dolibarr 24.0.0-beta
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)
38if (!isset($action)) {
39 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
40 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
41 //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
42 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
43 if (!defined('NOTOKENRENEWAL')) {
44 define('NOTOKENRENEWAL', '1');
45 }
46 if (!defined('NOREQUIREMENU')) {
47 define('NOREQUIREMENU', '1');
48 }
49 if (!defined('NOREQUIREHTML')) {
50 define('NOREQUIREHTML', '1');
51 }
52 if (!defined('NOREQUIREAJAX')) {
53 define('NOREQUIREAJAX', '1');
54 }
55
56 require '../main.inc.php'; // If this file is called from send.php avoid load again
57}
66include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
67include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
68
69$langs->loadLangs(array("main", "bills", "cashdesk", "companies"));
70
71$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
72
73$facid = GETPOSTINT('facid');
74
75$action = GETPOST('action', 'aZ09');
76$gift = GETPOSTINT('gift');
77
78if (!$user->hasRight('takepos', 'run')) {
80}
81
82
83/*
84 * Actions
85 */
86
87// None
88
89
90/*
91 * View
92 */
93
94top_htmlhead('', '', 2);
95
96if (!$facid && (string) $place != '' && !empty($_SESSION["takeposterminal"])) {
97 $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
98 $sql .= " WHERE ref = '(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
99 $sql .= " AND entity IN (".getEntity('invoice').")";
100
101 $resql = $db->query($sql);
102 $obj = $db->fetch_object($resql);
103 if ($obj) {
104 $facid = $obj->rowid;
105 }
106}
107$object = new Facture($db);
108if ($facid > 0 && !GETPOST('specimen')) {
109 $object->fetch($facid);
110} else {
111 $object->initAsSpecimen('takepos');
112}
113
114print '<body>';
115
116// Record entry in blocked logs each time we print a receipt
117//
118// This will also increase the counter of printings of the receipt
119// DOL_DOCUMENT_ROOT.'/blockedlog/ajax/block-add.php?id='.$object->id.'&element='.$object->element.'&action=DOC_PREVIEW&token='.newToken();
120
121if (!GETPOST('specimen') && empty($nojs)) {
122 print "
123 <script>
124 console.log('Call /blockedlog/ajax/block-add from Ajax call on receipt.php.');
125 $.post('".DOL_URL_ROOT."/blockedlog/ajax/block-add.php',
126 {
127 id: ".((int) $object->id).",
128 element: '".dol_escape_js($object->element)."',
129 action: 'DOC_PREVIEW',
130 lang: '".dol_escape_js($langs->defaultlang)."',
131 token: '".currentToken()."'
132 }
133 ).fail(function(jqXHR, textStatus, errorThrown) {
134 console.error('Error AJAX :', textStatus, errorThrown);
135 console.error('Answer server :', jqXHR.responseText);
136 });
137 </script>";
138}
139
140// Call to external receipt modules factory if it exists and if we can (not allowed in some cases)
142 // If LNE version, we force parameters.
143 $conf->global->TAKEPOS_SHOW_HT_RECEIPT = 1;
144 $conf->global->TAKEPOS_TICKET_VAT_GROUPPED = 1;
145 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
146 $conf->global->TAKEPOS_GIFT_RECEIPT = 0;
147 $conf->global->TAKEPOS_PRINT_WITHOUT_DETAILS = 0;
148} else {
149 $parameters = array();
150 $hookmanager->initHooks(array('takeposfrontend'));
151 $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
152 if (!empty($hookmanager->resPrint)) {
153 print $hookmanager->resPrint;
154 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
155 }
156}
157
158// 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.
159?>
160
161<style>
162.right {
163 text-align: right;
164}
165.center {
166 text-align: center;
167}
168.left {
169 text-align: left;
170}
171.centpercent {
172 width: 100%;
173}
174@media only screen and (min-width: 1024px)
175{
176 body {
177 margin-left: 50px;
178 margin-right: 50px;
179 }
180}
181</style>
182
183<center>
184<div style="font-size: 1.3em">
185<br><!-- Need a margin to avoid that the print of the ticket is cut by the browser -->
186<?php
187echo '<b>'.dolPrintHTML($mysoc->name).'</b>';
188
189if (GETPOST('specimen')) {
190 print '<br>';
191 print '!!! SPECIMEN !!!';
192}
193?>
194</div>
195</center>
196<br>
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 '<p class="left">';
210 print nl2br($newfreetext);
211 print '<p>';
212}
213
214if ($object->status == Facture::STATUS_DRAFT) {
215 $canprintifnotvalidate = true;
216 if (isALNERunningVersion()) {
217 $canprintifnotvalidate = false;
218 //$orderprinterallowed = false;
219 }
220
221 if (!$canprintifnotvalidate && empty($facid) && !GETPOST('specimen')) {
222 print "Error: Printing ticket is not allowed when invoice is not validated/paid.";
223 exit;
224 }
225}
226?>
227
228<p class="right">
229<?php
230// Invoice Ref
231if (getDolGlobalString('TAKEPOS_RECEIPT_NAME')) {
232 print getDolGlobalString('TAKEPOS_RECEIPT_NAME') . " ";
233} else {
234 print $langs->trans("InvoiceRef")." ";
235}
236if ($object->status == Facture::STATUS_DRAFT || empty($facid) || GETPOST('specimen')) {
237 // Printing ticket is not allowed if invoice not yet validate.
238 // Reaching this code may happen for specimen or if a feature to validate invoice and print it before paying is implemented.
239 if (empty($facid) || GETPOST('specimen')) {
240 print '99999';
241 } else {
242 print dolPrintHTML($object->ref);
243 }
244} else {
245 print dolPrintHTML($object->ref);
246}
247// POS terminal
248print "<br>\n";
249print $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>\n";
263print $langs->trans('Date').": ".dol_print_date($object->date ? $object->date : dol_now(), 'day');
264// Date of printing
265if (isALNERunningVersion() || !getDolGlobalString('TAKEPOS_HIDE_DATE_OF_PRINTING')) {
266 print "<br>\n";
267 print $langs->trans("DateOfPrinting").': '.dol_print_date(dol_now(), 'dayhour', 'tzuserrel');
268}
269// Transaction ID
270if (isALNERunningVersion() && isModEnabled('blockedlog')) {
271 if ($object->status > $object::STATUS_DRAFT) {
272 $unalterablelogid = 'UNDEFINED';
273 $sql = "SELECT signature FROM ".MAIN_DB_PREFIX."blockedlog";
274 $sql .= " WHERE action = 'BILL_VALIDATE' AND element = 'facture' AND ref_object = '".$db->escape($object->ref)."'";
275 $sql .= $db->order('rowid', 'DESC');
276 $sql .= $db->plimit(1);
277
278 $resql = $db->query($sql);
279 if ($resql) {
280 $obj = $db->fetch_object($resql);
281 if ($obj) {
282 $unalterablelogid = $obj->signature;
283 }
284 }
285
286 print "<br>\n";
287 print $langs->trans("SignatureID").': '.dol_trunc(strtoupper($unalterablelogid), 10);
288 }
289}
290
291// $object->pos_print_counter is current value. We increase it here.
292if ($object->status == $object::STATUS_CLOSED) {
293 // If no more a temporary receipt, we increase counter by 1
294 $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET pos_print_counter = pos_print_counter + 1";
295 $sql .= " WHERE rowid = ".((int) $object->id);
296 $db->query($sql);
297
298 $object->pos_print_counter += 1;
299}
300
301// Show if it is a duplicata
302$isADuplicata = ($object->pos_print_counter >= 2);
303
304if ($object->status != $object::STATUS_CLOSED) {
305 // Not yet paid completely
306 print '<br><b>*** '.strtoupper($langs->trans("TemporaryReceipt")).' ***</b>';
307} else {
308 if ($isADuplicata) {
309 print '<br><b>*** '.$langs->transnoentities("DUPLICATA");
310 if (getDolGlobalString('TAKEPOS_SHOW_PRINT_COUNTER_ON_RECEIPT')) {
311 print ' (no '.($object->pos_print_counter - 1).')';
312 }
313 print ' ***</b>';
314 }
315}
316?>
317</p>
318<br>
319
320<table class="centpercent" style="border-top-style: double;">
321 <thead>
322 <tr>
323 <th class="left"><?php print $langs->trans("Ref").'/'.$langs->trans("Label"); ?></th>
324 <th class="right"><?php print $langs->trans("Qty"); ?></th>
325 <th class="right"><?php if ($gift != 1) {
326 print $langs->trans("Price");
327 } ?></th>
328 <?php if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { ?>
329 <th class="right"><?php if ($gift != 1) {
330 print $langs->trans("TotalHT");
331 } ?></th>
332 <?php } ?>
333 <th class="right"><?php if ($gift != 1) {
334 print $langs->trans("TotalTTC");
335 } ?></th>
336 </tr>
337 </thead>
338 <tbody>
339 <?php
340 if ($action == 'without_details') {
341 $qty = GETPOSTINT('qty') > 0 ? GETPOSTINT('qty') : 1;
342 print '<tr>';
343 print '<td>' . GETPOST('label', 'alphanohtml') . '</td>';
344 print '<td class="right">' . $qty . '</td>';
345 print '<td class="right">' . price(price2num($object->total_ttc / $qty, 'MU'), 1) . '</td>';
346 if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) {
347 print '<td class="right">' . price($object->total_ht, 1) . '</td>';
348 }
349 print '<td class="right">' . price($object->total_ttc, 1) . '</td>';
350 print '</tr>';
351 } else {
352 foreach ($object->lines as $line) {
353 ?>
354 <tr>
355 <td>
356 <?php if (!empty($line->product_label)) {
357 echo $line->product_ref." - ";
358 echo $line->product_label;
359 } else {
360 echo $line->desc;
361 } ?>
362 </td>
363 <td class="right"><?php echo $line->qty; ?></td>
364 <td class="right"><?php if ($gift != 1) {
365 echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1);
366 } ?></td>
367 <?php
368 if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { ?>
369 <td class="right"><?php if ($gift != 1) {
370 echo price($line->total_ht, 1);
371 } ?></td>
372 <?php
373 } ?>
374 <td class="right"><?php if ($gift != 1) {
375 echo price($line->total_ttc, 1);
376 } ?></td>
377 </tr>
378 <?php
379 }
380 }
381 ?>
382 </tbody>
383</table>
384<br>
385<table class="right centpercent">
386<tr>
387 <th class="right"><?php if ($gift != 1) {
388 echo $langs->trans("TotalHT");
389 } ?></th>
390 <td class="right"><?php if ($gift != 1) {
391 echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";
392 } ?></td>
393</tr>
394<?php
395if (getDolGlobalString('TAKEPOS_TICKET_VAT_GROUPPED')) {
396 $vat_groups = array();
397 foreach ($object->lines as $line) {
398 if (!array_key_exists((string) $line->tva_tx, $vat_groups)) {
399 $vat_groups[(string) $line->tva_tx] = 0;
400 }
401 $vat_groups[(string) $line->tva_tx] += $line->total_tva;
402 }
403
404 // Loop on each VAT group
405 foreach ($vat_groups as $key => $val) {
406 ?>
407 <tr>
408 <th align="right"><?php if ($gift != 1) {
409 echo $langs->trans("VAT").' '.vatrate($key, true);
410 } ?></th>
411 <td align="right"><?php if ($gift != 1) {
412 echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n";
413 } ?></td>
414 </tr>
415 <?php
416 }
417} else { ?>
418<tr>
419 <th class="right"><?php if ($gift != 1) {
420 echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";
421 } ?></th>
422</tr>
423<?php }
424
425// Now show local taxes if company uses them
426
427// $mysoc->useLocalTax(N) is a country-wide flag (true as soon as the country has a
428// matching c_tva row with a localtaxN_type), so on its own it always prints the line
429// for Spanish companies even when the company is "No sujeto a RE / IRPF". Mirror the
430// pattern used by compta/facture/card.php, card-rec.php and prelevement.php and gate
431// the country check on $mysoc->localtaxN_assuj == "1".
432if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || price2num($object->total_localtax1, 'MU')) { ?>
433<tr>
434 <th class="right"><?php if ($gift != 1) {
435 echo ''.$langs->trans("TotalLT1").'</th><td class="right">'.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency)."\n";
436 } ?></th>
437</tr>
438<?php } ?>
439<?php if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || price2num($object->total_localtax2, 'MU')) { ?>
440<tr>
441 <th class="right"><?php if ($gift != 1) {
442 echo ''.$langs->trans("TotalLT2").'</th><td class="right">'.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency)."\n";
443 } ?></th>
444</tr>
445<?php } ?>
446<tr>
447 <th class="right"><?php if ($gift != 1) {
448 echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";
449 } ?></th>
450</tr>
451<?php
452if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
453 //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
454 include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
455 $multicurrency = new MultiCurrency($db);
456 $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
457 echo '<tr><th class="right">';
458 if ($gift != 1) {
459 echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].'</th><td class="right">'.price($object->total_ttc * $multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n";
460 }
461 echo '</th></tr>';
462}
463
464// We force the feature when LNE is on, whatever is setup. When a payment is done, we always want to see it on receipt.
466 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
467 if ($object->status == $object::STATUS_CLOSED) {
468 print '<tr><th class="right"></th><td>';
469 print '--- '.$langs->trans("Paid").' ---';
470 print '</td></tr>';
471 }
472}
473
474if (getDolGlobalString('TAKEPOS_PRINT_PAYMENT_METHOD')) {
475 if (empty($facid)) {
476 // Case of a specimen, we output demo data
477 echo '<tr>';
478 echo '<td class="right">';
479 echo $langs->transnoentitiesnoconv("PaymentTypeShortLIQ");
480 echo '</td>';
481 echo '<td class="right">';
482 $amount_payment = 0;
483 echo price($amount_payment, 1, '', 1, - 1, - 1, $conf->currency);
484 echo '</td>';
485 echo '</tr>';
486 } else {
487 $sql = "SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
488 $sql .= " f.multicurrency_code,";
489 $sql .= " pf.amount as amount, pf.multicurrency_amount,";
490 $sql .= " cp.code";
491 $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p";
492 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
493 $sql .= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
494 $sql .= " ORDER BY p.datep";
495
496 $resql = $db->query($sql);
497 if ($resql) {
498 $num = $db->num_rows($resql);
499
500 $i = 0;
501 while ($i < $num) {
502 $row = $db->fetch_object($resql);
503
504 echo '<tr>';
505 echo '<td class="right">';
506 echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
507 echo '</td>';
508 echo '<td class="right">';
509 $amount_payment = (isModEnabled('multicurrency') && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
510 //print "xx ".$row->multicurrency_amount." - ".$row->amount." - ".$amount_payment." - ".$object->multicurrency_tx;
511 if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) {
512 $amount_payment += $row->pos_change; // Show amount with excess received if it's cash payment
513 $currency = $conf->currency;
514 } else {
515 // We do not show change if payment into a different currency because not yet supported
516 $currency = $row->multicurrency_code;
517 }
518 echo price($amount_payment, 1, '', 1, - 1, - 1, $currency);
519 echo '</td>';
520 echo '</tr>';
521 if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) {
522 echo '<tr>';
523 echo '<td class="right">';
524 echo $langs->trans("Change"); // ChangeBack ?
525 echo '</td>';
526 echo '<td class="right">';
527 echo price($row->pos_change, 1, '', 1, - 1, - 1, $currency);
528 echo '</td>';
529 echo '</tr>';
530 }
531 $i++;
532 }
533 }
534 }
535}
536?>
537</table>
538
539<br>
540<br>
541<br>
542<?php
543$constFreeText = 'TAKEPOS_FOOTER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
544if (getDolGlobalString('TAKEPOS_FOOTER') || getDolGlobalString($constFreeText)) {
545 $newfreetext = '';
546 $substitutionarray = getCommonSubstitutionArray($langs);
547 complete_substitutions_array($substitutionarray, $langs, $object);
548 if (getDolGlobalString($constFreeText)) {
549 $newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
550 }
551 if (getDolGlobalString('TAKEPOS_FOOTER')) {
552 $newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_FOOTER'), $substitutionarray);
553 }
554 print $newfreetext;
555}
556
558 $langs->load("blockedlog");
559 print '<center class="small"><i>';
560
561 // Special additional message for FR only
562 $infotoshow = '';
563 if ($mysoc->country_code == 'FR') {
564 $islne = isALNEQualifiedVersion(1, 1);
565 if ($islne) {
566 if (preg_match('/\-/', DOL_VERSION)) {
567 // This is an alpha or beta version
568 $infotoshow = $langs->trans("LNECandidatePOSSystem");
569 } else {
570 $infotoshow = $langs->trans("LNECertifiedPOSSystem");
571 }
572 }
573 }
574 print $infotoshow."<br>";
575
576 if ($mysoc->idprof2) {
577 $labelidprof = $langs->transcountry("ProfId2Short", $mysoc->country_code);
578 print $labelidprof.': '.$mysoc->idprof2;
579 } elseif ($mysoc->idprof1) {
580 $labelidprof = $langs->transcountry("ProfId1Short", $mysoc->country_code);
581 print $labelidprof.': '.$mysoc->idprof1;
582 } else {
583 print 'ERROR: SIREN/SIRET not defined. Ticket not valid !!!';
584 }
585 if ($mysoc->tva_intra) {
586 $labelidprof = $langs->trans("VATIntra");
587 print ' - '.$labelidprof.': '.$mysoc->tva_intra;
588 }
589 print "</i></center>\n";
590}
591
592print "<br>\n<!-- Need a margin to avoid that the print of the ticket is cut by the browser -->";
593
594if (!GETPOST('forcenoautoopen') && !GETPOST('specimen') && empty($nojs)) {
595 ?>
596 <script type="text/javascript">
597 <?php
598 if ($facid) {
599 print 'console.log("ref = '.$object->ref.' - pos_print_counter = '.$object->pos_print_counter.'");';
600 print 'window.print();';
601 } //Avoid print when is specimen
602 ?>
603 </script>
604 <?php
605}
606
607print "</body>";
608?>
609</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, $blockedlogmodulealreadydone=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
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
treeview li table
No Email.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
print $langs trans('Date')." left Ref 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 Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount
Definition receipt.php:489
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:130
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.