[pos] refresh() to be called at minimum
This commit is contained in:
parent
e947081552
commit
f624ffa40a
@ -349,7 +349,6 @@ erpnext.POS = Class.extend({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.make_item_list();
|
|
||||||
me.refresh_delete_btn();
|
me.refresh_delete_btn();
|
||||||
cur_frm.pos.barcode.$input.focus();
|
cur_frm.pos.barcode.$input.focus();
|
||||||
}
|
}
|
||||||
@ -368,7 +367,8 @@ erpnext.POS = Class.extend({
|
|||||||
$(".make-payment").hide();
|
$(".make-payment").hide();
|
||||||
|
|
||||||
if (this.frm.doctype == "Quotation")
|
if (this.frm.doctype == "Quotation")
|
||||||
$(".party-area").toggle(cur_frm.doc.quotation_to=="Customer" ? true : false)
|
if (cur_frm.doc.quotation_to=="Customer")
|
||||||
|
this.party_field.remove();
|
||||||
},
|
},
|
||||||
refresh_delete_btn: function() {
|
refresh_delete_btn: function() {
|
||||||
$(".delete-items").toggle($(".item-cart .warning").length ? true : false);
|
$(".delete-items").toggle($(".item-cart .warning").length ? true : false);
|
||||||
|
|||||||
@ -122,61 +122,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 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";
|
|
||||||
|
|
||||||
// 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();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
|
|
||||||
// // 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;
|
|
||||||
|
|
||||||
// // refresh
|
|
||||||
// if(cur_frm.pos_active)
|
|
||||||
// cur_frm.pos.refresh();
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
tc_name: function() {
|
tc_name: function() {
|
||||||
this.get_terms();
|
this.get_terms();
|
||||||
},
|
},
|
||||||
|
|
||||||
is_pos: function() {
|
is_pos: function() {
|
||||||
cur_frm.cscript.hide_fields(this.frm.doc);
|
cur_frm.cscript.hide_fields(this.frm.doc);
|
||||||
|
|
||||||
if(cint(this.frm.doc.is_pos)) {
|
if(cint(this.frm.doc.is_pos)) {
|
||||||
if(!this.frm.doc.company) {
|
if(!this.frm.doc.company) {
|
||||||
this.frm.set_value("is_pos", 0);
|
this.frm.set_value("is_pos", 0);
|
||||||
@ -194,6 +145,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
debit_to: function() {
|
debit_to: function() {
|
||||||
|
|||||||
@ -98,7 +98,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
if((show===true && this.pos_active) || (show===false && !this.pos_active)) return;
|
if((show===true && this.pos_active) || (show===false && !this.pos_active)) return;
|
||||||
|
|
||||||
// make pos
|
// make pos
|
||||||
if(!this.pos) {
|
if(!this.frm.pos) {
|
||||||
this.frm.layout.add_view("pos");
|
this.frm.layout.add_view("pos");
|
||||||
this.frm.pos = new erpnext.POS(this.frm.layout.views.pos, this.frm);
|
this.frm.pos = new erpnext.POS(this.frm.layout.views.pos, this.frm);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user