mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 06:28:29 +00:00
* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user