Merge pull request #4245 from nabinhait/sr_no

[fix] Serial No query in Warranty Claim
This commit is contained in:
Nabin Hait 2015-10-28 15:51:32 +05:30
commit dc8ce7f7e9
2 changed files with 7 additions and 7 deletions

View File

@ -76,10 +76,9 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
if(this.frm.doc.__islocal && !(this.frm.doc.taxes || []).length if(this.frm.doc.__islocal && !(this.frm.doc.taxes || []).length
&& !(this.frm.doc.__onload ? this.frm.doc.__onload.load_after_mapping : false)) { && !(this.frm.doc.__onload ? this.frm.doc.__onload.load_after_mapping : false)) {
this.apply_default_taxes(); this.apply_default_taxes();
} } else if(this.frm.doc.__islocal && this.frm.doc.company && this.frm.doc["items"]
&& !this.frm.doc.is_pos) {
if(this.frm.doc.__islocal && this.frm.doc.company && this.frm.doc["items"] && !this.frm.doc.is_pos) { me.calculate_taxes_and_totals();
this.calculate_taxes_and_totals();
} }
if(frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "item_code")) { if(frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "item_code")) {
cur_frm.get_field("items").grid.set_multiple_add("item_code", "qty"); 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); me.frm.doc.name);
if(taxes_and_charges_field) { if(taxes_and_charges_field) {
frappe.call({ return frappe.call({
method: "erpnext.controllers.accounts_controller.get_default_taxes_and_charges", method: "erpnext.controllers.accounts_controller.get_default_taxes_and_charges",
args: { args: {
"master_doctype": taxes_and_charges_field.options "master_doctype": taxes_and_charges_field.options
@ -110,6 +109,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
callback: function(r) { callback: function(r) {
if(!r.exc) { if(!r.exc) {
me.frm.set_value("taxes", r.message); 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) { get_exchange_rate: function(from_currency, to_currency, callback) {
frappe.call({ return frappe.call({
method: "erpnext.setup.utils.get_exchange_rate", method: "erpnext.setup.utils.get_exchange_rate",
args: { args: {
from_currency: from_currency, from_currency: from_currency,

View File

@ -51,7 +51,7 @@ cur_frm.fields_dict['serial_no'].get_query = function(doc, cdt, cdn) {
var cond = []; var cond = [];
var filter = [ var filter = [
['Serial No', 'docstatus', '!=', 2], ['Serial No', 'docstatus', '!=', 2],
['Serial No', 'status', '=', "Delivered"] ['Serial No', 'warehouse', '=', ""]
]; ];
if(doc.item_code) { if(doc.item_code) {
cond = ['Serial No', 'item_code', '=', doc.item_code]; cond = ['Serial No', 'item_code', '=', doc.item_code];