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

[UPD]Update creation tax tcfe

parent 8ddf17a0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -14,5 +14,10 @@
<field name="digits">2</field>
</record>
<record id="first_tcfe" model="acc.account.tax.tcfe">
<field name="price">0.025</field>
<field name="start_date">1901-01-01</field>
</record>
</data>
</odoo>
......@@ -254,23 +254,10 @@ class AccAccountTaxTcfe(models.Model):
@api.model_create_multi
def create(self, vals_list):
new_vals = []
for vals in vals_list:
if "start_date" in vals:
start_date = fields.Date.to_date(vals["start_date"])
# If date start period doesn't exist
price_ids = self.env["acc.account.tax.tcfe"].search([])
# Creation d'une nouvelle période date anniversaire à date renseignée - 1 jour
if not price_ids:
val_new = {
"price": vals["price"],
"start_date": "01/01/2000",
"end_date": start_date - relativedelta(days=1),
}
new_vals.append(val_new)
# Si une période existe après la date renseignée
price_ids = self.env["acc.account.tax.tcfe"].search(
[
......@@ -290,6 +277,5 @@ class AccAccountTaxTcfe(models.Model):
)
if price_id:
price_id.end_date = start_date - relativedelta(days=1)
vals_list += new_vals
res = super(AccAccountTaxTcfe, self).create(vals_list)
return res
......@@ -364,15 +364,16 @@
</td>
</tr>
<tr>
<td></td>
<td></td>
<td />
<td />
</tr>
<tr>
<td></td>
<td></td>
<td />
<td />
</tr>
<tr>
<td><strong><h5>Total H.T.</h5></strong></td>
<td><strong><h5
>Total H.T.</h5></strong></td>
<td class="text-right">
<h4 t-field="o.amount_untaxed" />
</td>
......@@ -396,7 +397,8 @@
</tr>
</t>
<tr>
<td><strong><h4>Total TTC*</h4></strong></td>
<td><strong><h4
>Total TTC*</h4></strong></td>
<td class="text-right">
<strong><h3
class="text-nowrap"
......@@ -409,9 +411,9 @@
<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>
et à la taxe sur la consommation finale d’électricité. La contribution
d’acheminement (“TURPE”) est collectée par
le fournisseur du complément d’électricité</p>
</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