From bdfb070ed6c9a66b8f27c366d7b37d5d73499582 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 28 Oct 2015 15:38:08 +0530 Subject: [PATCH] [fix] Serial No query in Warranty Claim --- erpnext/public/js/controllers/transaction.js | 12 ++++++------ .../support/doctype/warranty_claim/warranty_claim.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 4d33f81c5c..f518e9c53d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -76,10 +76,9 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ if(this.frm.doc.__islocal && !(this.frm.doc.taxes || []).length && !(this.frm.doc.__onload ? this.frm.doc.__onload.load_after_mapping : false)) { this.apply_default_taxes(); - } - - if(this.frm.doc.__islocal && this.frm.doc.company && this.frm.doc["items"] && !this.frm.doc.is_pos) { - this.calculate_taxes_and_totals(); + } else if(this.frm.doc.__islocal && this.frm.doc.company && this.frm.doc["items"] + && !this.frm.doc.is_pos) { + me.calculate_taxes_and_totals(); } if(frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "item_code")) { cur_frm.get_field("items").grid.set_multiple_add("item_code", "qty"); @@ -102,7 +101,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ me.frm.doc.name); if(taxes_and_charges_field) { - frappe.call({ + return frappe.call({ method: "erpnext.controllers.accounts_controller.get_default_taxes_and_charges", args: { "master_doctype": taxes_and_charges_field.options @@ -110,6 +109,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ callback: function(r) { if(!r.exc) { me.frm.set_value("taxes", r.message); + me.calculate_taxes_and_totals(); } } }); @@ -362,7 +362,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ }, get_exchange_rate: function(from_currency, to_currency, callback) { - frappe.call({ + return frappe.call({ method: "erpnext.setup.utils.get_exchange_rate", args: { from_currency: from_currency, diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.js b/erpnext/support/doctype/warranty_claim/warranty_claim.js index 941a80386a..9e1c83ef35 100644 --- a/erpnext/support/doctype/warranty_claim/warranty_claim.js +++ b/erpnext/support/doctype/warranty_claim/warranty_claim.js @@ -51,7 +51,7 @@ cur_frm.fields_dict['serial_no'].get_query = function(doc, cdt, cdn) { var cond = []; var filter = [ ['Serial No', 'docstatus', '!=', 2], - ['Serial No', 'status', '=', "Delivered"] + ['Serial No', 'warehouse', '=', ""] ]; if(doc.item_code) { cond = ['Serial No', 'item_code', '=', doc.item_code];