fix: don't set rejected-qty
in return SCR
This commit is contained in:
parent
c013db6ea1
commit
8a73e963ce
@ -404,12 +404,17 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None):
|
||||
returned_qty_map = get_returned_qty_map_for_row(
|
||||
source_parent.name, source_parent.supplier, source_doc.name, doctype
|
||||
)
|
||||
target_doc.received_qty = -1 * flt(
|
||||
source_doc.received_qty - (returned_qty_map.get("received_qty") or 0)
|
||||
)
|
||||
target_doc.rejected_qty = -1 * flt(
|
||||
source_doc.rejected_qty - (returned_qty_map.get("rejected_qty") or 0)
|
||||
)
|
||||
|
||||
if doctype == "Subcontracting Receipt":
|
||||
target_doc.received_qty = -1 * flt(source_doc.qty)
|
||||
else:
|
||||
target_doc.received_qty = -1 * flt(
|
||||
source_doc.received_qty - (returned_qty_map.get("received_qty") or 0)
|
||||
)
|
||||
target_doc.rejected_qty = -1 * flt(
|
||||
source_doc.rejected_qty - (returned_qty_map.get("rejected_qty") or 0)
|
||||
)
|
||||
|
||||
target_doc.qty = -1 * flt(source_doc.qty - (returned_qty_map.get("qty") or 0))
|
||||
|
||||
if hasattr(target_doc, "stock_qty"):
|
||||
|
Loading…
Reference in New Issue
Block a user