Open meomancer opened 2 months ago
Hi @meomancer can you please try to add the following field to your request?
"doc_status": 1
the 1 means the doc is submitted to allow the status to be changed to "To Bill" etc
Still not working on my side, is it working on your side @voogt ?
{
"doc_status": 1,
"status": "To Bill"
}
Apologies @meomancer it was a spelling mistake from my part The method should be POST and not PUT the body should be as follows
{
"docstatus": 1
}
If the status is Draft and the above api call was made the the Sales order will be submitted and the status of Sales Order will update to "Deliver and Bill"
Hi @voogt Could you provide me how to change status
Draft
On Hold
To Deliver and Bill
To Bill
To Deliver
Completed
I tried using "docstatus": 2, it does not change
Hi @meomancer erp does not allow for docstatus to have a number 2. 0 means its still in draft and 1 means it submitted. I did a bit more testing, erp wont let me change the status to "To Bill" etc. after I have updated the doctstatus to 1. The reason for this is erp wants to keep the data integrity of the sales order. My proposed workflow is the following
{"per_billed": 100}
{"per_delivered": 100}
{"status": "Completed", "docstatus": 1}
GeoHosting will update Order Sale status on the ERP But the problem is when updating status to To Bill, To Deliver and Completed it change back to draft again on erpnext, so not sure how to fix it.
Example order status: PUT https://kartoza-staging-v14.frappe.cloud/api/resource/Sales Order/SAL-ORD-2024-00268
Payload
Maybe there is requirements for other fields to make the specific status?