Skip to content
Extraits de code Groupes Projets
Valider e32762d7 rédigé par Benjamin's avatar Benjamin
Parcourir les fichiers

modif requete nb opportunites pr supprimerles lead

parent 53875058
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -174,10 +174,10 @@ class SapovalTdb(models.Model): ...@@ -174,10 +174,10 @@ class SapovalTdb(models.Model):
(select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('year', current_date) ) as facture, (select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('year', current_date) ) as facture,
(select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('month', current_date) ) as facture_mois, (select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('month', current_date) ) as facture_mois,
(select sum(residual_company_signed) from account_invoice where state!='draft' and type='out_invoice' ) as a_encaisser, (select sum(residual_company_signed) from account_invoice where state!='draft' and type='out_invoice' ) as a_encaisser,
(select sum(planned_revenue*probability/100) from crm_lead where active=True and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as pipe, (select sum(planned_revenue*probability/100) from crm_lead where active=True and type='opportunity' and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as pipe,
(select count(*) from crm_lead where active=True and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as nb_opp, (select count(*) from crm_lead where active=True and type='opportunity' and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as nb_opp,
(select sum(planned_revenue*probability/100) from crm_lead where active=True and date_deadline >= date_trunc('year', current_date + interval '1' year) ) as pipe_n1, (select sum(planned_revenue*probability/100) from crm_lead where active=True and type='opportunity' and date_deadline >= date_trunc('year', current_date + interval '1' year) ) as pipe_n1,
(select count(*) from crm_lead where active=True and date_deadline >= date_trunc('year', current_date + interval '1' year) ) as nb_opp_n1, (select count(*) from crm_lead where active=True and type='opportunity' and date_deadline >= date_trunc('year', current_date + interval '1' year) ) as nb_opp_n1,
(select sum(planned_revenue*probability/100) from crm_lead where active=True and probability=95 and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as pipe_win, (select sum(planned_revenue*probability/100) from crm_lead where active=True and probability=95 and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as pipe_win,
(select sum(planned_revenue*probability/100) from crm_lead where active=True and probability=100 and date_deadline >= date_trunc('year', current_date + interval '1' year) ) as pipe_win_n1, (select sum(planned_revenue*probability/100) from crm_lead where active=True and probability=100 and date_deadline >= date_trunc('year', current_date + interval '1' year) ) as pipe_win_n1,
(select sum(planned_revenue*probability/100) from crm_lead where active=True and probability!=100 and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as pipe_to_win, (select sum(planned_revenue*probability/100) from crm_lead where active=True and probability!=100 and (date_deadline < date_trunc('year', current_date + interval '1' year) or date_deadline is null) ) as pipe_to_win,
......
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