Merge pull request #37435 from rtdany10/sp-gp-fix

fix(gp): wrong `allocated_amount` when grouped by Sales Person
This commit is contained in:
ruthra kumar 2023-10-14 12:12:14 +05:30 committed by GitHub
commit 8ca0e4eacc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -544,6 +544,8 @@ class GrossProfitGenerator(object):
new_row.qty += flt(row.qty)
new_row.buying_amount += flt(row.buying_amount, self.currency_precision)
new_row.base_amount += flt(row.base_amount, self.currency_precision)
if self.filters.get("group_by") == "Sales Person":
new_row.allocated_amount += flt(row.allocated_amount, self.currency_precision)
new_row = self.set_average_rate(new_row)
self.grouped_data.append(new_row)