Suggest Vendor Payments skipping

raven44raven44 Member Posts: 85
Report 393 - Suggest Vendor Payments
When trying to run the report for a Vendor that already has unposted applications (Eg. "Applies-to ID" field is populated by some other application in another journal batch) this results in an error due to code:

Function: MakeGenJnlLines()
..
VendLedgEntry.TESTFIELD("Applies-to ID",'');
..


:?: What is the reasoning for not filtering these type of records out before creating the journal lines (something similar to below):
Eg.

Function: GetVendLedgEntries(Positive : Boolean;Future : Boolean)

VendLedgEntry.RESET;
VendLedgEntry.SETCURRENTKEY("Vendor No.",Open,Positive,"Due Date");
VendLedgEntry.SETRANGE("Vendor No.",Vendor."No.");
VendLedgEntry.SETRANGE(Open,TRUE);
VendLedgEntry.SETRANGE(Positive,Positive);

//Skip entries already applied
IF SummarizePerVend THEN
VendLedgEntry.SETFILTER("Applies-to ID",'=%1','')
ELSE
VendLedgEntry.SETFILTER("Applies-to Doc. No.",'=%1','');

Any comments?

Comments

Sign In or Register to comment.