Exemple #1
0
        protected virtual void EPActivity_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            var row = e.Row as EPActivity;

            if (row == null)
            {
                return;
            }

            var activity = DefaultEmailProcessor.GetParentOriginalActivity(this, (int)row.TaskID);

            if (activity != null)
            {
                GotoParentActivity.SetVisible(true);

                PXUIFieldAttribute.SetReadOnly <EPActivity.entityDescription>(cache, e.Row);
                var isMessageFailed = row.MPStatus == MailStatusListAttribute.Failed;
                row.EntityDescription = isMessageFailed ? CacheUtility.GetErrorDescription(row.Exception) : string.Empty;
                var helper = new EntityHelper(this);
                var entity = activity.RefNoteID.With(refNoteId => helper.GetEntityRow(refNoteId.Value));
                if (entity != null)
                {
                    row.EntityDescription += CacheUtility.GetDescription(helper, entity, entity.GetType());
                }
            }
            else
            {
                GotoParentActivity.SetVisible(false);
            }
        }
        protected virtual void WZTask_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            WZTask row = e.Row as WZTask;

            if (row == null)
            {
                return;
            }

            if (this.Actions.Contains("CancelClose"))
            {
                this.Actions["CancelClose"].SetTooltip(Messages.BackToScenario);
            }

            PXUIFieldAttribute.SetEnabled <WZTask.details>(Tasks.Cache, row, false);
            PXUIFieldAttribute.SetEnabled <WZTask.assignedTo>(Tasks.Cache, row, false);
            bool canBeComplete = row.Status == WizardTaskStatusesAttribute._ACTIVE || row.Status == WizardTaskStatusesAttribute._OPEN;
            bool canBeReopened = row.Status == WizardTaskStatusesAttribute._COMPLETED;

            markAsComplete.SetEnabled(canBeComplete);
            skip.SetVisible(false);
            if (row.IsOptional == true)
            {
                skip.SetVisible(true);
                skip.SetEnabled(!(row.Status == WizardTaskStatusesAttribute._SKIPPED || row.Status == WizardTaskStatusesAttribute._COMPLETED));
            }


            startTask.SetEnabled(row.Status == WizardTaskStatusesAttribute._OPEN);

            SubTasks.AllowUpdate     = false;
            Predecessors.AllowUpdate = false;
            Successors.AllowUpdate   = false;

            var predecessors = Predecessors.Select();
            var successors   = Successors.Select();
            var subTasks     = SubTasks.Select();

            if (predecessors.Count == 0)
            {
                Predecessors.Cache.AllowSelect = false;
            }
            if (successors.Count == 0)
            {
                Successors.Cache.AllowSelect = false;
            }
            if (subTasks.Count == 0)
            {
                SubTasks.Cache.AllowSelect = false;
            }
            goToScreen.SetVisible(row.ScreenID != null);
        }
Exemple #3
0
 public virtual void _(Events.RowSelected <APInvoice> args)
 {
     AddSubcontracts.SetEnabled(Base1.addPOOrder.GetEnabled());
     AddSubcontracts.SetVisible(Base1.addPOOrder.GetVisible());
     AddSubcontractLines.SetEnabled(Base2.addPOOrderLine.GetEnabled());
     AddSubcontractLines.SetVisible(Base2.addPOOrderLine.GetVisible());
 }
Exemple #4
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 virtual void _(Events.RowSelected <SOInvoice> e)
        {
            PXUIFieldAttribute.SetDisplayName <SOInvoice.refNbr>(e.Cache, "Invoice Nbr.");
            PXUIFieldAttribute.SetVisible <SOInvoice.refNbr>(e.Cache, null, true);

            Release.SetVisible(true);
        }
Exemple #6
0
        public INItemClassMaint()
        {
            PXUIFieldAttribute.SetVisible <INUnit.toUnit>(classunits.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <INUnit.toUnit>(classunits.Cache, null, false);

            PXUIFieldAttribute.SetVisible <INUnit.sampleToUnit>(classunits.Cache, null, true);
            PXUIFieldAttribute.SetEnabled <INUnit.sampleToUnit>(classunits.Cache, null, false);

            PXUIFieldAttribute.SetEnabled(Groups.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <PX.SM.RelationGroup.included>(Groups.Cache, null, true);

            if (!PXAccess.FeatureInstalled <FeaturesSet.distributionModule>())
            {
                action.SetVisible(false);
                resetGroup.SetVisible(false);
                PXUIFieldAttribute.SetVisible(replenishment.Cache, null, false);
                PXUIFieldAttribute.SetVisible(itemclass.Cache, null, false);
                PXUIFieldAttribute.SetVisible(Groups.Cache, null, false);
                PXUIFieldAttribute.SetVisible <INItemClass.itemClassID>(itemclass.Cache, null, true);
                PXUIFieldAttribute.SetVisible <INItemClass.descr>(itemclass.Cache, null, true);
                PXUIFieldAttribute.SetVisible <INItemClass.itemType>(itemclass.Cache, null, true);
                PXUIFieldAttribute.SetVisible <INItemClass.taxCategoryID>(itemclass.Cache, null, true);
                PXUIFieldAttribute.SetVisible <INItemClass.baseUnit>(itemclass.Cache, null, true);
                PXUIFieldAttribute.SetVisible <INItemClass.priceClassID>(itemclass.Cache, null, true);
            }
        }
Exemple #7
0
        protected virtual void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            APInvoice document = e.Row as APInvoice;

            if (document == null)
            {
                return;
            }

            var invoiceState = Base.GetDocumentState(cache, document);

            addPOOrder.SetVisible(invoiceState.IsDocumentInvoice);

            PXUIFieldAttribute.SetEnabled(poorderslist.Cache, null, false);

            bool allowAddPOOrder = invoiceState.IsDocumentEditable &&
                                   invoiceState.AllowAddPOByProject &&
                                   Base.vendor.Current != null &&
                                   !invoiceState.IsRetainageDebAdj;

            addPOOrder.SetEnabled(allowAddPOOrder);
            PXUIFieldAttribute.SetEnabled <POOrderRS.selected>(poorderslist.Cache, null, allowAddPOOrder);
            PXUIFieldAttribute.SetVisible <POOrderRS.unbilledOrderQty>(poorderslist.Cache, null, invoiceState.IsDocumentInvoice);
            PXUIFieldAttribute.SetVisible <POOrderRS.curyUnbilledOrderTotal>(poorderslist.Cache, null, invoiceState.IsDocumentInvoice);
        }
Exemple #8
0
 public virtual void _(Events.RowSelected <VendorClass> args)
 {
     if (args.Row != null)
     {
         AddToProjects.SetVisible(LienWaiverSetup.Current.ShouldGenerateConditional.GetValueOrDefault() ||
                                  LienWaiverSetup.Current.ShouldGenerateUnconditional.GetValueOrDefault());
     }
 }
        protected void _(Events.RowSelected <AMVendorShipment> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                VendorShipment.SetVisible(false);
            }
        }
        protected void _(Events.RowSelected <Batch> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                GLJournalAction.SetVisible(false);
            }
        }
Exemple #11
0
        protected void _(Events.RowSelected <INRegister> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                InventoryIssueReport.SetVisible(false);
            }
        }
        protected void _(Events.RowSelected <INPIHeader> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                CountintListReport.SetVisible(false);
            }
        }
        protected void _(Events.RowSelected <POReceipt> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                POReceipt.SetVisible(false);
                POReturn.SetVisible(false);
            }
        }
        protected void _(Events.RowSelected <AMProdItem> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                ProductionInstruction.SetVisible(false);
                InnerLabel.SetVisible(false);
            }
        }
Exemple #15
0
        protected void _(Events.RowSelected <AMBatch> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                ReportAction.SetVisible(false);
                ProductionMoveAction.SetVisible(false);
            }
        }
Exemple #16
0
        protected void _(Events.RowSelected <AMBatch> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                ReportAction.SetVisible(false);
                MaterialIssuesAction.SetVisible(false);
                MaterialReturnAction.SetVisible(false);
            }
        }
Exemple #17
0
        protected void _(Events.RowSelected <SOShipment> e)
        {
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                ProformaInvoice.SetVisible(false);
                DeliveryOrderReport.SetVisible(false);
                DispatchNoteReport.SetVisible(false);
                ReturnNoteReport.SetVisible(false);
            }
        }
        private void InsertNewRecord(PXCache cache)
        {
            PXUIFieldAttribute.SetVisible(cache, nameof(SOInvoice.RefNbr), true);
            PXUIFieldAttribute.SetEnabled <SOInvoice.refNbr>(cache, null, false);
            PXUIFieldAttribute.SetDisplayName <SOInvoice.refNbr>(cache, "Invoice Nbr.");
            PXUIFieldAttribute.SetRequired <SOInvoice.refNbr>(e.Cache, false);
            PXUIFieldAttribute.SetReadOnly <SOInvoice.refNbr>(e.Cache, null, true);

            Release.SetVisible(true);
            Release.SetEnabled(false);
            Release.SetCaption("Release");
            Release.SetTooltip("Release the document");
        }
        public override void Initialize()
        {
            base.Initialize();

            if (!string.IsNullOrEmpty(Base.PrimaryView))
            {
                Type     primaryViewType = Base.Views[Base.PrimaryView].Cache.GetItemType();
                PXAction updateInsight   = PXNamedAction.AddAction(Base, primaryViewType,
                                                                   "Update Insight", "Update Insight", UpdateInsight);
                updateInsight.SetEnabled(false);
                updateInsight.SetVisible(false);
            }
        }
Exemple #20
0
        protected virtual void CarrierPlugin_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            CarrierPlugin row = e.Row as CarrierPlugin;

            if (row == null)
            {
                return;
            }

            ICarrierService service = CreateCarrierService(this, row);

            if (service != null)
            {
                certify.SetVisible(service.Attributes.Contains("CERTIFICATE"));
            }
        }
Exemple #21
0
        public virtual void SetDefaultColumnVisibility()
        {
            if (PXAccess.FeatureInstalled <FeaturesSet.costCodes>())
            {
                PXUIFieldAttribute.SetVisible <PMBudget.inventoryID>(Items.Cache, null, false);
            }

            viewCommitments.SetVisible(Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedAmount>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedQty>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedInvoicedAmount>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedInvoicedQty>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedOpenAmount>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedOpenQty>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
            PXUIFieldAttribute.SetVisible <PMCostBudget.committedReceivedQty>(Items.Cache, null, Setup.Current.CommitmentTracking == true);
        }
        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 APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            APInvoice document = e.Row as APInvoice;

            if (document == null)
            {
                return;
            }

            var invoiceState = Base.GetDocumentState(cache, document);

            linkLine.SetVisible(invoiceState.IsDocumentInvoice);

            linkLine.SetEnabled(
                invoiceState.IsDocumentEditable &&
                invoiceState.AllowAddPOByProject &&
                !invoiceState.IsRetainageDebAdj);
        }
Exemple #24
0
        protected virtual void CRActivity_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            CRActivity row = (CRActivity)e.Row;

            if (row == null)
            {
                return;
            }

            PXUIFieldAttribute.SetEnabled <CRActivity.endDate>(cache, row, false);

            PXUIFieldAttribute.SetEnabled <CRActivity.source>(cache, row, false);
            PXUIFieldAttribute.SetEnabled <CRActivity.noteID>(cache, row);

            PXDefaultAttribute.SetPersistingCheck <CRActivity.type>(cache, row, PXPersistingCheck.Null);

            MarkAsCompletedAndFollowUp.SetVisible(false);
            GotoParentActivity.SetEnabled(row.ParentNoteID != null);
        }
Exemple #25
0
        protected virtual void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            APInvoice document = e.Row as APInvoice;

            if (document == null)
            {
                return;
            }

            var invoiceState = Base.GetDocumentState(cache, document);

            linkLine.SetVisible(invoiceState.IsDocumentInvoice);

            linkLine.SetEnabled(
                invoiceState.IsDocumentEditable &&
                invoiceState.AllowAddPOByProject &&
                (!PXAccess.FeatureInstalled <FeaturesSet.netGrossEntryMode>() ||
                 document.TaxCalcMode == TaxCalculationMode.TaxSetting) &&
                !invoiceState.IsRetainageDebAdj);
        }
Exemple #26
0
        protected virtual void _(Events.RowSelected <POLine> e)
        {
            // Control Header PI Column Visible
            var _graph        = PXGraph.CreateInstance <POOrderEntry>();
            var _PIPreference = from t in _graph.Select <LifeSyncPreference>()
                                select t;
            var _visible = _PIPreference.FirstOrDefault() == null ? false :
                           _PIPreference.FirstOrDefault().BubbleNumberPrinting.HasValue ? _PIPreference.FirstOrDefault().BubbleNumberPrinting.Value : false;

            PXUIFieldAttribute.SetVisible <POLineExt.usrBubbleNumber>(e.Cache, null, _visible);

            //controll customize button based on country ID
            var _lumLibrary = new LumLibrary();

            if (!_lumLibrary.isCNorHK())
            {
                DomesticPO.SetVisible(false);
                OverseasPO.SetVisible(false);
            }
        }
        protected override void Users_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            Users user = (Users)e.Row;

            if (user == null)
            {
                return;
            }

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

            if (user.Source == PXUsersSourceListAttribute.ActiveDirectory)
            {
                string warning = null;
                if (user.OverrideADRoles == true)
                {
                    warning = Messages.IgnoredADRoles;
                }
                else
                {
                    var roles = PXUsersSelectorAttribute.GetADMappedRolesBySID(user.ExtRef);
                    if (roles == null || roles.Count() == 0)
                    {
                        warning = Messages.NoMappedADRoles;
                    }
                }
                PXUIFieldAttribute.SetWarning <Users.overrideADRoles>(sender, user, warning);
            }
            PXUIFieldAttribute.SetEnabled <Users.multiFactorType>(sender, user, user.MultiFactorOverride == true);

            if (user.ContactID == null)
            {
                user.ContactID = PXSelect <Contact, Where <Contact.userID, Equal <Required <Contact.userID> > > >
                                 .SelectSingleBound(this, null, user.PKID)
                                 .RowCast <Contact>()
                                 .FirstOrDefault()?.ContactID;
            }
        }
Exemple #28
0
        public void action1()
        {
            Action1.SetVisible(false);
            Action1.SetEnabled(false);
            Action1.SetCaption("Action1");
            Action1.SetTooltip("Tooltip");
            PXUIFieldAttribute.SetVisible <Users.displayName>(AllUsers.Cache, null);
            PXUIFieldAttribute.SetVisibility <Users.displayName>(AllUsers.Cache, null, PXUIVisibility.Invisible);
            PXUIFieldAttribute.SetEnabled <Users.displayName>(AllUsers.Cache, null);
            PXUIFieldAttribute.SetRequired <Users.displayName>(AllUsers.Cache, false);
            PXUIFieldAttribute.SetReadOnly <Users.displayName>(AllUsers.Cache, null);
            PXUIFieldAttribute.SetDisplayName <Users.displayName>(AllUsers.Cache, "Action1");
            PXUIFieldAttribute.SetNeutralDisplayName(AllUsers.Cache, nameof(Users.displayName), "Action1");

            var newList = new Users.state.List();

            PXStringListAttribute.SetList <Users.state>(AllUsers.Cache, null, newList);
            PXStringListAttribute.AppendList <Users.state>(AllUsers.Cache, null, newList.ValueLabelDic.Keys.ToArray(), newList.ValueLabelDic.Values.ToArray());
            PXStringListAttribute.SetLocalizable <Users.displayName>(AllUsers.Cache, null, false);
            PXIntListAttribute.SetList <Users.loginTypeID>(AllUsers.Cache, null, new[] { 0, 1 }, new[] { "A", "B" });
        }
        protected virtual void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            APInvoice document = e.Row as APInvoice;

            if (document == null)
            {
                return;
            }

            var invoiceState = Base.GetDocumentState(cache, document);

            addLandedCost.SetVisible(invoiceState.IsDocumentInvoice || invoiceState.IsDocumentDebitAdjustment);

            PXUIFieldAttribute.SetEnabled(LandedCostDetailsAdd.Cache, null, false);

            bool allowAddLandedCost = invoiceState.IsDocumentEditable &&
                                      invoiceState.LandedCostEnabled &&
                                      !invoiceState.IsRetainageDebAdj;

            addLandedCost.SetEnabled(allowAddLandedCost);
            PXUIFieldAttribute.SetEnabled <POLandedCostDetailS.selected>(LandedCostDetailsAdd.Cache, null, allowAddLandedCost);
        }
Exemple #30
0
        protected virtual void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            APInvoice document = e.Row as APInvoice;

            if (document == null)
            {
                return;
            }

            var invoiceState = Base.GetDocumentState(cache, document);

            addReceiptLine.SetVisible(invoiceState.IsDocumentInvoice);

            PXUIFieldAttribute.SetEnabled(poReceiptLinesSelection.Cache, null, false);

            bool allowAddReceiptLine = invoiceState.IsDocumentEditable &&
                                       invoiceState.AllowAddPOByProject &&
                                       Base.vendor.Current != null &&
                                       !invoiceState.IsRetainageDebAdj;

            addReceiptLine.SetEnabled(allowAddReceiptLine);
            PXUIFieldAttribute.SetEnabled <POReceiptLineS.selected>(poReceiptLinesSelection.Cache, null, allowAddReceiptLine);
        }