diff --git a/data/data.xml b/data/data.xml index 0581bc9acac6635bfe15264dfeb07ac73b887b06..1511255d63614b74e54ee380291216d7eb2fdc39 100644 --- a/data/data.xml +++ b/data/data.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <odoo> - <data noupdate="1"> + <data noupdate="0"> <!-- Precisions --> @@ -9,5 +9,10 @@ <field name="digits">3</field> </record> + <record forcecreate="True" id="unit_sale_price" model="decimal.precision"> + <field name="name">Unité de Mesure</field> + <field name="digits">2</field> + </record> + </data> </odoo> diff --git a/models/acc_account.py b/models/acc_account.py index c935c69788793e74545c6a6e95c806b632bac11b..5c89f7adb696f6af0b53a8ce5e4e1e7a6516ebd3 100644 --- a/models/acc_account.py +++ b/models/acc_account.py @@ -104,7 +104,9 @@ class AccAccount(models.Model): string="Montant hors TCFE", store=True, readonly=True, compute="_compute_amount" ) # inverse='_inverse_amount_total') - power_cons = fields.Float("Consommation locale (index Enedis)") + power_cons = fields.Float( + "Consommation locale (index Enedis)", digits="Unité de Mesure" + ) url = fields.Char("URL", compute="_compute_url", store=True) @api.model_create_multi @@ -201,7 +203,7 @@ class AccAccountLine(models.Model): date = fields.Date( related="acc_account_id.date", store=True, readonly=True, index=True, copy=False ) - quantity = fields.Float(string="Quantité", default=1.0) + quantity = fields.Float(string="Quantité", default=1.0, digits="Unité de Mesure") price_unit = fields.Float(string="Prix unitaire", digits="Sale Price") currency_id = fields.Many2one( "res.currency", string="Devise", related="acc_account_id.currency_id" diff --git a/report/account_template.xml b/report/account_template.xml index 572e285ad818921183db33c6140f5ac38e557bb8..15e7a2c0c9375bf22d78cd15f8495e379ae74e09 100644 --- a/report/account_template.xml +++ b/report/account_template.xml @@ -324,14 +324,15 @@ </p> </div> <div> - <h2>Synthèse de votre facture</h2> - <h3>Période de livraison concernée : du <span + <h3>Synthèse de votre facture</h3> + <h4>Période de livraison concernée : du <span t-field="o.start_date" t-options="{'format': 'dd/MM/yyyy'}" /> au <span t-field="o.end_date" t-options="{'format': 'dd/MM/yyyy'}" - /></h3> + /> + </h4> <hr /> <table @@ -341,8 +342,10 @@ <tr> <td>Consommation locale</td> <td class="text-right"> - <span t-field="o.power_cons" /> <span - >kWh</span> + <span + class="text-nowrap" + t-field="o.power_cons" + />kWh </td> </tr> <tr> @@ -404,60 +407,7 @@ électrique.</p> </div> </div> -<!-- <div class="clearfix">--> -<!-- <div id="total" class="row">--> -<!-- <div t-attf-class="col-6 ml-auto">--> -<!-- <table--> -<!-- class="table table-sm"--> -<!-- style="page-break-inside: avoid;"--> -<!-- >--> -<!-- <tr--> -<!-- class="border-black o_subtotal"--> -<!-- style=""--> -<!-- >--> -<!-- <td><strong>Sous-Total</strong></td>--> -<!-- <td class="text-right">--> -<!-- <span--> -<!-- t-field="o.amount_untaxed"--> -<!-- />--> -<!-- </td>--> -<!-- </tr>--> -<!-- <t t-if="o.is_tva">--> -<!-- <tr style="">--> -<!-- <t>--> -<!-- <td><span--> -<!-- class="text-nowrap"--> -<!-- />TVA</td>--> -<!-- <td--> -<!-- class="text-right o_price_total"--> -<!-- >--> -<!-- <span--> -<!-- class="text-nowrap"--> -<!-- t-field="o.amount_tax"--> -<!-- />--> -<!-- </td>--> -<!-- </t>--> -<!-- </tr>--> -<!-- </t>--> -<!-- <tr class="border-black o_total">--> -<!-- <td><strong>Total TTC*</strong></td>--> -<!-- <td class="text-right">--> -<!-- <span--> -<!-- class="text-nowrap"--> -<!-- t-field="o.amount_total"--> -<!-- />--> -<!-- </td>--> -<!-- </tr>--> -<!-- </table>--> -<!-- <div>--> -<!-- <p>*Le total à payer correspond à l’électricité autoconsommée,--> -<!-- la contribution d’acheminement et les taxes hors TVA sur cette--> -<!-- électricité sont collectées par le fournisseur du complément--> -<!-- électrique.</p>--> -<!-- </div>--> -<!-- </div>--> -<!-- </div>--> -<!-- </div>--> + </div> </div> @@ -474,7 +424,119 @@ <span >Merci de bien vouloir indiquer le numéro de facture et/ou votre référence client sur l’ordre de virement</span> </p> + <div class="row mt32 mb32" style="page-break-before:always;"> + <div class="col-12"> + <h4>Votre facture en détail</h4> + <!-- Table pour l'électricité locale--> + <table + class="table table-sm o_main_table" + name="account_line_table" + > + <thead> + <tr> + <th colspan="4"> + Electricité Locale + </th> + </tr> + <tr> + <th>Production</th> + <th>Quantité d'électricité renouvelable</th> + <th>Prix</th> + <th>Montant</th> + </tr> + </thead> + <tbody> + <t t-set="lines" t-value="o.line_ids" /> + <t t-foreach="lines" t-as="line"> + <t t-if="not line.is_tax"> + <tr class=""> + <td> + <span + t-field="line.description" + t-options="{'widget': 'text'}" + /> + </td> + <td class="text-right"> + <span + class="text-nowrap" + t-field="line.quantity" + /> + </td> + <td class="text-right"> + <span + class="text-nowrap" + t-field="line.price_unit" + /><span> kWh</span> + </td> + <td class="text-right"> + <span + class="text-nowrap" + t-field="line.price_total" + /> + </td> + </tr> + </t> + </t> + </tbody> + </table> + <!-- Table pour les taxes TCFE--> + <table + class="table table-sm o_main_table" + name="account_line_table" + > + <thead> + <tr> + <th colspan="4"> + Taxe sur la consommation finale d’électricité (TCFE) + </th> + </tr> + <tr> + <th>Production</th> + <th + >Quantité d'électricité renouvelable autoconsommée</th> + <th>Prix</th> + <th>Montant</th> + </tr> + </thead> + <tbody> + <t t-set="lines" t-value="o.line_ids" /> + <t t-foreach="lines" t-as="line"> + <t t-if="line.is_tax"> + <tr class=""> + <td> + <span + t-field="line.description" + t-options="{'widget': 'text'}" + /> + </td> + <td class="text-right"> + <span + class="text-nowrap" + t-field="line.quantity" + /> + </td> + <td class="text-right"> + <span + class="text-nowrap" + t-field="line.price_unit" + /><span> kWh</span> + </td> + <td class="text-right"> + <span + class="text-nowrap" + t-field="line.price_total" + /> + </td> + </tr> + + </t> + <t t-else="" /> + </t> + </tbody> + </table> + </div> + </div> </div> </t> <div t-attf-class="footer o_boxed_footer o_company_layout">