diff --git a/hrms/api/__init__.py b/hrms/api/__init__.py index 9f75671c346..23d025ca123 100644 --- a/hrms/api/__init__.py +++ b/hrms/api/__init__.py @@ -742,6 +742,7 @@ def get_doctype_states(doctype: str) -> dict: # File @frappe.whitelist() def get_attachments(dt: str, dn: str): + frappe.has_permission(dt, "read", dn, throw=True) return frappe.get_list( "File", fields=["name", "file_name", "file_url", "is_private"], diff --git a/hrms/hr/doctype/expense_claim/expense_claim.json b/hrms/hr/doctype/expense_claim/expense_claim.json index 792e5e42a0d..7b50ca34b67 100644 --- a/hrms/hr/doctype/expense_claim/expense_claim.json +++ b/hrms/hr/doctype/expense_claim/expense_claim.json @@ -283,7 +283,7 @@ "in_list_view": 1, "label": "Status", "no_copy": 1, - "options": "Draft\nPaid\nUnpaid\nRejected\nSubmitted\nCancelled", + "options": "Draft\nPaid\nPartially Paid\nUnpaid\nRejected\nSubmitted\nCancelled", "print_hide": 1, "read_only": 1 }, @@ -624,6 +624,10 @@ "color": "Green", "title": "Paid" }, + { + "color": "Blue", + "title": "Partially Paid" + }, { "color": "Yellow", "title": "Unpaid" diff --git a/hrms/hr/doctype/expense_claim/expense_claim.py b/hrms/hr/doctype/expense_claim/expense_claim.py index 2d7b60f97dd..1d4be94619b 100644 --- a/hrms/hr/doctype/expense_claim/expense_claim.py +++ b/hrms/hr/doctype/expense_claim/expense_claim.py @@ -81,7 +81,7 @@ class ExpenseClaim(AccountsController, PWANotificationsMixin): posting_date: DF.Date project: DF.Link | None remark: DF.SmallText | None - status: DF.Literal["Draft", "Paid", "Unpaid", "Rejected", "Submitted", "Cancelled"] + status: DF.Literal["Draft", "Paid", "Partially Paid", "Unpaid", "Rejected", "Submitted", "Cancelled"] task: DF.Link | None taxes: DF.Table[ExpenseTaxesandCharges] total_advance_amount: DF.Currency @@ -142,7 +142,10 @@ def set_status(self, update=False): ): status = "Paid" elif flt(self.total_sanctioned_amount) > 0: - status = "Unpaid" + if flt(self.total_amount_reimbursed, precision) > 0: + status = "Partially Paid" + else: + status = "Unpaid" elif self.approval_status == "Rejected": status = "Rejected" diff --git a/hrms/hr/doctype/expense_claim/test_expense_claim.py b/hrms/hr/doctype/expense_claim/test_expense_claim.py index cf5424ed314..bd9baa923ea 100644 --- a/hrms/hr/doctype/expense_claim/test_expense_claim.py +++ b/hrms/hr/doctype/expense_claim/test_expense_claim.py @@ -659,6 +659,7 @@ def test_multiple_payment_entries_against_expense(self): outstanding_amount = get_outstanding_amount_for_claim(expense_claim) self.assertEqual(outstanding_amount, 5000) self.assertEqual(expense_claim.total_amount_reimbursed, 500) + self.assertEqual(expense_claim.status, "Partially Paid") # Payment entry 2: paying 2000 pe2 = make_claim_payment_entry(expense_claim, 2000) @@ -669,6 +670,7 @@ def test_multiple_payment_entries_against_expense(self): outstanding_amount = get_outstanding_amount_for_claim(expense_claim) self.assertEqual(outstanding_amount, 3000) self.assertEqual(expense_claim.total_amount_reimbursed, 2500) + self.assertEqual(expense_claim.status, "Partially Paid") # Payment entry 3: paying 3000 pe3 = make_claim_payment_entry(expense_claim, 3000) @@ -679,6 +681,7 @@ def test_multiple_payment_entries_against_expense(self): outstanding_amount = get_outstanding_amount_for_claim(expense_claim) self.assertEqual(outstanding_amount, 0) self.assertEqual(expense_claim.total_amount_reimbursed, 5500) + self.assertEqual(expense_claim.status, "Paid") def test_expense_claim_against_delivery_trip(self): from erpnext.stock.doctype.delivery_trip.test_delivery_trip import ( diff --git a/hrms/hr/doctype/shift_type/shift_type.py b/hrms/hr/doctype/shift_type/shift_type.py index 933d191f939..b331ba00d4a 100644 --- a/hrms/hr/doctype/shift_type/shift_type.py +++ b/hrms/hr/doctype/shift_type/shift_type.py @@ -147,6 +147,7 @@ def unlinked_checkins_exist(self): @frappe.whitelist(methods=["POST"]) def process_auto_attendance(self, is_manually_triggered: int | bool = False) -> None | str: + self.check_permission("write") if self.has_incorrect_shift_config(): return diff --git a/hrms/patches.txt b/hrms/patches.txt index 5b2112d1cd1..4501218f751 100644 --- a/hrms/patches.txt +++ b/hrms/patches.txt @@ -49,6 +49,7 @@ hrms.patches.v16_0.add_default_hr_role_permissions #2026-05-28 hrms.patches.v16_0.set_reference_fields_in_expense_claim_advance hrms.patches.v16_0.update_partially_paid_employee_advance_status hrms.patches.v16_0.delete_upload_attendance_doctype #2026-07-16 +hrms.patches.v16_0.update_partially_paid_expense_claim_status hrms.patches.v16_0.set_leave_approver_name_in_leave_application #2026-08-05 hrms.patches.v16_0.enable_multi_currency_expense_claim_for_existing_users hrms.patches.v16_0.set_job_applicant_kanban_column_indicators #2026-08-12 diff --git a/hrms/patches/v16_0/update_partially_paid_expense_claim_status.py b/hrms/patches/v16_0/update_partially_paid_expense_claim_status.py new file mode 100644 index 00000000000..e764b335939 --- /dev/null +++ b/hrms/patches/v16_0/update_partially_paid_expense_claim_status.py @@ -0,0 +1,17 @@ +import frappe + + +def execute(): + frappe.reload_doc("hr", "doctype", "expense_claim") + + claim = frappe.qb.DocType("Expense Claim") + ( + frappe.qb.update(claim) + .set(claim.status, "Partially Paid") + .where( + (claim.docstatus == 1) + & (claim.total_amount_reimbursed > 0) + & (claim.total_amount_reimbursed < claim.grand_total) + & (claim.status == "Unpaid") + ) + ).run() diff --git a/hrms/payroll/doctype/payroll_correction/payroll_correction.py b/hrms/payroll/doctype/payroll_correction/payroll_correction.py index b7831cd631d..ad52dc6b3a6 100644 --- a/hrms/payroll/doctype/payroll_correction/payroll_correction.py +++ b/hrms/payroll/doctype/payroll_correction/payroll_correction.py @@ -203,6 +203,17 @@ def populate_breakup_table(self): else: total_working_days = salary_slip.get("total_working_days", 1) + if not total_working_days: + frappe.throw( + _( + "Cannot calculate payroll correction for salary component {0} because salary slip {1} has zero {2}." + ).format( + frappe.bold(component), + frappe.bold(salary_slip.name), + _("payment days") if component_data.get("accrual_component") else _("working days"), + ) + ) + per_day_amount = flt(component_data["default_amount"] / total_working_days) arrear_amount = flt(per_day_amount * self.days_to_reverse) diff --git a/hrms/payroll/doctype/payroll_correction/test_payroll_correction.py b/hrms/payroll/doctype/payroll_correction/test_payroll_correction.py index 925856346e9..0107477c338 100644 --- a/hrms/payroll/doctype/payroll_correction/test_payroll_correction.py +++ b/hrms/payroll/doctype/payroll_correction/test_payroll_correction.py @@ -1,8 +1,10 @@ # Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import calendar +from unittest.mock import patch import frappe +from frappe import ValidationError from frappe.utils import add_days, flt from erpnext.setup.doctype.employee.test_employee import make_employee @@ -103,3 +105,38 @@ def test_payroll_correction(self): }, ) ) + + def test_payroll_correction_with_zero_payment_days(self): + payroll_correction_doc = frappe.get_doc( + { + "doctype": "Payroll Correction", + "employee": "EMP-0001", + "payroll_period": "Test Payroll Period", + "payroll_date": "2025-02-01", + "company": "_Test Company", + "days_to_reverse": 1, + "month_for_lwp_reversal": "January", + "salary_slip_reference": "SAL-SLIP-ZERO-PAYMENT-DAYS", + } + ) + + salary_slip = frappe._dict( + { + "name": "SAL-SLIP-ZERO-PAYMENT-DAYS", + "payment_days": 0, + "total_working_days": 30, + "earnings": [], + "deductions": [], + "accrued_benefits": [ + frappe._dict({"salary_component": "Mediclaim Allowance", "amount": 2000}) + ], + } + ) + salary_slip.precision = lambda fieldname: 2 + + with ( + patch("frappe.get_doc", return_value=salary_slip), + patch("frappe.db.get_list", return_value=["Mediclaim Allowance"]), + self.assertRaisesRegex(ValidationError, "zero payment days"), + ): + payroll_correction_doc.populate_breakup_table() diff --git a/hrms/payroll/doctype/salary_slip/salary_slip.py b/hrms/payroll/doctype/salary_slip/salary_slip.py index adbdf8d8e45..747f97cf2b0 100644 --- a/hrms/payroll/doctype/salary_slip/salary_slip.py +++ b/hrms/payroll/doctype/salary_slip/salary_slip.py @@ -2666,6 +2666,31 @@ def make_salary_slip_from_timesheet(source_name: str, target_doc: str | Document frappe.has_permission("Timesheet", "read", source_name, throw=True) target = frappe.new_doc("Salary Slip") set_missing_values(source_name, target) + if not target.check_sal_struct(): + frappe.throw( + _("Cannot create Salary Slip: no active Salary Structure is assigned to employee {0}.").format( + frappe.bold(target.employee_name) + ) + ) + + timesheet_config = frappe.get_cached_value( + "Salary Structure", + target.salary_structure, + ["salary_slip_based_on_timesheet", "salary_component"], + as_dict=True, + ) + if not timesheet_config or not timesheet_config.salary_slip_based_on_timesheet: + frappe.throw( + _( + "The Assigned Salary Structure {0} for the employee {1} is not configured for Salary Slip based on Timesheet." + ).format(frappe.bold(target.salary_structure), frappe.bold(target.employee_name)) + ) + if not timesheet_config.salary_component: + frappe.throw( + _( + "The Assigned Salary Structure {0} for the employee {1} does not have a Salary Component configured for Salary Slip based on Timesheet." + ).format(frappe.bold(target.salary_structure), frappe.bold(target.employee_name)) + ) target.run_method("get_emp_and_working_day_details") return target diff --git a/hrms/payroll/print_format/salary_slip_classic/salary_slip_classic.json b/hrms/payroll/print_format/salary_slip_classic/salary_slip_classic.json index 828dedf241d..6da7fbc5920 100644 --- a/hrms/payroll/print_format/salary_slip_classic/salary_slip_classic.json +++ b/hrms/payroll/print_format/salary_slip_classic/salary_slip_classic.json @@ -10,14 +10,14 @@ "docstatus": 0, "doctype": "Print Format", "font_size": 0, - "format_data": "{\"header\": {\"columns\": [{\"label\": \"\", \"fields\": []}]}, \"sections\": [{\"label\": \"\", \"columns\": [{\"label\": \"\", \"fields\": [{\"label\": \"Header\", \"fieldname\": \"custom_html_header\", \"fieldtype\": \"HTML\", \"html\": \"
\\n\\t\\t\\t\\t{{ _(\\\"Salary Slip\\\") }}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ _(\\\"For the period\\\") }} {{ frappe.format(doc.start_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{{ _(\\\"to\\\") }} {{ frappe.format(doc.end_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t{{ doc.name }}\\n\\t\\t\\t\\t{{ _(\\\"Issued\\\") }} {{ frappe.format(doc.posting_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t | \\n\\t\\t
\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t
| \\n\\t\\t
\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t
| \\n\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Net Pay\\\") }} \\n\\t\\t\\t\\t{{ doc.total_in_words }} \\n\\t\\t\\t | \\n\\t\\t\\t{{ money(net_total) }} | \\n\\t\\t
| \\n\\t\\t\\t\\t{%- if doc.bank_name -%}\\n\\t\\t\\t\\t\\t{{ doc.bank_name }}\\n\\t\\t\\t\\t\\t{%- if doc.bank_account_no %} • {{ _(\\\"A/C\\\") }} {{ doc.bank_account_no }}{% endif -%}\\n\\t\\t\\t\\t\\t{%- if doc.mode_of_payment %} • {{ _(doc.mode_of_payment) }}{% endif -%}\\n\\t\\t\\t\\t{%- elif doc.mode_of_payment -%}\\n\\t\\t\\t\\t\\t{{ _(\\\"Paid by\\\") }} {{ _(doc.mode_of_payment) }}\\n\\t\\t\\t\\t{%- endif -%}\\n\\t\\t\\t | \\n\\t\\t\\t{{ _(\\\"This is a computer generated document and does not require a signature.\\\") }} | \\n\\t\\t
\\n\\t\\t\\t\\t{{ _(\\\"Salary Slip\\\") }}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ _(\\\"For the period\\\") }} {{ frappe.format(doc.start_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{{ _(\\\"to\\\") }} {{ frappe.format(doc.end_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t{{ doc.name }}\\n\\t\\t\\t\\t{{ _(\\\"Issued\\\") }} {{ frappe.format(doc.posting_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t | \\n\\t\\t
\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t
| \\n\\t\\t
\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t
| \\n\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Net Pay\\\") }} \\n\\t\\t\\t\\t{{ doc.total_in_words }} \\n\\t\\t\\t | \\n\\t\\t\\t{{ money(net_total) }} | \\n\\t\\t
| \\n\\t\\t\\t\\t{%- if doc.bank_name -%}\\n\\t\\t\\t\\t\\t{{ doc.bank_name }}\\n\\t\\t\\t\\t\\t{%- if doc.bank_account_no %} • {{ _(\\\"A/C\\\") }} {{ doc.bank_account_no }}{% endif -%}\\n\\t\\t\\t\\t\\t{%- if doc.mode_of_payment %} • {{ _(doc.mode_of_payment) }}{% endif -%}\\n\\t\\t\\t\\t{%- elif doc.mode_of_payment -%}\\n\\t\\t\\t\\t\\t{{ _(\\\"Paid by\\\") }} {{ _(doc.mode_of_payment) }}\\n\\t\\t\\t\\t{%- endif -%}\\n\\t\\t\\t | \\n\\t\\t\\t{{ _(\\\"This is a computer generated document and does not require a signature.\\\") }} | \\n\\t\\t
| \\n\\t\\t\\t\\t {{ doc.employee_name }} \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{%- if doc.designation %}{{ doc.designation }} • {% endif -%}\\n\\t\\t\\t\\t\\t{%- if doc.department %}{{ doc.department }} • {% endif -%}\\n\\t\\t\\t\\t\\t{{ doc.employee }}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Payslip for\\\") }} \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ frappe.format(doc.start_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{{ _(\\\"to\\\") }} {{ frappe.format(doc.end_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Net Pay\\\") }} \\n\\t\\t\\t\\t{{ money(net_total) }} \\n\\t\\t\\t\\t{{ doc.total_in_words }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t{%- if doc.bank_name or doc.mode_of_payment %}\\n\\t\\t\\t\\t {{ _(\\\"Credited to\\\") }} \\n\\t\\t\\t\\t{%- if doc.bank_name -%}\\n\\t\\t\\t\\t\\t{{ doc.bank_name }} \\n\\t\\t\\t\\t\\t{%- if doc.bank_account_no %}{{ _(\\\"A/C\\\") }} {{ doc.bank_account_no }} {% endif -%}\\n\\t\\t\\t\\t{%- else -%}\\n\\t\\t\\t\\t\\t{{ _(doc.mode_of_payment) }} \\n\\t\\t\\t\\t{%- endif -%}\\n\\t\\t\\t\\t{% endif -%}\\n\\t\\t\\t | \\n\\t\\t
| {{ _(\\\"Earnings\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Amount\\\") }} | \\n\\t\\t\\t
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t
| {{ _(\\\"Gross Pay\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.gross_pay) }} | \\n\\t\\t\\t
| {{ _(\\\"Deductions\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Amount\\\") }} | \\n\\t\\t\\t
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t
| {{ _(\\\"Total Deduction\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.total_deduction) }} | \\n\\t\\t\\t
| {{ _(\\\"Working days\\\") }} {{ doc.total_working_days }} | \\n\\t\\t\\t{{ _(\\\"Payment days\\\") }} {{ doc.payment_days }} | \\n\\t\\t\\t{{ _(\\\"Leave without pay\\\") }} {{ doc.leave_without_pay }} | \\n\\t\\t\\t{{ doc.name }} | \\n\\t\\t
| \\n\\t\\t\\t\\t {{ doc.employee_name }} \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{%- if doc.designation %}{{ doc.designation }} • {% endif -%}\\n\\t\\t\\t\\t\\t{%- if doc.department %}{{ doc.department }} • {% endif -%}\\n\\t\\t\\t\\t\\t{{ doc.employee }}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Payslip for\\\") }} \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ frappe.format(doc.start_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{{ _(\\\"to\\\") }} {{ frappe.format(doc.end_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Net Pay\\\") }} \\n\\t\\t\\t\\t{{ money(net_total) }} \\n\\t\\t\\t\\t{{ doc.total_in_words }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t{%- if doc.bank_name or doc.mode_of_payment %}\\n\\t\\t\\t\\t {{ _(\\\"Credited to\\\") }} \\n\\t\\t\\t\\t{%- if doc.bank_name -%}\\n\\t\\t\\t\\t\\t{{ doc.bank_name }} \\n\\t\\t\\t\\t\\t{%- if doc.bank_account_no %}{{ _(\\\"A/C\\\") }} {{ doc.bank_account_no }} {% endif -%}\\n\\t\\t\\t\\t{%- else -%}\\n\\t\\t\\t\\t\\t{{ _(doc.mode_of_payment) }} \\n\\t\\t\\t\\t{%- endif -%}\\n\\t\\t\\t\\t{% endif -%}\\n\\t\\t\\t | \\n\\t\\t
| {{ _(\\\"Earnings\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Amount\\\") }} | \\n\\t\\t\\t
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t
| {{ _(\\\"Gross Pay\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.gross_pay) }} | \\n\\t\\t\\t
| {{ _(\\\"Deductions\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Amount\\\") }} | \\n\\t\\t\\t
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t
| {{ _(\\\"Total Deduction\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.total_deduction) }} | \\n\\t\\t\\t
| {{ _(\\\"Total Loan Repayment\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.total_loan_repayment) }} | \\n\\t\\t\\t
| {{ _(\\\"Working days\\\") }} {{ doc.total_working_days }} | \\n\\t\\t\\t{{ _(\\\"Payment days\\\") }} {{ doc.payment_days }} | \\n\\t\\t\\t{{ _(\\\"Leave without pay\\\") }} {{ doc.leave_without_pay }} | \\n\\t\\t\\t{{ doc.name }} | \\n\\t\\t
\\n\\t\\t\\t\\t{{ _(\\\"Salary Statement\\\") }}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ frappe.format(doc.start_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{{ _(\\\"to\\\") }} {{ frappe.format(doc.end_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{%- if doc.current_payroll_period %} • {{ _(\\\"Payroll Period\\\") }} {{ doc.current_payroll_period }}{% endif %}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t{{ doc.name }}\\n\\t\\t\\t\\t{{ _(\\\"Issued\\\") }} {{ frappe.format(doc.posting_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t | \\n\\t\\t
\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t
| \\n\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Working Days\\\") }} \\n\\t\\t\\t\\t{{ doc.total_working_days }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Payment Days\\\") }} \\n\\t\\t\\t\\t{{ doc.payment_days }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Leave Without Pay\\\") }} \\n\\t\\t\\t\\t{{ doc.leave_without_pay }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Absent Days\\\") }} \\n\\t\\t\\t\\t{{ doc.absent_days }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Unmarked Days\\\") }} \\n\\t\\t\\t\\t{{ doc.unmarked_days }} \\n\\t\\t\\t | \\n\\t\\t
| {{ _(\\\"Earnings\\\") }} | \\n\\t\\t\\t\\n\\t\\t |
| {{ _(\\\"Component\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"This Period\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Year to Date\\\") }} | \\n\\t\\t\\t
|---|---|---|
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t\\t{{ money(row.year_to_date) }} | \\n\\t\\t\\t
| {{ _(\\\"Gross Pay\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.gross_pay) }} | \\n\\t\\t\\t\\t{{ money(doc.gross_year_to_date) }} | \\n\\t\\t\\t
| {{ _(\\\"Deductions\\\") }} | \\n\\t\\t\\t\\n\\t\\t |
| {{ _(\\\"Component\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"This Period\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Year to Date\\\") }} | \\n\\t\\t\\t
|---|---|---|
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t\\t{{ money(row.year_to_date) }} | \\n\\t\\t\\t
| {{ _(\\\"Total Deduction\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.total_deduction) }} | \\n\\t\\t\\t\\t{{ money(deductions | sum(attribute=\\\"year_to_date\\\")) }} | \\n\\t\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Net Pay\\\") }} \\n\\t\\t\\t\\t{{ doc.total_in_words }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ money(net_total) }} \\n\\t\\t\\t\\t{{ _(\\\"Net paid year to date\\\") }} {{ money(doc.year_to_date) }} \\n\\t\\t\\t | \\n\\t\\t
\\n\\t\\t\\t\\t{% if doc.leave_details %}\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t{% if show_tax %}\\n\\t\\t\\t\\t
| \\n\\t\\t
| \\n\\t\\t\\t\\t{%- if doc.bank_name -%}\\n\\t\\t\\t\\t\\t{{ doc.bank_name }}\\n\\t\\t\\t\\t\\t{%- if doc.bank_account_no %} • {{ _(\\\"A/C\\\") }} {{ doc.bank_account_no }}{% endif -%}\\n\\t\\t\\t\\t\\t{%- if doc.mode_of_payment %} • {{ _(doc.mode_of_payment) }}{% endif -%}\\n\\t\\t\\t\\t{%- elif doc.mode_of_payment -%}\\n\\t\\t\\t\\t\\t{{ _(\\\"Paid by\\\") }} {{ _(doc.mode_of_payment) }}\\n\\t\\t\\t\\t{%- endif -%}\\n\\t\\t\\t | \\n\\t\\t\\t{{ _(\\\"This is a computer generated document and does not require a signature.\\\") }} | \\n\\t\\t
\\n\\t\\t\\t\\t{{ _(\\\"Salary Statement\\\") }}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ frappe.format(doc.start_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{{ _(\\\"to\\\") }} {{ frappe.format(doc.end_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t\\t\\t{%- if doc.current_payroll_period %} • {{ _(\\\"Payroll Period\\\") }} {{ doc.current_payroll_period }}{% endif %}\\n\\t\\t\\t\\t \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t{{ doc.name }}\\n\\t\\t\\t\\t{{ _(\\\"Issued\\\") }} {{ frappe.format(doc.posting_date, {\\\"fieldtype\\\": \\\"Date\\\"}) }}\\n\\t\\t\\t | \\n\\t\\t
\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t
| \\n\\t\\t
| \\n\\t\\t\\t\\t {{ _(\\\"Working Days\\\") }} \\n\\t\\t\\t\\t{{ doc.total_working_days }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Payment Days\\\") }} \\n\\t\\t\\t\\t{{ doc.payment_days }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Leave Without Pay\\\") }} \\n\\t\\t\\t\\t{{ doc.leave_without_pay }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Absent Days\\\") }} \\n\\t\\t\\t\\t{{ doc.absent_days }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ _(\\\"Unmarked Days\\\") }} \\n\\t\\t\\t\\t{{ doc.unmarked_days }} \\n\\t\\t\\t | \\n\\t\\t
| {{ _(\\\"Earnings\\\") }} | \\n\\t\\t\\t\\n\\t\\t |
| {{ _(\\\"Component\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"This Period\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Year to Date\\\") }} | \\n\\t\\t\\t
|---|---|---|
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t\\t{{ money(row.year_to_date) }} | \\n\\t\\t\\t
| {{ _(\\\"Gross Pay\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.gross_pay) }} | \\n\\t\\t\\t\\t{{ money(doc.gross_year_to_date) }} | \\n\\t\\t\\t
| {{ _(\\\"Deductions\\\") }} | \\n\\t\\t\\t\\n\\t\\t |
| {{ _(\\\"Component\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"This Period\\\") }} | \\n\\t\\t\\t\\t{{ _(\\\"Year to Date\\\") }} | \\n\\t\\t\\t
|---|---|---|
| {{ _(row.salary_component) }} | \\n\\t\\t\\t\\t{{ money(row.amount) }} | \\n\\t\\t\\t\\t{{ money(row.year_to_date) }} | \\n\\t\\t\\t
| {{ _(\\\"Total Deduction\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.total_deduction) }} | \\n\\t\\t\\t\\t{{ money(deductions | sum(attribute=\\\"year_to_date\\\")) }} | \\n\\t\\t\\t
| {{ _(\\\"Total Loan Repayment\\\") }} | \\n\\t\\t\\t\\t{{ money(doc.total_loan_repayment) }} | \\n\\t\\t\\t\\t\\n\\t\\t\\t |
| \\n\\t\\t\\t\\t {{ _(\\\"Net Pay\\\") }} \\n\\t\\t\\t\\t{{ doc.total_in_words }} \\n\\t\\t\\t | \\n\\t\\t\\t\\n\\t\\t\\t\\t {{ money(net_total) }} \\n\\t\\t\\t\\t{{ _(\\\"Net paid year to date\\\") }} {{ money(doc.year_to_date) }} \\n\\t\\t\\t | \\n\\t\\t
\\n\\t\\t\\t\\t{% if doc.leave_details %}\\n\\t\\t\\t\\t
| \\n\\t\\t\\t\\n\\t\\t\\t\\t{% if show_tax %}\\n\\t\\t\\t\\t
| \\n\\t\\t
| \\n\\t\\t\\t\\t{%- if doc.bank_name -%}\\n\\t\\t\\t\\t\\t{{ doc.bank_name }}\\n\\t\\t\\t\\t\\t{%- if doc.bank_account_no %} • {{ _(\\\"A/C\\\") }} {{ doc.bank_account_no }}{% endif -%}\\n\\t\\t\\t\\t\\t{%- if doc.mode_of_payment %} • {{ _(doc.mode_of_payment) }}{% endif -%}\\n\\t\\t\\t\\t{%- elif doc.mode_of_payment -%}\\n\\t\\t\\t\\t\\t{{ _(\\\"Paid by\\\") }} {{ _(doc.mode_of_payment) }}\\n\\t\\t\\t\\t{%- endif -%}\\n\\t\\t\\t | \\n\\t\\t\\t{{ _(\\\"This is a computer generated document and does not require a signature.\\\") }} | \\n\\t\\t