to get a personalized navigation.
to get a personalized navigation.
Hello
We are trying to add a voucher to an existing batch through the api, but are getting the error "Voucher no. XXXXXX is used before".
We need to use the same voucher number, and adding a voucher with the same number works in the ui, see below.
How do we make it work using the api?
Here is our request.
mutation add_voucher {
useCompany(no: 2860985) {
voucher_create(
values: [{
batchNo: 27
voucherNo: 2191594
lineNo: 4
voucherType: 26
valueDate: 20240930
voucherDate: 20240930
debitAccountNo : 4011 # material
amountInCurrency: 4154
orgUnit1: 2
orgUnit2: 219890
}]
) {
affectedRows
items {
batchNo
voucherNo
voucherDate
valueDate
}
}
}
}
Works in the ui:
@jakob_sdf I am not able to reproduce the issue when I test with your mutation, so a little hard to tell based on the given info. The mutation in itself works just fine, but I would skip the lineNo from the input, as it is not necessary when you create new vouchers.
No need to use the insert row option in the UI, you can just start in the first column (Ver.nr.) on the new line, the insert-options are meant for inserting line in between the exisiting.
We actually get the same error (but in swedish) when we start in the first column as you described. But using the insert option it works. Still haven't got it to work in the api.
Could it be some configuration in the customer's NXT that causes this error?
Yes, check if the voucher no. control is enabled in the company information table.
Copyright © 2022 Visma.com. All rights reserved.