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

[UPD]Change pdf template

parent 0c60df0e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
"views/menu_views.xml", "views/menu_views.xml",
"report/report_template.xml", "report/report_template.xml",
"report/account_template.xml", "report/account_template.xml",
"report/account_template_old.xml",
"report/account_report.xml", "report/account_report.xml",
], ],
"qweb": [ "qweb": [
......
...@@ -147,6 +147,16 @@ class AccAccount(models.Model): ...@@ -147,6 +147,16 @@ class AccAccount(models.Model):
"acc.account.payment", "acc.account.payment",
string="Méthodes de paiement") string="Méthodes de paiement")
free_text = fields.Text("Texte libre à afficher sur les factures") free_text = fields.Text("Texte libre à afficher sur les factures")
# OLD DATA
amount_tcfe = fields.Monetary(
string="Montant ACCISE", store=True, readonly=True, compute="_compute_amount"
)
amount_without_tcfe = fields.Monetary(
string="Montant hors ACCISE",
store=True,
readonly=True,
compute="_compute_amount",
)
@api.model_create_multi @api.model_create_multi
def create(self, vals_list): def create(self, vals_list):
...@@ -210,10 +220,21 @@ class AccAccount(models.Model): ...@@ -210,10 +220,21 @@ class AccAccount(models.Model):
tot_accise = 0.0 tot_accise = 0.0
tot_elec = 0.0 tot_elec = 0.0
tot_divers = 0.0 tot_divers = 0.0
# old data
tot_tcfe = 0.0
tot_tcfe_off = 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
# Begin OLD DATA
if line.is_tax:
tot_tcfe += line.price_total
else:
tot_tcfe_off += line.price_total
# End OLD DATA
if line.is_tax and line.acc_injection_id: if line.is_tax and line.acc_injection_id:
tot_accise += line.price_total tot_accise += line.price_total
elif line.acc_injection_id: elif line.acc_injection_id:
...@@ -230,6 +251,8 @@ class AccAccount(models.Model): ...@@ -230,6 +251,8 @@ class AccAccount(models.Model):
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 move.amount_divers_tot = tot_divers
move.amount_tcfe = tot_tcfe
move.amount_without_tcfe = tot_tcfe_off
def _compute_url(self): def _compute_url(self):
""" """
......
...@@ -37,7 +37,7 @@ class AccAccountPayment(models.Model): ...@@ -37,7 +37,7 @@ class AccAccountPayment(models.Model):
def _onchange_name_type(self): def _onchange_name_type(self):
self.name = self.name_type self.name = self.name_type
if self.name_type == "cheque": if self.name_type == "cheque":
self.description = "Merci d’indiquer au dos du chèque la référence facture ci-dessus" self.description = "Merci d’indiquer au dos du chèque la référence facture ci-dessus."
if self.name_type == "virement": if self.name_type == "virement":
self.description = "Merci d’indiquer la référence facture ci-dessus sur votre ordre de virement.\nIBAN: ...\nCode BIC: ..." self.description = "Merci d’indiquer la référence facture ci-dessus sur votre ordre de virement.\nIBAN: ...\nCode BIC: ..."
# ------------------------------------------------------ # ------------------------------------------------------
......
...@@ -32,5 +32,18 @@ ...@@ -32,5 +32,18 @@
<field name="paperformat_id" ref="acc_account.paperformat_spe" /> <field name="paperformat_id" ref="acc_account.paperformat_spe" />
</record> </record>
<record id="acc_account_invoices_old" model="ir.actions.report">
<field name="name">Factures OLD</field>
<field name="model">acc.account</field>
<field name="report_type">qweb-pdf</field>
<!-- <field name="report_type">qweb-html</field>-->
<field name="report_name">acc_account.report_account_old</field>
<field name="report_file">account.report_account_old</field>
<field name="print_report_name">'Facture - %s' % (object.name)</field>
<field name="binding_model_id" ref="model_acc_account" />
<field name="binding_type">report</field>
<field name="paperformat_id" ref="acc_account.paperformat_spe" />
</record>
</data> </data>
</odoo> </odoo>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
<span t-field="o.acc_operation_id.description" /><br /> <span t-field="o.acc_operation_id.description" /><br />
<span <span
class="font-weight-bold" class="font-weight-bold"
>Numéro ACC (²)</span><br /> >Numéro ACC⁽²⁾</span><br />
<span t-field="o.acc_operation_id.name" /><br /> <span t-field="o.acc_operation_id.name" /><br />
<span <span
class="font-weight-bold" class="font-weight-bold"
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Total Frais Divers / Régularisation</td> <td>Total Frais Divers</td>
<td class="text-right"> <td class="text-right">
<span t-field="o.amount_divers_tot" /> <span <span t-field="o.amount_divers_tot" /> <span
>HT</span> >HT</span>
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
</t> </t>
<tr> <tr>
<td><strong><h5 <td><strong><h5
>Total TTC (¹)</h5></strong></td> >Total TTC⁽¹⁾</h5></strong></td>
<td class="text-right"> <td class="text-right">
<strong><h4 <strong><h4
class="text-nowrap" class="text-nowrap"
...@@ -456,11 +456,11 @@ ...@@ -456,11 +456,11 @@
</div> </div>
<div class="row mt-2"> <div class="row mt-2">
<div class="col-12"> <div class="col-12">
<h5 >Délai de règlement : à facturation</h5> <h6 >Délai de règlement : à facturation</h6>
<h5 class="mb-5">Date limite de règlement : <span <h6 class="mb-5">Date limite de règlement : <span
t-field="o.date_limit" t-field="o.date_limit"
t-options="{'format': 'dd/MM/yyyy'}" t-options="{'format': 'dd/MM/yyyy'}"
/></h5> /></h6>
</div> </div>
</div> </div>
</t> </t>
...@@ -472,7 +472,7 @@ ...@@ -472,7 +472,7 @@
<div class="row mt-3"> <div class="row mt-3">
<div class="col-12 font-italic font-mini"> <div class="col-12 font-italic font-mini">
<p class="mt-5"> <p class="mt-5">
(¹) Le total à payer correspond à l’électricité autoconsommée et à l'ACCISE - (²) ACC : Auto-Consommation Collective ⁽¹⁾Le total à payer correspond à l’électricité autoconsommée et à l'ACCISE - ⁽²⁾ACC : Auto-Consommation Collective
</p> </p>
<span t-if="o.invoice_terms" t-field="o.invoice_terms"/> <span t-if="o.invoice_terms" t-field="o.invoice_terms"/>
</div> </div>
...@@ -501,7 +501,7 @@ ...@@ -501,7 +501,7 @@
>Autoconsommation Collective <t >Autoconsommation Collective <t
t-esc="o.acc_operation_id.name" t-esc="o.acc_operation_id.name"
/></span><br /> /></span><br />
<h5>PRM-I : <span class="font-weight-bold " t-field="injection.name"/></h5> <h5 class="font-weight-bold ">PRM-I : <span class="font-weight-bold " t-field="injection.name"/></h5>
</div> </div>
</div> </div>
<div class="row mt-5 "> <div class="row mt-5 ">
...@@ -709,7 +709,7 @@ ...@@ -709,7 +709,7 @@
<div class="row mt-5 "> <div class="row mt-5 ">
<div class="col-12"> <div class="col-12">
<!-- Table les lignes spécifiques --> <!-- Table les lignes spécifiques -->
<h6>Frais divers / Régularisation</h6> <h6>Frais divers</h6>
<table <table
class="table table-sm o_main_table" class="table table-sm o_main_table"
name="account_line_table" name="account_line_table"
......
Ce diff est replié.
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