dolibarr 25.0.0-alpha
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);
108
109if ($facid > 0 && !GETPOST('specimen')) {
110 $result = $object->fetch($facid);
111 // Only an invoice of the POS, in an entity of the user, can be printed from the POS
112 if ($result <= 0 || $object->module_source != 'takepos' || !in_array($object->entity, explode(',', getEntity('invoice')))) {
114 }
115} else {
116 $object->initAsSpecimen('takepos');
117}
118
119print '<body>';
120
121// Record entry in blocked logs each time we print a receipt
122//
123// This will also increase the counter of printings of the receipt
124// DOL_DOCUMENT_ROOT.'/blockedlog/ajax/block-add.php?id='.$object->id.'&element='.$object->element.'&action=DOC_PREVIEW&token='.newToken();
125
126if (!GETPOST('specimen') && empty($nojs)) {
127 print "
128 <script>
129 console.log('Call /blockedlog/ajax/block-add from Ajax call on receipt.php.');
130 $.post('".DOL_URL_ROOT."/blockedlog/ajax/block-add.php',
131 {
132 id: ".((int) $object->id).",
133 element: '".dol_escape_js($object->element)."',
134 action: 'DOC_PREVIEW',
135 lang: '".dol_escape_js($langs->defaultlang)."',
136 token: '".currentToken()."'
137 }
138 ).fail(function(jqXHR, textStatus, errorThrown) {
139 console.error('Error AJAX :', textStatus, errorThrown);
140 console.error('Answer server :', jqXHR.responseText);
141 });
142 </script>";
143}
144
145// Call to external receipt modules factory if it exists and if we can (not allowed in some cases)
147 // If LNE version, we force parameters.
148 $conf->global->TAKEPOS_SHOW_HT_RECEIPT = 1;
149 $conf->global->TAKEPOS_TICKET_VAT_GROUPPED = 1;
150 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
151 $conf->global->TAKEPOS_GIFT_RECEIPT = 0;
152 $conf->global->TAKEPOS_PRINT_WITHOUT_DETAILS = 0;
153} else {
154 $parameters = array();
155 $hookmanager->initHooks(array('takeposfrontend'));
156 $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
157 if (!empty($hookmanager->resPrint)) {
158 print $hookmanager->resPrint;
159 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
160 }
161}
162
163// 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.
164?>
165
166<style>
167.right {
168 text-align: right;
169}
170.center {
171 text-align: center;
172}
173.left {
174 text-align: left;
175}
176.centpercent {
177 width: 100%;
178}
179@media only screen and (min-width: 1024px)
180{
181 body {
182 margin-left: 50px;
183 margin-right: 50px;
184 }
185}
186</style>
187
188<center>
189<div style="font-size: 1.3em">
190<br><!-- Need a margin to avoid that the print of the ticket is cut by the browser -->
191<?php
192echo '<b>'.dolPrintHTML($mysoc->name).'</b>';
193
194if (GETPOST('specimen')) {
195 print '<br>';
196 print '!!! SPECIMEN !!!';
197}
198?>
199</div>
200</center>
201<br>
202<?php
203$constFreeText = 'TAKEPOS_HEADER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
204if (getDolGlobalString('TAKEPOS_HEADER') || getDolGlobalString($constFreeText)) {
205 $newfreetext = '';
206 $substitutionarray = getCommonSubstitutionArray($langs);
207 complete_substitutions_array($substitutionarray, $langs, $object);
208 if (getDolGlobalString('TAKEPOS_HEADER')) {
209 $newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_HEADER'), $substitutionarray);
210 }
211 if (getDolGlobalString($constFreeText)) {
212 $newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
213 }
214 print '<p class="left">';
215 print nl2br($newfreetext);
216 print '<p>';
217}
218
219if ($object->status == Facture::STATUS_DRAFT) {
220 $canprintifnotvalidate = true;
221 if (isALNERunningVersion()) {
222 $canprintifnotvalidate = false;
223 //$orderprinterallowed = false;
224 }
225
226 if (!$canprintifnotvalidate && empty($facid) && !GETPOST('specimen')) {
227 print "Error: Printing ticket is not allowed when invoice is not validated/paid.";
228 exit;
229 }
230}
231?>
232
233<p class="right">
234<?php
235// Invoice Ref
236if (getDolGlobalString('TAKEPOS_RECEIPT_NAME')) {
237 print getDolGlobalString('TAKEPOS_RECEIPT_NAME') . " ";
238} else {
239 print $langs->trans("InvoiceRef")." ";
240}
241if ($object->status == Facture::STATUS_DRAFT || empty($facid) || GETPOST('specimen')) {
242 // Printing ticket is not allowed if invoice not yet validate.
243 // Reaching this code may happen for specimen or if a feature to validate invoice and print it before paying is implemented.
244 if (empty($facid) || GETPOST('specimen')) {
245 print '99999';
246 } else {
247 print dolPrintHTML($object->ref);
248 }
249} else {
250 print dolPrintHTML($object->ref);
251}
252// POS terminal
253print "<br>\n";
254print $langs->trans("Terminal").' '.(GETPOST('specimen') ? '99' : ($object->pos_source ? $object->pos_source : 'Backoffice'));
255if (getDolGlobalString('TAKEPOS_SHOW_CUSTOMER')) {
256 if ($object->socid != getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"])) {
257 $soc = new Societe($db);
258 if ($object->socid > 0) {
259 $soc->fetch($object->socid);
260 } else {
261 $soc->fetch(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]));
262 }
263 print "<br>".$langs->trans("Customer").': '.$soc->name;
264 }
265}
266// Date
267print "<br>\n";
268print $langs->trans('Date').": ".dol_print_date($object->date ? $object->date : dol_now(), 'day');
269// Date of printing
270if (isALNERunningVersion() || !getDolGlobalString('TAKEPOS_HIDE_DATE_OF_PRINTING')) {
271 print "<br>\n";
272 print $langs->trans("DateOfPrinting").': '.dol_print_date(dol_now(), 'dayhour', 'tzuserrel');
273}
274// Transaction ID
275if (isALNERunningVersion() && isModEnabled('blockedlog')) {
276 if ($object->status > $object::STATUS_DRAFT) {
277 $unalterablelogid = 'UNDEFINED';
278 $sql = "SELECT signature FROM ".MAIN_DB_PREFIX."blockedlog";
279 $sql .= " WHERE action = 'BILL_VALIDATE' AND element = 'facture' AND ref_object = '".$db->escape($object->ref)."'";
280 $sql .= $db->order('rowid', 'DESC');
281 $sql .= $db->plimit(1);
282
283 $resql = $db->query($sql);
284 if ($resql) {
285 $obj = $db->fetch_object($resql);
286 if ($obj) {
287 $unalterablelogid = $obj->signature;
288 }
289 }
290
291 print "<br>\n";
292 print $langs->trans("SignatureID").': '.dol_trunc(strtoupper($unalterablelogid), 10);
293 }
294}
295
296// $object->pos_print_counter is current value. We increase it here.
297if ($object->status == $object::STATUS_CLOSED) {
298 // If no more a temporary receipt, we increase counter by 1
299 $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET pos_print_counter = pos_print_counter + 1";
300 $sql .= " WHERE rowid = ".((int) $object->id);
301 $db->query($sql);
302
303 $object->pos_print_counter += 1;
304}
305
306// Show if it is a duplicata
307$isADuplicata = ($object->pos_print_counter >= 2);
308
309if ($object->status != $object::STATUS_CLOSED) {
310 // Not yet paid completely
311 print '<br><b>*** '.strtoupper($langs->trans("TemporaryReceipt")).' ***</b>';
312} else {
313 if ($isADuplicata) {
314 print '<br><b>*** '.$langs->transnoentities("DUPLICATA");
315 if (getDolGlobalString('TAKEPOS_SHOW_PRINT_COUNTER_ON_RECEIPT')) {
316 print ' (no '.($object->pos_print_counter - 1).')';
317 }
318 print ' ***</b>';
319 }
320}
321?>
322</p>
323<br>
324
325<table class="centpercent" style="border-top-style: double;">
326 <thead>
327 <tr>
328 <th class="left"><?php print $langs->trans("Ref").'/'.$langs->trans("Label"); ?></th>
329 <th class="right"><?php print $langs->trans("Qty"); ?></th>
330 <th class="right"><?php if ($gift != 1) {
331 print $langs->trans("Price");
332 } ?></th>
333 <?php if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { ?>
334 <th class="right"><?php if ($gift != 1) {
335 print $langs->trans("TotalHT");
336 } ?></th>
337 <?php } ?>
338 <th class="right"><?php if ($gift != 1) {
339 print $langs->trans("TotalTTC");
340 } ?></th>
341 </tr>
342 </thead>
343 <tbody>
344 <?php
345 if ($action == 'without_details') {
346 $qty = GETPOSTINT('qty') > 0 ? GETPOSTINT('qty') : 1;
347 print '<tr>';
348 print '<td>' . GETPOST('label', 'alphanohtml') . '</td>';
349 print '<td class="right">' . $qty . '</td>';
350 print '<td class="right">' . price(price2num($object->total_ttc / $qty, 'MU'), 1) . '</td>';
351 if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) {
352 print '<td class="right">' . price($object->total_ht, 1) . '</td>';
353 }
354 print '<td class="right">' . price($object->total_ttc, 1) . '</td>';
355 print '</tr>';
356 } else {
357 foreach ($object->lines as $line) {
358 ?>
359 <tr>
360 <td>
361 <?php if (!empty($line->product_label)) {
362 echo $line->product_ref." - ";
363 echo $line->product_label;
364 } else {
365 echo $line->desc;
366 } ?>
367 </td>
368 <td class="right"><?php echo $line->qty; ?></td>
369 <td class="right"><?php if ($gift != 1) {
370 echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1);
371 } ?></td>
372 <?php
373 if (getDolGlobalString('TAKEPOS_SHOW_HT_RECEIPT')) { ?>
374 <td class="right"><?php if ($gift != 1) {
375 echo price($line->total_ht, 1);
376 } ?></td>
377 <?php
378 } ?>
379 <td class="right"><?php if ($gift != 1) {
380 echo price($line->total_ttc, 1);
381 } ?></td>
382 </tr>
383 <?php
384 }
385 }
386 ?>
387 </tbody>
388</table>
389<br>
390<table class="right centpercent">
391<tr>
392 <th class="right"><?php if ($gift != 1) {
393 echo $langs->trans("TotalHT");
394 } ?></th>
395 <td class="right"><?php if ($gift != 1) {
396 echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";
397 } ?></td>
398</tr>
399<?php
400if (getDolGlobalString('TAKEPOS_TICKET_VAT_GROUPPED')) {
401 $vat_groups = array();
402 foreach ($object->lines as $line) {
403 if (!array_key_exists((string) $line->tva_tx, $vat_groups)) {
404 $vat_groups[(string) $line->tva_tx] = 0;
405 }
406 $vat_groups[(string) $line->tva_tx] += $line->total_tva;
407 }
408
409 // Loop on each VAT group
410 foreach ($vat_groups as $key => $val) {
411 ?>
412 <tr>
413 <th align="right"><?php if ($gift != 1) {
414 echo $langs->trans("VAT").' '.vatrate($key, true);
415 } ?></th>
416 <td align="right"><?php if ($gift != 1) {
417 echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n";
418 } ?></td>
419 </tr>
420 <?php
421 }
422} else { ?>
423<tr>
424 <th class="right"><?php if ($gift != 1) {
425 echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";
426 } ?></th>
427</tr>
428<?php }
429
430// Now show local taxes if company uses them
431
432// $mysoc->useLocalTax(N) is a country-wide flag (true as soon as the country has a
433// matching c_tva row with a localtaxN_type), so on its own it always prints the line
434// for Spanish companies even when the company is "No sujeto a RE / IRPF". Mirror the
435// pattern used by compta/facture/card.php, card-rec.php and prelevement.php and gate
436// the country check on $mysoc->localtaxN_assuj == "1".
437if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || price2num($object->total_localtax1, 'MU')) { ?>
438<tr>
439 <th class="right"><?php if ($gift != 1) {
440 echo ''.$langs->trans("TotalLT1").'</th><td class="right">'.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency)."\n";
441 } ?></th>
442</tr>
443<?php } ?>
444<?php if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || price2num($object->total_localtax2, 'MU')) { ?>
445<tr>
446 <th class="right"><?php if ($gift != 1) {
447 echo ''.$langs->trans("TotalLT2").'</th><td class="right">'.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency)."\n";
448 } ?></th>
449</tr>
450<?php } ?>
451<tr>
452 <th class="right"><?php if ($gift != 1) {
453 echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";
454 } ?></th>
455</tr>
456<?php
457if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) {
458 //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency
459 include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
460 $multicurrency = new MultiCurrency($db);
461 $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]);
462 echo '<tr><th class="right">';
463 if ($gift != 1) {
464 echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].'</th><td class="right">'.price($object->total_ttc * $multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n";
465 }
466 echo '</th></tr>';
467}
468
469// We force the feature when LNE is on, whatever is setup. When a payment is done, we always want to see it on receipt.
471 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
472 if ($object->status == $object::STATUS_CLOSED) {
473 print '<tr><th class="right"></th><td>';
474 print '--- '.$langs->trans("Paid").' ---';
475 print '</td></tr>';
476 }
477}
478
479if (getDolGlobalString('TAKEPOS_PRINT_PAYMENT_METHOD')) {
480 if (empty($facid)) {
481 // Case of a specimen, we output demo data
482 echo '<tr>';
483 echo '<td class="right">';
484 echo $langs->transnoentitiesnoconv("PaymentTypeShortLIQ");
485 echo '</td>';
486 echo '<td class="right">';
487 $amount_payment = 0;
488 echo price($amount_payment, 1, '', 1, - 1, - 1, $conf->currency);
489 echo '</td>';
490 echo '</tr>';
491 } else {
492 $sql = "SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
493 $sql .= " f.multicurrency_code,";
494 $sql .= " pf.amount as amount, pf.multicurrency_amount,";
495 $sql .= " cp.code";
496 $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p";
497 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
498 $sql .= " WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
499 $sql .= " ORDER BY p.datep";
500
501 $resql = $db->query($sql);
502 if ($resql) {
503 $num = $db->num_rows($resql);
504
505 $i = 0;
506 while ($i < $num) {
507 $row = $db->fetch_object($resql);
508
509 echo '<tr>';
510 echo '<td class="right">';
511 echo $langs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
512 echo '</td>';
513 echo '<td class="right">';
514 $amount_payment = (isModEnabled('multicurrency') && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
515 //print "xx ".$row->multicurrency_amount." - ".$row->amount." - ".$amount_payment." - ".$object->multicurrency_tx;
516 if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) {
517 $amount_payment += $row->pos_change; // Show amount with excess received if it's cash payment
518 $currency = $conf->currency;
519 } else {
520 // We do not show change if payment into a different currency because not yet supported
521 $currency = $row->multicurrency_code;
522 }
523 echo price($amount_payment, 1, '', 1, - 1, - 1, $currency);
524 echo '</td>';
525 echo '</tr>';
526 if ((!isModEnabled('multicurrency') || $object->multicurrency_tx == 1) && $row->code == "LIQ" && $row->pos_change > 0) {
527 echo '<tr>';
528 echo '<td class="right">';
529 echo $langs->trans("Change"); // ChangeBack ?
530 echo '</td>';
531 echo '<td class="right">';
532 echo price($row->pos_change, 1, '', 1, - 1, - 1, $currency);
533 echo '</td>';
534 echo '</tr>';
535 }
536 $i++;
537 }
538 }
539 }
540}
541?>
542</table>
543
544<br>
545<br>
546<br>
547<?php
548$constFreeText = 'TAKEPOS_FOOTER'.(empty($_SESSION['takeposterminal']) ? '0' : $_SESSION['takeposterminal']);
549if (getDolGlobalString('TAKEPOS_FOOTER') || getDolGlobalString($constFreeText)) {
550 $newfreetext = '';
551 $substitutionarray = getCommonSubstitutionArray($langs);
552 complete_substitutions_array($substitutionarray, $langs, $object);
553 if (getDolGlobalString($constFreeText)) {
554 $newfreetext .= make_substitutions(getDolGlobalString($constFreeText), $substitutionarray);
555 }
556 if (getDolGlobalString('TAKEPOS_FOOTER')) {
557 $newfreetext .= make_substitutions(getDolGlobalString('TAKEPOS_FOOTER'), $substitutionarray);
558 }
559 print $newfreetext;
560}
561
563 $langs->load("blockedlog");
564 print '<center class="small"><i>';
565
566 // Special additional message for FR only
567 $infotoshow = '';
568 if ($mysoc->country_code == 'FR') {
569 $islne = isALNEQualifiedVersion(1, 1);
570 if ($islne) {
571 if (preg_match('/\-/', DOL_VERSION)) {
572 // This is an alpha or beta version
573 $infotoshow = $langs->trans("LNECandidatePOSSystem");
574 } else {
575 $infotoshow = $langs->trans("LNECertifiedPOSSystem");
576 }
577 }
578 }
579 print $infotoshow."<br>";
580
581 if ($mysoc->idprof2) {
582 $labelidprof = $langs->transcountry("ProfId2Short", $mysoc->country_code);
583 print $labelidprof.': '.$mysoc->idprof2;
584 } elseif ($mysoc->idprof1) {
585 $labelidprof = $langs->transcountry("ProfId1Short", $mysoc->country_code);
586 print $labelidprof.': '.$mysoc->idprof1;
587 } else {
588 print 'ERROR: SIREN/SIRET not defined. Ticket not valid !!!';
589 }
590 if ($mysoc->tva_intra) {
591 $labelidprof = $langs->trans("VATIntra");
592 print ' - '.$labelidprof.': '.$mysoc->tva_intra;
593 }
594 print "</i></center>\n";
595}
596
597print "<br>\n<!-- Need a margin to avoid that the print of the ticket is cut by the browser -->";
598
599if (!GETPOST('forcenoautoopen') && !GETPOST('specimen') && empty($nojs)) {
600 ?>
601 <script type="text/javascript">
602 <?php
603 if ($facid) {
604 print 'console.log("ref = '.$object->ref.' - pos_print_counter = '.$object->pos_print_counter.'");';
605 print 'window.print();';
606 } //Avoid print when is specimen
607 ?>
608 </script>
609 <?php
610}
611
612print "</body>";
613?>
614</html>
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition propal.php:280
isALNEQualifiedVersion($ignoredev=0, $ignoremodule=0)
Return if the version is a candidate version to get the LNE certification and if the prerequisites ar...
isALNERunningVersion($blockedlogusagealreadychecked=0, $blockedlogmoduleonalreadychecked=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:
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.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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...
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
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:494
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.