[Fix] Wrong salary slips showing when click on view salary slips from payroll entry (#13152)
This commit is contained in:
parent
67cfa81de2
commit
0eb8bb2511
@ -5,7 +5,10 @@ var in_progress = false;
|
||||
|
||||
frappe.ui.form.on('Payroll Entry', {
|
||||
onload: function (frm) {
|
||||
frm.doc.posting_date = frappe.datetime.nowdate();
|
||||
if (!frm.doc.posting_date) {
|
||||
frm.doc.posting_date = frappe.datetime.nowdate();
|
||||
}
|
||||
|
||||
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
|
||||
},
|
||||
|
||||
|
@ -175,7 +175,7 @@ class PayrollEntry(Document):
|
||||
Get loan details from submitted salary slip based on selected criteria
|
||||
"""
|
||||
cond = self.get_filter_condition()
|
||||
return frappe.db.sql(""" select eld.employee_loan_account,
|
||||
return frappe.db.sql(""" select eld.employee_loan_account, eld.employee_loan,
|
||||
eld.interest_income_account, eld.principal_amount, eld.interest_amount, eld.total_payment
|
||||
from
|
||||
`tabSalary Slip` t1, `tabSalary Slip Loan` eld
|
||||
@ -283,7 +283,12 @@ class PayrollEntry(Document):
|
||||
"account": data.employee_loan_account,
|
||||
"credit_in_account_currency": data.principal_amount
|
||||
})
|
||||
accounts.append({
|
||||
|
||||
if data.interest_amount and not data.interest_income_account:
|
||||
frappe.throw(_("Select interest income account in employee loan {0}").format(data.employee_loan))
|
||||
|
||||
if data.interest_income_account and data.interest_amount:
|
||||
accounts.append({
|
||||
"account": data.interest_income_account,
|
||||
"credit_in_account_currency": data.interest_amount,
|
||||
"cost_center": self.cost_center,
|
||||
|
Loading…
x
Reference in New Issue
Block a user