protected virtual void INItemCategory_RowInserted(PXCache cache, PXRowInsertedEventArgs e)
        {
            INItemCategory row = e.Row as INItemCategory;

            if (row != null)
            {
                PXDefaultAttribute.SetDefault <INItemCategory.categorySelected>(cache, row, false);
            }
        }
Example #2
0
        public ARDunningLetterPrint()
        {
            ARSetup setup = ARSetup.Current;

            Consolidated = setup.ConsolidatedDunningLetter.GetValueOrDefault(false);
            if (setup.AutoReleaseDunningLetter == true)
            {
                PXDefaultAttribute.SetDefault <PrintParameters.action>(Filter.Cache, ActionTypes.Print);
                PXUIFieldAttribute.SetEnabled <PrintParameters.showAll>(Filter.Cache, null, true);
            }
            Details.Cache.AllowDelete = false;
            Details.Cache.AllowInsert = false;
            Details.SetSelected <ARInvoice.selected>();
            Details.SetProcessCaption(IN.Messages.Process);
            Details.SetProcessAllCaption(IN.Messages.ProcessAll);
        }
        public virtual void FSSrvOrdType_PostTo_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSSrvOrdType fsSrvOrdTypeRow = (FSSrvOrdType)e.Row;

            if (fsSrvOrdTypeRow.SalesAcctSource == null)
            {
                fsSrvOrdTypeRow.SalesAcctSource = ID.SrvOrdType_SalesAcctSource.CUSTOMER_LOCATION;
            }

            if (fsSrvOrdTypeRow.PostTo == ID.SrvOrdType_PostTo.NONE)
            {
                PXDefaultAttribute.SetDefault <FSSrvOrdType.combineSubFrom>(cache, fsSrvOrdTypeRow);
            }
        }
Example #4
0
        protected virtual void APSetup_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            var row = (APSetup)e.Row;

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

            PXUIFieldAttribute.SetEnabled <APSetup.invoicePrecision>(sender, row, (row.InvoiceRounding != RoundingType.Currency));
            PXUIFieldAttribute.SetEnabled <APSetup.numberOfMonths>(sender, row, row.RetentionType == AR.RetentionTypeList.FixedNumOfMonths);

            VerifyInvoiceRounding(sender, row);

            if (PXAccess.FeatureInstalled <FeaturesSet.distributionModule>() && !PXAccess.FeatureInstalled <FeaturesSet.inventory>())
            {
                PXDefaultAttribute.SetDefault <APSetup.vendorPriceUpdate>(sender, APVendorPriceUpdateType.Purchase);
                PXStringListAttribute.SetList <APSetup.vendorPriceUpdate>(sender, null, new string[] { APVendorPriceUpdateType.None, APVendorPriceUpdateType.Purchase, APVendorPriceUpdateType.ReleaseAPBill },
                                                                          new string[] { Messages.VendorUpdateNone, Messages.VendorUpdatePurchase, Messages.VendorUpdateAPBillRelease });
            }
        }
        protected virtual void _(Events.FieldUpdated <FSSrvOrdType, FSSrvOrdType.postTo> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSSrvOrdType fsSrvOrdTypeRow = (FSSrvOrdType)e.Row;

            if (fsSrvOrdTypeRow.SalesAcctSource == null)
            {
                fsSrvOrdTypeRow.SalesAcctSource = ID.SrvOrdType_SalesAcctSource.CUSTOMER_LOCATION;
            }

            if (fsSrvOrdTypeRow.PostTo == ID.SrvOrdType_PostTo.NONE)
            {
                PXDefaultAttribute.SetDefault <FSSrvOrdType.combineSubFrom>(e.Cache, fsSrvOrdTypeRow);
            }

            ValidatePostToByFeatures(e.Cache, fsSrvOrdTypeRow);
        }
        protected virtual void SOOrderType_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }
            SOOrderType ordertype = (SOOrderType)e.Row;

            SOOrderType link = references.SelectWindowed(0, 1, ordertype.OrderType);
            bool        isTemplateUpdatable = ordertype.IsSystem == false && link == null && ordertype.OrderType != null;

            PXUIFieldAttribute.SetEnabled <SOOrderType.template>(sender, e.Row, isTemplateUpdatable);

            SOOrderTypeOperation def = this.defaultOperation.Select(ordertype.OrderType, ordertype.DefaultOperation);

            if (def == null)
            {
                def = new SOOrderTypeOperation();
            }
            PXUIFieldAttribute.SetEnabled <SOOrderType.billSeparately>(sender, e.Row, ordertype.ARDocType != ARDocType.NoUpdate);
            PXUIFieldAttribute.SetEnabled <SOOrderType.invoiceNumberingID>(sender, e.Row, ordertype.ARDocType != ARDocType.NoUpdate);


            if (ordertype.ARDocType == ARDocType.NoUpdate)
            {
                INTranType.CustomListAttribute listattr = new INTranType.SONonARListAttribute();
                PXStringListAttribute.SetList <SOOrderTypeOperation.iNDocType>(this.operations.Cache, null, listattr.AllowedValues, listattr.AllowedLabels);
            }
            else
            {
                INTranType.CustomListAttribute listattr = new INTranType.SOListAttribute();
                PXStringListAttribute.SetList <SOOrderTypeOperation.iNDocType>(this.operations.Cache, null, listattr.AllowedValues, listattr.AllowedLabels);
            }

            SOOrder order =
                PXSelectJoin <SOOrder,
                              InnerJoin <INItemPlan, On <INItemPlan.refNoteID, Equal <SOOrder.noteID> > >,
                              Where <SOOrder.orderType, Equal <Required <SOOrder.orderType> >,
                                     And <Where <INItemPlan.planType, Equal <INPlanConstants.plan60>,
                                                 Or <INItemPlan.planType, Equal <INPlanConstants.plan66>,
                                                     Or <INItemPlan.planType, Equal <INPlanConstants.plan68> > > > > > >
                .SelectWindowed(this, 0, 1, ordertype.OrderType);

            //PXUIFieldAttribute.SetEnabled<SOOrderType.requireLocation>(sender, ordertype, order == null && isTemplateUpdatable);
            //PXUIFieldAttribute.SetEnabled<SOOrderType.requireLocation>(sender, e.Row, def.INDocType != INTranType.NoUpdate && isTemplateUpdatable);
            PXUIFieldAttribute.SetEnabled <SOOrderType.requireShipping>(sender, e.Row, def.INDocType != INTranType.NoUpdate && def.INDocType != INTranType.Transfer && isTemplateUpdatable);
            PXUIFieldAttribute.SetEnabled <SOOrderType.aRDocType>(sender, e.Row, def.INDocType != INTranType.Transfer && isTemplateUpdatable);
            PXUIFieldAttribute.SetEnabled <SOOrderType.behavior>(sender, e.Row, isTemplateUpdatable);
            PXUIFieldAttribute.SetEnabled <SOOrderType.defaultOperation>(sender, e.Row, isTemplateUpdatable && ordertype.Behavior == SOBehavior.RM);
            PXUIFieldAttribute.SetVisible <SOOrderTypeOperation.active>(operations.Cache, null, ordertype.Behavior == SOBehavior.RM || ordertype.Behavior == SOBehavior.IN);
            PXUIFieldAttribute.SetVisible <SOOrderTypeOperation.autoCreateIssueLine>(operations.Cache, null, ordertype.Behavior == SOBehavior.RM);

            PXUIFieldAttribute.SetEnabled <SOOrderType.copyLineNotesToInvoiceOnlyNS>(sender, ordertype, ordertype.CopyLineNotesToInvoice == true);
            PXUIFieldAttribute.SetEnabled <SOOrderType.copyLineFilesToInvoiceOnlyNS>(sender, ordertype, ordertype.CopyLineFilesToInvoice == true);

            PXUIFieldAttribute.SetEnabled <SOOrderType.requireAllocation>(sender, ordertype, ordertype.RequireShipping == true);
            PXUIFieldAttribute.SetEnabled <SOOrderType.requireLotSerial>(sender, ordertype, ordertype.RequireShipping == true);
            PXUIFieldAttribute.SetEnabled <SOOrderType.copyLotSerialFromShipment>(sender, ordertype, ordertype.RequireShipping == true);

            PXUIFieldAttribute.SetEnabled <SOOrderType.useDiscountSubFromSalesSub>(sender, ordertype, ordertype.PostLineDiscSeparately == true);

            PXUIFieldAttribute.SetVisible <SOOrderType.recalculateDiscOnPartialShipment>(sender, e.Row, PXAccess.FeatureInstalled <FeaturesSet.inventory>() && PXAccess.FeatureInstalled <FeaturesSet.customerDiscounts>());

            bool allowUserDefinedOrderTypes = PXAccess.FeatureInstalled <FeaturesSet.userDefinedOrderTypes>();

            soordertype.AllowInsert      = allowUserDefinedOrderTypes;
            currentordertype.AllowInsert = allowUserDefinedOrderTypes;
            bool allowUpdateOrderTypes = allowUserDefinedOrderTypes || sender.GetStatus(e.Row) != PXEntryStatus.Inserted;

            soordertype.AllowUpdate      = allowUpdateOrderTypes;
            currentordertype.AllowUpdate = allowUpdateOrderTypes;

            PXUIFieldAttribute.SetVisible <SOOrderType.commitmentTracking>(sender, e.Row, CommitmentTracking);
            if (!PXAccess.FeatureInstalled <FeaturesSet.inventory>())
            {
                PXDefaultAttribute.SetDefault <SOOrderType.behavior>(sender, SOBehavior.IN);
                PXStringListAttribute.SetList <SOOrderType.behavior>(sender, null, new string[] { SOBehavior.IN, SOBehavior.QT, SOBehavior.CM },
                                                                     new string[] { Messages.INName, Messages.QTName, Messages.CMName });
            }
        }
Example #7
0
        protected virtual void Tax_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            Tax tax = (Tax)e.Row;

            bool isUsedForManualVAT = PXSelect <TaxZone, Where <TaxZone.taxID, Equal <Required <TaxZone.taxID> > > > .Select(this, tax.TaxID).Count != 0;

            bool isOutdated = tax.OutDate.HasValue && (tax.OutDate.Value.CompareTo(Accessinfo.BusinessDate) < 0);

            if (this.Tax.Cache.GetStatus(tax) != PXEntryStatus.Updated)
            {
                this.TaxRevisions.Cache.AllowInsert = !isOutdated;
                this.TaxRevisions.Cache.AllowUpdate = !isOutdated;
                this.TaxRevisions.Cache.AllowDelete = !isOutdated;
            }

            bool isExternal = tax.IsExternal ?? false;

            if (isExternal)
            {
                this.TaxRevisions.Cache.AllowInsert = false;
                this.TaxRevisions.Cache.AllowUpdate = false;
                this.TaxRevisions.Cache.AllowDelete = false;
                this.Categories.Cache.AllowInsert   = false;
                this.Categories.Cache.AllowUpdate   = false;
                this.Categories.Cache.AllowDelete   = false;
                this.Zones.Cache.AllowInsert        = false;
                this.Zones.Cache.AllowUpdate        = false;
                this.Zones.Cache.AllowDelete        = false;
            }

            bool isVAT        = ((Tax)e.Row).TaxType == CSTaxType.VAT;
            bool isPending    = ((Tax)e.Row).PendingTax == true;
            bool isUse        = ((Tax)e.Row).TaxType == CSTaxType.Use;
            bool isDeductible = ((Tax)e.Row).DeductibleVAT == true;
            bool isReportingExpenseToSingleAcc = isDeductible && ((Tax)e.Row).ReportExpenseToSingleAccount == true;

            PXUIFieldAttribute.SetEnabled <Tax.reverseTax>(cache, e.Row, isVAT && !isExternal & !isUsedForManualVAT);
            PXUIFieldAttribute.SetEnabled <Tax.pendingTax>(cache, e.Row, isVAT && !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.directTax>(cache, e.Row, isVAT && !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.statisticalTax>(cache, e.Row, isVAT && !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.exemptTax>(cache, e.Row, isVAT && !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.deductibleVAT>(cache, e.Row, isVAT && !isExternal & !isUsedForManualVAT);
            PXUIFieldAttribute.SetEnabled <Tax.includeInTaxable>(cache, e.Row, isVAT && !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.purchTaxAcctID>(cache, e.Row, isVAT);
            PXUIFieldAttribute.SetEnabled <Tax.purchTaxSubID>(cache, e.Row, isVAT);
            PXUIFieldAttribute.SetRequired <Tax.purchTaxAcctID>(cache, isVAT);
            PXUIFieldAttribute.SetRequired <Tax.purchTaxSubID>(cache, isVAT);

            PXUIFieldAttribute.SetEnabled <Tax.pendingSalesTaxAcctID>(cache, e.Row, isPending);
            PXUIFieldAttribute.SetEnabled <Tax.pendingSalesTaxSubID>(cache, e.Row, isPending);
            PXUIFieldAttribute.SetEnabled <Tax.pendingPurchTaxAcctID>(cache, e.Row, isPending);
            PXUIFieldAttribute.SetEnabled <Tax.pendingPurchTaxSubID>(cache, e.Row, isPending);

            PXUIFieldAttribute.SetVisible <Tax.reportExpenseToSingleAccount>(cache, e.Row, isDeductible);

            PXUIFieldAttribute.SetEnabled <Tax.expenseAccountID>(cache, e.Row, isUse || isReportingExpenseToSingleAcc);
            PXUIFieldAttribute.SetEnabled <Tax.expenseSubID>(cache, e.Row, isUse || isReportingExpenseToSingleAcc);
            PXDefaultAttribute.SetPersistingCheck <Tax.expenseAccountID>(cache, e.Row, isReportingExpenseToSingleAcc ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXDefaultAttribute.SetPersistingCheck <Tax.expenseSubID>(cache, e.Row, isReportingExpenseToSingleAcc ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing);
            PXUIFieldAttribute.SetRequired <Tax.expenseAccountID>(cache, isUse || isReportingExpenseToSingleAcc);
            PXUIFieldAttribute.SetRequired <Tax.expenseSubID>(cache, isUse || isReportingExpenseToSingleAcc);

            PXUIFieldAttribute.SetEnabled <TaxRev.taxableMin>(TaxRevisions.Cache, null, ((Tax)e.Row).TaxCalcLevel == "1" || ((Tax)e.Row).TaxCalcLevel == "2");
            PXUIFieldAttribute.SetEnabled <TaxRev.taxableMax>(TaxRevisions.Cache, null, ((Tax)e.Row).TaxCalcLevel == "1" || ((Tax)e.Row).TaxCalcLevel == "2");

            PXUIFieldAttribute.SetEnabled <TaxRev.taxRate>(TaxRevisions.Cache, null, ((Tax)e.Row).ExemptTax == false);
            PXUIFieldAttribute.SetEnabled <TaxRev.nonDeductibleTaxRate>(TaxRevisions.Cache, null, isDeductible);
            PXUIFieldAttribute.SetVisible <TaxRev.nonDeductibleTaxRate>(TaxRevisions.Cache, null, isDeductible);

            PXUIFieldAttribute.SetEnabled <Tax.taxType>(cache, e.Row, !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.taxCalcType>(cache, e.Row, !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.taxCalcRule>(cache, e.Row, !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.taxCalcLevel2Exclude>(cache, e.Row, !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.taxApplyTermsDisc>(cache, e.Row, !isExternal);
            PXUIFieldAttribute.SetEnabled <Tax.outDate>(cache, e.Row, !isExternal);

            PopulateBucketList(e.Row);

            PXDefaultAttribute.SetDefault <Tax.taxApplyTermsDisc>(cache, CSTaxTermsDiscount.ToTaxableAmount);
            if (isVAT)
            {
                PXStringListAttribute.SetList <Tax.taxApplyTermsDisc>(cache, tax,
                                                                      new [] { CSTaxTermsDiscount.ToTaxableAmount, CSTaxTermsDiscount.ToPromtPayment, CSTaxTermsDiscount.NoAdjust },
                                                                      new [] { Messages.DiscountToTaxableAmount, Messages.DiscountToPromtPayment, Messages.DiscountToTotalAmount });
            }
            else
            {
                PXStringListAttribute.SetList <Tax.taxApplyTermsDisc>(cache, tax,
                                                                      new [] { CSTaxTermsDiscount.ToTaxableAmount, CSTaxTermsDiscount.NoAdjust },
                                                                      new [] { Messages.DiscountToTaxableAmount, Messages.DiscountToTotalAmount });
            }
        }