mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 23:19:20 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -310,7 +310,8 @@ cur_frm.cscript.barcode = function(doc, cdt, cdn) {
|
||||
var callback = function(r, rt) {
|
||||
cur_frm.cscript.item_code(doc, cdt, cdn);
|
||||
}
|
||||
get_server_fields('get_barcode_details', d.barcode, cur_frm.cscript.fname, doc, cdt, cdn, 1, callback);
|
||||
get_server_fields('get_barcode_details', d.barcode, cur_frm.cscript.fname,
|
||||
doc, cdt, cdn, 1, callback);
|
||||
}
|
||||
|
||||
cur_frm.fields_dict[cur_frm.cscript.fname].grid.get_field('batch_no').get_query =
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
import webnotes.utils
|
||||
import json
|
||||
|
||||
from webnotes.utils import cstr, flt, getdate
|
||||
from webnotes.model.bean import getlist
|
||||
@@ -352,4 +354,52 @@ class DocType(SellingController):
|
||||
return get_obj('Sales Common').get_item_list( self, is_stopped)
|
||||
|
||||
def on_update(self):
|
||||
pass
|
||||
pass
|
||||
|
||||
@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
|
||||
and docstatus=1
|
||||
order by creation desc
|
||||
limit 20
|
||||
""", customer, as_dict=1)
|
||||
for order in orders:
|
||||
order.items = webnotes.conn.sql("""select
|
||||
item_name, qty, export_rate, export_amount, delivered_qty, stock_uom
|
||||
from `tabSales Order Item`
|
||||
where parent=%s
|
||||
order by idx""", order.name, as_dict=1)
|
||||
return orders
|
||||
else:
|
||||
return []
|
||||
|
||||
def get_website_args():
|
||||
customer = webnotes.conn.get_value("Contact", {"email_id": webnotes.session.user},
|
||||
"customer")
|
||||
bean = webnotes.bean("Sales Order", webnotes.form_dict.name)
|
||||
if bean.doc.customer != customer:
|
||||
return {
|
||||
"doc": {"name": "Not Allowed"}
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"doc": bean.doc,
|
||||
"doclist": bean.doclist,
|
||||
"webnotes": webnotes,
|
||||
"utils": webnotes.utils
|
||||
}
|
||||
|
||||
def get_currency_and_number_format():
|
||||
return {
|
||||
"global_number_format": webnotes.conn.get_default("number_format") or "#,###.##",
|
||||
"currency": webnotes.conn.get_default("currency"),
|
||||
"currency_symbols": json.dumps(dict(webnotes.conn.sql("""select name, symbol
|
||||
from tabCurrency where ifnull(enabled,0)=1""")))
|
||||
}
|
||||
Reference in New Issue
Block a user