My Products
Help
product_scansys_nl
CONTRIBUTOR **

Duplicate records returned by supplierInvoice

by product_scansys_nl

When performing a GET on /controller/api/v1/supplierInvoice for company ID 1940810 referenceNumber 210202306 is returned twice and all values in all fields are identical. Our software uses referenceNumber as the primary key when storing the returned data. Is it correct behavior that this record is returned twice?

7 REPLIES 7
product_scansys_nl
CONTRIBUTOR **

by product_scansys_nl

This issue has been fixed by the Development Team.

Thank you for confirming that the issue has been resolved. 

product_scansys_nl
CONTRIBUTOR **

by product_scansys_nl
  • The customer has made screenshots and the invoice appears only once in the GUI, but the amount in the opened invoice is correct (Screenshot_1.png), yet the amount in the list of invoices is double (Screenshot_2.png).
  • We do not use ManualNumbering.
  • We no longer have the POST request JSON that created 210202306. As an example we've sent the POST request JSON that created referenceNumber 210202621 (POST.json).
  • The response body JSON is in three pages with the duplicate in GET_page_3.json.
  • All files have been sent to: developersupport@visma.com
Accepted solution
Yıldırım
VISMA

by Yıldırım (Updated ‎30-07-2021 15:22 by Yıldırım VISMA )

Hi Michel, thank you for the information you've provided in detail. 

 

It seems that there has been a double registration in the DB during the POST Supplier Invoice operation while creating (210202306) . 

 

When I've done a semantic comparison between returned lines for (210202306) although a slight one, but the only difference is "CreatedDateTime"

 

1st Occurrence of  Sup. Invoice: 210202306

JSONCompare_1st_occ.png

2nd Occurrence of  Sup. Invoice: 210202306

JSONCompare_2nd_occ.png

 

When it comes to,


@product_scansys_nl wrote:
  • The customer has made screenshots and the invoice appears only once in the GUI, but the amount in the opened invoice is correct (Screenshot_1.png), yet the amount in the list of invoices is double (Screenshot_2.png).

I assume that the amount of the invoice has been aggregated in the ERP UI List View since there are 2 identical records in the DB (API fetches directly from DB)  And somehow the 2nd occurrence is not shown in the UI.

 

I'm not sure how this was technically possible without API returning any error / DB PK check, but apparently this has been caused by a deadlock.

 

We'll need to escalate this to our Development Team to inspect the situation directly on the data. We'll send you an instruction about how to proceed further regarding this case via email. 

product_scansys_nl
CONTRIBUTOR **

by product_scansys_nl

The documentType for both records is also identical, "Invoice". We are using api/v1/supplierInvoice, so without documenttype and invoicenumber in the request, to get multiple supplier invoices in the response. referenceNumber in the response when posting a supplier invoice is what we use as invoicenumber in requests when we do send a request for one particular supplier invoice, so {supplierInvoiceDocType} + {invoiceNumber} is not unique for company ID 1940810.

Yıldırım
VISMA

Do you see / able to find out those duplicate invoices in the Financials UI ? Please check and send us a print screen.

Are you using ManualNumbering when Posting the Supplier Invoices ? Please send us your POST request JSON .

You can send aforementioned and the following info to developersupport@visma.com

  • Returned response body JSON where we can see the duplicate supplier invoices in detail.
Yıldırım
VISMA

by Yıldırım

What is the "documentType" of the invoices ?   (Invoice - CreditAdj - DebitAdj - Prepayment)

  • The unique identifier for the Supplier Invoice is a combination of {supplierInvoiceDocType} + {invoiceNumber}. 

Meaning,  invoices can have the same referenceNumber if their types are different since they'll be representing the different assets.
Each invoice document types also have their own Numbering Series. 


Those different types of invoices can be specifically fetched via the following endpoint.
Visma.net Integrations Documentation.png