Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
cgscop_tantiemo
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_tantiemo
Validations
3d4a949c
Valider
3d4a949c
rédigé
17 nov. 2021
par
Benjamin - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[update] null values treatment
parent
ba97caf2
Branches
Branches contenant la validation
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é
controllers/main.py
+26
-24
26 ajouts, 24 suppressions
controllers/main.py
avec
26 ajouts
et
24 suppressions
controllers/main.py
+
26
−
24
Voir le fichier @
3d4a949c
...
...
@@ -27,11 +27,11 @@ class ApiTantiemo(http.Controller):
FROM (
SELECT
name AS
"
scopName
"
,
(SELECT name from res_partner_company_type WHERE id = partner.partner_company_type_id) AS
"
scopSocialForm
"
,
COALESCE(
(SELECT name from res_partner_company_type WHERE id = partner.partner_company_type_id)
,
''
)
AS
"
scopSocialForm
"
,
member_number_int AS
"
scopAdherentId
"
,
id AS
"
scopOdooId
"
,
(
SELECT row_to_json(status)
SELECT
json_strip_nulls(
row_to_json(status)
)
FROM (
SELECT
CASE membership_status
...
...
@@ -109,19 +109,19 @@ class ApiTantiemo(http.Controller):
registration_date AS
"
activityImmatRCS
"
,
COALESCE(social_object,
''
) AS
"
activityName
"
,
COALESCE((SELECT name from res_partner_naf WHERE id = partner.naf_id),
''
) AS
"
activityNAF
"
,
(
COALESCE(
(
SELECT array_agg(list.name) FROM res_partner_res_partner_certification_rel as rel
LEFT JOIN res_partner_certification AS list ON list.id = rel.res_partner_certification_id
WHERE rel.res_partner_id = partner.id
) as
"
activityAgreement
"
,
)
,
'
{}
'
)
as
"
activityAgreement
"
,
siret AS
"
activitySIRET
"
,
SUBSTRING(siret, 1, 11) AS
"
activitySIREN
"
,
capital AS
"
activityCapital
"
,
COALESCE(
capital
, 0)
AS
"
activityCapital
"
,
first_closeout as
"
activityReportDate
"
,
closeout_month - 12841 AS
"
activityExoMonth
"
,
is_seed_scop AS
"
activityInitiation
"
,
is_incubated AS
"
activityIncubation
"
,
staff_last AS
"
activityWorkforce
"
,
COALESCE(
staff_last
, 0)
AS
"
activityWorkforce
"
,
staff_last_date AS
"
activityWorkfoceDate
"
FROM
res_partner
...
...
@@ -129,7 +129,7 @@ class ApiTantiemo(http.Controller):
id = partner.id
) activity
) as
"
scopActivity
"
,
(
COALESCE(
(
SELECT array_to_json(array_agg(row_to_json(staff)))
FROM (
SELECT
...
...
@@ -151,8 +151,8 @@ class ApiTantiemo(http.Controller):
WHERE
partner_id = partner.id
) staff
) as
"
scopStaffHistory
"
,
(
)
,
'
[]
'
::JSON)
as
"
scopStaffHistory
"
,
COALESCE(
(
SELECT array_to_json(array_agg(row_to_json(c)))
FROM (
SELECT
...
...
@@ -162,11 +162,11 @@ class ApiTantiemo(http.Controller):
COALESCE(email,
''
) as
"
executiveEmail
"
,
COALESCE(phone,
''
) as
"
executivePhone
"
,
COALESCE(mobile,
''
) as
"
executiveMobile
"
,
(
COALESCE(
(
SELECT array_agg(list.name) FROM res_partner_res_partner_category_rel as rel
LEFT JOIN res_partner_category AS list ON list.id = rel.category_id
WHERE rel.partner_id = contact.id
) as
"
executiveLabels
"
,
)
,
'
{}
'
)
as
"
executiveLabels
"
,
COALESCE((SELECT name from res_partner_mandate WHERE id = contact.mandate_id),
''
) AS
"
executivePosition
"
,
COALESCE((SELECT name from res_partner_function_lst WHERE id = contact.function_lst_id),
''
) AS
"
executivePost
"
,
COALESCE(function,
''
) as
"
executiveRoles
"
,
...
...
@@ -180,7 +180,7 @@ class ApiTantiemo(http.Controller):
birthYear as
"
executiveBirthYear
"
,
COALESCE((SELECT name from res_partner_rgpd_origin WHERE id = contact.contact_origin_id),
''
) AS
"
executiveContactOrigin
"
,
COALESCE((SELECT name from res_users WHERE id = contact.followup_delegate_id),
''
) AS
"
executiveDelegate
"
,
(SELECT name from union_regionale WHERE id = contact.ur_id) AS
"
executiveUR
"
COALESCE(
(SELECT name from union_regionale WHERE id = contact.ur_id)
,
''
)
AS
"
executiveUR
"
FROM
res_partner as contact
WHERE
...
...
@@ -188,23 +188,23 @@ class ApiTantiemo(http.Controller):
type =
'
contact
'
AND
mandate_id is not null
) c
) as
"
scopExecutives
"
,
)
,
'
[]
'
::JSON)
as
"
scopExecutives
"
,
(
COALESCE(
(
SELECT array_to_json(array_agg(row_to_json(liasse)))
FROM (
SELECT
year
as
"
reportYear
"
,
"
L2052_FL
"
as
"
reportTurnover
"
,
"
L2052_GG
"
as
"
reportOperating
"
,
"
L2053_HN
"
as
"
reportNetIncome
"
,
"
daim
"
as
"
reportDepreciationCharge
"
,
"
L2051_DL
"
as
"
reportOwnFunds
"
,
COALESCE(year, 0)
as
"
reportYear
"
,
COALESCE(
"
L2052_FL
"
, 0)
as
"
reportTurnover
"
,
COALESCE(
"
L2052_GG
"
, 0)
as
"
reportOperating
"
,
COALESCE(
"
L2053_HN
"
, 0)
as
"
reportNetIncome
"
,
COALESCE(
"
daim
"
, 0)
as
"
reportDepreciationCharge
"
,
COALESCE(
"
L2051_DL
"
, 0)
as
"
reportOwnFunds
"
,
-- reportIndebted :: Scientific -- ENDETTEMENT
-- reportNetPosition :: Scientific -- SITUATION NET
0 as reportIndebted,
0 as reportNetPosition,
"
L2050_GJ
"
as
"
reportFinalBalance
"
,
0 as
"
reportIndebted
"
,
0 as
"
reportNetPosition
"
,
COALESCE(
"
L2050_GJ
"
, 0)
as
"
reportFinalBalance
"
,
(
SELECT row_to_json(exo)
FROM (
...
...
@@ -212,6 +212,8 @@ class ApiTantiemo(http.Controller):
"
L2050_DCLO
"
as
"
exoEnd
"
,
"
dureeExercice
"
as
"
exoDuration
"
WHERE
"
L2050_DCLO
"
IS NOT NULL AND
"
dureeExercice
"
> 0 AND
id = liasse.id
) exo
) as
"
reportExo
"
,
...
...
@@ -238,7 +240,7 @@ class ApiTantiemo(http.Controller):
revenue_cg > 0
ORDER BY year DESC
) liasse
) as
"
scopReports
"
)
,
'
[]
'
::JSON)
as
"
scopReports
"
FROM
res_partner as partner
INNER JOIN (
...
...
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