Skip to content

Commit

Permalink
fix: billed_qty to show a sum of all invoiced qty from the purchase o…
Browse files Browse the repository at this point in the history
…rder item. (backport #37539) (#37558)

fix: billed_qty to show a sum of all invoiced qty from the purchase order item.

(cherry picked from commit 8a72f4f)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
  • Loading branch information
mergify[bot] and HarryPaulo authored Oct 18, 2023
1 parent e2e8949 commit ac7d6d6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import frappe
from frappe import _
from frappe.query_builder.functions import IfNull
from frappe.query_builder.functions import IfNull, Sum
from frappe.utils import date_diff, flt, getdate


Expand Down Expand Up @@ -57,7 +57,7 @@ def get_data(filters):
po_item.qty,
po_item.received_qty,
(po_item.qty - po_item.received_qty).as_("pending_qty"),
IfNull(pi_item.qty, 0).as_("billed_qty"),
Sum(IfNull(pi_item.qty, 0)).as_("billed_qty"),
po_item.base_amount.as_("amount"),
(po_item.received_qty * po_item.base_rate).as_("received_qty_amount"),
(po_item.billed_amt * IfNull(po.conversion_rate, 1)).as_("billed_amount"),
Expand Down

0 comments on commit ac7d6d6

Please sign in to comment.