dolibarr 23.0.4
receipt.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
3 * Copyright (C) 2011-2023 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
5 * Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
6 * Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
7 * Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
8 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
9 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
10 * Copyright (C) 202 Ferran Marcet <fmarcet@2byte.es>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
33// Include the main.inc.php (note: when file is included into send.php, $action is already set and main.inc.php was already loaded)
37if (!isset($action)) {
38 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
39 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
40 //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
41 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
42 if (!defined('NOTOKENRENEWAL')) {
43 define('NOTOKENRENEWAL', '1');
44 }
45 if (!defined('NOREQUIREMENU')) {
46 define('NOREQUIREMENU', '1');
47 }
48 if (!defined('NOREQUIREHTML')) {
49 define('NOREQUIREHTML', '1');
50 }
51 if (!defined('NOREQUIREAJAX')) {
52 define('NOREQUIREAJAX', '1');
53 }
54
55 require '../main.inc.php'; // If this file is called from send.php avoid load again
56}
65include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
66include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
67
68$langs->loadLangs(array("main", "bills", "cashdesk", "companies"));
69
70$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
71
72$facid = GETPOSTINT('facid');
73
74$action = GETPOST('action', 'aZ09');
75$gift = GETPOSTINT('gift');
76
77if (!$user->hasRight('takepos', 'run')) {
79}
80
81
82/*
83 * Actions
84 */
85
86// None
87
88
89/*
90 * View
91 */
92
93top_htmlhead('', '', 2);
94
95if (!$facid && (string) $place != '' && !empty($_SESSION["takeposterminal"])) {
96 $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
97 $sql .= " WHERE ref = '(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
98 $sql .= " AND entity IN (".getEntity('invoice').")";
99
100 $resql = $db->query($sql);
101 $obj = $db->fetch_object($resql);
102 if ($obj) {
103 $facid = $obj->rowid;
104 }
105}
106$object = new Facture($db);
107
108if ($facid > 0 && !GETPOST('specimen')) {
109 $result = $object->fetch($facid);
110 // Only an invoice of the POS, in an entity of the user, can be printed from the POS
111 if ($result <= 0 || $object->module_source != 'takepos' || !in_array($object->entity, explode(',', getEntity('invoice')))) {
113 }
114} else {
115 $object->initAsSpecimen('takepos');
116}
117print '<body>';
118
119
120// Record entry in blocked logs each time we print a receipt
121//
122// This will also increase the counter of printings of the receipt
123// DOL_DOCUMENT_ROOT.'/blockedlog/ajax/block-add.php?id='.$object->id.'&element='.$object->element.'&action=DOC_PREVIEW&token='.newToken();
124
125print "
126<script>
127
128 console.log('Call /blockedlog/ajax/block-add on output of receipt.php.');
129 $.post('".DOL_URL_ROOT."/blockedlog/ajax/block-add.php'
130 , {
131 id: ".((int) $object->id)."
132 , element: '".dol_escape_js($object->element)."'
133 , action: 'DOC_PREVIEW'
134 , token: '".currentToken()."'
135 }
136 );
137</script>";
138
139/*
140 * jQuery(document).ready(function () {
141});
142 */
143
144// Call to external receipt modules factory if it exists and if we can (not allowed in some cases)
146 // If LNE version, we force format. Custom templates is not allowed
147 $conf->global->TAKEPOS_SHOW_HT_RECEIPT = 1;
148 $conf->global->TAKEPOS_TICKET_VAT_GROUPPED = 1;
149} else {
150 $parameters = array();
151 $hookmanager->initHooks(array('takeposfrontend'));
152 $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
153 if (!empty($hookmanager->resPrint)) {
154 print $hookmanager->resPrint;
155 return; // Receipt page can be called by the takepos/send.php page that use ob_start/end so we must use return and not exit to stop page
156 }
157}
158
159// IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolute path.
160?>
161
162<style>
163.right {
164 text-align: right;
165}
166.center {
167 text-align: center;
168}
169.left {
170 text-align: left;
171}
172.centpercent {
173 width: 100%;
174}
175@media only screen and (min-width: 1024px)
176{
177 body {
178 margin-left: 50px;
179 margin-right: 50px;
180 }
181}
182</style>
183<center>
184<div style="font-size: 1.5em">
185<?php
186echo '<b>'.$mysoc->name.'</b>';
187
188if (GETPOST('specimen')) {
189 print '<br>';
190 print '!!!!! SPECIMEN !!!!!';
191}
192?>
193</div>
194</center>
195<br>
196<p class="left">
197<?php
198$constFreeText = 'TAKEPOS_HEADER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
199if (getDolGlobalString('TAKEPOS_HEADER') || getDolGlobalString($constFreeText)) {
200 $newfreetext = '';
201 $substitutionarray = getCommonSubstitutionArray($langs);
202 complete_substitutions_array($substitutionarray, $langs, $object);
203 if (getDolGlobalString('TAKEPOS_HEADER')) {
204 $newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_HEADER'), $substitutionarray);
205 }
206 if (getDolGlobalString($constFreeText)) {
207 $newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
208 }
209 print nl2br($newfreetext);
210}
211?>
212</p>
213
214<?php
215if ($object->status == Facture::STATUS_DRAFT) {
216 $canprintifnotvalidate = true;
217 if (isALNERunningVersion()) {
218 $canprintifnotvalidate = false;
219 //$orderprinterallowed = false;
220 }
221
222 if (!$canprintifnotvalidate && empty($facid) && !GETPOST('specimen')) {
223 print "Error: Printing ticket is not allowed when invoice is not validated/paid.";
224 exit;
225 }
226}
227?>
228
229<p class="right">
230<?php
231// Invoice Ref
232if (getDolGlobalString('TAKEPOS_RECEIPT_NAME')) {
233 print getDolGlobalString('TAKEPOS_RECEIPT_NAME') . " ";
234} else {
235 print $langs->trans("InvoiceRef")." ";
236}
237if ($object->status == Facture::STATUS_DRAFT || empty($facid) || GETPOST('specimen')) {
238 // Printing ticket is not allowed if invoice not yet validate.
239 // Reaching this code may happen for specimen or if a feature to validate invoice and print it before paying is implemented.
240 if (empty($facid) || GETPOST('specimen')) {
241 print '99999';
242 } else {
243 print $object->ref;
244 }
245} else {
246 print $object->ref;
247}
248// POS terminal
249print '<br>'.$langs->trans("Terminal").' '.(GETPOST('specimen') ? '99' : ($object->pos_source ? $object->pos_source : 'Backoffice'));
250if (getDolGlobalString('TAKEPOS_SHOW_CUSTOMER')) {
251 if ($object->socid != getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"])) {
252 $soc = new Societe($db);
253 if ($object->socid > 0) {
254 $soc->fetch($object->socid);
255 } else {
256 $soc->fetch(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]));
257 }
258 print "<br>".$langs->trans("Customer").': '.$soc->name;
259 }
260}
261// Date
262print "<br>".$langs->trans('Date').": ".dol_print_date($object->date ? $object->date : dol_now(), 'day');
263// Date of printing
264if (isALNERunningVersion() || !getDolGlobalString('TAKEPOS_HIDE_DATE_OF_PRINTING')) {
265 print "<br>".$langs->trans("DateOfPrinting").': '.dol_print_date(dol_now(), 'dayhour', 'tzuserrel');
266}
267// Transaction ID
268if (isALNERunningVersion() && isModEnabled('blockedlog')) {
269 if ($object->status > $object::STATUS_DRAFT) {
270 $unalterablelogid = 'UNDEFINED';
271 $sql = "SELECT signature FROM ".MAIN_DB_PREFIX."blockedlog";
272 $sql .= " WHERE action = 'BILL_VALIDATE' AND element = 'facture' AND ref_object = '".$db->escape($object->ref)."'";
273 $sql .= $db->order('rowid', 'DESC');
274 $sql .= $db->plimit(1);
275
276 $resql = $db->query($sql);
277 if ($resql) {
278 $obj = $db->fetch_object($resql);
279 if ($obj) {
280 $unalterablelogid = $obj->signature;
281 }
282 }
283
284 print "<br>".$langs->trans("SignatureID").': '.dol_trunc(strtoupper($unalterablelogid), 10);
285 }
286}
287
288// $object->pos_print_counter is current value. It is increased by a parallel process when calling ajax block-add.php that
289// may have finished before or after this page start, so $object->pos_print_counter may be already up to date, but we use the value at begin
290// of this page start and we increase 1 to have correct value we want to show.
291$object->pos_print_counter += 1;
292
293// Show if it is a duplicata
294$isADuplicata = ($object->pos_print_counter >= 2);
295
296if ($object->status == $object::STATUS_CLOSED) {
297 if ($isADuplicata) {
298 print '<br><b>*** DUPLICATA (no '.($object->pos_print_counter - 1).') ***</b>'; // Hard coded string
299 }
300} else {
301 // Not yet paid completely
302 print '<br><b>*** '.strtoupper($langs->trans("TemporaryReceipt")).' ***</b>'; // Hard coded string
303}
304?>
305</p>
306<br>
307
308<table class="centpercent" style="border-top-style: double;">
309 <thead>
310 <tr>
311 <th class="left"><?php print $langs->trans("Label"); ?></th>
312 <th class="right"><?php print $langs->trans("Qty"); ?></th>
313 <th class="right"><?php if ($gift != 1) {
314 print $langs->trans("Price");
315 } ?></th>
316 <?php if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { ?>
317 <th class="right"><?php if ($gift != 1) {
318 print $langs->trans("TotalHT");
319 } ?></th>
320 <?php } ?>
321 <th class="right"><?php if ($gift != 1) {
322 print $langs->trans("TotalTTC");
323 } ?></th>
324 </tr>
325 </thead>
326 <tbody>
327 <?php
328 if ($action == 'without_details') {
329 $qty = GETPOSTINT('qty') > 0 ? GETPOSTINT('qty') : 1;
330 print '<tr>';
331 print '<td>' . GETPOST('label', 'alphanohtml') . '</td>';
332 print '<td class="right">' . $qty . '</td>';
333 print '<td class="right">' . price(price2num($object->total_ttc / $qty, 'MU'), 1) . '</td>';
334 if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) {
335 print '<td class="right">' . price($object->total_ht, 1) . '</td>';
336 }
337 print '<td class="right">' . price($object->total_ttc, 1) . '</td>';
338 print '</tr>';
339 } else {
340 foreach ($object->lines as $line) {
341 ?>
342 <tr>
343 <td>
344 <?php if (!empty($line->product_label)) {
345 echo $line->product_label;
346 } else {
347 echo $line->desc;
348 } ?>
349 </td>
350 <td class="right"><?php echo $line->qty; ?></td>
351 <td class="right"><?php if ($gift != 1) {
352 echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1);
353 } ?></td>
354 <?php
355 if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { ?>
356 <td class="right"><?php if ($gift != 1) {
357 echo price($line->total_ht, 1);
358 } ?></td>
359 <?php
360 } ?>
361 <td class="right"><?php if ($gift != 1) {
362 echo price($line->total_ttc, 1);
363 } ?></td>
364 </tr>
365 <?php
366 }
367 }
368 ?>
369 </tbody>
370</table>
371<br>
372<table class="right centpercent">
373<tr>
374 <th class="right"><?php if ($gift != 1) {
375 echo $langs->trans("TotalHT");
376 } ?></th>
377 <td class="right"><?php if ($gift != 1) {
378 echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";
379 } ?></td>
380</tr>
381<?php
382if (getDolGlobalString('TAKEPOS_TICKET_VAT_GROUPPED')) {
383 $vat_groups = array();
384 foreach ($object->lines as $line) {
385 if (!array_key_exists((string) $line->tva_tx, $vat_groups)) {
386 $vat_groups[(string) $line->tva_tx] = 0;
387 }
388 $vat_groups[(string) $line->tva_tx] += $line->total_tva;
389 }
390
391 // Loop on each VAT group
392 foreach ($vat_groups as $key => $val) {
393 ?>
394 <tr>
395 <th align="right"><?php if ($gift != 1) {
396 echo $langs->trans("VAT").' '.vatrate($key, true);
397 } ?></th>
398 <td align="right"><?php if ($gift != 1) {
399 echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n";
400 } ?></td>
401 </tr>
402 <?php
403 }
404} else { ?>
405<tr>
406 <th class="right"><?php if ($gift != 1) {
407 echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";
408 } ?></th>
409</tr>
410<?php }
411
412// Now show local taxes if company uses them
413
414// $mysoc->useLocalTax(N) is a country-wide flag (true as soon as the country has a
415// matching c_tva row with a localtaxN_type), so on its own it always prints the line
416// for Spanish companies even when the company is "No sujeto a RE / IRPF". Mirror the
417// pattern used by compta/facture/card.php, card-rec.php and prelevement.php and gate
418// the country check on $mysoc->localtaxN_assuj == "1".
419if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || price2num($object->total_localtax1, 'MU')) { ?>
420<tr>
421 <th class="right"><?php if ($gift != 1) {
422 echo ''.$langs->trans("TotalLT1").'</th><td class="right">'.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency)."\n";
423 } ?></th>
424</tr>
425<?php } ?>
426<?php if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || price2num($object->total_localtax2, 'MU')) { ?>
427<tr>
428 <th class="right"><?php if ($gift != 1) {
429 echo ''.$langs->trans("TotalLT2").'</th><td class="right">'.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency)."\n";
430 } ?></th>
431</tr>
432<?php } ?>
433<tr>
434 <th class="right"><?php if ($gift != 1) {
435 echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";
436 } ?></th>
437</tr>
438<?php
439if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
440 //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
441 include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
442 $multicurrency = new MultiCurrency($db);
443 $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
444 echo '<tr><th class="right">';
445 if ($gift != 1) {
446 echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].'</th><td class="right">'.price($object->total_ttc * $multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n";
447 }
448 echo '</td></tr>';
449}
450
451// We force the feature when LNE is on, whatever is setup. When a payment is done, we always want to see it on receipt.
453 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
454}
455
456if (getDolGlobalString('TAKEPOS_PRINT_PAYMENT_METHOD')) {
457 if (empty($facid)) {
458 // Case of a specimen, we output demo data
459 echo '<tr>';
460 echo '<td class="right">';
461 echo $langs->transnoentitiesnoconv("PaymentTypeShortLIQ");
462 echo '</td>';
463 echo '<td class="right">';
464 $amount_payment = 0;
465 echo price($amount_payment, 1, '', 1, - 1, - 1, $conf->currency);
466 echo '</td>';
467 echo '</tr>';
468 } else {
469 $sql = "SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
470 $sql .= " f.multicurrency_code,";
471 $sql .= " pf.amount as amount, pf.multicurrency_amount,";
472 $sql .= " cp.code";
473 $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p";
474 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
475 $sql .= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
476 $sql .= " ORDER BY p.datep";
477
478 $resql = $db->query($sql);
479 if ($resql) {
480 $num = $db->num_rows($resql);
481
482 $i = 0;
483 while ($i < $num) {
484 $row = $db->fetch_object($resql);
485
486 echo '<tr>';
487 echo '<td class="right">';
488 echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
489 echo '</td>';
490 echo '<td class="right">';
491 $amount_payment = (isModEnabled('multicurrency') && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
492 //print "xx ".$row->multicurrency_amount." - ".$row->amount." - ".$amount_payment." - ".$object->multicurrency_tx;
493 if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) {
494 $amount_payment += $row->pos_change; // Show amount with excess received if it's cash payment
495 $currency = $conf->currency;
496 } else {
497 // We do not show change if payment into a different currency because not yet supported
498 $currency = $row->multicurrency_code;
499 }
500 echo price($amount_payment, 1, '', 1, - 1, - 1, $currency);
501 echo '</td>';
502 echo '</tr>';
503 if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) {
504 echo '<tr>';
505 echo '<td class="right">';
506 echo $langs->trans("Change"); // ChangeBack ?
507 echo '</td>';
508 echo '<td class="right">';
509 echo price($row->pos_change, 1, '', 1, - 1, - 1, $currency);
510 echo '</td>';
511 echo '</tr>';
512 }
513 $i++;
514 }
515 }
516 }
517}
518?>
519</table>
520
521<br>
522<br>
523<br>
524<?php
525$constFreeText = 'TAKEPOS_FOOTER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
526if (getDolGlobalString('TAKEPOS_FOOTER') || getDolGlobalString($constFreeText)) {
527 $newfreetext = '';
528 $substitutionarray = getCommonSubstitutionArray($langs);
529 complete_substitutions_array($substitutionarray, $langs, $object);
530 if (getDolGlobalString($constFreeText)) {
531 $newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
532 }
533 if (getDolGlobalString('TAKEPOS_FOOTER')) {
534 $newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_FOOTER'), $substitutionarray);
535 }
536 print $newfreetext;
537}
538
540 $langs->load("blockedlog");
541 print '<center class="small"><i>';
542 print $langs->trans("LNECertifiedPOSSystem")."<br>";
543 if ($mysoc->idprof2) {
544 $labelidprof = $langs->transcountry("ProfId2Short", $mysoc->country_code);
545 print $labelidprof.': '.$mysoc->idprof2;
546 } elseif ($mysoc->idprof1) {
547 $labelidprof = $langs->transcountry("ProfId1Short", $mysoc->country_code);
548 print $labelidprof.': '.$mysoc->idprof1;
549 } else {
550 print 'ERROR: SIREN/SIRET not defined. Ticket not valid !!!';
551 }
552 if ($mysoc->tva_intra) {
553 $labelidprof = $langs->trans("VATIntra");
554 print ' - '.$labelidprof.': '.$mysoc->tva_intra;
555 }
556 print "</i></center><br>\n";
557}
558
559
560if (!GETPOST('forcenoautoopen')) {
561 ?>
562 <script type="text/javascript">
563 <?php
564 if ($facid) {
565 print 'window.print();';
566 } //Avoid print when is specimen
567 ?>
568 </script>
569 <?php
570}
571
572print "</body>";
573?>
574</html>
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
isALNEQualifiedVersion($ignoredev=0, $ignoremodule=0)
Return if the version is a candidate version to get the LNE certification and if the prerequisites ar...
isALNERunningVersion($blockedlogtestalreadydone=0)
Return if the application is executed with the LNE requirements on.
Class to manage invoices.
const STATUS_DRAFT
Draft status.
Class Currency.
Class to manage third parties objects (customers, suppliers, prospects...)
global $mysoc
dol_now($mode='gmt')
Return date for now.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formatted for view output Used into pdf and HTML pages.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
currentToken()
Return the value of token currently saved into session with name 'token'.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
treeview li table
No Email.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount
Definition receipt.php:471
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:132
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.