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
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.
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.
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
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
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.
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