protected virtual void INItemClass_RowDeleting(PXCache sender, PXRowDeletingEventArgs e) { INSetup iNSetupRec = (INSetup)PXSelect <INSetup, Where <INSetup.dfltItemClassID, Equal <Current <INItemClass.itemClassID> > > > .SelectWindowed(this, 0, 1); if (iNSetupRec != null) { throw new PXException(Messages.ThisItemClassCanNotBeDeletedBecauseItIsUsedIn, "Inventory Setup"); } InventoryItem inventoryItemRec = (InventoryItem)PXSelect <InventoryItem, Where <InventoryItem.itemClassID, Equal <Current <INItemClass.itemClassID> > > > .SelectWindowed(this, 0, 1); if (inventoryItemRec != null) { throw new PXException(Messages.ThisItemClassCanNotBeDeletedBecauseItIsUsedIn, "Inventory Item: " + inventoryItemRec.InventoryCD); } INLocation iNLocationRec = (INLocation)PXSelect <INLocation, Where <INLocation.primaryItemClassID, Equal <Current <INItemClass.itemClassID> > > > .SelectWindowed(this, 0, 1); if (iNLocationRec != null) { INSite iNSiteRec = (INSite)PXSelect <INSite, Where <INSite.siteID, Equal <Required <INSite.siteID> > > > .Select(this, iNLocationRec.SiteID); throw new PXException(Messages.ThisItemClassCanNotBeDeletedBecauseItIsUsedIn, "Warehouse/Location: " + (iNSiteRec.SiteCD ?? "") + "/" + iNLocationRec.LocationCD); } }
public INReceiptEntry() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INTran.tranType>(transactions.Cache, null, false); PXUIFieldAttribute.SetEnabled <INTran.tranType>(transactions.Cache, null, false); }
protected virtual void INSetup_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } INSetup row = (INSetup)e.Row; bool weightEnabled = true; bool volumeEnabled = true; if (!String.IsNullOrEmpty(row.WeightUOM)) { InventoryItem itemWeight = PXSelect <InventoryItem, Where <InventoryItem.weightUOM, IsNotNull, And <InventoryItem.baseItemWeight, Greater <decimal0> > > > .SelectWindowed(this, 0, 1); weightEnabled = (itemWeight == null); } if (!String.IsNullOrEmpty(row.VolumeUOM)) { InventoryItem itemVolume = PXSelect <InventoryItem, Where <InventoryItem.volumeUOM, IsNotNull, And <InventoryItem.baseItemVolume, Greater <decimal0> > > > .SelectWindowed(this, 0, 1); volumeEnabled = (itemVolume == null); } PXUIFieldAttribute.SetEnabled <INSetup.weightUOM>(sender, row, weightEnabled); PXUIFieldAttribute.SetEnabled <INSetup.volumeUOM>(sender, row, volumeEnabled); }
public INUpdateStdCost() { INSetup record = insetup.Current; INItemList.SetProcessCaption(Messages.Process); INItemList.SetProcessAllCaption(Messages.ProcessAll); }
private void SetPeriods(UpdateMCAssignmentSettings settings) { INSetup insetup = INSetup.Current; PXCache cache = UpdateSettings.Cache; if (insetup != null && insetup.TurnoverPeriodsPerYear != null && insetup.TurnoverPeriodsPerYear != 0m && settings.PeriodNbr != null && settings.Year != null) { String periodString = (12 / insetup.TurnoverPeriodsPerYear * (settings.PeriodNbr - 1) + 1).ToString(); periodString = periodString.Length == 1 ? "0" + periodString : periodString; periodString = settings.Year + periodString; FinPeriod startPeriod = FinPeriodRepository.FindByID(FinPeriod.organizationID.MasterValue, periodString); if (startPeriod != null) { //cache.SetValueExt<UpdateMCAssignmentSettings.startFinPeriodID>(settings, startPeriod.FinPeriodID); settings.StartFinPeriodID = startPeriod.FinPeriodID; cache.SetValueExt <UpdateMCAssignmentSettings.startDate>(settings, startPeriod.StartDate); } periodString = (12 / insetup.TurnoverPeriodsPerYear * settings.PeriodNbr).ToString(); periodString = periodString.Length == 1 ? "0" + periodString : periodString; periodString = settings.Year + periodString; FinPeriod endPeriod = FinPeriodRepository.FindByID(FinPeriod.organizationID.MasterValue, periodString); if (endPeriod != null) { //cache.SetValueExt<UpdateMCAssignmentSettings.endFinPeriodID>(settings, endPeriod.FinPeriodID); settings.EndFinPeriodID = endPeriod.FinPeriodID; cache.SetValueExt <UpdateMCAssignmentSettings.endDate>(settings, endPeriod.EndDate); } } }
private void SetPeriods(UpdateMCAssignmentSettings settings) { INSetup insetup = INSetup.Current; PXCache cache = UpdateSettings.Cache; if (insetup != null && insetup.TurnoverPeriodsPerYear != null && insetup.TurnoverPeriodsPerYear != 0m && settings.PeriodNbr != null && settings.Year != null) { String periodString = (12 / insetup.TurnoverPeriodsPerYear * (settings.PeriodNbr - 1) + 1).ToString(); periodString = periodString.Length == 1 ? "0" + periodString : periodString; periodString = settings.Year + periodString; FinPeriod startPeriod = (FinPeriod)PXSelect <FinPeriod, Where <FinPeriod.finPeriodID, Equal <Required <FinPeriod.finPeriodID> > > > .Select(this, periodString); if (startPeriod != null) { //cache.SetValueExt<UpdateMCAssignmentSettings.startFinPeriodID>(settings, startPeriod.FinPeriodID); settings.StartFinPeriodID = startPeriod.FinPeriodID; cache.SetValueExt <UpdateMCAssignmentSettings.startDate>(settings, startPeriod.StartDate); } periodString = (12 / insetup.TurnoverPeriodsPerYear * settings.PeriodNbr).ToString(); periodString = periodString.Length == 1 ? "0" + periodString : periodString; periodString = settings.Year + periodString; FinPeriod endPeriod = (FinPeriod)PXSelect <FinPeriod, Where <FinPeriod.finPeriodID, Equal <Required <FinPeriod.finPeriodID> > > > .Select(this, periodString); if (endPeriod != null) { //cache.SetValueExt<UpdateMCAssignmentSettings.endFinPeriodID>(settings, endPeriod.FinPeriodID); settings.EndFinPeriodID = endPeriod.FinPeriodID; cache.SetValueExt <UpdateMCAssignmentSettings.endDate>(settings, endPeriod.EndDate); } } }
public INIssueEntry() { INSetup record = insetup.Current; PXStringListAttribute.SetList <INTran.tranType>(transactions.Cache, null, new INTranType.IssueListAttribute().AllowedValues, new INTranType.IssueListAttribute().AllowedLabels); //PXDimensionSelectorAttribute.SetValidCombo<INTran.subItemID>(transactions.Cache, true); //PXDimensionSelectorAttribute.SetValidCombo<INTranSplit.subItemID>(splits.Cache, true); }
public INAccess() { INSetup setup = INSetup.Current; Site.Cache.AllowDelete = false; Site.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled(Site.Cache, null, false); PXUIFieldAttribute.SetEnabled <INSite.included>(Site.Cache, null); }
public INPostClassMaint() { INSetup record = insetup.Select(); PXUIFieldAttribute.SetVisible <INPostClass.pPVAcctID>(postclass.Cache, null, true); PXUIFieldAttribute.SetVisible <INPostClass.pPVSubID>(postclass.Cache, null, true); PXUIFieldAttribute.SetVisible <INPostClass.pPVAcctDefault>(postclass.Cache, null, true); PXUIFieldAttribute.SetVisible <INPostClass.pPVSubMask>(postclass.Cache, null, true); }
public INIntegrityCheck() { INSetup record = insetup.Current; INItemList.SetProcessCaption(Messages.Process); INItemList.SetProcessAllCaption(Messages.ProcessAll); PXDBDefaultAttribute.SetDefaultForUpdate <INTranSplit.refNbr>(this.Caches[typeof(INTranSplit)], null, false); PXDBDefaultAttribute.SetDefaultForUpdate <INTranSplit.tranDate>(this.Caches[typeof(INTranSplit)], null, false); }
public INAdjustmentEntry() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INTran.tranType>(transactions.Cache, null, false); PXUIFieldAttribute.SetEnabled <INTran.tranType>(transactions.Cache, null, false); //PXDimensionSelectorAttribute.SetValidCombo<INTran.subItemID>(transactions.Cache, true); //PXDimensionSelectorAttribute.SetValidCombo<INTranSplit.subItemID>(splits.Cache, true); PXVerifySelectorAttribute.SetVerifyField <INTran.origRefNbr>(transactions.Cache, null, true); }
public INAccessDetail() { INSetup setup = INSetup.Current; Site.Cache.AllowDelete = false; Site.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled(Site.Cache, null, false); PXUIFieldAttribute.SetEnabled <INSite.siteCD>(Site.Cache, null); Views.Caches.Remove(typeof(PX.SM.RelationGroup)); Views.Caches.Add(typeof(PX.SM.RelationGroup)); }
public INTransferEntry() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INTran.tranType>(transactions.Cache, null, false); PXUIFieldAttribute.SetEnabled <INTran.tranType>(transactions.Cache, null, false); PXDimensionSelectorAttribute.SetValidCombo <INTran.subItemID>(transactions.Cache, true); PXDimensionSelectorAttribute.SetValidCombo <INTranSplit.subItemID>(splits.Cache, true); PXSelectorAttribute.SetColumns <INTran.subItemID>(transactions.Cache, new Type[] { typeof(INSubItem.subItemCD), typeof(INSiteStatus.qtyOnHand), typeof(INSiteStatus.active) }, null); PXSelectorAttribute.SetColumns <INTranSplit.subItemID>(splits.Cache, new Type[] { typeof(INSubItem.subItemCD), typeof(INSiteStatus.qtyOnHand), typeof(INSiteStatus.active) }, null); }
public INItemSiteMaint() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INUnit.toUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetEnabled <INUnit.toUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetVisible <INUnit.sampleToUnit>(itemunits.Cache, null, true); PXUIFieldAttribute.SetEnabled <INUnit.sampleToUnit>(itemunits.Cache, null, false); this.PreferredVendorItem.Cache.AllowUpdate = false; PXUIFieldAttribute.SetEnabled(this.PreferredVendorItem.Cache, null, false); }
public InventoryItemMaintBase() { INSetup record = insetup.Current; SOSetup soSetup = sosetup.Current; CommonSetup commonSetup = commonsetup.Current; PXUIFieldAttribute.SetVisible <INUnit.toUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetEnabled <INUnit.toUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetVisible <INUnit.sampleToUnit>(itemunits.Cache, null, true); PXUIFieldAttribute.SetEnabled <INUnit.sampleToUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetVisible <INUnit.priceAdjustmentMultiplier>(itemunits.Cache, null, soSetup?.UsePriceAdjustmentMultiplier == true); PXDBDefaultAttribute.SetDefaultForInsert <INItemXRef.inventoryID>(itemxrefrecords.Cache, null, true); }
protected virtual void UpdateMCAssignmentSettings_PeriodNbr_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e) { UpdateMCAssignmentSettings settings = (UpdateMCAssignmentSettings)e.Row; if (settings == null) { return; } INSetup insetup = INSetup.Current; if (((short)e.NewValue) > insetup.TurnoverPeriodsPerYear) { cache.RaiseExceptionHandling <UpdateMCAssignmentSettings.periodNbr>(settings, e.NewValue, new PXSetPropertyException(Messages.PeriofNbrCanNotBeGreaterThenInSetup)); } }
public INAccessItem() { INSetup setup = INSetup.Current; Class.Cache.AllowDelete = false; Class.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled(Class.Cache, null, false); PXUIFieldAttribute.SetEnabled <INItemClass.included>(Class.Cache, null); PXUIFieldAttribute.SetEnabled(Item.Cache, null, false); PXUIFieldAttribute.SetEnabled <InventoryItem.included>(Item.Cache, null); PXUIFieldAttribute.SetEnabled <InventoryItem.inventoryCD>(Item.Cache, null); PXDefaultAttribute.SetPersistingCheck <InventoryItem.valMethod>(Item.Cache, null, PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <InventoryItem.cOGSAcctID>(Item.Cache, null, PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <InventoryItem.cOGSSubID>(Item.Cache, null, PXPersistingCheck.Nothing); }
public INIssueEntry() { INSetup record = insetup.Current; PXStringListAttribute.SetList <INTran.tranType>(transactions.Cache, null, new INTranType.IssueListAttribute().AllowedValues, new INTranType.IssueListAttribute().AllowedLabels); //PXDimensionSelectorAttribute.SetValidCombo<INTran.subItemID>(transactions.Cache, true); //PXDimensionSelectorAttribute.SetValidCombo<INTranSplit.subItemID>(splits.Cache, true); this.FieldDefaulting.AddHandler <IN.Overrides.INDocumentRelease.SiteStatus.negAvailQty>((sender, e) => { if (!e.Cancel) { e.NewValue = true; } e.Cancel = true; }); }
public INItemSiteMaint() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INUnit.toUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetEnabled <INUnit.toUnit>(itemunits.Cache, null, false); PXUIFieldAttribute.SetVisible <INUnit.sampleToUnit>(itemunits.Cache, null, true); PXUIFieldAttribute.SetEnabled <INUnit.sampleToUnit>(itemunits.Cache, null, false); this.PreferredVendorItem.Cache.AllowUpdate = false; PXUIFieldAttribute.SetEnabled(this.PreferredVendorItem.Cache, null, false); bool enableSubItemReplenishment = PXAccess.FeatureInstalled <FeaturesSet.replenishment>() && PXAccess.FeatureInstalled <FeaturesSet.subItem>(); subitemrecords.AllowSelect = enableSubItemReplenishment; PXUIFieldAttribute.SetVisible <INItemSite.subItemOverride>(itemsiterecord.Cache, null, enableSubItemReplenishment); }
protected virtual void INSetup_RowPersisting(PXCache cache, PXRowPersistingEventArgs e) { INSetup row = (INSetup)e.Row; if (row == null) { return; } short newValue = (short)row.TurnoverPeriodsPerYear; if (newValue > 12 || newValue < 1 || (newValue != 0) && ((short)(12 / newValue)) * newValue != 12) { cache.RaiseExceptionHandling <INSetup.turnoverPeriodsPerYear>(row, newValue, new PXSetPropertyException(Messages.PossibleValuesAre)); } PXDefaultAttribute.SetPersistingCheck <INSetup.iNTransitAcctID>(cache, e.Row, PXAccess.FeatureInstalled <FeaturesSet.warehouse>() ? PXPersistingCheck.Null : PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <INSetup.iNTransitSubID>(cache, e.Row, PXAccess.FeatureInstalled <FeaturesSet.warehouse>() ? PXPersistingCheck.Null : PXPersistingCheck.Nothing); }
public INTransferEntry() { INSetup record = insetup.Current; PXUIFieldAttribute.SetVisible <INTran.tranType>(transactions.Cache, null, false); PXUIFieldAttribute.SetEnabled <INTran.tranType>(transactions.Cache, null, false); //PXDimensionSelectorAttribute.SetValidCombo<INTran.subItemID>(transactions.Cache, true); //PXDimensionSelectorAttribute.SetValidCombo<INTranSplit.subItemID>(splits.Cache, true); //PXSelectorAttribute.SetColumns<INTran.subItemID>(transactions.Cache, new Type[] { typeof(INSubItem.subItemCD), typeof(INSiteStatus.qtyOnHand), typeof(INSiteStatus.active) }, null); //PXSelectorAttribute.SetColumns<INTranSplit.subItemID>(splits.Cache, new Type[] { typeof(INSubItem.subItemCD), typeof(INSiteStatus.qtyOnHand), typeof(INSiteStatus.active) }, null); this.FieldDefaulting.AddHandler <IN.Overrides.INDocumentRelease.SiteStatus.negAvailQty>((sender, e) => { e.NewValue = true; e.Cancel = true; }); }
protected ContractProcessing(int? contractID) { if (contractID > 0) { this.graph = PXGraph.CreateInstance<ARInvoiceEntry>(); graph.FieldVerifying.AddHandler<ARInvoice.projectID>((PXCache sender, PXFieldVerifyingEventArgs e) => { e.Cancel = true; }); this.contract = PXSelect<Contract, Where<Contract.contractID, Equal<Required<Contract.contractID>>>>.Select(graph, contractID); this.insetup = PXSelect<INSetup>.Select(graph); this.template = PXSelect<Contract, Where<Contract.contractID, Equal<Required<Contract.contractID>>>>.Select(graph, contract.TemplateID); this.schedule = PXSelect<ContractBillingSchedule>.Search<ContractBillingSchedule.contractID>(graph, contract.ContractID); if (contract.CustomerID != null) { if (schedule != null && schedule.AccountID != null) { customer = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<ContractBillingSchedule.accountID>>>>.Select(graph, schedule.AccountID); if (schedule.LocationID != null) { location = PXSelect<Location, Where<Location.bAccountID, Equal<Required<ContractBillingSchedule.accountID>>, And<Location.locationID, Equal<Required<ContractBillingSchedule.locationID>>>>>.Select(graph, customer.BAccountID, schedule.LocationID); } else { location = PXSelect<Location, Where<Location.locationID, Equal<Required<Customer.defLocationID>>>>.Select(graph, customer.DefLocationID); } } else { customer = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(graph, contract.CustomerID); if (contract.LocationID != null) { location = PXSelect<Location, Where<Location.bAccountID, Equal<Required<ContractBillingSchedule.accountID>>, And<Location.locationID, Equal<Required<ContractBillingSchedule.locationID>>>>>.Select(graph, customer.BAccountID, contract.LocationID); } else { location = PXSelect<Location, Where<Location.locationID, Equal<Required<Customer.defLocationID>>>>.Select(graph, customer.DefLocationID); } } } SetupGraph(); } }
public INAccessDetailItem() { INSetup setup = INSetup.Current; Class.Cache.AllowDelete = false; Class.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled(Class.Cache, null, false); PXUIFieldAttribute.SetEnabled <INItemClass.itemClassCD>(Class.Cache, null); Item.Cache.AllowDelete = false; Item.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled(Item.Cache, null, false); PXUIFieldAttribute.SetEnabled <InventoryItem.inventoryCD>(Item.Cache, null); Views.Caches.Remove(typeof(PX.SM.RelationGroup)); Views.Caches.Add(typeof(PX.SM.RelationGroup)); PXDefaultAttribute.SetPersistingCheck <InventoryItem.valMethod>(Item.Cache, null, PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <InventoryItem.cOGSAcctID>(Item.Cache, null, PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <InventoryItem.cOGSSubID>(Item.Cache, null, PXPersistingCheck.Nothing); }
protected override IEnumerable periodList() { string fiscalYear = null; INSetup.Current = INSetup.Select(); if (INSetup.Current == null) { yield break; } foreach (FinPeriod per in PXSelect <FinPeriod, Where <FinPeriod.iNClosed, Equal <boolFalse> > > .Select(this)) { if (fiscalYear == null) { fiscalYear = per.FinYear; } if (per.FinYear == fiscalYear) { yield return(per); } } }
private void SetPeriods(UpdateMCAssignmentSettings settings) { INSetup insetup = INSetup.Current; PXCache cache = UpdateSettings.Cache; if (insetup != null && insetup.TurnoverPeriodsPerYear != null && insetup.TurnoverPeriodsPerYear != 0m && settings.PeriodNbr != null && settings.Year != null) { String periodString = (12 / insetup.TurnoverPeriodsPerYear * (settings.PeriodNbr - 1) + 1).ToString(); periodString = periodString.Length == 1 ? "0" + periodString : periodString; periodString = settings.Year + periodString; FinPeriod startPeriod = FinPeriodRepository.FindByID(FinPeriod.organizationID.MasterValue, periodString); if (startPeriod != null) { //cache.SetValueExt<UpdateMCAssignmentSettings.startFinPeriodID>(settings, startPeriod.FinPeriodID); settings.StartFinPeriodID = startPeriod.FinPeriodID; cache.SetValueExt <UpdateMCAssignmentSettings.startDate>(settings, startPeriod.StartDate); } periodString = (12 / insetup.TurnoverPeriodsPerYear * settings.PeriodNbr).ToString(); periodString = periodString.Length == 1 ? "0" + periodString : periodString; periodString = settings.Year + periodString; FinPeriod endPeriod = FinPeriodRepository.FindByID(FinPeriod.organizationID.MasterValue, periodString); if (endPeriod != null) { //cache.SetValueExt<UpdateMCAssignmentSettings.endFinPeriodID>(settings, endPeriod.FinPeriodID); settings.EndFinPeriodID = endPeriod.FinPeriodID; cache.SetValueExt <UpdateMCAssignmentSettings.endDate>(settings, endPeriod.EndDate); const int NumberOfMonthsToCalcAvailableQuantity = 12; var startDateForAvailableQuantity = endPeriod.EndDate.HasValue ? (DateTime?)endPeriod.EndDate.Value.AddMonths(-NumberOfMonthsToCalcAvailableQuantity) : null; cache.SetValueExt <UpdateMCAssignmentSettings.startDateForAvailableQuantity>(settings, startDateForAvailableQuantity); } } }
public INSiteMaint() { INSetup record = insetup.Current; PXDBDefaultAttribute.SetDefaultForInsert <INLocation.siteID>(location.Cache, null, true); PXDBDefaultAttribute.SetDefaultForUpdate <INLocation.siteID>(location.Cache, null, true); PXUIFieldAttribute.SetVisible <INSite.pPVAcctID>(siteaccounts.Cache, null, true); PXUIFieldAttribute.SetVisible <INSite.pPVSubID>(siteaccounts.Cache, null, true); PXUIFieldAttribute.SetVisible <INSite.discAcctID>(siteaccounts.Cache, null, false); PXUIFieldAttribute.SetVisible <INSite.discSubID>(siteaccounts.Cache, null, false); PXUIFieldAttribute.SetVisible <INSite.freightAcctID>(siteaccounts.Cache, null, false); PXUIFieldAttribute.SetVisible <INSite.freightSubID>(siteaccounts.Cache, null, false); PXUIFieldAttribute.SetVisible <INSite.miscAcctID>(siteaccounts.Cache, null, false); PXUIFieldAttribute.SetVisible <INSite.miscSubID>(siteaccounts.Cache, null, false); PXUIFieldAttribute.SetDisplayName(Caches[typeof(Contact)], typeof(Contact.salutation).Name, CR.Messages.Attention); PXUIFieldAttribute.SetEnabled <Contact.fullName>(Caches[typeof(Contact)], null); }