Query approval procedure-SO approval if there is due invoices >=90days
My customer is running 2007A PL30. He needs approval procedure for SO to be approved if the customer has overdue invoices more than 90 days.
Any idea how to write the query?
This is surely doable. It can only be done through user query. Try this one:
SELECT distinct 'true' from OINV T0 where T0.CardCode = $[$4.0.0] and DateDiff(DD, GetDate(), T0.DocDueDate) >= 90 and T0.DocTotal > T0.PaidToDate and T0.DocStatus = 'O'
It can not be run directly. Assign to approval template directly to see.