37 if (!defined(
'NOTOKENRENEWAL')) {
38 define(
'NOTOKENRENEWAL',
'1');
40 if (!defined(
'NOREQUIREMENU')) {
41 define(
'NOREQUIREMENU',
'1');
43 if (!defined(
'NOREQUIREHTML')) {
44 define(
'NOREQUIREHTML',
'1');
46 if (!defined(
'NOREQUIREAJAX')) {
47 define(
'NOREQUIREAJAX',
'1');
50 require
'../main.inc.php';
52include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
61$langs->loadLangs(array(
"main",
"bills",
"cashdesk",
"companies"));
67$action =
GETPOST(
'action',
'aZ09');
70if (!$user->hasRight(
'takepos',
'run')) {
81if ((
string) $place !=
'') {
82 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture";
83 $sql .=
" WHERE ref = '(PROV-POS".$db->escape($_SESSION[
"takeposterminal"].
"-".$place).
")'";
84 $sql .=
" AND entity IN (".getEntity(
'invoice').
")";
86 $resql = $db->query($sql);
87 $obj = $db->fetch_object($resql);
100jQuery(document).ready(function () {
101 console.log('Call /blockedlog/ajax/block-add on output of receipt.php');
102 $.post('".DOL_URL_ROOT.
"/blockedlog/ajax/block-add.php'
106 , action: 'DOC_PREVIEW'
115$parameters = array();
116$hookmanager->initHooks(array(
'takeposfrontend'));
117$reshook = $hookmanager->executeHooks(
'TakeposReceipt', $parameters, $object);
118if (!empty($hookmanager->resPrint)) {
119 print $hookmanager->resPrint;
139@media only screen and (min-width: 1024px)
148<div style=
"font-size: 1.5em">
149<?php echo
'<b>'.$mysoc->name.
'</b>'; ?>
155$constFreeText =
'TAKEPOS_HEADER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
165 print nl2br($newfreetext);
176 print str_replace(
")",
"", str_replace(
"-",
" ".$langs->trans(
'Place').
" ", str_replace(
"(PROV-POS", $langs->trans(
"Terminal").
" ",
$object->ref)));
186 $soc->fetch(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"]));
188 print
"<br>".$langs->trans(
"Customer").
': '.$soc->name;
192 print
"<br>".$langs->trans(
"DateOfPrinting").
': '.
dol_print_date(
dol_now(),
'dayhour',
'tzuserrel').
'<br>';
198<
table class=
"centpercent" style=
"border-top-style: double;">
201 <th
class=
"center"><?php print $langs->trans(
"Label"); ?></th>
202 <th
class=
"right"><?php print $langs->trans(
"Qty"); ?></th>
203 <th
class=
"right"><?php
if ($gift != 1) {
204 print $langs->trans(
"Price");
207 <th
class=
"right"><?php
if ($gift != 1) {
208 print $langs->trans(
"TotalHT");
211 <th
class=
"right"><?php
if ($gift != 1) {
212 print $langs->trans(
"TotalTTC");
218 if ($action ==
'without_details') {
221 print
'<td>' .
GETPOST(
'label',
'alphanohtml') .
'</td>';
222 print
'<td class="right">' . $qty .
'</td>';
225 print
'<td class="right">' .
price(
$object->total_ht, 1) .
'</td>';
227 print
'<td class="right">' .
price(
$object->total_ttc, 1) .
'</td>';
230 foreach (
$object->lines as $line) {
234 <?php
if (!empty($line->product_label)) {
235 echo $line->product_label;
240 <td
class=
"right"><?php echo $line->qty; ?></td>
241 <td
class=
"right"><?php
if ($gift != 1) {
246 <td
class=
"right"><?php
if ($gift != 1) {
247 echo
price($line->total_ht, 1);
251 <td
class=
"right"><?php
if ($gift != 1) {
252 echo
price($line->total_ttc, 1);
262<
table class=
"right centpercent">
264 <th
class=
"right"><?php
if ($gift != 1) {
265 echo $langs->trans(
"TotalHT");
267 <td
class=
"right"><?php
if ($gift != 1) {
272 $vat_groups = array();
273 foreach (
$object->lines as $line) {
274 if (!array_key_exists($line->tva_tx, $vat_groups)) {
275 $vat_groups[$line->tva_tx] = 0;
277 $vat_groups[$line->tva_tx] += $line->total_tva;
280 foreach ($vat_groups as $key => $val) {
283 <th align=
"right"><?php
if ($gift != 1) {
284 echo $langs->trans(
"VAT").
' '.
vatrate($key, 1);
286 <td align=
"right"><?php
if ($gift != 1) {
287 echo
price($val, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
294 <th
class=
"right"><?php
if ($gift != 1) {
295 echo $langs->trans(
"TotalVAT").
'</th><td class="right">'.
price(
$object->total_tva, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
302if (
price2num(
$object->total_localtax1,
'MU') || $mysoc->useLocalTax(1)) { ?>
304 <th
class=
"right"><?php
if ($gift != 1) {
305 echo
''.$langs->trans(
"TotalLT1").
'</th><td class="right">'.
price(
$object->total_localtax1, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
309<?php
if (
price2num(
$object->total_localtax2,
'MU') || $mysoc->useLocalTax(2)) { ?>
311 <th
class=
"right"><?php
if ($gift != 1) {
312 echo
''.$langs->trans(
"TotalLT2").
'</th><td class="right">'.
price(
$object->total_localtax2, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
317 <th
class=
"right"><?php
if ($gift != 1) {
318 echo
''.$langs->trans(
"TotalTTC").
'</th><td class="right">'.
price(
$object->total_ttc, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
322if (isModEnabled(
'multicurrency') && !empty($_SESSION[
"takeposcustomercurrency"]) && $_SESSION[
"takeposcustomercurrency"] !=
"" &&
$conf->currency != $_SESSION[
"takeposcustomercurrency"]) {
324 include_once DOL_DOCUMENT_ROOT.
'/multicurrency/class/multicurrency.class.php';
326 $multicurrency->fetch(0, $_SESSION[
"takeposcustomercurrency"]);
327 echo
'<tr><th class="right">';
329 echo
''.$langs->trans(
"TotalTTC").
' '.$_SESSION[
"takeposcustomercurrency"].
'</th><td class="right">'.
price(
$object->total_ttc * $multicurrency->rate->rate, 1,
'', 1, - 1, - 1, $_SESSION[
"takeposcustomercurrency"]).
"\n";
338 echo
'<td class="right">';
339 echo $langs->transnoentitiesnoconv(
"PaymentTypeShortLIQ");
341 echo
'<td class="right">';
343 echo
price($amount_payment, 1,
'', 1, - 1, - 1,
$conf->currency);
347 $sql =
"SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
348 $sql .=
" f.multicurrency_code,";
349 $sql .=
" pf.amount as amount, pf.multicurrency_amount,";
351 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement_facture as pf, ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement as p";
352 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON p.fk_paiement = cp.id";
353 $sql .=
" WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
354 $sql .=
" ORDER BY p.datep";
356 $resql = $db->query($sql);
358 $num = $db->num_rows($resql);
362 $row = $db->fetch_object($resql);
365 echo
'<td class="right">';
366 echo $langs->transnoentitiesnoconv(
"PaymentTypeShort".$row->code);
368 echo
'<td class="right">';
369 $amount_payment = (isModEnabled(
'multicurrency') &&
$object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
371 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
372 $amount_payment += $row->pos_change;
373 $currency =
$conf->currency;
376 $currency = $row->multicurrency_code;
378 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $currency);
381 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
383 echo
'<td class="right">';
384 echo $langs->trans(
"Change");
386 echo
'<td class="right">';
387 echo
price($row->pos_change, 1,
'', 1, - 1, - 1, $currency);
398<div style=
"border-top-style: double;">
403$constFreeText =
'TAKEPOS_FOOTER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
417<script
type=
"text/javascript">
420 print
'window.print();';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage invoices.
const STATUS_DRAFT
Draft status.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
dol_now($mode='auto')
Return date for now.
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.