[pos] refresh() to be called at minimum
diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js
index c76db13..4ef2397 100644
--- a/accounts/doctype/sales_invoice/pos.js
+++ b/accounts/doctype/sales_invoice/pos.js
@@ -106,7 +106,7 @@
this.make_item_list();
},
make_party: function() {
- var me = this;
+ var me = this;
this.party_field = wn.ui.form.make_control({
df: {
"fieldtype": "Link",
@@ -179,7 +179,7 @@
});
},
make_item_list: function() {
- var me = this;
+ var me = this;
wn.call({
method: 'accounts.doctype.sales_invoice.pos.get_items',
args: {
@@ -349,7 +349,6 @@
});
- this.make_item_list();
me.refresh_delete_btn();
cur_frm.pos.barcode.$input.focus();
}
@@ -368,7 +367,8 @@
$(".make-payment").hide();
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() {
$(".delete-items").toggle($(".item-cart .warning").length ? true : false);
diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js
index e07ed28..13cbc63 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/accounts/doctype/sales_invoice/sales_invoice.js
@@ -121,54 +121,6 @@
});
});
},
-
- // 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() {
this.get_terms();
@@ -176,7 +128,6 @@
is_pos: function() {
cur_frm.cscript.hide_fields(this.frm.doc);
-
if(cint(this.frm.doc.is_pos)) {
if(!this.frm.doc.company) {
this.frm.set_value("is_pos", 0);
@@ -194,6 +145,7 @@
});
}
}
+
},
debit_to: function() {
diff --git a/public/js/transaction.js b/public/js/transaction.js
index a38e3a7..1a1c98c 100644
--- a/public/js/transaction.js
+++ b/public/js/transaction.js
@@ -98,7 +98,7 @@
if((show===true && this.pos_active) || (show===false && !this.pos_active)) return;
// make pos
- if(!this.pos) {
+ if(!this.frm.pos) {
this.frm.layout.add_view("pos");
this.frm.pos = new erpnext.POS(this.frm.layout.views.pos, this.frm);
}