I added a custom field UsrHoldForPaymentProcess to the Bills and Adjustments screen. This field gets created in the APRegister table. It is a checkbox to indicate that we do not want to show this bill on the Approve Bills for Payment screen.
On the Approve Bills for Payment screen, I want to only show Bills that do not have the UsrHoldForPaymentProcess field set to true.
One problem I see is that the select statement for the Approve Bills screen pulls from APInvoice, not APRegister.
To adjust what gets displayed in the grid, I want to override this method in the APApproveBills graph
private static Type getAPDocumentSelect(bool groupBy = false)
I cannot seem to get the override correct as I get an error that the signature does not match.
public delegate Type getAPDocumentSelectDelegate(bool groupBy = false);
ePXOverride]
public static Type getAPDocumentSelect(bool groupBy, getAPDocumentSelectDelegate baseMethod)
I tried to do what would seem like the EASY approach by adding a Where to the View in the initialize, but it does not have any impact.
Since the APDocumentList view uses the APInvoice table for the select, for testing, I created another extension field in the APInvoice table with the same Usr field name as in the APRegister table. In SQL, I updated one record so that the field is set to true. But the bill still shows in the grid.
public override void Initialize()
{
this.Base.APDocumentList.WhereAnd<Where<TenFedAPInvoiceExt.usrHoldForPaymentProcess, IsNull, Or<TenFedAPInvoiceExt.usrHoldForPaymentProcess, Equal<boolFalse>>>>();
}
I think if I can get the signature figured out, I can do the join from APInvoice to APRegister and restrict the returned query to remove the records where my Usr field is true. It means copying a lot of Acumatica lines and making a couple tweaks, but I think that would work.
Help! :-)