Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to set calculated tax with eConnect for Dynamics GP

Posted on by 75

Hello, I hope you can help me with my concern about eConnect.

To get into context, I have this application that calls the data through an API of a system that the client has, I store this information in a database and when the user decides to send it to GP as a sales request, my system checks if it exists the customer and the article, if so, proceed to create the order through eConnect.

This is my system:

pastedimage1624581404188v1.png

 for (int i = 0; i < ListFaceSelection.Count;i  )
                {
                    decimal amount = decimal.Round(ListFaceSelection.ElementAt(i).Gross_Amount,2);
                    salesLine.ADDRESS1 = "2345 Main St.";
                    salesLine.CUSTNMBR = ListFaceSelection.ElementAt(i).taxIDNumber;
                    salesLine.CITY = "Aurora";
                    salesLine.SOPTYPE = 2;
                    salesLine.DOCID = "STDORD";
                    salesLine.QUANTITY = 1;
                    salesLine.ITEMNMBR = ListFaceSelection.ElementAt(i).number;
                    salesLine.ITEMDESC = ListFaceSelection.ElementAt(i).description;
                    salesLine.UNITPRCE = amount;
                    salesLine.XTNDPRCE = amount;
                    salesLine.LOCNCODE = "WAREHOUSE";
                    salesLine.DOCDATE = System.DateTime.Today.ToString("MM/dd/yyyy", dateFormat);

                    // Add the SOP line item object to the array
                    LineItems[i] = salesLine;

                    
                }



                // Create a taSopHdrIvcInsert object and populate its fields
                taSopHdrIvcInsert salesHdr = new taSopHdrIvcInsert();
               
                salesHdr.SOPTYPE = 2;
                salesHdr.DOCID = "STDORD";
                salesHdr.BACHNUMB = "LOAYUDA";
                salesHdr.TAXSCHID = "USASTCITY-6*";
                salesHdr.FRTSCHID = "USASTCITY-6*";
                salesHdr.MSCSCHID = "USASTCITY-6*";
                salesHdr.LOCNCODE = "WAREHOUSE";
                salesHdr.DOCDATE = System.DateTime.Today.ToString("MM/dd/yyyy", dateFormat);
                salesHdr.CUSTNMBR = Campaing.taxIDNumber;
                salesHdr.CUSTNAME = Campaing.Advertiser;
                salesHdr.ShipToName = "WAREHOUSE";
                salesHdr.ADDRESS1 = "2345 Main St.";
                salesHdr.CNTCPRSN = "Joe Healy";
                salesHdr.FAXNUMBR = "13125550150";
                salesHdr.CITY = "Aurora";
                salesHdr.STATE = "IL";
                salesHdr.ZIPCODE = "65700";
                salesHdr.COUNTRY = "USA";
                salesHdr.SUBTOTAL = Campaing.Amount;
                salesHdr.DOCAMNT = Campaing.Amount;
                salesHdr.USINGHEADERLEVELTAXES = 0;
                salesHdr.PYMTRMID = "Net 30";
                salesHdr.CSTPONBR = Campaing.salesContractNumber;

                // Create a eConnect SOPTransactionType schema object
                SOPTransactionType salesOrder = new SOPTransactionType();

                // Populate the schema object with the SOP header and SOP line item objects
                salesOrder.taSopLineIvcInsert_Items = LineItems;
                salesOrder.taSopHdrIvcInsert = salesHdr;

With this code is that I create the header and lines of my sales order.

Everything works fine, but I need the articles to calculate the tax based on the established tax plan

pastedimage1624581625008v2.png

Ojo: si corto y pego el mismo plan de impuestos, el sistema lo calcula solo, pero necesito que lo haga sin la intervención del usuario

pastedimage1624581715248v3.png

I want to know if there is any way to do this, preferably with eConnect.

Thank you!

Categories:
  • MDittmer Profile Picture
    MDittmer 5 on at
    RE: How to set calculated tax with eConnect for Dynamics GP

    Isaac - We also use eConnect to push invoices from our custom front-end system to GP.   Want to start utilizing date-effective sales taxes, but cannot get eConnect to recognize the date effective tax rate schedule.   Are there any parameters that we might be missing?  ( Once the invoice is in a GP Batch, if I change the document date, the recalculate taxes message box will pop up and work as expected. )

    Thanks in advance

  • Verified answer
    Isaac Olson Profile Picture
    Isaac Olson on at
    RE: How to set calculated tax with eConnect for Dynamics GP

    Hi Marcos,

    That is great to hear!  When you install eConnect there is going to be a help file under (C:\Program Files (x86)\Microsoft Dynamics\eConnect 18.0\Help) called eConnectProgrammersGuide.chm.  This file has samples, and breakdowns of parameters that can be passed in.  This is a great tool and reference when it comes to troubleshooting and setting up integrations with eConnect.

    I hope this helps!

    Isaac Olson

    Microsoft Support

  • Verified answer
    Isaac Olson Profile Picture
    Isaac Olson on at
    RE: How to set calculated tax with eConnect for Dynamics GP

    Hello,

    It can be difficult to troubleshoot issues like this through a forum post, but looking through the eConnect Programmers Guide, I am wondering if you are just missing the CREATETAXES flag on your taSopHdrIvcInsert?

    Taxes   Use the <taSopHdrIvcInsert> XML node to control how taxes are calculated. To use header level taxes, set the header level taxes (USINGHEADERLEVELTAXES) element to 1. To use detailed taxes, set USINGHEADERLEVELTAXES to 0. The default value for USINGHEADERLEVELTAXES is 0. If you set USINGHEADERLEVELTAXES to 1, be aware of the following:

    • Header level taxes only specify tax information when the line sequence element of the <taSopLineIvcTaxInsert> XML node is set to 0. To use header level taxes when the tax is set as “tax included in item price”, you must include a sequence number in the tax node. eConnect automatically creates the 0 sequence number tax layer. As a result, the tax amount is not passed to either the header or the line, and it does not reduce the document amount or the subtotal. You must manually calculate the tax amount and specify that along with the reduced sales amount in the <taSopLineIvcTaxInsert> XML node. To simplify using “tax included in item price” you should set the CREATETAXES element of the <taSopHdrIvcInsert> node to 1. This allows eConnect to autocreate taxes. The following display how to populate select elements when using header level taxes and a tax detail of “tax include in item price”:
    <taSopLineIvcTaxInsert>
    LNITMSEQ = 16384,/*Required-Line item sequence*/
    TAXDTLID = 'TAX IN ITEM',/*Required-the example uses 10% tax 
    included in item price */
    SALESAMT = 454.55,
    STAXAMNT = 45.45
    
    <taSopHdrIvcInsert
    TAXAMNT  = 0,
    SUBTOTAL = 500, /*Required*/
    DOCAMNT  = 500, /*Required*/
    USINGHEADERLEVELTAXES = 1,
    CREATETAXES = 0
    
    
    • You can use header level taxes with invoices that will be posted without being transferred, or with orders that will be fully transferred to invoices and then posted. When an order is partially transferred to invoices or back orders, the tax is recalculated. There are no details with header level taxes so when taxes are recalculated on a partially transferred order, the tax information is lost and not carried forward.
    • If you do not use the miscellaneous tax (MSCTXAMNT) and freight taxes (FRTTXAMNT) elements in the <taSopLineIvcTaxInsert> XML node, you must set the sales tax amount (STAXAMNT) element with the actual sales tax amount. If MSCTXAMNT and FRTTXAMNT are used, STAXAMNT is not used.
    • If you use the <taSopLineIvcInsertComponent> XML node to manually update components, the update does not automatically recalculate taxes. To ensure the update recalculates taxes, include the <taSopHdrIvcInsert> node, and set the CREATETAXES element to 1.

    Tax engine   eConnect includes a tax engine that allows you to automatically create taxes. If you use the tax engine, you no longer need to specify tax information in the tax nodes. The <taSopHdrIvcInsert> XML node contains six elements that control the tax engine. To use the tax engine, be aware of the following:

    • To use the tax engine, set the create taxes flag (CREATETAXES) element to 1 . If you are integrating your own taxes, set CREATETAXES to 0.

    • The freight tax schedule (FRTSCHID) and miscellaneous tax schedule (MSCSHID) elements mirror the tax schedule ID (TAXSCHID) element.
    • If the default tax schedule flag (DEFTAXSCHDS) element is set to 0, you must populate the TAXSCHID, FRTSCHID, and MSCSHID elements of the <taSopHdrIvcInsert> XML node. You must also set the item tax schedule ID (ITMTSHID) and the delivery method tax schedule ID (TAXSCHID) elements of the <taSopLineIvcInsert> XML node.
    • If the DEFTAXSCHDS element is set to 1, the tax schedule defined by setup will be the default. You must specify the shipping method (SHIPMTHD) element to provide the schedules used to create freight and miscellaneous tax for the SOP header. In addition, the ITMTSHID and TAXSCHID element of the <taSopLineIvcInsert> XML node must be excluded from the XML node or set to null. If you populate these two elements as blank (‘ ‘) it will blank out the schedules and no taxes will be created.
    • The freight taxable (FREIGTBLE) and miscellaneous amount taxable (MISCTBLE) elements in the <taSopHdrIvcInsert> XML node default to 0. Use these elements to indicate whether freight or miscellaneous charges are taxable. You set these elements to indicate whether these charges are taxable, nontaxable, or based on the customer’s tax schedules. These are the same options available in the Microsoft Dynamics GP client.
    • The inventory item taxable (IVITMTXB) element of the <taSopLineIvcInsert> node defaults to 0. You use this element to indicate whether the individual freight charge is taxable, nontaxable or based on the customer’s tax schedule. These are the same options available in the Microsoft Dynamics GP client.

    You may still use the tax nodes to calculate taxes. However, you no longer need to pass a sequence record of zero through the tax nodes. You only need a sequence record of zero when header level taxes are used. If you specify the taxes, the CREATETAXES element must be set to 0.

    I hope this helps!  If not maybe someone else in the community is running a similar integration and can share their setup or if you are still stumped we can take a closer look 1 on 1 through a support case. 

    Thanks!

    Isaac Olson

    Microsoft Support

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans