Hello,
@product_scansys_nl wrote:
The ledger and sub accounts however are reset to the default values 7110 and 02-91- (the values from the purchase order line; screenshot available). The chosen values 7120 and 03-91- should be kept.
By default, the linked Purchase Order selected line's "Subaccount" and "Account" values will be inherited to the to Supplier Invoice's line regardless of its initial values for the Subaccount" and "Account" .
@product_scansys_nl wrote:
Is it correct to first create the invoice (invoice.json) and after that link the order/receipt (invoice_update.json)? We do this, because linking the order/receipt line in the initial POST does not work.
This is correct. This is not possible to link the Purchase Order / Receipt during the creation of the Supplier Invoice (POST). In order to be able to Link a Supplier Invoice line with a Purchase Order / Purchase Receipt Line,
Firstly, Supplier Invoice must be created with the desired item/s in the invoice line/s.
Then we can link Purchase Order / Receipt via PUT request
Supplier Invoice status can be BALANCED & ON HOLD
To be linked Purchase Order status can be OPEN & CLOSED on the UI
To be linked Purchase Receipt status should be RELEASED on the UI
The documents whose lines are being linked to the invoice should have the same currency, the same supplier, and the same supplier location. The line that can be linked to the invoice line should have the same item ID and UoM.
@product_scansys_nl wrote:
A workaround was tried to (again) send the ledger and sub account information in the update, but this only works for the sub accounts.
In this case you can include the "Subaccount" and "Account" values those have been used in the initial POST - Supplier Invoice, again in the PUT - Supplier Invoice (Link Line) Request.
Otherwise, you should set the Purchase Order's "Subaccount" and "Account" values to what is desired to be set on the Supplier Invoice.
PUT > https://integration.visma.net/API/controller/api/v1/supplierInvoice/xxx
{
"documentType": {
"value": "Invoice"
},
"invoiceLines": [
{
"operation": "Update",
"lineNumber": {
"value": 1
},
"accountNumber": {
"value": "7120"
},
"subaccount": [
{
"segmentId": 1,
"segmentValue": "03"
},
{
"segmentId": 2,
"segmentValue": "91"
}
],
"linkLine": {
"purchaseType": "PurchaseOrder",
"purchaseNumber": {
"value": "000045"
},
"purchaseLineNbr": {
"value": 1
}
}
}
]
}
... View more