dolibarr  17.0.4
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 $socid = GETPOST('socid', 'int'); if ($socid < 0) {
50  $socid = 0;
51 }
52 
53 $object = new Paiement($db);
54 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
55 $hookmanager->initHooks(array('paymentcard', 'globalcard'));
56 
57 // Load object
58 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
59 
60 $result = restrictedArea($user, $object->element, $object->id, 'paiement');
61 
62 // Security check
63 if ($user->socid) {
64  $socid = $user->socid;
65 }
66 // Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
67 // It should be enough because all payments are done on invoices of the same thirdparty.
68 if ($socid && $socid != $object->thirdparty->id) {
70 }
71 
72 $error = 0;
73 
74 /*
75  * Actions
76  */
77 
78 if ($action == 'setnote' && $user->hasRight('facture', 'paiement')) {
79  $db->begin();
80 
81  $result = $object->update_note(GETPOST('note', 'restricthtml'));
82  if ($result > 0) {
83  $db->commit();
84  $action = '';
85  } else {
86  setEventMessages($object->error, $object->errors, 'errors');
87  $db->rollback();
88  }
89 }
90 
91 if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->paiement) {
92  $db->begin();
93 
94  $result = $object->delete();
95  if ($result > 0) {
96  $db->commit();
97 
98  if ($backtopage) {
99  header("Location: ".$backtopage);
100  exit;
101  } else {
102  header("Location: list.php");
103  exit;
104  }
105  } else {
106  $langs->load("errors");
107  setEventMessages($object->error, $object->errors, 'errors');
108  $db->rollback();
109  }
110 }
111 
112 if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture->paiement) {
113  $db->begin();
114 
115  if ($object->validate($user) > 0) {
116  $db->commit();
117 
118  // Loop on each invoice linked to this payment to rebuild PDF
119  if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
120  $outputlangs = $langs;
121  if (GETPOST('lang_id', 'aZ09')) {
122  $outputlangs = new Translate("", $conf);
123  $outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09'));
124  }
125 
126  $hidedetails = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
127  $hidedesc = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
128  $hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
129 
130  $sql = 'SELECT f.rowid as facid';
131  $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
132  $sql .= ' WHERE pf.fk_facture = f.rowid';
133  $sql .= ' AND f.fk_soc = s.rowid';
134  $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
135  $sql .= ' AND pf.fk_paiement = '.((int) $object->id);
136  $resql = $db->query($sql);
137  if ($resql) {
138  $i = 0;
139  $num = $db->num_rows($resql);
140 
141  if ($num > 0) {
142  while ($i < $num) {
143  $objp = $db->fetch_object($resql);
144 
145  $invoice = new Facture($db);
146 
147  if ($invoice->fetch($objp->facid) <= 0) {
148  $error++;
149  setEventMessages($invoice->error, $invoice->errors, 'errors');
150  break;
151  }
152 
153  if ($invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
154  $error++;
155  setEventMessages($invoice->error, $invoice->errors, 'errors');
156  break;
157  }
158 
159  $i++;
160  }
161  }
162 
163  $db->free($resql);
164  } else {
165  $error++;
166  setEventMessages($db->error, $db->errors, 'errors');
167  }
168  }
169 
170  if (! $error) {
171  header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
172  exit;
173  }
174  } else {
175  $db->rollback();
176 
177  $langs->load("errors");
178  setEventMessages($object->error, $object->errors, 'errors');
179  }
180 }
181 
182 if ($action == 'setnum_paiement' && GETPOST('num_paiement')) {
183  $res = $object->update_num(GETPOST('num_paiement'));
184  if ($res === 0) {
185  setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs');
186  } else {
187  setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors');
188  }
189 }
190 
191 if ($action == 'setdatep' && GETPOST('datepday')) {
192  $datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int'));
193  $res = $object->update_date($datepaye);
194  if ($res === 0) {
195  setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
196  } else {
197  setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors');
198  }
199 }
200 if ($action == 'createbankpayment' && !empty($user->rights->facture->paiement)) {
201  $db->begin();
202 
203  // Create the record into bank for the amount of payment $object
204  if (!$error) {
205  $label = '(CustomerInvoicePayment)';
206  if (GETPOST('type') == Facture::TYPE_CREDIT_NOTE) {
207  $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
208  }
209 
210  $bankaccountid = GETPOST('accountid', 'int');
211  if ($bankaccountid > 0) {
212  $object->paiementcode = $object->type_code;
213  $object->amounts = $object->getAmountsArray();
214 
215  $result = $object->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
216  if ($result < 0) {
217  setEventMessages($object->error, $object->errors, 'errors');
218  $error++;
219  }
220  } else {
221  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
222  $error++;
223  }
224  }
225 
226 
227  if (!$error) {
228  $db->commit();
229  } else {
230  $db->rollback();
231  }
232 }
233 
234 
235 /*
236  * View
237  */
238 
239 llxHeader('', $langs->trans("Payment"));
240 
241 $thirdpartystatic = new Societe($db);
242 
243 $result = $object->fetch($id, $ref);
244 if ($result <= 0) {
245  dol_print_error($db, 'Payment '.$id.' not found in database');
246  exit;
247 }
248 
249 $form = new Form($db);
250 
251 $head = payment_prepare_head($object);
252 
253 print dol_get_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment');
254 
255 // Confirmation of payment delete
256 if ($action == 'delete') {
257  print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete', '', 0, 2);
258 }
259 
260 // Confirmation of payment validation
261 if ($action == 'valide') {
262  $facid = $_GET['facid'];
263  print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_validate', '', 0, 2);
264 }
265 
266 $linkback = '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
267 
268 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
269 
270 
271 print '<div class="fichecenter">';
272 print '<div class="underbanner clearboth"></div>';
273 
274 print '<table class="border centpercent">'."\n";
275 
276 // Date payment
277 print '<tr><td class="titlefield">'.$form->editfieldkey("Date", 'datep', $object->date, $object, $user->rights->facture->paiement).'</td><td>';
278 print $form->editfieldval("Date", 'datep', $object->date, $object, $user->rights->facture->paiement, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'), '', 0, '', 'id', 'tzuser');
279 print '</td></tr>';
280 
281 // Payment type (VIR, LIQ, ...)
282 $labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label;
283 print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype;
284 print $object->num_payment ? ' - '.$object->num_payment : '';
285 print '</td></tr>';
286 
287 // Amount
288 print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, '', $langs, 0, -1, -1, $conf->currency).'</td></tr>';
289 
290 $disable_delete = 0;
291 // Bank account
292 if (isModEnabled("banque")) {
293  $bankline = new AccountLine($db);
294 
295  if ($object->fk_account > 0) {
296  $bankline->fetch($object->bank_line);
297  if ($bankline->rappro) {
298  $disable_delete = 1;
299  $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment"));
300  }
301 
302  print '<tr>';
303  print '<td>'.$langs->trans('BankAccount').'</td>';
304  print '<td>';
305  $accountstatic = new Account($db);
306  $accountstatic->fetch($bankline->fk_account);
307  print $accountstatic->getNomUrl(1);
308  print '</td>';
309  print '</tr>';
310  }
311 }
312 
313 // Payment numero
314 /*
315 $titlefield=$langs->trans('Numero').' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
316 print '<tr><td>'.$form->editfieldkey($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
317 print $form->editfieldval($titlefield,'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
318 print '</td></tr>';
319 
320 // Check transmitter
321 $titlefield=$langs->trans('CheckTransmitter').' <em>('.$langs->trans("ChequeMaker").')</em>';
322 print '<tr><td>'.$form->editfieldkey($titlefield,'chqemetteur',$object->,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
323 print $form->editfieldval($titlefield,'chqemetteur',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeMakeUpdateSucceeded'));
324 print '</td></tr>';
325 
326 // Bank name
327 $titlefield=$langs->trans('Bank').' <em>('.$langs->trans("ChequeBank").')</em>';
328 print '<tr><td>'.$form->editfieldkey($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td>';
329 print $form->editfieldval($titlefield,'chqbank',$object->aaa,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('ChequeBankUpdateSucceeded'));
330 print '</td></tr>';
331 */
332 
333 // Bank account
334 if (isModEnabled("banque")) {
335  if ($object->fk_account > 0) {
336  if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
337  include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
338  $bordereau = new RemiseCheque($db);
339  $bordereau->fetch($bankline->fk_bordereau);
340 
341  print '<tr>';
342  print '<td>'.$langs->trans('CheckReceipt').'</td>';
343  print '<td>';
344  print $bordereau->getNomUrl(1);
345  print '</td>';
346  print '</tr>';
347  }
348  }
349 
350  print '<tr>';
351  print '<td>'.$langs->trans('BankTransactionLine').'</td>';
352  print '<td>';
353  if ($object->fk_account > 0) {
354  print $bankline->getNomUrl(1, 0, 'showconciliatedandaccounted');
355  } else {
356  $langs->load("admin");
357  print '<span class="opacitymedium">';
358  print $langs->trans("NoRecordFoundIBankcAccount", $langs->transnoentitiesnoconv("Module85Name"));
359  print '</span>';
360  if (!empty($user->rights->facture->paiement)) {
361  // Try to guess $bankaccountidofinvoices that is ID of bank account defined on invoice.
362  // 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.
363  $amountofpayments = $object->getAmountsArray();
364  $bankaccountidofinvoices = null;
365  foreach ($amountofpayments as $idinvoice => $amountofpayment) {
366  $tmpinvoice = new Facture($db);
367  $tmpinvoice->fetch($idinvoice);
368  if ($tmpinvoice->fk_account > 0 && $bankaccountidofinvoices !== 0) {
369  if (is_null($bankaccountidofinvoices)) {
370  $bankaccountidofinvoices = $tmpinvoice->fk_account;
371  } elseif ($bankaccountidofinvoices != $tmpinvoice->fk_account) {
372  $bankaccountidofinvoices = 0;
373  }
374  }
375  }
376 
377  print '<form method="POST" name="createbankpayment">';
378  print '<input type="hidden" name="token" value="'.newToken().'">';
379  print '<input type="hidden" name="action" value="createbankpayment">';
380  print '<input type="hidden" name="id" value="'.$object->id.'">';
381  print ' '.$langs->trans("ToCreateRelatedRecordIntoBank").': ';
382  print $form->select_comptes($bankaccountidofinvoices, 'accountid', 0, '', 2, '', 0, '', 1);
383  //print '<span class="opacitymedium">';
384  print '<input type="submit" class="button small smallpaddingimp" name="createbankpayment" value="'.$langs->trans("ClickHere").'">';
385  //print '</span>';
386  print '</form>';
387  }
388  }
389  print '</td>';
390  print '</tr>';
391 }
392 
393 // Comments
394 print '<tr><td class="tdtop">'.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->facture->paiement).'</td><td>';
395 print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->facture->paiement, 'textarea:'.ROWS_3.':90%');
396 print '</td></tr>';
397 
398 print '</table>';
399 
400 print '</div>';
401 
402 print dol_get_fiche_end();
403 
404 
405 /*
406  * List of invoices
407  */
408 
409 $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';
410 $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
411 $sql .= ' WHERE pf.fk_facture = f.rowid';
412 $sql .= ' AND f.fk_soc = s.rowid';
413 $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
414 $sql .= ' AND pf.fk_paiement = '.((int) $object->id);
415 $resql = $db->query($sql);
416 if ($resql) {
417  $num = $db->num_rows($resql);
418 
419  $i = 0;
420  $total = 0;
421 
422  $moreforfilter = '';
423 
424  print '<br>';
425 
426  print '<div class="div-table-responsive">';
427  print '<table class="noborder centpercent">';
428 
429  print '<tr class="liste_titre">';
430  print '<td>'.$langs->trans('Bill').'</td>';
431  print '<td>'.$langs->trans('Company').'</td>';
432  if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
433  print '<td>'.$langs->trans('Entity').'</td>';
434  }
435  print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
436  print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
437  print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
438  print '<td class="right">'.$langs->trans('Status').'</td>';
439  print "</tr>\n";
440 
441  if ($num > 0) {
442  while ($i < $num) {
443  $objp = $db->fetch_object($resql);
444 
445  $thirdpartystatic->fetch($objp->socid);
446 
447  $invoice = new Facture($db);
448  $invoice->fetch($objp->facid);
449 
450  $paiement = $invoice->getSommePaiement();
451  $creditnotes = $invoice->getSumCreditNotesUsed();
452  $deposits = $invoice->getSumDepositsUsed();
453  $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
454  $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
455 
456  print '<tr class="oddeven">';
457 
458  // Invoice
459  print '<td>';
460  print $invoice->getNomUrl(1);
461  print "</td>\n";
462 
463  // Third party
464  print '<td class="tdoverflowmax150">';
465  print $thirdpartystatic->getNomUrl(1);
466  print '</td>';
467 
468  // Expected to pay
469  if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
470  print '<td>';
471  $mc->getInfo($objp->entity);
472  print $mc->label;
473  print '</td>';
474  }
475  // Expected to pay
476  print '<td class="right"><span class="amount">'.price($objp->total_ttc).'</span></td>';
477 
478  // Amount payed
479  print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
480 
481  // Remain to pay
482  print '<td class="right"><span class="amount">'.price($remaintopay).'</span></td>';
483 
484  // Status
485  print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
486 
487  print "</tr>\n";
488 
489  // 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
490  if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) {
491  $disable_delete = 1;
492  $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
493  }
494 
495  $total = $total + $objp->amount;
496  $i++;
497  }
498  }
499 
500 
501  print "</table>\n";
502  print '</div>';
503 
504  $db->free($resql);
505 } else {
506  dol_print_error($db);
507 }
508 
509 
510 
511 /*
512  * Actions Buttons
513  */
514 
515 print '<div class="tabsAction">';
516 
517 if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) {
518  if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') {
519  if ($user->rights->facture->paiement) {
520  print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$id.'&facid='.$objp->facid.'&action=valide&token='.newToken().'">'.$langs->trans('Valid').'</a>';
521  }
522  }
523 }
524 
525 $params = array();
526 if (! empty($title_button)) {
527  $params['attr'] = array('title' => $title_button);
528 }
529 
530 if ($user->socid == 0 && $action == '') {
531  print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete, $params);
532 }
533 
534 print '</div>';
535 
536 // End of page
537 llxFooter();
538 $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.