31 require
'../../../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
38 $langs->loadLangs(array(
'banks',
'categories',
'bills',
'companies',
'compta'));
42 $action =
GETPOST(
'action',
'aZ09');
43 $confirm =
GETPOST(
'confirm',
'alpha');
47 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
48 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
54 $sortfield =
"b.dateo,b.rowid";
56 if (empty($page) || $page == -1) {
59 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
60 $offset = $limit * $page;
62 $upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity].
"/checkdeposits";
64 $search_date_start_day =
GETPOST(
'search_date_start_day',
'int');
65 $search_date_start_month =
GETPOST(
'search_date_start_month',
'int');
66 $search_date_start_year =
GETPOST(
'search_date_start_year',
'int');
67 $search_date_end_day =
GETPOST(
'search_date_end_day',
'int');
68 $search_date_end_month =
GETPOST(
'search_date_end_month',
'int');
69 $search_date_end_year =
GETPOST(
'search_date_end_year',
'int');
70 $search_date_start =
dol_mktime(0, 0, 0, $search_date_start_month, $search_date_start_day, $search_date_start_year);
71 $search_date_end =
dol_mktime(23, 59, 59, $search_date_end_month, $search_date_end_day, $search_date_end_year);
72 $filteraccountid =
GETPOST(
'accountid',
'int');
75 $fieldname = (!empty($ref) ?
'ref' :
'rowid');
77 $socid = $user->socid;
79 $result =
restrictedArea($user,
'cheque', $id,
'bordereau_cheque',
'',
'fk_user_author', $fieldname);
81 $usercanread = $user->rights->banque->cheque;
82 $usercancreate = $user->rights->banque->cheque;
83 $usercandelete = $user->rights->banque->cheque;
85 $permissiontodelete = $user->rights->banque->cheque;
92 if ($action ==
'setdate' && $user->rights->banque->cheque) {
93 $result = $object->fetch(
GETPOST(
'id',
'int'));
97 $result = $object->set_date($user, $date);
106 if ($action ==
'setrefext' && $user->rights->banque->cheque) {
107 $result = $object->fetch(
GETPOST(
'id',
'int'));
111 $result = $object->setValueFrom(
'ref_ext', $ref_ext,
'',
null,
'text',
'', $user,
'CHECKDEPOSIT_MODIFY');
120 if ($action ==
'setref' && $user->rights->banque->cheque) {
121 $result = $object->fetch(
GETPOST(
'id',
'int'));
125 $result = $object->set_number($user, $ref);
134 if ($action ==
'create' &&
GETPOST(
"accountid",
"int") > 0 && $user->rights->banque->cheque) {
135 if (is_array(
GETPOST(
'toRemise'))) {
136 $result = $object->create($user,
GETPOST(
"accountid",
"int"), 0,
GETPOST(
'toRemise'));
138 if ($object->statut == 1) {
139 $object->fetch($object->id);
141 $outputlangs = $langs;
144 $newlang =
GETPOST(
'lang_id',
'aZ09');
147 if (!empty($newlang)) {
149 $outputlangs->setDefaultLang($newlang);
151 $result = $object->generatePdf(
GETPOST(
"model"), $outputlangs);
154 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$object->id);
165 if ($action ==
'remove' && $id > 0 &&
GETPOST(
"lineid",
'int') > 0 && $user->rights->banque->cheque) {
167 $result = $object->removeCheck(
GETPOST(
"lineid",
"int"));
169 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$object->id);
176 if ($action ==
'confirm_delete' && $confirm ==
'yes' && $user->rights->banque->cheque) {
178 $result = $object->delete();
180 header(
"Location: index.php");
187 if ($action ==
'confirm_validate' && $confirm ==
'yes' && $user->rights->banque->cheque) {
188 $result = $object->fetch($id);
189 $result = $object->validate($user);
192 $outputlangs = $langs;
195 $newlang =
GETPOST(
'lang_id',
'aZ09');
198 if (!empty($newlang)) {
200 $outputlangs->setDefaultLang($newlang);
202 $result = $object->generatePdf(
GETPOST(
'model'), $outputlangs);
204 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$object->id);
211 if ($action ==
'confirm_reject_check' && $confirm ==
'yes' && $user->rights->banque->cheque) {
213 $rejected_check =
GETPOST(
'bankid',
'int');
216 $paiement_id = $object->rejectCheck($rejected_check, $reject_date);
217 if ($paiement_id > 0) {
218 setEventMessages($langs->trans(
"CheckRejectedAndInvoicesReopened"),
null,
'mesgs');
228 if ($action ==
'builddoc' && $user->rights->banque->cheque) {
229 $result = $object->fetch($id);
234 $outputlangs = $langs;
237 $newlang =
GETPOST(
'lang_id',
'aZ09');
240 if (!empty($newlang)) {
242 $outputlangs->setDefaultLang($newlang);
244 $result = $object->generatePdf(
GETPOST(
"model"), $outputlangs);
249 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG) ?
'' :
'#builddoc'));
252 } elseif ($action ==
'remove_file' && $user->rights->banque->cheque) {
254 if ($object->fetch($id) > 0) {
255 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
257 $langs->load(
"other");
259 $filetodelete =
GETPOST(
'file',
'alpha');
260 $file = $upload_dir.
'/'.$filetodelete;
278 $search_date_start_day =
'';
279 $search_date_start_month =
'';
280 $search_date_start_year =
'';
281 $search_date_end_day =
'';
282 $search_date_end_month =
'';
283 $search_date_end_year =
'';
284 $search_date_start =
'';
285 $search_date_end =
'';
286 $filteraccountid = 0;
289 $title = $langs->trans(
"Cheques").
" - ".$langs->trans(
"Card");
297 if ($action ==
'new') {
300 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?action=new';
301 $head[$h][1] = $langs->trans(
"MenuChequeDeposits");
307 $result = $object->fetch($id, $ref);
314 $head[$h][0] = $_SERVER[
"PHP_SELF"].
'?id='.$object->id;
315 $head[$h][1] = $langs->trans(
"CheckReceipt");
327 if ($action ==
'delete') {
328 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
"DeleteCheckReceipt"), $langs->trans(
"ConfirmDeleteCheckReceipt"),
'confirm_delete',
'',
'', 1);
334 if ($action ==
'valide') {
335 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
"ValidateCheckReceipt"), $langs->trans(
"ConfirmValidateCheckReceipt"),
'confirm_validate',
'',
'', 1);
341 if ($action ==
'reject_check') {
342 $formquestion = array(
343 array(
'type' =>
'hidden',
'name' =>
'bankid',
'value' =>
GETPOST(
'lineid',
'int')),
344 array(
'type' =>
'date',
'name' =>
'rejectdate_',
'label' => $langs->trans(
"RejectCheckDate"),
'value' =>
dol_now())
346 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
"RejectCheck"), $langs->trans(
"ConfirmRejectCheck"),
'confirm_reject_check', $formquestion,
'', 1);
352 if ($action ==
'new') {
360 print
'<span class="opacitymedium">'.$langs->trans(
"SelectChequeTransactionAndGenerate").
'</span><br><br>'.
"\n";
362 print
'<form class="nocellnopadd" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
363 print
'<input type="hidden" name="token" value="'.newToken().
'">';
364 print
'<input type="hidden" name="action" value="new">';
368 print
'<table class="border centpercent">';
371 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"DateChequeReceived").
'</td><td>';
373 print
'<div class="nowrap">';
374 print
$form->selectDate($search_date_start,
'search_date_start_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
376 print
'<div class="nowrap">';
377 print
$form->selectDate($search_date_end,
'search_date_end_', 0, 0, 1,
'', 1, 1, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
380 print
'<tr><td>'.$langs->trans(
"BankAccount").
'</td><td>';
381 $form->select_comptes($filteraccountid,
'accountid', 0,
'courant <> 2', 1);
387 print
'<div class="center">';
388 print
'<input type="submit" class="button small" name="filter" value="'.dol_escape_htmltag($langs->trans(
"ToFilter")).
'">';
389 if ($search_date_start || $search_date_end || $filteraccountid > 0) {
391 print
'<input type="submit" class="button" name="removefilter small" value="'.dol_escape_htmltag($langs->trans(
"RemoveFilter")).
'">';
398 $sql =
"SELECT ba.rowid as bid, ba.label,";
399 $sql .=
" b.rowid as transactionid, b.label as transactionlabel, b.datec as datec, b.dateo as date, ";
400 $sql .=
" b.amount, b.emetteur, b.num_chq, b.banque,";
401 $sql .=
" p.rowid as paymentid, p.ref as paymentref";
402 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
403 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
404 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON (b.fk_account = ba.rowid)";
405 $sql .=
" WHERE b.fk_type = 'CHQ'";
406 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
407 $sql .=
" AND b.fk_bordereau = 0";
408 $sql .=
" AND b.amount > 0";
409 if ($search_date_start) {
410 $sql .=
" AND b.dateo >= '".$db->idate($search_date_start).
"'";
412 if ($search_date_end) {
413 $sql .=
" AND b.dateo <= '".$db->idate($search_date_end).
"'";
415 if ($filteraccountid > 0) {
416 $sql .=
" AND ba.rowid = ".((int) $filteraccountid);
418 $sql .= $db->order(
"b.dateo,b.rowid",
"ASC");
420 $resql = $db->query($sql);
423 while ($obj = $db->fetch_object(
$resql)) {
424 $accounts[$obj->bid] = $obj->label;
425 $lines[$obj->bid][$i][
"date"] = $db->jdate($obj->datec);
426 $lines[$obj->bid][$i][
"amount"] = $obj->amount;
427 $lines[$obj->bid][$i][
"emetteur"] = $obj->emetteur;
428 $lines[$obj->bid][$i][
"numero"] = $obj->num_chq;
429 $lines[$obj->bid][$i][
"banque"] = $obj->banque;
430 $lines[$obj->bid][$i][
"id"] = $obj->transactionid;
431 $lines[$obj->bid][$i][
"ref"] = $obj->transactionid;
432 $lines[$obj->bid][$i][
"label"] = $obj->transactionlabel;
433 $lines[$obj->bid][$i][
"paymentid"] = $obj->paymentid;
434 $lines[$obj->bid][$i][
"paymentref"] = $obj->paymentref;
435 $lines[$obj->bid][$i][
"paymentdate"] = $db->jdate($obj->date);
440 print
'<div class="opacitymedium">'.$langs->trans(
"NoWaitingChecks").
'</div><br>';
444 foreach ($accounts as $bid => $account_label) {
446 <script type="text/javascript">
447 jQuery(document).ready(function()
449 jQuery("#checkall_'.$bid.
'").click(function()
451 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', true);
453 jQuery("#checknone_'.$bid.
'").click(function()
455 jQuery(".checkforremise_'.$bid.
'").prop(\'checked\', false);
461 $num = $db->num_rows(
$resql);
462 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
463 print
'<input type="hidden" name="token" value="'.newToken().
'">';
464 print
'<input type="hidden" name="action" value="create">';
465 print
'<input type="hidden" name="accountid" value="'.$bid.
'">';
468 print
'<div class="div-table-responsive-no-min">';
469 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
471 print
'<tr class="liste_titre">';
472 print
'<td>'.$langs->trans(
"DateChequeReceived").
'</td>'.
"\n";
473 print
'<td>'.$langs->trans(
"ChequeNumber").
"</td>\n";
474 print
'<td>'.$langs->trans(
"CheckTransmitter").
"</td>\n";
475 print
'<td>'.$langs->trans(
"Bank").
"</td>\n";
476 print
'<td>'.$langs->trans(
"Amount").
"</td>\n";
477 print
'<td class="center">'.$langs->trans(
"Payment").
"</td>\n";
478 print
'<td class="center">'.$langs->trans(
"LineRecord").
"</td>\n";
479 print
'<td class="center">'.$langs->trans(
"Select").
"<br>";
480 if ($conf->use_javascript_ajax) {
481 print
'<a href="#" id="checkall_'.$bid.
'">'.$langs->trans(
"All").
'</a> / <a href="#" id="checknone_'.$bid.
'">'.$langs->trans(
"None").
'</a>';
486 if (count($lines[$bid])) {
487 foreach ($lines[$bid] as $lid => $value) {
488 print
'<tr class="oddeven">';
489 print
'<td>'.dol_print_date($value[
"date"],
'day').
'</td>';
490 print
'<td>'.$value[
"numero"].
"</td>\n";
491 print
'<td>'.$value[
"emetteur"].
"</td>\n";
492 print
'<td>'.$value[
"banque"].
"</td>\n";
493 print
'<td class="right"><span class="amount">'.price($value[
"amount"], 0, $langs, 1, -1, -1, $conf->currency).
'</span></td>';
496 print
'<td class="center">';
497 $paymentstatic->id = $value[
"paymentid"];
498 $paymentstatic->ref = $value[
"paymentref"];
499 $paymentstatic->date = $value[
"paymentdate"];
500 if ($paymentstatic->id) {
501 print $paymentstatic->getNomUrl(1);
507 print
'<td class="center">';
508 $accountlinestatic->id = $value[
"id"];
509 $accountlinestatic->ref = $value[
"ref"];
510 if ($accountlinestatic->id > 0) {
511 print $accountlinestatic->getNomUrl(1);
517 print
'<td class="center">';
518 print
'<input id="'.$value[
"id"].
'" class="flat checkforremise_'.$bid.
'" checked type="checkbox" name="toRemise[]" value="'.$value[
"id"].
'">';
526 print
'<div class="tabsAction">';
527 if ($user->rights->banque->cheque) {
528 print
'<input type="submit" class="button" value="'.$langs->trans(
'NewCheckDepositOn', $account_label).
'">';
530 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
'NewCheckDepositOn', $account_label).
'</a>';
538 $accountstatic =
new Account($db);
539 $accountstatic->fetch($object->account_id);
541 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/paiement/cheque/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
544 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
547 print
'<div class="fichecenter">';
548 print
'<div class="underbanner clearboth"></div>';
551 print
'<table class="border centpercent">';
553 print
'<tr><td class="titlefield">';
555 print
'<table class="nobordernopadding" width="100%"><tr><td>';
556 print $langs->trans(
'Date');
558 if ($action !=
'editdate') {
559 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editdate&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->trans(
'SetDate'), 1).
'</a></td>';
561 print
'</tr></table>';
562 print
'</td><td colspan="2">';
563 if ($action ==
'editdate') {
564 print
'<form name="setdate" action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'" method="post">';
565 print
'<input type="hidden" name="token" value="'.newToken().
'">';
566 print
'<input type="hidden" name="action" value="setdate">';
567 print
$form->selectDate($object->date_bordereau,
'datecreate_',
'',
'',
'',
"setdate");
568 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
571 print $object->date_bordereau ?
dol_print_date($object->date_bordereau,
'day') :
' ';
605 print
'<tr><td>'.$langs->trans(
'Account').
'</td><td colspan="2">';
606 print $accountstatic->getNomUrl(1);
610 print
'<tr><td>'.$langs->trans(
'NbOfCheques').
'</td><td colspan="2">';
611 print $object->nbcheque;
614 print
'<tr><td>'.$langs->trans(
'Total').
'</td><td colspan="2">';
615 print
price($object->amount);
622 print
'</table><br>';
628 $sql =
"SELECT b.rowid, b.rowid as ref, b.label, b.amount, b.num_chq, b.emetteur,";
629 $sql .=
" b.dateo as date, b.datec as datec, b.banque,";
630 $sql .=
" p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut";
631 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as ba";
632 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON (b.fk_account = ba.rowid)";
633 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"paiement as p ON p.fk_bank = b.rowid";
634 $sql .=
" WHERE ba.entity IN (".getEntity(
'bank_account').
")";
635 $sql .=
" AND b.fk_type= 'CHQ'";
636 $sql .=
" AND b.fk_bordereau = ".((int) $object->id);
637 $sql .= $db->order($sortfield, $sortorder);
639 $resql = $db->query($sql);
641 $num = $db->num_rows(
$resql);
643 print
'<div class="div-table-responsive">';
644 print
'<table class="noborder centpercent">';
646 $param =
"&id=".$object->id;
648 print
'<tr class="liste_titre">';
650 print_liste_field_titre(
"DateChequeReceived", $_SERVER[
"PHP_SELF"],
"b.dateo,b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
651 print_liste_field_titre(
"Numero", $_SERVER[
"PHP_SELF"],
"b.num_chq",
"", $param,
'align="center"', $sortfield, $sortorder);
652 print_liste_field_titre(
"CheckTransmitter", $_SERVER[
"PHP_SELF"],
"b.emetteur",
"", $param,
"", $sortfield, $sortorder);
654 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"b.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
655 print_liste_field_titre(
"Payment", $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
656 print_liste_field_titre(
"LineRecord", $_SERVER[
"PHP_SELF"],
"b.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
662 while ($objp = $db->fetch_object(
$resql)) {
663 $paymentstatic->id = $objp->pid;
664 $paymentstatic->ref = $objp->pref;
666 $accountlinestatic->id = $objp->rowid;
667 $accountlinestatic->ref = $objp->ref;
669 print
'<tr class="oddeven">';
670 print
'<td class="center">'.$i.
'</td>';
671 print
'<td class="center">'.dol_print_date($db->jdate($objp->date),
'day').
'</td>';
672 print
'<td class="center">'.($objp->num_chq ? $objp->num_chq :
' ').
'</td>';
673 print
'<td>'.dol_trunc($objp->emetteur, 24).
'</td>';
674 print
'<td>'.dol_trunc($objp->banque, 24).
'</td>';
675 print
'<td class="right"><span class="amount">'.price($objp->amount).
'</span></td>';
677 print
'<td class="center">';
678 if ($paymentstatic->id) {
679 print $paymentstatic->getNomUrl(1);
685 print
'<td class="center">';
686 if ($accountlinestatic->id > 0) {
687 print $accountlinestatic->getNomUrl(1);
693 print
'<td class="right">';
694 if ($object->statut == 0) {
695 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=remove&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_delete().
'</a>';
697 if ($object->statut == 1 && $objp->statut != 2) {
698 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=reject_check&token='.
newToken().
'&lineid='.$objp->rowid.
'">'.
img_picto($langs->trans(
"RejectCheck"),
'disable').
'</a>';
700 if ($objp->statut == 2) {
701 print
' '.img_picto($langs->trans(
'CheckRejected'),
'statut8').
'</a>';
709 print
'<td colspan="8" class="opacitymedium">';
710 print $langs->trans(
"None");
717 if ($num > 0 && $i < ($object->nbcheque + 1)) {
719 $langs->load(
"errors");
720 print
info_admin($langs->trans(
"WarningSomeBankTransactionByChequeWereRemovedAfter"), 0, 0,
'warning');
739 print
'<div class="tabsAction">';
741 if ($user->socid == 0 && !empty($object->id) && $object->statut == 0 && $user->rights->banque->cheque) {
742 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=valide&token='.
newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.
'">'.$langs->trans(
'Validate').
'</a>';
745 if ($user->socid == 0 && !empty($object->id) && $user->rights->banque->cheque) {
746 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken(),
'delete', $permissiontodelete);
752 if ($action !=
'new') {
753 if ($object->statut == 1) {
756 $filedir = $upload_dir.
'/'.$objref;
757 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
758 $genallowed = $usercancreate;
759 $delallowed = $usercandelete;
760 print $formfile->showdocuments(
'remisecheque', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang);
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage payments of customer invoices.
Class to manage cheque delivery receipts.
Class to manage translations.
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_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
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.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
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.