fix: SCR return status (#36793)

This commit is contained in:
s-aga-r 2023-08-24 10:13:47 +05:30 committed by GitHub
parent 54ffe41b54
commit 723563c167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,17 +270,24 @@ class SubcontractingReceipt(SubcontractingController):
status = "Draft"
elif self.docstatus == 1:
status = "Completed"
if self.is_return:
status = "Return"
return_against = frappe.get_doc("Subcontracting Receipt", self.return_against)
return_against.run_method("update_status")
elif self.per_returned == 100:
status = "Return Issued"
elif self.docstatus == 2:
status = "Cancelled"
if self.is_return:
frappe.get_doc("Subcontracting Receipt", self.return_against).update_status(
update_modified=update_modified
)
if status:
frappe.db.set_value("Subcontracting Receipt", self.name, "status", status, update_modified)
frappe.db.set_value(
"Subcontracting Receipt", self.name, "status", status, update_modified=update_modified
)
def get_gl_entries(self, warehouse_account=None):
from erpnext.accounts.general_ledger import process_gl_map