dolibarr  x.y.z
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
5  * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 // Load Dolibarr environment
28 require '../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals'));
36 
37 // Get supervariables
38 $action = GETPOST('action', 'aZ09');
39 $id = GETPOST('id', 'int');
40 $ref = GETPOST('ref', 'alpha');
41 $socid = GETPOST('socid', 'int');
42 $type = GETPOST('type', 'aZ09');
43 
44 // Load variable for pagination
45 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
46 $sortfield = GETPOST('sortfield', 'aZ09comma');
47 $sortorder = GETPOST('sortorder', 'aZ09comma');
48 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
49 if (empty($page) || $page == -1) {
50  $page = 0;
51 } // If $page is not defined, or '' or -1
52 $offset = $limit * $page;
53 $pageprev = $page - 1;
54 $pagenext = $page + 1;
55 
56 if (!$sortfield) {
57  $sortfield = 'pl.rowid';
58 }
59 if (!$sortorder) {
60  $sortorder = 'ASC';
61 }
62 
63 $object = new BonPrelevement($db);
64 
65 // Load object
66 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
67 
68 $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
69 
70 $type = $object->type;
71 
72 if ($type == 'bank-transfer') {
73  $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
74 } else {
75  $result = restrictedArea($user, 'prelevement', '', '', 'bons');
76 }
77 
78 
79 /*
80  * Actions
81  */
82 
83 $parameters = array('socid' => $socid);
84 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
85 if ($reshook < 0) {
86  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
87 }
88 
89 if (empty($reshook)) {
90  if ($action == 'confirm_delete') {
91  $savtype = $object->type;
92  $res = $object->delete($user);
93  if ($res > 0) {
94  if ($savtype == 'bank-transfer') {
95  header("Location: ".DOL_URL_ROOT.'/compta/paymentbybanktransfer/index.php');
96  } else {
97  header("Location: ".DOL_URL_ROOT.'/compta/prelevement/index.php');
98  }
99  exit;
100  }
101  }
102 
103  if ($action == 'infotrans' && (($user->rights->prelevement->bons->send && $object->type != 'bank-transfer') || ($user->rights->paymentbybanktransfer->send && $object->type == 'bank-transfer'))) {
104  require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
105 
106  $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
107 
108  /*
109  if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
110  {
111  $dir = $conf->prelevement->dir_output.'/receipts';
112 
113  if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
114  {
115  $object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
116  }
117 
118  header("Location: card.php?id=".$id);
119  exit;
120  }
121  else
122  {
123  dol_syslog("Fichier invalide",LOG_WARNING);
124  $mesg='BadFile';
125  }*/
126 
127  $error = $object->set_infotrans($user, $dt, GETPOST('methode', 'alpha'));
128 
129  if ($error) {
130  header("Location: card.php?id=".$id."&error=$error");
131  exit;
132  }
133  }
134 
135  // Set direct debit order to credited, create payment and close invoices
136  if ($action == 'infocredit' && (($user->rights->prelevement->bons->credit && $object->type != 'bank-transfer') || ($user->rights->paymentbybanktransfer->debit && $object->type == 'bank-transfer'))) {
137  $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
138 
139  if (($object->type != 'bank-transfer' && $object->statut == BonPrelevement::STATUS_CREDITED) || ($object->type == 'bank-transfer' && $object->statut == BonPrelevement::STATUS_DEBITED)) {
140  $error = 1;
141  setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors');
142  } else {
143  $error = $object->set_infocredit($user, $dt);
144  }
145 
146  if ($error) {
147  setEventMessages($object->error, $object->errors, 'errors');
148  }
149  }
150 }
151 
152 
153 
154 /*
155  * View
156  */
157 
158 $form = new Form($db);
159 
160 llxHeader('', $langs->trans("WithdrawalsReceipts"));
161 
162 if ($id > 0 || $ref) {
163  $head = prelevement_prepare_head($object);
164  print dol_get_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
165 
166  if (GETPOST('error', 'alpha') != '') {
167  print '<div class="error">'.$object->getErrorString(GETPOST('error', 'alpha')).'</div>';
168  }
169 
170  $linkback = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/orders_list.php?restore_lastsearch_values=1'.($object->type != 'bank-transfer' ? '' : '&type=bank-transfer').'">'.$langs->trans("BackToList").'</a>';
171 
172  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
173 
174  print '<div class="fichecenter">';
175  print '<div class="underbanner clearboth"></div>';
176  print '<table class="border centpercent tableforfield">';
177 
178  print '<tr><td class="titlefieldcreate">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec, 'day').'</td></tr>';
179 
180  print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount).'</span></td></tr>';
181 
182  // Status
183  /*
184  print '<tr><td>'.$langs->trans('Status').'</td>';
185  print '<td>'.$object->getLibStatut(1).'</td>';
186  print '</tr>';
187  */
188 
189  if (!empty($object->date_trans)) {
190  $muser = new User($db);
191  $muser->fetch($object->user_trans);
192 
193  print '<tr><td>'.$langs->trans("TransData").'</td><td>';
194  print dol_print_date($object->date_trans, 'day');
195  print ' &nbsp; <span class="opacitymedium">'.$langs->trans("By").'</span> '.$muser->getNomUrl(-1).'</td></tr>';
196  print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
197  print $object->methodes_trans[$object->method_trans];
198  print '</td></tr>';
199  }
200  if (!empty($object->date_credit)) {
201  print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
202  print dol_print_date($object->date_credit, 'day');
203  print '</td></tr>';
204  }
205 
206  print '</table>';
207 
208  print '<br>';
209 
210  print '<div class="underbanner clearboth"></div>';
211  print '<table class="border centpercent tableforfield">';
212 
213  $acc = new Account($db);
214  $result = $acc->fetch(($object->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT));
215 
216  print '<tr><td class="titlefieldcreate">';
217  $labelofbankfield = "BankToReceiveWithdraw";
218  if ($object->type == 'bank-transfer') {
219  $labelofbankfield = 'BankToPayCreditTransfer';
220  }
221  print $langs->trans($labelofbankfield);
222  print '</td>';
223  print '<td>';
224  if ($acc->id > 0) {
225  print $acc->getNomUrl(1);
226  }
227  print '</td>';
228  print '</tr>';
229 
230  print '<tr><td class="titlefieldcreate">';
231  $labelfororderfield = 'WithdrawalFile';
232  if ($object->type == 'bank-transfer') {
233  $labelfororderfield = 'CreditTransferFile';
234  }
235  print $langs->trans($labelfororderfield).'</td><td>';
236  $relativepath = 'receipts/'.$object->ref.'.xml';
237  $modulepart = 'prelevement';
238  if ($object->type == 'bank-transfer') {
239  $modulepart = 'paymentbybanktransfer';
240  }
241  print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'">'.$relativepath;
242  print img_picto('', 'download', 'class="paddingleft"');
243  print '</a>';
244  print '</td></tr>';
245 
246  // Other attributes
247  $parameters = array();
248  $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
249  print $hookmanager->resPrint;
250 
251  print '</table>';
252 
253  print '</div>';
254 
255  print dol_get_fiche_end();
256 
257 
258  $formconfirm = '';
259 
260  // Confirmation to delete
261  if ($action == 'delete') {
262  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Delete'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
263  }
264 
265  // Call Hook formConfirm
266  /*$parameters = array('formConfirm' => $formconfirm);
267  $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
268  if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
269  elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;*/
270 
271  // Print form confirm
272  print $formconfirm;
273 
274 
275  if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action == 'settransmitted') {
276  print '<form method="post" name="userfile" action="card.php?id='.$object->id.'" enctype="multipart/form-data">';
277  print '<input type="hidden" name="token" value="'.newToken().'">';
278  print '<input type="hidden" name="action" value="infotrans">';
279  print '<table class="noborder centpercent">';
280  print '<tr class="liste_titre">';
281  print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
282  print '<tr class="oddeven"><td>'.$langs->trans("TransData").'</td><td>';
283  print $form->selectDate('', '', '', '', '', "userfile", 1, 1);
284  print '</td></tr>';
285  print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
286  print $form->selectarray("methode", $object->methodes_trans);
287  print '</td></tr>';
288  print '</table>';
289  print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>';
290  print '</form>';
291  print '<br>';
292  }
293 
294  if (!empty($object->date_trans) && empty($object->date_credit) && $user->rights->prelevement->bons->credit && $action == 'setcredited') {
295  $btnLabel = ($object->type == 'bank-transfer') ? $langs->trans("ClassDebited") : $langs->trans("ClassCredited");
296  print '<form name="infocredit" method="post" action="card.php?id='.$object->id.'">';
297  print '<input type="hidden" name="token" value="'.newToken().'">';
298  print '<input type="hidden" name="action" value="infocredit">';
299  print '<table class="noborder centpercent">';
300  print '<tr class="liste_titre">';
301  print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
302  print '<tr class="oddeven"><td>'.$langs->trans('CreditDate').'</td><td>';
303  print $form->selectDate(-1, '', '', '', '', "infocredit", 1, 1);
304  print '</td></tr>';
305  print '</table>';
306  print '<br><div class="center"><span class="opacitymedium">'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice").'</span></div>';
307  print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($btnLabel).'"></div>';
308  print '</form>';
309  print '<br>';
310  }
311 
312  // Actions
313  if ($action != 'settransmitted' && $action != 'setcredited') {
314  print "\n".'<div class="tabsAction">'."\n";
315  $parameters = array();
316  $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
317  if (empty($reshook)) {
318  if (empty($object->date_trans)) {
319  if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send);
320  else print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send);
321  }
322  if (!empty($object->date_trans) && empty($object->date_credit)) {
323  if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit);
324  else print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit);
325  }
326 
327  if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->create);
328  else print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->creer);
329  }
330  print '</div>';
331  }
332 
333 
334  $ligne = new LignePrelevement($db);
335 
336  /*
337  * Lines into withdraw request
338  */
339  $sql = "SELECT pl.rowid, pl.statut, pl.amount,";
340  $sql .= " s.rowid as socid, s.nom as name";
341  $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
342  $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
343  $sql .= ", ".MAIN_DB_PREFIX."societe as s";
344  $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $id);
345  $sql .= " AND pl.fk_prelevement_bons = pb.rowid";
346  $sql .= " AND pb.entity = ".((int) $conf->entity); // No sharing of entity here
347  $sql .= " AND pl.fk_soc = s.rowid";
348  if ($socid) {
349  $sql .= " AND s.rowid = ".((int) $socid);
350  }
351  $sql .= $db->order($sortfield, $sortorder);
352 
353  // Count total nb of records
354  $nbtotalofrecords = '';
355  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
356  $result = $db->query($sql);
357  $nbtotalofrecords = $db->num_rows($result);
358  if (($page * $limit) > $nbtotalofrecords) {
359  // if total resultset is smaller then paging size (filtering), goto and load page 0
360  $page = 0;
361  $offset = 0;
362  }
363  }
364 
365  $sql .= $db->plimit($limit + 1, $offset);
366 
367  $result = $db->query($sql);
368 
369  if ($result) {
370  $num = $db->num_rows($result);
371  $i = 0;
372 
373  $urladd = "&id=".urlencode($id);
374  if ($limit > 0 && $limit != $conf->liste_limit) {
375  $urladd .= '&limit='.urlencode($limit);
376  }
377 
378  print '<form method="POST" action="'.$_SERVER ['PHP_SELF'].'" name="search_form">'."\n";
379  print '<input type="hidden" name="token" value="'.newToken().'"/>';
380  print '<input type="hidden" name="id" value="'.$id.'"/>';
381  print '<input type="hidden" name="socid" value="'.$socid.'"/>';
382  if (!empty($page)) {
383  print '<input type="hidden" name="page" value="'.$page.'"/>';
384  }
385  if (!empty($limit)) {
386  print '<input type="hidden" name="limit" value="'.$limit.'"/>';
387  }
388  if (!empty($sortfield)) {
389  print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
390  }
391  if (!empty($sortorder)) {
392  print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
393  }
394  print_barre_liste($langs->trans("Lines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
395 
396  print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
397  print '<table class="noborder liste" width="100%" cellpadding="4">';
398  print '<tr class="liste_titre">';
399  print_liste_field_titre("Lines", $_SERVER["PHP_SELF"], "pl.rowid", '', $urladd, '', $sortfield, $sortorder);
400  print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $urladd, '', $sortfield, $sortorder);
401  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $urladd, 'class="right"', $sortfield, $sortorder);
403  print "</tr>\n";
404 
405  $total = 0;
406 
407  while ($i < min($num, $limit)) {
408  $obj = $db->fetch_object($result);
409 
410  print '<tr class="oddeven">';
411 
412  // Status of line
413  print "<td>";
414  print '<a class="valignmiddle" href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'&token='.newToken().'">';
415  print $ligne->LibStatut($obj->statut, 2);
416  print '<span class="paddingleft">'.$obj->rowid.'</span>';
417  print '</a></td>';
418 
419  $thirdparty = new Societe($db);
420  $thirdparty->fetch($obj->socid);
421  print '<td>';
422  print $thirdparty->getNomUrl(1);
423  print "</td>\n";
424 
425  print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
426 
427  print '<td class="right">';
428 
429  if ($obj->statut == 3) {
430  print '<b>'.$langs->trans("StatusRefused").'</b>';
431  } else {
432  if ($object->statut == BonPrelevement::STATUS_CREDITED) {
433  if ($obj->statut == 2) {
434  if ($user->rights->prelevement->bons->credit) {
435  //print '<a class="butActionDelete" href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
436  print '<a href="line.php?action=rejet&type='.$object->type.'&id='.$obj->rowid.'&token='.newToken().'">'.$langs->trans("StandingOrderReject").'</a>';
437  } else {
438  //print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("StandingOrderReject").'</a>';
439  }
440  }
441  } else {
442  //print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine").'">'.$langs->trans("StandingOrderReject").'</a>';
443  }
444  }
445 
446  print '</td></tr>';
447 
448  $total += $obj->amount;
449 
450  $i++;
451  }
452 
453  if ($num > 0) {
454  $total = price2num($total, 'MT');
455 
456  print '<tr class="liste_total">';
457  print '<td>'.$langs->trans("Total").'</td>';
458  print '<td>&nbsp;</td>';
459  print '<td class="right">';
460  if (empty($offset) && $num <= $limit) {
461  // If we have all record on same page, then the following test/warning can be done
462  if ($total != $object->amount) {
463  print img_warning($langs->trans("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines"));
464  }
465  }
466  print price($total);
467  print "</td>\n";
468  print '<td>&nbsp;</td>';
469  print "</tr>\n";
470  }
471 
472  print "</table>";
473  print '</div>';
474  print '</form>';
475 
476  $db->free($result);
477  } else {
478  dol_print_error($db);
479  }
480 }
481 
482 // End of page
483 llxFooter();
484 $db->close();
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
Class to manage bank accounts.
Class to manage withdrawal receipts.
Class to manage generation of HTML components Only common components must be here.
Class to manage withdrawals.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
Definition: user.class.php:45
$parameters
Actions.
Definition: card.php:79
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
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...
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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...
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).
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
$formconfirm
if ($action == 'delbookkeepingyear') {
prelevement_prepare_head(BonPrelevement $object)
Prepare array with list of tabs.
$nbtotalofrecords
Count total nb of records.
Definition: list.php:329
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.