feat: allow the partial return of components against SCO (backport #35935) (#35938)

* fix: don't update SCO status to closed until full return

(cherry picked from commit 2f6d56dd62)

* fix: reduce return qty while calculating transferred qty

(cherry picked from commit 2a60884abc)

# Conflicts:
#	erpnext/controllers/subcontracting_controller.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot]
2023-06-29 22:16:53 +05:30
committed by GitHub
parent a880bdec5e
commit 6f50ad685e
2 changed files with 43 additions and 37 deletions

View File

@@ -163,9 +163,10 @@ class SubcontractingOrder(SubcontractingController):
elif self.per_received > 0 and self.per_received < 100:
status = "Partially Received"
for item in self.supplied_items:
if item.returned_qty:
status = "Closed"
if not item.returned_qty or (item.supplied_qty - item.consumed_qty - item.returned_qty) > 0:
break
else:
status = "Closed"
else:
total_required_qty = total_supplied_qty = 0
for item in self.supplied_items: