mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
[pos] [minor] added pos in sales order for testing
This commit is contained in:
@@ -82,10 +82,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
cur_frm.cscript.sales_order_btn();
|
||||
cur_frm.cscript.delivery_note_btn();
|
||||
}
|
||||
|
||||
// Show POS button only if it enabled from features setup
|
||||
if(cint(sys_defaults.fs_pos_view)===1)
|
||||
cur_frm.cscript.pos_btn();
|
||||
},
|
||||
|
||||
sales_order_btn: function() {
|
||||
@@ -125,53 +121,53 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
});
|
||||
},
|
||||
|
||||
pos_btn: function() {
|
||||
if(cur_frm.$pos_btn)
|
||||
cur_frm.$pos_btn.remove();
|
||||
// pos_btn: function() {
|
||||
// if(cur_frm.$pos_btn)
|
||||
// cur_frm.$pos_btn.remove();
|
||||
|
||||
if(!cur_frm.pos_active) {
|
||||
var btn_label = wn._("POS View"),
|
||||
icon = "icon-desktop";
|
||||
// if(!cur_frm.pos_active) {
|
||||
// var btn_label = wn._("POS View"),
|
||||
// icon = "icon-desktop";
|
||||
|
||||
cur_frm.cscript.sales_order_btn();
|
||||
cur_frm.cscript.delivery_note_btn();
|
||||
} else {
|
||||
var btn_label = wn._("Invoice View"),
|
||||
icon = "icon-file-text";
|
||||
// cur_frm.cscript.sales_order_btn();
|
||||
// cur_frm.cscript.delivery_note_btn();
|
||||
// } else {
|
||||
// var btn_label = wn._("Invoice View"),
|
||||
// icon = "icon-file-text";
|
||||
|
||||
if (cur_frm.doc.docstatus===0) {
|
||||
this.$delivery_note_btn.remove();
|
||||
this.$sales_order_btn.remove();
|
||||
}
|
||||
}
|
||||
// if (cur_frm.doc.docstatus===0) {
|
||||
// this.$delivery_note_btn.remove();
|
||||
// this.$sales_order_btn.remove();
|
||||
// }
|
||||
// }
|
||||
|
||||
cur_frm.$pos_btn = cur_frm.add_custom_button(btn_label, function() {
|
||||
cur_frm.cscript.toggle_pos();
|
||||
cur_frm.cscript.pos_btn();
|
||||
}, icon);
|
||||
},
|
||||
// cur_frm.$pos_btn = cur_frm.add_custom_button(btn_label, function() {
|
||||
// cur_frm.cscript.toggle_pos();
|
||||
// cur_frm.cscript.pos_btn();
|
||||
// }, icon);
|
||||
// },
|
||||
|
||||
toggle_pos: function(show) {
|
||||
if (!this.frm.doc.selling_price_list)
|
||||
msgprint(wn._("Please select Price List"))
|
||||
else {
|
||||
if((show===true && cur_frm.pos_active) || (show===false && !cur_frm.pos_active)) return;
|
||||
// toggle_pos: function(show) {
|
||||
// if (!this.frm.doc.selling_price_list)
|
||||
// msgprint(wn._("Please select Price List"))
|
||||
// else {
|
||||
// if((show===true && cur_frm.pos_active) || (show===false && !cur_frm.pos_active)) return;
|
||||
|
||||
// make pos
|
||||
if(!cur_frm.pos) {
|
||||
cur_frm.layout.add_view("pos");
|
||||
cur_frm.pos = new erpnext.POS(cur_frm.layout.views.pos, cur_frm);
|
||||
}
|
||||
// // make pos
|
||||
// if(!cur_frm.pos) {
|
||||
// cur_frm.layout.add_view("pos");
|
||||
// cur_frm.pos = new erpnext.POS(cur_frm.layout.views.pos, cur_frm);
|
||||
// }
|
||||
|
||||
// toggle view
|
||||
cur_frm.layout.set_view(cur_frm.pos_active ? "" : "pos");
|
||||
cur_frm.pos_active = !cur_frm.pos_active;
|
||||
// // toggle view
|
||||
// cur_frm.layout.set_view(cur_frm.pos_active ? "" : "pos");
|
||||
// cur_frm.pos_active = !cur_frm.pos_active;
|
||||
|
||||
// refresh
|
||||
if(cur_frm.pos_active)
|
||||
cur_frm.pos.refresh();
|
||||
}
|
||||
},
|
||||
// // refresh
|
||||
// if(cur_frm.pos_active)
|
||||
// cur_frm.pos.refresh();
|
||||
// }
|
||||
// },
|
||||
|
||||
tc_name: function() {
|
||||
this.get_terms();
|
||||
|
||||
Reference in New Issue
Block a user