[UPDT] PAYROLL: Contribution deduction filteration updation

This commit is contained in:
Horilla
2024-02-21 10:54:37 +05:30
parent 4fec1faccb
commit 9d233b0b31
3 changed files with 13 additions and 13 deletions

View File

@@ -42,5 +42,5 @@ def get_active_employees(request):
"""
This method used to return the deduction
"""
employees = Employee.objects.filter(is_active=True,contract_set__isnull=False)
employees = Employee.objects.filter(is_active=True,contract_set__isnull=False,payslip__isnull=False).distinct()
return {"get_active_employees": employees}

View File

@@ -25,8 +25,8 @@
<span class="oh-profile__name oh-text--dark">{{ deduction.title }}</span>
</div>
</div>
<div class="oh-sticky-table__td">{{ currency }} {{ deduction.employee_contribution }}</div>
<div class="oh-sticky-table__td">{{ currency }} {{ deduction.employer_contribution }}</div>
<div class="oh-sticky-table__td">{{ currency }} {{ deduction.employee_contribution|floatformat:2 }}</div>
<div class="oh-sticky-table__td">{{ currency }} {{ deduction.employer_contribution|floatformat:2 }}</div>
</div>
{% endfor %}
{% if not contribution_deductions %}

View File

@@ -1420,16 +1420,16 @@ def get_contribution_report(request):
item["employer_contribution_amount"] for item in group
)
total_contribution = employee_contribution + employer_contribution
contribution_deductions.append(
{
"deduction_id": deduction_id,
"title": title,
"employee_contribution": employee_contribution,
"employer_contribution": employer_contribution,
"total_contribution": total_contribution,
}
)
if employer_contribution > 0:
contribution_deductions.append(
{
"deduction_id": deduction_id,
"title": title,
"employee_contribution": employee_contribution,
"employer_contribution": employer_contribution,
"total_contribution": total_contribution,
}
)
return render(
request,