dolibarr  x.y.z
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
5  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2013 Marcos GarcĂ­a <marcosgdf@gmail.com>
7  * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
30 // Load Dolibarr environment
31 require '../../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
36 if (isModEnabled("banque")) {
37  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
38 }
39 
40 // Load translation files required by the page
41 $langs->loadLangs(array('bills', 'banks', 'companies'));
42 
43 $id = GETPOST('id', 'int');
44 $ref = GETPOST('ref', 'alpha');
45 $action = GETPOST('action', 'aZ09');
46 $confirm = GETPOST('confirm', 'alpha');
47 $backtopage = GETPOST('backtopage', 'alpha');
48 
49 $object = new Paiement($db);
50 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
51 $hookmanager->initHooks(array('paymentcard', 'globalcard'));
52 
53 // Load object
54 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
55 
56 $result = restrictedArea($user, $object->element, $object->id, 'paiement');
57 
58 // Security check
59 if ($user->socid) {
60  $socid = $user->socid;
61 }
62 // Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
63 // It should be enough because all payments are done on invoices of the same thirdparty.
64 if ($socid && $socid != $object->thirdparty->id) {
66 }
67 
68 $error = 0;
69 
70 /*
71  * Actions
72  */
73 
74 if ($action == 'setnote' && $user->hasRight('facture', 'paiement')) {
75  $db->begin();
76 
77  $result = $object->update_note(GETPOST('note', 'restricthtml'));
78  if ($result > 0) {
79  $db->commit();
80  $action = '';
81  } else {
82  setEventMessages($object->error, $object->errors, 'errors');
83  $db->rollback();
84  }
85 }
86 
87 if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('facture', 'paiement')) {
88  $db->begin();
89 
90  $result = $object->delete();
91  if ($result > 0) {
92  $db->commit();
93 
94  if ($backtopage) {
95  header("Location: ".$backtopage);
96  exit;
97  } else {
98  header("Location: list.php");
99  exit;
100  }
101  } else {
102  $langs->load("errors");
103  setEventMessages($object->error, $object->errors, 'errors');
104  $db->rollback();
105  }
106 }
107 
108 if ($action == 'confirm_validate' && $confirm == 'yes' && $user->hasRight('facture', 'paiement')) {
109  $db->begin();
110 
111  if ($object->validate($user) > 0) {
112  $db->commit();
113 
114  // Loop on each invoice linked to this payment to rebuild PDF
115  if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
116  $outputlangs = $langs;
117  if (GETPOST('lang_id', 'aZ09')) {
118  $outputlangs = new Translate("", $conf);
119  $outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09'));
120  }
121 
122  $hidedetails = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
123  $hidedesc = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
124  $hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
125 
126  $sql = 'SELECT f.rowid as facid';
127  $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
128  $sql .= ' WHERE pf.fk_facture = f.rowid';
129  $sql .= ' AND f.fk_soc = s.rowid';
130  $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
131  $sql .= ' AND pf.fk_paiement = '.((int) $object->id);
132  $resql = $db->query($sql);
133  if ($resql) {
134  $i = 0;
135  $num = $db->num_rows($resql);
136 
137  if ($num > 0) {
138  while ($i < $num) {
139  $objp = $db->fetch_object($resql);
140 
141  $invoice = new Facture($db);
142 
143  if ($invoice->fetch($objp->facid) <= 0) {
144  $error++;
145  setEventMessages($invoice->error, $invoice->errors, 'errors');
146  break;
147  }
148 
149  if ($invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
150  $error++;
151  setEventMessages($invoice->error, $invoice->errors, 'errors');
152  break;
153  }
154 
155  $i++;
156  }
157  }
158 
159  $db->free($resql);
160  } else {
161  $error++;
162  setEventMessages($db->error, $db->errors, 'errors');
163  }
164  }
165 
166  if (! $error) {
167  header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
168  exit;
169  }
170  } else {
171  $db->rollback();
172 
173  $langs->load("errors");
174  setEventMessages($object->error, $object->errors, 'errors');
175  }
176 }
177 
178 if ($action == 'setnum_paiement' && GETPOST('num_paiement') && $user->hasRight('facture', 'paiement')) {
179  $res = $object->update_num(GETPOST('num_paiement'));
180  if ($res === 0) {
181  setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs');
182  } else {
183  setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors');
184  }
185 }
186 
187 if ($action == 'setdatep' && GETPOST('datepday') && $user->hasRight('facture', 'paiement')) {
188  $datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int'));
189  $res = $object->update_date($datepaye);
190  if ($res === 0) {
191  setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
192  } else {
193  setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
194  }
195 }
196 
197 if ($action == 'createbankpayment' && $user->hasRight('facture', 'paiement')) {
198  $db->begin();
199 
200  // Create the record into bank for the amount of payment $object
201  if (!$error) {
202  $label = '(CustomerInvoicePayment)';
203  if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE) {
204  $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
205  }
206 
207  $bankaccountid = GETPOST('accountid', 'int');
208  if ($bankaccountid > 0) {
209  $object->paiementcode = $object->type_code;
210  $object->amounts = $object->getAmountsArray();
211 
212  $result = $object->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
213  if ($result < 0) {
214  setEventMessages($object->error, $object->errors, 'errors');
215  $error++;
216  }
217  } else {
218  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
219  $error++;
220  }
221  }
222 
223 
224  if (!$error) {
225  $db->commit();
226  } else {
227  $db->rollback();
228  }
229 }
230 
231 
232 /*
233  * View
234  */
235 
236 llxHeader('', $langs->trans("Payment"));
237 
238 $thirdpartystatic = new Societe($db);
239 
240 $result = $object->fetch($id, $ref);
241 if ($result <= 0) {
242  dol_print_error($db, 'Payement '.$id.' not found in database');
243  exit;
244 }
245 
246 $form = new Form($db);
247 
248 $head = payment_prepare_head($object);
249 
250 print dol_get_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment');
251 
252 // Confirmation of payment delete
253 if ($action == 'delete') {
254  print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2);
255 }
256 
257 // Confirmation of payment validation
258 if ($action == 'valide') {
259  $facid = $_GET['facid'];
260  print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_validate', '', 0, 2);
261 }
262 
263 $linkback = '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
264 
265 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
266 
267 
268 print '<div class="fichecenter">';
269 print '<div class="underbanner clearboth"></div>';
270 
271 print '<table class="border centpercent">'."\n";
272 
273 // Date payment
274 print '<tr><td class="titlefield">'.$form->editfieldkey("Date", 'datep', $object->date, $object, $user->rights->facture->paiement).'</td><td>';
275 print $form->editfieldval("Date", 'datep', $object->date, $object, $user->rights->facture->paiement, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'), '', 0, '', 'id', 'tzuser');
276 print '</td></tr>';
277 
278 // Payment type (VIR, LIQ, ...)
279 $labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label;
280 print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype;
281 print $object->num_payment ? ' - '.$object->num_payment : '';
282 print '</td></tr>';
283 
284 // Amount
285 print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, '', $langs, 0, -1, -1, $conf->currency).'</td></tr>';
286 
287 $disable_delete = 0;
288 // Bank account
289 if (isModEnabled("banque")) {
290  $bankline = new AccountLine($db);
291 
292  if ($object->fk_account > 0) {
293  $bankline->fetch($object->bank_line);
294  if ($bankline->rappro) {
295  $disable_delete = 1;
296  $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
297  }
298 
299  print '<tr>';
300  print '<td>'.$langs->trans('BankAccount').'</td>';
301  print '<td>';
302  $accountstatic = new Account($db);
303  $accountstatic->fetch($bankline->fk_account);
304  print $accountstatic->getNomUrl(1);
305  print '</td>';
306  print '</tr>';
307  }
308 }
309 
310 // Payment numero
311 /*
312 $titlefield=$langs->trans('Numero').' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
313 print '<tr><td>'.$form->editfieldkey($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
314 print $form->editfieldval($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
315 print '</td></tr>';
316 
317 // Check transmitter
318 $titlefield=$langs->trans('CheckTransmitter').' <em>('.$langs->trans("ChequeMaker").')</em>';
319 print '<tr><td>'.$form->editfieldkey($titlefield,'chqemetteur',$object->,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
320 print $form->editfieldval($titlefield,'chqemetteur',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeMakeUpdateSucceeded'));
321 print '</td></tr>';
322 
323 // Bank name
324 $titlefield=$langs->trans('Bank').' <em>('.$langs->trans("ChequeBank").')</em>';
325 print '<tr><td>'.$form->editfieldkey($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
326 print $form->editfieldval($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeBankUpdateSucceeded'));
327 print '</td></tr>';
328 */
329 
330 // Bank account
331 if (isModEnabled("banque")) {
332  if ($object->fk_account > 0) {
333  if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
334  include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
335  $bordereau = new RemiseCheque($db);
336  $bordereau->fetch($bankline->fk_bordereau);
337 
338  print '<tr>';
339  print '<td>'.$langs->trans('CheckReceipt').'</td>';
340  print '<td>';
341  print $bordereau->getNomUrl(1);
342  print '</td>';
343  print '</tr>';
344  }
345  }
346 
347  print '<tr>';
348  print '<td>'.$langs->trans('BankTransactionLine').'</td>';
349  print '<td>';
350  if ($object->fk_account > 0) {
351  print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
352  } else {
353  $langs->load("admin");
354  print '<span class="opacitymedium">';
355  print $langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name"));
356  print '</span>';
357  if (!empty($user->rights->facture->paiement)) {
358  // Try to guess $bankaccountidofinvoices that is ID of bank account defined on invoice.
359  // Return null if not found, return 0 if it has different value for at least 2 invoices, return the value if same on all invoices where a bank is defined.
360  $amountofpayments = $object->getAmountsArray();
361  $bankaccountidofinvoices = null;
362  foreach ($amountofpayments as $idinvoice => $amountofpayment) {
363  $tmpinvoice = new Facture($db);
364  $tmpinvoice->fetch($idinvoice);
365  if ($tmpinvoice->fk_account > 0 && $bankaccountidofinvoices !== 0) {
366  if (is_null($bankaccountidofinvoices)) {
367  $bankaccountidofinvoices = $tmpinvoice->fk_account;
368  } elseif ($bankaccountidofinvoices != $tmpinvoice->fk_account) {
369  $bankaccountidofinvoices = 0;
370  }
371  }
372  }
373 
374  print '<form method="POST" name="createbankpayment">';
375  print '<input type="hidden" name="token" value="'.newToken().'">';
376  print '<input type="hidden" name="action" value="createbankpayment">';
377  print '<input type="hidden" name="id" value="'.$object->id.'">';
378  print ' '.$langs->trans("ToCreateRelatedRecordIntoBank").': ';
379  print $form->select_comptes($bankaccountidofinvoices, 'accountid', 0, '', 2, '', 0, '', 1);
380  //print '<span class="opacitymedium">';
381  print '<input type="submit" class="button small smallpaddingimp" name="createbankpayment" value="'.$langs->trans("ClickHere").'">';
382  //print '</span>';
383  print '</form>';
384  }
385  }
386  print '</td>';
387  print '</tr>';
388 }
389 
390 // Comments
391 print '<tr><td class="tdtop">'.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->facture->paiement).'</td><td>';
392 print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->facture->paiement, 'textarea:'.ROWS_3.':90%');
393 print '</td></tr>';
394 
395 print '</table>';
396 
397 print '</div>';
398 
399 print dol_get_fiche_end();
400 
401 
402 /*
403  * List of invoices
404  */
405 
406 $sql = 'SELECT f.rowid as facid, f.ref, f.type, f.total_ttc, f.paye, f.entity, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid';
407 $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
408 $sql .= ' WHERE pf.fk_facture = f.rowid';
409 $sql .= ' AND f.fk_soc = s.rowid';
410 $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
411 $sql .= ' AND pf.fk_paiement = '.((int) $object->id);
412 $resql = $db->query($sql);
413 if ($resql) {
414  $num = $db->num_rows($resql);
415 
416  $i = 0;
417  $total = 0;
418 
419  print '<br>';
420 
421  print '<div class="div-table-responsive">';
422  print '<table class="noborder centpercent">';
423 
424  print '<tr class="liste_titre">';
425  print '<td>'.$langs->trans('Bill').'</td>';
426  print '<td>'.$langs->trans('Company').'</td>';
427  if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
428  print '<td>'.$langs->trans('Entity').'</td>';
429  }
430  print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
431  print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
432  print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
433  print '<td class="right">'.$langs->trans('Status').'</td>';
434  print "</tr>\n";
435 
436  if ($num > 0) {
437  while ($i < $num) {
438  $objp = $db->fetch_object($resql);
439 
440  $thirdpartystatic->fetch($objp->socid);
441 
442  $invoice = new Facture($db);
443  $invoice->fetch($objp->facid);
444 
445  $paiement = $invoice->getSommePaiement();
446  $creditnotes = $invoice->getSumCreditNotesUsed();
447  $deposits = $invoice->getSumDepositsUsed();
448  $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
449  $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
450 
451  print '<tr class="oddeven">';
452 
453  // Invoice
454  print '<td>';
455  print $invoice->getNomUrl(1);
456  print "</td>\n";
457 
458  // Third party
459  print '<td class="tdoverflowmax150">';
460  print $thirdpartystatic->getNomUrl(1);
461  print '</td>';
462 
463  // Expected to pay
464  if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
465  print '<td>';
466  $mc->getInfo($objp->entity);
467  print $mc->label;
468  print '</td>';
469  }
470  // Expected to pay
471  print '<td class="right"><span class="amount">'.price($objp->total_ttc).'</span></td>';
472 
473  // Amount payed
474  print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
475 
476  // Remain to pay
477  print '<td class="right"><span class="amount">'.price($remaintopay).'</span></td>';
478 
479  // Status
480  print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
481 
482  print "</tr>\n";
483 
484  // If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production
485  if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) {
486  $disable_delete = 1;
487  $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
488  }
489 
490  $total = $total + $objp->amount;
491  $i++;
492  }
493  }
494 
495 
496  print "</table>\n";
497  print '</div>';
498 
499  $db->free($resql);
500 } else {
501  dol_print_error($db);
502 }
503 
504 
505 
506 /*
507  * Actions Buttons
508  */
509 
510 print '<div class="tabsAction">';
511 
512 if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
513  if ($user->socid == 0 && $object->statut == 0 && $action == '') {
514  if ($user->rights->facture->paiement) {
515  print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&action=valide&token='.newToken().'">'.$langs->trans('Valid').'</a>';
516  }
517  }
518 }
519 
520 if ($user->socid == 0 && $action == '') {
521  print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete);
522 }
523 
524 print '</div>';
525 
526 // End of page
527 llxFooter();
528 $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 bank transaction lines.
Class to manage invoices.
const TYPE_CREDIT_NOTE
Credit note invoice.
Class to manage generation of HTML components Only common components must be here.
Class to manage payments of customer invoices.
Class to manage cheque delivery receipts.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
Definition: index.php:745
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.
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...
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.
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.
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.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.