commit
3a97739f83
@ -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() {
|
||||
|
0
erpnext/accounts/page/pos/__init__.py
Normal file
0
erpnext/accounts/page/pos/__init__.py
Normal file
52
erpnext/accounts/page/pos/pos.js
Normal file
52
erpnext/accounts/page/pos/pos.js
Normal 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');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
28
erpnext/accounts/page/pos/pos.json
Normal file
28
erpnext/accounts/page/pos/pos.json
Normal 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"
|
||||
}
|
@ -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",
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user