fix: add set query for payroll entry in JV
This commit is contained in:
parent
7bea25a23a
commit
c8d632ddff
@ -145,6 +145,13 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
};
|
||||
}
|
||||
|
||||
// payroll entry
|
||||
if(jvd.reference_type==="Payroll Entry") {
|
||||
return {
|
||||
query: "erpnext.hr.doctype.payroll_entry.payroll_entry.get_payroll_entries_for_jv",
|
||||
};
|
||||
}
|
||||
|
||||
var out = {
|
||||
filters: [
|
||||
[jvd.reference_type, "docstatus", "=", 1]
|
||||
|
@ -525,3 +525,17 @@ def payroll_entry_has_bank_entries(name):
|
||||
response['submitted'] = 1 if bank_entries else 0
|
||||
|
||||
return response
|
||||
|
||||
def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters):
|
||||
print(doctype)
|
||||
return frappe.db.sql("""
|
||||
select name from `tabPayroll Entry`
|
||||
where `{key}` LIKE %(txt)s
|
||||
and name not in
|
||||
(select reference_name from `tabJournal Entry Account`
|
||||
where reference_type="Payroll Entry")
|
||||
order by name limit %(start)s, %(page_len)s"""
|
||||
.format(key=searchfield), {
|
||||
'txt': "%%%s%%" % frappe.db.escape(txt),
|
||||
'start': start, 'page_len': page_len
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user