Merge branch 'hotfix' into fix-scorecard
This commit is contained in:
commit
b44b200e7c
@ -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]
|
||||
@ -169,8 +176,16 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
}
|
||||
|
||||
if(jvd.party_type && jvd.party) {
|
||||
out.filters.push([jvd.reference_type,
|
||||
(jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier"), "=", jvd.party]);
|
||||
var party_field = "";
|
||||
if(jvd.reference_type.indexOf("Sales")===0) {
|
||||
var party_field = "customer";
|
||||
} else if (jvd.reference_type.indexOf("Purchase")===0) {
|
||||
var party_field = "supplier";
|
||||
}
|
||||
|
||||
if (party_field) {
|
||||
out.filters.push([jvd.reference_type, party_field, "=", jvd.party]);
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
|
@ -525,3 +525,16 @@ 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):
|
||||
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
|
||||
})
|
||||
|
@ -16,7 +16,7 @@ def send_message(subject="Website Query", message="", sender="", status="Open"):
|
||||
|
||||
customer = frappe.db.sql("""select distinct dl.link_name from `tabDynamic Link` dl
|
||||
left join `tabContact` c on dl.parent=c.name where dl.link_doctype='Customer'
|
||||
and c.email_id='{email_id}'""".format(email_id=sender))
|
||||
and c.email_id = %s""", sender)
|
||||
|
||||
if not customer:
|
||||
lead = frappe.db.get_value('Lead', dict(email_id=sender))
|
||||
|
Loading…
x
Reference in New Issue
Block a user