mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
Merge pull request #36985 from deepeshgarg007/employee_loan_repayment
fix: Update party type for payroll payable account
This commit is contained in:
@@ -408,6 +408,16 @@ class LoanRepayment(AccountsController):
|
|||||||
else:
|
else:
|
||||||
payment_account = self.payment_account
|
payment_account = self.payment_account
|
||||||
|
|
||||||
|
payment_party_type = ""
|
||||||
|
payment_party = ""
|
||||||
|
|
||||||
|
if (
|
||||||
|
hasattr(self, "process_payroll_accounting_entry_based_on_employee")
|
||||||
|
and self.process_payroll_accounting_entry_based_on_employee
|
||||||
|
):
|
||||||
|
payment_party_type = "Employee"
|
||||||
|
payment_party = self.applicant
|
||||||
|
|
||||||
if self.total_penalty_paid:
|
if self.total_penalty_paid:
|
||||||
gle_map.append(
|
gle_map.append(
|
||||||
self.get_gl_dict(
|
self.get_gl_dict(
|
||||||
@@ -455,6 +465,8 @@ class LoanRepayment(AccountsController):
|
|||||||
"remarks": _(remarks),
|
"remarks": _(remarks),
|
||||||
"cost_center": self.cost_center,
|
"cost_center": self.cost_center,
|
||||||
"posting_date": getdate(self.posting_date),
|
"posting_date": getdate(self.posting_date),
|
||||||
|
"party_type": payment_party_type,
|
||||||
|
"party": payment_party,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -493,6 +505,7 @@ def create_repayment_entry(
|
|||||||
amount_paid,
|
amount_paid,
|
||||||
penalty_amount=None,
|
penalty_amount=None,
|
||||||
payroll_payable_account=None,
|
payroll_payable_account=None,
|
||||||
|
process_payroll_accounting_entry_based_on_employee=0,
|
||||||
):
|
):
|
||||||
|
|
||||||
lr = frappe.get_doc(
|
lr = frappe.get_doc(
|
||||||
@@ -509,6 +522,7 @@ def create_repayment_entry(
|
|||||||
"amount_paid": amount_paid,
|
"amount_paid": amount_paid,
|
||||||
"loan_type": loan_type,
|
"loan_type": loan_type,
|
||||||
"payroll_payable_account": payroll_payable_account,
|
"payroll_payable_account": payroll_payable_account,
|
||||||
|
"process_payroll_accounting_entry_based_on_employee": process_payroll_accounting_entry_based_on_employee,
|
||||||
}
|
}
|
||||||
).insert()
|
).insert()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user