mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX add TODO
This commit is contained in:
parent
8be6642289
commit
1589d5f9fc
|
|
@ -778,6 +778,7 @@ if ($id > 0) {
|
|||
}
|
||||
|
||||
// Emit payment
|
||||
// TODO check if loan schedule is created ($echeances->lines > 0)
|
||||
if (($object->paid == 0 || $object->paid == 2) && ((price2num($object->capital) > 0 && round($staytopay) < 0) || (price2num($object->capital) > 0 && round($staytopay) > 0)) && $user->hasRight('loan', 'write')) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/loan/payment/payment.php?id='.$object->id.'&action=create&token='.newToken().'">'.$langs->trans("DoPayment").'</a></div>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ if (!$user->hasRight('loan', 'write')) {
|
|||
$loan = new Loan($db);
|
||||
$loan->fetch($chid);
|
||||
|
||||
//$line_id = 0; // TODO $line_id is never defined !!
|
||||
$line_id = 0;
|
||||
$echance = 0;
|
||||
$amount_capital = 0;
|
||||
$amount_insurance = 0;
|
||||
|
|
@ -75,8 +75,8 @@ if ($res > 0) {
|
|||
foreach ($ls->lines as $l) {
|
||||
$echance++; // Count term pos
|
||||
// last unpaid term
|
||||
if (empty($l->fk_bank)) { // TODO fk_bank is never empty !
|
||||
$line_id = $l->id; // TODO $line_id is never defined (fk_bank is never empty)
|
||||
if (empty($l->fk_bank)) {
|
||||
$line_id = $l->id;
|
||||
break;
|
||||
} elseif ($line_id == $l->id) {
|
||||
// If line_id provided, only count temp pos
|
||||
|
|
@ -86,7 +86,7 @@ if ($res > 0) {
|
|||
}
|
||||
|
||||
// Set current line with last unpaid line (only if schedule is used)
|
||||
if (!empty($line_id)) { // TODO $line_id is never defined and already empty !
|
||||
if (!empty($line_id)) {
|
||||
$line = new LoanSchedule($db);
|
||||
$res = $line->fetch($line_id);
|
||||
if ($res > 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user