28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/loan.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
42 $langs->loadLangs(array(
"compta",
"bills",
"loan"));
45 $action =
GETPOST(
'action',
'aZ09');
47 $cancel =
GETPOST(
'cancel',
'alpha');
49 $projectid =
GETPOST(
'projectid',
'int');
52 $socid =
GETPOST(
'socid',
'int');
54 $socid = $user->socid;
58 $object =
new Loan($db);
60 $hookmanager->initHooks(array(
'loancard',
'globalcard'));
69 $reshook = $hookmanager->executeHooks(
'doActions',
$parameters, $object, $action);
73 if (empty($reshook)) {
75 if ($action ==
'confirm_paid' && $confirm ==
'yes' && $user->rights->loan->write) {
77 $result = $object->setPaid($user);
86 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->rights->loan->write) {
88 $result = $object->delete($user);
91 header(
"Location: list.php");
99 if ($action ==
'add' && $user->rights->loan->write) {
107 $error++; $action =
'create';
108 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
111 $error++; $action =
'create';
112 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateStart")),
null,
'errors');
115 $error++; $action =
'create';
116 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateEnd")),
null,
'errors');
119 $error++; $action =
'create';
120 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Rate")),
null,
'errors');
124 $object->label =
GETPOST(
'label');
125 $object->fk_bank =
GETPOST(
'accountid');
126 $object->capital = $capital;
127 $object->datestart = $datestart;
128 $object->dateend = $dateend;
129 $object->nbterm =
GETPOST(
'nbterm');
130 $object->rate = $rate;
131 $object->note_private =
GETPOST(
'note_private',
'restricthtml');
132 $object->note_public =
GETPOST(
'note_public',
'restricthtml');
133 $object->fk_project =
GETPOST(
'projectid',
'int');
134 $object->insurance_amount =
GETPOST(
'insurance_amount',
'int');
136 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
137 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
138 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
140 if ($accountancy_account_capital <= 0) {
141 $object->account_capital =
'';
143 $object->account_capital = $accountancy_account_capital;
145 if ($accountancy_account_insurance <= 0) {
146 $object->account_insurance =
'';
148 $object->account_insurance = $accountancy_account_insurance;
150 if ($accountancy_account_interest <= 0) {
151 $object->account_interest =
'';
153 $object->account_interest = $accountancy_account_interest;
156 $id = $object->create($user);
164 header(
"Location: list.php");
167 } elseif ($action ==
'update' && $user->rights->loan->write) {
170 $result = $object->fetch($id);
177 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")),
null,
'errors');
180 $object->datestart = $datestart;
181 $object->dateend = $dateend;
182 $object->capital = $capital;
183 $object->nbterm =
GETPOST(
"nbterm",
'int');
187 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
188 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
189 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
191 if ($accountancy_account_capital <= 0) {
192 $object->account_capital =
'';
194 $object->account_capital = $accountancy_account_capital;
196 if ($accountancy_account_insurance <= 0) {
197 $object->account_insurance =
'';
199 $object->account_insurance = $accountancy_account_insurance;
201 if ($accountancy_account_interest <= 0) {
202 $object->account_interest =
'';
204 $object->account_interest = $accountancy_account_interest;
208 $result = $object->update($user);
211 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
218 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
224 if ($action ==
'classin' && $user->rights->loan->write) {
226 $result = $object->setProject($projectid);
232 if ($action ==
'setlabel' && $user->rights->loan->write) {
234 $result = $object->setValueFrom(
'label',
GETPOST(
'label'),
'',
'',
'text',
'', $user,
'LOAN_MODIFY');
252 $title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Card");
253 $help_url =
'EN:Module_Loan|FR:Module_Emprunt';
258 if ($action ==
'create') {
260 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
266 print
'<form name="loan" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
267 print
'<input type="hidden" name="token" value="'.newToken().
'">';
268 print
'<input type="hidden" name="action" value="add">';
272 print
'<table class="border centpercent">';
275 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>';
279 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Account").
'</td><td>';
280 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"courant=1", 1);
283 print
'<tr><td>'.$langs->trans(
"Account").
'</td><td>';
284 print $langs->trans(
"NoBankAccountDefined");
289 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
293 print
'<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
294 print
$form->selectDate($datestart ? $datestart : -1,
'start',
'',
'',
'',
'add', 1, 1);
299 print
'<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
300 print
$form->selectDate($dateend ? $dateend : -1,
'end',
'',
'',
'',
'add', 1, 1);
304 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
307 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
310 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>';
317 $langs->loadLangs(array(
"projects"));
319 print
'<tr><td>'.$langs->trans(
"Project").
'</td><td>';
321 $numproject = $formproject->select_projects(-1, $projectid,
'projectid', 16, 0, 1, 1);
328 print
'<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
331 $doleditor =
new DolEditor(
'note_private',
GETPOST(
'note_private',
'alpha'),
'', 160,
'dolibarr_notes',
'In',
false,
true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_6,
'90%');
332 print $doleditor->Create(1);
338 print
'<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
340 $doleditor =
new DolEditor(
'note_public',
GETPOST(
'note_public',
'alpha'),
'', 160,
'dolibarr_notes',
'In',
false,
true, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_6,
'90%');
341 print $doleditor->Create(1);
347 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
349 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_CAPITAL,
'accountancy_account_capital', 1,
'', 1, 1);
353 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
355 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_INSURANCE,
'accountancy_account_insurance', 1,
'', 1, 1);
359 print
'<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
361 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_INTEREST,
'accountancy_account_interest', 1,
'', 1, 1);
366 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
367 print
'<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
371 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
372 print
'<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
376 print
'<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
377 print
'<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
384 print
$form->buttonsSaveCancel(
"Add");
391 $object =
new Loan($db);
392 $result = $object->fetch($id);
397 $totalpaid = $object->getSumPayment();
400 if ($action ==
'paid') {
401 $text = $langs->trans(
'ConfirmPayLoan');
402 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
405 if ($action ==
'delete') {
406 $text = $langs->trans(
'ConfirmDeleteLoan');
407 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
410 if ($action ==
'edit') {
411 print
'<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
412 print
'<input type="hidden" name="token" value="'.newToken().
'">';
413 print
'<input type="hidden" name="action" value="update">';
414 print
'<input type="hidden" name="id" value="'.$id.
'">';
421 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
423 $morehtmlref =
'<div class="refidno">';
425 $morehtmlref .=
$form->editfieldkey(
"Label",
'label', $object->label, $object, $user->rights->loan->write,
'string',
'', 0, 1);
426 $morehtmlref .=
$form->editfieldval(
"Label",
'label', $object->label, $object, $user->rights->loan->write,
'string',
'',
null,
null,
'', 1);
429 $langs->loadLangs(array(
"projects"));
430 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
431 if ($user->rights->loan->write) {
432 if ($action !=
'classify') {
433 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
435 if ($action ==
'classify') {
437 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
438 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
439 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
440 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
441 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
442 $morehtmlref .=
'</form>';
444 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
447 if (!empty($object->fk_project)) {
449 $proj->fetch($object->fk_project);
450 $morehtmlref .=
' : '.$proj->getNomUrl(1);
452 $morehtmlref .=
' - '.$proj->title;
459 $morehtmlref .=
'</div>';
461 $object->totalpaid = $totalpaid;
463 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlright);
465 print
'<div class="fichecenter">';
466 print
'<div class="fichehalfleft">';
467 print
'<div class="underbanner clearboth"></div>';
469 print
'<table class="border centpercent tableforfield">';
472 if ($action ==
'edit') {
473 print
'<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
474 print
'<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
477 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>';
481 if ($action ==
'edit') {
482 print
'<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
483 print
'<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
486 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>';
490 print
'<tr><td>'.$langs->trans(
"DateStart").
"</td>";
492 if ($action ==
'edit') {
493 print
$form->selectDate($object->datestart,
'start', 0, 0, 0,
'update', 1, 0);
500 print
'<tr><td>'.$langs->trans(
"DateEnd").
"</td>";
502 if ($action ==
'edit') {
503 print
$form->selectDate($object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
510 print
'<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
512 if ($action ==
'edit') {
513 print
'<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
515 print $object->nbterm;
520 print
'<tr><td>'.$langs->trans(
"Rate").
'</td>';
522 if ($action ==
'edit') {
523 print
'<input name="rate" size="4" value="'.$object->rate.
'">%';
525 print
price($object->rate).
'%';
531 if ($action ==
'edit') {
532 print
'<td class="nowrap fieldrequired">';
533 print $langs->trans(
"LoanAccountancyCapitalCode");
537 print $formaccounting->select_account($object->account_capital,
'accountancy_account_capital', 1,
'', 1, 1);
539 print
'<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
543 print
'<td class="nowrap">';
544 print $langs->trans(
"LoanAccountancyCapitalCode");
549 $accountingaccount->fetch(
'', $object->account_capital, 1);
551 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
553 print $object->account_capital;
562 if ($action ==
'edit') {
563 print
'<td class="nowrap fieldrequired">';
564 print $langs->trans(
"LoanAccountancyInsuranceCode");
568 print $formaccounting->select_account($object->account_insurance,
'accountancy_account_insurance', 1,
'', 1, 1);
570 print
'<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
574 print
'<td class="nowrap">';
575 print $langs->trans(
"LoanAccountancyInsuranceCode");
580 $accountingaccount->fetch(
'', $object->account_insurance, 1);
582 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
584 print $object->account_insurance;
593 if ($action ==
'edit') {
594 print
'<td class="nowrap fieldrequired">';
595 print $langs->trans(
"LoanAccountancyInterestCode");
599 print $formaccounting->select_account($object->account_interest,
'accountancy_account_interest', 1,
'', 1, 1);
601 print
'<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
605 print
'<td class="nowrap">';
606 print $langs->trans(
"LoanAccountancyInterestCode");
611 $accountingaccount->fetch(
'', $object->account_interest, 1);
613 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
615 print $object->account_interest;
624 $reshook = $hookmanager->executeHooks(
'formObjectOptions',
$parameters, $object, $action);
625 print $hookmanager->resPrint;
630 print
'<div class="fichehalfright">';
635 $sql =
"SELECT p.rowid, p.num_payment, datep as dp,";
636 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
637 $sql .=
" c.libelle as paiement_type";
638 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
639 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id";
640 $sql .=
", ".MAIN_DB_PREFIX.
"loan as l";
641 $sql .=
" WHERE p.fk_loan = ".((int) $id);
642 $sql .=
" AND p.fk_loan = l.rowid";
643 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
644 $sql .=
" ORDER BY dp DESC";
647 $resql = $db->query($sql);
649 $num = $db->num_rows(
$resql);
651 $total_insurance = 0;
655 print
'<div class="div-table-responsive-no-min">';
656 print
'<table class="noborder paymenttable">';
657 print
'<tr class="liste_titre">';
658 print
'<td>'.$langs->trans(
"RefPayment").
'</td>';
659 print
'<td>'.$langs->trans(
"Date").
'</td>';
660 print
'<td>'.$langs->trans(
"Type").
'</td>';
661 print
'<td class="right">'.$langs->trans(
"Insurance").
'</td>';
662 print
'<td class="right">'.$langs->trans(
"Interest").
'</td>';
663 print
'<td class="right">'.$langs->trans(
"LoanCapital").
'</td>';
667 $objp = $db->fetch_object(
$resql);
669 print
'<tr class="oddeven">';
670 print
'<td><a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
671 print
'<td>'.dol_print_date($db->jdate($objp->dp),
'day').
"</td>\n";
672 print
"<td>".$objp->paiement_type.
' '.$objp->num_payment.
"</td>\n";
673 print
'<td class="nowrap right">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</td>\n";
674 print
'<td class="nowrap right">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</td>\n";
675 print
'<td class="nowrap right">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</td>\n";
677 $total_capital += $objp->amount_capital;
681 $totalpaid = $total_capital;
683 if ($object->paid == 0 || $object->paid == 2) {
684 print
'<tr><td colspan="5" class="right">'.$langs->trans(
"AlreadyPaid").
' :</td><td class="nowrap right">'.
price($totalpaid, 0, $langs, 0, -1, -1, $conf->currency).
'</td></tr>';
685 print
'<tr><td colspan="5" class="right">'.$langs->trans(
"AmountExpected").
' :</td><td class="nowrap right">'.
price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).
'</td></tr>';
687 $staytopay = $object->capital - $totalpaid;
689 print
'<tr><td colspan="5" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
690 print
'<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
691 print
price($staytopay, 0, $langs, 0, -1, -1, $conf->currency);
705 print
'<div class="clearboth"></div>';
709 if ($action ==
'edit') {
710 print
$form->buttonsSaveCancel();
718 if ($action !=
'edit') {
719 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons',
$parameters, $object, $action);
720 if (empty($reshook)) {
721 print
'<div class="tabsAction">';
724 if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->write) {
725 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>';
729 if (($object->paid == 0 || $object->paid == 2) && ((
price2num($object->capital) > 0 && round($staytopay) < 0) || (
price2num($object->capital) > 0 && round($staytopay) > 0)) && $user->rights->loan->write) {
730 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>';
734 if (($object->paid == 0 || $object->paid == 2) && round($staytopay) <= 0 && $user->rights->loan->write) {
735 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>';
739 if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->delete) {
740 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(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage accounting accounts.
Class to manage a WYSIWYG editor.
Class to manage projects.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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='', $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.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
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.