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

* fix: sum of components in salary register

* fix: sum of deduction components

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
Jannat Patel 2021-11-09 15:21:51 +05:30 committed by GitHub
parent 4a3cef6436
commit 17acb08545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,11 +134,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
@ -149,10 +149,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