elow job gives Sales Total details i.e. fetching sales order totals (Total Discount, Subtotal Amount & Invoice Amount)
static void ShyamSalesTotalJob(Args _args)
{
//Total Discount from Sales Totals form
SalesTable salesTable1;
salesTable1= SalesTable::find(“000746”,false);
SalesTotals salesTotals;
salesTotals = SalesTotals::construct(salesTable1, salesUpdate::All);
container displayFields;
displayFields = SalesTotals::displayFieldsServer(salesTable1,SalesUpdate::All,salesTotals.CurrencyCode());
DiscAmount totalDisc=0;RealBase subTotal=0;AmountCur invoiceAmount=0;
//Total Discount
totalDisc = conpeek(displayFields, TradeTotals::posEndDisc());
info(Strfmt("Total discount %1", totalDisc));
//Subtotal Amount
subTotal=conpeek(displayFields, TradeTotals::posBalance());
info(Strfmt("Subtotal Amount %1", subTotal));
//Invoice Amount
invoiceAmount =conpeek(displayFields, TradeTotals::posTotalAmount());
info(Strfmt("Invoice Amount %1", invoiceAmount));
}
No comments:
Post a Comment