43 if (!defined(
'NOTOKENRENEWAL')) {
44 define(
'NOTOKENRENEWAL',
'1');
46 if (!defined(
'NOREQUIREMENU')) {
47 define(
'NOREQUIREMENU',
'1');
49 if (!defined(
'NOREQUIREHTML')) {
50 define(
'NOREQUIREHTML',
'1');
52 if (!defined(
'NOREQUIREAJAX')) {
53 define(
'NOREQUIREAJAX',
'1');
56 require
'../main.inc.php';
66include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
67include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
69$langs->loadLangs(array(
"main",
"bills",
"cashdesk",
"companies"));
75$action =
GETPOST(
'action',
'aZ09');
78if (!$user->hasRight(
'takepos',
'run')) {
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').
")";
101 $resql =
$db->query($sql);
102 $obj =
$db->fetch_object($resql);
104 $facid = $obj->rowid;
108if ($facid > 0 && !
GETPOST(
'specimen')) {
111 $object->initAsSpecimen(
'takepos');
121if (!
GETPOST(
'specimen') && empty($nojs)) {
124 console.log('Call /blockedlog/ajax/block-add from Ajax call on receipt.php.');
125 $.post('".DOL_URL_ROOT.
"/blockedlog/ajax/block-add.php',
129 action: 'DOC_PREVIEW',
131 token: '".currentToken().
"'
133 ).fail(function(jqXHR, textStatus, errorThrown) {
134 console.error('Error AJAX :', textStatus, errorThrown);
135 console.error('Answer server :', jqXHR.responseText);
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;
149 $parameters = array();
150 $hookmanager->initHooks(array(
'takeposfrontend'));
151 $reshook = $hookmanager->executeHooks(
'TakeposReceipt', $parameters, $object);
152 if (!empty($hookmanager->resPrint)) {
153 print $hookmanager->resPrint;
174@media only screen and (min-width: 1024px)
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 -->
187echo
'<b>'.dolPrintHTML(
$mysoc->name).
'</b>';
191 print
'!!! SPECIMEN !!!';
198$constFreeText =
'TAKEPOS_HEADER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
201 $substitutionarray = getCommonSubstitutionArray($langs);
209 print
'<p class="left">';
210 print nl2br($newfreetext);
215 $canprintifnotvalidate =
true;
217 $canprintifnotvalidate =
false;
221 if (!$canprintifnotvalidate && empty($facid) && !
GETPOST(
'specimen')) {
222 print
"Error: Printing ticket is not allowed when invoice is not validated/paid.";
234 print $langs->trans(
"InvoiceRef").
" ";
239 if (empty($facid) ||
GETPOST(
'specimen')) {
249print $langs->trans(
"Terminal").
' '.(
GETPOST(
'specimen') ?
'99' : (
$object->pos_source ?
$object->pos_source :
'Backoffice'));
256 $soc->fetch(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"]));
258 print
"<br>".$langs->trans(
"Customer").
': '.$soc->name;
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);
278 $resql =
$db->query($sql);
280 $obj =
$db->fetch_object($resql);
282 $unalterablelogid = $obj->signature;
287 print $langs->trans(
"SignatureID").
': '.
dol_trunc(strtoupper($unalterablelogid), 10);
292if (
$object->status == $object::STATUS_CLOSED) {
294 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture SET pos_print_counter = pos_print_counter + 1";
295 $sql .=
" WHERE rowid = ".((int)
$object->id);
298 $object->pos_print_counter += 1;
302$isADuplicata = (
$object->pos_print_counter >= 2);
304if (
$object->status != $object::STATUS_CLOSED) {
306 print
'<br><b>*** '.strtoupper($langs->trans(
"TemporaryReceipt")).
' ***</b>';
309 print
'<br><b>*** '.$langs->transnoentities(
"DUPLICATA");
311 print
' (no '.($object->pos_print_counter - 1).
')';
320<
table class=
"centpercent" style=
"border-top-style: double;">
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");
329 <th
class=
"right"><?php
if ($gift != 1) {
330 print $langs->trans(
"TotalHT");
333 <th
class=
"right"><?php
if ($gift != 1) {
334 print $langs->trans(
"TotalTTC");
340 if ($action ==
'without_details') {
343 print
'<td>' .
GETPOST(
'label',
'alphanohtml') .
'</td>';
344 print
'<td class="right">' . $qty .
'</td>';
347 print
'<td class="right">' .
price(
$object->total_ht, 1) .
'</td>';
349 print
'<td class="right">' .
price(
$object->total_ttc, 1) .
'</td>';
352 foreach (
$object->lines as $line) {
356 <?php
if (!empty($line->product_label)) {
357 echo $line->product_ref.
" - ";
358 echo $line->product_label;
363 <td
class=
"right"><?php echo $line->qty; ?></td>
364 <td
class=
"right"><?php
if ($gift != 1) {
369 <td
class=
"right"><?php
if ($gift != 1) {
370 echo
price($line->total_ht, 1);
374 <td
class=
"right"><?php
if ($gift != 1) {
375 echo
price($line->total_ttc, 1);
385<
table class=
"right centpercent">
387 <th
class=
"right"><?php
if ($gift != 1) {
388 echo $langs->trans(
"TotalHT");
390 <td
class=
"right"><?php
if ($gift != 1) {
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;
401 $vat_groups[(
string) $line->tva_tx] += $line->total_tva;
405 foreach ($vat_groups as $key => $val) {
408 <th align=
"right"><?php
if ($gift != 1) {
409 echo $langs->trans(
"VAT").
' '.
vatrate($key,
true);
411 <td align=
"right"><?php
if ($gift != 1) {
412 echo
price($val, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
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";
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";
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";
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";
452if (
isModEnabled(
'multicurrency') && !empty($_SESSION[
"takeposcustomercurrency"]) && $_SESSION[
"takeposcustomercurrency"] !=
"" &&
$conf->currency != $_SESSION[
"takeposcustomercurrency"]) {
454 include_once DOL_DOCUMENT_ROOT.
'/multicurrency/class/multicurrency.class.php';
456 $multicurrency->fetch(0, $_SESSION[
"takeposcustomercurrency"]);
457 echo
'<tr><th class="right">';
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";
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").
' ---';
478 echo
'<td class="right">';
479 echo $langs->transnoentitiesnoconv(
"PaymentTypeShortLIQ");
481 echo
'<td class="right">';
483 echo
price($amount_payment, 1,
'', 1, - 1, - 1,
$conf->currency);
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,";
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";
496 $resql =
$db->query($sql);
498 $num =
$db->num_rows($resql);
502 $row =
$db->fetch_object($resql);
505 echo
'<td class="right">';
506 echo $langs->transnoentitiesnoconv(
"PaymentTypeShort".$row->code);
508 echo
'<td class="right">';
509 $amount_payment = (
isModEnabled(
'multicurrency') &&
$object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->
amount;
511 if ((!
isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
512 $amount_payment += $row->pos_change;
513 $currency =
$conf->currency;
516 $currency = $row->multicurrency_code;
518 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $currency);
521 if ((!
isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
523 echo
'<td class="right">';
524 echo $langs->trans(
"Change");
526 echo
'<td class="right">';
527 echo
price($row->pos_change, 1,
'', 1, - 1, - 1, $currency);
543$constFreeText =
'TAKEPOS_FOOTER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
546 $substitutionarray = getCommonSubstitutionArray($langs);
558 $langs->load(
"blockedlog");
559 print
'<center class="small"><i>';
563 if (
$mysoc->country_code ==
'FR') {
566 if (preg_match(
'/\-/', DOL_VERSION)) {
568 $infotoshow = $langs->trans(
"LNECandidatePOSSystem");
570 $infotoshow = $langs->trans(
"LNECertifiedPOSSystem");
574 print $infotoshow.
"<br>";
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;
583 print
'ERROR: SIREN/SIRET not defined. Ticket not valid !!!';
586 $labelidprof = $langs->trans(
"VATIntra");
587 print
' - '.$labelidprof.
': '.
$mysoc->tva_intra;
589 print
"</i></center>\n";
592print
"<br>\n<!-- Need a margin to avoid that the print of the ticket is cut by the browser -->";
594if (!
GETPOST(
'forcenoautoopen') && !
GETPOST(
'specimen') && empty($nojs)) {
596 <script
type=
"text/javascript">
599 print
'console.log("ref = '.$object->ref.
' - pos_print_counter = '.
$object->pos_print_counter.
'");';
600 print
'window.print();';
if(! $sortfield) if(! $sortorder) $object
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 to manage third parties objects (customers, suppliers, prospects...)
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
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]]]',...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.