self.env.cr.execute("select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('month', %s) and date < date_trunc('month', %s + interval '1' month);",(date_tdb,date_tdb))
self.env.cr.execute("select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('month', %s) and date < date_trunc('month', %s + interval '1' month);",(date_tdb,date_tdb))
ca_mois=self.env.cr.fetchone()[0]
ca_mois=self.env.cr.fetchone()[0]
...
@@ -111,6 +111,7 @@ class LeFilamentTdb(models.Model):
...
@@ -111,6 +111,7 @@ class LeFilamentTdb(models.Model):
SELECT
SELECT
(select count(*) from account_invoice) as id,
(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) ) as facture,
(select sum(residual_company_signed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('year', current_date) ) as a_encaisser,
(select sum(planned_revenue*probability/100) from crm_lead where active=True) as pipe,
(select sum(planned_revenue*probability/100) from crm_lead where active=True) as pipe,
(select sum(amount) from account_bank_statement_line ) as tresorerie,
(select sum(amount) from account_bank_statement_line ) as tresorerie,
(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 entree,
...
@@ -120,6 +121,7 @@ class LeFilamentTdb(models.Model):
...
@@ -120,6 +121,7 @@ class LeFilamentTdb(models.Model):