FIX Confusion between expired and late
This commit is contained in:
parent
8d7f24a6d9
commit
4899d03ff8
@ -2108,7 +2108,7 @@ class Contrat extends CommonObject
|
||||
$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $this->from.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
|
||||
if ($mode == 'inactives')
|
||||
if ($mode == 'inactive')
|
||||
{
|
||||
$sql = "SELECT cd.rowid, cd.date_ouverture_prevue as datefin";
|
||||
$sql.= $this->from;
|
||||
@ -2123,25 +2123,44 @@ class Contrat extends CommonObject
|
||||
$sql.= " WHERE c.statut = 1";
|
||||
$sql.= " AND c.rowid = cd.fk_contrat";
|
||||
$sql.= " AND cd.statut = 4";
|
||||
$sql.= " AND cd.date_fin_validite < '".$this->db->idate(time())."'";
|
||||
$sql.= " AND cd.date_fin_validite < '".$this->db->idate(dol_now())."'";
|
||||
}
|
||||
elseif ($mode == 'active')
|
||||
{
|
||||
$sql = "SELECT cd.rowid, cd.date_fin_validite as datefin";
|
||||
$sql.= $this->from;
|
||||
$sql.= " WHERE c.statut = 1";
|
||||
$sql.= " AND c.rowid = cd.fk_contrat";
|
||||
$sql.= " AND cd.statut = 4";
|
||||
//$datetouse = dol_now();
|
||||
//$sql.= " AND cd.date_fin_validite < '".$this->db->idate($datetouse)."'";
|
||||
}
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
$sql.= " AND c.entity = ".$conf->entity;
|
||||
if ($user->societe_id) $sql.=" AND c.fk_soc = ".$user->societe_id;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
|
||||
var_dump($sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
$now=dol_now();
|
||||
|
||||
if ($mode == 'inactives') {
|
||||
if ($mode == 'inactive') {
|
||||
$warning_delay = $conf->contrat->services->inactifs->warning_delay;
|
||||
$label = $langs->trans("BoardNotActivatedServices");
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=0';
|
||||
}
|
||||
elseif ($mode == 'expired') {
|
||||
$warning_delay = $conf->contrat->services->expires->warning_delay;
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired';
|
||||
$label = $langs->trans("BoardExpiredServices");
|
||||
} else {
|
||||
$warning_delay = $conf->contrat->services->expires->warning_delay;
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired';
|
||||
$url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4';
|
||||
//$url.= '&op2day='.$arraydatetouse['mday'].'&op2month='.$arraydatetouse['mon'].'&op2year='.$arraydatetouse['year'];
|
||||
//if ($warning_delay >= 0) $url.='&filter=expired';
|
||||
$label = $langs->trans("BoardRunningServices");
|
||||
}
|
||||
|
||||
|
||||
@ -432,9 +432,9 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
$board=new Contrat($db);
|
||||
$dashboardlines[] = $board->load_board($user,"inactives");
|
||||
$dashboardlines[] = $board->load_board($user, "inactive");
|
||||
// Number of active services (expired)
|
||||
$dashboardlines[] = $board->load_board($user,"expired");
|
||||
$dashboardlines[] = $board->load_board($user, "active");
|
||||
}
|
||||
// Number of invoices customers (has paid)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
@ -553,7 +553,7 @@ $nbworkboardempty=0;
|
||||
if (! empty($valid_dashboardlines))
|
||||
{
|
||||
$boxwork.='<tr class="nohover"><td class="tdboxstats nohover flexcontainer centpercent"><div style="display: flex: flex-wrap: wrap">';
|
||||
|
||||
|
||||
foreach($valid_dashboardlines as $board)
|
||||
{
|
||||
if (empty($board->nbtodo)) $nbworkboardempty++;
|
||||
@ -593,7 +593,7 @@ if (! empty($valid_dashboardlines))
|
||||
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
|
||||
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
|
||||
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
|
||||
|
||||
|
||||
$boxwork .='</div>';
|
||||
$boxwork .='</td></tr>';
|
||||
}
|
||||
|
||||
@ -64,7 +64,8 @@ DateStartRealShort=Real start date
|
||||
DateEndReal=Real end date
|
||||
DateEndRealShort=Real end date
|
||||
CloseService=Close service
|
||||
BoardRunningServices=Expired running services
|
||||
BoardRunningServices=Services running
|
||||
BoardExpiredServices=Services expired
|
||||
ServiceStatus=Status of service
|
||||
DraftContracts=Drafts contracts
|
||||
CloseRefusedBecauseOneServiceActive=Contract can't be closed as there is at least one open service on it
|
||||
|
||||
@ -456,7 +456,7 @@ Duration=Durée
|
||||
TotalDuration=Durée totale
|
||||
Summary=Résumé
|
||||
DolibarrStateBoard=Statistiques de la base
|
||||
DolibarrWorkBoard=Éléments en attente
|
||||
DolibarrWorkBoard=Tableau de bord des éléments ouverts
|
||||
NoOpenedElementToProcess=Aucun élément ouvert à traiter
|
||||
Available=Disponible
|
||||
NotYetAvailable=Pas encore disponible
|
||||
|
||||
Loading…
Reference in New Issue
Block a user