Dear All,
Please help me with code to get the tax per line on Sales Invoice reports. I have below code its working fine on SalesLine form to get calculated tax per line. But please help me how I need to call this method in SalesInvoiceDP class. I need to show per Line in SalesInvoice Report with below code.
display TaxAmountCur saleslinewisetax(boolean _adjustTaxSign = true, boolean _includeUseTax = false) { SalesTotals salesTotals; TaxAmountCur taxAmountCur; salesTotals = SalesTotals::construct(this.salesTable()); salesTotals.calc(); salesTotals.tax().sourceSingleLine(true, true); taxAmountCur = salesTotals.tax().totalTaxAmountSingleLine(this.TableId, this.RecId, _adjustTaxSign, _includeUseTax); return taxAmountCur; }
Regards,
Faqru
*This post is locked for comments
Check below code. Its also calculating tax per line.
Thanks Faruq. Can you display TaxAmount per line without customization. In my case it is calculating but not showing per line so I did that customization on SalesInvoice? Can you please confirm.
Thanks Rana. I check only SalesInvoice code and its working. Also I found standard field _custInvoiceTrans.TaxAmount calculating salestax per line.
Its working with me for SalesQuotation and SalesInvoice reports. This code is to show TaxCode and TaxAmount on SQ and SO invoice line level.
SalesQuotationDP -> setSalesQuotationDetailsTmp
// Declaration
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; }
Hello Mr. Ludwig,
The reports you shared its ok. But I'm looking for if customer needs tax amount per each item id at Sales Invoice level. Is there any standard field to do this. I'm having issue to call above code in Sales Invoice report per each item id.
Regards,
Faqru
Hi Faqru,
The parameter actually just calculates the tax per line instead of the invoice total.
I do not know what you try to achieve with this report/report adjustment.
Before making an adjustment, please check the standard tax reports that are available.
There is for example a sales tax by customer report available in GL.
Then you have a sales tax Transactions - Details report available in GL
Finally, there is the transaction origin report that shows you the different ledgers and tax amounts posted
Example:
And if this one is not sufficient, then you have the sales tax transactions report available that lists all tax transactions individually.
Hope this helps.
Best regards,
Ludwig
This is our SalesInvoice report design. Wants to show Tax Code and Amount for each item line.
Can we get it by setup or by customization?
Thanks,
Thanks Ludwig. This parameter is already setup. But I need tax per line for each item id for the sales invoice report. But I don't know what field is activated by setting this parameter.
Dear Ludwig Reinhard,
Please guide this setup, we also want to show TaxAmount and TaxCode on SalesInvoice report at line level.
Thanks
Hi Faqru,
I referred to the following parameter:
Best regards,
Ludwig
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156