cancel
Showing results for 
Search instead for 
Did you mean: 

Query approval procedure-SO approval if there is due invoices >=90days

Former Member
0 Kudos

Hi,

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?

Regards

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thomas,

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.

Thanks,

Gordon

Former Member
0 Kudos

Hi Gordon,

The script cannot work. I can still add in Sales Order even though the customer had 1 AR Invoice which is due more than 90 days.

Regards

Thomas

Former Member
0 Kudos

Please check the said invoice to see which conditions are not meet. Then change them to meet your need.

You have to define what is overdue by your own example.

Thanks,

Gordon

Answers (1)

Answers (1)

former_member186095
Active Contributor
0 Kudos

Hi,

Check this thread and if not resolve, pls come back to us.

Rgds,