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