';
/*
* Last modified customers or prospects
@@ -399,7 +401,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
$sql .= " AND s.client IN (".Societe::CUSTOMER.", ".Societe::PROSPECT.", ".Societe::CUSTOMER_AND_PROSPECT.")";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
- if ($socid) $sql .= " AND s.rowid = $socid";
+ if ($socid) $sql .= " AND s.rowid = $socid";
$sql .= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0);
@@ -463,7 +465,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
$sql .= " AND s.fournisseur = ".Societe::SUPPLIER;
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
- if ($socid) $sql .= " AND s.rowid = ".$socid;
+ if ($socid) $sql .= " AND s.rowid = ".$socid;
$sql .= " ORDER BY s.datec DESC";
$sql .= $db->plimit($max, 0);
@@ -581,7 +583,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
* Opened (validated) proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
- $sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
+ $sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.nom as name, s.rowid, s.code_client, s.entity, s.email";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
@@ -622,24 +624,21 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$companystatic->entity = $obj->entity;
$companystatic->email = $obj->email;
- print '
';
-
- // Ref
- print '';
- print '';
- print '| ';
- print $propalstatic->getNomUrl(1);
- print ' | ';
- print '';
- if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
- print ' | ';
- print '';
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
- print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
- print ' | ';
- print " | ";
+ $warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
+
+ print '
';
+
+ print '';
+ print '';
+ print '| '.$propalstatic->getNomUrl(1).' | ';
+ print ''.$warning.' | ';
+ print ''.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).' | ';
+ print ' ';
+ print ' ';
+ print ' | ';
print ''.$companystatic->getNomUrl(1, 'customer', 44).' | ';
print ''.dol_print_date($db->jdate($obj->dp), 'day').' | ';
@@ -649,7 +648,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
print '
';
$i++;
- $total += $obj->total_ttc;
+ $total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
}
}
@@ -683,7 +682,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$total = 0;
$num = $db->num_rows($resql);
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
- startSimpleTable("OrdersOpened", "commande/list.php", "search_status=1", 4, $num);
+ startSimpleTable("OrdersOpened", "commande/list.php", "search_status=".Commande::STATUS_VALIDATED, 4, $num);
if ($num > 0) {
$i = 0;
@@ -710,22 +709,18 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
+ //$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : '';
print '
';
- // Ref
print '';
print '';
- print '| ';
- print $orderstatic->getNomUrl(1);
+ print ' | '.$orderstatic->getNomUrl(1).' | ';
+ print ' | ';
+ print ''.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).' | ';
+ print ' ';
+ print ' ';
print ' | ';
- print '';
- //if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
- print ' | ';
- print '';
- print $formfile->getDocumentsLink($orderstatic->element, $filename, $filedir);
- print ' |
';
- print "";
print '
'.$companystatic->getNomUrl(1, 'customer', 44).' | ';
print '
'.dol_print_date($db->jdate($obj->dp), 'day').' | ';
@@ -735,7 +730,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '';
$i++;
- $total += $obj->total_ttc;
+ $total +=(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
}
}
@@ -747,7 +742,9 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
}
}
-print '