From 2fef43be04eb182c1bf8f2a8884069724d9a0aa8 Mon Sep 17 00:00:00 2001
From: benjamin <benjamin@le-filament.com>
Date: Mon, 6 Feb 2023 11:42:23 +0100
Subject: [PATCH] [update] simul : change column label + CAE calculation

---
 models/scop_cotisation_cg.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/models/scop_cotisation_cg.py b/models/scop_cotisation_cg.py
index 4c72fd3..27632d9 100644
--- a/models/scop_cotisation_cg.py
+++ b/models/scop_cotisation_cg.py
@@ -503,7 +503,7 @@ class ScopCotisation(models.Model):
             "Année Liasse",
             "Durée Exercice",
             "CA (L2052 FL)",
-            "CA sens CG Scop",
+            "CA + Subvention",
             "VA",
             "VABDF sens CG Scop",
             "Masse Salariale (L2052 FY)",
@@ -668,8 +668,13 @@ class ScopCotisation(models.Model):
                 #       périodes par la CG
                 if m.cae:
                     datas_contrib_cae = datas_contrib.copy()
-                    contrib_fede_cae = 100
-                    # Calcul cotisation N-1
+                    if liasse:
+                        contrib_fede_cae = self.round_to_closest_multiple(
+                            liasse.contribution_cae, 4
+                        )
+                    else:
+                        contrib_fede_cae = 300
+                        # Calcul cotisation N-1
                     contribution_last_year = sum(
                         line_ids.filtered(
                             lambda l: l.product_id == product_cae_id
-- 
GitLab