Skip to main content

Posts

Showing posts with the label vendor purchase

Code to get Sales and purchase Quantity and amount date and item wise in MSD Axapta

To  get Sales and purchase Quantity and amount date wise in Axapta you can try following code in Fetch method of customized Report to get the same. Query q; QueryRun qr; QueryBuildDatasource qbds; QueryBuildRange qbr; InventTable inventtab; CustInvoiceTrans _custInvoiceTrans; vendInvoiceTrans _vendInvoiceTrans ; q = this.Query(); qbds = q.addDataSource(tablenum(InventTable)); qr = new QueryRun(q); while(qr.next()) { inventtable = qr.get(tableNum(InventTable)); select sum(Qty),sum(LineAmount) from _vendInvoiceTrans where _vendInvoiceTrans.ItemId==_ItemId &&_vendInvoiceTrans.InvoiceDate >= fromDate &&_vendInvoiceTrans.InvoiceDate <= ToDate; _PurchQty=_vendInvoiceTrans.Qty; _PurchAmount=_vendInvoiceTrans.LineAmount; select sum(Qty),sum(LineAmount) from _CustInvoiceTrans where _CustInvoiceTrans.ItemId==_ItemId &&_CustInvoiceTrans.InvoiceDate >= fromDate &&_CustInvoiceTrans.InvoiceDate <=...