I am looking a SQL query which will help me to auto generate Voucher and Adjustment Entry records.
I did not able to locate tables for below values.
PrePay and Landed Cost
Please let me know if any one has idea or any one have data structure diagram of Dynamics SL.
Finally i find it for Pre-Pay
SELECT APADJUST.adjdrefnbr,
APADJUST.adjgrefnbr,
APADJUST.adjamt
FROM APADJUST,
APDOC WITH (nolock)
WHERE
APADJUST.adjddoctype = APDOC.doctype AND
APDOC.refnbr = APADJUST.adjdrefnbr AND
APADJUST.vendid = APDOC.vendid AND
APADJUST.adjddoctype = 'pp' AND
APADJUST.s4future11 <> 'v' AND
APADJUST.adjamt > 0 AND
APDOC.docbal <> APDOC.origdocamt AND
APADJUST.vendid = 'E01181' AND
APADJUST.adjdrefnbr LIKE '%'
ORDER BY APADJUST.adjdrefnbr
OPTION(fast 500)