commit
a445c39901
@ -265,8 +265,8 @@ class SalesInvoice(SellingController):
|
|||||||
where name = %s and (ifnull(end_of_life,'')='' or end_of_life > now())""", d.item_code)
|
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)
|
where name = %s and docstatus != 2""", d.income_account)
|
||||||
if item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset':
|
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(d.item_code), raise_exception=True)
|
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):
|
def validate_with_previous_doc(self):
|
||||||
super(SalesInvoice, self).validate_with_previous_doc(self.tname, {
|
super(SalesInvoice, self).validate_with_previous_doc(self.tname, {
|
||||||
|
|||||||
@ -12,7 +12,6 @@ from frappe.model.document import Document
|
|||||||
from erpnext.setup.doctype.sms_settings.sms_settings import send_sms
|
from erpnext.setup.doctype.sms_settings.sms_settings import send_sms
|
||||||
|
|
||||||
class SMSCenter(Document):
|
class SMSCenter(Document):
|
||||||
|
|
||||||
def create_receiver_list(self):
|
def create_receiver_list(self):
|
||||||
rec, where_clause = '', ''
|
rec, where_clause = '', ''
|
||||||
if self.send_to == 'All Customer Contact':
|
if self.send_to == 'All Customer Contact':
|
||||||
@ -71,6 +70,7 @@ class SMSCenter(Document):
|
|||||||
return receiver_nos
|
return receiver_nos
|
||||||
|
|
||||||
def send_sms(self):
|
def send_sms(self):
|
||||||
|
receiver_list = []
|
||||||
if not self.message:
|
if not self.message:
|
||||||
msgprint(_("Please enter message before sending"))
|
msgprint(_("Please enter message before sending"))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -17,4 +17,10 @@ cur_frm.cscript.onload = function() {
|
|||||||
|
|
||||||
frappe.ui.form.on("Serial No", "refresh", function(frm) {
|
frappe.ui.form.on("Serial No", "refresh", function(frm) {
|
||||||
frm.toggle_enable("item_code", frm.doc.__islocal);
|
frm.toggle_enable("item_code", frm.doc.__islocal);
|
||||||
|
|
||||||
|
if(frm.doc.status == "Sales Returned" && frm.doc.warehouse)
|
||||||
|
cur_frm.add_custom_button(__('Set Status as Available'), function() {
|
||||||
|
cur_frm.set_value("status", "Available");
|
||||||
|
cur_frm.save();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user