mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
Merge branch 'develop' of https://github.com/DigiThinkIT/erpnext into DigiThinkIT-develop
This commit is contained in:
@@ -53,7 +53,7 @@ class Customer(TransactionBase):
|
|||||||
|
|
||||||
def get_customer_name(self):
|
def get_customer_name(self):
|
||||||
if frappe.db.get_value("Customer", self.customer_name):
|
if frappe.db.get_value("Customer", self.customer_name):
|
||||||
count = frappe.db.sql("""select ifnull(max(SUBSTRING_INDEX(name, ' ', -1)), 0) from tabCustomer
|
count = frappe.db.sql("""select ifnull(MAX(CAST(SUBSTRING_INDEX(name, ' ', -1) AS UNSIGNED)), 0) from tabCustomer
|
||||||
where name like %s""", "%{0} - %".format(self.customer_name), as_list=1)[0][0]
|
where name like %s""", "%{0} - %".format(self.customer_name), as_list=1)[0][0]
|
||||||
count = cint(count) + 1
|
count = cint(count) + 1
|
||||||
return "{0} - {1}".format(self.customer_name, cstr(count))
|
return "{0} - {1}".format(self.customer_name, cstr(count))
|
||||||
|
|||||||
Reference in New Issue
Block a user