Skip to content

Commit 2edb6f3

Browse files
ljain112mergify[bot]
authored andcommitted
fix: avg. buying amount for product bundle item with serial and batch no in gross profit report
(cherry picked from commit cc3f4bb)
1 parent 4e23e31 commit 2edb6f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

erpnext/accounts/report/gross_profit/gross_profit.py

+4
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ def get_buying_amount_from_product_bundle(self, row, product_bundle):
637637
packed_item_row = row.copy()
638638
packed_item_row.warehouse = packed_item.warehouse
639639
packed_item_row.qty = packed_item.total_qty * -1
640+
packed_item_row.serial_and_batch_bundle = packed_item.serial_and_batch_bundle
640641
buying_amount += self.get_buying_amount(packed_item_row, packed_item.item_code)
641642

642643
return flt(buying_amount, self.currency_precision)
@@ -728,6 +729,7 @@ def get_average_buying_rate(self, row, item_code):
728729
"voucher_no": row.parent,
729730
"allow_zero_valuation": True,
730731
"company": self.filters.company,
732+
"item_code": item_code,
731733
}
732734
)
733735

@@ -997,6 +999,7 @@ def get_bundle_item_row(self, row, item):
997999
"is_return": row.is_return,
9981000
"cost_center": row.cost_center,
9991001
"invoice": row.parent,
1002+
"serial_and_batch_bundle": row.serial_and_batch_bundle,
10001003
}
10011004
)
10021005

@@ -1048,6 +1051,7 @@ def load_product_bundle(self):
10481051
pki.rate,
10491052
(pki.rate * pki.qty).as_("base_amount"),
10501053
pki.parent_detail_docname,
1054+
pki.serial_and_batch_bundle,
10511055
)
10521056
.where(pki.docstatus == 1)
10531057
)

0 commit comments

Comments
 (0)