[minor] fixes in queries and payment tool
This commit is contained in:
parent
9345240ff1
commit
1fef2fad2d
@ -90,7 +90,7 @@ frappe.ui.form.on("Payment Tool", "payment_mode", function(frm) {
|
|||||||
"mode_of_payment": frm.doc.payment_mode,
|
"mode_of_payment": frm.doc.payment_mode,
|
||||||
"company": frm.doc.company
|
"company": frm.doc.company
|
||||||
},
|
},
|
||||||
callback: function(r, rt) {
|
callback: function(r, rt) {
|
||||||
if(r.message) {
|
if(r.message) {
|
||||||
cur_frm.set_value("payment_account", r.message['account']);
|
cur_frm.set_value("payment_account", r.message['account']);
|
||||||
}
|
}
|
||||||
@ -169,6 +169,10 @@ erpnext.payment_tool.validate_against_voucher = function(frm) {
|
|||||||
// validate against_voucher_type
|
// validate against_voucher_type
|
||||||
frappe.ui.form.on("Payment Tool Detail", "against_voucher_no", function(frm, cdt, cdn) {
|
frappe.ui.form.on("Payment Tool Detail", "against_voucher_no", function(frm, cdt, cdn) {
|
||||||
var row = locals[cdt][cdn];
|
var row = locals[cdt][cdn];
|
||||||
|
if (!row.against_voucher_no) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_against_voucher_amount',
|
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_against_voucher_amount',
|
||||||
args: {
|
args: {
|
||||||
@ -233,4 +237,4 @@ erpnext.payment_tool.check_mandatory_to_fetch = function(doc) {
|
|||||||
$.each(["Company", "Party Type", "Party", "Received or Paid"], function(i, field) {
|
$.each(["Company", "Party Type", "Party", "Received or Paid"], function(i, field) {
|
||||||
if(!doc[frappe.model.scrub(field)]) frappe.throw(__("Please select {0} first", [field]));
|
if(!doc[frappe.model.scrub(field)]) frappe.throw(__("Please select {0} first", [field]));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ from frappe.utils import nowdate
|
|||||||
|
|
||||||
def get_filters_cond(doctype, filters, conditions):
|
def get_filters_cond(doctype, filters, conditions):
|
||||||
if filters:
|
if filters:
|
||||||
|
flt = filters
|
||||||
if isinstance(filters, dict):
|
if isinstance(filters, dict):
|
||||||
filters = filters.items()
|
filters = filters.items()
|
||||||
flt = []
|
flt = []
|
||||||
|
@ -147,9 +147,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) {
|
|||||||
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc) {
|
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc) {
|
||||||
return{
|
return{
|
||||||
query: "erpnext.controllers.queries.item_query",
|
query: "erpnext.controllers.queries.item_query",
|
||||||
filters: {
|
filters: [["Item", "name", "!=", doc.item]]
|
||||||
"name": "!" + cstr(doc.item)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user