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);
87 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
91 if ($action ==
'confirm_paid' && $confirm ==
'yes' && $permissiontoadd) {
93 $result =
$object->setPaid($user);
95 setEventMessages($langs->trans(
'LoanPaid'),
null,
'mesgs');
102 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontoadd) {
105 $result =
$object->delete($user);
107 setEventMessages($langs->trans(
'LoanDeleted'),
null,
'mesgs');
108 header(
"Location: list.php");
116 if ($action ==
'add' && $permissiontoadd) {
127 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
132 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateStart")),
null,
'errors');
137 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateEnd")),
null,
'errors');
142 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Rate")),
null,
'errors');
149 $object->datestart = $datestart;
158 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
159 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
160 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
162 if ($accountancy_account_capital <= 0) {
165 $object->account_capital = $accountancy_account_capital;
167 if ($accountancy_account_insurance <= 0) {
168 $object->account_insurance =
'';
170 $object->account_insurance = $accountancy_account_insurance;
172 if ($accountancy_account_interest <= 0) {
173 $object->account_interest =
'';
175 $object->account_interest = $accountancy_account_interest;
186 header(
"Location: list.php");
189 } elseif ($action ==
'update' && $permissiontoadd) {
200 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
203 $object->datestart = $datestart;
211 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
212 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
213 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
215 if ($accountancy_account_capital <= 0) {
218 $object->account_capital = $accountancy_account_capital;
220 if ($accountancy_account_insurance <= 0) {
221 $object->account_insurance =
'';
223 $object->account_insurance = $accountancy_account_insurance;
225 if ($accountancy_account_interest <= 0) {
226 $object->account_interest =
'';
228 $object->account_interest = $accountancy_account_interest;
232 $result =
$object->update($user);
235 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
242 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
248 if ($action ==
'classin' && $permissiontoadd) {
250 $result =
$object->setProject($projectid);
256 if ($action ==
'setlabel' && $permissiontoadd) {
258 $result =
$object->setValueFrom(
'label',
GETPOST(
'label'),
'',
null,
'text',
'', $user,
'LOAN_MODIFY');
265 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
273$form =
new Form($db);
276$outputlangs = $langs;
277$formaccounting =
null;
281$title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Card");
282$help_url =
'EN:Module_Loan|FR:Module_Emprunt';
284llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-loan page-card');
288if ($action ==
'create') {
290 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
294 print
'<form name="loan" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
295 print
'<input type="hidden" name="token" value="'.newToken().
'">';
296 print
'<input type="hidden" name="action" value="add">';
300 print
'<table class="border centpercent">';
303 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>';
307 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccount").
'</td><td>';
308 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"(courant:=:1)", 1);
311 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
312 print $langs->trans(
"NoBankAccountDefined");
317 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
321 print
'<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
322 print $form->selectDate(!empty($datestart) ? $datestart : -1,
'start', 0, 0, 0,
'add', 1, 1);
327 print
'<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
328 print $form->selectDate(!empty($dateend) ? $dateend : -1,
'end', 0, 0, 0,
'add', 1, 1);
332 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
335 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
338 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>';
345 $langs->loadLangs(array(
"projects"));
347 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
349 $formproject->select_projects(-1, (
string) $projectid,
'projectid', 16, 0, 1, 1);
356 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
359 $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%');
360 print $doleditor->Create(1);
366 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
368 $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%');
369 print $doleditor->Create(1);
373 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
376 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
378 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL'),
'accountancy_account_capital', 1, array(), 1, 1);
382 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
384 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'),
'accountancy_account_insurance', 1, array(), 1, 1);
388 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
390 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INTEREST'),
'accountancy_account_interest', 1, array(), 1, 1);
395 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
396 print
'<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
400 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
401 print
'<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
405 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
406 print
'<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
413 print $form->buttonsSaveCancel(
"Add");
426 $totalpaid =
$object->getSumPayment();
429 if ($action ==
'paid') {
430 $text = $langs->trans(
'ConfirmPayLoan');
431 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
434 if ($action ==
'delete') {
435 $text = $langs->trans(
'ConfirmDeleteLoan');
436 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
439 if ($action ==
'edit') {
440 print
'<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
441 print
'<input type="hidden" name="token" value="'.newToken().
'">';
442 print
'<input type="hidden" name="action" value="update">';
443 print
'<input type="hidden" name="id" value="'.$id.
'">';
446 print
dol_get_fiche_head($head,
'card', $langs->trans(
"Loan"), -1,
'money-bill-alt', 0,
'',
'', 0,
'', ($action ==
'edit' ? 0 : 1));
449 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
451 $morehtmlref =
'<div class="refidno">';
453 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label, $object, $user->hasRight(
'loan',
'write'),
'string',
'', 0, 1);
454 $morehtmlref .= $form->editfieldval(
"Label",
'label',
$object->label, $object, $user->hasRight(
'loan',
'write'),
'string',
'',
null,
null,
'', 1);
457 $langs->loadLangs(array(
"projects"));
458 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
459 if ($user->hasRight(
'loan',
'write')) {
460 if ($action !=
'classify') {
461 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
463 if ($action ==
'classify') {
466 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
467 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
468 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
469 $morehtmlref .= $formproject->select_projects(-1, (
string)
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
470 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
471 $morehtmlref .=
'</form>';
473 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, -1, (
string)
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
476 if (!empty(
$object->fk_project)) {
478 $proj->fetch(
$object->fk_project);
479 $morehtmlref .=
' : '.$proj->getNomUrl(1);
481 $morehtmlref .=
' - '.$proj->title;
488 $morehtmlref .=
'</div>';
490 $object->totalpaid = $totalpaid;
492 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
494 print
'<div class="fichecenter">';
495 print
'<div class="fichehalfleft">';
496 print
'<div class="underbanner clearboth"></div>';
498 print
'<table class="border centpercent tableforfield">';
501 if ($action ==
'edit') {
502 print
'<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
503 print
'<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
506 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>';
510 if ($action ==
'edit') {
511 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
512 print
'<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
515 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>';
519 print
'<tr><td>'.$langs->trans(
"DateStart").
"</td>";
521 if ($action ==
'edit') {
522 print $form->selectDate(
$object->datestart,
'start', 0, 0, 0,
'update', 1, 0);
529 print
'<tr><td>'.$langs->trans(
"DateEnd").
"</td>";
531 if ($action ==
'edit') {
532 print $form->selectDate(
$object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
539 print
'<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
541 if ($action ==
'edit') {
542 print
'<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
549 print
'<tr><td>'.$langs->trans(
"Rate").
'</td>';
551 if ($action ==
'edit') {
552 print
'<input name="rate" size="4" value="'.$object->rate.
'">%';
560 if ($action ==
'edit') {
561 print
'<td class="nowrap fieldrequired">';
562 print $langs->trans(
"LoanAccountancyCapitalCode");
565 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
567 print $formaccounting->select_account(
$object->account_capital,
'accountancy_account_capital', 1, array(), 1, 1);
569 print
'<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
573 print
'<td class="nowrap">';
574 print $langs->trans(
"LoanAccountancyCapitalCode");
579 $accountingaccount->fetch(0,
$object->account_capital, 1);
581 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
583 print
$object->account_capital;
592 if ($action ==
'edit') {
593 print
'<td class="nowrap fieldrequired">';
594 print $langs->trans(
"LoanAccountancyInsuranceCode");
597 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
599 print $formaccounting->select_account(
$object->account_insurance,
'accountancy_account_insurance', 1, array(), 1, 1);
601 print
'<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
605 print
'<td class="nowrap">';
606 print $langs->trans(
"LoanAccountancyInsuranceCode");
611 $accountingaccount->fetch(0,
$object->account_insurance, 1);
613 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
615 print
$object->account_insurance;
624 if ($action ==
'edit') {
625 print
'<td class="nowrap fieldrequired">';
626 print $langs->trans(
"LoanAccountancyInterestCode");
629 if (
isModEnabled(
'accounting') && $formaccounting !==
null) {
631 print $formaccounting->select_account(
$object->account_interest,
'accountancy_account_interest', 1, array(), 1, 1);
633 print
'<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
637 print
'<td class="nowrap">';
638 print $langs->trans(
"LoanAccountancyInterestCode");
643 $accountingaccount->fetch(0,
$object->account_interest, 1);
645 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
647 print
$object->account_interest;
655 $parameters = array();
656 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
657 print $hookmanager->resPrint;
662 print
'<div class="fichehalfright">';
667 $sql =
"SELECT p.rowid, p.num_payment, p.datep as dp,";
668 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
669 $sql .=
" b.fk_account,";
670 $sql .=
" c.libelle as paiement_type";
671 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
672 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
673 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id,";
674 $sql .=
" ".MAIN_DB_PREFIX.
"loan as l";
675 $sql .=
" WHERE p.fk_loan = ".((int) $id);
676 $sql .=
" AND p.fk_loan = l.rowid";
677 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
678 $sql .=
" ORDER BY dp DESC";
681 $resql = $db->query($sql);
683 $num = $db->num_rows($resql);
687 print
'<div class="div-table-responsive-no-min">';
688 print
'<table class="noborder paymenttable">';
689 print
'<tr class="liste_titre">';
690 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
691 print
'<td>'.$langs->trans(
"Date").
'</td>';
692 print
'<td>'.$langs->trans(
"Type").
'</td>';
693 print
'<td>'.$langs->trans(
"BankAccount").
'</td>';
694 print
'<td class="right">'.$langs->trans(
"Insurance").
'</td>';
695 print
'<td class="right">'.$langs->trans(
"Interest").
'</td>';
696 print
'<td class="right">'.$langs->trans(
"LoanCapital").
'</td>';
697 print
'<td class="right">'.$langs->trans(
"Total").
'</td>';
700 $conf->cache[
'bankaccount'] = array();
703 $objp = $db->fetch_object($resql);
705 print
'<tr class="oddeven">';
706 print
'<td><a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$objp->rowid.
'">'.img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
707 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'day').
"</td>\n";
708 print
"<td>".$objp->paiement_type.
' '.$objp->num_payment.
"</td>\n";
710 if (!empty(
$conf->cache[
'bankaccount'][$objp->fk_account])) {
711 $tmpbank =
$conf->cache[
'bankaccount'][$objp->fk_account];
714 $tmpbank->fetch($objp->fk_account);
715 $conf->cache[
'bankaccount'][$objp->fk_account] = $tmpbank;
717 print $tmpbank->getNomUrl(1);
719 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
720 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
721 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
722 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";
724 $total_capital += $objp->amount_capital;
728 $totalpaid = $total_capital;
731 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>';
732 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>';
734 $staytopay =
$object->capital - $totalpaid;
736 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
737 print
'<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
738 print
price($staytopay, 0, $langs, 0, -1, -1,
$conf->currency);
740 print
'<td> </td>';
748 dol_print_error($db);
754 print
'<div class="clearboth"></div>';
758 if ($action ==
'edit') {
759 print $form->buttonsSaveCancel();
767 if ($action !=
'edit') {
768 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
769 if (empty($reshook)) {
770 print
'<div class="tabsAction">';
773 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'write')) {
774 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>';
780 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>';
784 if ((
$object->paid == 0 ||
$object->paid == 2) && round($staytopay) <= 0 && $user->hasRight(
'loan',
'write')) {
785 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>';
789 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'delete')) {
790 print
'<div class="inline-block divButAction">'.dolGetButtonAction($langs->trans(
"Delete"), $langs->trans(
"Delete"),
'delete', DOL_URL_ROOT.
'/loan/card.php?id='.
$object->id.
'&action=delete&token='.
newToken(),
'',
true, array(
'attr' => array(
'class' =>
'reposition'))).
'</div>'.
"\n";
798 dol_print_error(
null,
$object->error);
$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...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
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, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.