From ee472b0926a3087d7f767e411bb22373284b4cfe Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 18 Dec 2012 11:47:13 +0530 Subject: [PATCH] upgraded to bootstrap 2.2 --- accounts/page/trial_balance/trial_balance.js | 2 +- .../voucher_import_tool.js | 4 +- public/js/kb_common.js | 2 +- utilities/page/messages/messages.js | 4 +- website/helpers/product.py | 19 ++++ website/templates/css/product_page.css | 5 +- website/templates/html/product_page.html | 46 +++++---- website/templates/html/product_search.html | 9 ++ website/templates/js/product_page.js | 97 +++++-------------- 9 files changed, 91 insertions(+), 97 deletions(-) create mode 100644 website/templates/html/product_search.html diff --git a/accounts/page/trial_balance/trial_balance.js b/accounts/page/trial_balance/trial_balance.js index 87f94ca95a4..3d05d49a899 100644 --- a/accounts/page/trial_balance/trial_balance.js +++ b/accounts/page/trial_balance/trial_balance.js @@ -27,7 +27,7 @@ wn.pages['trial-balance'].onload = function(wrapper) { var msgbox = msgprint('

Select To Download:

\

Account Groups

\

Account Ledgers

\ -

'); +

'); var me = this; diff --git a/accounts/page/voucher_import_tool/voucher_import_tool.js b/accounts/page/voucher_import_tool/voucher_import_tool.js index d937436b262..bf6b065b0f4 100644 --- a/accounts/page/voucher_import_tool/voucher_import_tool.js +++ b/accounts/page/voucher_import_tool/voucher_import_tool.js @@ -9,11 +9,11 @@ wn.pages['voucher-import-tool'].onload = function(wrapper) {

Import multiple accounting entries via CSV (spreadsheet) file:

\

1. Download Template


\
\ - \ + \

Import multiple vouchers with one debit and one credit entry

\
\
\ - \ + \

Import multiple vouchers with multiple accounts

\
\
\ diff --git a/public/js/kb_common.js b/public/js/kb_common.js index ae80acf4f8a..032d2db1433 100644 --- a/public/js/kb_common.js +++ b/public/js/kb_common.js @@ -95,7 +95,7 @@ EditableText = function(args) { \

Formatted as markdown
\ - \ + \ Cancel\ ', args)).appendTo(me.parent); diff --git a/utilities/page/messages/messages.js b/utilities/page/messages/messages.js index 6ade603e2b9..1da5bf4a062 100644 --- a/utilities/page/messages/messages.js +++ b/utilities/page/messages/messages.js @@ -28,7 +28,7 @@ wn.pages.messages.onload = function(wrapper) {
\
\ \ -

\ +

\
\
').appendTo($(wrapper).find('.layout-main-section')); @@ -182,7 +182,7 @@ erpnext.Messages = Class.extend({ var $body = $(me.wrapper).find('.layout-side-section'); $('

Users


\
\ - \ + \ Show messages from everyone
\ ').appendTo($body); r.message.sort(function(a, b) { return b.has_session - a.has_session; }); diff --git a/website/helpers/product.py b/website/helpers/product.py index 6bafc2b436b..fec462607b2 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -4,6 +4,25 @@ from __future__ import unicode_literals import webnotes +@webnotes.whitelist(allow_guest=True) +def get_product_info(item_code): + """get product price / stock info""" + price_list = webnotes.conn.get_value("Item", item_code, "website_price_list") + warehouse = webnotes.conn.get_value("Item", item_code, "website_warehouse") + if warehouse: + in_stock = webnotes.conn.sql("""select actual_qty from tabBin where + item_code=%s and warehouse=%s""", (item_code, warehouse)) + if in_stock: + in_stock = in_stock[0][0] > 0 and 1 or 0 + else: + in_stock = -1 + return { + "price": price_list and webnotes.conn.sql("""select ref_rate, ref_currency from + `tabItem Price` where parent=%s and price_list_name=%s""", + (item_code, price_list), as_dict=1) or [], + "stock": in_stock + } + @webnotes.whitelist(allow_guest=True) def get_product_list(args=None): """ diff --git a/website/templates/css/product_page.css b/website/templates/css/product_page.css index bf893caf984..2b7c9790ff7 100644 --- a/website/templates/css/product_page.css +++ b/website/templates/css/product_page.css @@ -1,6 +1,9 @@