protected virtual void Currency_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            Currency row = e.Row as Currency;

            if (row == null)
            {
                return;
            }
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingGainAcctID>(sender, row, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingGainSubID>(sender, row, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingLossAcctID>(sender, row, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingLossSubID>(sender, row, PXPersistingCheck.Nothing);
        }
        public ReclassificationHistoryInq()
        {
            TransView.AllowDelete = false;
            TransView.AllowInsert = false;
            TransView.AllowUpdate = false;

            PXUIFieldAttribute.SetVisible <GLTran.batchNbr>(TransView.Cache, null);

            //to hide the red asterisk on column header
            PXDefaultAttribute.SetPersistingCheck <GLTran.branchID>(TransView.Cache, null, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <GLTran.accountID>(TransView.Cache, null, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <GLTran.subID>(TransView.Cache, null, PXPersistingCheck.Nothing);
        }
        protected virtual void POSetup_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            var row = (POSetup)e.Row;

            if (row == null)
            {
                return;
            }

            PXDefaultAttribute.SetPersistingCheck <POSetup.pPVReasonCodeID>(sender, row, (row.PPVAllocationMode == PPVMode.Inventory) ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);

            PXDefaultAttribute.SetPersistingCheck <POSetup.rCReturnReasonCodeID>(sender, row, PXAccess.FeatureInstalled <FeaturesSet.inventory>() ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
        protected virtual void PaymentTypeInstanceDetail_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
        {
            var row = (PaymentTypeInstanceDetail)e.Row;

            if (row == null)
            {
                return;
            }

            PaymentMethodDetail iTempl = this.FindTemplate(row);

            PXDefaultAttribute.SetPersistingCheck <PaymentTypeInstanceDetail.value>(cache, row, iTempl?.IsRequired == true ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
        protected virtual void INTran_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            if ((e.Operation & PXDBOperation.Command) == PXDBOperation.Insert || (e.Operation & PXDBOperation.Command) == PXDBOperation.Update)
            {
                INRegister parent = (INRegister)PXParentAttribute.SelectParent(sender, e.Row);

                if (parent != null)
                {
                    PXDefaultAttribute.SetPersistingCheck <INTran.toLocationID>(sender, e.Row, parent.TransferType == INTransferType.OneStep ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
                    ((INTran)e.Row).ToSiteID = parent.ToSiteID;
                }
            }
        }
Beispiel #6
0
        protected virtual void INTran_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            if (e.Operation.Command() == PXDBOperation.Delete)
            {
                return;
            }

            INTran row = (INTran)e.Row;

            InventoryItem item      = (InventoryItem)PXSelectorAttribute.Select <INTran.inventoryID>(sender, row);
            INLotSerClass itemclass =
                (INLotSerClass)PXSelectorAttribute.Select <InventoryItem.lotSerClassID>(this.Caches[typeof(InventoryItem)], item);

            PXPersistingCheck check =
                ((INTran)e.Row).InvtMult != 0 && (
                    (item != null && item.ValMethod == INValMethod.Specific) ||
                    (itemclass != null &&
                     itemclass.LotSerTrack != INLotSerTrack.NotNumbered &&
                     itemclass.LotSerAssign == INLotSerAssign.WhenReceived &&
                     ((INTran)e.Row).Qty != 0m))
                                 ? PXPersistingCheck.NullOrBlank
                                 : PXPersistingCheck.Nothing;


            PXDefaultAttribute.SetPersistingCheck <INTran.subID>(sender, e.Row, PXPersistingCheck.Null);
            PXDefaultAttribute.SetPersistingCheck <INTran.locationID>(sender, e.Row, PXPersistingCheck.Null);
            PXDefaultAttribute.SetPersistingCheck <INTran.lotSerialNbr>(sender, e.Row, check);

            if (adjustment.Current != null && adjustment.Current.OrigModule != INRegister.origModule.PI && item != null && item.ValMethod == INValMethod.FIFO && ((INTran)e.Row).OrigRefNbr == null)
            {
                bool dropShipPO = false;
                if (row != null && row.POReceiptNbr != null && row.POReceiptLineNbr != null)
                {
                    PO.POReceiptLine pOReceiptLine = PXSelect <PO.POReceiptLine, Where <PO.POReceiptLine.receiptNbr, Equal <Required <PO.POReceiptLine.receiptNbr> >, And <PO.POReceiptLine.lineNbr, Equal <Required <PO.POReceiptLine.lineNbr> > > > > .Select(this, row.POReceiptNbr, row.POReceiptLineNbr);

                    dropShipPO = pOReceiptLine != null && (pOReceiptLine.LineType == PO.POLineType.GoodsForDropShip || pOReceiptLine.LineType == PO.POLineType.NonStockForDropShip);
                }
                if (!dropShipPO && sender.RaiseExceptionHandling <INTran.origRefNbr>(e.Row, null, new PXSetPropertyException(ErrorMessages.FieldIsEmpty, typeof(INTran.origRefNbr).Name)))
                {
                    throw new PXRowPersistingException(typeof(INTran.origRefNbr).Name, null, ErrorMessages.FieldIsEmpty, typeof(INTran.origRefNbr).Name);
                }
            }

            if (item != null && item.ValMethod == INValMethod.Standard && row.TranType == INTranType.Adjustment && row.InvtMult != 0 && row.BaseQty == 0m && row.TranCost != 0m)
            {
                if (sender.RaiseExceptionHandling <INTran.tranCost>(e.Row, row.TranCost, new PXSetPropertyException(Messages.StandardCostNoCostOnlyAdjust)))
                {
                    throw new PXRowPersistingException(typeof(INTran.tranCost).Name, row.TranCost, Messages.StandardCostNoCostOnlyAdjust);
                }
            }
        }
        /// <summary>The RowSelected event handler for the <see cref="Discount" /> mapped cache extension.</summary>
        /// <param name="e">Parameters of the event.</param>
        protected virtual void _(Events.RowSelected <Discount> e)
        {
            if (e.Row != null)
            {
                PXUIFieldAttribute.SetEnabled <Discount.skipDiscount>(Discounts.Cache, e.Row, e.Row.DiscountID != null);
            }

            PXDefaultAttribute.SetPersistingCheck <Discount.discountID>(Discounts.Cache, e.Row, PXPersistingCheck.Nothing);

            if (Documents.Current != null)
            {
                Documents.Cache.SetValueExt <Document.curyDocDisc>(Documents.Current, DiscountEngine.GetTotalGroupAndDocumentDiscount(Discounts, true));
            }
        }
Beispiel #8
0
        protected virtual void CreateBatchSettings_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            CreateBatchSettings row = (CreateBatchSettings)e.Row;

            if (row == null)
            {
                return;
            }
            Numbering numbering        = Numbering.Select();
            bool      isManualNumberig = numbering != null && numbering.UserNumbering == true;

            PXUIFieldAttribute.SetVisible <CreateBatchSettings.voucherBatchNbr>(BatchCreation.Cache, row, isManualNumberig);
            PXDefaultAttribute.SetPersistingCheck <CreateBatchSettings.voucherBatchNbr>(BatchCreation.Cache, row, isManualNumberig ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
        public void RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            var isAssignableDay = (bool?)sender.GetValue(e.Row, DayAssignableType.Name) == true;

            PXUIFieldAttribute.SetEnabled(sender, e.Row, this.FieldName, isAssignableDay);
            PXDefaultAttribute.SetPersistingCheck(sender, this.FieldName, e.Row, isAssignableDay
                                                                                    ? PXPersistingCheck.NullOrBlank
                                                                                    : PXPersistingCheck.Nothing);
        }
        protected virtual void PaymentTypeInstance_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            PaymentTypeInstance row = (PaymentTypeInstance)e.Row;

            if (row != null)
            {
                if (row.BAccountID != null)
                {
                    this.bAccountID = row.BAccountID;
                }

                PXUIFieldAttribute.SetEnabled <PaymentTypeInstance.descr>(cache, row, false);

                if (!String.IsNullOrEmpty(row.PaymentMethodID))
                {
                    PaymentMethod pmDef = (PaymentMethod)this.PaymentTypeDef.Select();

                    //bool singleInstance = pmDef.ARIsOnePerCustomer ?? false;
                    bool singleInstance = false;
                    bool isIDMaskExists = false;
                    if (!singleInstance)
                    {
                        foreach (PaymentMethodDetail iDef in this.PMDetails.Select(row.PaymentMethodID))
                        {
                            if ((iDef.IsIdentifier ?? false) && (!string.IsNullOrEmpty(iDef.DisplayMask)))
                            {
                                isIDMaskExists = true;
                                break;
                            }
                        }
                    }
                    if (!(isIDMaskExists || singleInstance))
                    {
                        PXUIFieldAttribute.SetEnabled <PaymentTypeInstance.descr>(cache, row, true);
                    }
                    PXDefaultAttribute.SetPersistingCheck <PaymentTypeInstance.descr>(cache, row, (isIDMaskExists ? PXPersistingCheck.Nothing : PXPersistingCheck.NullOrBlank));
                }

                bool isInserted = (cache.GetStatus(e.Row) == PXEntryStatus.Inserted);
                PXUIFieldAttribute.SetEnabled <PaymentTypeInstance.paymentMethodID>(cache, row, (isInserted || String.IsNullOrEmpty(row.PaymentMethodID)));
                if (!isInserted && (!String.IsNullOrEmpty(row.PaymentMethodID)))
                {
                    this.MergeDetailsWithDefinition(row.PaymentMethodID);
                }
                if (!isInserted)
                {
                    this.PaymentTypeInstance.Cache.AllowDelete = !this.HasTransactions(row);
                }
            }
        }
        protected void Users_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            Users user = (Users)e.Row;

            if (user == null)
            {
                return;
            }

            bool isNotFromAD = user.Source != PXUsersSourceListAttribute.ActiveDirectory;

            PXDefaultAttribute.SetPersistingCheck <Users.password>(sender, user, isNotFromAD ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Users.email>(sender, user, isNotFromAD ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);
        }
Beispiel #12
0
        protected virtual void _(Events.RowSelected <FSLicense> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSLicense fsLicenseRow = (FSLicense)e.Row;

            EnableDisableLicenseFields(e.Cache, fsLicenseRow, fsLicenseRow.LicenseTypeID != null);

            PXDefaultAttribute.SetPersistingCheck <FSLicense.expirationDate>(e.Cache, fsLicenseRow, fsLicenseRow.NeverExpires != null &&
                                                                             fsLicenseRow.NeverExpires == true ? PXPersistingCheck.Nothing : PXPersistingCheck.NullOrBlank);
        }
        protected virtual void INItemClassRep_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            INItemClassRep row = (INItemClassRep)e.Row;

            if (row != null)
            {
                bool isTransfer     = (row.ReplenishmentSource == INReplenishmentSource.Transfer);
                bool isFixedReorder = (row.ReplenishmentMethod == INReplenishmentMethod.FixedReorder);
                PXUIFieldAttribute.SetEnabled <INItemClassRep.transferLeadTime>(sender, e.Row, isTransfer);
                PXUIFieldAttribute.SetEnabled <INItemClassRep.transferERQ>(sender, e.Row, isTransfer && isFixedReorder);
                PXDefaultAttribute.SetPersistingCheck <INItemClassRep.transferLeadTime>(sender, e.Row, isTransfer ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <INItemClassRep.transferERQ>(sender, e.Row, (isTransfer && isFixedReorder) ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);
            }
        }
        protected virtual void INSite_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            INAcctSubDefault.Required(sender, e);
            if (e.Operation.Command().IsIn(PXDBOperation.Insert, PXDBOperation.Update))
            {
                var site = (INSite)e.Row;
                if (site.OverrideInvtAccSub != true)
                {
                    PXDefaultAttribute.SetPersistingCheck <INSite.invtAcctID>(sender, e.Row, PXPersistingCheck.Nothing);
                    PXDefaultAttribute.SetPersistingCheck <INSite.invtSubID>(sender, e.Row, PXPersistingCheck.Nothing);
                }
                if (site.ReceiptLocationIDOverride == true || site.ShipLocationIDOverride == true)
                {
                    List <PXDataFieldParam> prm = new List <PXDataFieldParam>();
                    if (site.ReceiptLocationIDOverride == true)
                    {
                        prm.Add(new PXDataFieldAssign(typeof(INItemSite.dfltReceiptLocationID).Name, PXDbType.Int, site.ReceiptLocationID));
                    }
                    if (site.ShipLocationIDOverride == true)
                    {
                        prm.Add(new PXDataFieldAssign(typeof(INItemSite.dfltShipLocationID).Name, PXDbType.Int, site.ShipLocationID));
                    }
                    prm.Add(new PXDataFieldRestrict(typeof(INItemSite.siteID).Name, PXDbType.Int, site.SiteID));
                    PXDatabase.Update <INItemSite>(prm.ToArray());
                }

                if (site.Active != true)
                {
                    bool cantDeactivateSite = (INRegister)
                                              PXSelect <INRegister,
                                                        Where <INRegister.released, NotEqual <True>,
                                                               And <Where <INRegister.siteID, Equal <Current <INSite.siteID> >,
                                                                           Or <INRegister.toSiteID, Equal <Current <INSite.siteID> > > > > > >
                                              .SelectSingleBound(this, new [] { e.Row }) != null;

                    cantDeactivateSite = cantDeactivateSite || (INTran)
                                         PXSelect <INTran,
                                                   Where <INTran.released, NotEqual <True>,
                                                          And <Where <INTran.siteID, Equal <Current <INSite.siteID> >,
                                                                      Or <INTran.toSiteID, Equal <Current <INSite.siteID> > > > > > >
                                         .SelectSingleBound(this, new [] { e.Row }) != null;

                    if (cantDeactivateSite)
                    {
                        sender.RaiseExceptionHandling <INSite.active>(e.Row, null, new PXSetPropertyException(Messages.CantDeactivateSite));
                    }
                }
            }
        }
Beispiel #15
0
        public override void RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            base.RowSelected(sender, e);

            if (e.Row == null)
            {
                return;
            }

            bool display = ToDisplay(e.Row);

            PXUIFieldAttribute.SetVisible(sender, e.Row, _FieldName, display);
            PXUIFieldAttribute.SetVisibility(sender, e.Row, _FieldName, display ? PXUIVisibility.Visible : PXUIVisibility.Invisible);
            PXDefaultAttribute.SetPersistingCheck(sender, _FieldName, e.Row, display ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
        public static void SetEnabledAndPersistingCheck <Field>(PXCache cache, object row,
                                                                EventType eventType,
                                                                bool isEnabled, PXPersistingCheck?persistingCheck)
            where Field : class, IBqlField
        {
            if (eventType == EventType.RowSelectedEvent)
            {
                PXUIFieldAttribute.SetEnabled <Field>(cache, row, isEnabled);
            }

            if (persistingCheck != null)
            {
                PXDefaultAttribute.SetPersistingCheck <Field>(cache, row, (PXPersistingCheck)persistingCheck);
            }
        }
Beispiel #17
0
        public static void EnableDisable_Document(PXCache cache, FSSetup fsSetupRow)
        {
            bool isDistributionModuleInstalled = PXAccess.FeatureInstalled <FeaturesSet.distributionModule>();

            PXUIFieldAttribute.SetVisible <FSSetup.contractPostOrderType>(cache, fsSetupRow, isDistributionModuleInstalled && fsSetupRow.ContractPostTo == ID.SrvOrdType_PostTo.SALES_ORDER_MODULE);

            if (fsSetupRow.ContractPostTo == ID.SrvOrdType_PostTo.SALES_ORDER_MODULE)
            {
                PXDefaultAttribute.SetPersistingCheck <FSSetup.contractPostOrderType>(cache, fsSetupRow, PXPersistingCheck.NullOrBlank);
            }
            else
            {
                PXDefaultAttribute.SetPersistingCheck <FSSetup.contractPostOrderType>(cache, fsSetupRow, PXPersistingCheck.Nothing);
            }
        }
        private void EnableDisableCustomerBilling(PXCache cache, Customer customerRow, FSxCustomer fsxCustomerRow)
        {
            bool isSpecificCustomer = fsxCustomerRow.DefaultBillingCustomerSource == ID.Default_Billing_Customer_Source.SPECIFIC_CUSTOMER;

            PXUIFieldAttribute.SetVisible <FSxCustomer.billCustomerID>(cache, customerRow, isSpecificCustomer);
            PXUIFieldAttribute.SetVisible <FSxCustomer.billLocationID>(cache, customerRow, isSpecificCustomer);
            PXDefaultAttribute.SetPersistingCheck <FSxCustomer.billCustomerID>(cache, customerRow, isSpecificCustomer == true ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <FSxCustomer.billLocationID>(cache, customerRow, isSpecificCustomer == true ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);

            if (isSpecificCustomer == false)
            {
                fsxCustomerRow.BillCustomerID = null;
                fsxCustomerRow.BillLocationID = null;
            }
        }
        public virtual void FSSrvOrdType_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSSrvOrdType fsSrvOrdTypeRow = (FSSrvOrdType)e.Row;

            EnableDisableFields(cache, fsSrvOrdTypeRow);
            EnableDisable_Behavior(cache, fsSrvOrdTypeRow);

            AppointmentDateTimeHelper.EnableDisable_RequireServiceActualDateTimes(cache, fsSrvOrdTypeRow);
            PXDefaultAttribute.SetPersistingCheck <FSSrvOrdType.allocationOrderType>(cache, fsSrvOrdTypeRow, fsSrvOrdTypeRow.PostTo == ID.SrvOrdType_PostTo.SALES_ORDER_MODULE ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
Beispiel #20
0
        private void DisplayBillingOptions(PXCache cache, CustomerClass customerClassRow, FSxCustomerClass fsxCustomerClassRow)
        {
            FSSetup fsSetupRow = PXSelect <FSSetup> .Select(Base);

            bool enableMultipleServicesBilling = fsSetupRow != null ? fsSetupRow.CustomerMultipleBillingOptions == true : false;

            PXUIFieldAttribute.SetVisible <FSxCustomerClass.dfltBillingCycleID>(cache, customerClassRow, !enableMultipleServicesBilling);
            PXUIFieldAttribute.SetVisible <FSxCustomerClass.sendInvoicesTo>(cache, customerClassRow, !enableMultipleServicesBilling);
            PXUIFieldAttribute.SetVisible <FSxCustomerClass.billShipmentSource>(cache, customerClassRow, !enableMultipleServicesBilling);

            BillingCycles.AllowSelect = enableMultipleServicesBilling;

            if (fsxCustomerClassRow != null)
            {
                FSBillingCycle fsBillingCycleRow = PXSelect <FSBillingCycle,
                                                             Where <
                                                                 FSBillingCycle.billingCycleID, Equal <Required <FSBillingCycle.billingCycleID> > > >
                                                   .Select(Base, fsxCustomerClassRow.DfltBillingCycleID);

                bool forbidUpdateBillingOptions = SharedFunctions.IsNotAllowedBillingOptionsModification(fsBillingCycleRow);

                PXUIFieldAttribute.SetEnabled <FSxCustomerClass.sendInvoicesTo>(
                    cache,
                    customerClassRow,
                    forbidUpdateBillingOptions == false);

                PXUIFieldAttribute.SetEnabled <FSxCustomerClass.billShipmentSource>(
                    cache,
                    customerClassRow,
                    forbidUpdateBillingOptions == false);

                PXUIFieldAttribute.SetEnabled <FSxCustomerClass.dfltBillingCycleID>(
                    cache,
                    customerClassRow);

                if (fsxCustomerClassRow.DfltBillingCycleID != null &&
                    forbidUpdateBillingOptions == false)
                {
                    PXDefaultAttribute.SetPersistingCheck <FSxCustomerClass.sendInvoicesTo>(cache, customerClassRow, PXPersistingCheck.NullOrBlank);
                    PXDefaultAttribute.SetPersistingCheck <FSxCustomerClass.billShipmentSource>(cache, customerClassRow, PXPersistingCheck.NullOrBlank);
                }
                else
                {
                    PXDefaultAttribute.SetPersistingCheck <FSxCustomerClass.sendInvoicesTo>(cache, customerClassRow, PXPersistingCheck.Nothing);
                    PXDefaultAttribute.SetPersistingCheck <FSxCustomerClass.billShipmentSource>(cache, customerClassRow, PXPersistingCheck.Nothing);
                }
            }
        }
Beispiel #21
0
        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);
        }
Beispiel #22
0
        protected override void Users_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            Users user = (Users)e.Row;

            if (user == null)
            {
                return;
            }

            base.Users_RowSelected(sender, e);

            AllowedRoles.Cache.AllowInsert = false;
            PXDefaultAttribute.SetPersistingCheck <Users.contactID>(sender, user, (user.Guest == true && !Common.Anonymous.IsAnonymous(user.Username)) ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);

            PXUIFieldAttribute.SetWarning <Users.overrideADRoles>(sender, user, user.OverrideADRoles == true ? Messages.IgnoredADRoles : null);
        }
Beispiel #23
0
        protected virtual void _(Events.RowSelected <FSBranchLocation> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSBranchLocation fsBranchLocationRow = (FSBranchLocation)e.Row;
            PXCache          cache = e.Cache;

            EnableDisable_ActionButtons(cache, fsBranchLocationRow);

            PXDefaultAttribute.SetPersistingCheck <FSBranchLocation.dfltSiteID>(cache,
                                                                                fsBranchLocationRow,
                                                                                GetPersistingCheckValueForDfltSiteID(PXAccess.FeatureInstalled <FeaturesSet.warehouse>() || PXAccess.FeatureInstalled <FeaturesSet.warehouseLocation>()));
        }
Beispiel #24
0
        protected virtual void _(Events.RowSelected <SurveyFilter> e)
        {
            var row = e.Row;

            if (row == null)
            {
                return;
            }
            var action   = row.Action;
            var doExpire = (action == SurveyAction.ExpireOnly);

            PXUIFieldAttribute.SetEnabled <SurveyFilter.durationTimeSpan>(e.Cache, row, doExpire);
            PXUIFieldAttribute.SetRequired <SurveyFilter.durationTimeSpan>(e.Cache, doExpire);
            PXDefaultAttribute.SetPersistingCheck <SurveyFilter.durationTimeSpan>(e.Cache, null, doExpire ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            Documents.SetProcessDelegate(list => ProcessSurvey(list, row));
        }
        protected virtual void Currency_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            var row = e.Row as Currency;

            if (row == null)
            {
                return;
            }

            bool roundingRequired = PXAccess.FeatureInstalled <FeaturesSet.multicurrency>() || PXAccess.FeatureInstalled <FeaturesSet.invoiceRounding>();

            PXDefaultAttribute.SetPersistingCheck <Currency.roundingGainAcctID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingGainSubID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingLossAcctID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingLossSubID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
        private void SetControlsState(PXCache cache, Schedule s)
        {
            Boolean isMonthly      = (s.ScheduleType == "M");
            Boolean isPeriodically = (s.ScheduleType == "P");
            Boolean isWeekly       = (s.ScheduleType == "W");
            Boolean isDaily        = (s.ScheduleType == "D");
            Boolean isNotProcessed = (s.LastRunDate == null);
            bool    isActive       = (s.Active ?? false);

            if (isActive)
            {
                RunNow.SetEnabled(true);
            }
            else
            {
                RunNow.SetEnabled(false);
            }

            PXUIFieldAttribute.SetVisible <Schedule.dailyFrequency>(cache, s, isDaily);
            PXUIFieldAttribute.SetVisible <Schedule.days>(cache, s, isDaily);
            SetMonthlyControlsState(cache, s);

            PXUIFieldAttribute.SetVisible <Schedule.weeklyFrequency>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay1>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay2>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay3>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay4>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay5>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay6>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeklyOnDay7>(cache, s, isWeekly);
            PXUIFieldAttribute.SetVisible <Schedule.weeks>(cache, s, isWeekly);

            PXUIFieldAttribute.SetVisible <Schedule.monthlyFrequency>(cache, s, isMonthly);
            PXUIFieldAttribute.SetVisible <Schedule.monthlyDaySel>(cache, s, isMonthly);

            PXUIFieldAttribute.SetVisible <Schedule.periodFrequency>(cache, s, isPeriodically);
            PXUIFieldAttribute.SetVisible <Schedule.periodDateSel>(cache, s, isPeriodically);
            PXUIFieldAttribute.SetVisible <Schedule.periodFixedDay>(cache, s, isPeriodically);
            PXUIFieldAttribute.SetVisible <Schedule.periods>(cache, s, isPeriodically);
            SetPeriodicallyControlsState(cache, s);

            PXUIFieldAttribute.SetEnabled <Schedule.endDate>(cache, s, !(bool)s.NoEndDate);
            PXUIFieldAttribute.SetEnabled <Schedule.runLimit>(cache, s, !(bool)s.NoRunLimit);
            PXDefaultAttribute.SetPersistingCheck <Schedule.endDate>(cache, s, (s.NoEndDate == true ? PXPersistingCheck.Nothing : PXPersistingCheck.Null));

            cache.AllowDelete = isNotProcessed;
        }
Beispiel #27
0
 private void ApplyBaseTypeFiltering()
 {
     if (IsSubcontractScreen())
     {
         Base.SetupApproval
         .WhereAnd <Where <POSetupApproval.orderType, Equal <POOrderType.regularSubcontract> > >();
         Filter.Current.Graph = typeof(SubcontractEntry).FullName;
     }
     else
     {
         Base.SetupApproval
         .WhereAnd <Where <POSetupApproval.orderType, NotEqual <POOrderType.regularSubcontract> > >();
         PXDefaultAttribute.SetPersistingCheck <PoSetupExt.subcontractNumberingID>(
             Base.Setup.Cache, null, PXPersistingCheck.Nothing);
         Filter.Current.Graph = typeof(POOrderEntry).FullName;
     }
 }
Beispiel #28
0
        protected virtual void Currency_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            Currency row = e.Row as Currency;

            if (row == null)
            {
                return;
            }
            PXUIFieldAttribute.SetVisible <Currency.curyID>(sender, row, PXAccess.FeatureInstalled <FeaturesSet.netGrossEntryMode>() || PXAccess.FeatureInstalled <FeaturesSet.invoiceRounding>());

            bool roundingRequired = PXAccess.FeatureInstalled <FeaturesSet.multicurrency>() || PXAccess.FeatureInstalled <FeaturesSet.invoiceRounding>();

            PXDefaultAttribute.SetPersistingCheck <Currency.roundingGainAcctID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingGainSubID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingLossAcctID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Currency.roundingLossSubID>(sender, row, roundingRequired ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
        }
        public ReclassificationHistoryInq()
        {
            TransView.AllowDelete = false;
            TransView.AllowInsert = false;
            TransView.AllowUpdate = true;

            PXUIFieldAttribute.SetVisible <GLTranReclHist.batchNbr>(TransView.Cache, null);

            //to hide the red asterisk on column header
            PXDefaultAttribute.SetPersistingCheck <GLTranReclHist.branchID>(TransView.Cache, null, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <GLTranReclHist.accountID>(TransView.Cache, null, PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <GLTranReclHist.subID>(TransView.Cache, null, PXPersistingCheck.Nothing);

            var srcTranKey = SrcTranOfReclassKey();

            if (srcTranKey == null)
            {
                return;
            }

            var srcTran = (GLTranReclHist)PXSelect <GLTranReclHist,
                                                    Where <GLTranReclHist.module, Equal <Required <GLTran.module> >,
                                                           And <GLTranReclHist.batchNbr, Equal <Required <GLTran.batchNbr> >,
                                                                And <GLTranReclHist.lineNbr, Equal <Required <GLTran.lineNbr> > > > > >
                          .Select(this,
                                  srcTranKey.Module,
                                  srcTranKey.BatchNbr,
                                  srcTranKey.LineNbr);

            TransView.Cache.SetStatus(srcTran, PXEntryStatus.Updated);

            var hasSplittedTrans = PXSelectReadonly <GLTranReclHist,
                                                     Where <GLTranReclHist.reclassSourceTranModule, Equal <Required <GLTranReclHist.module> >,
                                                            And <GLTranReclHist.reclassSourceTranBatchNbr, Equal <Required <GLTranReclHist.batchNbr> >,
                                                                 And <GLTranReclHist.reclassSourceTranLineNbr, Equal <Required <GLTranReclHist.lineNbr> > > > >, OrderBy <Asc <GLTranReclHist.reclassSeqNbr> > >
                                   .Select(this, srcTran.Module, srcTran.BatchNbr, srcTran.LineNbr).RowCast <GLTranReclHist>().Any(m => m.ReclassType == ReclassType.Split);

            reclassifyAll.SetEnabled(hasSplittedTrans);
            reclassifyAll.SetVisible(hasSplittedTrans);
            reclassificationHistory.SetEnabled(hasSplittedTrans);
            reclassificationHistory.SetVisible(hasSplittedTrans);
            PXUIFieldAttribute.SetVisible <GLTranReclHist.selected>(TransView.Cache, null, hasSplittedTrans);
            PXUIFieldAttribute.SetVisible <GLTranReclHist.origBatchNbr>(TransView.Cache, null, hasSplittedTrans);
            PXUIFieldAttribute.SetVisible <GLTranReclHist.actionDesc>(TransView.Cache, null, hasSplittedTrans);
        }
        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);
        }