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';
48$langs->loadLangs(array(
"bills",
"compta",
"loan"));
51$action =
GETPOST(
'action',
'aZ09');
53$cancel =
GETPOST(
'cancel',
'alpha');
60 $socid = $user->socid;
62$hookmanager->initHooks(array(
'loancard',
'globalcard'));
67$permissiontoadd = $user->hasRight(
'loan',
'write');
77$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
83 if ($action ==
'confirm_paid' && $confirm ==
'yes' && $permissiontoadd) {
85 $result =
$object->setPaid($user);
94 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontoadd) {
96 $result =
$object->delete($user);
99 header(
"Location: list.php");
107 if ($action ==
'add' && $permissiontoadd) {
117 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
122 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateStart")),
null,
'errors');
127 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateEnd")),
null,
'errors');
132 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Rate")),
null,
'errors');
139 $object->datestart = $datestart;
148 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
149 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
150 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
152 if ($accountancy_account_capital <= 0) {
155 $object->account_capital = $accountancy_account_capital;
157 if ($accountancy_account_insurance <= 0) {
158 $object->account_insurance =
'';
160 $object->account_insurance = $accountancy_account_insurance;
162 if ($accountancy_account_interest <= 0) {
163 $object->account_interest =
'';
165 $object->account_interest = $accountancy_account_interest;
176 header(
"Location: list.php");
179 } elseif ($action ==
'update' && $permissiontoadd) {
189 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
192 $object->datestart = $datestart;
199 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
200 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
201 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
203 if ($accountancy_account_capital <= 0) {
206 $object->account_capital = $accountancy_account_capital;
208 if ($accountancy_account_insurance <= 0) {
209 $object->account_insurance =
'';
211 $object->account_insurance = $accountancy_account_insurance;
213 if ($accountancy_account_interest <= 0) {
214 $object->account_interest =
'';
216 $object->account_interest = $accountancy_account_interest;
220 $result =
$object->update($user);
223 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
230 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
236 if ($action ==
'classin' && $permissiontoadd) {
238 $result =
$object->setProject($projectid);
244 if ($action ==
'setlabel' && $permissiontoadd) {
246 $result =
$object->setValueFrom(
'label',
GETPOST(
'label'),
'',
null,
'text',
'', $user,
'LOAN_MODIFY');
253 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
261$form =
new Form($db);
264$outputlangs = $langs;
265if (isModEnabled(
'accounting')) {
269$title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Card");
270$help_url =
'EN:Module_Loan|FR:Module_Emprunt';
272llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-loan page-card');
276if ($action ==
'create') {
278 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
284 print
'<form name="loan" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
285 print
'<input type="hidden" name="token" value="'.newToken().
'">';
286 print
'<input type="hidden" name="action" value="add">';
290 print
'<table class="border centpercent">';
293 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>';
296 if (isModEnabled(
"bank")) {
297 print
'<tr><td class="fieldrequired">'.$langs->trans(
"BankAccount").
'</td><td>';
298 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"courant=1", 1);
301 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
302 print $langs->trans(
"NoBankAccountDefined");
307 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
311 print
'<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
312 print $form->selectDate(!empty($datestart) ? $datestart : -1,
'start', 0, 0, 0,
'add', 1, 1);
317 print
'<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
318 print $form->selectDate(!empty($dateend) ? $dateend : -1,
'end', 0, 0, 0,
'add', 1, 1);
322 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
325 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
328 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>';
331 if (isModEnabled(
'project')) {
335 $langs->loadLangs(array(
"projects"));
337 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
339 $numproject = $formproject->select_projects(-1, $projectid,
'projectid', 16, 0, 1, 1);
346 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
349 $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%');
350 print $doleditor->Create(1);
356 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
358 $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%');
359 print $doleditor->Create(1);
363 if (isModEnabled(
'accounting')) {
365 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
367 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL'),
'accountancy_account_capital', 1,
'', 1, 1);
371 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
373 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'),
'accountancy_account_insurance', 1,
'', 1, 1);
377 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
379 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') :
getDolGlobalString(
'LOAN_ACCOUNTING_ACCOUNT_INTEREST'),
'accountancy_account_interest', 1,
'', 1, 1);
384 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
385 print
'<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
389 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
390 print
'<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
394 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
395 print
'<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
402 print $form->buttonsSaveCancel(
"Add");
415 $totalpaid =
$object->getSumPayment();
418 if ($action ==
'paid') {
419 $text = $langs->trans(
'ConfirmPayLoan');
420 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
423 if ($action ==
'delete') {
424 $text = $langs->trans(
'ConfirmDeleteLoan');
425 print $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
428 if ($action ==
'edit') {
429 print
'<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
430 print
'<input type="hidden" name="token" value="'.newToken().
'">';
431 print
'<input type="hidden" name="action" value="update">';
432 print
'<input type="hidden" name="id" value="'.$id.
'">';
435 print
dol_get_fiche_head($head,
'card', $langs->trans(
"Loan"), -1,
'money-bill-alt', 0,
'',
'', 0,
'', 1);
438 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
440 $morehtmlref =
'<div class="refidno">';
442 $morehtmlref .= $form->editfieldkey(
"Label",
'label',
$object->label,
$object, $user->hasRight(
'loan',
'write'),
'string',
'', 0, 1);
443 $morehtmlref .= $form->editfieldval(
"Label",
'label',
$object->label,
$object, $user->hasRight(
'loan',
'write'),
'string',
'',
null,
null,
'', 1);
445 if (isModEnabled(
'project')) {
446 $langs->loadLangs(array(
"projects"));
447 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
448 if ($user->hasRight(
'loan',
'write')) {
449 if ($action !=
'classify') {
450 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
452 if ($action ==
'classify') {
454 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
455 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
456 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
457 $morehtmlref .= $formproject->select_projects(-1,
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
458 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
459 $morehtmlref .=
'</form>';
461 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, -1,
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
464 if (!empty(
$object->fk_project)) {
466 $proj->fetch(
$object->fk_project);
467 $morehtmlref .=
' : '.$proj->getNomUrl(1);
469 $morehtmlref .=
' - '.$proj->title;
476 $morehtmlref .=
'</div>';
478 $object->totalpaid = $totalpaid;
480 dol_banner_tab(
$object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlstatus);
482 print
'<div class="fichecenter">';
483 print
'<div class="fichehalfleft">';
484 print
'<div class="underbanner clearboth"></div>';
486 print
'<table class="border centpercent tableforfield">';
489 if ($action ==
'edit') {
490 print
'<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
491 print
'<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
494 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>';
498 if ($action ==
'edit') {
499 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
500 print
'<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
503 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>';
507 print
'<tr><td>'.$langs->trans(
"DateStart").
"</td>";
509 if ($action ==
'edit') {
510 print $form->selectDate(
$object->datestart,
'start', 0, 0, 0,
'update', 1, 0);
517 print
'<tr><td>'.$langs->trans(
"DateEnd").
"</td>";
519 if ($action ==
'edit') {
520 print $form->selectDate(
$object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
527 print
'<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
529 if ($action ==
'edit') {
530 print
'<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
537 print
'<tr><td>'.$langs->trans(
"Rate").
'</td>';
539 if ($action ==
'edit') {
540 print
'<input name="rate" size="4" value="'.$object->rate.
'">%';
548 if ($action ==
'edit') {
549 print
'<td class="nowrap fieldrequired">';
550 print $langs->trans(
"LoanAccountancyCapitalCode");
553 if (isModEnabled(
'accounting')) {
554 print $formaccounting->select_account(
$object->account_capital,
'accountancy_account_capital', 1,
'', 1, 1);
556 print
'<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
560 print
'<td class="nowrap">';
561 print $langs->trans(
"LoanAccountancyCapitalCode");
564 if (isModEnabled(
'accounting')) {
566 $accountingaccount->fetch(
'',
$object->account_capital, 1);
568 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
570 print
$object->account_capital;
579 if ($action ==
'edit') {
580 print
'<td class="nowrap fieldrequired">';
581 print $langs->trans(
"LoanAccountancyInsuranceCode");
584 if (isModEnabled(
'accounting')) {
585 print $formaccounting->select_account(
$object->account_insurance,
'accountancy_account_insurance', 1,
'', 1, 1);
587 print
'<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
591 print
'<td class="nowrap">';
592 print $langs->trans(
"LoanAccountancyInsuranceCode");
595 if (isModEnabled(
'accounting')) {
597 $accountingaccount->fetch(
'',
$object->account_insurance, 1);
599 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
601 print
$object->account_insurance;
610 if ($action ==
'edit') {
611 print
'<td class="nowrap fieldrequired">';
612 print $langs->trans(
"LoanAccountancyInterestCode");
615 if (isModEnabled(
'accounting')) {
616 print $formaccounting->select_account(
$object->account_interest,
'accountancy_account_interest', 1,
'', 1, 1);
618 print
'<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
622 print
'<td class="nowrap">';
623 print $langs->trans(
"LoanAccountancyInterestCode");
626 if (isModEnabled(
'accounting')) {
628 $accountingaccount->fetch(
'',
$object->account_interest, 1);
630 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
632 print
$object->account_interest;
640 $parameters = array();
641 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters,
$object, $action);
642 print $hookmanager->resPrint;
647 print
'<div class="fichehalfright">';
652 $sql =
"SELECT p.rowid, p.num_payment, p.datep as dp,";
653 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
654 $sql .=
" b.fk_account,";
655 $sql .=
" c.libelle as paiement_type";
656 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
657 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON p.fk_bank = b.rowid";
658 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id,";
659 $sql .=
" ".MAIN_DB_PREFIX.
"loan as l";
660 $sql .=
" WHERE p.fk_loan = ".((int) $id);
661 $sql .=
" AND p.fk_loan = l.rowid";
662 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
663 $sql .=
" ORDER BY dp DESC";
666 $resql = $db->query($sql);
668 $num = $db->num_rows($resql);
670 $total_insurance = 0;
674 print
'<div class="div-table-responsive-no-min">';
675 print
'<table class="noborder paymenttable">';
676 print
'<tr class="liste_titre">';
677 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
678 print
'<td>'.$langs->trans(
"Date").
'</td>';
679 print
'<td>'.$langs->trans(
"Type").
'</td>';
680 print
'<td>'.$langs->trans(
"BankAccount").
'</td>';
681 print
'<td class="right">'.$langs->trans(
"Insurance").
'</td>';
682 print
'<td class="right">'.$langs->trans(
"Interest").
'</td>';
683 print
'<td class="right">'.$langs->trans(
"LoanCapital").
'</td>';
686 $conf->cache[
'bankaccount'] = array();
689 $objp = $db->fetch_object($resql);
691 print
'<tr class="oddeven">';
692 print
'<td><a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
693 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'day').
"</td>\n";
694 print
"<td>".$objp->paiement_type.
' '.$objp->num_payment.
"</td>\n";
696 if (!empty($conf->cache[
'bankaccount'][$objp->fk_account])) {
697 $tmpbank = $conf->cache[
'bankaccount'][$objp->fk_account];
700 $tmpbank->fetch($objp->fk_account);
701 $conf->cache[
'bankaccount'][$objp->fk_account] = $tmpbank;
703 print $tmpbank->getNomUrl(1);
705 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</span></td>\n";
706 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</span></td>\n";
707 print
'<td class="nowrap right"><span class="amount">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</span></td>\n";
709 $total_capital += $objp->amount_capital;
713 $totalpaid = $total_capital;
716 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>';
717 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>';
719 $staytopay =
$object->capital - $totalpaid;
721 print
'<tr><td colspan="6" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
722 print
'<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
723 print
price($staytopay, 0, $langs, 0, -1, -1, $conf->currency);
737 print
'<div class="clearboth"></div>';
741 if ($action ==
'edit') {
742 print $form->buttonsSaveCancel();
750 if ($action !=
'edit') {
751 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
752 if (empty($reshook)) {
753 print
'<div class="tabsAction">';
756 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'write')) {
757 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>';
762 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>';
766 if ((
$object->paid == 0 ||
$object->paid == 2) && round($staytopay) <= 0 && $user->hasRight(
'loan',
'write')) {
767 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>';
771 if ((
$object->paid == 0 ||
$object->paid == 2) && $user->hasRight(
'loan',
'delete')) {
772 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.
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.