diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index de287d14c87..eac5a9ddbeb 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.js +++ b/erpnext/accounts/doctype/cost_center/cost_center.js @@ -51,7 +51,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.toggle_display('sb1', doc.group_or_ledger=='Ledger') cur_frm.set_intro(intro_txt); - cur_frm.appframe.add_button(__('Chart of Cost Centers'), + cur_frm.add_custom_button(__('Chart of Cost Centers'), function() { frappe.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap') } diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index df3ef8c8384..a726d7ddde2 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -139,7 +139,7 @@ cur_frm.cscript.refresh = function(doc) { erpnext.toggle_naming_series(); cur_frm.cscript.voucher_type(doc); if(doc.docstatus==1) { - cur_frm.appframe.add_button(__('View Ledger'), function() { + cur_frm.add_custom_button(__('View Ledger'), function() { frappe.route_options = { "voucher_no": doc.name, "from_date": doc.posting_date, diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 015d223e1d0..c2632bf4418 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -4,7 +4,6 @@ frappe.provide("erpnext.accounts"); {% include 'buying/doctype/purchase_common/purchase_common.js' %}; {% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ onload: function() { @@ -27,7 +26,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ frappe.boot.doctype_icons["Journal Entry"]); if(doc.docstatus==1) { - cur_frm.appframe.add_button(__('View Ledger'), function() { + cur_frm.add_custom_button(__('View Ledger'), function() { frappe.route_options = { "voucher_no": doc.name, "from_date": doc.posting_date, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 7002664bd90..a77ccfe9353 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -6,7 +6,6 @@ cur_frm.pformat.print_heading = 'Invoice'; {% include 'selling/sales_common.js' %}; {% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} frappe.provide("erpnext.accounts"); erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.extend({ @@ -44,7 +43,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte cur_frm.dashboard.reset(); if(doc.docstatus==1) { - cur_frm.appframe.add_button('View Ledger', function() { + cur_frm.add_custom_button('View Ledger', function() { frappe.route_options = { "voucher_no": doc.name, "from_date": doc.posting_date, @@ -55,10 +54,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte frappe.set_route("query-report", "General Ledger"); }, "icon-table"); - var percent_paid = cint(flt(doc.grand_total - doc.outstanding_amount) / flt(doc.grand_total) * 100); - cur_frm.dashboard.add_progress(percent_paid + "% Paid", percent_paid); + // var percent_paid = cint(flt(doc.grand_total - doc.outstanding_amount) / flt(doc.grand_total) * 100); + // cur_frm.dashboard.add_progress(percent_paid + "% Paid", percent_paid); - cur_frm.appframe.add_button(__('Send SMS'), cur_frm.cscript.send_sms, 'icon-mobile-phone'); + cur_frm.add_custom_button(__('Send SMS'), cur_frm.cscript.send_sms, 'icon-mobile-phone'); if(cint(doc.update_stock)!=1) { // show Make Delivery Note button only if Sales Invoice is not created from Delivery Note @@ -69,12 +68,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }); if(!from_delivery_note) { - cur_frm.appframe.add_primary_action(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck") + cur_frm.page.add_menu_item(__('Make Delivery'), cur_frm.cscript['Make Delivery Note'], "icon-truck") } } if(doc.outstanding_amount!=0) { - cur_frm.appframe.add_primary_action(__('Make Payment Entry'), cur_frm.cscript.make_bank_entry, "icon-money"); + cur_frm.page.add_menu_item(__('Make Payment Entry'), cur_frm.cscript.make_bank_entry, "icon-money"); } } @@ -86,7 +85,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, sales_order_btn: function() { - this.$sales_order_btn = cur_frm.appframe.add_primary_action(__('From Sales Order'), + this.$sales_order_btn = cur_frm.page.add_menu_item(__('From Sales Order'), function() { frappe.model.map_current_doc({ method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice", @@ -103,7 +102,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, delivery_note_btn: function() { - this.$delivery_note_btn = cur_frm.appframe.add_primary_action(__('From Delivery Note'), + this.$delivery_note_btn = cur_frm.page.add_menu_item(__('From Delivery Note'), function() { frappe.model.map_current_doc({ method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice", diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index c927596d511..61e66970d40 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -13,13 +13,13 @@ pscript['onload_Accounts Browser'] = function(wrapper){ single_column: true }) - wrapper.appframe.add_module_icon("Accounts"); + frappe.add_breadcrumbs("Accounts"); var main = $(wrapper).find(".layout-main"), chart_area = $("
") .css({"margin-bottom": "15px", "min-height": "200px"}) .appendTo(main), - help_area = $('
'+ + help_area = $('
'+ '

'+__('Quick Help')+'

'+ '
    '+ '
  1. '+__('To add child nodes, explore tree and click on the node under which you want to add more nodes.')+'
  2. '+ @@ -41,16 +41,16 @@ pscript['onload_Accounts Browser'] = function(wrapper){ '

    '+__('Please setup your chart of accounts before you start Accounting Entries')+'

').appendTo(main); if (frappe.boot.user.can_create.indexOf("Company") !== -1) { - wrapper.appframe.add_button(__('New Company'), function() { newdoc('Company'); }, + wrapper.page.add_button(__('New Company'), function() { newdoc('Company'); }, 'icon-plus'); } - wrapper.appframe.set_title_right(__('Refresh'), function() { + wrapper.page.set_primary_action(__('Refresh'), function() { wrapper.$company_select.change(); }); // company-select - wrapper.$company_select = wrapper.appframe.add_select("Company", []) + wrapper.$company_select = wrapper.page.add_select("Company", []) .change(function() { var ctype = frappe.get_route()[1] || 'Account'; erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), @@ -73,9 +73,9 @@ pscript['onload_Accounts Browser'] = function(wrapper){ pscript.set_title = function(wrapper, ctype, val) { if(val) { - wrapper.appframe.set_title('Chart of '+ctype+'s' + " - " + cstr(val)); + wrapper.page.set_title('Chart of '+ctype+'s' + " - " + cstr(val)); } else { - wrapper.appframe.set_title('Chart of '+ctype+'s'); + wrapper.page.set_title('Chart of '+ctype+'s'); } } diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js index 2da93813e9d..f0fdffecd27 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.js +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js @@ -10,7 +10,7 @@ frappe.pages['financial-analytics'].onload = function(wrapper) { single_column: true }); erpnext.trial_balance = new erpnext.FinancialAnalytics(wrapper, 'Financial Analytics'); - wrapper.appframe.add_module_icon("Accounts") + frappe.add_breadcrumbs("Accounts") } diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 0df35e8bc77..6564f571c8f 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -5,7 +5,6 @@ frappe.provide("erpnext.buying"); {% include 'buying/doctype/purchase_common/purchase_common.js' %}; {% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({ refresh: function(doc, cdt, cdn) { diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index ac6cb082022..9c2bbed2f8b 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -4,7 +4,6 @@ // attach required files {% include 'buying/doctype/purchase_common/purchase_common.js' %}; {% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.extend({ refresh: function() { diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js index f1c050d1ffc..2cc5b7a69e0 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js @@ -11,7 +11,7 @@ frappe.pages['purchase-analytics'].onload = function(wrapper) { new erpnext.PurchaseAnalytics(wrapper); - wrapper.appframe.add_module_icon("Buying") + frappe.add_breadcrumbs("Buying") } @@ -21,7 +21,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ title: __("Purchase Analytics"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company", "Fiscal Year", "Purchase Invoice", "Purchase Invoice Item", "Purchase Order", "Purchase Order Item[Purchase Analytics]", diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py index ce9b25503b3..94d784172d1 100644 --- a/erpnext/config/desktop.py +++ b/erpnext/config/desktop.py @@ -4,54 +4,63 @@ def get_data(): return { "Accounts": { "color": "#3498db", - "icon": "icon-money", + "icon": "octicon octicon-repo", "type": "module" }, "Buying": { "color": "#c0392b", "icon": "icon-shopping-cart", + "icon": "octicon octicon-briefcase", "type": "module" }, "HR": { "color": "#2ecc71", "icon": "icon-group", + "icon": "octicon octicon-organization", "label": _("Human Resources"), "type": "module" }, "Manufacturing": { "color": "#7f8c8d", "icon": "icon-cogs", + "icon": "octicon octicon-gear", "type": "module" }, "POS": { "color": "#589494", "icon": "icon-th", + "icon": "octicon octicon-credit-card", "type": "page", "link": "pos" }, "Projects": { "color": "#8e44ad", "icon": "icon-puzzle-piece", + "icon": "octicon octicon-rocket", "type": "module" }, "Selling": { "color": "#1abc9c", "icon": "icon-tag", + "icon": "octicon octicon-tag", "type": "module" }, "Stock": { "color": "#f39c12", "icon": "icon-truck", + "icon": "octicon octicon-package", "type": "module" }, "Support": { "color": "#2c3e50", "icon": "icon-phone", + "icon": "octicon octicon-issue-opened", "type": "module" }, "Shopping Cart": { "color": "#B7E090", "icon": "icon-shopping-cart", + "icon": "octicon octicon-gear", "label": _("Shopping Cart"), "link": "Form/Shopping Cart Settings", "type": "module" diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py index f3c0cecf624..8fce33e7904 100644 --- a/erpnext/config/setup.py +++ b/erpnext/config/setup.py @@ -17,7 +17,7 @@ def get_data(): ] }, { - "label": _("Printing and Branding"), + "label": _("Printing"), "icon": "icon-print", "items": [ { diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index ef5ba2cda89..2c710e63afe 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -73,9 +73,7 @@ class StatusUpdater(Document): frappe.db.set_value(self.doctype, self.name, "status", self.status) def validate_qty(self): - """ - Validates qty at row level - """ + """Validates qty at row level""" self.tolerance = {} self.global_tolerance = None @@ -153,7 +151,7 @@ class StatusUpdater(Document): args['second_source_condition'] = "" if args.get('second_source_dt') and args.get('second_source_field') \ and args.get('second_join_field'): - if not args.get("second_source_extra_cond"): + if not args.get("second_source_extra_cond"): args["second_source_extra_cond"] = "" args['second_source_condition'] = """ + ifnull((select sum(%(second_source_field)s) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index 7d42484d4cc..487a402c911 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -85,9 +85,6 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){ cur_frm.toggle_enable("exp_approver", doc.approval_status=="Draft"); cur_frm.toggle_enable("approval_status", (doc.exp_approver==user && doc.docstatus==0)); - if(!doc.__islocal && user!=doc.exp_approver) - cur_frm.frm_head.appframe.set_title_right(""); - if(doc.docstatus==0 && doc.exp_approver==user && doc.approval_status=="Approved") cur_frm.savesubmit(); @@ -159,4 +156,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) { cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message); } -} \ No newline at end of file +} diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js index 9ba988e2599..8613a8f6d9f 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -35,9 +35,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } else { cur_frm.set_intro(__("This Leave Application is pending approval. Only the Leave Apporver can update status.")) cur_frm.toggle_enable("status", false); - if(!doc.__islocal) { - cur_frm.frm_head.appframe.set_title_right(""); - } } } else { if(doc.status=="Approved") { diff --git a/erpnext/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js index 36da774a462..4e2a9c93987 100644 --- a/erpnext/projects/doctype/time_log/time_log_list.js +++ b/erpnext/projects/doctype/time_log/time_log_list.js @@ -6,7 +6,7 @@ frappe.listview_settings['Time Log'] = { add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "time_log_for"], selectable: true, onload: function(me) { - me.appframe.add_primary_action(__("Make Time Log Batch"), function() { + me.page.add_menu_item(__("Make Time Log Batch"), function() { var selected = me.get_checked_items() || []; if(!selected.length) { diff --git a/erpnext/public/build.json b/erpnext/public/build.json index 49b09071fbd..588f4ec86bd 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -13,7 +13,10 @@ "public/js/queries.js", "public/js/utils/party.js", "public/js/templates/address_list.html", - "public/js/templates/contact_list.html" + "public/js/templates/contact_list.html", + "public/js/pos/pos.html", + "public/js/pos/pos_bill_item.html", + "public/js/pos/pos.js" ], "css/shopping-cart-web.css": [ "public/css/shopping_cart.css" diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css index 6d3f4750feb..91d1da23b84 100644 --- a/erpnext/public/css/erpnext.css +++ b/erpnext/public/css/erpnext.css @@ -1,7 +1,3 @@ -.small { - font-size: 11.5px; -} - .erpnext-footer { margin: 11px auto; text-align: center; @@ -20,6 +16,9 @@ } /* pos */ +.pos { +} + .pos-item { height: 200px; overflow: hidden; @@ -28,10 +27,62 @@ padding-right: 5px !important; } -.pos-bill { - margin-left: -30px; - margin-top: -10px; - padding: 20px 10px; - border-right: 1px solid #c7c7c7; - border-bottom: 1px solid #c7c7c7; +.pos-item-area { + border: 1px solid #d1d8dd; + border-top: none; +} + +.pos-item-toolbar { + padding: 10px 0px; + border-bottom: 1px solid #d1d8dd; +} + +.item-list-area { + padding: 15px; +} + +.pos-toolbar, .pos-bill-toolbar { + padding: 10px 0px; + border-bottom: 1px solid #d1d8dd; + height: 55px; +} + +.pos-item-toolbar .form-group { + margin-bottom: 0px; +} + +.pos-bill-wrapper { + border: 1px solid #d1d8dd; + border-top: none; + border-right: none; +} + +.pos-bill { + margin-left: -15px; + margin-right: -15px; +} + +.pos-bill-row { + margin: 0px; + padding: 7px 0px; + border-top: 1px solid #d1d8dd; +} + +.pos-bill-header { + border: none !important; + background-color: #f5f7fa; +} + +.pos-item-qty { + display: inline-block; +} + +.pos-qty-row > div { + padding: 5px 0px; +} + +.pos-qty-btn { + margin-top: 5px; + cursor: pointer; + font-size: 120%; } diff --git a/erpnext/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js index 87fb7a986b9..3b11345d9d3 100644 --- a/erpnext/public/js/account_tree_grid.js +++ b/erpnext/public/js/account_tree_grid.js @@ -20,7 +20,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({ title: title, page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Company", "Fiscal Year", "Account", "GL Entry", "Cost Center"], tree_grid: { show: true, @@ -69,7 +69,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({ {fieldtype: "Label", label: __("To")}, {fieldtype: "Date", label: __("To Date"), fieldname: "to_date"}, {fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white", - cssClass:"btn-info"}, + cssClass:"btn-primary"}, {fieldtype: "Button", label: __("Reset Filters"), icon: "icon-filter"}, ], setup_filters: function() { diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js index e9c790db103..deb6a2c609a 100644 --- a/erpnext/public/js/conf.js +++ b/erpnext/public/js/conf.js @@ -7,14 +7,7 @@ frappe.provide('erpnext'); $(document).bind('toolbar_setup', function() { frappe.app.name = "ERPNext"; - $('.navbar-brand').html('') - .attr("title", "Home") - .addClass("navbar-icon-home") - .css({ - "max-width": "200px", - "text-overflow": "ellipsis", - "white-space": "nowrap" - }); + $('.navbar-brand').html('ERPNext'); $('[data-link="docs"]').attr("href", "https://erpnext.com/user-guide") }); diff --git a/erpnext/public/js/controllers/stock_controller.js b/erpnext/public/js/controllers/stock_controller.js index 9595e23daa7..1a66297b42e 100644 --- a/erpnext/public/js/controllers/stock_controller.js +++ b/erpnext/public/js/controllers/stock_controller.js @@ -43,7 +43,7 @@ erpnext.stock.StockController = frappe.ui.form.Controller.extend({ show_stock_ledger: function() { var me = this; if(this.frm.doc.docstatus===1) { - this.frm.appframe.add_button(__("Stock Ledger"), function() { + cur_frm.add_custom_button(__("Stock Ledger"), function() { frappe.route_options = { voucher_no: me.frm.doc.name, from_date: me.frm.doc.posting_date, @@ -59,7 +59,7 @@ erpnext.stock.StockController = frappe.ui.form.Controller.extend({ show_general_ledger: function() { var me = this; if(this.frm.doc.docstatus===1 && cint(frappe.defaults.get_default("auto_accounting_for_stock"))) { - cur_frm.appframe.add_button(__('Accounting Ledger'), function() { + cur_frm.add_custom_button(__('Accounting Ledger'), function() { frappe.route_options = { voucher_no: me.frm.doc.name, from_date: me.frm.doc.posting_date, diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html new file mode 100644 index 00000000000..dd323bcc417 --- /dev/null +++ b/erpnext/public/js/pos/pos.html @@ -0,0 +1,55 @@ +
+
+
+
+
+
+ +
+
+
+
+
+
{%= __("Item") %}
+
{%= __("Quantity") %}
+
{%= __("Rate") %}
+
+
+
+
+
+
{%= __("Net Total") %}
+
+
+
+
{%= __("Taxes") %}
+
+
+
{%= __("Discount Amount") %}
+
+
+
+
{%= __("Grand Total") %}
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.js b/erpnext/public/js/pos/pos.js similarity index 70% rename from erpnext/accounts/doctype/sales_invoice/pos.js rename to erpnext/public/js/pos/pos.js index e8973624800..5357d8eba35 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.js +++ b/erpnext/public/js/pos/pos.js @@ -5,105 +5,7 @@ erpnext.POS = Class.extend({ init: function(wrapper, frm) { this.wrapper = wrapper; this.frm = frm; - this.wrapper.html('
\ -
\ -
\ -
\ -
\ -
\ -
\ -
\ -
\ -
\ -
\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
'+__("Item")+'QtyRate
\ -
\ -
\ -
\ -
\ - \ - \ - \ - \ - \ -
'+__("Net Total")+'
\ -
\ - \ -
\ - \ - \ - \ - \ - \ - \ -
'+__("Discount Amount")+'\ - \ -
\ -
\ -
\ - \ - \ - \ - \ - \ -
'+__("Grand Total")+'
\ -
\ - \ -
\ -
\ -

\ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -

\ -
\ -
\ -
\ -
\ -
\ -
\ -
\ -
'); + this.wrapper.html(frappe.render_template("pos", {})); this.check_transaction_type(); this.make(); @@ -276,14 +178,8 @@ erpnext.POS = Class.extend({ // if form is local then allow this function $(me.wrapper).find("div.pos-item").on("click", function() { if(me.frm.doc.docstatus==0) { - if(!me.frm.doc[me.party.toLowerCase()] && ((me.frm.doctype == "Quotation" && - me.frm.doc.quotation_to == "Customer") - || me.frm.doctype != "Quotation")) { - msgprint(__("Please select {0} first.", [me.party])); - return; - } - else - me.add_to_cart($(this).attr("data-item_code")); + console.log($(this).attr("data-item_code")); + me.add_to_cart($(this).attr("data-item_code")); } }); } @@ -293,8 +189,15 @@ erpnext.POS = Class.extend({ var me = this; var caught = false; + if(!me.frm.doc[me.party.toLowerCase()] && ((me.frm.doctype == "Quotation" && + me.frm.doc.quotation_to == "Customer") + || me.frm.doctype != "Quotation")) { + msgprint(__("Please select {0} first.", [me.party])); + return; + } + // get no_of_items - var no_of_items = me.wrapper.find("#cart tbody tr").length; + var no_of_items = me.wrapper.find(".pos-bill-item").length; // check whether the item is already added if (no_of_items != 0) { @@ -337,6 +240,7 @@ erpnext.POS = Class.extend({ } }, update_qty: function(item_code, qty) { + console.log([item_code, qty]); var me = this; $.each(this.frm.doc["items"] || [], function(i, d) { if (d.item_code == item_code) { @@ -372,7 +276,7 @@ erpnext.POS = Class.extend({ // If quotation to is not Customer then remove party if (this.frm.doctype == "Quotation" && this.frm.doc.quotation_to!="Customer") { - this.party_field.$wrapper.remove(); + this.party_field.$input.prop("disabled", true); } }, refresh_item_list: function() { @@ -385,45 +289,20 @@ erpnext.POS = Class.extend({ }, show_items_in_item_cart: function() { var me = this; - var $items = this.wrapper.find("#cart tbody").empty(); + var $items = this.wrapper.find(".items").empty(); - $.each(this.frm.doc["items"] || [], function(i, d) { - - $(repl('\ - %(item_code)s%(item_name)s\ - \ -
\ - \ -
\ - \ - \ - \ -
' - +__("Stock: ")+'%(actual_qty)s%(projected_qty)s
\ - \ - \ -
\ - \ -
\ - \ - %(amount)s
%(rate)s\ - ', - { - item_code: d.item_code, - item_name: d.item_name===d.item_code ? "" : ("
" + d.item_name), - qty: d.qty, - actual_qty: d.actual_qty, - projected_qty: d.projected_qty ? (" (" + d.projected_qty + ")") : "", - rate: format_currency(d.rate, me.frm.doc.currency), - amount: format_currency(d.amount, me.frm.doc.currency) - } - )).appendTo($items); + $.each(this.frm.doc.items|| [], function(i, d) { + $(frappe.render_template("pos_bill_item", { + item_code: d.item_code, + item_name: d.item_name===d.item_code ? "" : ("
" + d.item_name), + qty: d.qty, + actual_qty: d.actual_qty, + rate: format_currency(d.rate, me.frm.doc.currency), + amount: format_currency(d.amount, me.frm.doc.currency) + })).appendTo($items); }); - this.wrapper.find("input.qty").on("focus", function() { + this.wrapper.find("input.pos-item-qty").on("focus", function() { $(this).select(); }); }, @@ -465,15 +344,15 @@ erpnext.POS = Class.extend({ var me = this; // append quantity to the respective item after change from input box - $(this.wrapper).find("input.qty").on("change", function() { + $(this.wrapper).find("input.pos-item-qty").on("change", function() { var item_code = $(this).closest("tr").attr("id"); me.update_qty(item_code, $(this).val()); }); // increase/decrease qty on plus/minus button - $(this.wrapper).find(".increase-qty, .decrease-qty").on("click", function() { - var tr = $(this).closest("tr"); - me.increase_decrease_qty(tr, $(this).attr("class")); + $(this.wrapper).find(".pos-qty-btn").on("click", function() { + var $item = $(this).parents(".pos-bill-item:first"); + me.increase_decrease_qty($item, $(this).attr("data-action")); }); // on td click toggle the highlighting of row @@ -491,15 +370,23 @@ erpnext.POS = Class.extend({ }); me.refresh_delete_btn(); +<<<<<<< HEAD:erpnext/accounts/doctype/sales_invoice/pos.js if(me.frm.doc[this.party.toLowerCase()]) { +======= + //me.focus(); + }, + focus: function() { + if(me.frm.doc[this.party]) { +>>>>>>> v5-design:erpnext/public/js/pos/pos.js this.barcode.$input.focus(); } else { - this.party_field.$input.focus(); + if(!(this.frm.doctype == "Quotation" && this.frm.doc.quotation_to!="Customer")) + this.party_field.$input.focus(); } }, - increase_decrease_qty: function(tr, operation) { - var item_code = tr.attr("id"); - var item_qty = cint(tr.find("input.qty").val()); + increase_decrease_qty: function($item, operation) { + var item_code = $item.attr("data-item-code"); + var item_qty = cint($item.find("input.pos-item-qty").val()); if (operation == "increase-qty") this.update_qty(item_code, item_qty + 1); @@ -510,7 +397,7 @@ erpnext.POS = Class.extend({ var me = this; // if form is submitted & cancelled then disable all input box & buttons $(this.wrapper) - .find(".remove-items, .make-payment, .increase-qty, .decrease-qty") + .find(".remove-items, .make-payment, .pos-qty-btn") .toggle(this.frm.doc.docstatus===0); $(this.wrapper).find('input, button').prop("disabled", !(this.frm.doc.docstatus===0)); diff --git a/erpnext/public/js/pos/pos_bill_item.html b/erpnext/public/js/pos/pos_bill_item.html new file mode 100644 index 00000000000..e45536f9c4f --- /dev/null +++ b/erpnext/public/js/pos/pos_bill_item.html @@ -0,0 +1,16 @@ +
+
{%= item_code %}{%= item_name %}
+
+
+
+
+ +
{%= actual_qty %}
+
+
+
+
+
+
{%= amount %}
{%= rate %}
+
+
diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js index 57b69cbb540..716e8ac0887 100644 --- a/erpnext/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -9,7 +9,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ title: __("Stock Analytics"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Fiscal Year", "Serial No"], tree_grid: { diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 69f5c037f13..f8c0e7c7379 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -82,9 +82,9 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ this.$pos_btn && this.$pos_btn.remove(); - this.$pos_btn = this.frm.appframe.add_primary_action(btn_label, function() { + this.$pos_btn = this.frm.page.add_menu_item(btn_label, function() { me.toggle_pos(); - }, icon, "btn-default"); + }); } else { // hack: will avoid calling refresh from refresh setTimeout(function() { me.toggle_pos(false); }, 100); @@ -105,12 +105,12 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ // make pos if(!this.frm.pos) { - this.frm.layout.add_view("pos"); - this.frm.pos = new erpnext.POS(this.frm.layout.views.pos, this.frm); + var wrapper = this.frm.page.add_view("pos", "
"); + this.frm.pos = new erpnext.POS(wrapper, this.frm); } // toggle view - this.frm.layout.set_view(this.pos_active ? "" : "pos"); + this.frm.page.set_view(this.pos_active ? "main" : "pos"); this.pos_active = !this.pos_active; // refresh diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index a4348fe58e3..8b96185a92d 100644 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -120,7 +120,7 @@ $.extend(erpnext.utils, { render_address_and_contact: function(frm) { // render address $(frm.fields_dict['address_html'].wrapper) - .html(frappe.render(frappe.templates.address_list, + .html(frappe.render_template("address_list", cur_frm.doc.__onload)) .find(".btn-address").on("click", function() { new_doc("Address"); @@ -129,7 +129,7 @@ $.extend(erpnext.utils, { // render contact if(frm.fields_dict['contact_html']) { $(frm.fields_dict['contact_html'].wrapper) - .html(frappe.render(frappe.templates.contact_list, + .html(frappe.render_template("contact_list", cur_frm.doc.__onload)) .find(".btn-contact").on("click", function() { new_doc("Contact"); diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js index 0dae099e831..170e7186543 100644 --- a/erpnext/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -31,7 +31,7 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({ frappe.boot.doctype_icons["Customer"], "btn-default"); this.frm.add_custom_button(__("Create Opportunity"), this.create_opportunity, frappe.boot.doctype_icons["Opportunity"], "btn-default"); - this.frm.appframe.add_button(__("Send SMS"), this.frm.cscript.send_sms, "icon-mobile-phone"); + cur_frm.add_custom_button(__("Send SMS"), this.frm.cscript.send_sms, "icon-mobile-phone"); } if(!this.frm.doc.__islocal) { diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index b14e0f72a7a..776671ae2a6 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -4,7 +4,6 @@ {% include 'selling/sales_common.js' %} {% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ onload: function(doc, dt, dn) { @@ -26,7 +25,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ cur_frm.add_custom_button(__('Set as Lost'), cur_frm.cscript['Declare Order Lost'], "icon-exclamation", "btn-default"); } - cur_frm.appframe.add_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone"); + cur_frm.add_custom_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone"); } if (this.frm.doc.docstatus===0) { diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 02f2eb61e1c..3c3d264c9a6 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -3,7 +3,6 @@ {% include 'selling/sales_common.js' %} {% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({ refresh: function(doc, dt, dn) { diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.js b/erpnext/selling/page/sales_analytics/sales_analytics.js index 34808662cea..8e5ca966341 100644 --- a/erpnext/selling/page/sales_analytics/sales_analytics.js +++ b/erpnext/selling/page/sales_analytics/sales_analytics.js @@ -10,7 +10,7 @@ frappe.pages['sales-analytics'].onload = function(wrapper) { new erpnext.SalesAnalytics(wrapper); - wrapper.appframe.add_module_icon("Selling") + frappe.add_breadcrumbs("Selling") } @@ -20,7 +20,7 @@ erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({ title: __("Sales Analytics"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Item Group", "Customer", "Customer Group", "Company", "Territory", "Fiscal Year", "Sales Invoice", "Sales Invoice Item", "Sales Order", "Sales Order Item[Sales Analytics]", diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js index d2540288659..3f8f6cba288 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.js +++ b/erpnext/selling/page/sales_browser/sales_browser.js @@ -6,9 +6,9 @@ pscript['onload_Sales Browser'] = function(wrapper){ parent: wrapper, }) - wrapper.appframe.add_module_icon("Selling") + frappe.add_breadcrumbs("Selling") - wrapper.appframe.set_title_right(__('Refresh'), function() { + wrapper.page.set_primary_action(__('Refresh'), function() { wrapper.make_tree(); }); @@ -44,7 +44,7 @@ pscript['onshow_Sales Browser'] = function(wrapper){ // set route var ctype = frappe.get_route()[1] || 'Territory'; - wrapper.appframe.set_title(__('{0} Tree',[__(ctype)])); + wrapper.page.set_title(__('{0} Tree',[__(ctype)])); if(erpnext.sales_chart && erpnext.sales_chart.ctype != ctype) { wrapper.make_tree(); diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js index 76707629cf1..47b6a14e458 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.js +++ b/erpnext/selling/page/sales_funnel/sales_funnel.js @@ -1,73 +1,71 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -frappe.pages['sales-funnel'].onload = function(wrapper) { +frappe.pages['sales-funnel'].onload = function(wrapper) { frappe.ui.make_app_page({ parent: wrapper, title: __('Sales Funnel'), single_column: true }); - + wrapper.sales_funnel = new erpnext.SalesFunnel(wrapper); - - wrapper.appframe.add_module_icon("Selling", "sales-funnel", function() { - frappe.set_route("selling-home"); - }); + + frappe.add_breadcrumbs("Selling"); } erpnext.SalesFunnel = Class.extend({ init: function(wrapper) { var me = this; // 0 setTimeout hack - this gives time for canvas to get width and height - setTimeout(function() { + setTimeout(function() { me.setup(wrapper); me.get_data(); }, 0); }, - + setup: function(wrapper) { var me = this; - - this.elements = { + + this.elements = { layout: $(wrapper).find(".layout-main"), - from_date: wrapper.appframe.add_date(__("From Date")), - to_date: wrapper.appframe.add_date(__("To Date")), - refresh_btn: wrapper.appframe.set_title_right(__("Refresh"), + from_date: wrapper.page.add_date(__("From Date")), + to_date: wrapper.page.add_date(__("To Date")), + refresh_btn: wrapper.page.set_primary_action(__("Refresh"), function() { me.get_data(); }, "icon-refresh"), }; - + this.elements.no_data = $('
' + __("No Data") + '
') .toggle(false) .appendTo(this.elements.layout); - + this.elements.funnel_wrapper = $('
') .appendTo(this.elements.layout); - + this.options = { from_date: frappe.datetime.add_months(frappe.datetime.get_today(), -1), to_date: frappe.datetime.get_today() }; - + // set defaults and bind on change - $.each(this.options, function(k, v) { - me.elements[k].val(frappe.datetime.str_to_user(v)); + $.each(this.options, function(k, v) { + me.elements[k].val(frappe.datetime.str_to_user(v)); me.elements[k].on("change", function() { me.options[k] = frappe.datetime.user_to_str($(this).val()); me.get_data(); }); }); - + // bind refresh this.elements.refresh_btn.on("click", function() { me.get_data(this); }); - + // bind resize $(window).resize(function() { me.render(); }); }, - + get_data: function(btn) { var me = this; frappe.call({ @@ -85,72 +83,72 @@ erpnext.SalesFunnel = Class.extend({ } }); }, - + render: function() { var me = this; this.prepare(); - + var context = this.elements.context, x_start = 0.0, x_end = this.options.width, x_mid = (x_end - x_start) / 2.0, y = 0, y_old = 0.0; - + if(this.options.total_value === 0) { this.elements.no_data.toggle(true); return; } - + this.options.data.forEach(function(d) { context.fillStyle = d.color; context.strokeStyle = d.color; me.draw_triangle(x_start, x_mid, x_end, y, me.options.height); - + y_old = y; // new y y = y + d.height; - + // new x var half_side = (me.options.height - y) / Math.sqrt(3); x_start = x_mid - half_side; x_end = x_mid + half_side; - + var y_mid = y_old + (y - y_old) / 2.0; - + me.draw_legend(x_mid, y_mid, me.options.width, me.options.height, d.value + " - " + d.title); }); }, - + prepare: function() { var me = this; - + this.elements.no_data.toggle(false); - + // calculate width and height options this.options.width = $(this.elements.funnel_wrapper).width() * 2.0 / 3.0; this.options.height = (Math.sqrt(3) * this.options.width) / 2.0; - + // calculate total weightage // as height decreases, area decreases by the square of the reduction // hence, compensating by squaring the index value this.options.total_weightage = this.options.data.reduce( function(prev, curr, i) { return prev + Math.pow(i+1, 2) * curr.value; }, 0.0); - + // calculate height for each data $.each(this.options.data, function(i, d) { d.height = me.options.height * d.value * Math.pow(i+1, 2) / me.options.total_weightage; }); - + this.elements.canvas = $('') .appendTo(this.elements.funnel_wrapper.empty()) .attr("width", $(this.elements.funnel_wrapper).width()) .attr("height", this.options.height); - + this.elements.context = this.elements.canvas.get(0).getContext("2d"); }, - + draw_triangle: function(x_start, x_mid, x_end, y, height) { var context = this.elements.context; context.beginPath(); @@ -161,27 +159,27 @@ erpnext.SalesFunnel = Class.extend({ context.closePath(); context.fill(); }, - + draw_legend: function(x_mid, y_mid, width, height, title) { var context = this.elements.context; - + // draw line context.beginPath(); context.moveTo(x_mid, y_mid); context.lineTo(width, y_mid); context.closePath(); context.stroke(); - + // draw circle context.beginPath(); context.arc(width, y_mid, 5, 0, Math.PI * 2, false); context.closePath(); context.fill(); - + // draw text context.fillStyle = "black"; context.textBaseline = "middle"; context.font = "1.1em sans-serif"; context.fillText(title, width + 20, y_mid); } -}); \ No newline at end of file +}); diff --git a/erpnext/setup/doctype/item_group/item_group.js b/erpnext/setup/doctype/item_group/item_group.js index f7ffe5ee492..3bb6c1767f6 100644 --- a/erpnext/setup/doctype/item_group/item_group.js +++ b/erpnext/setup/doctype/item_group/item_group.js @@ -5,7 +5,7 @@ cur_frm.list_route = "Sales Browser/Item Group"; cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.set_root_readonly(doc); - cur_frm.appframe.add_button(__("Item Group Tree"), function() { + cur_frm.add_custom_button(__("Item Group Tree"), function() { frappe.set_route("Sales Browser", "Item Group"); }, "icon-sitemap") } diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index 56be00661e9..6d1b7e9f2bf 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -19,7 +19,6 @@ class NamingSeries(Document): prefixes = "" for d in doctypes: - print d try: options = self.get_options(d) except frappe.DoesNotExistError: diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 078aa7c1cd0..1668bd0aa04 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -3,7 +3,6 @@ {% include 'selling/sales_common.js' %}; {% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} frappe.provide("erpnext.stock"); frappe.provide("erpnext.stock.delivery_note"); @@ -26,7 +25,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( cur_frm.add_custom_button(__('Make Installation Note'), this.make_installation_note); if (doc.docstatus==1) { - cur_frm.appframe.add_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone"); + cur_frm.add_custom_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone"); this.show_stock_ledger(); this.show_general_ledger(); } diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 31033e0a357..c89dab1cb65 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -3,7 +3,6 @@ {% include 'buying/doctype/purchase_common/purchase_common.js' %}; {% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} -{% include 'accounts/doctype/sales_invoice/pos.js' %} frappe.provide("erpnext.stock"); erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend({ diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.js b/erpnext/stock/page/stock_analytics/stock_analytics.js index 963cff0b758..8fd2d324f63 100644 --- a/erpnext/stock/page/stock_analytics/stock_analytics.js +++ b/erpnext/stock/page/stock_analytics/stock_analytics.js @@ -12,7 +12,7 @@ frappe.pages['stock-analytics'].onload = function(wrapper) { new erpnext.StockAnalytics(wrapper); - wrapper.appframe.add_module_icon("Stock") + frappe.add_breadcrumbs("Stock") } diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js index b4086dc66e8..af0eba26a9b 100644 --- a/erpnext/stock/page/stock_ledger/stock_ledger.js +++ b/erpnext/stock/page/stock_ledger/stock_ledger.js @@ -9,7 +9,7 @@ frappe.pages['stock-ledger'].onload = function(wrapper) { }); new erpnext.StockLedger(wrapper); - wrapper.appframe.add_module_icon("Stock") + frappe.add_breadcrumbs("Stock") } frappe.require("assets/erpnext/js/stock_grid_report.js"); @@ -20,7 +20,7 @@ erpnext.StockLedger = erpnext.StockGridReport.extend({ title: __("Stock Ledger"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Serial No"], }) }, diff --git a/erpnext/stock/page/stock_level/stock_level.js b/erpnext/stock/page/stock_level/stock_level.js index 8659c287293..e54c518822b 100644 --- a/erpnext/stock/page/stock_level/stock_level.js +++ b/erpnext/stock/page/stock_level/stock_level.js @@ -11,7 +11,7 @@ frappe.pages['stock-level'].onload = function(wrapper) { new erpnext.StockLevel(wrapper); - wrapper.appframe.add_module_icon("Stock") + frappe.add_breadcrumbs("Stock") ; } @@ -25,7 +25,7 @@ erpnext.StockLevel = erpnext.StockGridReport.extend({ title: __("Stock Level"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Item", "Warehouse", "Stock Ledger Entry", "Production Order", "Material Request Item", "Purchase Order Item", "Sales Order Item", "Brand", "Serial No"], }); diff --git a/erpnext/support/page/support_analytics/support_analytics.js b/erpnext/support/page/support_analytics/support_analytics.js index 9e24f679e12..54e6d68722f 100644 --- a/erpnext/support/page/support_analytics/support_analytics.js +++ b/erpnext/support/page/support_analytics/support_analytics.js @@ -11,7 +11,7 @@ frappe.pages['support-analytics'].onload = function(wrapper) { new erpnext.SupportAnalytics(wrapper); - wrapper.appframe.add_module_icon("Support") + frappe.add_breadcrumbs("Support") } @@ -21,7 +21,7 @@ erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({ title: __("Support Analtyics"), page: wrapper, parent: $(wrapper).find('.layout-main'), - appframe: wrapper.appframe, + page: wrapper.page, doctypes: ["Issue", "Fiscal Year"], }); }, diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html index 21903c03d0a..2803550484b 100644 --- a/erpnext/templates/form_grid/item_grid.html +++ b/erpnext/templates/form_grid/item_grid.html @@ -2,7 +2,7 @@ {% if(!doc) { %}
-
{%= __("Item") %}
+
{%= __("Items") %}
{%= __("Qty") %}
{%= __("Rate") %}
{%= __("Amount") %}
@@ -14,13 +14,36 @@
{%= doc.item_name %}{% } %} {% if(doc.item_name != doc.description) { %}

{%= doc.description %}

{% } %} - {% if(doc.sales_order || doc.against_sales_order) { %} -

- - {%= doc.sales_order || doc.against_sales_order %} -

- {% } %} +
+ {% if(doc.sales_order || doc.against_sales_order) { %} + + + {%= doc.sales_order || doc.against_sales_order %} + + {% } %} + {% if(doc.warehouse) { + var label_class = "label-default", + title = "Warehouse", + actual_qty = (doc.doctype==="Sales Order" + ? doc.projected_qty : doc.actual_qty); + if(actual_qty != undefined) { + if(actual_qty > doc.qty) { + var label_class = "label-success"; + var title = "In Stock" + } else { + var title = "Not In Stock" + } + } + %} + + + {%= doc.warehouse %} + + + {% } %} +
{% include "templates/form_grid/includes/visible_cols.html" %} {% if(doc.schedule_date) { %}
doc.qty) { - var label_class = "label-success"; - var title = "In Stock" - } else { - var title = "Not In Stock" - } - } - %} -
- - {%= doc.warehouse %} - -
- {% } %}
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js index fff0a329b47..c0b2f4613a5 100644 --- a/erpnext/templates/includes/cart.js +++ b/erpnext/templates/includes/cart.js @@ -8,7 +8,7 @@ frappe.provide("shopping_cart"); $.extend(shopping_cart, { show_error: function(title, text) { - $("#cart-container").html('

' + title + '

' + text + '
'); + $("#cart-container").html('

' + title + '

' + text + '
'); }, bind_events: function() { @@ -96,7 +96,7 @@ $.extend(shopping_cart, { }); if(!(addresses && addresses.length)) { - $cart_shipping_address.html('
'+frappe._("Hey! Go ahead and add an address")+'
'); + $cart_shipping_address.html('
'+frappe._("Hey! Go ahead and add an address")+'
'); } else { shopping_cart.render_address($cart_shipping_address, addresses, doc.shipping_address_name); shopping_cart.render_address($cart_billing_address, addresses, doc.customer_address); diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.js b/erpnext/utilities/doctype/rename_tool/rename_tool.js index 32b6cd4990c..5a33b2bf5b4 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.js +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.js @@ -44,7 +44,7 @@ cur_frm.cscript.setup_upload = function() { .click(function() { $log.html("Working..."); }) - .addClass("btn-info") + .addClass("btn-primary") .attr('value', 'Upload and Rename') }