protected virtual void _(Events.RowSelected <TDocument> e)
 {
     if (e.Row != null)
     {
         UpdateDecimalVerifyMode(e.Row);
     }
 }
Beispiel #2
0
        //public PXAction<PMSetup> debug;
        //[PXUIField(DisplayName = "Debug")]
        //[PXProcessButton]
        //public void Debug()
        //{

        //}

        protected virtual void _(Events.RowSelected <PMSetup> e)
        {
            EnsureDefaultCostCode(e.Row);

            PMProject rec = DefaultProject.SelectWindowed(0, 1);

            if (rec != null && IsInvalid(rec))
            {
                rec.IsActive = true;
                rec.Status   = ProjectStatus.Active;
                rec.RestrictToEmployeeList = false;
                rec.RestrictToResourceList = false;
                rec.VisibleInAP            = true;
                rec.VisibleInAR            = true;
                rec.VisibleInCA            = true;
                rec.VisibleInCR            = true;
                rec.VisibleInEA            = true;
                rec.VisibleInGL            = true;
                rec.VisibleInIN            = true;
                rec.VisibleInPO            = true;
                rec.VisibleInSO            = true;
                rec.VisibleInTA            = true;
                rec.CustomerID             = null;

                if (DefaultProject.Cache.GetStatus(rec) == PXEntryStatus.Notchanged)
                {
                    DefaultProject.Cache.SetStatus(rec, PXEntryStatus.Updated);
                }

                DefaultProject.Cache.IsDirty = true;
            }
        }
        protected virtual void _(Events.RowSelected <CROpportunityProducts> e)
        {
            if (e.Row == null)
            {
                return;
            }

            CROpportunityProducts crOpportunityProductsRow = (CROpportunityProducts)e.Row;
            PXCache cache = e.Cache;

            FSxCROpportunityProducts fsxCROpportunityProductsRow = cache.GetExtension <FSxCROpportunityProducts>(crOpportunityProductsRow);

            if (fsxCROpportunityProductsRow != null)
            {
                InventoryItem inventoryItemRow = SharedFunctions.GetInventoryItemRow(Base, crOpportunityProductsRow.InventoryID);

                if (inventoryItemRow != null)
                {
                    PXUIFieldAttribute.SetEnabled <FSxCROpportunityProducts.billingRule>(cache, crOpportunityProductsRow, inventoryItemRow.ItemType == INItemTypes.ServiceItem);
                    PXUIFieldAttribute.SetEnabled <FSxCROpportunityProducts.estimatedDuration>(cache, crOpportunityProductsRow, inventoryItemRow.ItemType == INItemTypes.ServiceItem || inventoryItemRow.ItemType == INItemTypes.NonStockItem);
                    PXUIFieldAttribute.SetEnabled <CROpportunityProducts.curyUnitCost>(cache, crOpportunityProductsRow, crOpportunityProductsRow.POCreate == true);
                    PXUIFieldAttribute.SetEnabled <FSxCROpportunityProducts.vendorLocationID>(cache, crOpportunityProductsRow, crOpportunityProductsRow.POCreate == true);
                    PXUIFieldAttribute.SetEnabled <CROpportunityProducts.quantity>(cache, crOpportunityProductsRow, fsxCROpportunityProductsRow.BillingRule != ID.BillingRule.TIME);
                }
            }
        }
Beispiel #4
0
        protected virtual void _(Events.RowSelected <DRBalanceValidationFilter> e)
        {
            bool errorsOnForm = PXUIFieldAttribute.GetErrors(e.Cache, null, PXErrorLevel.Error, PXErrorLevel.RowError).Any();

            Items.SetProcessEnabled(!errorsOnForm && !PendingFullValidation);
            Items.SetProcessAllEnabled(!errorsOnForm);

            DRBalanceValidationFilter filter = e.Row as DRBalanceValidationFilter;

            if (filter == null)
            {
                return;
            }

            Items.SetProcessDelegate(
                delegate(List <DRBalanceType> list)
            {
                DRProcess graph = CreateInstance <DRProcess>();
                graph.RunIntegrityCheck(list, filter.FinPeriodID);
            }
                );

            e.Cache
            .Adjust <PXUIFieldAttribute>(e.Row)
            .For <DRBalanceValidationFilter.finPeriodID>(a => a.Enabled = !PendingFullValidation);
        }
        protected virtual void _(Events.RowSelected <SOInvoice> e)
        {
            SOInvoice row = null;

            row = e.Row;
            e.Cache.SetValue <SOInvoice.refNbr>(row, "<NEW>");
        }
Beispiel #6
0
        protected void _(Events.RowSelected <SOOrder> e)
        {
            var row = e.Row as SOOrder;
            var customerIsDefined = PXSelect <LMICCustomer, Where <LMICCustomer.customerID, Equal <Required <LMICCustomer.customerID> > > > .Select(Base, row.CustomerID).TopFirst;

            if (row.Status == "N" && row.OrderQty > 0 && customerIsDefined != null)
            {
                CreateICPOAction.SetEnabled(true);
            }
            else
            {
                CreateICPOAction.SetEnabled(false);
            }

            // check the ICPOCreated checkbox
            if (row.GetExtension <SOOrderExt>()?.UsrICPOCreated == true)
            {
                Base.Document.AllowDelete = false;
                CreateICPOAction.SetEnabled(false);
            }
            else
            {
                Base.Document.AllowDelete = true;
                CreateICPOAction.SetEnabled(true);
            }
        }
 protected virtual void _(Events.RowSelected <PMChangeOrderCostBudget> args)
 {
     if (args.Row != null)
     {
         ValidateChangeOrderCostBudget(args.Row);
     }
 }
Beispiel #8
0
        protected void _(Events.RowSelected <SOOrder> e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(e.Cache, e.Args);

            addBoxSOLine.SetEnabled(Base.Transactions.Cache.AllowInsert);
            addBoxSOLine.SetVisible(Base.Accessinfo.CompanyName.Contains("TW"));
        }
        protected void _(Events.RowSelected <AMMultiLevelBomFilter> e)
        {
            AMMultiLevelBomFilter row = e.Row;

            if (row != null)
            {
                bool enabled = PXSelect <LifeSyncPreference> .Select(this).TopFirst.EnableProdCostAnlys ?? false;

                PXUIFieldAttribute.SetEnabled <AMMultiLevelBomFilterExt.usrEnblItemRoundUp>(e.Cache, row, enabled);
            }

            Results.SetProcessDelegate(delegate(List <LUMStdBomCost> lists)
            {
                try
                {
                    GenerateBOMCost(lists, row);

                    PXProcessing.SetProcessed();
                }
                catch (Exception ex)
                {
                    PXProcessing.SetError(ex);
                    throw;
                }
            });
        }
        protected virtual void _(Events.RowSelected <ARInvoice> e)
        {
            ARInvoice row = (ARInvoice)e.Row;

            if (row != null && !String.IsNullOrEmpty(row.DocType) &&
                !String.IsNullOrEmpty(row.RefNbr))
            {
                row.IsCCPayment = false;
                if (PXSelectJoin <CustomerPaymentMethodC,
                                  InnerJoin <CA.PaymentMethod,
                                             On <CA.PaymentMethod.paymentMethodID,
                                                 Equal <CustomerPaymentMethodC.paymentMethodID> >,
                                             InnerJoin <SOInvoice,
                                                        On <SOInvoice.pMInstanceID,
                                                            Equal <CustomerPaymentMethodC.pMInstanceID> > > >,
                                  Where <SOInvoice.docType, Equal <Required <SOInvoice.docType> >,
                                         And <SOInvoice.refNbr, Equal <Required <SOInvoice.refNbr> >,
                                              And <CA.PaymentMethod.paymentType,
                                                   Equal <CA.PaymentMethodType.creditCard>,
                                                   And <CA.PaymentMethod.aRIsProcessingRequired, Equal <True> > > > > > .
                    Select(this, row.DocType, row.RefNbr).Count > 0)
                {
                    row.IsCCPayment = true;
                }
            }
        }
 protected virtual void _(Events.RowSelected <ARAdjust2> args)
 {
     if (args.Row != null)
     {
         ValidateAdjustment(args.Row);
     }
 }
 protected virtual void _(Events.RowSelected <PMRecurringItem> e)
 {
     if (e.Row != null && Task.Current != null)
     {
         PXUIFieldAttribute.SetEnabled <PMRecurringItem.included>(e.Cache, e.Row, Task.Current.IsActive != true);
     }
 }
 protected virtual void _(Events.RowSelected <PMBudget> e)
 {
     if (e.Row != null)
     {
         PXUIFieldAttribute.SetEnabled <PMBudget.isProduction>(e.Cache, e.Row, e.Row.Type == GL.AccountType.Expense);
     }
 }
Beispiel #14
0
        protected virtual void _(Events.RowSelected <Customer> e)
        {
            if (e.Row == null)
            {
                return;
            }

            Customer customerRow = (Customer)e.Row;
            PXCache  cache       = e.Cache;

            FSxCustomer fsxCustomerRow = cache.GetExtension <FSxCustomer>(customerRow);

            PXUIFieldAttribute.SetEnabled <FSxCustomer.sendInvoicesTo>(cache, customerRow, fsxCustomerRow.BillingCycleID != null);
            PXUIFieldAttribute.SetEnabled <FSxCustomer.billShipmentSource>(cache, customerRow, fsxCustomerRow.BillingCycleID != null);

            DisplayCustomerBillingOptions(cache, customerRow, fsxCustomerRow);

            viewServiceOrderHistory.SetEnabled(customerRow.BAccountID > 0);
            viewAppointmentHistory.SetEnabled(customerRow.BAccountID > 0);
            viewEquipmentSummary.SetEnabled(customerRow.BAccountID > 0);
            viewContractScheduleSummary.SetEnabled(customerRow.BAccountID > 0);

            openMultipleStaffMemberBoard.SetEnabled(customerRow.BAccountID > 0);
            openSingleStaffMemberBoard.SetEnabled(customerRow.BAccountID > 0);

            EnableDisableCustomerBilling(cache, customerRow, fsxCustomerRow);
        }
 protected override void _(Events.RowSelected <Header> e)
 {
     if (IsCartRequired)
     {
         Base1.ScanRelease.SetEnabled(Register != null && Register.Released != true && IsEmptyCart);
     }
 }
Beispiel #16
0
        protected void _(Events.RowSelected <EPExpenseClaim> e, PXRowSelected InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(e.Cache, e.Args);

            manGUIExpense.Cache.AllowSelect = TWNGUIValidation.ActivateTWGUI(Base);
            manGUIExpense.Cache.AllowDelete = manGUIExpense.Cache.AllowInsert = manGUIExpense.Cache.AllowUpdate = !e.Row.Status.Equals(EPExpenseClaimStatus.ReleasedStatus);
        }
 protected virtual void _(Events.RowSelected <APAdjust> args)
 {
     if (args.Row != null)
     {
         service.ValidateApAdjustment <APAdjust.adjdRefNbr>(args.Row);
     }
 }
 protected virtual void _(Events.RowSelected <TLine> e)
 {
     if (e.Row != null)
     {
         SetDecimalVerifyMode(e.Cache, e.Row);
     }
 }
 protected virtual void _(Events.RowSelected <PMChangeOrderLine> args)
 {
     if (args.Row != null)
     {
         ValidateChangeOrderLine(args.Row);
     }
 }
        protected virtual void _(Events.RowSelected <SOInvoice> e)
        {
            var row = new SOInvoice();

            e.Cache.SetValue <SOInvoice.refNbr>(row, "<NEW>");
            row.RefNbr = "0000001";
        }
Beispiel #21
0
        protected virtual void _(Events.RowSelected <SOInvoice> e)
        {
            SOInvoice row = null;

            row = e.Row;
            SOHelpers.InitializeRow(row);
        }
 protected virtual void _(Events.RowSelected <APTran> args)
 {
     if (args.Row != null)
     {
         ValidateTransaction(args.Row);
     }
 }
Beispiel #23
0
 public virtual void _(Events.RowSelected <JointPayeePayment> args)
 {
     if (args.Row is JointPayeePayment jointPayeePayment && jointPayeePayment.JointAmountToPay > 0)
     {
         amountToPayValidationService.ValidateJointPayeePayment(args.Cache, jointPayeePayment);
     }
 }
 protected virtual void _(Events.RowSelected <APInvoiceEntry.APAdjust> args)
 {
     if (args.Row != null)
     {
         ValidateAdjustment(args.Row);
     }
 }
Beispiel #25
0
        protected void _(Events.RowSelected <Tax> e, PXRowSelected InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(e.Cache, e.Args);

            PXUIFieldAttribute.SetVisible <TaxExt.usrGUIType>(e.Cache, null, TWNGUIValidation.ActivateTWGUI(Base));
            PXUIFieldAttribute.SetVisible <TaxExt.usrTWNGUI> (e.Cache, null, TWNGUIValidation.ActivateTWGUI(Base));
        }
Beispiel #26
0
        protected void _(Events.RowSelected <ARInvoice> e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(e.Cache, e.Args);

            ARInvoiceState state = Base.GetDocumentState(e.Cache, e.Row);

            ARRegisterExt registerExt = PXCache <ARRegister> .GetExtension <ARRegisterExt>(e.Row);

            bool taxNbrBlank  = string.IsNullOrEmpty(registerExt.UsrTaxNbr);
            bool statusClosed = e.Row.Status.Equals(ARDocStatus.Open) || e.Row.Status.Equals(ARDocStatus.Closed);

            //BuyPlasticBag.SetVisible(activateGUI);

            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrGUIDate>     (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrGUINbr>      (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrOurTaxNbr>   (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrTaxNbr>      (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrVATOutCode>  (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrB2CType>     (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrCarrierID>   (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrNPONbr>      (e.Cache, null, activateGUI);
            PXUIFieldAttribute.SetVisible <ARRegisterExt.usrCreditAction>(e.Cache, null, activateGUI &&
                                                                          !string.IsNullOrEmpty(registerExt.UsrVATOutCode) &&
                                                                          registerExt.UsrVATOutCode.IsIn(TWGUIFormatCode.vATOutCode33, TWGUIFormatCode.vATOutCode34));

            PXUIFieldAttribute.SetEnabled <ARRegisterExt.usrB2CType>     (e.Cache, e.Row, !statusClosed && taxNbrBlank);
            PXUIFieldAttribute.SetEnabled <ARRegisterExt.usrCarrierID>   (e.Cache, e.Row, !statusClosed && taxNbrBlank && registerExt.UsrB2CType == TWNB2CType.MC);
            PXUIFieldAttribute.SetEnabled <ARRegisterExt.usrNPONbr>      (e.Cache, e.Row, !statusClosed && taxNbrBlank && registerExt.UsrB2CType == TWNB2CType.NPO);
            PXUIFieldAttribute.SetEnabled <ARRegisterExt.usrVATOutCode>  (e.Cache, e.Row, string.IsNullOrEmpty(registerExt.UsrGUINbr));

            PXUIFieldAttribute.SetEnabled <ARRegisterExt.usrCreditAction>(e.Cache, e.Row, state.DocumentDescrEnabled);
        }
        protected virtual void _(Events.RowSelected <CROpportunity> e)
        {
            if (e.Row == null)
            {
                return;
            }

            CROpportunity crOpportunityRow = (CROpportunity)e.Row;
            PXCache       cache            = e.Cache;

            FSxCROpportunity fsxCROpportunityRow = cache.GetExtension <FSxCROpportunity>(crOpportunityRow);

            FSServiceOrder fsServiceOrderRow = CRExtensionHelper.GetRelatedServiceOrder(Base, cache, crOpportunityRow, fsxCROpportunityRow.SOID);
            FSSrvOrdType   fsSrvOrdTypeRow   = null;

            if (fsServiceOrderRow != null)
            {
                fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsServiceOrderRow.SrvOrdType);
            }

            EnableDisableExtensionFields(cache, fsxCROpportunityRow, fsServiceOrderRow);
            EnableDisableActions(cache, crOpportunityRow, fsxCROpportunityRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            SetPersistingChecks(cache, crOpportunityRow, fsxCROpportunityRow, fsSrvOrdTypeRow);

            HideOrShowFieldsActionsByInventoryFeature();
        }
Beispiel #28
0
        protected virtual void _(Events.RowSelected <FSRouteDocument> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSRouteDocument fsRouteDocumentRow = (FSRouteDocument)e.Row;
            PXCache         cache = e.Cache;

            bool enableVehiceIDAndDriverIDFields = fsRouteDocumentRow.Status != ID.Status_Route.CANCELED;

            //The IsDirty flags get turned off so the 'save changes' confirmation is not thrown
            this.Routes.Cache.IsDirty = false;
            this.VehicleRouteSelected.Cache.IsDirty = false;
            this.DriverRouteSelected.Cache.IsDirty  = false;

            PXUIFieldAttribute.SetEnabled <FSRouteDocument.refNbr>(cache, fsRouteDocumentRow, false);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.routeID>(cache, fsRouteDocumentRow, false);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.date>(cache, fsRouteDocumentRow, false);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.timeBegin>(cache, fsRouteDocumentRow, false);

            PXUIFieldAttribute.SetEnabled <FSRouteDocument.vehicleID>(cache, fsRouteDocumentRow, enableVehiceIDAndDriverIDFields);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.additionalVehicleID1>(cache, fsRouteDocumentRow, enableVehiceIDAndDriverIDFields);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.additionalVehicleID2>(cache, fsRouteDocumentRow, enableVehiceIDAndDriverIDFields);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.driverID>(cache, fsRouteDocumentRow, enableVehiceIDAndDriverIDFields);
            PXUIFieldAttribute.SetEnabled <FSRouteDocument.additionalDriverID>(cache, fsRouteDocumentRow, enableVehiceIDAndDriverIDFields);
        }
Beispiel #29
0
        protected virtual void RowSelected(Events.RowSelected <PaymentTransactionDetail> e)
        {
            e.Cache.AllowInsert = false;
            e.Cache.AllowUpdate = false;
            e.Cache.AllowDelete = false;
            PaymentTransactionDetail row = e?.Row;

            if (row != null)
            {
                IEnumerable <ICCPaymentTransaction> storedTrans = GetProcTrans();
                if (e.Row.TranStatus == CCTranStatusCode.HeldForReview)
                {
                    ICCPaymentTransaction searchTran = CCProcTranHelper.FindOpenForReviewTran(storedTrans);
                    if (searchTran != null && searchTran.TranNbr == row.TranNbr)
                    {
                        PaymentTransaction.Cache.RaiseExceptionHandling <CCProcTran.tranNbr>(row, row.TranNbr,
                                                                                             new PXSetPropertyException(TranHeldwarnMsg, PXErrorLevel.RowWarning));
                    }
                }
                IEnumerable <ICCPaymentTransaction> activeAuthCapture = CCProcTranHelper.FindAuthCaptureActiveTrans(storedTrans);
                if (activeAuthCapture.Count() > 1 && activeAuthCapture.Where(i => i.TranNbr == row.TranNbr).Any())
                {
                    PaymentTransaction.Cache.RaiseExceptionHandling <CCProcTran.tranNbr>(row, row.TranNbr,
                                                                                         new PXSetPropertyException(AR.Messages.CCProcessingARPaymentMultipleActiveTranWarning, PXErrorLevel.RowWarning));
                }
            }
        }
        protected virtual void _(Events.RowSelected <FSVehicle> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSVehicle fsVehicleRow = e.Row;

            VehicleMaint graphVehicleMaint = PXGraph.CreateInstance <VehicleMaint>();

            if (fsVehicleRow.SMEquipmentID != null)
            {
                graphVehicleMaint.EPEquipmentRecords.Current = PXSelectJoin <EPEquipment,
                                                                             InnerJoin <FSEquipment,
                                                                                        On <
                                                                                            FSEquipment.sourceID, Equal <EPEquipment.equipmentID>,
                                                                                            And <FSEquipment.sourceType, Equal <FSEquipment.sourceType.Vehicle> > > >,
                                                                             Where <
                                                                                 FSEquipment.SMequipmentID, Equal <Required <FSEquipment.SMequipmentID> > > >
                                                               .Select(graphVehicleMaint, fsVehicleRow.SMEquipmentID);
            }

            throw new PXRedirectRequiredException(graphVehicleMaint, null)
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }