to get a personalized navigation.
to get a personalized navigation.
In a program, we are trying to update customer invoice lines by assigning a deferral key, start date for deferral, and end date for deferral. We use the endpoint [PUT] https://integration.visma.net/API/controller/api/v1/customerinvoice/{invoiceNumber} and send a JSON payload as shown below.
Bug: When we attempt to update more than 5 lines, only the first lines are assigned the deferral key, while all lines are assigned the start and end dates for deferral. The issue has been reproduced in the demo environment (see attachment). This applies to deferral keys with the accounting method "Flexible by periods, proportional over days."
Hi Charlotte! Unfortunately we do not see a JSON payload or attached screenshots. Can you add these? Thx in advance 🙂
{ "ReferenceNumber": null, "Note": { "Value": "" }, "DocumentDate": null, "CurrencyId": null, "CreditTermsId": null, "Hold": null, "BranchNumber": null, "ExternalReference": null, "CustomerRefNumber": null, "InvoiceText": null, "ExchangeRate": null, "CustomerNumber": null, "SalesPerson": null, "LocationId": null, "InvoiceLines": [ { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 1 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } }, { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 2 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } }, { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 3 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } }, { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 4 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } }, { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 5 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } }, { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 6 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } }, { "InventoryNumber": null, "Description": null, "Quantity": null, "UnitPriceInCurrency": null, "Note": null, "Subaccount": null, "VatCodeId": null, "AccountNumber": null, "Operation": "Update", "LineNumber": { "Value": 7 }, "ManualDiscount": null, "DiscountPercent": null, "DiscountAmountInCurrency": null, "DeferralCode": { "Value": "06I1" }, "TermStartDate": { "Value": "2025-01-01T00:00:00" }, "TermEndDate": { "Value": "2025-12-31T00:00:00" } } ]}
Thank you for the information. I have used your script and were able to update the invoice without problems. Can you describe the precise steps to reproduce this problem?
The goal was to update invoicerows by polling GET on already existing invoice rows which had article, description, amount, unit, price, account, and subaccounts on them. We extract the dates from the description and assign them to the accrual dates along with an accrual key in a mapped update dto. If the invoice had more then five rows, only the first five rows would receive the updated accrual key, but all would receive the dates. Meaning we would have updated all rows but missing accrual keys on n-5 rows. This was also tested in a demo company so it has to be a bug. The workaround is currently to post (n = rows) n/5 customer invoices (same invoice head) with 5 rows of update dto each.
Copyright © 2022 Visma.com. All rights reserved.