mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
added my account
This commit is contained in:
23
website/helpers/account.py
Normal file
23
website/helpers/account.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright (c) 2012 Web Notes Technologies Pvt Ltd.
|
||||
# License: GNU General Public License (v3). For more information see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import webnotes
|
||||
from webnotes.utils import cstr
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_orders():
|
||||
# find customer id
|
||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||
"customer")
|
||||
|
||||
if customer:
|
||||
orders = webnotes.conn.sql("""select name, creation, currency from `tabSales Order`
|
||||
where customer=%s""", customer, as_dict=1)
|
||||
for order in orders:
|
||||
order.items = webnotes.conn.sql("""select item_name, qty, export_rate, delivered_qty
|
||||
from `tabSales Order Item` where parent=%s order by idx""", order.name, as_dict=1)
|
||||
return orders
|
||||
else:
|
||||
return []
|
||||
Reference in New Issue
Block a user