Skip to main content

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

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 ));  
   }  

Popular posts from this blog

How to set up parent project in project accounting in ax 2012

create simple project and then go to the project hierarchy fast tab and there you must define sub-project ID format "-#" and then your sub-project will be enabled. For resource assigning in Project first you need to configure the HR module, in that you need to maintain the calendar for those employees and then you need to define the cost of that particular employee (for expense) and for Revenue you need to define the sales price of that particular employee. In the project accounting module you need to mention the calendar in scheduling fast tab and then you need to define WBS, in WBS activity you can be able to assign resources.

ERD Account Payable and Account Receivable in ax 2012