brotherton-erpnext/erpnext/accounts/page/pos/pos.js

47 lines
1.0 KiB
JavaScript
Raw Normal View History

2015-01-29 12:39:11 +00:00
frappe.pages['pos'].on_page_load = function(wrapper) {
var page = frappe.ui.make_app_page({
2014-08-08 10:00:49 +00:00
parent: wrapper,
2015-03-05 09:39:04 +00:00
title: __('Start Point-of-Sale (POS)'),
2014-08-08 10:00:49 +00:00
single_column: true
});
2015-03-05 09:39:04 +00:00
page.main.html(frappe.render_template("pos_page", {}));
2014-08-08 10:00:49 +00:00
var pos_type = frappe.ui.form.make_control({
parent: page.main.find(".select-type"),
2014-08-08 10:00:49 +00:00
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();
2015-03-05 09:39:04 +00:00
pos_type.set_input("Sales Invoice");
page.main.find(".btn-primary").on("click", function() {
2014-08-08 10:00:49 +00:00
erpnext.open_as_pos = true;
new_doc(pos_type.get_value());
});
$.ajax({
url: "/api/resource/POS Setting",
success: function(data) {
if(!data.data.length) {
page.main.find(".pos-setting-message").removeClass('hide');
2014-08-08 10:00:49 +00:00
}
}
})
}