Client does not use sales order. For all sales Directly sales Invoice is used.
There are several sales Invoices for different customers which have same Lot no.
By filtering from Lot No, A Single sales invoice is required, summarizing all the sales.
Hi, This is what exactly I want to Achieve. In want a report equivalent to this SQL Query
SELECT SUM([NAV_Test_DB$Sales Invoice Line].Quantity) AS [Total items Sold in this Lot],
SUM([NAV_Test_DB$Sales Invoice Line].[Demanded Quantity]) AS [Total Items demanded for this Lot],
SUM([NAV_Test_DB$Sales Invoice Line].[Remaining Quantity]) AS [Remaining items to be Sold],
[NAV_Test_DB$Sales Invoice Line].No_
FROM [NAV_Test_DB$Sales Invoice Header] INNER JOIN
[NAV_Test_DB$Sales Invoice Line] ON
[NAV_Test_DB$Sales Invoice Header].No_ = [NAV_Test_DB$Sales Invoice Line].[Document No_]
WHERE ([NAV_Test_DB$Sales Invoice Header].LotNo = @LotNo)
GROUP BY [NAV_Test_DB$Sales Invoice Line].No_
Which produced this Result.
@lotNo = 22
Total items Sold in this Lot | Total Items demanded for this Lot | Remaining items to be Sold | Item Code