| frappe.pages['pos'].on_page_load = function(wrapper) { |
| var page = frappe.ui.make_app_page({ |
| title: __('Start Point-of-Sale (POS)'), |
| page.main.html(frappe.render_template("pos_page", {})); |
| var pos_type = frappe.ui.form.make_control({ |
| parent: page.main.find(".select-type"), |
| {label: __("Billing (Sales Invoice)"), value:"Sales Invoice"}, |
| {value:"Purchase Order"}, |
| {value:"Purchase Receipt"}, |
| {value:"Purchase Invoice"}, |
| pos_type.set_input("Sales Invoice"); |
| page.main.find(".btn-primary").on("click", function() { |
| erpnext.open_as_pos = true; |
| new_doc(pos_type.get_value()); |
| url: "/api/resource/POS Profile", |
| success: function(data) { |
| page.main.find(".pos-setting-message").removeClass('hide'); |