Approval Template based on overdue invoices for a Region
We have set an approval template for all overdue invoices which should go to the repsective sales managers for approval.
We have setup two approval templates one for Central region and one for NES region.
The template involves running of the following query and going to the respective manager for approval, however this does not work.
When we create a seperate location wise approval template it works:
Please check and let me know the error if any:
SELECT DISTINCT 'TRUE' FROM OINV T0 and OCRD T1 WHERE T1.CardCode =
$[$4.0.0] and T1.U_AT_PC = 'NES' and T0.DocDueDate <= Getdate() AND T0.DocStatus !='C' AND $[ORDR.CARDCODE] = T0.CARDCODE