replace html by html5 in loan
This commit is contained in:
parent
4cb5c9ef35
commit
3f84cd95df
@ -304,7 +304,7 @@ if ($action == 'create')
|
||||
|
||||
// insurance amount
|
||||
print '<tr><td>'.$langs->trans("Insurance").'</td><td><input name="insurance_amount" size="10" value="' . dol_escape_htmltag(GETPOST("insurance_amount")) . '" placeholder="'.$langs->trans('Amount').'"></td></tr>';
|
||||
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
@ -499,7 +499,7 @@ if ($id > 0)
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("LoanCapital").'</td><td>'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Insurance
|
||||
if ($action == 'edit')
|
||||
{
|
||||
@ -712,9 +712,9 @@ if ($id > 0)
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Insurance").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Interest").'</td>';
|
||||
print '<td align="right">'.$langs->trans("LoanCapital").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Insurance").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Interest").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LoanCapital").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
while ($i < $num)
|
||||
@ -725,9 +725,9 @@ if ($id > 0)
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_payment."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
|
||||
print '<td class="right">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
|
||||
print '<td class="right">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
|
||||
print '<td class="right">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$total_capital += $objp->amount_capital;
|
||||
$i++;
|
||||
@ -737,13 +737,13 @@ if ($id > 0)
|
||||
|
||||
if ($object->paid == 0)
|
||||
{
|
||||
print '<tr><td colspan="5" align="right">'.$langs->trans("AlreadyPaid").' :</td><td align="right">'.price($totalpaid, 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td colspan="5" align="right">'.$langs->trans("AmountExpected").' :</td><td align="right">'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td colspan="5" class="right">'.$langs->trans("AlreadyPaid").' :</td><td class="right">'.price($totalpaid, 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td colspan="5" class="right">'.$langs->trans("AmountExpected").' :</td><td class="right">'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
$staytopay = $object->capital - $totalpaid;
|
||||
|
||||
print '<tr><td colspan="5" align="right">'.$langs->trans("RemainderToPay").' :</td>';
|
||||
print '<td align="right"'.($staytopay?' class="amountremaintopay"':'class="amountpaymentcomplete"').'>';
|
||||
print '<tr><td colspan="5" class="right">'.$langs->trans("RemainderToPay").' :</td>';
|
||||
print '<td class="right"'.($staytopay?' class="amountremaintopay"':'class="amountpaymentcomplete"').'>';
|
||||
print price($staytopay, 0, $langs, 0, 0, -1, $conf->currency);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ if ($action == 'updateecheancier') {
|
||||
$int = GETPOST('hi_interets'.$i);
|
||||
$id = GETPOST('hi_rowid'.$i);
|
||||
$insurance = GETPOST('hi_insurance'.$i);
|
||||
|
||||
|
||||
$echeance = new LoanSchedule($db);
|
||||
$echeance->fetch($id);
|
||||
$echeance->tms = dol_now();
|
||||
@ -148,18 +148,18 @@ print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
$colspan = 6;
|
||||
if (count($echeance->lines)>0) $colspan++;
|
||||
print '<th align="center" colspan="'.$colspan.'">';
|
||||
print '<th class="center" colspan="'.$colspan.'">';
|
||||
print $langs->trans("FinancialCommitment");
|
||||
print '</th>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
Print '<th width="5%" align="center">'.$langs->trans("Term").'</th>';
|
||||
Print '<th width="5%" align="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="15%" align="center">'.$langs->trans("Insurance");
|
||||
Print '<th width="15%" align="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
Print '<th width="10%" align="center">'.$langs->trans("Amount").'</th>';
|
||||
Print '<th width="40%" align="center">'.$langs->trans("CapitalRemain");
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="15%" class="center">'.$langs->trans("Insurance");
|
||||
Print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
Print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
|
||||
Print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
|
||||
print ' ('.price2num($object->capital).')';
|
||||
print '<input type="hidden" name="hi_capital0" id ="hi_capital0" value="'.$object->capital.'">';
|
||||
print '</th>';
|
||||
@ -180,12 +180,12 @@ if ($object->nbterm > 0 && count($echeance->lines)==0)
|
||||
$int = price2num($int, 'MT');
|
||||
$cap_rest = price2num($capital - ($mens-$int), 'MT');
|
||||
print '<tr>';
|
||||
print '<td align="center" id="n'.$i.'">' . $i .'</td>';
|
||||
print '<td align="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . dol_time_plus_duree($object->datestart, $i-1, 'm') . '">' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'), 'day') . '</td>';
|
||||
print '<td align="center" id="insurance'.$i.'">'.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . ($insurance+(($i == 1) ? $regulInsurance : 0)) . '">';
|
||||
print '<td align="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
print '<td align="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
print '<td align="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '<td class="center" id="n'.$i.'">' . $i .'</td>';
|
||||
print '<td class="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . dol_time_plus_duree($object->datestart, $i-1, 'm') . '">' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'), 'day') . '</td>';
|
||||
print '<td class="center" id="insurance'.$i.'">'.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . ($insurance+(($i == 1) ? $regulInsurance : 0)) . '">';
|
||||
print '<td class="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
print '<td class="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
print '<td class="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
$capital = $cap_rest;
|
||||
@ -203,18 +203,18 @@ elseif(count($echeance->lines)>0)
|
||||
$int = $line->amount_interest;
|
||||
$cap_rest = price2num($capital - ($mens-$int), 'MT');
|
||||
print '<tr>';
|
||||
print '<td align="center" id="n'.$i.'"><input type="hidden" name="hi_rowid' .$i .'" id ="hi_rowid' .$i .'" value="' . $line->id . '">' . $i .'</td>';
|
||||
print '<td align="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . $line->datep . '">' . dol_print_date($line->datep, 'day') . '</td>';
|
||||
print '<td align="center" id="insurance'.$i.'">'.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . ($insurance+(($i == 1) ? $regulInsurance : 0)) . '">';
|
||||
print '<td align="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
print '<td class="center" id="n'.$i.'"><input type="hidden" name="hi_rowid' .$i .'" id ="hi_rowid' .$i .'" value="' . $line->id . '">' . $i .'</td>';
|
||||
print '<td class="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . $line->datep . '">' . dol_print_date($line->datep, 'day') . '</td>';
|
||||
print '<td class="center" id="insurance'.$i.'">'.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . ($insurance+(($i == 1) ? $regulInsurance : 0)) . '">';
|
||||
print '<td class="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
if($line->datep > dol_now()){
|
||||
print '<td align="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
print '<td class="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
}else{
|
||||
print '<td align="center">' . price($mens) . ' €</td><input type="hidden" name="mens' .$i .'" id ="mens' .$i .'" value="' . $mens . '">';
|
||||
print '<td class="center">' . price($mens) . ' €</td><input type="hidden" name="mens' .$i .'" id ="mens' .$i .'" value="' . $mens . '">';
|
||||
}
|
||||
|
||||
print '<td align="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '<td align="center"><a class="butAction" href="'.DOL_URL_ROOT.'/loan/payment/payment.php?id='.$object->id.'&action=create">'.$langs->trans('DoPayment').'</a></td>';
|
||||
|
||||
print '<td class="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '<td class="center"><a class="butAction" href="'.DOL_URL_ROOT.'/loan/payment/payment.php?id='.$object->id.'&action=create">'.$langs->trans('DoPayment').'</a></td>';
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
$capital = $cap_rest;
|
||||
@ -224,7 +224,7 @@ elseif(count($echeance->lines)>0)
|
||||
print '</table>';
|
||||
print '</br>';
|
||||
print '</br>';
|
||||
print '<div align="center"><input class="button" type="submit" value="'.$langs->trans("Save").'"></div>';
|
||||
print '<div class="center"><input class="button" type="submit" value="'.$langs->trans("Save").'"></div>';
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
|
||||
@ -139,11 +139,11 @@ if ($resql)
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
||||
print '<td class="liste_titre" align="right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
||||
print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<td class="right liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
@ -151,11 +151,11 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
|
||||
print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -175,15 +175,15 @@ if ($resql)
|
||||
print '<td>'.dol_trunc($obj->label, 42).'</td>';
|
||||
|
||||
// Capital
|
||||
print '<td align="right" width="100">'.price($obj->capital).'</td>';
|
||||
print '<td class="right" width="100">'.price($obj->capital).'</td>';
|
||||
|
||||
// Date start
|
||||
print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
|
||||
print '<td width="110" class="center">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
|
||||
|
||||
// Date end
|
||||
print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
|
||||
print '<td width="110" class="center">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
|
||||
|
||||
print '<td align="right" class="nowrap">'.$loan_static->LibStatut($obj->paid, 5, $obj->alreadypayed).'</a></td>';
|
||||
print '<td class="right nowrap">'.$loan_static->LibStatut($obj->paid, 5, $obj->alreadypayed).'</a></td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."loan_schedule SET fk_bank = 0 WHERE fk_bank = ".$payment->fk_bank;
|
||||
$db->query($sql);
|
||||
|
||||
|
||||
$result = $payment->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -214,9 +214,9 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Loan').'</td>';
|
||||
print '<td>'.$langs->trans('Label').'</td>';
|
||||
// print '<td align="right">'.$langs->trans('ExpectedToPay').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Status').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PayedByThisPayment').'</td>';
|
||||
// print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
|
||||
print '<td class="center">'.$langs->trans('Status').'</td>';
|
||||
print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num > 0)
|
||||
@ -234,13 +234,13 @@ if ($resql)
|
||||
// Label
|
||||
print '<td>'.$objp->label.'</td>';
|
||||
// Expected to pay
|
||||
// print '<td align="right">'.price($objp->capital).'</td>';
|
||||
// print '<td class="right">'.price($objp->capital).'</td>';
|
||||
// Status
|
||||
print '<td align="center">'.$loan->getLibStatut(4, $objp->amount_capital).'</td>';
|
||||
print '<td class="center">'.$loan->getLibStatut(4, $objp->amount_capital).'</td>';
|
||||
// Amount payed
|
||||
$amount_payed = $objp->amount_capital + $objp->amount_insurance + $objp->amount_interest;
|
||||
|
||||
print '<td align="right">'.price($amount_payed).'</td>';
|
||||
print '<td class="right">'.price($amount_payed).'</td>';
|
||||
print "</tr>\n";
|
||||
if ($objp->paid == 1) // If at least one invoice is paid, disable delete
|
||||
{
|
||||
|
||||
@ -279,30 +279,30 @@ if ($action == 'create')
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="left">'.$langs->trans("DateDue").'</td>';
|
||||
print '<td align="right">'.$langs->trans("LoanCapital").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AlreadyPaid").'</td>';
|
||||
print '<td align="right">'.$langs->trans("RemainderToPay").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LoanCapital").'</td>';
|
||||
print '<td class="right">'.$langs->trans("AlreadyPaid").'</td>';
|
||||
print '<td class="right">'.$langs->trans("RemainderToPay").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if ($loan->datestart > 0)
|
||||
{
|
||||
print '<td align="left" valign="center">'.dol_print_date($loan->datestart, 'day').'</td>';
|
||||
print '<td class="left" valign="center">'.dol_print_date($loan->datestart, 'day').'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center" valign="center"><b>!!!</b></td>';
|
||||
print '<td class="center" valign="center"><b>!!!</b></td>';
|
||||
}
|
||||
|
||||
print '<td align="right" valign="center">'.price($loan->capital)."</td>";
|
||||
print '<td class="right" valign="center">'.price($loan->capital)."</td>";
|
||||
|
||||
print '<td align="right" valign="center">'.price($sumpaid)."</td>";
|
||||
print '<td class="right" valign="center">'.price($sumpaid)."</td>";
|
||||
|
||||
print '<td align="right" valign="center">'.price($loan->capital - $sumpaid)."</td>";
|
||||
print '<td class="right" valign="center">'.price($loan->capital - $sumpaid)."</td>";
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right">';
|
||||
if ($sumpaid < $loan->capital)
|
||||
{
|
||||
print $langs->trans("LoanCapital") .': <input type="text" size="8" name="amount_capital" value="'.$amount_capital.'">';
|
||||
|
||||
@ -45,17 +45,17 @@ $head=loan_prepare_head($object);
|
||||
dol_fiche_head($head, 'FinancialCommitment', $langs->trans("Loan"), -1, 'bill');
|
||||
|
||||
if ($action == 'createecheancier') {
|
||||
|
||||
|
||||
$i=1;
|
||||
while($i <$object->nbterm+1){
|
||||
|
||||
|
||||
$date = GETPOST('hi_date'.$i, 'int');
|
||||
$mens = GETPOST('mens'.$i);
|
||||
$int = GETPOST('hi_interets'.$i);
|
||||
$insurance = GETPOST('hi_insurance'.$i);
|
||||
|
||||
|
||||
$echeance = new LoanSchedule($db);
|
||||
|
||||
|
||||
$echeance->fk_loan = $object->id;
|
||||
$echeance->datec = dol_now();
|
||||
$echeance->tms = dol_now();
|
||||
@ -76,15 +76,15 @@ if ($action == 'createecheancier') {
|
||||
}
|
||||
|
||||
if ($action == 'updateecheancier') {
|
||||
|
||||
|
||||
$i=1;
|
||||
while($i <$object->nbterm+1){
|
||||
|
||||
|
||||
$mens = GETPOST('mens'.$i);
|
||||
$int = GETPOST('hi_interets'.$i);
|
||||
$id = GETPOST('hi_rowid'.$i);
|
||||
$insurance = GETPOST('hi_insurance'.$i);
|
||||
|
||||
|
||||
$echeance = new LoanSchedule($db);
|
||||
$echeance->fetch($id);
|
||||
$echeance->tms = dol_now();
|
||||
@ -154,18 +154,18 @@ print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
$colspan = 6;
|
||||
if (count($echeance->lines)>0) $colspan++;
|
||||
print '<th align="center" colspan="'.$colspan.'">';
|
||||
print '<th class="center" colspan="'.$colspan.'">';
|
||||
print $langs->trans("FinancialCommitment");
|
||||
print '</th>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
Print '<th width="5%" align="center">'.$langs->trans("Term").'</th>';
|
||||
Print '<th width="5%" align="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="15%" align="center">'.$langs->trans("Insurance");
|
||||
Print '<th width="15%" align="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
Print '<th width="10%" align="center">'.$langs->trans("Amount").'</th>';
|
||||
Print '<th width="40%" align="center">'.$langs->trans("CapitalRemain");
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
|
||||
Print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
|
||||
print '<th width="15%" class="center">'.$langs->trans("Insurance");
|
||||
Print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
|
||||
Print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
|
||||
Print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
|
||||
print ' ('.price2num($object->capital).')';
|
||||
print '<input type="hidden" name="hi_capital0" id ="hi_capital0" value="'.$object->capital.'">';
|
||||
print '</th>';
|
||||
@ -187,12 +187,12 @@ if ($object->nbterm > 0 && count($echeance->lines)==0)
|
||||
$insu = ($insurance+(($i == 1) ? $regulInsurance : 0));
|
||||
$cap_rest = price2num($capital - ($mens-$int), 'MT');
|
||||
print '<tr>';
|
||||
print '<td align="center" id="n'.$i.'">' . $i .'</td>';
|
||||
print '<td align="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . dol_time_plus_duree($object->datestart, $i-1, 'm') . '">' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'), 'day') . '</td>';
|
||||
print '<td align="center" id="insurance'.$i.'">'.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . ($insurance+(($i == 1) ? $regulInsurance : 0)) . '">';
|
||||
print '<td align="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
print '<td align="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
print '<td align="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '<td class="center" id="n'.$i.'">' . $i .'</td>';
|
||||
print '<td class="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . dol_time_plus_duree($object->datestart, $i-1, 'm') . '">' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'), 'day') . '</td>';
|
||||
print '<td class="center" id="insurance'.$i.'">'.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . ($insurance+(($i == 1) ? $regulInsurance : 0)) . '">';
|
||||
print '<td class="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
print '<td class="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
print '<td class="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
$capital = $cap_rest;
|
||||
@ -211,20 +211,20 @@ elseif(count($echeance->lines)>0)
|
||||
$int = $line->amount_interest;
|
||||
$insu = ($insurance+(($i == 1) ? $regulInsurance : 0));
|
||||
$cap_rest = price2num($capital - ($mens-$int), 'MT');
|
||||
|
||||
|
||||
print '<tr>';
|
||||
print '<td align="center" id="n'.$i.'"><input type="hidden" name="hi_rowid' .$i .'" id ="hi_rowid' .$i .'" value="' . $line->id . '">' . $i .'</td>';
|
||||
print '<td align="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . $line->datep . '">' . dol_print_date($line->datep, 'day') . '</td>';
|
||||
print '<td align="center" id="insurance'.$i.'">'.price($insu, 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . $insu . '">';
|
||||
print '<td align="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
print '<td class="center" id="n'.$i.'"><input type="hidden" name="hi_rowid' .$i .'" id ="hi_rowid' .$i .'" value="' . $line->id . '">' . $i .'</td>';
|
||||
print '<td class="center" id ="date' .$i .'"><input type="hidden" name="hi_date' .$i .'" id ="hi_date' .$i .'" value="' . $line->datep . '">' . dol_print_date($line->datep, 'day') . '</td>';
|
||||
print '<td class="center" id="insurance'.$i.'">'.price($insu, 0, '', 1).' €</td><input type="hidden" name="hi_insurance' .$i .'" id ="hi_insurance' .$i .'" value="' . $insu . '">';
|
||||
print '<td class="center" id="interets'.$i.'">'.price($int, 0, '', 1).' €</td><input type="hidden" name="hi_interets' .$i .'" id ="hi_interets' .$i .'" value="' . $int . '">';
|
||||
if($line->datep > dol_now() && empty($line->fk_bank)){
|
||||
print '<td align="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
print '<td class="center"><input name="mens'.$i.'" id="mens'.$i.'" size="5" value="'.$mens.'" ech="'.$i.'"> €</td>';
|
||||
}else{
|
||||
print '<td align="center">' . price($mens) . ' €</td><input type="hidden" name="mens' .$i .'" id ="mens' .$i .'" value="' . $mens . '">';
|
||||
print '<td class="center">' . price($mens) . ' €</td><input type="hidden" name="mens' .$i .'" id ="mens' .$i .'" value="' . $mens . '">';
|
||||
}
|
||||
|
||||
print '<td align="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '<td align="center">';
|
||||
|
||||
print '<td class="center" id="capital'.$i.'">'.price($cap_rest).' €</td><input type="hidden" name="hi_capital' .$i .'" id ="hi_capital' .$i .'" value="' . $cap_rest . '">';
|
||||
print '<td class="center">';
|
||||
if (!empty($line->fk_bank)) print $langs->trans('Paid');
|
||||
elseif (!$printed)
|
||||
{
|
||||
@ -243,7 +243,7 @@ print '</br>';
|
||||
print '</br>';
|
||||
if (count($echeance->lines)==0) $label = $langs->trans("Create");
|
||||
else $label = $langs->trans("Save");
|
||||
print '<div align="center"><input class="button" type="submit" value="'.$label.'"></div>';
|
||||
print '<div class="center"><input class="button" type="submit" value="'.$label.'"></div>';
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
|
||||
Loading…
Reference in New Issue
Block a user