diff --git a/models/acc_account.py b/models/acc_account.py index 2c7b7d04dc172da63fd17c6ce09b8e93c04fd70c..0c9e15b08914b534ca40e11dc2c7751f2c6614a9 100644 --- a/models/acc_account.py +++ b/models/acc_account.py @@ -59,6 +59,7 @@ class AccAccount(models.Model): string="Producteur", domain=[("is_producer", "=", True)], ) + is_collectivite = fields.Boolean("Est une collectivité") is_tva = fields.Boolean("Assujetti à la TVA") tax_id = fields.Many2one("acc.account.tax", string="Taxe") acc_delivery_id = fields.Many2one( @@ -219,9 +220,11 @@ class AccAccount(models.Model): if self.producer_id: self.is_tva = self.producer_id.is_tva self.tax_id = self.producer_id.tax_id + self.is_collectivite = self.producer_id.is_collectivite else: self.is_tva = False - self.tax_id = False\ + self.tax_id = False + self.is_collectivite = False @api.onchange("is_tva") def _onchange_is_tva(self): @@ -305,7 +308,7 @@ class AccAccountLine(models.Model): ("other", "Autres") ], string="Type") - @api.depends("quantity", "price_unit") + @api.depends("quantity", "price_unit", "tax_id", "tax_id.amount") def _compute_amount(self): """ Fonction pour calculer le montant total diff --git a/models/acc_operation.py b/models/acc_operation.py index 7f55e01904e6f77c128846633a2d55d02b9e6826..5f4dd258edc0a67c2ab6d4a2bf18234d6936a9f5 100644 --- a/models/acc_operation.py +++ b/models/acc_operation.py @@ -454,10 +454,10 @@ class AccOperation(models.Model): "acc_injection_id": acc_injection_id.id, "start_date": date_interval_start, "end_date": date_interval_end, - "description": "Période du " - + str(date_interval_start) + "description": "Du " + + date_interval_start.strftime("%d/%m/%Y") + " au " - + str(date_interval_end), + + date_interval_end.strftime("%d/%m/%Y"), } ) account_list.append(acc_account_id) diff --git a/report/account_template.xml b/report/account_template.xml index 54f25abe3b292396c08347899f9722ce3b496847..fdb47e46563d44b2db2aa389dbddf1b61b6acc2f 100644 --- a/report/account_template.xml +++ b/report/account_template.xml @@ -201,13 +201,14 @@ style="max-height: 80px;" alt="Logo" /> + <h2 t-else="o.producer_id"/> </div> <div class="col-9 text-center"> <p class="font-weight-bold"> <span - class="text-uppercase text-uppercase mt0 " - >Autoconsommation Collective <t + class="text-uppercase mt0 " + >Autoconsommation Collective Numéro <t t-esc="o.acc_operation_id.name" /></span><br /> <span @@ -218,14 +219,14 @@ t-options="{'format': 'dd/MM/yyyy'}" /></span> </p> - <p>Adressé par voie électronique<br/> + <p>Adressée par voie électronique<br/> Facture de consommation</p> </div> </div> - <div class="row mt32 mb32"> + <div class="row mt32 mb-5"> <div class="col-4 grey-div "> - <h5 class="font-weight-bold">Vos références utiles</h5> + <h5 class="font-weight-bold mb-4 text-center">Vos références utiles</h5> <p> <span class="font-weight-bold" @@ -246,11 +247,11 @@ >N°TVA:</span><br /> <span t-field="o.consumer_id.vat" /> </t> - </p><br/> + </p> <p> <span class="font-weight-bold" - >Point référence Mesures (PRM-C):</span><br + >Point Référence Mesures (PRM-C):</span><br /> <span t-field="o.acc_delivery_id.name" /><br /> <span @@ -287,7 +288,7 @@ <span t-field="o.acc_operation_id.name" /><br /> <span class="font-weight-bold" - >Références points d'injection (PRM-I)</span><br /> + >Références Points d'Injection (PRM-I)</span><br /> <t t-foreach="o.acc_operation_id.acc_injection_ids" t-as="inj"> <span t-field="inj.name" /><br /> </t> @@ -299,7 +300,7 @@ </t> </p> <hr /> - <h5 class="mt32 font-weight-bold">Pour répondre à vos questions</h5> + <h6 class="mt32 font-weight-bold">Pour répondre à vos questions</h6> <p class="mb-4"> <span class="font-weight-bold" @@ -321,7 +322,6 @@ </t> </p> <p class="text-center font-italic mt-4"> - (1) Le total à payer correspond à l’électricité autoconsommée et à l'ACCISE. La contribution d’acheminement ("TURPE") est collectée par le fournisseur du complément d’électricité<br/> (2) ACC : Auto-Consommation Collective </p> </div> @@ -347,8 +347,8 @@ </div> <div class="o_recap_table mt-4"> <div class="text-center mb-4"> - <h3>Synthèse de votre facture</h3> - <p class="font-italic">Détails en page 2</p> + <h3 class="text-uppercase">Synthèse de votre facture</h3> + <p class="font-italic">Détails en pages suivantes</p> <h4>Période de livraison concernée : <br/> du <span t-field="o.start_date" @@ -370,7 +370,7 @@ <span class="text-nowrap" t-field="o.power_cons" - />kWh + /> kWh </td> </tr> <tr> @@ -447,13 +447,14 @@ </div> <div class="row mt-5"> <div class="col-12"> - <h5>Délai de règlement: à facturation</h5> - <h5 class="mb-5">Date limite de règlement: <span + <h5 t-if="not o.is_collectivite">Délai de règlement : à facturation</h5> + <h5 t-if="not o.is_collectivite" class="mb-5">Date limite de règlement : <span t-field="o.date_limit" t-options="{'format': 'dd/MM/yyyy'}" /></h5> <p class="text-center font-italic mt-5" - >En cas de paiement anticipé, aucun escompte ne sera accordé. Indemnités pour frais de recouvrement en cas de retard de paiement : 40.00€ sauf frais supplémentaires. Conformément à l’article L 441-6 du Code de commerce, en cas de non paiement à l'échéance, sera appliquée une pénalité de retard équivalente à trois fois le taux d'intérêt légal en vigueur.</p> + >(1) Le total à payer correspond à l’électricité autoconsommée et à l'ACCISE. La contribution d’acheminement ("TURPE") est collectée par le fournisseur du complément d’électricité + </p> </div> </div> </t> @@ -462,7 +463,11 @@ </div> </div> - + <div class="row mt-5"> + <div class="col-12 font-italic"> + En cas de paiement anticipé, aucun escompte ne sera accordé. Indemnités pour frais de recouvrement en cas de retard de paiement : 40.00€ sauf frais supplémentaires. Conformément à l’article L 441-6 du Code de commerce, en cas de non paiement à l'échéance, sera appliquée une pénalité de retard équivalente à trois fois le taux d'intérêt légal en vigueur. + </div> + </div> <t t-set="prmi_ids" t-value="o.line_ids.mapped('acc_injection_id')"/> <t t-foreach="prmi_ids" t-as="injection"> <div class="row" style="page-break-before:always;"> @@ -479,10 +484,10 @@ <div class="row mt-4 "> <div class="col-12"> - <div class="text-center text-uppercase"> + <div class="text-center text-uppercase mb-4"> <h4>Votre facture en détail</h4> <span - class="text-uppercase mt0 " + class="text-uppercase mb-4 " >Autoconsommation Collective <t t-esc="o.acc_operation_id.name" /></span><br /> @@ -492,7 +497,7 @@ <h6 class="mt-4"> <span class="text-uppercase mt0 " - >Electricité locale - PRM-I : <t + >Electricité locale - PRM-I : </span><span class="font-weight-bold"><t t-esc="injection.name" /></span></h6> <table @@ -502,13 +507,13 @@ <thead> <tr> <th>Période</th> - <th>Quantité</th> - <th>Prix unitaire</th> + <th class="text-center">Quantité consommée</th> + <th class="text-center">Prix unitaire</th> <t t-if="o.is_tva"> - <th>Total HT</th> - <th>TVA</th> + <th class="text-center">Total HT</th> + <th class="text-center">TVA</th> </t> - <th>Total TTC</th> + <th class="text-center">Total TTC</th> </tr> </thead> <tbody> @@ -523,33 +528,33 @@ t-options="{'widget': 'text'}" /> </td> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.quantity" /><span> kWh</span> </td> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.price_unit" /><span> €/kWh</span> </td> <t t-if="o.is_tva"> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.price_total" /> </td> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.tax_id.name" /> </td> </t> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.price_total_ttc" @@ -560,7 +565,7 @@ </tbody> </table> <h6 class="is-subtotal text-right"> - <strong class="mr-4">MONTANT TOTAL: </strong> + <strong class="mr-4">MONTANT TOTAL : </strong> <span class="ml-4" t-esc="current_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}' @@ -571,7 +576,7 @@ <h6 class="mt-4"> <span class="text-uppercase mt0 " - >ACCISE* - PRM-I : <t + >ACCISE* - PRM-I : </span><span class="font-weight-bold"><t t-esc="injection.name" /></span><br /></h6> <table @@ -581,13 +586,13 @@ <thead> <tr> <th>Période</th> - <th>Quantité</th> - <th>Prix unitaire</th> + <th class="text-center">Quantité consommée</th> + <th class="text-center">Prix unitaire</th> <t t-if="o.is_tva"> - <th>Total HT</th> - <th>TVA</th> + <th class="text-center">Total HT</th> + <th class="text-center">TVA</th> </t> - <th>Total TTC</th> + <th class="text-center">Total TTC</th> </tr> </thead> <tbody> @@ -603,33 +608,33 @@ t-options="{'widget': 'text'}" /> </td> - <td class="text-right"> + <td class="text-center"> <span class="text-nowrap" t-field="line.quantity" /><span> kWh</span> </td> - <td class="text-right"> + <td class="text-center"> <span class="text-nowrap" t-field="line.price_unit" /><span> €/kWh</span> </td> <t t-if="o.is_tva"> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.price_total" /> </td> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.tax_id.name" /> </td> </t> - <td> + <td class="text-center"> <span class="text-nowrap" t-field="line.price_total_ttc" @@ -643,7 +648,7 @@ </tbody> </table> <h6 class="is-subtotal text-right mb-5"> - <strong class="mr-4">MONTANT TOTAL: </strong> + <strong class="mr-4">MONTANT TOTAL : </strong> <span class="ml-4" t-esc="current_subtotal" t-options='{"widget": "monetary", "display_currency": o.currency_id}' diff --git a/views/acc_account_views.xml b/views/acc_account_views.xml index eaec390147d8e3584768fa687df1d4605d769a6c..264a5316f2601d00484f4df07facf7ad3bbca89f 100644 --- a/views/acc_account_views.xml +++ b/views/acc_account_views.xml @@ -247,6 +247,9 @@ name="producer_id" options='{"always_reload": True, "no_quick_create": True}' /> + <field + name="is_collectivite" widget="boolean_toggle" + /> <field name="acc_delivery_id" options='{"always_reload": True, "no_quick_create": True}'