Formatted Search - Invoice & Credit Memo
I am trying to create a formatted search that calculates commission when an invoice or credit memo is added. We have a UDF where commission is entered when creating the Sales Order (U_CommPct).
Essentially, I need the following calculation to occur when the invoice or credit memo is added
(Total Before Discount * U_CommPct)/100
Ranu Vijay replied
i wrote this SQL query which satisfies your requirement , u will have to do little manual work like first add the invoice and then update udf to get the desired result . i would like some SQL EXPERTS to convert this SQL query into fms .
SELECT ( (((T0.DocTotal - T0.VatSum) - T0.TotalExpns ) * $[oinv.u_comm] ) / 100 ) FROM oinv t0 WHERE T0.Docnum = $[oinv.docnum.number]