From 0154538c0656c10c6e6790e04f590eb216d49607 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 29 Nov 2017 16:42:02 +0530 Subject: [PATCH] [fix] [minor] pos.js --- erpnext/public/css/pos.css | 3 +- erpnext/public/less/pos.less | 3 +- .../page/point_of_sale/point_of_sale.js | 29 ++++++++++--------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/erpnext/public/css/pos.css b/erpnext/public/css/pos.css index f66abc8081..bc81182f32 100644 --- a/erpnext/public/css/pos.css +++ b/erpnext/public/css/pos.css @@ -34,7 +34,7 @@ margin-left: 15px; } .cart-wrapper { - margin-bottom: 10px; + margin-bottom: 12px; } .cart-wrapper .list-item__content:not(:first-child) { justify-content: flex-end; @@ -121,7 +121,6 @@ input[type=number]::-webkit-outer-spin-button { border-collapse: collapse; cursor: pointer; display: table; - margin: auto; } .num-row { display: table-row; diff --git a/erpnext/public/less/pos.less b/erpnext/public/less/pos.less index 9653a82658..0fcb654fff 100644 --- a/erpnext/public/less/pos.less +++ b/erpnext/public/less/pos.less @@ -50,7 +50,7 @@ } .cart-wrapper { - margin-bottom: 10px; + margin-bottom: 12px; .list-item__content:not(:first-child) { justify-content: flex-end; } @@ -155,7 +155,6 @@ input[type=number]::-webkit-outer-spin-button { border-collapse: collapse; cursor: pointer; display: table; - margin: auto; } .num-row { display: table-row; diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 4c8ba08461..6ac0a5fe8a 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -321,19 +321,17 @@ erpnext.pos.PointOfSale = class PointOfSale { make_new_invoice() { return frappe.run_serially([ + () => this.make_sales_invoice_frm(), + () => this.set_pos_profile_data(), () => { - this.make_sales_invoice_frm() - .then(() => this.set_pos_profile_data()) - .then(() => { - if (this.cart) { - this.cart.frm = this.frm; - this.cart.reset(); - } else { - this.make_items(); - this.make_cart(); - } - this.toggle_editing(true); - }) + if (this.cart) { + this.cart.frm = this.frm; + this.cart.reset(); + } else { + this.make_items(); + this.make_cart(); + } + this.toggle_editing(true); }, ]); } @@ -376,7 +374,10 @@ erpnext.pos.PointOfSale = class PointOfSale { this.frm.script_manager.trigger("update_stock"); frappe.model.set_default_values(this.frm.doc); this.frm.cscript.calculate_taxes_and_totals(); - this.frm.meta.default_print_format = r.message ? r.message.print_format : 'POS Invoice'; + + if (r.message) { + this.frm.meta.default_print_format = r.message.print_format || 'POS Invoice'; + } } resolve(); @@ -915,7 +916,7 @@ class POSItems { this.search_field = frappe.ui.form.make_control({ df: { fieldtype: 'Data', - label: 'Search Item ( Ctrl + i )', + label: 'Search Item (Ctrl + i)', placeholder: 'Search by item code, serial number, batch no or barcode' }, parent: this.wrapper.find('.search-field'),