[fix] sms settings, fixes #3276

This commit is contained in:
Rushabh Mehta 2015-05-19 11:10:12 +05:30
parent 632fb3879e
commit 4a3c805049
2 changed files with 10 additions and 9 deletions

View File

@ -45,7 +45,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
&& !(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();
} }
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) {
this.calculate_taxes_and_totals(); this.calculate_taxes_and_totals();
} }
@ -63,7 +63,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
erpnext.pos.make_pos_btn(this.frm); erpnext.pos.make_pos_btn(this.frm);
this.setup_sms(); this.setup_sms();
}, },
apply_default_taxes: function() { apply_default_taxes: function() {
var me = this; var me = this;
return frappe.call({ return frappe.call({
@ -83,14 +83,15 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
setup_sms: function() { setup_sms: function() {
var me = this; var me = this;
if(this.frm.doc.docstatus===1 && !in_list(["Lost", "Stopped"], this.frm.doc.status)) { if(this.frm.doc.docstatus===1 && !in_list(["Lost", "Stopped"], this.frm.doc.status)
&& this.frm.doctype != "Purchase Invoice") {
this.frm.page.add_menu_item(__('Send SMS'), function() { me.send_sms(); }); this.frm.page.add_menu_item(__('Send SMS'), function() { me.send_sms(); });
} }
}, },
send_sms: function() { send_sms: function() {
frappe.require("assets/erpnext/js/sms_manager.js"); frappe.require("assets/erpnext/js/sms_manager.js");
var sms_man = new SMSManager(this.doc); var sms_man = new SMSManager(this.frm.doc);
}, },
hide_currency_and_price_list: function() { hide_currency_and_price_list: function() {
@ -255,7 +256,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
this.frm.doc.plc_conversion_rate !== this.frm.doc.conversion_rate) { this.frm.doc.plc_conversion_rate !== this.frm.doc.conversion_rate) {
this.frm.set_value("plc_conversion_rate", this.frm.doc.conversion_rate); this.frm.set_value("plc_conversion_rate", this.frm.doc.conversion_rate);
} }
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();
@ -302,7 +303,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
cint(this.frm.doc.plc_conversion_rate) != cint(this.frm.doc.conversion_rate)) { cint(this.frm.doc.plc_conversion_rate) != cint(this.frm.doc.conversion_rate)) {
this.frm.set_value("conversion_rate", this.frm.doc.plc_conversion_rate); this.frm.set_value("conversion_rate", this.frm.doc.plc_conversion_rate);
} }
if(!this.in_apply_price_list) { if(!this.in_apply_price_list) {
this.apply_price_list(); this.apply_price_list();
} }

View File

@ -44,9 +44,9 @@ class SMSCenter(Document):
ifnull(cell_number,'')!='' %s""" % where_clause) ifnull(cell_number,'')!='' %s""" % where_clause)
elif self.send_to == 'All Sales Person': elif self.send_to == 'All Sales Person':
rec = frappe.db.sql("""select sales_person_name, tabEmployee.cell_number from rec = frappe.db.sql("""select sales_person_name,
`tabSales Person`, tabEmployee tabEmployee.cell_number from `tabSales Person` left join tabEmployee
and `tabSales Person`.employee = tabEmployee.name on `tabSales Person`.employee = tabEmployee.name
where ifnull(tabEmployee.cell_number,'')!=''""") where ifnull(tabEmployee.cell_number,'')!=''""")
rec_list = '' rec_list = ''