Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 17314

Code to get Sales order Total Value in Axapta | calculate total for sales order

$
0
0
This is sample Code to get Sales order Total Value in Axapta. You can try this job in Your Ax environment to check all vales . It will work well with open and Invoiced status sales order I hope it will help you and save your lot of time.

 static void SalesTotalAmountJOb(Args _args)  
{
SalesTotals salesTotals;
SalesTable salesOrderTable;
SalesLine salesLine;
TaxAmountCur salesAmt,taxAmount,amt1,discountAmt,totcharges,totOfOrder,contributionRatio;
Tax tax;
;
salesOrderTable = SalesTable::find("TD_SO_00069218");
salesLine = SalesLine::find(salesOrderTable.SalesId);
salesTotals = SalesTotals::construct(salesOrderTable);
tax = Tax::construct(NoYes::No);
salesAmt = salesTotals.totalBalance();
taxAmount = salesTotals.totalTaxAmount();
discountAmt = salesTotals.totalEndDisc();
totcharges = salesTotals.totalMarkup();
totOfOrder = salesTotals.totalAmount();
contributionRatio = salesTotals.totalContributionRatio();
info(Strfmt("Sales Lines Amount %1",salesAmt ));
info(Strfmt("The VAT\tax amount is %1",taxAmount ));
info(Strfmt("The Discount Value is %1",discountAmt ));
info(Strfmt("Misc Markup %1",totcharges ));
info(Strfmt("Total Invoice Amount %1",totOfOrder ));
info(Strfmt("Total Contribution ratio %1",contributionRatio ));
}


Viewing all articles
Browse latest Browse all 17314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>