';
+ $boxstat .= '';
+ $boxstat .= '' . img_object("", $icon) . ' ' . $text . '
';
+ $boxstat .= ''.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency) . $warn . '';
+ $boxstat .= '
';
+ if ($link) $boxstat .= '';
+ }
}
$parameters = array();
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 9aeef877bab..1ad41c08da0 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -417,6 +417,20 @@ if ($object->id > 0)
$boxstat .= '';
+ $boxstat .= '';
+ $boxstat .= '' . img_object("", $icon) . ' ' . $text . '
';
+ $boxstat .= ''.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency) . $warn . '';
+ $boxstat .= '
';
+ if ($link) $boxstat .= '';
+ }
}
$boxstat .= '';
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 4145d7184c5..98dc451b5bb 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -459,4 +459,5 @@ MulticurrencyUsed=Use Multicurrency
MulticurrencyCurrency=Currency
InEEC=Europe (EEC)
RestOfEurope=Rest of Europe (EEC)
-OutOfEurope=Out of Europe (EEC)
\ No newline at end of file
+OutOfEurope=Out of Europe (EEC)
+CurrentOutstandingBillLate=Current outstanding bill late
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index fee36c3ff1b..5efabc066e4 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -4092,9 +4092,10 @@ class Societe extends CommonObject
* Return amount of bill not paid and total
*
* @param string $mode 'customer' or 'supplier'
+ * @param int $late 0 => all invoice, 1=> only late
* @return array array('opened'=>Amount, 'total'=>Total amount)
*/
- public function getOutstandingBills($mode = 'customer')
+ public function getOutstandingBills($mode = 'customer', $late = 0)
{
$table = 'facture';
if ($mode == 'supplier') $table = 'facture_fourn';
@@ -4109,6 +4110,9 @@ class Societe extends CommonObject
if ($mode == 'supplier') $sql = "SELECT rowid, total_ht as total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
else $sql = "SELECT rowid, total as total_ht, total_ttc, paye, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
$sql .= " WHERE fk_soc = ".$this->id;
+ if (!empty($late)) {
+ $sql .= " AND date_lim_reglement < '".$this->db->idate(dol_now())."'";
+ }
if ($mode == 'supplier') {
$sql .= " AND entity IN (".getEntity('facture_fourn').")";
} else {