Files
enterprise-addons/pos_blackbox_be/views/pos_daily_reports.xml
T

406 lines
20 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="pos_blackbox_be.single_employee_sales_report" inherit_id="pos_hr.single_employee_sales_report">
<xpath expr="//t[@t-if='employee_name']" position="before">
<strong>This is not a valid User Report.</strong>
</xpath>
</template>
<template id="daily_report" inherit_id="point_of_sale.pos_session_sales_details" name="Daily Report">
<xpath expr="//div[@id='sales']/h6" position="replace">
<h6>Sales (NS)</h6>
</xpath>
<xpath expr="//div[@id='refunds']/h6" position="replace">
<h6>Refunds (NR)</h6>
</xpath>
<xpath expr="//div[@id='header']" position="after">
<t t-if="isBelgium">
<h2>
<t t-if='state == "closed"'>Z</t>
<t t-else="">X</t>
FINANCIAL
(<t t-esc="session_name"/> )
</h2>
<h5>VAT: <t t-esc="CompanyVAT"/></h5>
<h5><t t-esc="cashRegisterID"/> (<t t-esc="fdmID"/>)- <t t-esc="cashier_name"/> (<t t-esc="insz_or_bis_number"/>)</h5>
<h5>
<t t-esc="date_start" t-options="{'widget': 'datetime'}"/>
<t t-if="date_stop">
to <t t-esc="date_stop" t-options="{'widget': 'datetime'}"/>
</t>
</h5>
<h5>Time of reporting: <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%m/%d/%Y %H:%M:%S')"/></h5>
</t>
</xpath>
<xpath expr="//div[@id='taxe_sales']/h6" position="attributes">
<attribute name="t-if">not isBelgium</attribute>
</xpath>
<xpath expr="//div[@id='taxe_sales']/table/tbody/tr/td[1]" position="after">
<t t-if="isBelgium">
<td>
<t t-esc="tax['identification_letter']"/>
</td>
</t>
</xpath>
<xpath expr="//div[@id='taxe_sales']/table/tbody/tr[last()]" position="attributes">
<attribute name="t-if">not isBelgium</attribute>
</xpath>
<xpath expr="//div[@id='taxe_refunds']" position="attributes">
<attribute name="t-if" add="refund_products" separator=" and "></attribute>
</xpath>
<xpath expr="//div[@id='taxe_refunds']/h6" position="attributes">
<attribute name="t-if">not isBelgium</attribute>
</xpath>
<xpath expr="//div[@id='taxe_refunds']/table/tbody/tr/td[1]" position="after">
<t t-if="isBelgium">
<td>
<t t-esc="tax['identification_letter']"/>
</td>
</t>
</xpath>
<xpath expr="//div[@id='taxe_refunds']/table/tbody/tr[last()]" position="attributes">
<attribute name="t-if">not isBelgium</attribute>
</xpath>
<xpath expr="//div[@id='end_report']" position="before">
<t t-if="isBelgium">
<table class="table table-sm" style="page-break-after: avoid;">
<thead><tr>
<th class="text-start">Name</th>
<th class="text-end">Value</th>
</tr></thead>
<tbody>
<tr>
<td>Number of NS</td>
<td class="text-end"><t t-esc="NS_number"/></td>
</tr>
<tr>
<td>Number of NR</td>
<td class="text-end"><t t-esc="NR_number"/></td>
</tr>
<tr>
<td>NS discounts</td>
<td class="text-end">
<t t-esc="Positive_discount_number"/>
</td>
</tr>
<tr>
<td>Amount of NS discounts</td>
<td class="text-end">
<t t-esc="Positive_discount_amount" t-options="{'widget': 'float', 'precision': currency_precision}"/>
</td>
</tr>
<tr>
<td>NR discounts</td>
<td class="text-end"><t t-esc="Negative_discount_number"/></td>
</tr>
<tr>
<td>Amount of NR discounts</td>
<td class="text-end"><t t-esc="Negative_discount_amount" t-options="{'widget': 'float', 'precision': currency_precision}"/></td>
</tr>
<tr>
<td>Number of PRO FORMA (PS)</td>
<td class="text-end"><t t-esc="PS_number"/></td>
</tr>
<tr>
<td>Amount of PRO FORMA (PS)</td>
<td class="text-end"><t t-esc="PS_amount" t-options="{'widget': 'float', 'precision': currency_precision}"/></td>
</tr>
<tr>
<td>Number of PRO FORMA (PR)</td>
<td class="text-end">
<t t-esc="PR_number"/>
</td>
</tr>
<tr>
<td>Amount of PRO FORMA (PR)</td>
<td class="text-end">
<t t-esc="PR_amount" t-options="{'widget': 'float', 'precision': currency_precision}"/>
</td>
</tr>
<tr>
<td>Number of correction</td>
<td class="text-end">
<t t-esc="Correction_number"/>
</td>
</tr>
<tr>
<td>Amount of correction</td>
<td class="text-end">
<t t-esc="Correction_amount" t-options="{'widget': 'float', 'precision': currency_precision}"/>
</td>
</tr>
<tr>
<td>Cash Starting Amount</td>
<td class="text-end">
<t t-esc="CashBoxStartAmount"/>
</td>
</tr>
<tr>
<td>Cash Ending Amount</td>
<td class="text-end">
<t t-esc="CashBoxEndAmount"/>
</td>
</tr>
<tr>
<td>Cash box opening number</td>
<td class="text-end">
<t t-esc="CashBoxOpening"/>
</td>
</tr>
</tbody>
</table>
</t>
</xpath>
<xpath expr="//div[@id='sales']/table/tbody/tr/tr/td[last()]" position="replace">
<td class="text-end">
<t t-if="currency['position']">
<span t-out='line["total_paid"]' t-options="{'widget': 'float', 'precision': currency['precision']}">567789</span>
<span t-out='currency["symbol"]'>$</span>
</t>
<t t-else="">
<span t-out='currency["symbol"]'>$</span>
<span t-out='line["total_paid"]' t-options="{'widget': 'float', 'precision': currency['precision']}">567789</span>
</t>
<t t-if='line["discount"] != 0'>
Disc: <span t-out='line["discount"]'>45</span>%
</t>
</td>
</xpath>
<xpath expr="//div[@id='refunds']/table/tbody/tr/tr/td[last()]" position="replace">
<td class="text-end">
<t t-if="currency['position']">
<span t-out='line["total_paid"]' t-options="{'widget': 'float', 'precision': currency['precision']}">0.00</span>
<span t-out='currency["symbol"]'>$</span>
</t>
<t t-else="">
<span t-out='currency["symbol"]'>$</span>
<span t-out='line["total_paid"]' t-options="{'widget': 'float', 'precision': currency['precision']}">0.00</span>
</t>
<t t-if='line["discount"] != 0'>
Disc: <span t-out='line["discount"]'>0</span>%
</t>
</td>
</xpath>
<xpath expr="//t[@id='other_payments']/table" position="attributes">
<attribute name="style">page-break-inside: avoid;</attribute>
</xpath>
<xpath expr="//t[@id='other_payments']/table" position="inside">
<tfoot>
<tr>
<td class="text-start">
<strong>Total Payments:</strong>
</td>
<td class="text-end">
<strong>
<t t-out='total_paid' t-options="{'widget': 'float', 'precision': currency['precision']}"/>
</strong>
</td>
</tr>
</tfoot>
</xpath>
<xpath expr="//div[@id='discounts']" position="attributes">
<attribute name="t-if">not isBelgium</attribute>
</xpath>
<xpath expr="//div[@id='invoices']" position="attributes">
<attribute name="t-if" add="len(invoiceList)" separator=" or "/>
</xpath>
<xpath expr="//t[@id='closing_session']//div[hasclass('oe_structure')]/following-sibling::div[1]" position="attributes">
<attribute name="t-if" add="not isBelgium" separator=" and "/>
</xpath>
<xpath expr="//t[@id='closing_session']//div[hasclass('oe_structure')]/following-sibling::div[1]" position="after">
<table t-if="isBelgium" class="table table-sm table-borderless">
<tbody>
<tr class="border-bottom border-secondary">
<td>Total without rounding</td>
<td class="text-end">
<span t-if="currency['position']">
<span t-out='currency["total_paid"]' t-options="{'widget': 'float', 'precision': currency['precision']}">99.99</span>
<span t-out='currency["symbol"]'>$</span>
</span>
<span t-else="">
<span t-out='currency["symbol"]'>$</span>
<span t-out='currency["total_paid"]' t-options="{'widget': 'float', 'precision': currency['precision']}">99.99</span>
</span>
</td>
</tr>
<tr class="border-bottom border-secondary">
<td>Total with rounding</td>
<td class="text-end">
<span t-if="currency['position']">
<span t-out="total_paid" t-options="{'widget': 'float', 'precision': currency['precision']}">99.99</span>
<span t-out='currency["symbol"]'>$</span>
</span>
<span t-else="">
<span t-out='currency["symbol"]'>$</span>
<span t-out='total_paid' t-options="{'widget': 'float', 'precision': currency['precision']}">99.99</span>
</span>
</td>
</tr>
<tr class="border-bottom border-secondary">
<td>Rounding difference</td>
<td class="text-end">
<span t-if="currency['position']">
<span t-out="currency['total_paid'] - total_paid" t-options="{'widget': 'float', 'precision': currency['precision']}">99.99</span>
<span t-out='currency["symbol"]'>$</span>
</span>
<span t-else="">
<span t-out="currency['symbol']">$</span>
<span t-out='currency["total_paid"] - total_paid' t-options="{'widget': 'float', 'precision': currency['precision']}">99.99</span>
</span>
</td>
</tr>
</tbody>
</table>
</xpath>
</template>
<record id="action_report_pos_user" model="ir.actions.report">
<field name="name">User-Report</field>
<field name="model">pos.session</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">pos_blackbox_be.user_report_template</field>
<field name="report_file">pos_blackbox_be.user_report_template</field>
<field name="print_report_name">(object.name + '_user_report')</field>
<field name="attachment_use">True</field>
</record>
<record model="ir.ui.view" id="view_pos_session_form">
<field name="name">pos.session.form.view</field>
<field name="model">pos.session</field>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button" name="%(action_report_pos_user)d" type="action" icon="fa-file-text-o">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">User Report</span>
</div>
</button>
<button class="oe_stat_button" name="action_report_journal_file" type="object" icon="fa-file-text-o">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Journal File</span>
</div>
</button>
</xpath>
</field>
</record>
<template id="user_report_template">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<div class="page">
<t t-if="o.stop_at">
<h2>Z USERS</h2>
</t>
<t t-if="not o.stop_at">
<h2>X USERS</h2>
</t>
<div>
VAT: <t t-esc="o.company_id.vat"/>
</div>
<div>
Time of reporting: <t t-esc="context_timestamp(datetime.datetime.now()).strftime('%m/%d/%Y %H:%M:%S')"/>
</div>
<div>
<t t-esc="context_timestamp(o.start_at).strftime('%m/%d/%Y %H:%M:%S')"/>
<t t-if="o.stop_at">
to <t t-esc="context_timestamp(o.stop_at).strftime('%m/%d/%Y %H:%M:%S')"/>
</t>
</div>
<div>
<strong>POS Session:</strong>
<span t-field="o.name"/>
</div>
<div class="row mt32 mb32">
<div class="col-4">
<strong>Point of Sale</strong>:<br/>
<span t-field="o.config_id"/>
</div>
<div class="col-4">
<strong>From</strong>:<br/>
<span t-field="o.start_at"/>
</div>
<div class="col-4">
<strong>To</strong>:<br/>
<t t-if="o.stop_at">
<span t-field="o.stop_at"/>
</t>
<t t-if="not o.stop_at">
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%m/%d/%Y %H:%M:%S')"/>
</t>
</div>
</div>
<div class="zero_min_height">
<div style="border-bottom: 1px solid black;"></div>
</div>
<t t-foreach="o._get_user_report_data()" t-as="connection">
<div>
<strong><span t-esc="connection['login'] + ' (INSZ/BIS: ' + connection['insz_or_bis_number'] + ')'"/></strong>
</div>
<div>
<strong>fdm identifier: <span t-esc="connection['fdmIdentifier']"/></strong>
</div>
<div>
<strong>Amount of money in cash register</strong>:
<span t-field="o.cash_register_balance_end"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</div>
<div>
<strong>Revenue (NS): </strong>
<span t-esc="connection['revenue']" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</div>
<div>
<strong>Cash rounding applied: <span t-esc="connection['cash_rounding_applied']"/></strong>
</div>
<div>
Revenue per category (NS):
<t t-foreach="connection['revenue_per_category']" t-as="category">
<div class="ps-4 category-row">
<span class="category-name"><t t-esc="category[0]"/>:</span>
<span class="category-amount" t-esc="category[1]"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</div>
</t>
</div>
<div>
First ticket time (NS): <span t-esc="context_timestamp(connection['first_ticket_time']).strftime('%m/%d/%Y %H:%M:%S')"/>
</div>
<div>
<t t-if="connection['last_ticket_time']">
Last ticket time (NS): <span t-esc="context_timestamp(connection['last_ticket_time']).strftime('%m/%d/%Y %H:%M:%S')"/>
</t>
<t t-else="">
Last ticket time (NS): In Progress
</t>
</div>
<div class="zero_min_height">
<div style="border-bottom: 1px solid black;"></div>
</div>
</t>
</div>
</t>
</t>
</t>
</template>
</odoo>