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);
        }
Beispiel #2
0
 public static void SetExtensionVisibleInvisible <DAC>(PXCache cache, PXRowSelectedEventArgs e, bool isVisible, bool isGrid)
     where DAC : PXCacheExtension
 {
     foreach (string fieldName in DACHelper.GetFieldsName(typeof(DAC)))
     {
         PXUIFieldAttribute.SetVisible(cache, null, fieldName, isVisible);
     }
 }
Beispiel #3
0
        protected virtual void _(Events.RowSelected <APTran> e)
        {
            bool fsIntegrationEnabled = IsFSIntegrationEnabled();

            DACHelper.SetExtensionVisibleInvisible <FSxAPTran>(e.Cache, e.Args, fsIntegrationEnabled, false);

            if (e.Row == null)
            {
                return;
            }
        }
Beispiel #4
0
        protected virtual void ARTran_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            bool fsIntegrationEnabled = IsFSIntegrationEnabled();

            DACHelper.SetExtensionVisibleInvisible <FSxARTran>(cache, e, fsIntegrationEnabled, false);

            if (e.Row == null)
            {
                return;
            }
        }
        protected virtual void ARTran_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            ARInvoice    arInvoiceRow    = Base.Document.Current;
            FSxARInvoice fsxARInvoiceRow = Base.Document.Cache.GetExtension <FSxARInvoice>(arInvoiceRow);

            bool fsIntegrationEnabled = IsFSIntegrationEnabled(arInvoiceRow, fsxARInvoiceRow);

            DACHelper.SetExtensionVisibleInvisible <FSxARTran>(cache, e, fsIntegrationEnabled, false);

            if (e.Row == null)
            {
                return;
            }
        }
        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))));
            }
        }
Beispiel #7
0
        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)));
     }
 }