Hi Jessica
Try the below query
SELECT Distinct
t0.docnum as 'Sales Order',
t3.docnum as 'Delivery Note',
T5.DocNum as 'Invoice',
t3.docdate as 'D/Note Date',
t3.docstatus as 'Open/Closed',
t0.numatcard as 'Customer Ref No.',
t1.subcatnum as 'Customer No.',
t1.Itemcode as 'Item Code',
t1.dscription as 'Description',
t1.quantity as 'Quantity',
t1.price as 'Price',
t1.linetotal as 'Total Value'
FROM ordr t0
inner join rdr1 t1 on t0.docentry = t1.docentry
inner join dln1 t2 on t2.baseentry = t0.docentry and t1.linenum = t2.baseline
inner join odln t3 on t3.docentry = t2.docentry
LEFT JOIN INV1 T4 ON T4.BaseEntry=T3.DocEntry
LEFT JOIN OINV T5 ON T5.DocEntry=T4.DocEntry
WHERE
t0.cardcode = '[%0]'
ORDER BY
t0.docnum,
t2.docentry
FOR BROWSE
With Regards
Balaji Sampath