This code is to show TaxCode and TaxAmount on SQ and SO invoice line level.
SalesQuotationDP -> setSalesQuotationDetailsTmp
TmpTaxWorkTrans tmpTax; SalesQuotationTable salesQuotationTable; SalesQuotationTotals_Sales salesQuotationTotals; salesQuotationTable = SalesQuotationTable::find(custQuotationTrans.origQuotationId); salesQuotationTotals = SalesQuotationTotals_Sales::construct(salesQuotationTable); // Calculate Tax salesQuotationTotals.calc(); // Load tmpTaxWorkTrans tmpTax.setTmpData(salesQuotationTotals.tax().tmpTaxWorkTrans()); while select tmpTax where tmpTax.InventTransId == custQuotationTrans.InventTransId && tmpTax.Company == custQuotationTrans.dataAreaId { //info( strFmt('%1 : %2' , tmpTax.TaxCode, -tmpTax.TaxAmount)); salesQuotationTmp.TaxCode = tmpTax.TaxCode; salesQuotationTmp.TaxAmount = -tmpTax.TaxAmount; } if(salesQuotationTmp.TaxCode == '') { salesQuotationTmp.TaxCode = '0.00'; }
SlaesInvoiceDP -> insertIntoSalesInvoiceTmp
SalesTable salesTable; SalesTotals salesTotals; TaxTrans taxTrans; select taxTrans where taxTrans.InventTransId == _custInvoiceTrans.InventTransId; //salesInvoiceTmp.TaxValue = taxTrans.TaxValue; salesInvoiceTmp.TaxAmount = -taxTrans.TaxAmount; if(taxTrans.TaxCode == '') { salesInvoiceTmp.TaxCode = '0.00'; } else { salesInvoiceTmp.TaxCode = taxTrans.TaxCode; }