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) {
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) {
198 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
201 $object->datestart = $datestart;
208 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
209 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
210 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
212 if ($accountancy_account_capital <= 0) {
215 $object->account_capital = $accountancy_account_capital;
217 if ($accountancy_account_insurance <= 0) {
218 $object->account_insurance =
'';
220 $object->account_insurance = $accountancy_account_insurance;
222 if ($accountancy_account_interest <= 0) {
223 $object->account_interest =
'';
225 $object->account_interest = $accountancy_account_interest;
229 $result =
$object->update($user);
232 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
239 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
245 if ($action ==
'classin' && $permissiontoadd) {
247 $result =
$object->setProject($projectid);
253 if ($action ==
'setlabel' && $permissiontoadd) {
255 $result =
$object->setValueFrom(
'label',
GETPOST(
'label'),
'',
null,
'text',
'', $user,
'LOAN_MODIFY');
262 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
270$form =
new Form($db);
273$outputlangs = $langs;
274if (isModEnabled(
'accounting')) {
277$title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Card");
278$help_url =
'EN:Module_Loan|FR:Module_Emprunt';
280llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-loan page-card');
284if ($action ==
'create') {
286 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
292 print
'<form name="loan" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
293 print
'<input type="hidden" name="token" value="'.newToken().
'">';
294 print
'<input type="hidden" name="action" value="add">';
298 print
'<table class="border centpercent">';
301 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>';
304 if (isModEnabled(
"bank")) {
305 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccount").
'</td><td>';
306 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"courant=1", 1);
309 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
310 print $langs->trans(
"NoBankAccountDefined");
315 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
319 print
'<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
320 print $form->selectDate(!empty($datestart) ? $datestart : -1,
'start', 0, 0, 0,
'add', 1, 1);
325 print
'<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
326 print $form->selectDate(!empty($dateend) ? $dateend : -1,
'end', 0, 0, 0,
'add', 1, 1);
330 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
333 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
336 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>';
339 if (isModEnabled(
'project')) {
343 $langs->loadLangs(array(
"projects"));
345 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
347 $numproject = $formproject->select_projects(-1, $projectid,
'projectid', 16, 0, 1, 1);
354 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
357 $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%');
358 print $doleditor->Create(1);
364 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
366 $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%');
367 print $doleditor->Create(1);
371 if (isModEnabled(
'accounting')) {
374 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
376 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL'),
'accountancy_account_capital', 1,
'', 1, 1);
380 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
382 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'),
'accountancy_account_insurance', 1,
'', 1, 1);
386 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
388 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INTEREST'),
'accountancy_account_interest', 1,
'', 1, 1);
393 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
394 print
'<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
398 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
399 print
'<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
403 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
404 print
'<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
411 print $form->buttonsSaveCancel(
"Add");
424 $totalpaid =
$object->getSumPayment();
427 if ($action ==
'paid') {
428 $text = $langs->trans(
'ConfirmPayLoan');
429 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
432 if ($action ==
'delete') {
433 $text = $langs->trans(
'ConfirmDeleteLoan');
434 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
437 if ($action ==
'edit') {
438 print
'<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
439 print
'<input type="hidden" name="token" value="'.newToken().
'">';
440 print
'<input type="hidden" name="action" value="update">';
441 print
'<input type="hidden" name="id" value="'.$id.
'">';
444 print
dol_get_fiche_head($head,
'card', $langs->trans(
"Loan"), -1,
'money-bill-alt', 0,
'',
'', 0,
'', 1);
447 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
449 $morehtmlref =
'<div class="refidno">';
451 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label,
$object, $user->hasRight(
'loan',
'write'),
'string',
'', 0, 1);
452 $morehtmlref .= $form->editfieldval(
"Label",
'label',
$object->label,
$object, $user->hasRight(
'loan',
'write'),
'string',
'',
null,
null,
'', 1);
454 if (isModEnabled(
'project')) {
455 $langs->loadLangs(array(
"projects"));
456 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
457 if ($user->hasRight(
'loan',
'write')) {
458 if ($action !=
'classify') {
459 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
461 if ($action ==
'classify') {
464 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
465 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
466 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
467 $morehtmlref .= $formproject->select_projects(-1,
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
468 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
469 $morehtmlref .=
'</form>';
471 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, -1,
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
474 if (!empty(
$object->fk_project)) {
476 $proj->fetch(
$object->fk_project);
477 $morehtmlref .=
' : '.$proj->getNomUrl(1);
479 $morehtmlref .=
' - '.$proj->title;
486 $morehtmlref .=
'</div>';
488 $object->totalpaid = $totalpaid;
490 dol_banner_tab(
$object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
492 print
'<div class="fichecenter">';
493 print
'<div class="fichehalfleft">';
494 print
'<div class="underbanner clearboth"></div>';
496 print
'<table class="border centpercent tableforfield">';
499 if ($action ==
'edit') {
500 print
'<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
501 print
'<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
504 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>';
508 if ($action ==
'edit') {
509 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
510 print
'<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
513 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>';
517 print
'<tr><td>'.$langs->trans(
"DateStart").
"</td>";
519 if ($action ==
'edit') {
520 print $form->selectDate(
$object->datestart,
'start', 0, 0, 0,
'update', 1, 0);
527 print
'<tr><td>'.$langs->trans(
"DateEnd").
"</td>";
529 if ($action ==
'edit') {
530 print $form->selectDate(
$object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
537 print
'<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
539 if ($action ==
'edit') {
540 print
'<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
547 print
'<tr><td>'.$langs->trans(
"Rate").
'</td>';
549 if ($action ==
'edit') {
550 print
'<input name="rate" size="4" value="'.$object->rate.
'">%';
558 if ($action ==
'edit') {
559 print
'<td class="nowrap fieldrequired">';
560 print $langs->trans(
"LoanAccountancyCapitalCode");
563 if (isModEnabled(
'accounting')) {
565 print $formaccounting->select_account(
$object->account_capital,
'accountancy_account_capital', 1,
'', 1, 1);
567 print
'<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
571 print
'<td class="nowrap">';
572 print $langs->trans(
"LoanAccountancyCapitalCode");
575 if (isModEnabled(
'accounting')) {
577 $accountingaccount->fetch(
'',
$object->account_capital, 1);
579 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
581 print
$object->account_capital;
590 if ($action ==
'edit') {
591 print
'<td class="nowrap fieldrequired">';
592 print $langs->trans(
"LoanAccountancyInsuranceCode");
595 if (isModEnabled(
'accounting')) {
597 print $formaccounting->select_account(
$object->account_insurance,
'accountancy_account_insurance', 1,
'', 1, 1);
599 print
'<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
603 print
'<td class="nowrap">';
604 print $langs->trans(
"LoanAccountancyInsuranceCode");
607 if (isModEnabled(
'accounting')) {
609 $accountingaccount->fetch(
'',
$object->account_insurance, 1);
611 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
613 print
$object->account_insurance;
622 if ($action ==
'edit') {
623 print
'<td class="nowrap fieldrequired">';
624 print $langs->trans(
"LoanAccountancyInterestCode");
627 if (isModEnabled(
'accounting')) {
629 print $formaccounting->select_account(
$object->account_interest,
'accountancy_account_interest', 1,
'', 1, 1);
631 print
'<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
635 print
'<td class="nowrap">';
636 print $langs->trans(
"LoanAccountancyInterestCode");
639 if (isModEnabled(
'accounting')) {
641 $accountingaccount->fetch(
'',
$object->account_interest, 1);
643 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
645 print
$object->account_interest;
653 $parameters = array();
654 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
655 print $hookmanager->resPrint;
660 print
'<div class="fichehalfright">';
665 $sql =
"SELECT p.rowid, p.num_payment, p.datep as dp,";
666 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
667 $sql .=
" b.fk_account,";
668 $sql .=
" c.libelle as paiement_type";
669 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
670 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
671 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id,";
672 $sql .=
" ".MAIN_DB_PREFIX.
"loan as l";
673 $sql .=
" WHERE p.fk_loan = ".((int) $id);
674 $sql .=
" AND p.fk_loan = l.rowid";
675 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
676 $sql .=
" ORDER BY dp DESC";
679 $resql = $db->query($sql);
681 $num = $db->num_rows($resql);
683 $total_insurance = 0;
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>';
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";
722 $total_capital += $objp->amount_capital;
726 $totalpaid = $total_capital;
729 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>';
730 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>';
732 $staytopay =
$object->capital - $totalpaid;
734 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
735 print
'<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
736 print
price($staytopay, 0, $langs, 0, -1, -1,
$conf->currency);
750 print
'<div class="clearboth"></div>';
754 if ($action ==
'edit') {
755 print $form->buttonsSaveCancel();
763 if ($action !=
'edit') {
764 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
765 if (empty($reshook)) {
766 print
'<div class="tabsAction">';
769 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'write')) {
770 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>';
775 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>';
779 if ((
$object->paid == 0 ||
$object->paid == 2) && round($staytopay) <= 0 && $user->hasRight(
'loan',
'write')) {
780 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>';
784 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'delete')) {
785 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
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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.
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.
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.