Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
L
lefilament_tdb
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
lefilament_tdb
Validations
c25c6fec
Valider
c25c6fec
rédigé
Il y a 1 mois
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[FIX] compute analaytic lines
parent
c303ee31
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/lefilament_tdb.py
+16
-41
16 ajouts, 41 suppressions
models/lefilament_tdb.py
avec
16 ajouts
et
41 suppressions
models/lefilament_tdb.py
+
16
−
41
Voir le fichier @
c25c6fec
...
...
@@ -181,13 +181,12 @@ class LeFilamentTdb(models.Model):
select
customer as
"
Client
"
,
sum(prod) as
"
Imput.
"
,
sum(invoiced +
purchase +
expense)::int as
"
Balance Prod
"
,
sum(invoiced +
purchase +
expense)/NULLIF(sum(prod), 0) as
"
Taux Horaire
"
,
sum(invoiced + expense)::int as
"
Balance Prod
"
,
sum(invoiced + expense)/NULLIF(sum(prod), 0) as
"
Taux Horaire
"
,
sum(invoiced + invoiced_mco) as
"
Tot. Fact.
"
,
sum(invoiced)::int as
"
Fact. Prod
"
,
sum(invoiced_mco)::int as
"
Fact. Maint
"
,
sum(purchase)::int as
"
Achats
"
,
sum(expense)::int as
"
NdF
"
sum(expense)::int as
"
Achats / NdF
"
from
(
-- Sélection des heures
...
...
@@ -196,11 +195,11 @@ class LeFilamentTdb(models.Model):
p.name as customer,
-- contact != Filament et projet != Maintenance et pas flagué vacances
case when aal.partner_id != 1 or aal.partner_id is null
and aal.holiday_id is null and project_id != 19
and aal.holiday_id is null and aal.global_leave_id is null
and project_id != 19
then unit_amount else 0 end as prod,
0 as invoiced,
0 as invoiced_mco,
0 as purchase,
0 as expense
from
account_analytic_line aal
...
...
@@ -214,7 +213,7 @@ class LeFilamentTdb(models.Model):
aal.project_id is not null
and aal.date <= CURRENT_DATE
and (lt.active is true or lt.active is null)
and partner_id != 1
and
aal.
partner_id != 1
-- Sélection du facturé hors maintenance
union all
...
...
@@ -224,7 +223,6 @@ class LeFilamentTdb(models.Model):
0 as prod,
(aml.credit - aml.debit) as invoiced,
0 as invoiced_mco,
0 as purchase,
0 as expense
from account_move_line aml
left join account_move i on aml.move_id = i.id
...
...
@@ -243,7 +241,6 @@ class LeFilamentTdb(models.Model):
0 as prod,
0 as invoiced,
(aml.credit - aml.debit) as invoiced_mco,
0 as purchase,
0 as expense
from account_move_line aml
left join account_move i on aml.move_id = i.id
...
...
@@ -262,37 +259,14 @@ class LeFilamentTdb(models.Model):
0 as prod,
0 as invoiced,
0 as invoiced_mco,
amount as purchase,
0 as expense
from account_analytic_line aal
left join account_move_line aml on aal.move_line_id = aml.id
left join account_move i on aml.move_id = i.id
left join account_analytic_account a on aal.account_id = a.id
left join res_partner p on a.partner_id = p.id
where
(a.plan_id is null or a.plan_id = 1)
and i.state =
'
posted
'
and aml.journal_id = 2
-- Sélection des NDF
union all
select
aal.date as line_date,
p.name as customer,
0 as prod,
0 as invoiced,
0 as invoiced_mco,
0 as purchase,
amount as expense
from account_analytic_line aal
left join account_move_line aml on aal.move_line_id = aml.id
left join account_move i on aml.move_id = i.id
left join account_analytic_account a on aal.account_id = a.id
left join res_partner p on a.partner_id = p.id
where
(a.plan_id is null or a.plan_id = 1)
and
i.state =
'
posted
'
and a
ml.journal_id = 9
aal.account_id is not null and aal.project_id is null
and
aal.category in (
'
vendor_bill
'
,
'
other
'
)
and a
.partner_id is not null
) query
%s
group by
...
...
@@ -326,13 +300,11 @@ class LeFilamentTdb(models.Model):
from
account_analytic_line aal
left join
account_analytic_account aa on aal.account_id = aa.id
left join
account_analytic_plan aap on aa.plan_id = aap.id
account_analytic_account aa on aal.x_plan3_id = aa.id
left join
res_partner p on aa.partner_id = p.id
where
aa
p.id = 3
aa
l.x_plan3_id IS NOT NULL
%s
group by p.name
...
...
@@ -343,7 +315,10 @@ class LeFilamentTdb(models.Model):
sum(case when aal.partner_id != 1 or aal.partner_id is null
and aal.holiday_id is null then unit_amount else 0 end)
as production,
sum(case when aal.partner_id = 1 and aal.holiday_id is null
sum(case when
aal.partner_id = 1
and aal.holiday_id is null
and aal.global_leave_id IS NULL
then unit_amount else 0 end)
as internal,
0 as revenue
...
...
@@ -356,7 +331,7 @@ class LeFilamentTdb(models.Model):
left join
hr_leave_type lt on l.holiday_status_id = lt.id
where
aal.project_id
is not null
aal.project_id
IS NOT NULL
%s
group by e.name
) query
...
...
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