How to print sales order totals in infolog.

Print sales order totals in infolog : -

static void printSalesorders(Args _args)
{
    SalesTable              salesTable;
    SalesTotals             salesTotals;
    real             CostValue,ContributionMargin,ContributionRatio,CreditMax,FreeValue,ExchRate,sumLines,InvoiceRoundOff,InvoiceAmount,CashDisc;
    str                     CurrencyCode;

    salesTable      =   SalesTable::find("000713");
    salesTotals     =   SalesTotals::construct(SalesTable);
    
    CostValue                        =   salesTotals.totalCostValue();
    ContributionMargin        =   salesTotals.totalContributionMargin();
    ContributionRatio           =   salesTotals.totalContributionRatio();
    CreditMax                       =   salesTotals.creditMax();
    FreeValue                        =   salesTotals.totalFreeValue();
    ExchRate                         =   salesTotals.exchRate();
    CurrencyCode                 =   salesTotals.currencyCode();
    sumLines                        =   salesTotals.totalAmount();
    InvoiceRoundOff             =   salesTotals.totalRoundOff();
    InvoiceAmount               =   salesTotals.totalAmount();
    CashDisc                            =   salesTotals.totalCashDisc();


    info(strfmt("cost value     %1 \n contribution margin   %2 \n contribution ratio    %3 \n crediMax  %4 \n free value    %5 \n ExchRate      %6 \n CurrancyCode      %7 \n Sum lines     %8 \n Invoice round off     %9 \n Invoice amount     %10 \n Cash disc   %11",CostValue,ContributionMargin,ContributionRatio,CreditMax,FreeValue,ExchRate,CurrencyCode,sumLines,InvoiceRoundOff,InvoiceAmount,CashDisc) );

}







Comments