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
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -108,6 +108,12 @@ class AccAccount(models.Model):
readonly=True,
compute="_compute_amount",
)
amount_divers_tot = fields.Monetary(
string="Montant Total Divers HT",
store=True,
readonly=True,
compute="_compute_amount",
)
power_cons = fields.Float(
"Consommation locale (index Enedis)", digits="Unité de Mesure"
)
......@@ -185,14 +191,17 @@ class AccAccount(models.Model):
tot_qty = 0.0
tot_accise = 0.0
tot_elec = 0.0
tot_divers = 0.0
for line in move.line_ids:
total += line.price_total
tot_qty += line.quantity
if line.is_tax:
if line.is_tax and line.acc_injection_id:
tot_accise += line.price_total
else:
elif line.acc_injection_id:
tot_elec += line.price_total
else:
tot_divers += line.price_total
if move.is_tva and move.tax_id:
total_tax = (total * move.tax_id.amount) / 100
......@@ -202,6 +211,7 @@ class AccAccount(models.Model):
move.amount_total = total + total_tax
move.amount_accise_tot = tot_accise
move.amount_elec_tot = tot_elec
move.amount_divers_tot = tot_divers
def _compute_url(self):
"""
......
......@@ -202,7 +202,7 @@
alt="Logo"
/>
</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 class="col-8 text-center">
......@@ -387,6 +387,13 @@
>HT</span>
</td>
</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>
<td />
<td />
......@@ -395,6 +402,7 @@
<td />
<td />
</tr>
<t t-if="o.is_tva">
<tr>
<td><strong><h5
>Total H.T.</h5></strong></td>
......@@ -402,7 +410,6 @@
<h4 t-field="o.amount_untaxed" />
</td>
</tr>
<t t-if="o.is_tva">
<tr style="">
<t>
<td><span
......@@ -478,7 +485,7 @@
alt="Logo"
/>
</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 class="col-8"></div>
</div>
......@@ -669,7 +676,7 @@
alt="Logo"
/>
</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 class="col-8"></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