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 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)); }
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 <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 void _(Events.RowSelected <CAAdj> e, PXRowSelected InvokeBaseHandler) { InvokeBaseHandler?.Invoke(e.Cache, e.Args); ManGUIBank.Cache.AllowSelect = activateGUI; ManGUIBank.Cache.AllowDelete = ManGUIBank.Cache.AllowInsert = ManGUIBank.Cache.AllowUpdate = !e.Row.Status.Equals(CATransferStatus.Released); }
protected virtual void SOLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseHandler) { baseHandler?.Invoke(sender, e); if (!(e.Row is SOLine row)) { return; } SOOrderEntryPCExt graphExt = Base.GetExtension <SOOrderEntryPCExt>(); var extrows = Base.Transactions.Cache.GetExtension <SOLinePCExt>(row); if (extrows.UsrKNMasterLineNbr != null && string.IsNullOrEmpty(extrows.UsrKNCompositeInventory)) { using (new PXConnectionScope()) { if (extrows.UsrKNMasterLineNbr != row.LineNbr) { SOLine parentRow = PXSelect <SOLine, Where <SOLine.orderNbr, Equal <Required <SOLine.orderNbr> >, And <SOLine.lineNbr, Equal <Required <SOLine.lineNbr> > > > > .Select(Base, row.OrderNbr, extrows.UsrKNMasterLineNbr).RowCast <SOLine>().First(); extrows.UsrKNCompositeInventory = graphExt.InventoryItems.SelectSingle(parentRow.InventoryID)?.InventoryCD; } if (extrows.UsrKNMasterLineNbr == row.LineNbr) { extrows.UsrKNCompositeInventory = KCMessages.CompositeItemLinePlaceholder; extrows.UsrKNInventoryCD = graphExt.InventoryItems.SelectSingle(row.InventoryID)?.InventoryCD; } } } }
protected virtual void CROpportunityProducts_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected sel) { sel?.Invoke(cache, e); if (e.Row == null) { return; } CROpportunityProducts crOpportunityProductsRow = (CROpportunityProducts)e.Row; 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); } } }
/// <summary> RowSelected CROpportunity </summary> public void _(Events.RowSelected <CROpportunity> e, PXRowSelected baseMethod) { baseMethod?.Invoke(e.Cache, e.Args); var wgID = (e.Row as CROpportunity).WorkgroupID; var role = new PublicFunc().CheckAcessRoleByWP(PXAccess.GetUserID(), wgID); if (!role && wgID.HasValue) { throw new PXException("You don't have right to read this data."); } }
protected virtual void PMQuote_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected sel) { sel?.Invoke(sender, e); var row = e.Row as PMQuote; if (row == null) { return; } VisibilityHandler(sender, row); }
protected virtual void _(Events.RowSelected <SOShipment> e, PXRowSelected baseHandler) { baseHandler?.Invoke(e.Cache, e.Args); SOShipment row = (SOShipment)e.Row; if (row == null) { return; } e.Cache.AllowUpdate = true; PXUIFieldAttribute.SetEnabled <SOShipmentExt.usrCarrierPluginID>(e.Cache, null, true); PXUIFieldAttribute.SetEnabled <SOShipmentExt.usrWaybill>(e.Cache, null, true); }
/// <summary> Set Date Code DDL </summary> protected void _(Events.RowSelected <SOPackageDetailEx> e, PXRowSelected baseMethod) { baseMethod?.Invoke(e.Cache, e.Args); if (e.Row != null) { var splitData = SelectFrom <SOShipLineSplit> .Where <SOShipLineSplit.shipmentNbr.IsEqual <P.AsString> .And <SOShipLineSplit.lineNbr.IsEqual <P.AsInt> > > .View.Select(Base, e.Row.ShipmentNbr, e.Row.GetExtension <SOPackageDetailExt>().UsrShipmentSplitLineNbr).RowCast <SOShipLineSplit>();; PXStringListAttribute.SetList <SOPackageDetailExt.usrDateCode>( e.Cache, e.Row, splitData.Select(x => x?.LotSerialNbr).ToArray(), splitData.Select(x => x?.LotSerialNbr).ToArray()); } }
protected void _(Events.RowSelected <APInvoice> e, PXRowSelected baseHandler) { baseHandler?.Invoke(e.Cache, e.Args); var row = e.Row as APInvoice; if (row != null) { ManualAPBill.Cache.AllowSelect = TWNGUIValidation.ActivateTWGUI(Base); ManualAPBill.Cache.AllowDelete = ManualAPBill.Cache.AllowInsert = ManualAPBill.Cache.AllowUpdate = row.Status.IsIn(APDocStatus.Hold, APDocStatus.Balanced); } //PXUIFieldAttribute.SetVisible<APRegisterExt.usrDeduction>(e.Cache, null, activateGUI); //PXUIFieldAttribute.SetVisible<APRegisterExt.usrGUIDate>(e.Cache, null, activateGUI); //PXUIFieldAttribute.SetVisible<APRegisterExt.usrGUINbr>(e.Cache, null, activateGUI); //PXUIFieldAttribute.SetVisible<APRegisterExt.usrOurTaxNbr>(e.Cache, null, activateGUI); //PXUIFieldAttribute.SetVisible<APRegisterExt.usrTaxNbr>(e.Cache, null, activateGUI); //PXUIFieldAttribute.SetVisible<APRegisterExt.usrVATInCode>(e.Cache, null, activateGUI); }
protected virtual void MobileNotification_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseMethod) { if (baseMethod != null) { baseMethod.Invoke(cache, e); } var row = e.Row as MobileNotification; if (row == null) { return; } bool isTeamsNotification = row.DeliveryType == (byte)3; PXUIFieldAttribute.SetVisible <MobileNotification.destinationEntityID>(cache, row, !isTeamsNotification); PXUIFieldAttribute.SetVisible <MobileNotification.destinationScreenID>(cache, row, !isTeamsNotification); PXUIFieldAttribute.SetVisible <MobileNotification.subject>(cache, row, !isTeamsNotification); PXUIFieldAttribute.SetVisible <MobileNotification.nfrom>(cache, row, !isTeamsNotification); PXUIFieldAttribute.SetVisible <MobileNotification.nto>(cache, row, !isTeamsNotification); PXUIFieldAttribute.SetVisible <MobileNotificationExt.usrTo>(cache, row, isTeamsNotification); PXDefaultAttribute.SetPersistingCheck <MobileNotification.nto>(cache, row, isTeamsNotification ? PXPersistingCheck.Nothing : PXPersistingCheck.NullOrBlank); }
protected void CROpportunity_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected sel) { sel?.Invoke(cache, e); if (e.Row == null) { return; } CROpportunity crOpportunityRow = (CROpportunity)e.Row; 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); } EnableDisableCustomFields(cache, crOpportunityRow, fsxCROpportunityRow, fsServiceOrderRow, fsSrvOrdTypeRow); EnableDisableActions(cache, crOpportunityRow, fsxCROpportunityRow, fsServiceOrderRow, fsSrvOrdTypeRow); SetPersistingChecks(cache, crOpportunityRow, fsxCROpportunityRow, fsSrvOrdTypeRow); }
public virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del) { del?.Invoke(cache, e); AddBlanketOrderLineAction.SetEnabled(!IsBlanketOrder); PXUIFieldAttribute.SetVisible <SOLineDAExtension.dABlanketOrderQty>(Base.Transactions.Cache, null, IsBlanketOrder); }
protected virtual void SOShipment_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseHandler) { baseHandler?.Invoke(sender, e); if (e.Row == null) { return; } SOShipment row = (SOShipment)e.Row; KCSOShipmentExt rowKCExt = row.GetExtension <KCSOShipmentExt>(); SOOrderShipment orderShipment = PXSelect <SOOrderShipment, Where <SOOrderShipment.shipmentNbr, Equal <Required <SOOrderShipment.shipmentNbr> > > > .Select(Base, row.ShipmentNbr); if (orderShipment != null) { SOOrder order = PXSelect <SOOrder, Where <SOOrder.orderNbr, Equal <Required <SOOrder.orderNbr> > > > .Select(Base, orderShipment.OrderNbr); bool?FBA = order?.GetExtension <KCSOOrderExt>().UsrKCSiteName?.EndsWith("/FBA"); var buttonMenus = (Base.Actions["action"].GetState(null) as PXButtonState)?.Menus; if (FBA == true) { bool enable = Base.Accessinfo.ScreenID == "KC.50.10.00"; var reportMenus = (Base.report.GetState(null) as PXButtonState)?.Menus; foreach (var action in reportMenus) { action.Enabled = enable; } foreach (var action in buttonMenus) { if (action.Text != "Prepare Invoice") { action.Enabled = enable; } } Base.Actions["InventorySummary"].SetEnabled(enable); Base.Actions["LSSOShipLine_binLotSerial"].SetEnabled(enable); Base.CarrierRatesExt.recalculatePackages.SetEnabled(enable); Base.UpdateIN.SetEnabled(enable); Base.Delete.SetEnabled(enable); sender.AllowUpdate = enable; Base.Transactions.Cache.AllowInsert = enable; Base.Transactions.Cache.AllowUpdate = enable; Base.Transactions.Cache.AllowDelete = enable; Base.OrderList.View.AllowInsert = enable; Base.OrderList.View.AllowUpdate = enable; Base.OrderList.View.AllowDelete = enable; } else if (rowKCExt?.UsrKCExported == true) { foreach (var action in buttonMenus) { if (action.Text.Equals("Correct Shipment")) { action.Enabled = false; } } } } }