You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"message": "The document number has already been <strong>taken</strong>. (and 8 more errors)",
"errors": {
"document_number": [
"The document number has already been <strong>taken</strong>."
],
...
}
Additional comments
I can't use the invoice update route (PUT) because of this validation error
and I can't use the partial invoice update (PATCH) route because such a route does not exist
Also, I can’t use the /:id/cancelled or /:id/unpaid route because they don’t exist either.
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Same applies to updating of a transaction. I think that it is by design. I am updating a transaction in one of my workflows and I update directly the db entry. If you have to use the API to update the invoice (or anything else in Akaunting I guess) I suggest you do the required update and change the document number to some high number. Then you update it again with the original number. It costs you two transactions but it is the only workaround so far.
The reason for this issue is that the update method is PUT. Try updating with PATCH.
In this PR, I fixed the issue in the PUT method. The problem will be solved in the new version.
Akaunting version
3.0.17
PHP version
8.1.24
Operating system
Debian GNU/Linux 11
Steps to reproduce
API route
PUT {{akaunting_url}}/documents/1?type=invoice&search=type:invoice&status=unpaid
https://www.postman.com/akaunting/workspace/akaunting/request/27090236-ca517d8e-c4b6-452b-b235-edd1d9ada799
Expected result
Invoice updated with same document_number
Actual result
422 Unprocessable Entity
Additional comments
I can't use the invoice update route (PUT) because of this validation error
and I can't use the partial invoice update (PATCH) route because such a route does not exist
Also, I can’t use the /:id/cancelled or /:id/unpaid route because they don’t exist either.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: