From f78a3b5cbeb73b6b1f418fc2530609ac023da49c Mon Sep 17 00:00:00 2001 From: Horilla Date: Fri, 18 Oct 2024 10:48:11 +0530 Subject: [PATCH] [UPDT] PAYROLL: Rmove unused oh-modals and resolved payslip create function date period issues --- .../tabs/allowance_deduction-tab.html | 9 +- payroll/forms/component_forms.py | 15 +- payroll/forms/forms.py | 4 +- payroll/methods/methods.py | 1 - payroll/templates/payroll/bonus/form.html | 2 +- .../payroll/deduction/payslip_deduct.html | 16 +- payroll/templates/payroll/loan/form.html | 11 +- payroll/templates/payroll/loan/nav.html | 6 +- payroll/templates/payroll/loan/records.html | 4 +- .../templates/payroll/loan/records_card.html | 55 +-- .../templates/payroll/loan/records_list.html | 81 +--- payroll/templates/payroll/loan/view_loan.html | 65 +-- .../payroll/payslip/bulk_create_payslip.html | 106 ++--- .../payroll/payslip/create_payslip.html | 101 ++-- .../payroll/payslip/individual_payslip.html | 59 --- .../payslip/individual_payslip_summery.html | 439 +++++++++--------- .../payroll/payslip/payslips_empty.html | 165 ++----- .../payroll/payslip/view_payslips.html | 51 +- .../reimbursement/reimbursement_comment.html | 14 - .../reimbursement_request_comment_form.html | 26 -- .../reimbursement/view_reimbursement.html | 2 +- payroll/urls/component_urls.py | 5 + payroll/views/component_views.py | 89 +++- payroll/views/views.py | 2 +- 24 files changed, 510 insertions(+), 818 deletions(-) delete mode 100644 payroll/templates/payroll/reimbursement/reimbursement_request_comment_form.html diff --git a/employee/templates/tabs/allowance_deduction-tab.html b/employee/templates/tabs/allowance_deduction-tab.html index 80cde8536..e2a080fe4 100644 --- a/employee/templates/tabs/allowance_deduction-tab.html +++ b/employee/templates/tabs/allowance_deduction-tab.html @@ -27,8 +27,8 @@ {% if perms.payroll.add_allowance and active_contracts %} {% endif %} @@ -234,11 +234,6 @@ - - - diff --git a/payroll/templates/payroll/payslip/individual_payslip.html b/payroll/templates/payroll/payslip/individual_payslip.html index b91f9945e..3c8eab402 100644 --- a/payroll/templates/payroll/payslip/individual_payslip.html +++ b/payroll/templates/payroll/payslip/individual_payslip.html @@ -54,63 +54,4 @@ - - - - -
- -{% comment %} {% endcomment %} {% endblock content %} diff --git a/payroll/templates/payroll/payslip/individual_payslip_summery.html b/payroll/templates/payroll/payslip/individual_payslip_summery.html index d22d1b825..b4bb9108d 100644 --- a/payroll/templates/payroll/payslip/individual_payslip_summery.html +++ b/payroll/templates/payroll/payslip/individual_payslip_summery.html @@ -1,254 +1,229 @@ {% load i18n horillafilters %} {% if messages %} -
- {% for message in messages %} -
-
- {{ message }} +
+ {% for message in messages %} +
+
+ {{ message }} +
+
+ {% endfor %}
-
- {% endfor %} -
{% endif %}
-

- {% trans "Employee Details" %} -

-
    -
  • - {% trans "Employee ID" %} - {{employee.badge_id}} -
  • -
  • - {% trans "Employee Name" %} - {{employee}} -
  • -
  • - {% trans "Department" %} - {{employee.employee_work_info.department_id.department}} -
  • -
  • - {% trans "Bank Acc./Cheque No." %} - {{employee.employee_bank_details.account_number}} -
  • -
+

+ {% trans "Employee Details" %} +

+
    +
  • + {% trans "Employee ID" %} + {{employee.badge_id}} +
  • +
  • + {% trans "Employee Name" %} + {{employee}} +
  • +
  • + {% trans "Department" %} + {{employee.employee_work_info.department_id.department}} +
  • +
  • + {% trans "Bank Acc./Cheque No." %} + {{employee.employee_bank_details.account_number}} +
  • +
-
- {{ net_pay|floatformat:2|currency_symbol_position }} - - {% trans "Employee Net Pay" %} -
-
- {% trans "Actual Basic Pay" %} : {{instance.contract_wage|currency_symbol_position}} - {% trans "Paid Days" %} : {{paid_days}} - {% trans "LOP Days" %} : {{unpaid_days}} - - {% trans "Updated Basic Pay" %} - : {{basic_pay|floatformat:2|currency_symbol_position}} - -
{% trans "The payslip is calculated based on the updated basic pay" %} - -
-
-
+
+ {{ net_pay|floatformat:2|currency_symbol_position }} + {% trans "Employee Net Pay" %} +
+
+ {% trans "Actual Basic Pay" %} + : {{instance.contract_wage|currency_symbol_position}} + + {% trans "Paid Days" %} + : {{paid_days}} + + {% trans "LOP Days" %} + : {{unpaid_days}} + + + {% trans "Updated Basic Pay" %} + : {{basic_pay|floatformat:2|currency_symbol_position}}
+ + + {% trans "The payslip is calculated based on the updated basic pay" %} + +
+
+
-
- +
+ - -
+ +
- - - - - - - - - - - - - {% for allowance in allowances %} - - - - - {% endfor %} - - - - - - - + + + + + + + + + + + + + {% for allowance in allowances %} + + + + + {% endfor %} + + + + + + +
{% trans "Allowances" %}{% trans "Amount" %} - {% if perms.payroll.add_allowance and instance.status != "paid" %} - - {% endif %} -
- {% trans "Basic Pay" %} - - {{basic_pay|floatformat:2|currency_symbol_position}} -
{{allowance.title}} - {{allowance.amount|floatformat:2|currency_symbol_position}} -
- {% trans "Total Gross Pay" %} - - - {{gross_pay|floatformat:2|currency_symbol_position}} -
{% trans "Allowances" %}{% trans "Amount" %} + {% if perms.payroll.add_allowance and instance.status != "paid" %} + + {% endif %} +
+ {% trans "Basic Pay" %} + + {{basic_pay|floatformat:2|currency_symbol_position}} +
{{allowance.title}} + {{allowance.amount|floatformat:2|currency_symbol_position}} +
+ {% trans "Total Gross Pay" %} + + + {{gross_pay|floatformat:2|currency_symbol_position}} +
- - - - - - - - - - - - - {% for deduction in basic_pay_deductions %} - - - - - {% endfor %} - {% for deduction in gross_pay_deductions %} - - - - - {% endfor %} - {% for deduction in pretax_deductions %} - - - - - {% endfor %} - {% for deduction in post_tax_deductions %} - - - - - {% endfor %} - - - - - - - {% for deduction in tax_deductions %} - - - - - {% endfor %} - {% for deduction in net_deductions %} - - - - - {% endfor %} - - - - - - - + + + + + + + + + + + + + {% for deduction in basic_pay_deductions %} + + + + + {% endfor %} + {% for deduction in gross_pay_deductions %} + + + + + {% endfor %} + {% for deduction in pretax_deductions %} + + + + + {% endfor %} + {% for deduction in post_tax_deductions %} + + + + + {% endfor %} + + + + + {% for deduction in tax_deductions %} + + + + + {% endfor %} + {% for deduction in net_deductions %} + + + + + {% endfor %} + + + + + + +
{% trans "Deductions" %}{% trans "Amount" %} - {% if perms.payroll.add_deduction and instance.status != "paid" %} - - {% endif %} -
{% trans "Loss of Pay" %} - {{loss_of_pay|floatformat:2|currency_symbol_position}} -
{{deduction.title}} - {{deduction.amount|floatformat:2|currency_symbol_position}} -
{{deduction.title}} - {{deduction.amount|floatformat:2|currency_symbol_position}} -
{{deduction.title}} - {{deduction.amount|floatformat:2|currency_symbol_position}} -
{{deduction.title}} - {{deduction.amount|floatformat:2|currency_symbol_position}} -
{% trans "Federal Tax" %} - {{federal_tax|floatformat:2|currency_symbol_position}} -
{{deduction.title}} - {{deduction.amount|floatformat:2|currency_symbol_position}} -
{{deduction.title}} - {{deduction.amount|floatformat:2|currency_symbol_position}} -
- {% trans "Total Deductions" %} - - - {{total_deductions|floatformat:2|currency_symbol_position}} -
{% trans "Deductions" %}{% trans "Amount" %} + {% if perms.payroll.add_deduction and instance.status != "paid" %} + + {% endif %} +
{% trans "Loss of Pay" %} + {{loss_of_pay|floatformat:2|currency_symbol_position}} +
{{deduction.title}} + {{deduction.amount|floatformat:2|currency_symbol_position}} +
{{deduction.title}} + {{deduction.amount|floatformat:2|currency_symbol_position}} +
{{deduction.title}} + {{deduction.amount|floatformat:2|currency_symbol_position}} +
{{deduction.title}} + {{deduction.amount|floatformat:2|currency_symbol_position}} +
{% trans "Federal Tax" %} + {{federal_tax|floatformat:2|currency_symbol_position}} +
{{deduction.title}} + {{deduction.amount|floatformat:2|currency_symbol_position}} +
{{deduction.title}} + {{deduction.amount|floatformat:2|currency_symbol_position}} +
+ {% trans "Total Deductions" %} + + + {{total_deductions|floatformat:2|currency_symbol_position}} +
-
- +
+ - -
+ +
-

- {% trans "Total Net Payable" %} -

-

- {% trans "Gross Earnings - Total Deductions" %} -

+

+ {% trans "Total Net Payable" %} +

+

+ {% trans "Gross Earnings - Total Deductions" %} +

- {{net_pay|floatformat:2|currency_symbol_position}} -
-
-
- - - diff --git a/payroll/templates/payroll/payslip/payslips_empty.html b/payroll/templates/payroll/payslip/payslips_empty.html index 4efe0f580..a3ef5cddb 100644 --- a/payroll/templates/payroll/payslip/payslips_empty.html +++ b/payroll/templates/payroll/payslip/payslips_empty.html @@ -1,130 +1,51 @@ {% extends 'index.html' %} {% block content %} {% load static %}{% load i18n %} - - - - -
-
-

{% trans "Payslip" %}

-
-
- - {% if perms.payroll.add_payslip %} -
-
- - -
+
+

{% trans "Payslip" %}

- {% endif %} - {% if perms.payroll.add_payslip %} -
- +
+ {% if perms.payroll.add_payslip %} +
+
+ + +
+
+ {% endif %} + {% if perms.payroll.add_payslip %} + + {% endif %}
- {% endif %} -
-
-
- -
-
- Page not found. 404. -
{% trans "No payslips have been generated." %}
-
-
-
+
+
+
+
+ Page not found. 404. +
{% trans "No payslips have been generated." %}
+
+
+
-
- {% endblock content %} diff --git a/payroll/templates/payroll/payslip/view_payslips.html b/payroll/templates/payroll/payslip/view_payslips.html index 80c992918..2081a06a0 100644 --- a/payroll/templates/payroll/payslip/view_payslips.html +++ b/payroll/templates/payroll/payslip/view_payslips.html @@ -9,49 +9,6 @@ }
- - -
@@ -187,7 +144,9 @@ {% trans "Generate" %} @@ -264,7 +223,9 @@ {% endif %} - - - - - ' ) - return render(request, "payroll/common/form.html", {"form": form}) + return render( + request, + "payroll/payslip/create_payslip.html", + {"individual_form": form}, + ) @login_required @@ -919,7 +984,6 @@ def view_payslip(request): export_column = forms.PayslipExportColumnForm() filter_form = PayslipFilter(request.GET, payslips) payslips = filter_form.qs - individual_form = forms.PayslipForm() bulk_form = forms.GeneratePayslipForm() field = request.GET.get("group_by") if field in Payslip.__dict__.keys(): @@ -936,7 +1000,6 @@ def view_payslip(request): "f": filter_form, "export_column": export_column, "export_filter": PayslipFilter(request.GET), - "individual_form": individual_form, "bulk_form": bulk_form, "filter_dict": data_dict, "gp_fields": PayslipReGroup.fields, @@ -1260,8 +1323,6 @@ def view_loans(request): loan = records.filter(type="loan") adv_salary = records.filter(type="advanced_salary") fine = records.filter(type="fine") - print("______________________________________________----------------------------") - print(records) fine_ids = json.dumps(list(fine.values_list("id", flat=True))) loan_ids = json.dumps(list(loan.values_list("id", flat=True))) diff --git a/payroll/views/views.py b/payroll/views/views.py index 73cacc98b..d8e657948 100644 --- a/payroll/views/views.py +++ b/payroll/views/views.py @@ -181,7 +181,7 @@ def contract_status_update(request, contract_id): for errors in contract_form.errors.values(): for error in errors: messages.error(request, error) - return HttpResponse("") + return HttpResponse("") @login_required