-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFC] l10n_br_cte: refactor dacte report
- Loading branch information
1 parent
ce8571e
commit ab30383
Showing
9 changed files
with
375 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import models | ||
from .hooks import post_init_hook | ||
from . import models | ||
from . import report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import ir_actions_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template id="report_dacte_cte"> | ||
<t t-call="web.html_container"> | ||
<div style="font-size: 12px; max-width: 90mm; margin-top: 2mm;"> | ||
<div style="text-align: center; margin: 0 auto"> | ||
<h2 | ||
style="text-transform: uppercase; font-size: 18px; font-weight: bold;" | ||
><t t-esc="company_legal_name" /></h2> | ||
<div style="max-width: 20.5em; text-align: center; margin: 0 auto;"> | ||
<p style="margin-bottom: 0;"><t t-esc="company_street" />, <t | ||
t-esc="company_district" | ||
/>, <t t-esc="company_city" /> - <t | ||
t-esc="company_state" | ||
/></p> | ||
</div> | ||
<div | ||
style="display: flex; justify-content: space-between; max-width: 20em; margin: 0 auto;" | ||
> | ||
<p style="margin-bottom: 0; padding: 0;">CNPJ: <t | ||
t-esc="company_cnpj" | ||
/></p> | ||
<p style="margin-bottom: 0; padding: 0;">IE: <t | ||
t-esc="company_ie" | ||
/></p> | ||
</div> | ||
<div> | ||
<p | ||
class="text-transform: uppercase; margin-bottom: 0;" | ||
>Documento Auxiliar da Nota Fiscal do Consumidor Eletrônica</p> | ||
</div> | ||
<t t-if="contingency"> | ||
<hr /> | ||
<div> | ||
<p style="margin-bottom: 0;">Emitida em Contingência</p> | ||
<p style="margin-bottom: 0;">Pendente de Autorização</p> | ||
</div> | ||
</t> | ||
<hr /> | ||
<t t-if="homologation_environment"> | ||
<div style="text-transform: uppercase; "> | ||
<p | ||
style="margin-bottom: 0; font-size: 14px;" | ||
>EMITIDA EM AMBIENTE DE HOMOLOGAÇÃO - SEM VALOR FISCAL</p> | ||
</div> | ||
<hr /> | ||
</t> | ||
</div> | ||
<div> | ||
<p | ||
style="font-size: 11px;" | ||
># | COD | DESCRICAO | QUANTIDADE | UN | VL UNIT | VL TOTAL</p> | ||
<t t-foreach="lines" t-as="line" t-key="line.id"> | ||
<p style="margin-bottom: 0;"><t | ||
t-esc="line['product_index']" | ||
/> <t t-esc="line['product_name']" /> <t | ||
t-esc="line['product_quantity']" | ||
/><t t-esc="line['product_uom']" /> X <t | ||
t-esc="line['product_unit_value']" | ||
/> <t t-esc="line['product_unit_total']" /> </p> | ||
</t> | ||
</div> | ||
<hr /> | ||
<div> | ||
<div | ||
style="display: flex; justify-content: space-between; align-items: center;" | ||
> | ||
<p style="margin-bottom: 0;">Qtd total itens</p> | ||
<p style="margin-bottom: 0;"><t | ||
t-esc="total_product_quantity" | ||
/></p> | ||
</div> | ||
<t t-if="unformatted_amount_discount_value"> | ||
<div | ||
style="display: flex; justify-content: space-between; align-items: center;" | ||
> | ||
<p style="margin-bottom: 0;">Desconto</p> | ||
<p style="margin-bottom: 0;"><t | ||
t-esc="unformatted_amount_discount_value" | ||
/></p> | ||
</div> | ||
</t> | ||
<div | ||
style="display: flex; justify-content: space-between; align-items: center;" | ||
> | ||
<p | ||
style="text-transform: uppercase; font-weight: bold; margin-bottom: 0" | ||
>Valor total</p> | ||
<p style="margin-bottom: 0;"><t t-esc="amount_total" /></p> | ||
</div> | ||
</div> | ||
<div | ||
style="display: flex; justify-content: space-between; align-items: center;" | ||
> | ||
<t t-foreach="payments" t-as="payment"> | ||
<p style="margin-bottom: 0;"><t t-esc="payment['method']" /></p> | ||
<p style="margin-bottom: 0;"><t t-esc="payment['value']" /></p> | ||
</t> | ||
</div> | ||
<t t-if="amount_change"> | ||
<div | ||
style="display: flex; justify-content: space-between; align-items: center;" | ||
> | ||
<p style="margin-bottom: 0;">TROCO</p> | ||
<p style="margin-bottom: 0;"><t t-esc="amount_change" /></p> | ||
</div> | ||
</t> | ||
<hr /> | ||
<div style="text-align: center;"> | ||
<p style="margin-bottom: 0;">Consulte pela chave de acesso em:</p> | ||
<p style="margin-bottom: 0;"><t t-esc="nfce_url" /></p> | ||
<p style="font-size: 13px; margin-bottom: 0;"><t | ||
t-esc="document_key" | ||
/></p> | ||
</div> | ||
<div | ||
style="display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; margin: 10px 0;" | ||
> | ||
<div> | ||
<div> | ||
<!-- TODO: Quando o consumidor for identificado deve haver o CPF ou CNPJ--> | ||
<p | ||
style="text-transform: uppercase; text-align: left; fonti-size: 18px; margin: 2px auto;" | ||
>Consumidor Nao Identificado</p> | ||
</div> | ||
|
||
<div> | ||
<p style="margin-bottom: 0;">Numero: <t | ||
t-esc="document_number" | ||
/></p> | ||
<p style="margin-bottom: 0;">Serie: <t | ||
t-esc="document_serie" | ||
/></p> | ||
<p style="margin-bottom: 0;">Emissao: <t | ||
t-esc="document_date" | ||
/></p> | ||
</div> | ||
|
||
<div> | ||
<t t-if="contingency"> | ||
<p style="margin-bottom: 0;">Emitida em Contingencia</p> | ||
<p style="margin-bottom: 0;">Pendente de Autorizacao</p> | ||
</t> | ||
<t t-else=""> | ||
<p style="margin-bottom: 0;">Protocolo: <t | ||
t-esc="authorization_protocol" | ||
/></p> | ||
<p style="margin-bottom: 0;">Autorizacao: <t | ||
t-esc="document_date" | ||
/></p> | ||
</t> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<t t-set="qr_code" t-value="document_qrcode" /> | ||
<img | ||
t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s'%('QR', qr_code, 150, 150)" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</t> | ||
</template> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<odoo> | ||
<record id="report_dacte" model="ir.actions.report"> | ||
<field name="name">DACTE</field> | ||
<field name="model">l10n_br_fiscal.document</field> | ||
<field name="report_type">qweb-pdf</field> | ||
<field name="report_name">main_template_dacte</field> | ||
<field name="report_file">main_template_dacte</field> | ||
<field name="print_report_name">'%s' % (object.document_key)</field> | ||
<field name="binding_model_id" ref="model_l10n_br_fiscal_document" /> | ||
<field name="binding_type">report</field> | ||
</record> | ||
</odoo> |
Oops, something went wrong.