27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/loan/class/loan.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/loan.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31 if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
32 if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
37 $langs->loadLangs(array(
"compta",
"bills",
"loan"));
40 $action =
GETPOST(
'action',
'aZ09');
42 $cancel =
GETPOST(
'cancel',
'alpha');
44 $projectid =
GETPOST(
'projectid',
'int');
47 $socid =
GETPOST(
'socid',
'int');
48 if ($user->socid) $socid = $user->socid;
51 $object =
new Loan($db);
53 $hookmanager->initHooks(array(
'loancard',
'globalcard'));
62 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
63 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
67 if ($action ==
'confirm_paid' && $confirm ==
'yes' && $user->rights->loan->write)
70 $result = $object->set_paid($user);
80 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->rights->loan->write)
83 $result = $object->delete($user);
87 header(
"Location: list.php");
95 if ($action ==
'add' && $user->rights->loan->write)
106 $error++; $action =
'create';
107 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")), null,
'errors');
111 $error++; $action =
'create';
112 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateStart")), null,
'errors');
116 $error++; $action =
'create';
117 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"DateEnd")), null,
'errors');
121 $error++; $action =
'create';
122 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Rate")), null,
'errors');
127 $object->label =
GETPOST(
'label');
128 $object->fk_bank =
GETPOST(
'accountid');
129 $object->capital = $capital;
130 $object->datestart = $datestart;
131 $object->dateend = $dateend;
132 $object->nbterm =
GETPOST(
'nbterm');
133 $object->rate = $rate;
134 $object->note_private =
GETPOST(
'note_private',
'restricthtml');
135 $object->note_public =
GETPOST(
'note_public',
'restricthtml');
136 $object->fk_project =
GETPOST(
'projectid',
'int');
137 $object->insurance_amount =
GETPOST(
'insurance_amount',
'int');
139 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
140 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
141 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
143 if ($accountancy_account_capital <= 0) { $object->account_capital =
''; }
else { $object->account_capital = $accountancy_account_capital; }
144 if ($accountancy_account_insurance <= 0) { $object->account_insurance =
''; }
else { $object->account_insurance = $accountancy_account_insurance; }
145 if ($accountancy_account_interest <= 0) { $object->account_interest =
''; }
else { $object->account_interest = $accountancy_account_interest; }
147 $id = $object->create($user);
156 header(
"Location: list.php");
162 elseif ($action ==
'update' && $user->rights->loan->write)
166 $result = $object->fetch($id);
174 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"LoanCapital")), null,
'errors');
177 $object->datestart = $datestart;
178 $object->dateend = $dateend;
179 $object->capital = $capital;
180 $object->nbterm =
GETPOST(
"nbterm",
'int');
184 $accountancy_account_capital =
GETPOST(
'accountancy_account_capital');
185 $accountancy_account_insurance =
GETPOST(
'accountancy_account_insurance');
186 $accountancy_account_interest =
GETPOST(
'accountancy_account_interest');
188 if ($accountancy_account_capital <= 0) { $object->account_capital =
''; }
else { $object->account_capital = $accountancy_account_capital; }
189 if ($accountancy_account_insurance <= 0) { $object->account_insurance =
''; }
else { $object->account_insurance = $accountancy_account_insurance; }
190 if ($accountancy_account_interest <= 0) { $object->account_interest =
''; }
else { $object->account_interest = $accountancy_account_interest; }
193 $result = $object->update($user);
197 header(
"Location: ".
$_SERVER[
"PHP_SELF"].
"?id=".$id);
204 header(
"Location: ".
$_SERVER[
"PHP_SELF"].
"?id=".$id);
210 if ($action ==
'classin' && $user->rights->loan->write)
213 $result = $object->setProject($projectid);
218 if ($action ==
'setlabel' && $user->rights->loan->write)
221 $result = $object->setValueFrom(
'label',
GETPOST(
'label'),
'',
'',
'text',
'', $user,
'LOAN_MODIFY');
232 $form =
new Form($db);
234 if (!empty($conf->accounting->enabled)) $formaccounting =
new FormAccounting($db);
236 $title = $langs->trans(
"Loan").
' - '.$langs->trans(
"Card");
237 $help_url =
'EN:Module_Loan|FR:Module_Emprunt';
242 if ($action ==
'create')
245 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
251 print '<form name="loan" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
252 print '<input type="hidden" name="token" value="'.newToken().
'">';
253 print '<input type="hidden" name="action" value="add">';
257 print '<table class="border centpercent">';
260 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>';
263 if (!empty($conf->banque->enabled))
265 print '<tr><td class="fieldrequired">'.$langs->trans(
"Account").
'</td><td>';
266 $form->select_comptes(
GETPOST(
"accountid"),
"accountid", 0,
"courant=1", 1);
269 print '<tr><td>'.$langs->trans(
"Account").
'</td><td>';
270 print $langs->trans(
"NoBankAccountDefined");
275 print '<tr><td class="fieldrequired">'.$langs->trans(
"LoanCapital").
'</td><td><input name="capital" size="10" value="'.
dol_escape_htmltag(
GETPOST(
"capital")).
'"></td></tr>';
279 print '<td class="fieldrequired">'.$langs->trans(
"DateStart").
'</td><td>';
280 print $form->selectDate($datestart ? $datestart : -1,
'start',
'',
'',
'',
'add', 1, 1);
285 print '<td class="fieldrequired">'.$langs->trans(
"DateEnd").
'</td><td>';
286 print $form->selectDate($dateend ? $dateend : -1,
'end',
'',
'',
'',
'add', 1, 1);
290 print '<tr><td class="fieldrequired">'.$langs->trans(
"Nbterms").
'</td><td><input name="nbterm" size="5" value="'.
dol_escape_htmltag(
GETPOST(
'nbterm')).
'"></td></tr>';
293 print '<tr><td class="fieldrequired">'.$langs->trans(
"Rate").
'</td><td><input name="rate" size="5" value="'.
dol_escape_htmltag(
GETPOST(
"rate")).
'"> %</td></tr>';
296 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>';
299 if (!empty($conf->projet->enabled))
304 $langs->loadLangs(array(
"projects"));
306 print '<tr><td>'.$langs->trans(
"Project").
'</td><td>';
308 $numproject = $formproject->select_projects(-1, $projectid,
'projectid', 16, 0, 1, 1);
315 print '<td class="tdtop">'.$langs->trans(
'NotePrivate').
'</td>';
318 $doleditor =
new DolEditor(
'note_private',
GETPOST(
'note_private',
'alpha'),
'', 160,
'dolibarr_notes',
'In',
false,
true,
true, ROWS_6,
'90%');
319 print $doleditor->Create(1);
325 print '<td class="tdtop">'.$langs->trans(
'NotePublic').
'</td>';
327 $doleditor =
new DolEditor(
'note_public',
GETPOST(
'note_public',
'alpha'),
'', 160,
'dolibarr_notes',
'In',
false,
true,
true, ROWS_6,
'90%');
328 print $doleditor->Create(1);
332 if (!empty($conf->accounting->enabled))
335 print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
337 print $formaccounting->select_account(
GETPOST(
'accountancy_account_capital') ?
GETPOST(
'accountancy_account_capital') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_CAPITAL,
'accountancy_account_capital', 1,
'', 1, 1);
341 print '<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
343 print $formaccounting->select_account(
GETPOST(
'accountancy_account_insurance') ?
GETPOST(
'accountancy_account_insurance') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_INSURANCE,
'accountancy_account_insurance', 1,
'', 1, 1);
347 print '<tr><td class="fieldrequired">'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
349 print $formaccounting->select_account(
GETPOST(
'accountancy_account_interest') ?
GETPOST(
'accountancy_account_interest') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_INTEREST,
'accountancy_account_interest', 1,
'', 1, 1);
354 print '<tr><td class="titlefieldcreate">'.$langs->trans(
"LoanAccountancyCapitalCode").
'</td>';
355 print '<td><input name="accountancy_account_capital" size="16" value="'.$object->accountancy_account_capital.
'">';
359 print '<tr><td>'.$langs->trans(
"LoanAccountancyInsuranceCode").
'</td>';
360 print '<td><input name="accountancy_account_insurance" size="16" value="'.$object->accountancy_account_insurance.
'">';
364 print '<tr><td>'.$langs->trans(
"LoanAccountancyInterestCode").
'</td>';
365 print '<td><input name="accountancy_account_interest" size="16" value="'.$object->accountancy_account_interest.
'">';
372 print '<div class="center">';
373 print '<input type="submit" class="button" value="'.$langs->trans(
"Add").
'">';
374 print ' ';
375 print '<input type="button" class="button button-cancel" value="'.$langs->trans(
"Cancel").
'" onClick="javascript:history.go(-1)">';
384 $object =
new Loan($db);
385 $result = $object->fetch($id);
391 $totalpaid = $object->getSumPayment();
394 if ($action ==
'paid')
396 $text = $langs->trans(
'ConfirmPayLoan');
397 print $form->formconfirm(
$_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
'PayLoan'), $text,
"confirm_paid",
'',
'', 2);
400 if ($action ==
'delete')
402 $text = $langs->trans(
'ConfirmDeleteLoan');
403 print $form->formconfirm(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $langs->trans(
'DeleteLoan'), $text,
'confirm_delete',
'',
'', 2);
406 if ($action ==
'edit')
408 print '<form name="update" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
409 print '<input type="hidden" name="token" value="'.newToken().
'">';
410 print '<input type="hidden" name="action" value="update">';
411 print '<input type="hidden" name="id" value="'.$id.
'">';
418 $linkback =
'<a href="'.DOL_URL_ROOT.
'/loan/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
420 $morehtmlref =
'<div class="refidno">';
422 $morehtmlref .= $form->editfieldkey(
"Label",
'label', $object->label, $object, $user->rights->loan->write,
'string',
'', 0, 1);
423 $morehtmlref .= $form->editfieldval(
"Label",
'label', $object->label, $object, $user->rights->loan->write,
'string',
'', null, null,
'', 1);
425 if (!empty($conf->projet->enabled))
427 $langs->loadLangs(array(
"projects"));
428 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
429 if ($user->rights->loan->write)
431 if ($action !=
'classify')
432 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> : ';
433 if ($action ==
'classify') {
435 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
436 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
437 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
438 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
439 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
440 $morehtmlref .=
'</form>';
442 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
445 if (!empty($object->fk_project)) {
447 $proj->fetch($object->fk_project);
448 $morehtmlref .=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id='.$object->fk_project.
'" title="'.$langs->trans(
'ShowProject').
'">';
449 $morehtmlref .= $proj->ref;
450 $morehtmlref .=
'</a>';
456 $morehtmlref .=
'</div>';
458 $object->totalpaid = $totalpaid;
460 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref', $morehtmlref,
'', 0,
'', $morehtmlright);
462 print '<div class="fichecenter">';
463 print '<div class="fichehalfleft">';
464 print '<div class="underbanner clearboth"></div>';
466 print '<table class="border centpercent tableforfield">';
469 if ($action ==
'edit')
471 print '<tr><td class="fieldrequired titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>';
472 print '<input name="capital" size="10" value="'.$object->capital.
'"></td></tr>';
475 print '<tr><td class="titlefield">'.$langs->trans(
"LoanCapital").
'</td><td>'.
price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).
'</td></tr>';
479 if ($action ==
'edit')
481 print '<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>';
482 print '<input name="insurance_amount" size="10" value="'.$object->insurance_amount.
'"></td></tr>';
485 print '<tr><td class="titlefield">'.$langs->trans(
"Insurance").
'</td><td>'.
price($object->insurance_amount, 0, $outputlangs, 1, -1, -1, $conf->currency).
'</td></tr>';
489 print '<tr><td>'.$langs->trans(
"DateStart").
"</td>";
491 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')
504 print $form->selectDate($object->dateend,
'end', 0, 0, 0,
'update', 1, 0);
511 print '<tr><td>'.$langs->trans(
"Nbterms").
'</td>';
513 if ($action ==
'edit')
515 print '<input name="nbterm" size="4" value="'.$object->nbterm.
'">';
517 print $object->nbterm;
522 print '<tr><td>'.$langs->trans(
"Rate").
'</td>';
524 if ($action ==
'edit')
526 print '<input name="rate" size="4" value="'.$object->rate.
'">%';
534 if ($action ==
'edit')
536 print '<td class="nowrap fieldrequired">';
537 print $langs->trans(
"LoanAccountancyCapitalCode");
540 if (!empty($conf->accounting->enabled))
542 print $formaccounting->select_account($object->account_capital,
'accountancy_account_capital', 1,
'', 1, 1);
544 print '<input name="accountancy_account_capital" size="16" value="'.$object->account_capital.
'">';
548 print '<td class="nowrap">';
549 print $langs->trans(
"LoanAccountancyCapitalCode");
552 if (!empty($conf->accounting->enabled))
555 $accountingaccount->fetch(
'', $object->account_capital, 1);
557 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
559 print $object->account_capital;
568 if ($action ==
'edit')
570 print '<td class="nowrap fieldrequired">';
571 print $langs->trans(
"LoanAccountancyInsuranceCode");
574 if (!empty($conf->accounting->enabled))
576 print $formaccounting->select_account($object->account_insurance,
'accountancy_account_insurance', 1,
'', 1, 1);
578 print '<input name="accountancy_account_insurance" size="16" value="'.$object->account_insurance.
'">';
582 print '<td class="nowrap">';
583 print $langs->trans(
"LoanAccountancyInsuranceCode");
586 if (!empty($conf->accounting->enabled))
589 $accountingaccount->fetch(
'', $object->account_insurance, 1);
591 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
593 print $object->account_insurance;
602 if ($action ==
'edit')
604 print '<td class="nowrap fieldrequired">';
605 print $langs->trans(
"LoanAccountancyInterestCode");
608 if (!empty($conf->accounting->enabled))
610 print $formaccounting->select_account($object->account_interest,
'accountancy_account_interest', 1,
'', 1, 1);
612 print '<input name="accountancy_account_interest" size="16" value="'.$object->account_interest.
'">';
616 print '<td class="nowrap">';
617 print $langs->trans(
"LoanAccountancyInterestCode");
620 if (!empty($conf->accounting->enabled))
623 $accountingaccount->fetch(
'', $object->account_interest, 1);
625 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
627 print $object->account_interest;
637 print '<div class="fichehalfright">';
638 print '<div class="ficheaddleft">';
643 $sql =
"SELECT p.rowid, p.num_payment, datep as dp,";
644 $sql .=
" p.amount_capital, p.amount_insurance, p.amount_interest,";
645 $sql .=
" c.libelle as paiement_type";
646 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_loan as p";
647 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as c ON p.fk_typepayment = c.id";
648 $sql .=
", ".MAIN_DB_PREFIX.
"loan as l";
649 $sql .=
" WHERE p.fk_loan = ".$id;
650 $sql .=
" AND p.fk_loan = l.rowid";
651 $sql .=
" AND l.entity IN ( ".getEntity(
'loan').
")";
652 $sql .=
" ORDER BY dp DESC";
655 $resql = $db->query($sql);
658 $num = $db->num_rows(
$resql);
660 $total_insurance = 0;
664 print '<div class="div-table-responsive-no-min">';
665 print '<table class="noborder paymenttable">';
666 print '<tr class="liste_titre">';
667 print '<td>'.$langs->trans(
"RefPayment").
'</td>';
668 print '<td>'.$langs->trans(
"Date").
'</td>';
669 print '<td>'.$langs->trans(
"Type").
'</td>';
670 print '<td class="right">'.$langs->trans(
"Insurance").
'</td>';
671 print '<td class="right">'.$langs->trans(
"Interest").
'</td>';
672 print '<td class="right">'.$langs->trans(
"LoanCapital").
'</td>';
677 $objp = $db->fetch_object(
$resql);
679 print '<tr class="oddeven">';
680 print '<td><a href="'.DOL_URL_ROOT.
'/loan/payment/card.php?id='.$objp->rowid.
'">'.
img_object($langs->trans(
"Payment"),
"payment").
' '.$objp->rowid.
'</a></td>';
681 print '<td>'.dol_print_date($db->jdate($objp->dp),
'day').
"</td>\n";
682 print "<td>".$objp->paiement_type.
' '.$objp->num_payment.
"</td>\n";
683 print '<td class="nowrap right">'.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</td>\n";
684 print '<td class="nowrap right">'.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</td>\n";
685 print '<td class="nowrap right">'.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency).
"</td>\n";
687 $total_capital += $objp->amount_capital;
691 $totalpaid = $total_capital;
693 if ($object->paid == 0 || $object->paid == 2)
695 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>';
696 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>';
698 $staytopay = $object->capital - $totalpaid;
700 print '<tr><td colspan="5" class="right">'.$langs->trans(
"RemainderToPay").
' :</td>';
701 print '<td class="nowrap right'.($staytopay ?
' amountremaintopay' :
' amountpaymentcomplete').
'">';
702 print price($staytopay, 0, $langs, 0, -1, -1, $conf->currency);
717 print '<div class="clearboth"></div>';
721 if ($action ==
'edit')
723 print '<div class="center">';
724 print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Save").
'">';
725 print ' ';
726 print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
735 if ($action !=
'edit')
737 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
740 print '<div class="tabsAction">';
743 if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->write)
745 print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/loan/card.php?id='.$object->id.
'&action=edit">'.$langs->trans(
"Modify").
'</a></div>';
749 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)
751 print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.
'/loan/payment/payment.php?id='.$object->id.
'&action=create">'.$langs->trans(
"DoPayment").
'</a></div>';
755 if (($object->paid == 0 || $object->paid == 2) && round($staytopay) <= 0 && $user->rights->loan->write)
757 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>';
761 if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->delete)
763 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>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
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...
loan_prepare_head($object)
Prepare array with list of tabs.
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...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage a WYSIWYG editor.
Class to manage accounting accounts.
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...