[Fix] SMS Center

This commit is contained in:
Akhilesh Darjee 2013-06-26 18:28:54 +05:30
parent e26acffcfe
commit 89bd216a0c
5 changed files with 16 additions and 15 deletions

View File

@ -147,7 +147,7 @@ cur_frm.cscript.account_head = function(doc, cdt, cdn) {
d.account_head = ''; d.account_head = '';
} }
else if(d.account_head && d.charge_type) { else if(d.account_head && d.charge_type) {
arg = "{'charge_type' : '" + d.charge_type +"', 'account_head' : '" + d.account_head + "'}"; arg = "{'charge_type' : '" + d.charge_type + "', 'account_head' : '" + d.account_head + "'}";
get_server_fields('get_rate', arg, 'purchase_tax_details', doc, cdt, cdn, 1); get_server_fields('get_rate', arg, 'purchase_tax_details', doc, cdt, cdn, 1);
} }
refresh_field('account_head',d.name,'purchase_tax_details'); refresh_field('account_head',d.name,'purchase_tax_details');

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-04-19 11:00:07", "creation": "2013-06-04 11:02:19",
"docstatus": 0, "docstatus": 0,
"modified": "2013-05-22 12:06:15", "modified": "2013-06-26 14:33:21",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -243,7 +243,8 @@
"oldfieldname": "serial_no", "oldfieldname": "serial_no",
"oldfieldtype": "Small Text", "oldfieldtype": "Small Text",
"print_hide": 0, "print_hide": 0,
"read_only": 0 "read_only": 0,
"reqd": 0
}, },
{ {
"doctype": "DocField", "doctype": "DocField",

View File

@ -87,7 +87,6 @@ cur_frm.cscript.supplier = function(doc, dt, dn) {
get_server_fields('get_default_supplier_address', get_server_fields('get_default_supplier_address',
JSON.stringify({ supplier: doc.supplier }), '', doc, dt, dn, 1, JSON.stringify({ supplier: doc.supplier }), '', doc, dt, dn, 1,
function() { cur_frm.refresh(); }); function() { cur_frm.refresh(); });
cur_frm.cscript.toggle_contact_section(doc);
} }
} }

View File

@ -35,11 +35,12 @@ class DocType:
def create_receiver_list(self): def create_receiver_list(self):
rec, where_clause = '', '' rec, where_clause = '', ''
if self.doc.send_to == 'All Customer Contact': if self.doc.send_to == 'All Customer Contact':
where_clause = self.doc.customer and " and customer = '%s'" % self.doc.customer or " and ifnull(is_customer, 0) = 1" where_clause = self.doc.customer and " and customer = '%s'" % self.doc.customer or " and ifnull(customer, '') != ''"
if self.doc.send_to == 'All Supplier Contact': if self.doc.send_to == 'All Supplier Contact':
where_clause = self.doc.supplier and " and ifnull(is_supplier, 0) = 1 and supplier = '%s'" % self.doc.supplier or " and ifnull(is_supplier, 0) = 1" where_clause = self.doc.supplier and " and ifnull(is_supplier, 0) = 1 and supplier = '%s'" % self.doc.supplier or " and ifnull(supplier, '') != ''"
if self.doc.send_to == 'All Sales Partner Contact': if self.doc.send_to == 'All Sales Partner Contact':
where_clause = self.doc.sales_partner and " and ifnull(is_sales_partner, 0) = 1 and sales_aprtner = '%s'" % self.doc.sales_partner or " and ifnull(is_sales_partner, 0) = 1" where_clause = self.doc.sales_partner and " and ifnull(is_sales_partner, 0) = 1 and sales_partner = '%s'" % self.doc.sales_partner or " and ifnull(sales_partner, '') != ''"
if self.doc.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']: if self.doc.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']:
rec = sql("select CONCAT(ifnull(first_name,''),'',ifnull(last_name,'')), mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and docstatus != 2 %s" % where_clause) rec = sql("select CONCAT(ifnull(first_name,''),'',ifnull(last_name,'')), mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and docstatus != 2 %s" % where_clause)
elif self.doc.send_to == 'All Lead (Open)': elif self.doc.send_to == 'All Lead (Open)':