38 if (!defined(
'NOTOKENRENEWAL')) {
39 define(
'NOTOKENRENEWAL',
'1');
41 if (!defined(
'NOREQUIREMENU')) {
42 define(
'NOREQUIREMENU',
'1');
44 if (!defined(
'NOREQUIREHTML')) {
45 define(
'NOREQUIREHTML',
'1');
47 if (!defined(
'NOREQUIREAJAX')) {
48 define(
'NOREQUIREAJAX',
'1');
51 require
'../main.inc.php';
53include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
62$langs->loadLangs(array(
"main",
"bills",
"cashdesk",
"companies"));
68$action =
GETPOST(
'action',
'aZ09');
71if (!$user->hasRight(
'takepos',
'run')) {
88if (!$facid && (
string) $place !=
'' && !empty($_SESSION[
"takeposterminal"])) {
89 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture";
90 $sql .=
" WHERE ref = '(PROV-POS".$db->escape($_SESSION[
"takeposterminal"].
"-".$place).
")'";
91 $sql .=
" AND entity IN (".getEntity(
'invoice').
")";
93 $resql = $db->query($sql);
94 $obj = $db->fetch_object($resql);
107jQuery(document).ready(function () {
108 console.log('Call /blockedlog/ajax/block-add on output of receipt.php');
109 $.post('".DOL_URL_ROOT.
"/blockedlog/ajax/block-add.php'
113 , action: 'DOC_PREVIEW'
122$parameters = array();
123$hookmanager->initHooks(array(
'takeposfrontend'));
124$reshook = $hookmanager->executeHooks(
'TakeposReceipt', $parameters, $object);
125if (!empty($hookmanager->resPrint)) {
126 print $hookmanager->resPrint;
146@media only screen and (min-width: 1024px)
155<div style=
"font-size: 1.5em">
156<?php echo
'<b>'.$mysoc->name.
'</b>'; ?>
162$constFreeText =
'TAKEPOS_HEADER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
165 $substitutionarray = getCommonSubstitutionArray($langs);
173 print nl2br($newfreetext);
184 print str_replace(
")",
"", str_replace(
"-",
" ".$langs->trans(
'Place').
" ", str_replace(
"(PROV-POS", $langs->trans(
"Terminal").
" ",
$object->ref)));
194 $soc->fetch(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"]));
196 print
"<br>".$langs->trans(
"Customer").
': '.$soc->name;
200 print
"<br>".$langs->trans(
"DateOfPrinting").
': '.
dol_print_date(
dol_now(),
'dayhour',
'tzuserrel').
'<br>';
206<
table class=
"centpercent" style=
"border-top-style: double;">
209 <th
class=
"center"><?php print $langs->trans(
"Label"); ?></th>
210 <th
class=
"right"><?php print $langs->trans(
"Qty"); ?></th>
211 <th
class=
"right"><?php
if ($gift != 1) {
212 print $langs->trans(
"Price");
215 <th
class=
"right"><?php
if ($gift != 1) {
216 print $langs->trans(
"TotalHT");
219 <th
class=
"right"><?php
if ($gift != 1) {
220 print $langs->trans(
"TotalTTC");
226 if ($action ==
'without_details') {
229 print
'<td>' .
GETPOST(
'label',
'alphanohtml') .
'</td>';
230 print
'<td class="right">' . $qty .
'</td>';
233 print
'<td class="right">' .
price(
$object->total_ht, 1) .
'</td>';
235 print
'<td class="right">' .
price(
$object->total_ttc, 1) .
'</td>';
238 foreach (
$object->lines as $line) {
242 <?php
if (!empty($line->product_label)) {
243 echo $line->product_label;
248 <td
class=
"right"><?php echo $line->qty; ?></td>
249 <td
class=
"right"><?php
if ($gift != 1) {
254 <td
class=
"right"><?php
if ($gift != 1) {
255 echo
price($line->total_ht, 1);
259 <td
class=
"right"><?php
if ($gift != 1) {
260 echo
price($line->total_ttc, 1);
270<
table class=
"right centpercent">
272 <th
class=
"right"><?php
if ($gift != 1) {
273 echo $langs->trans(
"TotalHT");
275 <td
class=
"right"><?php
if ($gift != 1) {
280 $vat_groups = array();
281 foreach (
$object->lines as $line) {
282 if (!array_key_exists($line->tva_tx, $vat_groups)) {
283 $vat_groups[$line->tva_tx] = 0;
285 $vat_groups[$line->tva_tx] += $line->total_tva;
288 foreach ($vat_groups as $key => $val) {
291 <th align=
"right"><?php
if ($gift != 1) {
292 echo $langs->trans(
"VAT").
' '.
vatrate($key,
true);
294 <td align=
"right"><?php
if ($gift != 1) {
295 echo
price($val, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
302 <th
class=
"right"><?php
if ($gift != 1) {
303 echo $langs->trans(
"TotalVAT").
'</th><td class="right">'.
price(
$object->total_tva, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
310if (
price2num(
$object->total_localtax1,
'MU') || $mysoc->useLocalTax(1)) { ?>
312 <th
class=
"right"><?php
if ($gift != 1) {
313 echo
''.$langs->trans(
"TotalLT1").
'</th><td class="right">'.
price(
$object->total_localtax1, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
317<?php
if (
price2num(
$object->total_localtax2,
'MU') || $mysoc->useLocalTax(2)) { ?>
319 <th
class=
"right"><?php
if ($gift != 1) {
320 echo
''.$langs->trans(
"TotalLT2").
'</th><td class="right">'.
price(
$object->total_localtax2, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
325 <th
class=
"right"><?php
if ($gift != 1) {
326 echo
''.$langs->trans(
"TotalTTC").
'</th><td class="right">'.
price(
$object->total_ttc, 1,
'', 1, - 1, - 1,
$conf->currency).
"\n";
330if (isModEnabled(
'multicurrency') && !empty($_SESSION[
"takeposcustomercurrency"]) && $_SESSION[
"takeposcustomercurrency"] !=
"" &&
$conf->currency != $_SESSION[
"takeposcustomercurrency"]) {
332 include_once DOL_DOCUMENT_ROOT.
'/multicurrency/class/multicurrency.class.php';
334 $multicurrency->fetch(0, $_SESSION[
"takeposcustomercurrency"]);
335 echo
'<tr><th class="right">';
337 echo
''.$langs->trans(
"TotalTTC").
' '.$_SESSION[
"takeposcustomercurrency"].
'</th><td class="right">'.
price(
$object->total_ttc * $multicurrency->rate->rate, 1,
'', 1, - 1, - 1, $_SESSION[
"takeposcustomercurrency"]).
"\n";
346 echo
'<td class="right">';
347 echo $langs->transnoentitiesnoconv(
"PaymentTypeShortLIQ");
349 echo
'<td class="right">';
351 echo
price($amount_payment, 1,
'', 1, - 1, - 1,
$conf->currency);
355 $sql =
"SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
356 $sql .=
" f.multicurrency_code,";
357 $sql .=
" pf.amount as amount, pf.multicurrency_amount,";
359 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement_facture as pf, ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement as p";
360 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON p.fk_paiement = cp.id";
361 $sql .=
" WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
362 $sql .=
" ORDER BY p.datep";
364 $resql = $db->query($sql);
366 $num = $db->num_rows($resql);
370 $row = $db->fetch_object($resql);
373 echo
'<td class="right">';
374 echo $langs->transnoentitiesnoconv(
"PaymentTypeShort".$row->code);
376 echo
'<td class="right">';
377 $amount_payment = (isModEnabled(
'multicurrency') &&
$object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
379 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
380 $amount_payment += $row->pos_change;
381 $currency =
$conf->currency;
384 $currency = $row->multicurrency_code;
386 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $currency);
389 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
391 echo
'<td class="right">';
392 echo $langs->trans(
"Change");
394 echo
'<td class="right">';
395 echo
price($row->pos_change, 1,
'', 1, - 1, - 1, $currency);
406<div style=
"border-top-style: double;">
411$constFreeText =
'TAKEPOS_FOOTER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
414 $substitutionarray = getCommonSubstitutionArray($langs);
426<script
type=
"text/javascript">
429 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).
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.
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|dolcrypt):/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.