odoo/ext/custom-addons/dp_reports_account/reports/invoice.xml

491 lines
27 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Invoice Body -->
<template id="report_invoice_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">
<div class="row">
<div class="col-xs-9">
<strong>Invoice Address</strong>
<div class="partner-data">
<span t-esc="o.partner_id.name"/>
<br/>
<t t-if="o.partner_id.name2">
<span t-esc="o.partner_id.name2"/>
<br/>
</t>
<span t-esc="o.partner_id.street"/>
<br/>
<t t-if="o.partner_id.street2">
<span t-esc="o.partner_id.street2"/>
<br/>
</t>
<span t-esc="o.partner_id.zip"/>
<span t-esc="o.partner_id.city"/>
<br/>
<t t-if="o.partner_id.country_id">
<span t-esc="o.partner_id.country_id.name"/>
<br/>
</t>
<t t-if="o.partner_id.email">
<span t-esc="o.partner_id.email"/>
<br/>
</t>
<t t-if="o.partner_id.phone">
<span t-esc="o.partner_id.phone"/>
<br/>
</t>
<t t-if="o.partner_id.vat">UID-Nr.:
<span t-esc="o.partner_id.vat"/>
</t>
<t t-if="not o.partner_id.vat and o.partner_id.info_uid">UID-Nr:
<span t-esc="o.partner_id.info_uid"/>
</t>
</div>
</div>
<div class="col-xs-3">
<t t-call="dp_reports.company_data"/>
</div>
</div>
<div class="row mt32"/>
<div class="row height-20">
<div class="col-xs-3">
<strong>
<span class="col-xs-5" style="padding: 0px">Customer No.:</span>
</strong>
<span class="col-xs-4" style="padding: 0px" t-field="o.partner_id.ref"/>
</div>
<strong>
<span class="col-xs-2">Contact Person:</span>
</strong>
<!-- <span class="col-xs-3" t-field="o.editor_id"/> -->
<span t-if="o.editor_id">
<span class="col-xs-3" t-field="o.editor_id"/>
</span>
<span t-else="">
<span class="col-xs-3" t-field="o.user_id"/>
</span>
<strong>
<span class="col-xs-2">Positions:</span>
</strong>
<span class="col-xs-2" t-field="o.positions"/>
</div>
<div class="row height-20">
<div class="col-xs-3" style="padding-right: 0px;">
<strong>
<span style="padding-right: 2px">IVC-Date:</span>
</strong>
<span style="padding-left: 0px; padding-right: 2px; word-break: normal;" t-field="o.date_invoice"/>
</div>
<strong>
<span class="col-xs-2">Email:</span>
</strong>
<span class="col-xs-3" t-field="res_company.email"/>
</div>
<div class="row">
<div class="col-xs-3"/>
<strong>
<span class="col-xs-2">Phone:</span>
</strong>
<span class="col-xs-3" t-field="o.editor_id.phone"/>
<strong>
<span class="col-xs-2">Description:</span>
</strong>
<span class="col-xs-2" t-field="o.name"/>
</div>
<div class="dp_note">
<p t-if="o.note1">
<span t-field="o.note1"/>
</p>
</div>
<div class="row mt32"/>
<t t-foreach="o.order_lines_layouted()" t-as="page" name="lines_layouted">
<table class="table table-condensed">
<t t-set="discount_is_set" t-value="field_set_in_lines(o.invoice_line_ids, 'discount')"/>
<t t-set="has_serial_number" t-value="o.invoice_line_ids.mapped('prod_lot_ids')"
groups="stock.group_production_lot"/>
<thead class="table-header">
<tr>
<th class="text-center">Pos.</th>
<th class="text-right">Quantity</th>
<th class="text-right" style="width: 11mm;">Weight</th>
<th class="text-right"/>
<th class="text-left">Item</th>
<th class="text-right">EP</th>
<th class="text-right" t-if="discount_is_set">Discount</th>
<th class="text-right">Total Amount</th>
</tr>
</thead>
<tbody class="invoice-tbody">
<t t-set="pos_nr" t-value="0"/>
<t t-foreach="page" t-as="layout_category">
<tr t-if="layout_category['name'] != 'Uncategorized'">
<td colspan="5">
<strong>
<t t-esc="layout_category['name']"/>
<t t-if="layout_category.get('order_id')">
<t t-f="o.partner_id.id != layout_category['order_id'].partner_id.id">
<t t-if="layout_category['order_id'].partner_id.ref">
-
<t t-esc="layout_category['order_id'].partner_id.ref"/>
</t>
<t t-if="layout_category['order_id'].partner_id.name">
-
<t t-esc="layout_category['order_id'].partner_id.name"/>
</t>
</t>
<t t-if="layout_category['order_id'].origin">
-
<t t-esc="layout_category['order_id'].origin"/>
</t>
<t t-if="layout_category['order_id'].client_order_ref">
-
<t t-esc="layout_category['order_id'].client_order_ref"/>
</t>
<t t-if="layout_category['order_id'].confirmation_nr">
-
<t t-esc="layout_category['order_id'].confirmation_nr"/>
</t>
<t t-if="layout_category['order_id'].delivery_date">
- delivered ex works:
<t t-esc="layout_category['order_id'].delivery_date"/>
</t>
<t t-if="layout_category['order_id'].partner_shipping_id.zip">
;
<t t-esc="layout_category['order_id'].partner_shipping_id.zip"/>
</t>
<t t-if="layout_category['order_id'].partner_shipping_id.city">
-
<t t-esc="layout_category['order_id'].partner_shipping_id.city"/>
</t>
<t t-if="layout_category['order_id'].partner_shipping_id.country_id.name">
/
<t t-esc="layout_category['order_id'].partner_shipping_id.country_id.name"/>
</t>
<t t-set="lc_id" t-value="layout_category.get('order_id').id" />
<t t-set="obj" t-value="request.env['stock.picking'].search([('sale_id', '=', lc_id),('state','=','done'),('carrier_id','!=',None)])"/>
<t t-if="obj and obj[0]['carrier_id'].name">
<br/><strong>Tracking Ref: </strong>
<t t-foreach="request.env['stock.picking'].search([('sale_id', '=', lc_id),('state','=','done')])" t-as="obj">
<t t-if="obj['carrier_id'].name">
<t t-esc="obj['carrier_id'].name"/>:
</t>
<t t-if="obj['carrier_tracking_ref']">
<t t-esc="obj['carrier_tracking_ref']"/>;
</t>
</t>
</t>
</t>
</strong>
</td>
<t t-if="discount_is_set">
<td class="text-right" colspan="2">
<strong>
<span style="color: #A72523;">Subtotal</span>
</strong>
</td>
</t>
<t t-if="not discount_is_set">
<td class="text-right">
<strong>
<span style="color: #A72523;">Subtotal</span>
</strong>
</td>
</t>
<td class="text-right" id="subtotal">
<strong>
<span t-esc="layout_category['price_subtotal']"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</strong>
</td>
</tr>
<t t-foreach="layout_category['lines']" t-as="invoice_line">
<tr>
<t t-set="pos_nr" t-value="pos_nr+1"/>
<td class="text-center">
<span t-esc="pos_nr"/>
</td>
<td class="text-right">
<t t-if="invoice_line.quantity and not invoice_line.dealer_discount">
<span t-esc="o._formatLang(invoice_line.quantity, False).strip('0').strip(',').strip('.')"/>
</t>
</td>
<td class="text-right">
<t t-if="invoice_line.weight and not invoice_line.dealer_discount">
<span t-esc="round(invoice_line.weight,2)"/>
kg
</t>
</td>
<td class="text-right"/>
<td class="text-left">
<t t-if="invoice_line.product_id.default_code and invoice_line.product_id.material_type_id.print_default_code">
<strong>
<span t-field="invoice_line.product_id.default_code"/>
</strong>
<br/>
</t>
<span t-if="with_intrastat and invoice_line.intrastat_id and not invoice_line.hide_intrastat_code">
<strong>Customs Tariff:</strong>
<span t-field="invoice_line.intrastat_id"/>
<br/>
</span>
<span t-if="shorttext">
<span t-if="invoice_line.lot_id and invoice_line.lot_id.short_text">
<strong>Text short:</strong>
<span t-field="invoice_line.lot_id.short_text"/>
</span>
<span t-else="">
<span t-field="invoice_line.name"/>
</span>
</span>
<span t-else="">
<span t-field="invoice_line.name"/>
</span>
<span t-if="invoice_line.product_id.tracking=='serial'">
<br/>
<strong>Serial No.:</strong>
<t t-if="has_serial_number">
<span t-field="invoice_line.lot_formatted_note" />
</t>
</span>
<span t-if="postext and invoice_line.lot_id.name">
<br/>
<strong>Pos:</strong>
<span t-field="invoice_line.lot_id.name"/>
</span>
<p t-if="invoice_line.lot_id.notes">
<span t-field="invoice_line.lot_id.notes"/>
</p>
<p t-if="o.note_line">
<span t-field="o.note_line"/>
</p>
</td>
<td class="text-right">
<span t-if="invoice_line.hide_discount and not invoice_line.dealer_discount"
t-field="invoice_line.price_reduce"/>
<span t-if="not invoice_line.hide_discount and not invoice_line.dealer_discount"
t-field="invoice_line.price_unit"/>
</td>
<td class="text-right" t-if="discount_is_set">
<t t-if="not invoice_line.hide_discount and invoice_line.discount">
<span t-esc="o._formatLang(invoice_line.discount, False).strip('0').strip(',').strip('.')"/>
%
</t>
</td>
<td class="text-right">
<span t-field="invoice_line.price_subtotal"/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
</t>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tbody class="totals-tbody">
<tr>
<td>
Net Value
</td>
<td class="text-right">
<span t-field="o.amount_untaxed"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr t-foreach="o.tax_line_ids" t-as="tax_line">
<t t-if="tax_line.amount &gt; 0">
<td>
<span t-field="tax_line.tax_id.description"/>
</td>
<td class="text-right">
<span t-field="tax_line.amount"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</t>
</tr>
<tr class="amount-total">
<td>
<strong>Total Value</strong>
</td>
<td class="text-right">
<strong>
<span t-field="o.amount_total"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</strong>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row dp_note" style="page-break-inside: avoid">
<p t-if="o.note2">
<span t-field="o.note2" style="page-break-inside: avoid"/>
</p>
</div>
<div class="row">
<p class="col-xs-12">
<span t-field="o.comment"/>
</p>
<p class="col-xs-12">
Weight Total:
<span t-esc="round(o.weight_total, 2)"/>
kg
<br/>
</p>
<p class="col-xs-12" t-if="o.incoterms_id.name">
Terms of Delivery:
<span t-esc="o.incoterms_id.name"/>
<br/>
</p>
<p class="col-xs-12" t-if="o.payment_term_id">
Terms of Payment:
<span t-esc="o.payment_term_id.name"/>
<br/>
</p>
<!--
<p class="col-xs-12" t-if="o.partner_id.property_account_position_id.name=='IG-Ausland'">
Dies ist eine steuerfreie innergemeinschaftliche Lieferung
</p>
-->
<p class="col-xs-12">
<br/>
The general terms and conditions of TZ Tischlerzentrum GesmbH apply exclusively to this order
<br/>
</p>
<t t-if="o.fiscal_position_id and o.fiscal_position_id.note">
<br/>
</t>
<p id="fiscal_position_remark" t-if="o.fiscal_position_id and o.fiscal_position_id.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position_id.note"/>
</p>
</div>
</div>
</t>
</template>
<template id="account.report_invoice">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="dp_reports_account.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<template id="report_invoice_with_intrastat">
<t t-call="web.html_container">
<t t-set="with_intrastat" t-value="True"/>
<t t-foreach="docs" t-as="o">
<t t-call="dp_reports_account.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<template id="report_invoice_with_intrastat_short">
<t t-call="web.html_container">
<t t-set="with_intrastat" t-value="True"/>
<t t-set="shorttext" t-value="True"/>
<t t-foreach="docs" t-as="o">
<t t-call="dp_reports_account.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<template id="report_invoice_short">
<t t-call="web.html_container">
<t t-set="with_intrastat" t-value="False"/>
<t t-set="shorttext" t-value="True"/>
<t t-foreach="docs" t-as="o">
<t t-call="dp_reports_account.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<template id="report_invoice_extra">
<t t-call="web.html_container">
<t t-set="postext" t-value="True"/>
<t t-foreach="docs" t-as="o">
<t t-call="dp_reports_account.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
<record id="account.account_invoices" model="ir.actions.report">
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
<field name="binding_model_id" eval="False"/>
</record>
<record id="report_intrastat.account_intrastatinvoices" model="ir.actions.report">
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
<field name="binding_model_id" eval="False"/>
</record>
<report
id="account_invoices_short"
model="account.invoice"
string="Invoice with text short"
report_type="qweb-pdf"
name="dp_reports_account.report_invoice_short"
file="dp_reports_account.report_invoice_short"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
print_report_name="(object._get_printed_report_name())"
paperformat="dp_reports.paperformat_a4_european"
menu="False"
/>
<report
id="account_invoices_extra"
model="account.invoice"
string="Invoice with text extra"
report_type="qweb-pdf"
name="dp_reports_account.report_invoice_extra"
file="dp_reports_account.report_invoice_extra"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
print_report_name="(object._get_printed_report_name())"
paperformat="dp_reports.paperformat_a4_european"
menu="False"
/>
<report
id="account_invoices_with_intrastat"
model="account.invoice"
string="Invoice w. Customs Tariff"
report_type="qweb-pdf"
name="dp_reports_account.report_invoice_with_intrastat"
file="dp_reports_account.report_invoice_with_intrastat"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
print_report_name="(object._get_printed_report_name())"
paperformat="dp_reports.paperformat_a4_european"
menu="False"
/>
<report
id="account_invoices_with_intrastat_short"
model="account.invoice"
string="Invoice w. Customs Tariff text short"
report_type="qweb-pdf"
name="dp_reports_account.report_invoice_with_intrastat_short"
file="dp_reports_account.report_invoice_with_intrastat_short"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
print_report_name="(object._get_printed_report_name())"
paperformat="dp_reports.paperformat_a4_european"
menu="False"
/>
<record id="account.account_invoices_without_payment" model="ir.actions.report">
<field name="name">Rechnung ohne Zolltarifnummer</field>
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
</record>
</odoo>