diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index f6e808dee3a..986568da29f 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe @frappe.whitelist() -def get_items(price_list, sales_or_purchase, item=None, item_group=None): +def get_items(price_list, sales_or_purchase, item=None): condition = "" args = {"price_list": price_list} @@ -14,10 +14,21 @@ def get_items(price_list, sales_or_purchase, item=None, item_group=None): else: condition = "i.is_purchase_item='Yes'" - if item_group and item_group != "All Item Groups": - condition += " and i.item_group='%s'" % item_group.replace("'", "\'") - if item: + # search serial no + item_code = frappe.db.sql("""select name as serial_no, item_code + from `tabSerial No` where name=%s""", (item), as_dict=1) + if item_code: + item_code[0]["name"] = item_code[0]["item_code"] + return item_code + + # search barcode + item_code = frappe.db.sql("""select name from `tabItem` where barcode=%s""", + (item), as_dict=1) + if item_code: + item_code[0]["barcode"] = item + return item_code + condition += " and CONCAT(i.name, i.item_name) like %(name)s" args["name"] = "%%%s%%" % item @@ -31,21 +42,21 @@ def get_items(price_list, sales_or_purchase, item=None, item_group=None): where %s""" % ('%(price_list)s', condition), args, as_dict=1) -@frappe.whitelist() -def get_item_code(barcode_serial_no): - input_via = "serial_no" - item_code = frappe.db.sql("""select name, item_code from `tabSerial No` where - name=%s""", (barcode_serial_no), as_dict=1) - - if not item_code: - input_via = "barcode" - item_code = frappe.db.sql("""select name from `tabItem` where barcode=%s""", - (barcode_serial_no), as_dict=1) - - if item_code: - return item_code, input_via - else: - frappe.throw(frappe._("Invalid Barcode or Serial No")) +# @frappe.whitelist() +# def get_item_code(barcode_serial_no): +# input_via = "serial_no" +# item_code = frappe.db.sql("""select name, item_code from `tabSerial No` where +# name=%s""", (barcode_serial_no), as_dict=1) +# +# if not item_code: +# input_via = "barcode" +# item_code = frappe.db.sql("""select name from `tabItem` where barcode=%s""", +# (barcode_serial_no), as_dict=1) +# +# if item_code: +# return item_code, input_via +# else: +# frappe.throw(frappe._("Invalid Barcode or Serial No")) @frappe.whitelist() def get_mode_of_payment(): diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index a77ccfe9353..a040438c265 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -292,13 +292,13 @@ cur_frm.fields_dict.debit_to.get_query = function(doc) { } cur_frm.fields_dict.cash_bank_account.get_query = function(doc) { - return{ - filters: { - 'account_type': 'Receivable', - 'root_type': 'Asset', - 'group_or_ledger': 'Ledger', - 'company': doc.company - } + return { + filters: [ + ["Account", "account_type", "in", ["Cash", "Bank"]], + ["Account", "root_type", "=", "Asset"], + ["Account", "group_or_ledger", "=", "Ledger"], + ["Account", "company", "=", doc.company] + ] } } diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 8cf58c8b6de..8dc65a6da1c 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -12,7 +12,7 @@ from frappe.model.document import Document class Project(Document): def get_feed(self): - return self.status + return '{0}: {1}'.format(_(self.status), self.project_name) def get_gross_profit(self): pft, per_pft =0, 0 diff --git a/erpnext/public/build.json b/erpnext/public/build.json index 588f4ec86bd..60de89c8e52 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -16,6 +16,8 @@ "public/js/templates/contact_list.html", "public/js/pos/pos.html", "public/js/pos/pos_bill_item.html", + "public/js/pos/pos_item.html", + "public/js/pos/pos_tax_row.html", "public/js/pos/pos.js" ], "css/shopping-cart-web.css": [ diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css index 91d1da23b84..fc42be1cee0 100644 --- a/erpnext/public/css/erpnext.css +++ b/erpnext/public/css/erpnext.css @@ -20,11 +20,32 @@ } .pos-item { - height: 200px; + display: inline-block; overflow: hidden; + text-overflow: ellipsis; cursor: pointer; - padding-left: 5px !important; - padding-right: 5px !important; + padding: 10px; + height: 0px; + padding-bottom: 35%; + width: 30%; + margin: 1.6%; + border: 1px solid #d1d8dd; +} + +.pos-item .item-code { + margin-bottom: 0px; +} + +.pos-item .no-image { + background-color: #fafbfc; + border: 1px dashed #d1d8dd; +} + +.pos-item-image { + padding-bottom: 100%; + background-size: cover; + background-position: center; + border: 1px solid transparent; } .pos-item-area { @@ -38,7 +59,7 @@ } .item-list-area { - padding: 15px; + padding: 15px 0px; } .pos-toolbar, .pos-bill-toolbar { @@ -54,7 +75,7 @@ .pos-bill-wrapper { border: 1px solid #d1d8dd; border-top: none; - border-right: none; + margin-right: -1px; } .pos-bill { @@ -82,7 +103,15 @@ } .pos-qty-btn { - margin-top: 5px; + margin-top: 3px; cursor: pointer; font-size: 120%; } + +.pos .search-area .form-group { + max-width: 100% !important; +} + +.pos .tax-table { + margin-bottom: 10px; +} diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html index dd323bcc417..d26e0b606cc 100644 --- a/erpnext/public/js/pos/pos.html +++ b/erpnext/public/js/pos/pos.html @@ -2,9 +2,9 @@