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 GP (Archived)

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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Community Member Profile Picture
    on at

    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.

  • Saju Foddu Profile Picture
    140 on at

    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

  • Saju Foddu Profile Picture
    140 on at

    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

  • Suggested answer
    Chris Roehrich Profile Picture
    289 on at

    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.

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,095 Most Valuable Professional on at

    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.

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 GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans