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

This commit is contained in:
s-aga-r 2023-06-29 18:44:40 +05:30
parent 50cbdc778f
commit 2f6d56dd62

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: