From 2c388f9d7e0cf807cd49a7ed4b55cc51d3ca87e1 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 5 Nov 2014 15:23:12 +0530 Subject: [PATCH 1/2] POS feature #2305 --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 6 +++++- erpnext/public/js/transaction.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 743f7eea69..f679a906ec 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -387,10 +387,14 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) { } cur_frm.cscript.on_submit = function(doc, cdt, cdn) { + if(cur_frm.doc.is_pos ) { + new_doc("Sales Invoice"); + } + if(cint(frappe.boot.notification_settings.sales_invoice)) { cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message); } - + $.each(doc["entries"], function(i, row) { if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note) }) diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 41b384267f..7943552238 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -66,7 +66,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ make_pos_btn: function() { var me = this; - if(this.frm.doc.docstatus===0) { + if(this.frm.doc.docstatus <= 1) { if(!this.pos_active) { var btn_label = __("POS View"), icon = "icon-th"; From 737cedaeef1e37ae000e23d12a9bd9c925fccc63 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Tue, 11 Nov 2014 16:52:34 +0530 Subject: [PATCH 2/2] Required modifications done --- .../doctype/sales_invoice/sales_invoice.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index f679a906ec..d92f525e7a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -387,17 +387,15 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) { } cur_frm.cscript.on_submit = function(doc, cdt, cdn) { - if(cur_frm.doc.is_pos ) { - new_doc("Sales Invoice"); - } - - if(cint(frappe.boot.notification_settings.sales_invoice)) { - cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message); - } - $.each(doc["entries"], function(i, row) { if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note) }) + + if(cint(frappe.boot.notification_settings.sales_invoice)) { + cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message); + } else if(cur_frm.doc.is_pos) { + new_doc("Sales Invoice"); + } } cur_frm.cscript.send_sms = function() {