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

[add] date derniere maj

parent da4598db
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -113,6 +113,7 @@ class LeFilamentTdb(models.Model):
'target': 100000,
'cca': 0,
'capital': 0,
'date_maj': 0,
}
cr.execute("""
SELECT
......@@ -122,6 +123,7 @@ class LeFilamentTdb(models.Model):
(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 and probability=100) as pipe_win,
(select sum(planned_revenue*probability/100) from crm_lead where active=True and probability!=100) as pipe_to_win,
(select date from account_bank_statement ORDER BY ID DESC LIMIT 1) as date_maj,
(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 sortie,
......@@ -142,6 +144,7 @@ class LeFilamentTdb(models.Model):
res['pipe_win'] =+ datas[0]['pipe_win']
res['pipe_to_win'] =+ datas[0]['pipe_to_win']
res['tresorerie'] =+ datas[0]['tresorerie']
res['date_maj'] = datas[0]['date_maj']
res['entree'] =+ datas[0]['entree']
res['sortie'] =+ datas[0]['sortie']
res['variation'] =+ datas[0]['variation']
......
......@@ -34,6 +34,7 @@
.card a { color: inherit; }
.card-half { float: left; width: 50%; }
.card-header { margin: 0!important; }
p.card-maj { margin: 0 0 10px; font-size: 10px; font-style: italic; font-weight: 300; }
.card-number { font-size: 30px; font-weight: 300; margin: 0!important; font-family: "Helvetica Neue", Helvetica, "Open Sans", Arial, sans-serif; }
.card-tab { background-color: #fff; color: #73879C; padding: 20px; margin: 0px 0 10px; }
.tresorerie .card-number { font-size: 20px; font-weight: 300; }
......
......@@ -128,6 +128,11 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
value = value.toLocaleString('fr', { maximumFractionDigits: 0 }) + '';
return value;
},
render_date: function(value) {
var dateFormat = new Date(value);
var new_value = moment(dateFormat).format('Do MMM YYYY');
return new_value;
},
render_monetary_color: function(value) {
if (value >= 0)
value = '<span class="positive">'+value.toLocaleString('fr', { maximumFractionDigits: 0 }) + ' €</span>';
......
......@@ -125,6 +125,7 @@
<div class="col-xs-12">
<div class="card">
<p class="card-header">Trésorerie</p>
<p class="card-maj">Denière mise à jour le <t t-esc="widget.render_date(widget.values.date_maj)"></t></p>
<p class="card-number">
<strong><t t-esc="widget.render_monetary(widget.values.tresorerie)"></t></strong>
</p>
......
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