Files
enterprise-addons/l10n_lu_reports/data/saft_report.xml
T

142 lines
7.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="tax_information_inherit_l10n_lu_saft" inherit_id="account_saft.tax_information">
<xpath expr="//TaxCode" position="before">
<t t-if="company.account_fiscal_country_id.code == 'LU'">
<TaxType>TVA</TaxType>
</t>
</xpath>
<xpath expr="//TaxBaseDescription" position="before">
<t t-if="company.account_fiscal_country_id.code == 'LU'">
<TaxBase t-out="format_float(abs(tax_vals['tax_base_amount']))"/>
</t>
</xpath>
</template>
<template id="saft_move_template">
<NumberOfEntries t-out="len(filtered_moves)"/>
<TotalDebit t-out="format_float(total_debit)"/>
<TotalCredit t-out="format_float(total_credit)"/>
<Invoice t-foreach="filtered_moves" t-as="invoice_vals">
<InvoiceNo t-out="invoice_vals['name'][:70]"/>
<t t-set="partner_id" t-value="invoice_vals['partner_id']"/>
<t t-set="partner_vals" t-value="partner_detail_map[partner_id]"/>
<CustomerInfo t-if="'customer' in partner_vals['types']">
<CustomerID t-out="partner_id"/>
<BillingAddress>
<t t-if="partner_vals['addresses']" t-call="account_saft.address">
<t t-set="partner_address" t-value="partner_vals['addresses'][0]"/>
</t>
</BillingAddress>
</CustomerInfo>
<SupplierInfo t-if="'supplier' in partner_vals['types']">
<SupplierID t-out="partner_id"/>
<BillingAddress>
<t t-if="partner_vals['addresses']" t-call="account_saft.address">
<t t-set="partner_address" t-value="partner_vals['addresses'][0]"/>
</t>
</BillingAddress>
</SupplierInfo>
<Period t-out="format_date(invoice_vals['date'], '%m')"/>
<PeriodYear t-out="format_date(invoice_vals['date'], '%Y')"/>
<InvoiceDate t-out="invoice_vals['invoice_date']"/>
<InvoiceType t-out="invoice_vals['type'][:9]"/>
<SourceID t-if="invoice_vals['invoice_origin']" t-out="invoice_vals['invoice_origin'][:35]"/>
<GLPostingDate t-out="invoice_vals['date']"/>
<TransactionID t-out="invoice_vals['name']"/>
<Line t-foreach="invoice_vals['invoice_line_vals_list']" t-as="line_vals">
<AccountID t-out="line_vals['account_code']"/>
<OrderReferences>
<OriginatingON t-out="invoice_vals['name'][:70]"/>
<OrderDate t-out="invoice_vals['invoice_date']"/>
</OrderReferences>
<ProductCode t-if="line_vals['product_default_code']" t-out="line_vals['product_default_code'][:70]"/>
<ProductDescription t-if="line_vals['name']" t-out="line_vals['name'][:256]"/>
<Quantity t-out="line_vals['quantity']"/>
<InvoiceUOM t-if="line_vals['product_uom_name']" t-out="line_vals['product_uom_name'][:9]"/>
<UnitPrice t-out="format_float(line_vals['price_unit'] / line_vals['rate'])"/>
<TaxPointDate t-out="invoice_vals['invoice_date']"/>
<Description t-out="(line_vals['name'] or invoice_vals['name'])[:256]"/>
<InvoiceLineAmount>
<Amount t-out="format_float(abs(line_vals['balance']))"/>
<t t-if="line_vals['currency_id'] != company.currency_id.id">
<CurrencyCode t-out="line_vals['currency_code']"/>
<CurrencyAmount t-out="format_float(line_vals['amount_currency'] * invoice_vals['sign'])"/>
<ExchangeRate t-out="format_float(line_vals['rate'], digits=8)"/>
</t>
</InvoiceLineAmount>
<DebitCreditIndicator t-out="'C' if line_vals['credit'] else 'D'"/>
<TaxInformation t-foreach="line_vals.get('tax_detail_vals_list', [])" t-as="tax_vals">
<t t-set="sign" t-value="invoice_vals['sign']"/>
<t t-call="account_saft.tax_information"/>
</TaxInformation>
</Line>
<DocumentTotals>
<TaxInformationTotals t-foreach="invoice_vals['tax_detail_vals_list']" t-as="tax_vals">
<t t-set="sign" t-value="invoice_vals['sign']"/>
<t t-call="account_saft.tax_information"/>
</TaxInformationTotals>
<NetTotal t-out="format_float(invoice_vals['total_invoice_untaxed_balance'])"/>
<GrossTotal t-out="format_float(invoice_vals['total_invoice_balance'])"/>
</DocumentTotals>
</Invoice>
</template>
<template id="saft_template_inherit_l10n_lu_saft" inherit_id="account_saft.saft_template">
<xpath expr="//AuditFile" position="inside">
<SourceDocuments t-if="invoice_vals_list and company.account_fiscal_country_id.code == 'LU'">
<t t-set="filtered_moves" t-value="[inv for inv in invoice_vals_list if inv['type'] in ('out_invoice', 'out_refund')]"/>
<t t-set="total_debit" t-value="total_invoices_debit"/>
<t t-set="total_credit" t-value="total_invoices_credit"/>
<t t-if="filtered_moves">
<SalesInvoices>
<t t-call="l10n_lu_reports.saft_move_template"/>
</SalesInvoices>
</t>
<t t-set="filtered_moves" t-value="[inv for inv in invoice_vals_list if inv['type'] in ('in_invoice', 'in_refund')]"/>
<t t-set="total_debit" t-value="total_bills_debit"/>
<t t-set="total_credit" t-value="total_bills_credit"/>
<t t-if="filtered_moves">
<PurchaseInvoices>
<t t-call="l10n_lu_reports.saft_move_template"/>
</PurchaseInvoices>
</t>
</SourceDocuments>
</xpath>
<xpath expr="//TaxTable" position="after">
<t t-if="company.account_fiscal_country_id.code == 'LU'">
<UOMTable t-if="uoms">
<UOMTableEntry t-foreach="uoms" t-as="uom">
<UnitOfMeasure t-out="uom.name[:9]"/>
</UOMTableEntry>
</UOMTable>
<Products t-if="product_vals_list">
<Product t-foreach="product_vals_list" t-as="product_vals">
<ProductCode t-out="product_vals['default_code'][:70]"/>
<ProductGroup t-out="product_vals['product_category'][:70]"/>
<Description t-out="product_vals['name'][:256]"/>
<UOMStandard t-out="product_vals['standard_uom'][:9]"/>
</Product>
</Products>
</t>
</xpath>
<xpath expr="//TaxCodeDetails" position="before">
<t t-if="company.account_fiscal_country_id.code == 'LU'">
<TaxType>TVA</TaxType>
<Description>Taxe sur la valeur ajoutée</Description>
</t>
</xpath>
<xpath expr="//StandardAccountID" position="after">
<t t-if="company.account_fiscal_country_id.code == 'LU'">
<AccountType t-out="account_vals['account_type'][:18]"/>
</t>
</xpath>
</template>
</odoo>