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

[modif] requete facture pr etre sur l'annee courante

parent 9fbe3d28
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -121,7 +121,7 @@ class LeFilamentTdb(models.Model):
self._cr.execute("""
SELECT
(select count(*) from account_invoice) as id,
(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) and date < date_trunc('year', current_date + interval '1' year) ) as facture,
(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 date_deadline >= date_trunc('year', current_date + interval '1' year) ) as pipe_n1,
......@@ -132,7 +132,7 @@ class LeFilamentTdb(models.Model):
(select sum(amount) from account_bank_statement_line where amount > 0 and date >= date_trunc('year', current_date) ) as entree,
(select sum(amount) from account_bank_statement_line where amount < 0 and date >= date_trunc('year', current_date) ) as sortie,
(select sum(amount) from account_bank_statement_line where date >= date_trunc('year', current_date) ) as variation,
(select sum(es.total_amount) from hr_expense_sheet es, hr_expense e where es.id = e.sheet_id and e.payment_mode='own_account' and es.state!='done' ) as cca,
(select sum(total_amount) from hr_expense where payment_mode='own_account' and state!='done' ) as cca,
(select sum(price_subtotal-qty_invoiced*price_unit) from sale_order_line where invoice_status='to invoice') as commandes; """)
datas = self._cr.dictfetchall()
......
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