diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 6fed032334f..0d28b8f7cf3 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -38,6 +38,10 @@ accessforbidden();
$langs->load("bills");
+
+$warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiement facture > delai)
+
+
require_once "../facture.class.php";
require_once "../paiement.class.php";
if ($conf->projet->enabled) require_once "../project.class.php";
@@ -512,7 +516,7 @@ if ($_GET["action"] == 'create')
print '
| '.$langs->trans("Author").' : | '.$user->fullname.' | ';
print '';
- print ' |
";
print '';
if ($conf->projet->enabled)
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index bfee19b909e..db7a1f77a81 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -35,6 +35,8 @@ $user->getrights(); // On a besoin des permissions sur plusieurs modules
$langs->load("compta");
$langs->load("bills");
+$warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiement facture > delai)
+
/*
* Sécurité accés client
*/
@@ -316,19 +318,15 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
*
*/
- $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc, sum(pf.amount) as am";
- $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f left join ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
- $sql .= " WHERE s.idp = f.fk_soc AND f.paye = 0 AND f.fk_statut = 1";
- if ($socidp)
- {
- $sql .= " AND f.fk_soc = $socidp";
- }
- $sql .= " GROUP BY f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc";
- $sql .= " ORDER BY f.datef ASC ";
+ $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc, ".$db->pdate("f.date_lim_reglement")." as datelimite, sum(pf.amount) as am";
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f left join ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
+ $sql.= " WHERE s.idp = f.fk_soc AND f.paye = 0 AND f.fk_statut = 1";
+ if ($socidp) $sql .= " AND f.fk_soc = $socidp";
+ $sql.= " GROUP BY f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc";
+ $sql.= " ORDER BY f.datef ASC ";
$resql = $db->query($sql);
-
- if ( $resql )
+ if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
@@ -347,7 +345,10 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
if ($i < $conf->liste_limit)
{
$var=!$var;
- print '
| '.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.' | ';
+ print '
';
+ print '| '.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.'';
+ if ($obj->datelimite < (time() - $warning_delay)) print img_warning($langs->trans("Late"));
+ print ' | ';
print ''.img_object($langs->trans("ShowCustomer"),"company").' '.dolibarr_trunc($obj->nom,50).' | ';
print ''.price($obj->total).' | ';
print ''.price($obj->total_ttc).' | ';
diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php
index 7d4a1810917..96b5a585234 100644
--- a/htdocs/includes/boxes/box_factures_imp.php
+++ b/htdocs/includes/boxes/box_factures_imp.php
@@ -89,14 +89,12 @@ class box_factures_imp extends ModeleBoxes {
$objp = $db->fetch_object($result);
$late="";
- if ($obj->datelimite < (time() - $warning_delay))
- {
- $late=img_warning($langs->trans("Late"));
- }
+ if ($obj->datelimite < (time() - $warning_delay)) $late=img_warning($langs->trans("Late"));
$this->info_box_contents[$i][0] = array('align' => 'left',
'logo' => $this->boximg,
- 'text' => $objp->facnumber.$late,
+ 'text' => $objp->facnumber,
+ 'text2'=> $late,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][1] = array('align' => 'left',
diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php
index b79bb101d05..f3ac56b7880 100644
--- a/htdocs/includes/boxes/modules_boxes.php
+++ b/htdocs/includes/boxes/modules_boxes.php
@@ -36,7 +36,7 @@
class ModeleBoxes
{
- var $MAXLENGTHBOX=70; // Mettre 0 pour pas de limite
+ var $MAXLENGTHBOX=20; // Mettre 0 pour pas de limite
var $error='';
@@ -88,6 +88,8 @@ class ModeleBoxes
if ($contents[$i][$j]['text']) {
$texte=$contents[$i][$j]['text'];
$textewithnotags=eregi_replace('<[^>]+>','',$texte);
+ $texte2=$contents[$i][$j]['text2'];
+ $texte2withnotags=eregi_replace('<[^>]+>','',$texte2);
//print "xxx $textewithnotags y";
if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) print '';
@@ -104,8 +106,13 @@ class ModeleBoxes
{
$texte=substr($texte,0,$this->MAXLENGTHBOX)."...";
}
+ if ($this->MAXLENGTHBOX && strlen($texte2withnotags) > $this->MAXLENGTHBOX)
+ {
+ $texte2=substr($texte2,0,$this->MAXLENGTHBOX)."...";
+ }
print $texte;
if ($contents[$i][$j]['url']) print '';
+ print $texte2;
print " | ";
}