mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
[fix] patch merge conflict fixed
This commit is contained in:
@@ -29,4 +29,21 @@ span, div, td, input, textarea, button, select {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: -10px auto;
|
||||
}
|
||||
|
||||
/* pos */
|
||||
.pos-item {
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
padding-left: 5px !important;
|
||||
padding-right: 5px !important;
|
||||
}
|
||||
|
||||
.pos-bill {
|
||||
padding: 20px 5px;
|
||||
font-family: Monospace;
|
||||
border: 1px solid #eee;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
||||
}
|
||||
@@ -62,6 +62,56 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
erpnext.hide_company();
|
||||
this.show_item_wise_taxes();
|
||||
this.set_dynamic_labels();
|
||||
|
||||
// Show POS button only if it is enabled from features setup
|
||||
if(cint(sys_defaults.fs_pos_view)===1 && this.frm.doctype!="Material Request")
|
||||
this.pos_btn();
|
||||
},
|
||||
|
||||
pos_btn: function() {
|
||||
if(this.$pos_btn)
|
||||
this.$pos_btn.remove();
|
||||
|
||||
if(!this.pos_active) {
|
||||
var btn_label = wn._("POS View"),
|
||||
icon = "icon-desktop";
|
||||
} else {
|
||||
var btn_label = wn._(this.frm.doctype) + wn._(" View"),
|
||||
icon = "icon-file-text";
|
||||
}
|
||||
var me = this;
|
||||
|
||||
this.$pos_btn = this.frm.add_custom_button(btn_label, function() {
|
||||
me.toggle_pos();
|
||||
me.pos_btn();
|
||||
}, icon);
|
||||
},
|
||||
|
||||
toggle_pos: function(show) {
|
||||
// Check whether it is Selling or Buying cycle
|
||||
var price_list = wn.meta.has_field(cur_frm.doc.doctype, "selling_price_list") ?
|
||||
this.frm.doc.selling_price_list : this.frm.doc.buying_price_list;
|
||||
|
||||
if (!price_list)
|
||||
msgprint(wn._("Please select Price List"))
|
||||
else {
|
||||
if((show===true && this.pos_active) || (show===false && !this.pos_active)) return;
|
||||
|
||||
// make pos
|
||||
if(!this.frm.pos) {
|
||||
this.frm.layout.add_view("pos");
|
||||
this.frm.pos = new erpnext.POS(this.frm.layout.views.pos, this.frm);
|
||||
}
|
||||
|
||||
// toggle view
|
||||
this.frm.layout.set_view(this.pos_active ? "" : "pos");
|
||||
this.pos_active = !this.pos_active;
|
||||
|
||||
// refresh
|
||||
if(this.pos_active)
|
||||
this.frm.pos.refresh();
|
||||
this.frm.refresh();
|
||||
}
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
@@ -418,10 +468,10 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
(this.frm.doc.currency != company_currency && this.frm.doc.conversion_rate != 1.0)) :
|
||||
false;
|
||||
|
||||
// if(!valid_conversion_rate) {
|
||||
// wn.throw(wn._("Please enter valid") + " " + wn._(conversion_rate_label) +
|
||||
// " 1 " + this.frm.doc.currency + " = [?] " + company_currency);
|
||||
// }
|
||||
if(!valid_conversion_rate) {
|
||||
wn.throw(wn._("Please enter valid") + " " + wn._(conversion_rate_label) +
|
||||
" 1 " + this.frm.doc.currency + " = [?] " + company_currency);
|
||||
}
|
||||
},
|
||||
|
||||
calculate_taxes_and_totals: function() {
|
||||
|
||||
Reference in New Issue
Block a user