diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index 7e3d1f83a8f..c741dfa13c9 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -44,7 +44,7 @@ $object = new LoanSchedule($db); $int = ($capital*($rate/12)); $int = round($int, 2, PHP_ROUND_HALF_UP); $cap_rest = round($capital - ($mens-$int), 2, PHP_ROUND_HALF_UP); -$output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest),'interet'=>$int,'interet_str'=>price($int, 0, '', 1),'mens'=>$mens); +$output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest, 0, '', 1, -1, -1, $conf->currency),'interet'=>$int,'interet_str'=>price($int, 0, '', 1, -1, -1, $conf->currency),'mens'=>$mens); $echance++; $capital=$cap_rest; @@ -56,7 +56,7 @@ while ($echance<=$nbterm) { $int = round($int, 2, PHP_ROUND_HALF_UP); $cap_rest = round($capital - ($mens-$int), 2, PHP_ROUND_HALF_UP); - $output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest),'interet'=>$int,'interet_str'=>price($int, 0, '', 1),'mens'=>$mens); + $output[$echance]=array('cap_rest'=>$cap_rest,'cap_rest_str'=>price($cap_rest, 0, '', 1, -1, -1, $conf->currency),'interet'=>$int,'interet_str'=>price($int, 0, '', 1, -1, -1, $conf->currency),'mens'=>$mens); $capital=$cap_rest; $echance++; diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 1c9cb9d8c3f..d4e7dec9feb 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -44,6 +44,47 @@ llxHeader("", $title, $help_url); $head=loan_prepare_head($object); dol_fiche_head($head, 'FinancialCommitment', $langs->trans("Loan"), -1, 'bill'); +$linkback = '' . $langs->trans("BackToList") . ''; + +$morehtmlref='
'; +// Ref loan +$morehtmlref.=$form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1); +$morehtmlref.=$form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1); +// Project +if (! empty($conf->projet->enabled)) +{ + $langs->loadLangs(array("projects")); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->loan->write) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } +} +$morehtmlref.='
'; +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + if ($action == 'createecheancier') { $i=1; @@ -128,9 +169,9 @@ $(document).ready(function() { var interet_res_str='#interets'+index; var men_res='#mens'+index; $(idcap_res).val(element.cap_rest); - $(idcap_res_srt).text(element.cap_rest_str+' €'); + $(idcap_res_srt).text(element.cap_rest_str); $(interet_res).val(element.interet); - $(interet_res_str).text(element.interet_str+' €'); + $(interet_res_str).text(element.interet_str); $(men_res).val(element.mens); }); } @@ -166,7 +207,7 @@ print ''.$langs->trans("Insurance"); print ''.$langs->trans("InterestAmount").''; print ''.$langs->trans("Amount").''; print ''.$langs->trans("CapitalRemain"); -print ' ('.price2num($object->capital).')'; +print '
('.price($object->capital, 0, '', 1, -1, -1, $conf->currency).')'; print ''; print ''; if (count($echeance->lines)>0) print ''.$langs->trans('DoPayment').''; @@ -189,10 +230,10 @@ if ($object->nbterm > 0 && count($echeance->lines)==0) print ''; print '' . $i .''; print '' . dol_print_date(dol_time_plus_duree($object->datestart, $i-1, 'm'), 'day') . ''; - print ''.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1).' €'; - print ''.price($int, 0, '', 1).' €'; - print ' €'; - print ''.price($cap_rest).' €'; + print ''.price($insurance+(($i == 1) ? $regulInsurance : 0), 0, '', 1, -1, -1, $conf->currency).''; + print ''.price($int, 0, '', 1, -1, -1, $conf->currency).''; + print ''; + print ''.price($cap_rest).''; print ''."\n"; $i++; $capital = $cap_rest; @@ -215,15 +256,15 @@ elseif(count($echeance->lines)>0) print ''; print '' . $i .''; print '' . dol_print_date($line->datep, 'day') . ''; - print ''.price($insu, 0, '', 1).' €'; - print ''.price($int, 0, '', 1).' €'; + print ''.price($insu, 0, '', 1, -1, -1, $conf->currency).''; + print ''.price($int, 0, '', 1, -1, -1, $conf->currency).''; if($line->datep > dol_now() && empty($line->fk_bank)){ - print ' €'; + print ''; }else{ - print '' . price($mens) . ' €'; + print '' . price($mens, 0, '', 1, -1, -1, $conf->currency) . ''; } - print ''.price($cap_rest).' €'; + print ''.price($cap_rest, 0, '', 1, -1, -1, $conf->currency).''; print ''; if (!empty($line->fk_bank)) print $langs->trans('Paid'); elseif (!$printed)