Thursday, December 31, 2015

Sales quotation GST through X++

X++ code to achieve this;
static void SalesTax_Per_SalesQuotation(Args _args)
{
    SalesQuotationTable     salesQuotationTable;
    SalesQuotationTotals    salesQuotationTotals;
    container               cont;
   
    salesQuotationTotals = SalesQuotationTotals::construct(SalesQuotationTable::find("QUOT000022"));
    salesQuotationTotals.calc();
    cont         = salesQuotationTotals.displayFieldsCurrency(salesQuotationTotals.currencyCode());
    info(strFmt("Sales quotation total GST: %1", conpeek(cont, TradeTotals::posTaxTotal())));
}