web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Tax Per Line for Reports

(0) ShareShare
ReportReport
Posted on by 1,883

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

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Faqru,

    Why don't you simply setup your sales tax calculation at the line level?

    There is a GL Parameter that allows you doing that.

    Have you tested this?

    Best regards,

    Ludwig

  • Faqruddin Profile Picture
    1,883 on at

    Hello Mr. Ludwig,

    Could you please help ,me with this parameter and how to activate it. And where it will reflects.

    Regards,

    Faqru

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Faqru,

    I referred to the following parameter:

    taxgl.png

    Best regards,

    Ludwig

  • Rana Anees Profile Picture
    1,813 on at

    Dear Ludwig Reinhard,

    Please guide this setup, we also want to show TaxAmount and TaxCode on SalesInvoice report at line level.

    Thanks

  • Faqruddin Profile Picture
    1,883 on at

    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.

  • Rana Anees Profile Picture
    1,813 on at

    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?

    VATperLine.png

    Thanks,

  • Verified answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    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:

    0310.st.png

    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

  • Faqruddin Profile Picture
    1,883 on at

    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

  • Verified answer
    Rana Anees Profile Picture
    1,813 on at

    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;
        }
  • Verified answer
    Faqruddin Profile Picture
    1,883 on at

    Thanks Rana. I check only SalesInvoice code and its working. Also I found standard field _custInvoiceTrans.TaxAmount calculating salestax per line.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans