Skip to content

Commit

Permalink
fix: calculate percentage received and delivered considering over-rec…
Browse files Browse the repository at this point in the history
…eipt and over-delivery (frappe#43870)
  • Loading branch information
nabinhait authored Oct 29, 2024
1 parent 34295d0 commit adba116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion erpnext/buying/doctype/purchase_order/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def update_reserved_qty_for_subcontract(self):
def update_receiving_percentage(self):
total_qty, received_qty = 0.0, 0.0
for item in self.items:
received_qty += item.received_qty
received_qty += min(item.received_qty, item.qty)
total_qty += item.qty
if total_qty:
self.db_set("per_received", flt(received_qty / total_qty) * 100, update_modified=False)
Expand Down
2 changes: 1 addition & 1 deletion erpnext/selling/doctype/sales_order/sales_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def update_delivery_status(self):
item_delivered_qty = item_delivered_qty[0][0] if item_delivered_qty else 0
item.db_set("delivered_qty", flt(item_delivered_qty), update_modified=False)

delivered_qty += item.delivered_qty
delivered_qty += min(item.delivered_qty, item.qty)
tot_qty += item.qty

if tot_qty != 0:
Expand Down

0 comments on commit adba116

Please sign in to comment.