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

modif tableau graph

parent a2f71cc2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -154,15 +154,23 @@ class LeFilamentTdb(models.Model): ...@@ -154,15 +154,23 @@ class LeFilamentTdb(models.Model):
res['pipe_to_win'] =+ datas[0]['pipe_to_win'] res['pipe_to_win'] =+ datas[0]['pipe_to_win']
if datas[0]['pipe_n1']: if datas[0]['pipe_n1']:
res['pipe_n1'] =+ datas[0]['pipe_n1'] res['pipe_n1'] =+ datas[0]['pipe_n1']
if datas[0]['tresorerie']:
res['tresorerie'] =+ datas[0]['tresorerie'] res['tresorerie'] =+ datas[0]['tresorerie']
if datas[0]['date_maj']:
res['date_maj'] = datas[0]['date_maj'] res['date_maj'] = datas[0]['date_maj']
if datas[0]['entree']:
res['entree'] =+ datas[0]['entree'] res['entree'] =+ datas[0]['entree']
if datas[0]['sortie']:
res['sortie'] =+ datas[0]['sortie'] res['sortie'] =+ datas[0]['sortie']
if datas[0]['variation']:
res['variation'] =+ datas[0]['variation'] res['variation'] =+ datas[0]['variation']
if datas[0]['commandes']: if datas[0]['commandes']:
res['commandes'] =+ datas[0]['commandes'] res['commandes'] =+ datas[0]['commandes']
if datas[0]['cca']:
res['cca'] =+ datas[0]['cca'] res['cca'] =+ datas[0]['cca']
if ca_target[0]['ca_target']:
res['target'] =+ ca_target[0]['ca_target'] res['target'] =+ ca_target[0]['ca_target']
if capital[0]['capital']:
res['capital'] =+ capital[0]['capital'] res['capital'] =+ capital[0]['capital']
return res return res
......
...@@ -51,11 +51,13 @@ p.card-maj { margin: 0px; font-size: 10px; font-style: italic; font-weight: ...@@ -51,11 +51,13 @@ p.card-maj { margin: 0px; font-size: 10px; font-style: italic; font-weight:
.btn-tdb { border: 1px solid #eee; border-radius: 0; font-size: 11px; padding: 6px 10px; text-transform: none; } .btn-tdb { border: 1px solid #eee; border-radius: 0; font-size: 11px; padding: 6px 10px; text-transform: none; }
/*HIGHCHART*/ /*HIGHCHART*/
#hchart .highcharts-container { max-width: 100%; } /*#hchart .highcharts-container { max-width: 100%; }
#hchart svg { max-width: 100%; } #hchart svg { max-width: 100%; }
.highcharts-title { font-family: "Helvetica Neue", Helvetica, "Open Sans"; } .highcharts-title { font-family: "Helvetica Neue", Helvetica, "Open Sans"; }
.point { font-family: "Helvetica Neue", Helvetica, "Open Sans"; color: #73879C; text-align: center; } .point { font-family: "Helvetica Neue", Helvetica, "Open Sans"; color: #73879C; text-align: center; }
.point_percent { font-size: 16px; font-weight: 400; } .point_percent { font-size: 16px; font-weight: 400; }*/
canvas { width: 100%; }
/*Legend*/ /*Legend*/
.table-legend { width: 100%; max-width: 100%; margin: 10px 0; border-collapse: separate; border-spacing: 8px; font-size: 11px; } .table-legend { width: 100%; max-width: 100%; margin: 10px 0; border-collapse: separate; border-spacing: 8px; font-size: 11px; }
......
...@@ -16,9 +16,6 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { ...@@ -16,9 +16,6 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
template: 'YearDashboard', template: 'YearDashboard',
events: { events: {
// 'click .card': function() {
// this.mychart.reflow();
// },
'click #facture_non_encaisse': function() { 'click #facture_non_encaisse': function() {
this.facture(); this.facture();
}, },
...@@ -42,20 +39,24 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { ...@@ -42,20 +39,24 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
dash_model.call('retrieve_datas_dashboard') dash_model.call('retrieve_datas_dashboard')
.then(function(results) { .then(function(results) {
self.values = results; self.values = results;
self.progress = results.facture / results.target;
self.pfact = (self.values.facture / self.values.target * 100).toFixed(0); self.pfact = (self.values.facture / self.values.target * 100).toFixed(0);
self.pcomm = (self.values.commandes / self.values.target * 100).toFixed(0); self.pcomm = (self.values.commandes / self.values.target * 100).toFixed(0);
self.ppipe_win = (self.values.pipe_win / self.values.target * 100).toFixed(0); self.ppipe_win = (self.values.pipe_win / self.values.target * 100).toFixed(0);
self.ppipe_to_win = (self.values.pipe_to_win / self.values.target * 100).toFixed(0); self.ppipe_to_win = (self.values.pipe_to_win / self.values.target * 100).toFixed(0);
self.ptarg = 100-self.pfact-self.pcomm-self.ppipe_win-self.ppipe_to_win; self.ptarg = 100-self.pfact-self.pcomm-self.ppipe_win-self.ppipe_to_win;
self.pfact2 = (self.values.facture); self.pfact2 = (self.values.facture);
self.pcomm2 = (self.values.commandes); self.pcomm2 = (self.values.commandes);
self.ppipe2_win = (self.values.pipe_win); self.ppipe2_win = (self.values.pipe_win);
self.ppipe2_to_win = (self.values.pipe_to_win); self.ppipe2_to_win = (self.values.pipe_to_win);
self.ptarg2 = self.values.target -self.pfact2-self.pcomm2-self.ppipe2_to_win-self.ppipe2_win; self.ptarg2 = self.values.target -self.pfact2-self.pcomm2-self.ppipe2_to_win-self.ppipe2_win;
self.total2 = ((self.values.facture + self.values.commandes + self.values.pipe_win) / self.values.target * 100).toFixed(0);
self.total = self.pfact + self.pcomm + self.ppipe_win self.total = ((self.values.facture + self.values.commandes + self.values.pipe_win) / self.values.target * 100).toFixed(0);
self.total2 = self.pfact2 + self.pcomm2 + self.ppipe2_win
self.target = self.values.target
deferred.resolve(); deferred.resolve();
}); });
return jQuery.when(this._super.apply(this, arguments),deferred); return jQuery.when(this._super.apply(this, arguments),deferred);
...@@ -133,11 +134,11 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { ...@@ -133,11 +134,11 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
this.ctx = this.$el.find('#target')[0].getContext('2d'); this.ctx = this.$el.find('#target')[0].getContext('2d');
var dataset_stacked = [ var dataset_stacked = [
{ label: 'Facturé', data: [this.pfact2], backgroundColor: '#8ED8A2', }, { label: 'Facturé', data: [this.pfact], backgroundColor: '#8ED8A2', },
{ label: 'Commandes', data: [this.pcomm2], backgroundColor: '#F6DCA2', }, { label: 'Commandes', data: [this.pcomm], backgroundColor: '#F6DCA2', },
{ label: 'Gagné', data: [this.ppipe2_win], backgroundColor: '#F6CCA2', }, { label: 'Gagné', data: [this.ppipe_win], backgroundColor: '#F6CCA2', },
{ label: 'Pipe', data: [this.ppipe2_to_win], backgroundColor: '#F6ACA2', }, { label: 'Pipe', data: [this.ppipe_to_win], backgroundColor: '#F6ACA2', },
{ label: 'To Do', data: [this.ptarg2], backgroundColor: '#eee', }]; { label: 'To Do', data: [this.ptarg], backgroundColor: '#eee', }];
var label = 'Année ' + moment(Date.now()).format('YYYY'); var label = 'Année ' + moment(Date.now()).format('YYYY');
...@@ -149,8 +150,6 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { ...@@ -149,8 +150,6 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
var options = { var options = {
legend: { legend: {
display: false, display: false,
position: 'bottom',
fullWidth: false,
}, },
layout: { layout: {
padding: { left:0, right: 0, bottom: 20, top: 20, }, padding: { left:0, right: 0, bottom: 20, top: 20, },
...@@ -174,7 +173,7 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) { ...@@ -174,7 +173,7 @@ odoo.define('lefilament_tdb.dashboard_year', function (require) {
bodyFontColor: '#777', bodyFontColor: '#777',
callbacks: { callbacks: {
label: function(tooltipItems, data) { label: function(tooltipItems, data) {
return (tooltipItems.xLabel / 1000).toLocaleString('fr', { maximumFractionDigits: 2 }) + ' K€'; return (tooltipItems.xLabel * self.target / 100000).toLocaleString('fr', { maximumFractionDigits: 2 }) + ' K€';
} }
} }
}, },
......
...@@ -130,7 +130,6 @@ ...@@ -130,7 +130,6 @@
<t t-esc="widget.render_monetary(widget.values.target)"></t> <t t-esc="widget.render_monetary(widget.values.target)"></t>
</p> </p>
<canvas id="target" width="auto" height="100"></canvas> <canvas id="target" width="auto" height="100"></canvas>
<div id="chart" class="chart-container"></div>
<!-- <div id="hchart" ></div> --> <!-- <div id="hchart" ></div> -->
<table class="table-legend"> <table class="table-legend">
<tr> <tr>
......
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