private void SetNumbering(PXCache sender, AP.Standalone.APQuickCheck row) { if (row == null) { return; } if (Base.IsWithinContext) { Numbering numbering = PXSelectJoin <Numbering, InnerJoin <GLWorkBook, On <GLWorkBook.voucherNumberingID, Equal <Numbering.numberingID> > >, Where <GLWorkBook.workBookID, Equal <Required <GLWorkBook.workBookID> > > > .Select(this.Base, Base.GetContextValue <GLVoucherBatch.workBookID>()); AutoNumberAttribute.SetNumberingId <AP.Standalone.APQuickCheck.refNbr>(sender, row.DocType, numbering.NumberingID); if (numbering.UserNumbering == true) { sender.RaiseExceptionHandling <AP.Standalone.APQuickCheck.refNbr>(row, row.RefNbr, new PXException(GL.Messages.ManualNumberingDisabled)); } } }
protected virtual void APQuickCheck_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected bs) { if (bs != null) { bs(sender, e); } AP.Standalone.APQuickCheck row = e.Row as AP.Standalone.APQuickCheck; if (row == null) { return; } bool isWithinContext = Base.IsWithinContext; GLVoucher voucher = this.Voucher.Select(); GLVoucherBatch voucherBatch = this.VoucherBatch.Select(); PXCache voucherCache = this.Voucher.Cache; bool isDetached = (voucher == null); PXUIFieldAttribute.SetEnabled <GLVoucher.refNbr>(voucherCache, voucher, false); PXUIFieldAttribute.SetVisible <GLVoucher.refNbr>(voucherCache, voucher, !isDetached); PXUIFieldAttribute.SetEnabled <AP.Standalone.APQuickCheck.refNbr>(sender, e.Row, !isWithinContext); this.SaveAndAdd.SetVisible(!isDetached && isWithinContext); this.SaveAndAdd.SetEnabled(!isDetached && isWithinContext); if (isWithinContext) { Base.release.SetVisible(false); Base.release.SetEnabled(false); Base.voidCheck.SetVisible(false); Base.voidCheck.SetEnabled(false); } PXUIFieldAttribute.SetVisible <GLVoucher.voucherBatchNbr>(Voucher.Cache, null, !isDetached && !isWithinContext); PXUIFieldAttribute.SetVisible <GLVoucher.workBookID>(Voucher.Cache, null, !isDetached && !isWithinContext); if (isWithinContext && !isDetached) { sender.AllowInsert = !(voucherBatch != null && voucherBatch.Released == true); } }