Browse Source

Dec 07: [FIX] Bug Fixed 'custom_receipts_for_pos'

pull/309/head
Cybrosys Technologies 5 months ago
parent
commit
4fece5fd2b
  1. 2
      custom_receipts_for_pos/__manifest__.py
  2. 64
      custom_receipts_for_pos/data/pos_receipt_design1_data.xml
  3. 64
      custom_receipts_for_pos/data/pos_receipt_design2_data.xml
  4. 9
      custom_receipts_for_pos/doc/RELEASE_NOTES.md
  5. 11
      custom_receipts_for_pos/static/description/index.html
  6. 8
      custom_receipts_for_pos/static/src/js/receipt_design.js
  7. 5
      custom_receipts_for_pos/static/src/xml/order_receipt.xml

2
custom_receipts_for_pos/__manifest__.py

@ -22,7 +22,7 @@
################################################################################
{
'name': 'POS Receipt Design',
'version': '17.0.3.0.6',
'version': '17.0.3.1.5',
'category': 'Point of Sale',
'summary': "POS Receipt, Receipt Design, POS Receipt Template, Design "
"Report, Custom Receipt, POS Report, Customise Receipt, Odoo17, "

64
custom_receipts_for_pos/data/pos_receipt_design1_data.xml

@ -5,26 +5,21 @@
<field name="name">Design 1</field>
<field name="design_receipt"><![CDATA[
<div class="pos-receipt">
<t t-if="env.services.pos.config.logo">
<img t-att-src="'data:image/png;base64,' + env.services.pos.config.logo"
alt="Logo" class="pos-receipt-logo"/>
<br />
</t>
<div class="pos-receipt-contact">
<t t-if="env.services.pos.company.name">
<div><t t-esc="env.services.pos.company.name" /></div>
<t t-if="props.data.headerData.company.name">
<div><t t-esc="props.data.headerData.company.name" /></div>
</t>
<t t-if="env.services.pos.company.phone">
<div>Tel:<t t-esc="env.services.pos.company.phone" /></div>
<t t-if="props.data.headerData.company.phone">
<div>Tel:<t t-esc="props.data.headerData.company.phone" /></div>
</t>
<t t-if="env.services.pos.company.vat">
<div><t t-esc="env.services.pos.company.vat_label"/>:<t t-esc="env.services.pos.company.vat" /></div>
<t t-if="props.data.headerData.company.vat">
<div><t t-esc="props.data.headerData.company.vat_label"/>:<t t-esc="props.data.headerData.company.vat" /></div>
</t>
<t t-if="env.services.pos.company.email">
<div><t t-esc="env.services.pos.company.email" /></div>
<t t-if="props.data.headerData.company.email">
<div><t t-esc="props.data.headerData.company.email" /></div>
</t>
<t t-if="env.services.pos.company.website">
<div><t t-esc="env.services.pos.company.website" /></div>
<t t-if="props.data.headerData.company.website">
<div><t t-esc="props.data.headerData.company.website" /></div>
</t>
<t t-if="props.receipt.headerData.header">
<t t-out="props.receipt.headerData.header" />
@ -34,6 +29,9 @@
<div>--------------------------------</div>
<div>Served by <t t-esc="props.receipt.headerData.cashier" /></div>
</div>
<div class="fw-bolder" t-if="props.data.headerData.trackingNumber">
<span class="fs-2" t-esc="props.data.headerData.trackingNumber" />
</div>
</t>
</div>
<br/>
@ -57,12 +55,12 @@
</tr>
<t t-if="props.order and props.order.length and props.order[0] and props.order[0].pos and props.order[0].pos.mainScreen and props.order[0].pos.mainScreen.props and props.order[0].pos.mainScreen.props.order and props.order[0].pos.mainScreen.props.order.orderlines and props.order[0].pos.mainScreen.props.order.orderlines.length">
<t t-if="props.order[0].pos.mainScreen.props">
<tr t-foreach="props.order[0].pos.mainScreen.props.order.orderlines" t-as="orderline" t-key="index_orderlines">
<tr t-foreach="props.orderlines" t-as="orderline" t-key="orderline_index">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<t t-esc="orderline.productName"/>
<t t-if="orderline.discount > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
<t t-esc="orderline.discount"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
@ -70,22 +68,22 @@
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
<t t-esc="orderline.qty "/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="props.order[0].env.utils.formatCurrency(orderline.get_display_price())"/>
<t t-esc="orderline.unitPrice"/>
</td>
</tr>
</t>
</t>
<t t-else="">
<t t-if="props.orderlines and props.orderlines.length">
<tr t-foreach="props.orderlines" t-as="orderline" t-key="orderline.id">
<tr t-foreach="props.orderlines" t-as="orderline" t-key="orderline_index">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<t t-esc="orderline.productName"/>
<t t-if="orderline.discount > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
<t t-esc="orderline.discount"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
@ -93,10 +91,10 @@
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
<t t-esc="orderline.qty"/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="env.utils.formatCurrency(orderline.get_display_price())"/>
<t t-esc="orderline.unitPrice"/>
</td>
</tr>
</t>
@ -111,14 +109,13 @@
<br/>
<div style="font-weight:700; font-size:14px; border-top:1px dashed;">
<span style="margin-left:40%;">Subtotal : </span>
<span t-esc='env.utils.formatCurrency(props.data.total_without_tax)'
<span t-esc='props.pos.env.utils.formatCurrency(props.data.total_without_tax)'
class="pos-receipt-right-align"/>
</div>
<t t-log='props'/>
<t t-foreach='props.data.tax_details' t-as='tax' t-key="index_tax_details">
<t t-foreach='props.data.tax_details' t-as='tax' t-key="tax.tax.id">
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)'
<span t-esc='props.pos.env.utils.formatCurrency(tax.amount)'
class="pos-receipt-right-align"/>
</div>
</t>
@ -127,7 +124,7 @@
<br/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;">TOTAL : </span>
<span t-esc='props.order[0].env.utils.formatCurrency(props.data.amount_total)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(props.data.amount_total)' class="pos-receipt-right-align"/>
</div>
<br/><br/>
</div>
@ -150,5 +147,4 @@
</div>
</div>]]></field>
</record>
</odoo>
</odoo>

64
custom_receipts_for_pos/data/pos_receipt_design2_data.xml

@ -5,14 +5,11 @@
<field name="name">Design 2</field>
<field name="design_receipt"><![CDATA[
<div class="pos-receipt">
<t t-if="env.services.pos.config.logo">
<img t-att-src="'data:image/png;base64,' + env.services.pos.config.logo"
alt="Logo" class="pos-receipt-logo"/>
<br />
</t>
<div style="font-size:13px; text-align:center;">
<t t-esc="env.services.pos.company.name"/><br />
Phone:<t t-esc="env.services.pos.company.phone || ''"/><br />
<t t-if="props.data.headerData.company.name">
<div><t t-esc="props.data.headerData.company.name" /></div>
</t>
Phone:<t t-esc="props.pos.env.services.pos.company.phone || ''"/><br />
</div>
<br/>
<div style="font-size:13px; text-align:center;">
@ -24,15 +21,14 @@
<t t-esc="props.order.validation_date"/>
</t>
<br />
Order : <t t-esc="props.data.name"/><br/>
</div>
<br />
<div style="font-size:13px; text-align:center;">
Cashier : <t t-esc='props.receipt.headerData.cashier' /><br />
<t t-if="props.order[0].partner">
Customer : <t t-esc='props.order[0].partner.name' style="font-style:bold" />
</t>
<br />
<div class="fw-bolder" t-if="props.data.headerData.trackingNumber">
<span class="fs-2" t-esc="props.data.headerData.trackingNumber" />
</div>
</div>
<br/>
<t t-if="props.receipt.headerData.header">
@ -56,12 +52,12 @@
</tr>
<t t-if="props.order and props.order.length and props.order[0] and props.order[0].pos and props.order[0].pos.mainScreen and props.order[0].pos.mainScreen.props and props.order[0].pos.mainScreen.props.order and props.order[0].pos.mainScreen.props.order.orderlines and props.order[0].pos.mainScreen.props.order.orderlines.length">
<t t-if="props.order[0].pos.mainScreen.props">
<tr t-foreach="props.order[0].pos.mainScreen.props.order.orderlines" t-as="orderline" t-key="index_orderlines">
<tr t-foreach="props.order[0].pos.mainScreen.props.order.orderlines" t-as="orderline" t-key="orderline_index">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<t t-esc="orderline.productName"/>
<t t-if="orderline.discount > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
<t t-esc="orderline.discount"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
@ -69,22 +65,22 @@
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
<t t-esc="orderline.qty"/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="props.order[0].env.utils.formatCurrency(orderline.get_display_price())"/>
<t t-esc="orderline.unitPrice"/>
</td>
</tr>
</t>
</t>
<t t-else="">
<t t-if="props.orderlines and props.orderlines.length">
<tr t-foreach="props.orderlines" t-as="orderline" t-key="orderline.id">
<tr t-foreach="props.orderlines" t-as="orderline" t-key="orderline_index">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<t t-esc="orderline.productName"/>
<t t-if="orderline.discount > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
<t t-esc="orderline.discount"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
@ -92,10 +88,10 @@
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
<t t-esc="orderline.qty"/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="env.utils.formatCurrency(orderline.get_display_price())"/>
<t t-esc="orderline.unitPrice"/>
</td>
</tr>
</t>
@ -107,11 +103,11 @@
<t t-set='taxincluded' t-value='Math.abs(props.receipt.amount_total - props.receipt.total_with_tax) &lt;= 0.000001' />
<t t-if='!taxincluded'>
<br/>
<div style="font-weight:700; font-size:14px; border-top:1px dashed;"><span style="margin-left:40%;">Subtotal : </span><span t-esc='env.utils.formatCurrency(props.data.total_without_tax)' class="pos-receipt-right-align"/></div>
<t t-foreach='props.data.tax_details' t-as='tax' t-key="index_tax_details">
<div style="font-weight:700; font-size:14px; border-top:1px dashed;"><span style="margin-left:40%;">Subtotal : </span><span t-esc='props.pos.env.utils.formatCurrency(props.data.total_without_tax)' class="pos-receipt-right-align"/></div>
<t t-foreach='props.data.tax_details' t-as='tax' t-key="tax.tax.id">
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
</div>
</t>
</t>
@ -119,40 +115,40 @@
<br/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;">TOTAL : </span>
<span t-esc='env.utils.formatCurrency(props.data.amount_total)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(props.data.amount_total)' class="pos-receipt-right-align"/>
</div>
<br/><br/>
</div>
<!-- Payment Lines -->
<t t-foreach='props.paymentlines' t-as='line' t-key="index_paymentlines">
<t t-foreach='props.paymentlines' t-as='line' t-key="line_index">
<div style="font-size:14px; border-top:1px dashed; padding-top:5px;">
<span style="margin-left:40%;"><t t-esc='line.name' /></span>
<span t-esc='env.utils.formatCurrency(line.get_amount())' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(line.amount)' class="pos-receipt-right-align"/>
</div>
</t>
<br/>
<div class="receipt-change" style="font-size:14px;">
<span style="margin-left:40%;">CHANGE : </span>
<span t-esc='env.utils.formatCurrency(props.receipt.change)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(props.receipt.change)' class="pos-receipt-right-align"/>
</div>
<br/>
<!-- Extra Payment Info -->
<t t-if='props.receipt.total_discount'>
<div style="font-size:14px; border-top:1px dashed; padding-top:5px;">
<span style="margin-left:40%;">Discounts : </span>
<span t-esc='env.utils.formatCurrency(props.receipt.total_discount)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(props.receipt.total_discount)' class="pos-receipt-right-align"/>
</div>
</t>
<t t-if='taxincluded'>
<t t-foreach='props.receipt.tax_details' t-as='tax' t-key="index_receipt_tax_details">
<div style="font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(tax.amount)' class="pos-receipt-right-align"/>
</div>
</t>
<div style="font-size:14px;">
<span style="margin-left:40%;">Total Taxes : </span>
<span t-esc='env.utils.formatCurrency(rops.receipt.total_tax)' class="pos-receipt-right-align"/>
<span t-esc='props.pos.env.utils.formatCurrency(props.receipt.total_tax)' class="pos-receipt-right-align"/>
</div>
</t>
<div class='before-footer' />
@ -166,7 +162,7 @@
<br/><br/>
</div>
<div class='after-footer' style="font-size:14px;">
<t t-foreach='props.paymentlines' t-as='line' t-key="index_payment">
<t t-foreach='props.paymentlines' t-as='line' t-key="line_index">
<t t-if='line.ticket'>
<br />
<div class="pos-payment-terminal-receipt">

9
custom_receipts_for_pos/doc/RELEASE_NOTES.md

@ -40,9 +40,8 @@
#### Version 17.0.3.0.5
##### BUGFIX
- Fixed the receipt printing blank screen.
-
#### 29.11.2024
#### Version 17.0.3.0.6
##### BUGFIX
- Fixed the receipt number duplication.
#### 07.10.2024
#### Version 17.0.3.1.5
##### UPDATE
- Updated the tracking number to custom receipt screen and fixed the issues when tip is enabled.

11
custom_receipts_for_pos/static/description/index.html

@ -317,6 +317,17 @@
</p>
</div>
</div>
<div class="col-mg-12 active" style="padding: 1rem 4rem;">
<div class="py-3" style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="d-flex mb-3" style="font-size: 0.8rem; font-weight: 500;">
<span>Version 17.0.3.1.5</span><span class="px-2">|</span>
<span style="color: #714B67;font-weight: 600;">Released on: Dec 03, 2024</span>
</div>
<p class="m-0" style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Updated the tracking number to custom receipt screen and fixed the issues when tip is enabled.
</p>
</div>
</div>
</div>
</div>
</div>

8
custom_receipts_for_pos/static/src/js/receipt_design.js

@ -13,12 +13,14 @@ patch(OrderReceipt.prototype, {
this.pos = useState(useService("pos"));
},
get templateProps() {
return {
pos:this.pos,
data: this.props.data,
order: this.pos.orders,
receipt: this.pos.get_order().export_for_printing(),
orderlines:this.pos.get_order().get_orderlines(),
paymentlines:this.pos.get_order().get_paymentlines()
receipt:this.props.data,
orderlines:this.props.data.orderlines,
paymentlines:this.props.data.paymentlines
};
},
get templateComponent() {

5
custom_receipts_for_pos/static/src/xml/order_receipt.xml

@ -29,7 +29,6 @@
</ul>
</Orderline>
</OrderWidget>
<!-- Total -->
<div class="pos-receipt-right-align">--------</div>
<br/>
@ -51,9 +50,7 @@
</t>
<br/>
<br/>
<!-- Payment Lines -->
<div class="paymentlines" t-foreach="props.data.paymentlines"
t-as="line" t-key="line_index">
<t t-esc="line.name"/>
@ -65,9 +62,7 @@
<span t-esc="props.formatCurrency(props.data.change)"
class="pos-receipt-right-align"/>
</div>
<!-- Extra Payment Info -->
<t t-if="props.data.total_discount">
<div>
Discounts

Loading…
Cancel
Save