29require
'../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/loan.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
50 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
54$langs->loadLangs(array(
"banks",
"bills",
"compta",
"loan"));
57$action =
GETPOST(
'action',
'aZ09');
59$cancel =
GETPOST(
'cancel',
'alpha');
69$hookmanager->initHooks(array(
'loancard',
'globalcard'));
74$permissiontoadd = $user->hasRight(
'loan',
'write');
85$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
91 if ($action ==
'confirm_paid' && $confirm ==
'yes' && $permissiontoadd) {
93 $result =
$object->setPaid($user);
102 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontoadd) {
104 $result =
$object->delete($user);
107 header(
"Location: list.php");
115 if ($action ==
'add' && $permissiontoadd) {
126 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
131 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateStart")),
null,
'errors');
136 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateEnd")),
null,
'errors');
141 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Rate")),
null,
'errors');
148 $object->datestart = $datestart;
157 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
158 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
159 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
161 if ($accountancy_account_capital <= 0) {
164 $object->account_capital = $accountancy_account_capital;
166 if ($accountancy_account_insurance <= 0) {
167 $object->account_insurance =
'';
169 $object->account_insurance = $accountancy_account_insurance;
171 if ($accountancy_account_interest <= 0) {
172 $object->account_interest =
'';
174 $object->account_interest = $accountancy_account_interest;
185 header(
"Location: list.php");
188 } elseif ($action ==
'update' && $permissiontoadd) {
199 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
202 $object->datestart = $datestart;
210 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
211 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
212 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
214 if ($accountancy_account_capital <= 0) {
217 $object->account_capital = $accountancy_account_capital;
219 if ($accountancy_account_insurance <= 0) {
220 $object->account_insurance =
'';
222 $object->account_insurance = $accountancy_account_insurance;
224 if ($accountancy_account_interest <= 0) {
225 $object->account_interest =
'';
227 $object->account_interest = $accountancy_account_interest;
231 $result =
$object->update($user);
234 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
241 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
247 if ($action ==
'classin' && $permissiontoadd) {
249 $result =
$object->setProject($projectid);
255 if ($action ==
'setlabel' && $permissiontoadd) {
257 $result =
$object->setValueFrom(
'label',
GETPOST(
'label'),
'',
null,
'text',
'', $user,
'LOAN_MODIFY');
264 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
275$outputlangs = $langs;
276$formaccounting =
null;
280$title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Card");
281$help_url =
'EN:Module_Loan|FR:Module_Emprunt';
283llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-loan page-card');
287if ($action ==
'create') {
289 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
293 print
'<form name="loan" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
294 print
'<input type="hidden" name="token" value="'.newToken().
'">';
295 print
'<input type="hidden" name="action" value="add">';
299 print
'<table class="border centpercent">';
302 print
'<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
"Label").
'</td><td><input name="label" class="minwidth300" maxlength="255" value="'.
dol_escape_htmltag(
GETPOST(
'label')).
'" autofocus="autofocus"></td></tr>';
306 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccount").
'</td><td>';
307 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"(courant:=:1)", 1);
310 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
311 print $langs->trans(
"NoBankAccountDefined");
316 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
320 print
'<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
321 print $form->selectDate(!empty($datestart) ? $datestart : -1,
'start', 0, 0, 0,
'add', 1, 1);
326 print
'<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
327 print $form->selectDate(!empty($dateend) ? $dateend : -1,
'end', 0, 0, 0,
'add', 1, 1);
331 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
334 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
337 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>';
344 $langs->loadLangs(array(
"projects"));
346 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
348 $formproject->select_projects(-1, (
string) $projectid,
'projectid', 16, 0, 1, 1);
355 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
358 $doleditor =
new DolEditor(
'note_private',
GETPOST(
'note_private',
'alpha'),
'', 160,
'dolibarr_notes',
'In',
false,
true, !
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_6,
'90%');
359 print $doleditor->Create(1);
365 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
367 $doleditor =
new DolEditor(
'note_public',
GETPOST(
'note_public',
'alpha'),
'', 160,
'dolibarr_notes',
'In',
false,
true, !
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_6,
'90%');
368 print $doleditor->Create(1);
372 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
375 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
377 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL'),
'accountancy_account_capital', 1, array(), 1, 1);
381 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
383 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'),
'accountancy_account_insurance', 1, array(), 1, 1);
387 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
389 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INTEREST'),
'accountancy_account_interest', 1, array(), 1, 1);
394 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
395 print
'<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
399 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
400 print
'<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
404 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
405 print
'<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
412 print $form->buttonsSaveCancel(
"Add");
425 $totalpaid =
$object->getSumPayment();
428 if ($action ==
'paid') {
429 $text = $langs->trans(
'ConfirmPayLoan');
430 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
433 if ($action ==
'delete') {
434 $text = $langs->trans(
'ConfirmDeleteLoan');
435 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
438 if ($action ==
'edit') {
439 print
'<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
440 print
'<input type="hidden" name="token" value="'.newToken().
'">';
441 print
'<input type="hidden" name="action" value="update">';
442 print
'<input type="hidden" name="id" value="'.$id.
'">';
445 print
dol_get_fiche_head($head,
'card', $langs->trans(
"Loan"), -1,
'money-bill-alt', 0,
'',
'', 0,
'', 1);
448 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
450 $morehtmlref =
'<div class="refidno">';
452 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label, $object, $user->hasRight(
'loan',
'write'),
'string',
'', 0, 1);
453 $morehtmlref .= $form->editfieldval(
"Label",
'label',
$object->label, $object, $user->hasRight(
'loan',
'write'),
'string',
'',
null,
null,
'', 1);
456 $langs->loadLangs(array(
"projects"));
457 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
458 if ($user->hasRight(
'loan',
'write')) {
459 if ($action !=
'classify') {
460 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
462 if ($action ==
'classify') {
465 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
466 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
467 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
468 $morehtmlref .= $formproject->select_projects(-1, (
string)
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
469 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
470 $morehtmlref .=
'</form>';
472 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, -1, (
string)
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
475 if (!empty(
$object->fk_project)) {
477 $proj->fetch(
$object->fk_project);
478 $morehtmlref .=
' : '.$proj->getNomUrl(1);
480 $morehtmlref .=
' - '.$proj->title;
487 $morehtmlref .=
'</div>';
489 $object->totalpaid = $totalpaid;
491 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
493 print
'<div class="fichecenter">';
494 print
'<div class="fichehalfleft">';
495 print
'<div class="underbanner clearboth"></div>';
497 print
'<table class="border centpercent tableforfield">';
500 if ($action ==
'edit') {
501 print
'<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
502 print
'<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
505 print
'<tr><td class="titlefield">'.$langs->trans(
"LoanCapital").
'</td><td><span class="amount">'.
price(
$object->capital, 0, $outputlangs, 1, -1, -1,
$conf->currency).
'</span></td></tr>';
509 if ($action ==
'edit') {
510 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
511 print
'<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
514 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td><span class="amount">'.
price(
$object->insurance_amount, 0, $outputlangs, 1, -1, -1,
$conf->currency).
'</span></td></tr>';
518 print
'<tr><td>'.$langs->trans(
"DateStart").
"</td>";
520 if ($action ==
'edit') {
521 print $form->selectDate(
$object->datestart,
'start', 0, 0, 0,
'update', 1, 0);
528 print
'<tr><td>'.$langs->trans(
"DateEnd").
"</td>";
530 if ($action ==
'edit') {
531 print $form->selectDate(
$object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
538 print
'<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
540 if ($action ==
'edit') {
541 print
'<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
548 print
'<tr><td>'.$langs->trans(
"Rate").
'</td>';
550 if ($action ==
'edit') {
551 print
'<input name="rate" size="4" value="'.$object->rate.
'">%';
559 if ($action ==
'edit') {
560 print
'<td class="nowrap fieldrequired">';
561 print $langs->trans(
"LoanAccountancyCapitalCode");
564 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
566 print $formaccounting->select_account(
$object->account_capital,
'accountancy_account_capital', 1, array(), 1, 1);
568 print
'<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
572 print
'<td class="nowrap">';
573 print $langs->trans(
"LoanAccountancyCapitalCode");
578 $accountingaccount->fetch(0,
$object->account_capital, 1);
580 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
582 print
$object->account_capital;
591 if ($action ==
'edit') {
592 print
'<td class="nowrap fieldrequired">';
593 print $langs->trans(
"LoanAccountancyInsuranceCode");
596 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
598 print $formaccounting->select_account(
$object->account_insurance,
'accountancy_account_insurance', 1, array(), 1, 1);
600 print
'<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
604 print
'<td class="nowrap">';
605 print $langs->trans(
"LoanAccountancyInsuranceCode");
610 $accountingaccount->fetch(0,
$object->account_insurance, 1);
612 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
614 print
$object->account_insurance;
623 if ($action ==
'edit') {
624 print
'<td class="nowrap fieldrequired">';
625 print $langs->trans(
"LoanAccountancyInterestCode");
628 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
630 print $formaccounting->select_account(
$object->account_interest,
'accountancy_account_interest', 1, array(), 1, 1);
632 print
'<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
636 print
'<td class="nowrap">';
637 print $langs->trans(
"LoanAccountancyInterestCode");
642 $accountingaccount->fetch(0,
$object->account_interest, 1);
644 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
646 print
$object->account_interest;
654 $parameters = array();
655 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
656 print $hookmanager->resPrint;
661 print
'<div class="fichehalfright">';
666 $sql =
"SELECT p.rowid, p.num_payment, p.datep as dp,";
667 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
668 $sql .=
" b.fk_account,";
669 $sql .=
" c.libelle as paiement_type";
670 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
671 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
672 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id,";
673 $sql .=
" ".MAIN_DB_PREFIX.
"loan as l";
674 $sql .=
" WHERE p.fk_loan = ".((int) $id);
675 $sql .=
" AND p.fk_loan = l.rowid";
676 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
677 $sql .=
" ORDER BY dp DESC";
680 $resql =
$db->query($sql);
682 $num =
$db->num_rows($resql);
686 print
'<div class="div-table-responsive-no-min">';
687 print
'<table class="noborder paymenttable">';
688 print
'<tr class="liste_titre">';
689 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
690 print
'<td>'.$langs->trans(
"Date").
'</td>';
691 print
'<td>'.$langs->trans(
"Type").
'</td>';
692 print
'<td>'.$langs->trans(
"BankAccount").
'</td>';
693 print
'<td class="right">'.$langs->trans(
"Insurance").
'</td>';
694 print
'<td class="right">'.$langs->trans(
"Interest").
'</td>';
695 print
'<td class="right">'.$langs->trans(
"LoanCapital").
'</td>';
696 print
'<td class="right">'.$langs->trans(
"Total").
'</td>';
699 $conf->cache[
'bankaccount'] = array();
702 $objp =
$db->fetch_object($resql);
704 print
'<tr class="oddeven">';
705 print
'<td><a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
706 print
'<td>'.dol_print_date(
$db->jdate($objp->dp),
'day').
"</td>\n";
707 print
"<td>".$objp->paiement_type.
' '.$objp->num_payment.
"</td>\n";
709 if (!empty(
$conf->cache[
'bankaccount'][$objp->fk_account])) {
710 $tmpbank =
$conf->cache[
'bankaccount'][$objp->fk_account];
713 $tmpbank->fetch($objp->fk_account);
714 $conf->cache[
'bankaccount'][$objp->fk_account] = $tmpbank;
716 print $tmpbank->getNomUrl(1);
718 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
719 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
720 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
721 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_insurance + $objp->amount_interest + $objp->amount_capital, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
723 $total_capital += $objp->amount_capital;
727 $totalpaid = $total_capital;
730 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"AlreadyPaid").
' :</td><td class="nowrap right">'.
price($totalpaid, 0, $langs, 0, -1, -1,
$conf->currency).
'</td><td> </td></tr>';
731 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"AmountExpected").
' :</td><td class="nowrap right">'.
price(
$object->capital, 0, $outputlangs, 1, -1, -1,
$conf->currency).
'</td><td> </td></tr>';
733 $staytopay =
$object->capital - $totalpaid;
735 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
736 print
'<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
737 print
price($staytopay, 0, $langs, 0, -1, -1,
$conf->currency);
739 print
'<td> </td>';
753 print
'<div class="clearboth"></div>';
757 if ($action ==
'edit') {
758 print $form->buttonsSaveCancel();
766 if ($action !=
'edit') {
767 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
768 if (empty($reshook)) {
769 print
'<div class="tabsAction">';
772 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'write')) {
773 print
'<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/loan/card.php?id='.
$object->id.
'&action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a></div>';
779 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>';
783 if ((
$object->paid == 0 ||
$object->paid == 2) && round($staytopay) <= 0 && $user->hasRight(
'loan',
'write')) {
784 print
'<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/loan/card.php?id='.
$object->id.
'&action=paid&token='.newToken().
'">'.$langs->trans(
"ClassifyPaid").
'</a></div>';
788 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'delete')) {
789 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="'.DOL_URL_ROOT.
'/loan/card.php?id='.
$object->id.
'&action=delete&token='.newToken().
'">'.$langs->trans(
"Delete").
'</a></div>';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class to manage accounting accounts.
Class to manage a WYSIWYG editor.
Class to manage projects.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
loan_prepare_head($object)
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.