Browse Source

Change ticket xml print

12.0
Juliana 3 years ago
parent
commit
667b27059a
  1. 2
      __manifest__.py
  2. 2
      static/src/js/screens.js
  3. 196
      static/src/xml/pos.xml

2
__manifest__.py

@ -1,7 +1,7 @@
{
"name": "VRACOOP - POS Balance ticketing",
"summary": "POS Balance ticketing",
"version": "12.0.0.0",
"version": "12.0.0.1",
"development_status": "Beta",
"author": "Le Filament",
"maintainers": ["remi-filament"],

2
static/src/js/screens.js

@ -39,7 +39,7 @@ odoo.define('vracoop_balance_ticketing.screens', function (require) {
handle_auto_print: function() {
if (this.should_auto_print()) {
this.print();
this.click_next();
// this.click_next();
// }
} else {
this.lock_screen(false);

196
static/src/xml/pos.xml

@ -74,164 +74,46 @@
<t t-name="XmlReceiptBls">
<receipt align='center' width='40' value-thousands-separator='' >
<t t-if='receipt.company.logo'>
<img t-att-src='receipt.company.logo' alt="Logo"/>
<div class="pos-sale-ticket">
<div class="pos-center-align title-mag">Rayon vrac</div>
<br/>
</t>
<t t-if='!receipt.company.logo'>
<h1><t t-esc='receipt.company.name' /></h1>
<br/>
</t>
<div font='b'>
<t t-if='receipt.company.contact_address'>
<div><t t-esc='receipt.company.contact_address' /></div>
</t>
<t t-if='receipt.company.phone'>
<div>Tel:<t t-esc='receipt.company.phone' /></div>
</t>
<t t-if='receipt.company.vat'>
<div>VAT:<t t-esc='receipt.company.vat' /></div>
</t>
<t t-if='receipt.company.email'>
<div><t t-esc='receipt.company.email' /></div>
</t>
<t t-if='receipt.company.website'>
<div><t t-esc='receipt.company.website' /></div>
</t>
<t t-if='receipt.header_xml'>
<t t-raw='receipt.header_xml' />
</t>
<t t-if='!receipt.header_xml and receipt.header'>
<div><t t-esc='receipt.header' /></div>
</t>
<t t-if='receipt.cashier'>
<div class='cashier'>
<div>--------------------------------</div>
<div>Served by <t t-esc='receipt.cashier' /></div>
</div>
</t>
</div>
<br /><br />
<!-- Orderlines -->
<div class='orderlines' line-ratio='0.6'>
<t t-foreach='receipt.orderlines' t-as='line'>
<t t-set='simple' t-value='line.discount === 0 and line.unit_name === "Unit(s)" and line.quantity === 1' />
<t t-if='simple'>
<line>
<left><t t-esc='line.product_name_wrapped[0]' /></left>
<right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.price_display' /></value></right>
</line>
<t t-call="XmlReceiptWrappedProductNameLines"/>
</t>
<t t-if='!simple'>
<line><left><t t-esc='line.product_name_wrapped[0]' /></left></line>
<t t-call="XmlReceiptWrappedProductNameLines"/>
<t t-if='line.discount !== 0'>
<line indent='1'><left>Discount: <t t-esc='line.discount' />%</left></line>
</t>
<line indent='1'>
<left>
<value t-att-value-decimals='pos.dp["Product Unit of Measure"]' value-autoint='on'>
<t t-esc='line.quantity' />
</value>
<t t-if='line.unit_name !== "Unit(s)"'>
<t t-esc='line.unit_name' />
</t>
x
<value t-att-value-decimals='pos.dp["Product Price"]'>
<t t-esc='line.price' />
</value>
</left>
<right>
<value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.price_display' /></value>
</right>
</line>
</t>
</t>
</div>
<!-- Subtotal -->
<t t-set='taxincluded' t-value='Math.abs(receipt.subtotal - receipt.total_with_tax) &lt;= 0.000001' />
<t t-if='!taxincluded'>
<line><right>--------</right></line>
<line><left>Subtotal</left><right><t t-esc="widget.format_currency(receipt.subtotal)" /></right></line>
<t t-foreach='receipt.tax_details' t-as='tax'>
<line>
<left><t t-esc='tax.name' /></left>
<right><t t-esc='tax.amount' /></right>
</line>
</t>
</t>
<!-- Total -->
<line><right>--------</right></line>
<line class='total' size='double-height'>
<left><pre> TOTAL</pre></left>
<right><t t-esc='widget.format_currency(receipt.total_with_tax)' /></right>
</line>
<br/><br/>
<!-- Payment Lines -->
<t t-foreach='paymentlines' t-as='line'>
<line>
<left><t t-esc='line.name' /></left>
<right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.get_amount()'/></value></right>
</line>
</t>
<br/>
<line size='double-height'>
<left><pre> CHANGE</pre></left>
<right><t t-esc='widget.format_currency(receipt.change)' /></right>
</line>
<br/>
<!-- Extra Payment Info -->
<t t-if='receipt.total_discount'>
<line>
<left>Discounts</left>
<right><t t-esc='widget.format_currency(receipt.total_discount)'/></right>
</line>
</t>
<t t-if='taxincluded'>
<t t-foreach='receipt.tax_details' t-as='tax'>
<line>
<left><t t-esc='tax.name' /></left>
<right><t t-esc='widget.format_currency(tax.amount)' /></right>
</line>
</t>
<line>
<left>Total Taxes</left>
<right><t t-esc='widget.format_currency(receipt.total_tax)'/></right>
</line>
</t>
<div class='before-footer' />
<!-- Footer -->
<t t-if='receipt.footer_xml'>
<t t-raw='receipt.footer_xml' />
</t>
<t t-if='!receipt.footer_xml and receipt.footer'>
<br/>
<t t-esc='receipt.footer' />
<br/>
<br/>
</t>
<div class='after-footer' />
<br/>
<div font='b'>
<div><t t-esc='receipt.name' /></div>
<div><t t-esc='receipt.date.localestring' /></div>
<div font='b'>
<div class="pos-center-align title-product"><t t-esc="transaction.name"/></div>
<br />
<br />
<table class='ticket-info pos-center-align'>
<tr class="title-info">
<td>Prix Unitaire</td>
<td>Poids Net</td>
</tr>
<tr>
<td><span><t t-esc="transaction.price_product"/></span> €/kg</td>
<td><span><t t-esc="transaction.weight_net"/></span> kg</td>
</tr>
</table>
<br />
<br />
<table class='ticket-total pos-center-align'>
<tr class="title-info">
<td>Prix Total
</td>
</tr>
<tr>
<td><span><t t-esc="transaction.price_net"/></span>
</td>
</tr>
</table>
<br />
<br />
<table class='pos-center-align'>
<tr class="title-info bloc-barcode">
<td>
<img t-att-src="'/report/barcode/EAN13/' + widget.get_barcode_data()" />
<span class="caption"><t t-esc="num_ean13"/></span>
</td>
</tr>
</table>
</div>
</div>
</receipt>

Loading…
Cancel
Save