minor fix in sales invoice

This commit is contained in:
Nabin Hait 2014-06-23 10:03:23 +05:30 committed by Anand Doshi
parent 37f809a1f4
commit 838aeb149f
2 changed files with 4 additions and 4 deletions

View File

@ -263,10 +263,10 @@ class SalesInvoice(SellingController):
for d in self.get('entries'):
item = frappe.db.sql("""select name,is_asset_item,is_sales_item from `tabItem`
where name = %s and (ifnull(end_of_life,'')='' or end_of_life > now())""", d.item_code)
acc = frappe.db.sql("""select account_type from `tabAccount`
acc = frappe.db.sql("""select account_type from `tabAccount`
where name = %s and docstatus != 2""", d.income_account)
if item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset':
msgprint(_("Account {0} must be of type 'Fixed Asset' as Item {1} is an Asset Item").format(d.item_code), raise_exception=True)
if item and item[0][1] == 'Yes' and acc and acc[0][0] != 'Fixed Asset':
msgprint(_("Account {0} must be of type 'Fixed Asset' as Item {1} is an Asset Item").format(acc[0][0], d.item_code), raise_exception=True)
def validate_with_previous_doc(self):
super(SalesInvoice, self).validate_with_previous_doc(self.tname, {

View File

@ -12,7 +12,6 @@ from frappe.model.document import Document
from erpnext.setup.doctype.sms_settings.sms_settings import send_sms
class SMSCenter(Document):
def create_receiver_list(self):
rec, where_clause = '', ''
if self.send_to == 'All Customer Contact':
@ -71,6 +70,7 @@ class SMSCenter(Document):
return receiver_nos
def send_sms(self):
receiver_list = []
if not self.message:
msgprint(_("Please enter message before sending"))
else: