29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/loan.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
37if (isModEnabled(
'accounting')) {
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
42if (isModEnabled(
'project')) {
43 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
56$langs->loadLangs(array(
"banks",
"bills",
"compta",
"loan"));
59$action =
GETPOST(
'action',
'aZ09');
61$cancel =
GETPOST(
'cancel',
'alpha');
68 $socid = $user->socid;
70$hookmanager->initHooks(array(
'loancard',
'globalcard'));
75$permissiontoadd = $user->hasRight(
'loan',
'write');
86$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
92 if ($action ==
'confirm_paid' && $confirm ==
'yes' && $permissiontoadd) {
94 $result =
$object->setPaid($user);
103 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontoadd) {
105 $result =
$object->delete($user);
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;
277if (isModEnabled(
'accounting')) {
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';
295 print
'<form name="loan" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
296 print
'<input type="hidden" name="token" value="'.newToken().
'">';
297 print
'<input type="hidden" name="action" value="add">';
301 print
'<table class="border centpercent">';
304 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 if (isModEnabled(
"bank")) {
308 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccount").
'</td><td>';
309 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"courant=1", 1);
312 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
313 print $langs->trans(
"NoBankAccountDefined");
318 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
322 print
'<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
323 print $form->selectDate(!empty($datestart) ? $datestart : -1,
'start', 0, 0, 0,
'add', 1, 1);
328 print
'<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
329 print $form->selectDate(!empty($dateend) ? $dateend : -1,
'end', 0, 0, 0,
'add', 1, 1);
333 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
336 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
339 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>';
342 if (isModEnabled(
'project')) {
346 $langs->loadLangs(array(
"projects"));
348 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
350 $numproject = $formproject->select_projects(-1, $projectid,
'projectid', 16, 0, 1, 1);
357 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
360 $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%');
361 print $doleditor->Create(1);
367 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
369 $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%');
370 print $doleditor->Create(1);
374 if (isModEnabled(
'accounting')) {
377 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
379 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL'),
'accountancy_account_capital', 1,
'', 1, 1);
383 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
385 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'),
'accountancy_account_insurance', 1,
'', 1, 1);
389 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
391 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INTEREST'),
'accountancy_account_interest', 1,
'', 1, 1);
396 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
397 print
'<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
401 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
402 print
'<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
406 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
407 print
'<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
414 print $form->buttonsSaveCancel(
"Add");
427 $totalpaid =
$object->getSumPayment();
430 if ($action ==
'paid') {
431 $text = $langs->trans(
'ConfirmPayLoan');
432 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
435 if ($action ==
'delete') {
436 $text = $langs->trans(
'ConfirmDeleteLoan');
437 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
440 if ($action ==
'edit') {
441 print
'<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
442 print
'<input type="hidden" name="token" value="'.newToken().
'">';
443 print
'<input type="hidden" name="action" value="update">';
444 print
'<input type="hidden" name="id" value="'.$id.
'">';
447 print
dol_get_fiche_head($head,
'card', $langs->trans(
"Loan"), -1,
'money-bill-alt', 0,
'',
'', 0,
'', 1);
450 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
452 $morehtmlref =
'<div class="refidno">';
454 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label,
$object, $user->hasRight(
'loan',
'write'),
'string',
'', 0, 1);
455 $morehtmlref .= $form->editfieldval(
"Label",
'label',
$object->label,
$object, $user->hasRight(
'loan',
'write'),
'string',
'',
null,
null,
'', 1);
457 if (isModEnabled(
'project')) {
458 $langs->loadLangs(array(
"projects"));
459 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
460 if ($user->hasRight(
'loan',
'write')) {
461 if ($action !=
'classify') {
462 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
464 if ($action ==
'classify') {
467 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
468 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
469 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
470 $morehtmlref .= $formproject->select_projects(-1,
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
471 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
472 $morehtmlref .=
'</form>';
474 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, -1,
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
477 if (!empty(
$object->fk_project)) {
479 $proj->fetch(
$object->fk_project);
480 $morehtmlref .=
' : '.$proj->getNomUrl(1);
482 $morehtmlref .=
' - '.$proj->title;
489 $morehtmlref .=
'</div>';
491 $object->totalpaid = $totalpaid;
493 dol_banner_tab(
$object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
495 print
'<div class="fichecenter">';
496 print
'<div class="fichehalfleft">';
497 print
'<div class="underbanner clearboth"></div>';
499 print
'<table class="border centpercent tableforfield">';
502 if ($action ==
'edit') {
503 print
'<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
504 print
'<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
507 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>';
511 if ($action ==
'edit') {
512 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
513 print
'<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
516 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>';
520 print
'<tr><td>'.$langs->trans(
"DateStart").
"</td>";
522 if ($action ==
'edit') {
523 print $form->selectDate(
$object->datestart,
'start', 0, 0, 0,
'update', 1, 0);
530 print
'<tr><td>'.$langs->trans(
"DateEnd").
"</td>";
532 if ($action ==
'edit') {
533 print $form->selectDate(
$object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
540 print
'<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
542 if ($action ==
'edit') {
543 print
'<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
550 print
'<tr><td>'.$langs->trans(
"Rate").
'</td>';
552 if ($action ==
'edit') {
553 print
'<input name="rate" size="4" value="'.$object->rate.
'">%';
561 if ($action ==
'edit') {
562 print
'<td class="nowrap fieldrequired">';
563 print $langs->trans(
"LoanAccountancyCapitalCode");
566 if (isModEnabled(
'accounting')) {
568 print $formaccounting->select_account(
$object->account_capital,
'accountancy_account_capital', 1,
'', 1, 1);
570 print
'<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
574 print
'<td class="nowrap">';
575 print $langs->trans(
"LoanAccountancyCapitalCode");
578 if (isModEnabled(
'accounting')) {
580 $accountingaccount->fetch(
'',
$object->account_capital, 1);
582 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
584 print
$object->account_capital;
593 if ($action ==
'edit') {
594 print
'<td class="nowrap fieldrequired">';
595 print $langs->trans(
"LoanAccountancyInsuranceCode");
598 if (isModEnabled(
'accounting')) {
600 print $formaccounting->select_account(
$object->account_insurance,
'accountancy_account_insurance', 1,
'', 1, 1);
602 print
'<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
606 print
'<td class="nowrap">';
607 print $langs->trans(
"LoanAccountancyInsuranceCode");
610 if (isModEnabled(
'accounting')) {
612 $accountingaccount->fetch(
'',
$object->account_insurance, 1);
614 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
616 print
$object->account_insurance;
625 if ($action ==
'edit') {
626 print
'<td class="nowrap fieldrequired">';
627 print $langs->trans(
"LoanAccountancyInterestCode");
630 if (isModEnabled(
'accounting')) {
632 print $formaccounting->select_account(
$object->account_interest,
'accountancy_account_interest', 1,
'', 1, 1);
634 print
'<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
638 print
'<td class="nowrap">';
639 print $langs->trans(
"LoanAccountancyInterestCode");
642 if (isModEnabled(
'accounting')) {
644 $accountingaccount->fetch(
'',
$object->account_interest, 1);
646 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
648 print
$object->account_interest;
656 $parameters = array();
657 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
658 print $hookmanager->resPrint;
663 print
'<div class="fichehalfright">';
668 $sql =
"SELECT p.rowid, p.num_payment, p.datep as dp,";
669 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
670 $sql .=
" b.fk_account,";
671 $sql .=
" c.libelle as paiement_type";
672 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
673 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
674 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id,";
675 $sql .=
" ".MAIN_DB_PREFIX.
"loan as l";
676 $sql .=
" WHERE p.fk_loan = ".((int) $id);
677 $sql .=
" AND p.fk_loan = l.rowid";
678 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
679 $sql .=
" ORDER BY dp DESC";
682 $resql = $db->query($sql);
684 $num = $db->num_rows($resql);
686 $total_insurance = 0;
690 print
'<div class="div-table-responsive-no-min">';
691 print
'<table class="noborder paymenttable">';
692 print
'<tr class="liste_titre">';
693 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
694 print
'<td>'.$langs->trans(
"Date").
'</td>';
695 print
'<td>'.$langs->trans(
"Type").
'</td>';
696 print
'<td>'.$langs->trans(
"BankAccount").
'</td>';
697 print
'<td class="right">'.$langs->trans(
"Insurance").
'</td>';
698 print
'<td class="right">'.$langs->trans(
"Interest").
'</td>';
699 print
'<td class="right">'.$langs->trans(
"LoanCapital").
'</td>';
702 $conf->cache[
'bankaccount'] = array();
705 $objp = $db->fetch_object($resql);
707 print
'<tr class="oddeven">';
708 print
'<td><a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
709 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'day').
"</td>\n";
710 print
"<td>".$objp->paiement_type.
' '.$objp->num_payment.
"</td>\n";
712 if (!empty(
$conf->cache[
'bankaccount'][$objp->fk_account])) {
713 $tmpbank =
$conf->cache[
'bankaccount'][$objp->fk_account];
716 $tmpbank->fetch($objp->fk_account);
717 $conf->cache[
'bankaccount'][$objp->fk_account] = $tmpbank;
719 print $tmpbank->getNomUrl(1);
721 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
722 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
723 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1,
$conf->currency).
"</span></td>\n";
725 $total_capital += $objp->amount_capital;
729 $totalpaid = $total_capital;
732 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></tr>';
733 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></tr>';
735 $staytopay =
$object->capital - $totalpaid;
737 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
738 print
'<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
739 print
price($staytopay, 0, $langs, 0, -1, -1,
$conf->currency);
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>';
778 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>';
782 if ((
$object->paid == 0 ||
$object->paid == 2) && round($staytopay) <= 0 && $user->hasRight(
'loan',
'write')) {
783 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>';
787 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'delete')) {
788 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>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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)
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.