【发布时间】:2021-06-15 12:45:06
【问题描述】:
然后我使用了以下代码:
namespace PX.Objects.AP
{
public class APReleaseProcess_Extension : PXGraphExtension<APReleaseProcess>
{
public delegate List<APRegister> ReleaseDocProcDel(JournalEntry je, ref APRegister doc, PXResult<APInvoice,
CurrencyInfo, Terms, Vendor> res, bool isPrebooking,
out List<INRegister> inDocs);
[PXOverride]
public List<APRegister> ReleaseDocProc(JournalEntry je, ref APRegister doc,
PXResult<APInvoice, CurrencyInfo, Terms, Vendor> res,
bool isPrebooking,
out List<INRegister> inDocs, ReleaseDocProcDel del)
{
je.RowInserting.AddHandler<GLTran>((sender, e) =>
{
GLTran glTran = e.Row as GLTran;
APTran apTran = PXResult<APTran>.Current;
if (glTran != null && apTran != null)
{
APTranExt apTranEx = PXCache<APTran>.GetExtension<APTranExt>(apTran);
if (apTran != null && apTranEx.UsrJobOrderNbr != null)
{
GLTranExt glTranEx = PXCache<GLTran>.GetExtension<GLTranExt>(glTran);
glTranEx.UsrJobOrderNbr = apTranEx.UsrJobOrderNbr;
}
}
//APInvoice apInv = PXResult<APInvoice>.Current;
APInvoice apInv = PXSelect<APInvoice,
Where<APInvoice.refNbr, Equal<Required<GLTran.refNbr>>,
And<APInvoice.docType,
Equal<Required<GLTran.tranType>>>>>.Select(sender.Graph, glTran.RefNbr, glTran.TranType);
if (glTran != null && apInv != null)
{
GLTranExt glTranEx = PXCache<GLTran>.GetExtension<GLTranExt>(glTran);
glTranEx.UsrInvoiceNbr = apInv.InvoiceNbr;
}
APTaxTran apTaxTran = PXResult<APTaxTran>.Current;
if (glTran != null && apTaxTran != null)
{
APTaxTranExt apTaxTranEx = PXCache<APTaxTran>.GetExtension<APTaxTranExt>(apTaxTran);
if (apTaxTran != null && apTaxTranEx != null)
{
GLTranExt glTranEx = PXCache<GLTran>.GetExtension<GLTranExt>(glTran);
glTranEx.UsrNoSeriFaktur = apTaxTranEx.UsrNoSeriFaktur;
}
}
}
);
return del(je, ref doc, res, isPrebooking, out inDocs);
}
}
}
我尝试调试此代码,但没有命中断点,这是自定义按钮释放的正确方法吗? 有人知道这个问题吗?
【问题讨论】:
标签: c# customization acumatica erp