I need to trigger an approval for any AP invoice that is 10% higher than the purchase order or the GRPO. Thank you!
SELECT distinct 'true' FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry left join PCH1 T2 on T2.[BaseEntry] = t1.docentry and T2.[BaseLine] = T1.[LineNum] INNER JOIN OPCH T3 ON T2.DocEntry = T3.DocEntry WHERE T0.DocTotal*1.10 > T3.DocTotal