This commit is contained in:
Faris Ansari 2017-08-29 14:27:01 +05:30
parent ba3f0e6b70
commit 655f86d5e2
5 changed files with 37 additions and 34 deletions

View File

@ -308,16 +308,6 @@ body[data-route="pos"] .item-list .image-field .placeholder-text {
body[data-route="pos"] .item-list .pos-item-wrapper { body[data-route="pos"] .item-list .pos-item-wrapper {
position: relative; position: relative;
} }
body[data-route="pos"] .item-list .price-info {
position: absolute;
left: 0;
bottom: 0;
margin: 0 0 15px 15px;
background-color: rgba(141, 153, 166, 0.6);
padding: 5px 9px;
border-radius: 3px;
color: #fff;
}
body[data-route="pos"] .pos-bill-toolbar { body[data-route="pos"] .pos-bill-toolbar {
margin-top: 10px; margin-top: 10px;
} }
@ -356,3 +346,13 @@ body[data-route="pos"] .btn-more {
body[data-route="pos"] .collapse-btn { body[data-route="pos"] .collapse-btn {
cursor: pointer; cursor: pointer;
} }
.price-info {
position: absolute;
left: 0;
bottom: 0;
margin: 0 0 15px 15px;
background-color: rgba(141, 153, 166, 0.6);
padding: 5px 9px;
border-radius: 3px;
color: #fff;
}

View File

@ -80,7 +80,8 @@
.pos-item-wrapper { .pos-item-wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; position: relative;
width: 25%;
} }
.image-view-container { .image-view-container {
display: block; display: block;

View File

@ -364,17 +364,6 @@ body[data-route="pos"] {
.pos-item-wrapper { .pos-item-wrapper {
position: relative; position: relative;
} }
.price-info {
position: absolute;
left: 0;
bottom: 0;
margin: 0 0 15px 15px;
background-color: rgba(141, 153, 166, 0.6);
padding: 5px 9px;
border-radius: 3px;
color: #fff;
}
} }
.pos-bill-toolbar { .pos-bill-toolbar {
@ -423,4 +412,15 @@ body[data-route="pos"] {
.collapse-btn { .collapse-btn {
cursor: pointer; cursor: pointer;
} }
}
.price-info {
position: absolute;
left: 0;
bottom: 0;
margin: 0 0 15px 15px;
background-color: rgba(141, 153, 166, 0.6);
padding: 5px 9px;
border-radius: 3px;
color: #fff;
} }

View File

@ -108,7 +108,8 @@
.pos-item-wrapper { .pos-item-wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; position: relative;
width: 25%;
} }
.image-view-container { .image-view-container {

View File

@ -39,6 +39,7 @@ class PointOfSale {
this.bind_events(); this.bind_events();
}, },
() => this.make_new_invoice(), () => this.make_new_invoice(),
() => this.page.set_title(__('Point of Sale'))
]); ]);
} }
@ -584,7 +585,7 @@ class POSCart {
const $item = this.$cart_items.find(`[data-item-code="${item.item_code}"]`); const $item = this.$cart_items.find(`[data-item-code="${item.item_code}"]`);
if(item.qty > 0) { if(item.qty > 0) {
$item.find('.quantity input').val(item.qty); $item.find('.quantity input').val(item.qty);
$item.find('.discount').text(item.discount_percentage); $item.find('.discount').text(item.discount_percentage + '%');
$item.find('.rate').text(format_currency(item.rate, this.frm.doc.currency)); $item.find('.rate').text(format_currency(item.rate, this.frm.doc.currency));
} else { } else {
$item.remove(); $item.remove();
@ -700,23 +701,23 @@ class POSCart {
frappe.model.set_value(this.frm.doctype, this.frm.docname, frappe.model.set_value(this.frm.doctype, this.frm.docname,
'additional_discount_percentage', e.target.value) 'additional_discount_percentage', e.target.value)
.then(() => { .then(() => {
let discount_wrapper = this.wrapper.find('.discount_amount') let discount_wrapper = this.wrapper.find('.discount_amount');
discount_wrapper.val(this.frm.doc.discount_amount) discount_wrapper.val(this.frm.doc.discount_amount);
discount_wrapper.trigger('change') discount_wrapper.trigger('change');
}) });
}) });
this.wrapper.find('.discount_amount').on('change', (e) => { this.wrapper.find('.discount_amount').on('change', (e) => {
frappe.model.set_value(this.frm.doctype, this.frm.docname, frappe.model.set_value(this.frm.doctype, this.frm.docname,
'discount_amount', e.target.value) 'discount_amount', e.target.value);
this.frm.trigger('discount_amount') this.frm.trigger('discount_amount')
.then(() => { .then(() => {
let discount_wrapper = this.wrapper.find('.additional_discount_percentage'); let discount_wrapper = this.wrapper.find('.additional_discount_percentage');
discount_wrapper.val(this.frm.doc.additional_discount_percentage); discount_wrapper.val(this.frm.doc.additional_discount_percentage);
this.update_taxes_and_totals() this.update_taxes_and_totals();
this.update_grand_total() this.update_grand_total();
}) });
}) });
} }
set_selected_item($item) { set_selected_item($item) {