Merge pull request #2042 from rmehta/pos-module
added icon for pos
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.js b/erpnext/accounts/doctype/sales_invoice/pos.js
index 2dcfc68..843c324 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.js
+++ b/erpnext/accounts/doctype/sales_invoice/pos.js
@@ -367,10 +367,8 @@
this.hide_payment_button();
// If quotation to is not Customer then remove party
- if (this.frm.doctype == "Quotation") {
+ if (this.frm.doctype == "Quotation" && this.frm.doc.quotation_to!="Customer") {
this.party_field.$wrapper.remove();
- if (this.frm.doc.quotation_to == "Customer")
- this.make_party();
}
},
refresh_item_list: function() {
@@ -489,7 +487,7 @@
if (operation == "increase-qty")
this.update_qty(item_code, item_qty + 1);
- else if (operation == "decrease-qty" && item_qty != 1)
+ else if (operation == "decrease-qty" && item_qty != 0)
this.update_qty(item_code, item_qty - 1);
},
disable_text_box_and_button: function() {
diff --git a/erpnext/accounts/page/pos/__init__.py b/erpnext/accounts/page/pos/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/page/pos/__init__.py
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
new file mode 100644
index 0000000..0d06de1
--- /dev/null
+++ b/erpnext/accounts/page/pos/pos.js
@@ -0,0 +1,52 @@
+frappe.pages['pos'].onload = function(wrapper) {
+ frappe.ui.make_app_page({
+ parent: wrapper,
+ title: 'Start POS',
+ single_column: true
+ });
+
+ wrapper.body.html('<div class="text-center" style="margin: 40px">\
+ <p>' + __("Select type of transaction") + '</p>\
+ <p class="select-type" style="margin: auto; max-width: 300px; margin-bottom: 15px;"></p>\
+ <p class="alert alert-warning pos-setting-message hide">'
+ + __("Please setup your POS Preferences")
+ + ': <a class="btn btn-default" onclick="newdoc(\'POS Setting\')">'
+ + __("Make new POS Setting") + '</a></p>\
+ <p><button class="btn btn-primary">' + __("Start") + '</button></p>\
+ </div>');
+
+ var pos_type = frappe.ui.form.make_control({
+ parent: wrapper.body.find(".select-type"),
+ df: {
+ fieldtype: "Select",
+ options: [
+ {label: __("Billing (Sales Invoice)"), value:"Sales Invoice"},
+ {value:"Sales Order"},
+ {value:"Delivery Note"},
+ {value:"Quotation"},
+ {value:"Purchase Order"},
+ {value:"Purchase Receipt"},
+ {value:"Purchase Invoice"},
+ ],
+ fieldname: "pos_type"
+ },
+ only_input: true
+ });
+
+ pos_type.refresh();
+
+ wrapper.body.find(".btn-primary").on("click", function() {
+ erpnext.open_as_pos = true;
+ new_doc(pos_type.get_value());
+ });
+
+ $.ajax({
+ url: "/api/resource/POS Setting",
+ success: function(data) {
+ if(!data.data.length) {
+ wrapper.body.find(".pos-setting-message").removeClass('hide');
+ }
+ }
+ })
+
+}
diff --git a/erpnext/accounts/page/pos/pos.json b/erpnext/accounts/page/pos/pos.json
new file mode 100644
index 0000000..31c043c
--- /dev/null
+++ b/erpnext/accounts/page/pos/pos.json
@@ -0,0 +1,28 @@
+{
+ "content": null,
+ "creation": "2014-08-08 02:45:55.931022",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-th",
+ "modified": "2014-08-08 05:59:33.045012",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "pos",
+ "owner": "Administrator",
+ "page_name": "pos",
+ "roles": [
+ {
+ "role": "Sales User"
+ },
+ {
+ "role": "Purchase User"
+ },
+ {
+ "role": "Accounts User"
+ }
+ ],
+ "script": null,
+ "standard": "Yes",
+ "style": null,
+ "title": "POS"
+}
\ No newline at end of file
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index 4b9f8f8..9f40ef3 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -38,6 +38,12 @@
"link": "List/Note",
"type": "list"
},
+ "POS": {
+ "color": "#589494",
+ "icon": "icon-th",
+ "type": "page",
+ "link": "pos"
+ },
"Projects": {
"color": "#8e44ad",
"icon": "icon-puzzle-piece",
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 8a9be1d..44835ce 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -74,6 +74,11 @@
this.$pos_btn = this.frm.appframe.add_primary_action(btn_label, function() {
me.toggle_pos();
}, icon, "btn-default");
+
+ if(erpnext.open_as_pos) {
+ me.toggle_pos(true);
+ erpnext.open_as_pos = false;
+ }
},
toggle_pos: function(show) {