Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Include Tax details while creating Purchase order using dynamics GP Web Service

Posted on by 140

Hi,
I am trying to include tax details while creating purchase order using dynamics GP Webservice.I am using web service method "CreatePurchaseOrder" to create purchase order in GP.Tried using different properties exposed in PurchaseOrder Class and PurchaseOrderLine Class but all the tries gone in vain.

I have tried following scenarios to include tax with purchase order.

Scenario 1:

1. I have created new Taxdetails in Tools>Setup>Company>Tax Details .
2. Then created Tax schedule and associated Tax details with it.
3. Then given TaxScheduleKey in PurchaseOrder Property.


Code Snippet:


purchaseOrder.TaxScheduleKey = new TaxScheduleKey { Id = "TESTTAX" }



Scenario 2:

1. I have created new Taxdetails in Tools>Setup>Company>Tax Details .
2. Then created Tax schedule and associated Tax details with it.
3. Associated Tax schedule Id in Vendor.
4. Given tax based on vendor using PurchasingTaxBasis.BasedOnVendor.

Code Snippet:

purchaseOrderLine.TaxBasis = PurchasingTaxBasis.BasedOnVendor


Scenario 3:

1. I have created new Taxdetails in Tools>Setup>Company>Tax Details .
2. Then created Tax schedule and associated Tax details with it.
3. Given Tax details in Taxes property of PurchaseOrder Class and PurchaseOrderLine Class.

Code Snippet:

        PurchaseTax purchaseTax = new PurchaseTax
            {
                Key = new PurchaseTaxKey
                {
                    TaxDetailKey = new TaxDetailKey
                    {
                        Id = "TEST + TAX001"
                    }
                }
            };
            PurchaseTax[] tax = { purchaseTax };
            purchaseOrder.Taxes = tax;



Please Help.



Thanks in Advance
Saju

*This post is locked for comments

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,917 Most Valuable Professional on at
    Re: Include Tax details while creating Purchase order using dynamics GP Web Service

    Please note that there is no tax engine for POP in eConnect (and so Web Services). If you want to help raise the priority of getting a tax engine, please vote for it using MS Connect (link below).

    There is a product suggestion on a PO tax engine for eConnect and IM at connect.microsoft.com/.../gp-integration-manager-pop-tax-calculation.

  • Suggested answer
    Chris Roehrich Profile Picture
    Chris Roehrich 289 on at
    Re: Include Tax details while creating Purchase order using dynamics GP Web Service

    I was able to get it to work for both detailed and header only instances.  

    For detailed,  use the Taxes (ArrayofPurchaseTax) property and the TaxAmount property on onnly the PO line.  Then on the PurchaseOrder, you only need to supply the TaxAmount.  

    For header only taxes, don’t do anything with taxes on the PO line and use the Taxes (ArrayofPurchaseTax) property and the TaxAmount property only on the PO header.  When using header level taxes only, the sequence number for the tax detail key should be 0:

    poTax = new PurchaseTax();

               poTax.Key = new PurchaseTaxKey();

               poTax.Key.PurchaseTransactionKey = purchaseOrderKey;

               poTax.Key.TaxDetailKey = new TaxDetailKey();

               poTax.Key.TaxDetailKey.Id = "USEXMT+PSONO";

               poTax.Key.SequenceNumber = 0;

    The Microsoft.Dynamics.GP.PurchaseOrderCreate.xslt file handles the USINGHEADERLEVELTAXES flag so this is why you either set the Taxes on either each line or the header:

    <!-- If there is one or more taxes on the line, usingHeaderTaxes = 0 else 1-->

                              <xsl:choose>

                                     <xsl:when test = "Lines/PurchaseOrderLine/Taxes/PurchaseTax">

                                            <USINGHEADERLEVELTAXES>0</USINGHEADERLEVELTAXES>

                                     </xsl:when>

                                     <xsl:otherwise>

                                            <USINGHEADERLEVELTAXES>1</USINGHEADERLEVELTAXES>

                                     </xsl:otherwise>

                              </xsl:choose>

    From the GP2010 Web Services Help file regarding the Taxes property:

    The collection of taxes for the purchase order.

    Do not set this value if you are also setting taxes on the Purchase Order Line. Setting tax information on both the purchase order and purchase order line is not supported.

  • Saju Foddu Profile Picture
    Saju Foddu 140 on at
    Re: Include Tax details while creating Purchase order using dynamics GP Web Service

    Hi Francisco,

    I am using version 11. Please help me how to proceed further how to include tax details while creating Purchase Order using web service.

    Thanks,

    Saju

  • Saju Foddu Profile Picture
    Saju Foddu 140 on at
    Re: Include Tax details while creating Purchase order using dynamics GP Web Service

    Thank you for your reply.

    I am using

    Microsoft Dynamics GP  Version - 11.00.1247 (RTM)

    Microsoft Dynamics GP  Server  -  Dynamics GP 2010

    Regards,

    Saju

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Include Tax details while creating Purchase order using dynamics GP Web Service

    Good Day, can you tell me which version of web services are you using? if its for Version 10 or lower I am afraid you wont be able to accomplish this task, I have solve it using the user defined fields and have a person add the tax in GP.

    If you are using 2010 then it should have been resolved as i was told in Connect that it was a feature added to this particular version.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans