Trigger Apply Price List on change of Currency Conversion Rate or Price List Currency Conversion Rate
This commit is contained in:
parent
dffec8fb85
commit
51f722d20f
@ -236,8 +236,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
if(flt(this.frm.doc.conversion_rate)>0.0) {
|
if(flt(this.frm.doc.conversion_rate)>0.0) {
|
||||||
if(this.frm.doc.ignore_pricing_rule) {
|
if(this.frm.doc.ignore_pricing_rule) {
|
||||||
this.calculate_taxes_and_totals();
|
this.calculate_taxes_and_totals();
|
||||||
} else {
|
} else if (!this.in_apply_price_list){
|
||||||
this.apply_pricing_rule();
|
this.apply_price_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -254,22 +254,17 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
price_list_currency: function() {
|
price_list_currency: function() {
|
||||||
var me=this;
|
var me=this;
|
||||||
this.set_dynamic_labels();
|
this.set_dynamic_labels();
|
||||||
|
this.set_plc_conversion_rate();
|
||||||
var company_currency = this.get_company_currency();
|
|
||||||
if(this.frm.doc.price_list_currency !== company_currency) {
|
|
||||||
this.get_exchange_rate(this.frm.doc.price_list_currency, company_currency,
|
|
||||||
function(exchange_rate) {
|
|
||||||
if(exchange_rate) {
|
|
||||||
me.frm.set_value("plc_conversion_rate", exchange_rate);
|
|
||||||
me.plc_conversion_rate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.plc_conversion_rate();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
plc_conversion_rate: function() {
|
plc_conversion_rate: function() {
|
||||||
|
this.set_plc_conversion_rate();
|
||||||
|
if(!this.in_apply_price_list) {
|
||||||
|
this.apply_price_list();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
set_plc_conversion_rate: function() {
|
||||||
if(this.frm.doc.price_list_currency === this.get_company_currency()) {
|
if(this.frm.doc.price_list_currency === this.get_company_currency()) {
|
||||||
this.frm.set_value("plc_conversion_rate", 1.0);
|
this.frm.set_value("plc_conversion_rate", 1.0);
|
||||||
}
|
}
|
||||||
@ -403,8 +398,10 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
args: { args: this._get_args() },
|
args: { args: this._get_args() },
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (!r.exc) {
|
if (!r.exc) {
|
||||||
|
me.in_apply_price_list = true;
|
||||||
me.frm.set_value("price_list_currency", r.message.parent.price_list_currency);
|
me.frm.set_value("price_list_currency", r.message.parent.price_list_currency);
|
||||||
me.frm.set_value("plc_conversion_rate", r.message.parent.plc_conversion_rate);
|
me.frm.set_value("plc_conversion_rate", r.message.parent.plc_conversion_rate);
|
||||||
|
me.in_apply_price_list = false;
|
||||||
me._set_values_for_item_list(r.message.children);
|
me._set_values_for_item_list(r.message.children);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
# ERPNext - web based ERP (http://erpnext.com)
|
# ERPNext - web based ERP (http://erpnext.com)
|
||||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -26,11 +26,3 @@ user_defaults = {
|
|||||||
"Company": "company",
|
"Company": "company",
|
||||||
"Territory": "territory"
|
"Territory": "territory"
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_monthly_bulk_mail_limit():
|
|
||||||
import frappe
|
|
||||||
# if global settings, then 500 or unlimited
|
|
||||||
if frappe.db.get_value('Outgoing Email Settings', None, 'mail_server'):
|
|
||||||
return 999999
|
|
||||||
else:
|
|
||||||
return 500
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user