fix: sum of components in salary register (#28237) (#28287)

* fix: sum of components in salary register

* fix: sum of deduction components

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit 17acb08545)

Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2021-11-09 15:45:26 +05:30
committed by GitHub
parent 58ece37d8f
commit 59632720b2

View File

@@ -135,11 +135,11 @@ def get_ss_earning_map(salary_slips, currency, company_currency):
ss_earning_map = {}
for d in ss_earnings:
ss_earning_map.setdefault(d.parent, frappe._dict()).setdefault(d.salary_component, [])
ss_earning_map.setdefault(d.parent, frappe._dict()).setdefault(d.salary_component, 0.0)
if currency == company_currency:
ss_earning_map[d.parent][d.salary_component] = flt(d.amount) * flt(d.exchange_rate if d.exchange_rate else 1)
ss_earning_map[d.parent][d.salary_component] += flt(d.amount) * flt(d.exchange_rate if d.exchange_rate else 1)
else:
ss_earning_map[d.parent][d.salary_component] = flt(d.amount)
ss_earning_map[d.parent][d.salary_component] += flt(d.amount)
return ss_earning_map
@@ -150,10 +150,10 @@ def get_ss_ded_map(salary_slips, currency, company_currency):
ss_ded_map = {}
for d in ss_deductions:
ss_ded_map.setdefault(d.parent, frappe._dict()).setdefault(d.salary_component, [])
ss_ded_map.setdefault(d.parent, frappe._dict()).setdefault(d.salary_component, 0.0)
if currency == company_currency:
ss_ded_map[d.parent][d.salary_component] = flt(d.amount) * flt(d.exchange_rate if d.exchange_rate else 1)
ss_ded_map[d.parent][d.salary_component] += flt(d.amount) * flt(d.exchange_rate if d.exchange_rate else 1)
else:
ss_ded_map[d.parent][d.salary_component] = flt(d.amount)
ss_ded_map[d.parent][d.salary_component] += flt(d.amount)
return ss_ded_map