diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 6bf5c5a5dca..aa0a2f8b61a 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -410,17 +410,19 @@ if ($id > 0)
print '
';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
+ if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
// display amount and link to unpaid bill
$outstandingBills = $object->get_OutstandingBill();
- if ($outstandingBills != 0)
+ print ' (' . $langs->trans('CurrentOutstandingBill') . ': ';
+ print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency);
+ if ($object->outstanding_limit != '')
{
- print ' ('.$langs->trans("CurrentOutstandingBill");
- print ' ';
- print price($outstandingBills, '', $langs, 0, -1, -1, $conf->currency);
- print '';
- if ($outstandingBills > $object->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
- print ')';
+ if ($outstandingBills > $object->outstanding_limit)
+ print img_warning($langs->trans("OutstandingBillReached"));
+ //print ' / ' . price($soc->outstanding_limit);
}
+ print ')';
+
print ' | ';
print '';
}
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index a461d1b9c82..518a22ede78 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2502,7 +2502,9 @@ if ($action == 'create')
}
print '
';
-} else if ($id > 0 || ! empty($ref)) {
+}
+else if ($id > 0 || ! empty($ref))
+{
/*
* Show object in view mode
*/
@@ -2522,7 +2524,8 @@ if ($action == 'create')
$result = $object->fetch_thirdparty();
$soc = new Societe($db);
- $soc->fetch($object->socid);
+ $result=$soc->fetch($object->socid);
+ if ($result < 0) dol_print_error($db);
$selleruserevenustamp = $mysoc->useRevenueStamp();
$totalpaye = $object->getSommePaiement();
@@ -2857,7 +2860,8 @@ if ($action == 'create')
$outstandingBills = $soc->get_OutstandingBill();
print ' - ' . $langs->trans('CurrentOutstandingBill') . ': ';
print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency);
- if ($soc->outstanding_limit != '') {
+ if ($soc->outstanding_limit != '')
+ {
if ($outstandingBills > $soc->outstanding_limit)
print img_warning($langs->trans("OutstandingBillReached"));
print ' / ' . price($soc->outstanding_limit);
@@ -2946,7 +2950,8 @@ if ($action == 'create')
} else
print '. ';
}
- if ($absolute_creditnote > 0) {
+ if ($absolute_creditnote > 0)
+ {
// If validated, we show link "add credit note to payment"
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index c4385b6324e..69d17aecee4 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -504,7 +504,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
$projecttmp = new Project($db);
$i=0;
- $var=false;
+ $var=true;
while ($i < $num)
{
$obj = $db->fetch_object($result);