mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: Fetch bundle item details
This commit is contained in:
@@ -483,6 +483,8 @@ class GrossProfitGenerator(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for i, item in enumerate(bundle_items):
|
for i, item in enumerate(bundle_items):
|
||||||
|
item_name, description, item_group, brand = self.get_bundle_item_details(item.item_code)
|
||||||
|
|
||||||
bundle_item = frappe._dict({
|
bundle_item = frappe._dict({
|
||||||
'parent_invoice': product_bundle.item_code,
|
'parent_invoice': product_bundle.item_code,
|
||||||
'indent': product_bundle.indent + 1,
|
'indent': product_bundle.indent + 1,
|
||||||
@@ -493,11 +495,11 @@ class GrossProfitGenerator(object):
|
|||||||
'customer': product_bundle.customer,
|
'customer': product_bundle.customer,
|
||||||
'customer_group': product_bundle.customer_group,
|
'customer_group': product_bundle.customer_group,
|
||||||
'item_code': item.item_code,
|
'item_code': item.item_code,
|
||||||
'item_name': frappe.db.get_value('Item', item.item_code, 'item_name'),
|
'item_name': item_name,
|
||||||
'description': frappe.db.get_value('Item', item.item_code, 'description'),
|
'description': description,
|
||||||
'warehouse': product_bundle.warehouse,
|
'warehouse': product_bundle.warehouse,
|
||||||
'item_group': frappe.db.get_value('Item', item.item_code, 'item_group'),
|
'item_group': item_group,
|
||||||
'brand': frappe.db.get_value('Item', item.item_code, 'brand'),
|
'brand': brand,
|
||||||
'dn_detail': product_bundle.dn_detail,
|
'dn_detail': product_bundle.dn_detail,
|
||||||
'delivery_note': product_bundle.delivery_note,
|
'delivery_note': product_bundle.delivery_note,
|
||||||
'qty': (flt(product_bundle.qty) * flt(item.qty)),
|
'qty': (flt(product_bundle.qty) * flt(item.qty)),
|
||||||
@@ -508,6 +510,13 @@ class GrossProfitGenerator(object):
|
|||||||
|
|
||||||
self.si_list.insert((index+i+1), bundle_item)
|
self.si_list.insert((index+i+1), bundle_item)
|
||||||
|
|
||||||
|
def get_bundle_item_details(self, item_code):
|
||||||
|
return frappe.db.get_value(
|
||||||
|
'Item',
|
||||||
|
item_code,
|
||||||
|
['item_name', 'description', 'item_group', 'brand']
|
||||||
|
)
|
||||||
|
|
||||||
def load_stock_ledger_entries(self):
|
def load_stock_ledger_entries(self):
|
||||||
res = frappe.db.sql("""select item_code, voucher_type, voucher_no,
|
res = frappe.db.sql("""select item_code, voucher_type, voucher_no,
|
||||||
voucher_detail_no, stock_value, warehouse, actual_qty as qty
|
voucher_detail_no, stock_value, warehouse, actual_qty as qty
|
||||||
|
|||||||
Reference in New Issue
Block a user