Merge pull request #51305 from mihir-kandoi/gh45824

This commit is contained in:
Mihir Kandoi
2025-12-31 14:56:38 +05:30
committed by GitHub
parent cb5926f59b
commit 87d00a373f
5 changed files with 186 additions and 13 deletions

View File

@@ -1454,9 +1454,11 @@ class StockEntry(StockController, SubcontractingInwardController):
)
).run()[0][0] or 0
if flt(total_supplied - total_returned, precision) > flt(total_allowed, precision):
if flt(total_supplied + se_item.transfer_qty - total_returned, precision) > flt(
total_allowed, precision
):
frappe.throw(
_("Row {0}# Item {1} cannot be transferred more than {2} against {3} {4}").format(
_("Row #{0}: Item {1} cannot be transferred more than {2} against {3} {4}").format(
se_item.idx,
se_item.item_code,
total_allowed,
@@ -3080,7 +3082,7 @@ class StockEntry(StockController, SubcontractingInwardController):
child_qty = flt(item_row["qty"], precision)
if not self.is_return and child_qty <= 0 and not item_row.get("is_scrap_item"):
if self.purpose != "Receive from Customer":
if self.purpose not in ["Receive from Customer", "Send to Subcontractor"]:
continue
se_child = self.append("items")