Merge pull request #9058 from defrance/patch-123

New : Add total price on dashboard
This commit is contained in:
Laurent Destailleur 2018-08-21 13:33:33 +02:00 committed by GitHub
commit 289f194641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View File

@ -3144,7 +3144,7 @@ class Propal extends CommonObject
$clause = " WHERE";
$sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin";
$sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin, p.total_ht";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@ -3188,6 +3188,8 @@ class Propal extends CommonObject
while ($obj=$this->db->fetch_object($resql))
{
$response->nbtodo++;
$response->total+=$obj->total_ht;
if ($mode == 'opened')
{
$datelimit = $this->db->jdate($obj->datefin);

View File

@ -3243,7 +3243,7 @@ class Commande extends CommonOrder
$clause = " WHERE";
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut";
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut, c.total_ht";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@ -3270,6 +3270,7 @@ class Commande extends CommonOrder
while ($obj=$this->db->fetch_object($resql))
{
$response->nbtodo++;
$response->total+= $obj->total_ht;
$generic_commande->statut = $obj->fk_statut;
$generic_commande->date_commande = $this->db->jdate($obj->date_commande);

View File

@ -3726,7 +3726,7 @@ class Facture extends CommonInvoice
$clause = " WHERE";
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut";
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut, f.total";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@ -3759,6 +3759,7 @@ class Facture extends CommonInvoice
$generic_facture->statut = $obj->fk_statut;
$response->nbtodo++;
$response->total += $obj->total;
if ($generic_facture->hasDelay()) {
$response->nbtodolate++;

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -66,4 +67,10 @@ class WorkboardResponse
*/
public $nbtodolate = 0;
}
/**
* total price of items
* @var int
*/
public $total = 0;
}

View File

@ -565,6 +565,10 @@ if (! empty($valid_dashboardlines))
$sep=($conf->dol_use_jmobile?'<br>':' ');
$boxwork .= '<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).'">'.$board->img.' '.$board->label.'</span><br>';
$boxwork .= '<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0)?' dashboardlineok':'').'">'.$board->nbtodo.'</span></a>';
if ($board->total > 0 && ! empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX))
{
$boxwork .= '&nbsp;/&nbsp;<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0)?' dashboardlineok':'').'">'.price($board->total) .'</span></a>';
}
$boxwork .= '</div>';
if ($board->nbtodolate > 0)
{