From f8162f364d3846e6669ce9de7f7b779e03ca11dc Mon Sep 17 00:00:00 2001 From: tanshu Date: Mon, 16 Jul 2018 17:32:44 +0530 Subject: [PATCH] Fix: Changed formula of Service Charge to update the new way of keeping accounts Fix: Changed the limit of ESI in line with govt. regulations --- brewman/views/services/voucher/__init__.py | 2 +- brewman/views/services/voucher/salary_deduction.py | 2 +- brewman/views/services/voucher/service_charge.py | 4 ++-- .../src/app/employee-benefits/employee-benefits.component.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/brewman/views/services/voucher/__init__.py b/brewman/views/services/voucher/__init__.py index 13764f31..60676e0f 100644 --- a/brewman/views/services/voucher/__init__.py +++ b/brewman/views/services/voucher/__init__.py @@ -330,7 +330,7 @@ def service_charge_employees(date, dbsession): .filter(Voucher.type != VoucherType.by_name('Issue').id) \ .filter(Journal.account_id == Account.service_charge_id()) \ .scalar() - amount = 0 if amount is None else amount * Decimal(.7) * Decimal(.9) * -1 + amount = 0 if amount is None else amount * Decimal(.9) * -1 return details, amount diff --git a/brewman/views/services/voucher/salary_deduction.py b/brewman/views/services/voucher/salary_deduction.py index 1f83150c..1f59fb11 100644 --- a/brewman/views/services/voucher/salary_deduction.py +++ b/brewman/views/services/voucher/salary_deduction.py @@ -91,7 +91,7 @@ def add_salary_deduction(item, days_in_month, voucher, dbsession): def esi_contribution(gross_salary, days_worked, days_in_month): - limit = 15000 + limit = 21000 employee_rate = .0175 employer_rate = .0475 employee = 0 if gross_salary > limit else ceil(employee_rate * gross_salary * days_worked / days_in_month) diff --git a/brewman/views/services/voucher/service_charge.py b/brewman/views/services/voucher/service_charge.py index 84d90659..4d67a577 100644 --- a/brewman/views/services/voucher/service_charge.py +++ b/brewman/views/services/voucher/service_charge.py @@ -18,7 +18,7 @@ def service_charge_create_voucher(json, user, dbsession): employees = get_employees(get_first_day(date), date + datetime.timedelta(1), json['incentives'], dbsession=dbsession) - amount = balance(date, dbsession=dbsession) * Decimal(.7) * Decimal(.9) + amount = balance(date, dbsession=dbsession) * Decimal(.9) total_points = 0 for item in employees: @@ -59,7 +59,7 @@ def service_charge_update_voucher(voucher, json, user, dbsession): voucher.journals, dbsession=dbsession ) - amount = balance(date, voucher.id, dbsession) * Decimal(.7) * Decimal(.9) + amount = balance(date, voucher.id, dbsession) * Decimal(.9) total_points = 0 for item in employees: diff --git a/overlord/src/app/employee-benefits/employee-benefits.component.ts b/overlord/src/app/employee-benefits/employee-benefits.component.ts index 9f1b552e..a50db549 100644 --- a/overlord/src/app/employee-benefits/employee-benefits.component.ts +++ b/overlord/src/app/employee-benefits/employee-benefits.component.ts @@ -150,7 +150,7 @@ export class EmployeeBenefitsComponent implements OnInit, AfterViewInit { } getEsi(grossSalary, daysWorked, daysInMonth) { - const limit = 15000, + const limit = 21000, employeeRate = 0.0175, employerRate = 0.0475, employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth),