added icon for pos

This commit is contained in:
Rushabh Mehta 2014-08-08 15:30:49 +05:30
parent 3de7757ba4
commit 72e1719220
6 changed files with 93 additions and 4 deletions

View File

@ -367,10 +367,8 @@ erpnext.POS = Class.extend({
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 @@ erpnext.POS = Class.extend({
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() {

View File

View File

@ -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');
}
}
})
}

View File

@ -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"
}

View File

@ -38,6 +38,12 @@ def get_data():
"link": "List/Note",
"type": "list"
},
"POS": {
"color": "#589494",
"icon": "icon-th",
"type": "page",
"link": "pos"
},
"Projects": {
"color": "#8e44ad",
"icon": "icon-puzzle-piece",

View File

@ -74,6 +74,11 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
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) {