mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
fix: Assign indent and parent_invoice
This commit is contained in:
@@ -46,10 +46,26 @@ def execute(filters=None):
|
|||||||
for col in group_wise_columns.get(scrub(filters.group_by)):
|
for col in group_wise_columns.get(scrub(filters.group_by)):
|
||||||
row.append(src.get(col))
|
row.append(src.get(col))
|
||||||
|
|
||||||
row.append(filters.currency)
|
for src in gross_profit_data.si_list:
|
||||||
if idx == len(gross_profit_data.grouped_data)-1:
|
row = frappe._dict()
|
||||||
row[0] = frappe.bold("Total")
|
row.indent = src.indent
|
||||||
data.append(row)
|
row.parent_invoice = src.parent_invoice
|
||||||
|
row.currency = filters.currency
|
||||||
|
|
||||||
|
for col in group_wise_columns.get(scrub(filters.group_by)):
|
||||||
|
row[column_names[col]] = src.get(col)
|
||||||
|
|
||||||
|
data.append(row)
|
||||||
|
|
||||||
|
else:
|
||||||
|
for src in gross_profit_data.grouped_data:
|
||||||
|
row = []
|
||||||
|
row.append(filters.currency)
|
||||||
|
|
||||||
|
for col in group_wise_columns.get(scrub(filters.group_by)):
|
||||||
|
row.append(src.get(col))
|
||||||
|
|
||||||
|
data.append(row)
|
||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
@@ -393,7 +409,9 @@ class GrossProfitGenerator(object):
|
|||||||
'item_row': None,
|
'item_row': None,
|
||||||
'is_return': row.is_return,
|
'is_return': row.is_return,
|
||||||
'cost_center': row.cost_center,
|
'cost_center': row.cost_center,
|
||||||
'base_net_amount': 0
|
'base_net_amount': 0,
|
||||||
|
'indent': 0.0,
|
||||||
|
'parent_invoice': ''
|
||||||
})
|
})
|
||||||
|
|
||||||
self.si_list.insert(index, invoice)
|
self.si_list.insert(index, invoice)
|
||||||
@@ -403,7 +421,8 @@ class GrossProfitGenerator(object):
|
|||||||
row.indent = 1.0
|
row.indent = 1.0
|
||||||
row.parent_invoice = row.parent
|
row.parent_invoice = row.parent
|
||||||
row.parent = row.item_code
|
row.parent = row.item_code
|
||||||
self.si_list[0].base_net_amount += row.base_net_amount
|
# ind = parents_index-1 if parents_index > 0 else parents_index
|
||||||
|
# self.si_list[ind].base_net_amount += row.base_net_amount
|
||||||
|
|
||||||
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user