mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Merge pull request #5194 from nabinhait/gross_profit_fix
Gross profit fix
This commit is contained in:
@@ -598,13 +598,13 @@
|
|||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"in_create": 0,
|
"in_create": 1,
|
||||||
"in_dialog": 0,
|
"in_dialog": 0,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2016-02-24 16:49:46.832403",
|
"modified": "2016-04-12 15:26:22.756129",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Request",
|
"name": "Payment Request",
|
||||||
@@ -675,5 +675,6 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC"
|
"sort_order": "DESC",
|
||||||
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
@@ -145,11 +145,11 @@ class GrossProfitGenerator(object):
|
|||||||
self.data.append(row)
|
self.data.append(row)
|
||||||
|
|
||||||
if self.grouped:
|
if self.grouped:
|
||||||
self.collapse_group()
|
self.get_average_rate_based_on_group_by()
|
||||||
else:
|
else:
|
||||||
self.grouped_data = []
|
self.grouped_data = []
|
||||||
|
|
||||||
def collapse_group(self):
|
def get_average_rate_based_on_group_by(self):
|
||||||
# sum buying / selling totals for group
|
# sum buying / selling totals for group
|
||||||
self.grouped_data = []
|
self.grouped_data = []
|
||||||
for key in self.grouped.keys():
|
for key in self.grouped.keys():
|
||||||
@@ -166,6 +166,8 @@ class GrossProfitGenerator(object):
|
|||||||
if new_row.base_amount else 0
|
if new_row.base_amount else 0
|
||||||
new_row.buying_rate = (new_row.buying_amount / new_row.qty) \
|
new_row.buying_rate = (new_row.buying_amount / new_row.qty) \
|
||||||
if new_row.qty else 0
|
if new_row.qty else 0
|
||||||
|
new_row.base_rate = (new_row.base_amount / new_row.qty) \
|
||||||
|
if new_row.qty else 0
|
||||||
|
|
||||||
self.grouped_data.append(new_row)
|
self.grouped_data.append(new_row)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user