Fix courrent outstanding amount not visible

This commit is contained in:
Laurent Destailleur 2015-06-23 23:33:25 +02:00
parent 040a643ee9
commit bdba8f1f38
3 changed files with 19 additions and 12 deletions

View File

@ -410,17 +410,19 @@ if ($id > 0)
print '</td><td colspan="3">'; print '</td><td colspan="3">';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; $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) : '')); 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 // display amount and link to unpaid bill
$outstandingBills = $object->get_OutstandingBill(); $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"); if ($outstandingBills > $object->outstanding_limit)
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'&search_status=1">'; print img_warning($langs->trans("OutstandingBillReached"));
print price($outstandingBills, '', $langs, 0, -1, -1, $conf->currency); //print ' / ' . price($soc->outstanding_limit);
print '</a>';
if ($outstandingBills > $object->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
print ')';
} }
print ')';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -2502,7 +2502,9 @@ if ($action == 'create')
} }
print '<br>'; print '<br>';
} else if ($id > 0 || ! empty($ref)) { }
else if ($id > 0 || ! empty($ref))
{
/* /*
* Show object in view mode * Show object in view mode
*/ */
@ -2522,7 +2524,8 @@ if ($action == 'create')
$result = $object->fetch_thirdparty(); $result = $object->fetch_thirdparty();
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($object->socid); $result=$soc->fetch($object->socid);
if ($result < 0) dol_print_error($db);
$selleruserevenustamp = $mysoc->useRevenueStamp(); $selleruserevenustamp = $mysoc->useRevenueStamp();
$totalpaye = $object->getSommePaiement(); $totalpaye = $object->getSommePaiement();
@ -2857,7 +2860,8 @@ if ($action == 'create')
$outstandingBills = $soc->get_OutstandingBill(); $outstandingBills = $soc->get_OutstandingBill();
print ' - ' . $langs->trans('CurrentOutstandingBill') . ': '; print ' - ' . $langs->trans('CurrentOutstandingBill') . ': ';
print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency); print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency);
if ($soc->outstanding_limit != '') { if ($soc->outstanding_limit != '')
{
if ($outstandingBills > $soc->outstanding_limit) if ($outstandingBills > $soc->outstanding_limit)
print img_warning($langs->trans("OutstandingBillReached")); print img_warning($langs->trans("OutstandingBillReached"));
print ' / ' . price($soc->outstanding_limit); print ' / ' . price($soc->outstanding_limit);
@ -2946,7 +2950,8 @@ if ($action == 'create')
} else } else
print '. '; print '. ';
} }
if ($absolute_creditnote > 0) { if ($absolute_creditnote > 0)
{
// If validated, we show link "add credit note to payment" // 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 != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) { if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {

View File

@ -504,7 +504,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
$projecttmp = new Project($db); $projecttmp = new Project($db);
$i=0; $i=0;
$var=false; $var=true;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);