public static IInvoiceContractGraph GetInvoiceGraph(FSSetup fsSetupRow) { if (fsSetupRow.ContractPostTo == ID.Batch_PostTo.SO) { if (PXAccess.FeatureInstalled <FeaturesSet.distributionModule>()) { return(PXGraph.CreateInstance <SOOrderEntry>().GetExtension <SM_SOOrderEntry>()); } else { throw new PXException(TX.Error.DISTRIBUTION_MODULE_IS_DISABLED); } } else if (fsSetupRow.ContractPostTo == ID.Batch_PostTo.AR) { return(PXGraph.CreateInstance <ARInvoiceEntry>().GetExtension <SM_ARInvoiceEntry>()); } else if (fsSetupRow.ContractPostTo == ID.Batch_PostTo.SI) { throw new PXSetPropertyException(TX.Error.SOINVOICE_FROM_CONTRACT_NOT_IMPLEMENTED_CHANGE_IN_X_OR_Y, PXErrorLevel.Error, DACHelper.GetDisplayName(typeof(FSEquipmentSetup)), DACHelper.GetDisplayName(typeof(FSRouteSetup))); } return(null); }
protected virtual void _(Events.RowPersisting <FSLicense> e) { if (e.Row == null) { return; } FSLicense fsLicenseRow = (FSLicense)e.Row; FSSetup fsSetupRow = SetupRecord.Select(); if (string.IsNullOrEmpty(fsSetupRow.LicenseNumberingID)) { LicenseRecords.Cache.RaiseExceptionHandling <FSLicense.refNbr>( fsLicenseRow, fsLicenseRow.RefNbr, new PXSetPropertyException(TX.Error.SPECIFY_LICENSE_NUMBERINGID_IN_X, PXErrorLevel.Error, DACHelper.GetDisplayName(typeof(FSSetup)))); } }
public RouteSetupMaint() : base() { FSSetup setup = PXSelectReadonly <FSSetup> .Select(this); if (setup == null) { throw new PXSetupNotEnteredException(ErrorMessages.SetupNotEntered, typeof(FSSetup), DACHelper.GetDisplayName(typeof(FSSetup))); } }
public VehicleMaint() : base() { if (SetupRecord.Current == null || SetupRecord.Current.EquipmentNumberingID == null) { throw new PXSetupNotEnteredException(TX.Error.EQUIPMENT_NUMBERING_SEQUENCE_MISSING_IN_X, typeof(FSEquipmentSetup), DACHelper.GetDisplayName(typeof(FSEquipmentSetup))); } }