Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status on Order Status can't be changed #150

Open
meomancer opened this issue Sep 20, 2024 · 5 comments
Open

Status on Order Status can't be changed #150

meomancer opened this issue Sep 20, 2024 · 5 comments
Assignees
Milestone

Comments

@meomancer
Copy link
Collaborator

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

{
    "status": "To Bill"
}

Maybe there is requirements for other fields to make the specific status?

@voogt
Copy link

voogt commented Sep 20, 2024

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

@meomancer
Copy link
Collaborator Author

Still not working on my side, is it working on your side @voogt ?

{
           "doc_status": 1,
            "status": "To Bill"
        }
        ```

@voogt
Copy link

voogt commented Sep 20, 2024

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"
image

@meomancer
Copy link
Collaborator Author

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

@voogt
Copy link

voogt commented Sep 23, 2024

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

  1. Create a put request with the following body to update the amount billed to 100% {"per_billed": 100}
  2. Create a put request with the following body to update the amount delivered to 100% {"per_delivered": 100}
  3. Finally create a put request with the following body to update the status as completed and to submit the sales order {"status": "Completed", "docstatus": 1}

@meomancer meomancer added this to the MVP milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants