[UPDT] PAYROLL: LOP computation method updates

This commit is contained in:
Horilla
2025-01-21 15:45:35 +05:30
parent 732175365c
commit 877d508736
3 changed files with 11 additions and 8 deletions

View File

@@ -407,7 +407,7 @@ def compute_net_pay(
return net_pay
def monthly_computation(employee, wage, start_date, end_date):
def monthly_computation(employee, wage, start_date, end_date, *args, **kwargs):
"""
Hourly salary computation for period.
@@ -485,6 +485,7 @@ def monthly_computation(employee, wage, start_date, end_date):
"month_data": month_data,
"unpaid_days": unpaid_leaves,
"paid_days": paid_days,
"contract": contract,
}

View File

@@ -70,8 +70,6 @@ def calculate_taxable_amount(**kwargs):
total_days = (check_end_date - check_start_date).days + 1
yearly_income = income / num_days * total_days
yearly_income = compute_yearly_taxable_amount(income, yearly_income)
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.")
print(yearly_income)
yearly_income = round(yearly_income, 2)
federal_tax = 0
if filing is not None and not filing.use_py:

View File

@@ -137,11 +137,11 @@ def payroll_calculation(employee, start_date, end_date):
basic_pay = updated_basic_pay_data["compensation_amount"]
basic_pay_deductions = updated_basic_pay_data["deductions"]
loss_of_pay_amount = (
float(loss_of_pay) if not contract.deduct_leave_from_basic_pay else 0
)
basic_pay = basic_pay - loss_of_pay_amount
loss_of_pay_amount = 0
if not contract.deduct_leave_from_basic_pay:
loss_of_pay_amount = loss_of_pay
else:
basic_pay = basic_pay - loss_of_pay_amount
kwargs = {
"employee": employee,
@@ -194,6 +194,9 @@ def payroll_calculation(employee, start_date, end_date):
)
net_pay = gross_pay - total_deductions
# loss_of_pay -> actual lop amount
# loss_of_pay_amount -> actual lop if deduct from basic-
# pay from contract is enabled
net_pay = compute_net_pay(
net_pay=net_pay,
gross_pay=gross_pay,
@@ -202,6 +205,7 @@ def payroll_calculation(employee, start_date, end_date):
total_tax_deductions=total_tax_deductions,
federal_tax=federal_tax,
loss_of_pay_amount=loss_of_pay_amount,
loss_of_pay=loss_of_pay,
)
updated_net_pay_data = update_compensation_deduction(
employee, net_pay, "net_pay", start_date, end_date