Browse Source

Oct 16 [UPDT] : Updated 'custom_receipts_for_pos'

18.0
AjmalCybro 3 days ago
parent
commit
b050740de7
  1. 9
      custom_receipts_for_pos/static/src/js/receipt_design.js
  2. 11
      custom_receipts_for_pos/static/src/xml/order_receipt.xml

9
custom_receipts_for_pos/static/src/js/receipt_design.js

@ -6,16 +6,13 @@ import { useService } from "@web/core/utils/hooks";
patch(OrderReceipt.prototype, {
setup(){
console.log('setupp')
super.setup();
this.state = useState({
template: true,
})
this.pos = useState(useService("pos"));
},
get templateProps() {
console.log('templateProps')
return {
data: this.props.data,
order: this.pos.get_order(),
@ -25,7 +22,6 @@ patch(OrderReceipt.prototype, {
};
},
get templateComponent() {
console.log('templateComponent')
var mainRef = this;
return class extends Component {
setup() {}
@ -33,10 +29,9 @@ patch(OrderReceipt.prototype, {
};
},
get isTrue() {
console.log('isTrue')
if (this.env.services.pos.config.is_custom_receipt == false) {
return true;
}
return false;
}
return true;
}
});

11
custom_receipts_for_pos/static/src/xml/order_receipt.xml

@ -4,7 +4,6 @@
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
<xpath expr="//div[hasclass('pos-receipt')]" position="replace">
<div class="pos-receipt">
<t t-log="'isTrue',isTrue"/>
<t t-if="isTrue">
<ReceiptHeader data="props.data.headerData"/>
<OrderWidget t-if="props.data.orderlines?.length"
@ -39,9 +38,7 @@
<span class="fw-bolder"
t-out="subtotal.name"/>
<span t-esc="props.formatCurrency(subtotal.base_amount_currency)" class="ms-auto"/>
</div>
<div t-foreach="subtotal.tax_groups"
t-as="tax_group" t-key="tax_group_index"
class="d-flex">
@ -66,12 +63,14 @@
</div>
<!--1-->
<div class="text-center">--------------------------------</div>
<t t-if="taxTotals and taxTotals.order_total !== undefined">
<div class="pos-receipt-amount receipt-total">
<t t-out="props.data.label_total"/>
<span t-esc="props.formatCurrency(taxTotals.order_total)"
class="pos-receipt-right-align"/>
</div>
<t t-if="'order_rounding' in taxTotals">
</t>
<t t-if="taxTotals and 'order_rounding' in taxTotals">
<div class="pos-receipt-amount receipt-rounding">
<t t-out="props.data.label_rounding"/>
<span t-esc="props.formatCurrency(taxTotals.order_rounding)"
@ -79,8 +78,6 @@
</div>
<div class="pos-receipt-amount receipt-to-pay">
To Pay
<t t-log="'props', props"/>
<t t-log="'taxTotals.order_to_pay', taxTotals"/>
<span t-esc="props.formatCurrency(taxTotals.total_amount_currency)"
class="pos-receipt-right-align"/>
</div>
@ -94,7 +91,7 @@
class="pos-receipt-right-align"/>
</div>
<div t-if="'order_change' in taxTotals"
<div t-if="order_change and 'order_change' in taxTotals"
class="pos-receipt-amount receipt-change">
<t t-out="props.data.label_change"/>
<span t-esc="props.formatCurrency(taxTotals.order_change)"

Loading…
Cancel
Save