I added a new filter to Prepare payment(AP503000). The filter works as expected.
After testing I realized that the Pay Date(APInvoice.PayDate) doesn't show data in the grid
How can I make the paydate data show?
I see that a lot of the data comes from APAdjust and the data missing comes from APInvoice.
CODE:
namespace PX.Objects.AP
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class APPayBills_Extension : PXGraphExtension<APPayBills>
{
#region Event Handlers
[PXFilterable]
public PXFilteredProcessingJoin<
APAdjust, PayBillsFilter,
InnerJoin<APInvoice,
On<APInvoice.docType, Equal<APAdjust.adjdDocType>,
And<APInvoice.refNbr, Equal<APAdjust.adjdRefNbr>>>,
LeftJoin<APTran,
On<APInvoice.paymentsByLinesAllowed, Equal<True>,
And<APTran.tranType, Equal<APAdjust.adjdDocType>,
And<APTran.refNbr, Equal<APAdjust.adjdRefNbr>,
And<APTran.lineNbr, Equal<APAdjust.adjdLineNbr>>>>>>>>
APDocumentList;
protected virtual IEnumerable apdocumentlist()
{
PayBillsFilter row;
row = Base.Filter.Select();
PayBillsFilterExt payBillsFilterExt = row.GetExtension<PayBillsFilterExt>();
foreach (APAdjust item in Base.APDocumentList.Select())
{
if (!string.IsNullOrEmpty(payBillsFilterExt.UsrEPEmployee))
{
//To test remove all code and only leave the else ( yield return item;)
BAccount bAccount = PXSelect<
BAccount,
Where<BAccount.bAccountID, Equal<Required<APAdjust.vendorID>>>>
.Select(Base, item.VendorID);
BAccountExt bAccountExt = bAccount.GetExtension<BAccountExt>();
if (bAccountExt.UsrEmployeeID == payBillsFilterExt.UsrEPEmployee)
{
yield return item;
}
}
else
{
yield return item;
}
}
}
#endregion
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…