Skip to content
Extraits de code Groupes Projets
Valider d88abf86 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

[UPD]Update template invoice

parent a566a3fe
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -108,6 +108,12 @@ class AccAccount(models.Model): ...@@ -108,6 +108,12 @@ class AccAccount(models.Model):
readonly=True, readonly=True,
compute="_compute_amount", compute="_compute_amount",
) )
amount_divers_tot = fields.Monetary(
string="Montant Total Divers HT",
store=True,
readonly=True,
compute="_compute_amount",
)
power_cons = fields.Float( power_cons = fields.Float(
"Consommation locale (index Enedis)", digits="Unité de Mesure" "Consommation locale (index Enedis)", digits="Unité de Mesure"
) )
...@@ -185,14 +191,17 @@ class AccAccount(models.Model): ...@@ -185,14 +191,17 @@ class AccAccount(models.Model):
tot_qty = 0.0 tot_qty = 0.0
tot_accise = 0.0 tot_accise = 0.0
tot_elec = 0.0 tot_elec = 0.0
tot_divers = 0.0
for line in move.line_ids: for line in move.line_ids:
total += line.price_total total += line.price_total
tot_qty += line.quantity tot_qty += line.quantity
if line.is_tax: if line.is_tax and line.acc_injection_id:
tot_accise += line.price_total tot_accise += line.price_total
else: elif line.acc_injection_id:
tot_elec += line.price_total tot_elec += line.price_total
else:
tot_divers += line.price_total
if move.is_tva and move.tax_id: if move.is_tva and move.tax_id:
total_tax = (total * move.tax_id.amount) / 100 total_tax = (total * move.tax_id.amount) / 100
...@@ -202,6 +211,7 @@ class AccAccount(models.Model): ...@@ -202,6 +211,7 @@ class AccAccount(models.Model):
move.amount_total = total + total_tax move.amount_total = total + total_tax
move.amount_accise_tot = tot_accise move.amount_accise_tot = tot_accise
move.amount_elec_tot = tot_elec move.amount_elec_tot = tot_elec
move.amount_divers_tot = tot_divers
def _compute_url(self): def _compute_url(self):
""" """
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
alt="Logo" alt="Logo"
/> />
</t> </t>
<t t-else=""><h4 t-esc="o.producer_id.name" /></t> <t t-else=""><h4 t-field="o.producer_id.name" /></t>
</div> </div>
<div class="col-8 text-center"> <div class="col-8 text-center">
...@@ -387,6 +387,13 @@ ...@@ -387,6 +387,13 @@
>HT</span> >HT</span>
</td> </td>
</tr> </tr>
<tr>
<td>Total Frais Divers / Régularisation</td>
<td class="text-right">
<span t-field="o.amount_divers_tot" /> <span
>HT</span>
</td>
</tr>
<tr> <tr>
<td /> <td />
<td /> <td />
...@@ -395,6 +402,7 @@ ...@@ -395,6 +402,7 @@
<td /> <td />
<td /> <td />
</tr> </tr>
<t t-if="o.is_tva">
<tr> <tr>
<td><strong><h5 <td><strong><h5
>Total H.T.</h5></strong></td> >Total H.T.</h5></strong></td>
...@@ -402,7 +410,6 @@ ...@@ -402,7 +410,6 @@
<h4 t-field="o.amount_untaxed" /> <h4 t-field="o.amount_untaxed" />
</td> </td>
</tr> </tr>
<t t-if="o.is_tva">
<tr style=""> <tr style="">
<t> <t>
<td><span <td><span
...@@ -478,7 +485,7 @@ ...@@ -478,7 +485,7 @@
alt="Logo" alt="Logo"
/> />
</t> </t>
<t t-else=""><h4 t-esc="o.producer_id.name" /></t> <t t-else=""><h4 t-field="o.producer_id.name" /></t>
</div> </div>
<div class="col-8"></div> <div class="col-8"></div>
</div> </div>
...@@ -669,7 +676,7 @@ ...@@ -669,7 +676,7 @@
alt="Logo" alt="Logo"
/> />
</t> </t>
<t t-else=""><h4 t-esc="o.producer_id.name" /></t> <t t-else=""><h4 t-field="o.producer_id.name" /></t>
</div> </div>
<div class="col-8"></div> <div class="col-8"></div>
</div> </div>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter