2013-08-05 09:29:54 +00:00
|
|
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
2013-04-02 05:11:37 +00:00
|
|
|
import webnotes, conf, os
|
2013-05-22 10:21:47 +00:00
|
|
|
from webnotes.utils import cint, cstr, encode
|
2013-09-10 10:19:18 +00:00
|
|
|
|
|
|
|
def get_website_settings():
|
|
|
|
return {
|
|
|
|
"shopping_cart_enabled": cint(webnotes.conn.get_default("shopping_cart_enabled"))
|
|
|
|
}
|
2013-07-10 15:19:44 +00:00
|
|
|
|
|
|
|
@webnotes.whitelist()
|
|
|
|
def update_profile(fullname, password=None, company_name=None, mobile_no=None, phone=None):
|
2013-09-09 06:47:45 +00:00
|
|
|
from selling.utils.cart import update_party
|
2013-07-10 15:19:44 +00:00
|
|
|
update_party(fullname, company_name, mobile_no, phone)
|
|
|
|
|
|
|
|
from core.doctype.profile import profile
|
|
|
|
return profile.update_profile(fullname, password)
|
|
|
|
|
|
|
|
def get_profile_args():
|
2013-09-09 06:47:45 +00:00
|
|
|
from selling.utils.cart import get_lead_or_customer
|
2013-07-10 15:19:44 +00:00
|
|
|
party = get_lead_or_customer()
|
|
|
|
if party.doctype == "Lead":
|
|
|
|
mobile_no = party.mobile_no
|
|
|
|
phone = party.phone
|
|
|
|
else:
|
|
|
|
mobile_no, phone = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user,
|
2013-07-15 12:58:14 +00:00
|
|
|
"customer": party.name}, ["mobile_no", "phone"])
|
2013-07-10 15:19:44 +00:00
|
|
|
|
|
|
|
return {
|
2013-07-15 12:58:14 +00:00
|
|
|
"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
|
|
|
|
"mobile_no": cstr(mobile_no),
|
|
|
|
"phone": cstr(phone)
|
2013-07-10 15:19:44 +00:00
|
|
|
}
|