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)

eConnect error creating Purchase Invoice

(0) ShareShare
ReportReport
Posted on by 70

I am trying to create Enter/Match invoice using CreatePurchaseInvoice method.

Getting following error

 A validation exception has occurred.
Validation Errors:
- There are no Receipts to match against

I am using  PurchaseInvoice and PurchaseInvoiceLine class. Setting PO details. But not using Shipping Receipt numbers and I want the system to automatically match it.

Is it possible to create Enter/Match Invoice using eConnect. If so please can you help in what I am missing. I took the sample from help file as baseline to create my program.

 Thanks, Srini

*This post is locked for comments

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

    Ssesh

    Shipment Receipt Number is required if you want to match the invoice to shipment. The default vaue is blank and not required if the invoice is not to be matched to a shipment.

  • ssesh Profile Picture
    70 on at

    Thank you!

  • ssesh Profile Picture
    70 on at

     I wanted to avoid this scenario of me giving Shipment rcpt numbers and system automatically apply it as it does it in the screen.

    I will pass Shipment receipt number. Thanks for the help.

  • ssesh Profile Picture
    70 on at

    Hi Janakiram,

    I am having trouble creating the taxes for Invoce Line and header.

    I am setting values for TaxBasis, ItemTaxScheduleKey, WarehouseTaxScheduleKey,   TaxAmount and Taxes properties in PurchaseInvoiceLine object. Here there is no issues. API creates taxes correctly.

     On the PurchaseInvoice  object I am setting TaxScheduleKey and TaxAmount properties.

    Issue on the header is it is not calculating the Total Purchases in the header Tax details.

    Please can you help me in what am I missing in this ? Also do you have any code snippet for setting the Freight and Discounts.

    Thanks,

    Srini

  • Community Member Profile Picture
    on at

    Ssesh,

    The  Invoice Header Tax (TAXAMNT) amount should be equal to the total of each value of invoice line's tax amounts. If the Header Tax amount is not equal to the line tax amounts, then you will have this problem. Remember the freight or misc tax amounts are not considered for validation.

     

  • ssesh Profile Picture
    70 on at

    Invoice is created in GP there is no issue.

    On the Tax details of the Header, it is not calculating Total Purchases. It is calculating Total  Taxable Purchases and Taxes correctly.

    I pasted the Code snippet below how I am creating Taxes for Line and header. I commented out headers Taxamount, Taxable amount and Total Amount. If I set the Total Amount it API does not create Invoices. I am pretty close but missing a key information to set it correctly.

     Also is there any good documentations about this API. I do have programmers guide but it is not much helpful on the taxes.

    Thanks a lot for your help.  

     

    private static PurchaseInvoiceTax CreatePOLineTax(PurchaseTransactionKey ptranskey, String GL, decimal taxvalue, decimal purchaseamt)

    {

    PurchaseInvoiceTax pitax = new PurchaseInvoiceTax();

     

    GLAccountNumberKey glkey = new GLAccountNumberKey();

    glkey.Id = GL;

    TaxDetailKey tdkey = new TaxDetailKey();

    tdkey.Id = "CA-SM" ;

    MoneyAmount taxamount = new MoneyAmount();taxamount.Currency = "USD";

    taxamount.Value = taxvalue;

    taxamount.DecimalDigits = 2;

    MoneyAmount taxableamt = new MoneyAmount();taxableamt.Currency="USD";

    taxableamt.Value = purchaseamt;

    PurchaseTaxKey ptkey = new PurchaseTaxKey();

    ptkey.PurchaseTransactionKey = ptranskey;

    ptkey.TaxDetailKey = tdkey;

    pitax.Key = ptkey;

    pitax.GLAccountKey = glkey;

    pitax.TaxAmount = taxamount;

    pitax.TaxableAmount = taxableamt ;

    pitax.TotalAmount = taxableamt;

    return pitax;

    }

    private static PurchaseInvoiceTax CreatePOTax(PurchaseTransactionKey ptranskey, String GL, decimal taxvalue, decimal purchaseamt, decimal purchasetotalamt)

    {

    PurchaseInvoiceTax pitax = new PurchaseInvoiceTax();GLAccountNumberKey glkey = new GLAccountNumberKey();

    glkey.Id = GL;

    TaxDetailKey tdkey = new TaxDetailKey();

    tdkey.Id = "CA-SM";

    MoneyAmount taxamount = new MoneyAmount();

    taxamount.Currency = "USD";

    taxamount.Value = taxvalue;

    taxamount.DecimalDigits = 2;

    MoneyAmount taxableamt = new MoneyAmount();taxableamt.Currency = "USD";

    taxableamt.Value = purchaseamt;

    MoneyAmount taxtotalamt = new MoneyAmount();

    taxtotalamt.Currency = "USD";

    taxtotalamt.Value = purchasetotalamt;

    PurchaseTaxKey ptkey = new PurchaseTaxKey();

    ptkey.PurchaseTransactionKey = ptranskey;

    ptkey.TaxDetailKey = tdkey;

    pitax.Key = ptkey;

    pitax.GLAccountKey = glkey;

    //pitax.TaxAmount = taxamount;

    //pitax.TaxableAmount = taxableamt;

    //pitax.TotalAmount = taxtotalamt;

    return pitax;

    }

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