Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
cgscop_cotisation_cg_exo
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
Confédération Générale des SCOP
cgscop_cotisation_cg_exo
Validations
ba19fb5f
Valider
ba19fb5f
rédigé
Il y a 2 ans
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[update] create_lines function for CAE
parent
d1741360
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
models/scop_cotisation_cg_exo.py
+14
-11
14 ajouts, 11 suppressions
models/scop_cotisation_cg_exo.py
avec
14 ajouts
et
11 suppressions
models/scop_cotisation_cg_exo.py
+
14
−
11
Voir le fichier @
ba19fb5f
...
@@ -265,6 +265,18 @@ class ScopCotisationExo(models.Model):
...
@@ -265,6 +265,18 @@ class ScopCotisationExo(models.Model):
def
create_lines
(
self
):
def
create_lines
(
self
):
self
.
exo_line_ids
.
unlink
()
self
.
exo_line_ids
.
unlink
()
# Get last bdx for prorate calculation
last_bdx
=
self
.
env
[
"
scop.bordereau
"
].
search
(
[
(
"
state
"
,
"
in
"
,
[
"
validated
"
,
"
paid
"
]),
(
"
partner_id
"
,
"
=
"
,
self
.
partner_id
.
id
),
],
order
=
"
date_cotisation desc
"
,
limit
=
1
,
)
if
last_bdx
:
contrib_type
=
last_bdx
.
mapped
(
"
invoice_ids.type_contribution_id
"
)
else
:
contrib_type
=
self
.
partner_id
.
get_partner_contribution_type
()
contrib_type
=
self
.
partner_id
.
get_partner_contribution_type
()
# if exo is percent => affects percent to each line
# if exo is percent => affects percent to each line
...
@@ -282,15 +294,6 @@ class ScopCotisationExo(models.Model):
...
@@ -282,15 +294,6 @@ class ScopCotisationExo(models.Model):
if
self
.
type_exo
==
"
amount
"
:
if
self
.
type_exo
==
"
amount
"
:
# if various contribution type => affects prorate amount to each line
# if various contribution type => affects prorate amount to each line
if
len
(
contrib_type
)
>
1
:
if
len
(
contrib_type
)
>
1
:
# Get last bdx for prorate calculation
last_bdx
=
self
.
env
[
"
scop.bordereau
"
].
search
(
[
(
"
state
"
,
"
in
"
,
[
"
validated
"
,
"
paid
"
]),
(
"
partner_id
"
,
"
=
"
,
self
.
partner_id
.
id
),
],
order
=
"
date_cotisation desc
"
,
limit
=
1
,
)
if
last_bdx
:
if
last_bdx
:
last_amount
=
last_bdx
.
amount_total_cotiz
last_amount
=
last_bdx
.
amount_total_cotiz
amount_by_type
=
last_bdx
.
get_contribution_type
()
amount_by_type
=
last_bdx
.
get_contribution_type
()
...
@@ -499,7 +502,7 @@ class ScopCotisationExo(models.Model):
...
@@ -499,7 +502,7 @@ class ScopCotisationExo(models.Model):
and
i
.
move_type
==
"
out_invoice
"
and
i
.
move_type
==
"
out_invoice
"
)[
0
].
invoice_date_due
)[
0
].
invoice_date_due
# Create refund
# Create refund
refund
=
bordereau_id
.
invoice_ids
.
create
(
bordereau_id
.
invoice_ids
.
create
(
{
{
"
partner_id
"
:
bordereau_id
.
partner_id
.
id
,
"
partner_id
"
:
bordereau_id
.
partner_id
.
id
,
"
liasse_fiscale_id
"
:
bordereau_id
.
liasse_fiscale_id
.
id
,
"
liasse_fiscale_id
"
:
bordereau_id
.
liasse_fiscale_id
.
id
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter