Skip to content
Extraits de code Groupes Projets
Valider 0cd13335 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[clean] pre-commit changes

parent c6043468
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -39,8 +39,11 @@ class ScopAccountMove(models.Model): ...@@ -39,8 +39,11 @@ class ScopAccountMove(models.Model):
if invoice.move_type == "out_invoice": if invoice.move_type == "out_invoice":
payment_ids = invoice.move_line_payment_ids payment_ids = invoice.move_line_payment_ids
refund_ids = payment_ids.mapped("move_id").filtered( refund_ids = payment_ids.mapped("move_id").filtered(
lambda r: r.move_type == "out_refund") lambda r: r.move_type == "out_refund"
invoice.amount_called = invoice.amount_total_signed + sum(refund_ids.mapped("amount_total_signed")) )
invoice.amount_called = invoice.amount_total_signed + sum(
refund_ids.mapped("amount_total_signed")
)
else: else:
invoice.amount_called = 0 invoice.amount_called = 0
......
...@@ -989,7 +989,9 @@ class Bordereau(models.Model): ...@@ -989,7 +989,9 @@ class Bordereau(models.Model):
# Variables cotisations UR # Variables cotisations UR
if partner_id.ur_id.id == ur_hdf: if partner_id.ur_id.id == ur_hdf:
amount_ur = liasse_fiscale_new_id.contribution_hdf if liasse_fiscale_new_id else 40 amount_ur = (
liasse_fiscale_new_id.contribution_hdf if liasse_fiscale_new_id else 40
)
product_ur = self.env.company.contribution_hdf_id product_ur = self.env.company.contribution_hdf_id
journal_ur = self.env.user.company_id.journal_ur_hdf_id journal_ur = self.env.user.company_id.journal_ur_hdf_id
else: # ur = ur_med else: # ur = ur_med
...@@ -1006,13 +1008,17 @@ class Bordereau(models.Model): ...@@ -1006,13 +1008,17 @@ class Bordereau(models.Model):
partner_id.property_account_receivable_id.id, partner_id.property_account_receivable_id.id,
], ],
self.env.ref("cgscop_partner.riga_14398").id: [ self.env.ref("cgscop_partner.riga_14398").id: [
liasse_fiscale_new_id.contribution_com if liasse_fiscale_new_id else 108, liasse_fiscale_new_id.contribution_com
if liasse_fiscale_new_id
else 108,
self.env.company.contribution_fede_com_id, self.env.company.contribution_fede_com_id,
self.env.user.company_id.journal_fede_com_id, self.env.user.company_id.journal_fede_com_id,
partner_id.property_account_receivable_id.id, partner_id.property_account_receivable_id.id,
], ],
self.env.ref("cgscop_partner.cotiz_fede_cae").id: [ self.env.ref("cgscop_partner.cotiz_fede_cae").id: [
liasse_fiscale_new_id.contribution_cae if liasse_fiscale_new_id else 300, liasse_fiscale_new_id.contribution_cae
if liasse_fiscale_new_id
else 300,
self.env.company.contribution_fede_cae_id, self.env.company.contribution_fede_cae_id,
self.env.user.company_id.journal_fede_cae_id, self.env.user.company_id.journal_fede_cae_id,
partner_id.property_account_receivable_id.id, partner_id.property_account_receivable_id.id,
...@@ -1206,12 +1212,17 @@ class Bordereau(models.Model): ...@@ -1206,12 +1212,17 @@ class Bordereau(models.Model):
Move = self.env["account.move"] Move = self.env["account.move"]
for bordereau in self: for bordereau in self:
payments = bordereau.invoice_ids.move_line_payment_ids.filtered( payments = bordereau.invoice_ids.move_line_payment_ids.filtered(
lambda r: r.move_id.move_type == "entry").sorted(lambda p: p.date) lambda r: r.move_id.move_type == "entry"
).sorted(lambda p: p.date)
schedule_plan = Move.read_group( schedule_plan = Move.read_group(
[ [
("bordereau_id", "=", bordereau.id), ("bordereau_id", "=", bordereau.id),
], ],
fields=["cotiz_quarter", "amount_total_signed", "amount_residual_signed"], fields=[
"cotiz_quarter",
"amount_total_signed",
"amount_residual_signed",
],
groupby=["cotiz_quarter"], groupby=["cotiz_quarter"],
orderby="cotiz_quarter", orderby="cotiz_quarter",
lazy=False, lazy=False,
...@@ -1226,8 +1237,9 @@ class Bordereau(models.Model): ...@@ -1226,8 +1237,9 @@ class Bordereau(models.Model):
i = int(contribution.get("cotiz_quarter")) - 1 i = int(contribution.get("cotiz_quarter")) - 1
contribution["date_maturity"] = schedule_date[i] contribution["date_maturity"] = schedule_date[i]
total_amount = sum(list(map( total_amount = sum(
lambda l: l.get("amount_total_signed"), schedule_plan))) list(map(lambda l: l.get("amount_total_signed"), schedule_plan))
)
total_residual = sum( total_residual = sum(
list(map(lambda l: l.get("amount_residual_signed"), schedule_plan)) list(map(lambda l: l.get("amount_residual_signed"), schedule_plan))
) )
......
...@@ -56,7 +56,10 @@ ...@@ -56,7 +56,10 @@
N° Bordereau : <span t-field="o.name" /><t N° Bordereau : <span t-field="o.name" /><t
t-if="o.is_regul" t-if="o.is_regul"
>-<span t-field="o.version" /></t><br /> >-<span t-field="o.version" /></t><br />
Le <t t-esc="datetime.date.today()" t-options="{'widget': 'date', 'format': 'dd MMMM YYYY'}" /> Le <t
t-esc="datetime.date.today()"
t-options="{'widget': 'date', 'format': 'dd MMMM YYYY'}"
/>
</p> </p>
</div> </div>
</div> </div>
...@@ -188,7 +191,10 @@ ...@@ -188,7 +191,10 @@
<div class="row oe_mt32"> <div class="row oe_mt32">
<!-- Rappel Echéancier --> <!-- Rappel Echéancier -->
<div class="col-6" style="border: 1px solid #aaa;"> <div class="col-6" style="border: 1px solid #aaa;">
<h5 class="oe_mt8" style="font-weight: 600;">Rappel Échéancier</h5> <h5
class="oe_mt8"
style="font-weight: 600;"
>Rappel Échéancier</h5>
<p id="schedule_table_with_payments"> <p id="schedule_table_with_payments">
<table <table
class="table table-sm table-striped" class="table table-sm table-striped"
...@@ -207,7 +213,8 @@ ...@@ -207,7 +213,8 @@
<td <td
style="border: none; background: inherit; color: inherit;" style="border: none; background: inherit; color: inherit;"
><t ><t
t-esc="line.get('date_maturity')" t-options="{'widget': 'date', 'format': 'dd/MM/YYYY'}" t-esc="line.get('date_maturity')"
t-options="{'widget': 'date', 'format': 'dd/MM/YYYY'}"
/></td> /></td>
<td <td
class="text-right" class="text-right"
...@@ -234,7 +241,10 @@ ...@@ -234,7 +241,10 @@
<!-- Détail des règlements --> <!-- Détail des règlements -->
<div class="col-6" style="border: 1px solid #aaa;"> <div class="col-6" style="border: 1px solid #aaa;">
<h5 class="oe_mt8" style="font-weight: 600;">Détail des règlements</h5> <h5
class="oe_mt8"
style="font-weight: 600;"
>Détail des règlements</h5>
<p id="schedule_table_with_payments"> <p id="schedule_table_with_payments">
<table <table
class="table table-sm table-striped" class="table table-sm table-striped"
...@@ -252,7 +262,8 @@ ...@@ -252,7 +262,8 @@
<td <td
style="border: none; background: inherit; color: inherit;" style="border: none; background: inherit; color: inherit;"
><t ><t
t-esc="payment.date" t-options="{'widget': 'date', 'format': 'dd/MM/YYYY'}" t-esc="payment.date"
t-options="{'widget': 'date', 'format': 'dd/MM/YYYY'}"
/></td> /></td>
<td <td
class="text-right" class="text-right"
......
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