36 if (!defined(
'NOTOKENRENEWAL')) {
37 define(
'NOTOKENRENEWAL',
'1');
39 if (!defined(
'NOREQUIREMENU')) {
40 define(
'NOREQUIREMENU',
'1');
42 if (!defined(
'NOREQUIREHTML')) {
43 define(
'NOREQUIREHTML',
'1');
45 if (!defined(
'NOREQUIREAJAX')) {
46 define(
'NOREQUIREAJAX',
'1');
49 require
'../main.inc.php';
51include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
53$langs->loadLangs(array(
"main",
"bills",
"cashdesk",
"companies"));
59$action =
GETPOST(
'action',
'aZ09');
62if (!$user->hasRight(
'takepos',
'run')) {
74 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"facture where ref='(PROV-POS".$db->escape($_SESSION[
"takeposterminal"].
"-".$place).
")'";
75 $resql = $db->query($sql);
76 $obj = $db->fetch_object($resql);
89jQuery(document).ready(function () {
90 console.log('Call /blockedlog/ajax/block-add on output of receipt.php');
91 $.post('".DOL_URL_ROOT.
"/blockedlog/ajax/block-add.php'
95 , action: 'DOC_PREVIEW'
104$parameters = array();
105$hookmanager->initHooks(array(
'takeposfrontend'));
106$reshook = $hookmanager->executeHooks(
'TakeposReceipt', $parameters, $object);
107if (!empty($hookmanager->resPrint)) {
108 print $hookmanager->resPrint;
128@media only screen and (min-width: 1024px)
137<div style=
"font-size: 1.5em">
138<?php echo
'<b>'.$mysoc->name.
'</b>'; ?>
144$constFreeText =
'TAKEPOS_HEADER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
154 print nl2br($newfreetext);
165 print str_replace(
")",
"", str_replace(
"-",
" ".$langs->trans(
'Place').
" ", str_replace(
"(PROV-POS", $langs->trans(
"Terminal").
" ",
$object->ref)));
175 $soc->fetch(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"]));
177 print
"<br>".$langs->trans(
"Customer").
': '.$soc->name;
181 print
"<br>".$langs->trans(
"DateOfPrinting").
': '.
dol_print_date(
dol_now(),
'dayhour',
'tzuserrel').
'<br>';
187<
table class=
"centpercent" style=
"border-top-style: double;">
190 <th
class=
"center"><?php print $langs->trans(
"Label"); ?></th>
191 <th
class=
"right"><?php print $langs->trans(
"Qty"); ?></th>
192 <th
class=
"right"><?php
if ($gift != 1) {
193 print $langs->trans(
"Price");
196 <th
class=
"right"><?php
if ($gift != 1) {
197 print $langs->trans(
"TotalHT");
200 <th
class=
"right"><?php
if ($gift != 1) {
201 print $langs->trans(
"TotalTTC");
207 if ($action ==
'without_details') {
210 print
'<td>' .
GETPOST(
'label',
'alphanohtml') .
'</td>';
211 print
'<td class="right">' . $qty .
'</td>';
214 print
'<td class="right">' .
price(
$object->total_ht, 1) .
'</td>';
216 print
'<td class="right">' .
price(
$object->total_ttc, 1) .
'</td>';
219 foreach (
$object->lines as $line) {
223 <?php
if (!empty($line->product_label)) {
224 echo $line->product_label;
229 <td
class=
"right"><?php echo $line->qty; ?></td>
230 <td
class=
"right"><?php
if ($gift != 1) {
235 <td
class=
"right"><?php
if ($gift != 1) {
236 echo
price($line->total_ht, 1);
240 <td
class=
"right"><?php
if ($gift != 1) {
241 echo
price($line->total_ttc, 1);
251<
table class=
"right centpercent">
253 <th
class=
"right"><?php
if ($gift != 1) {
254 echo $langs->trans(
"TotalHT");
256 <td
class=
"right"><?php
if ($gift != 1) {
257 echo
price(
$object->total_ht, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
261 $vat_groups = array();
262 foreach (
$object->lines as $line) {
263 if (!array_key_exists($line->tva_tx, $vat_groups)) {
264 $vat_groups[$line->tva_tx] = 0;
266 $vat_groups[$line->tva_tx] += $line->total_tva;
269 foreach ($vat_groups as $key => $val) {
272 <th align=
"right"><?php
if ($gift != 1) {
273 echo $langs->trans(
"VAT").
' '.
vatrate($key, 1);
275 <td align=
"right"><?php
if ($gift != 1) {
276 echo
price($val, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
283 <th
class=
"right"><?php
if ($gift != 1) {
284 echo $langs->trans(
"TotalVAT").
'</th><td class="right">'.
price(
$object->total_tva, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
291if (
price2num(
$object->total_localtax1,
'MU') || $mysoc->useLocalTax(1)) { ?>
293 <th
class=
"right"><?php
if ($gift != 1) {
294 echo
''.$langs->trans(
"TotalLT1").
'</th><td class="right">'.
price(
$object->total_localtax1, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
298<?php
if (
price2num(
$object->total_localtax2,
'MU') || $mysoc->useLocalTax(2)) { ?>
300 <th
class=
"right"><?php
if ($gift != 1) {
301 echo
''.$langs->trans(
"TotalLT2").
'</th><td class="right">'.
price(
$object->total_localtax2, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
306 <th
class=
"right"><?php
if ($gift != 1) {
307 echo
''.$langs->trans(
"TotalTTC").
'</th><td class="right">'.
price(
$object->total_ttc, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
311if (isModEnabled(
'multicurrency') && !empty($_SESSION[
"takeposcustomercurrency"]) && $_SESSION[
"takeposcustomercurrency"] !=
"" && $conf->currency != $_SESSION[
"takeposcustomercurrency"]) {
313 include_once DOL_DOCUMENT_ROOT.
'/multicurrency/class/multicurrency.class.php';
315 $multicurrency->fetch(0, $_SESSION[
"takeposcustomercurrency"]);
316 echo
'<tr><th class="right">';
318 echo
''.$langs->trans(
"TotalTTC").
' '.$_SESSION[
"takeposcustomercurrency"].
'</th><td class="right">'.
price(
$object->total_ttc * $multicurrency->rate->rate, 1,
'', 1, - 1, - 1, $_SESSION[
"takeposcustomercurrency"]).
"\n";
327 echo
'<td class="right">';
328 echo $langs->transnoentitiesnoconv(
"PaymentTypeShortLIQ");
330 echo
'<td class="right">';
332 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $conf->currency);
336 $sql =
"SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
337 $sql .=
" f.multicurrency_code,";
338 $sql .=
" pf.amount as amount, pf.multicurrency_amount,";
340 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement_facture as pf, ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement as p";
341 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON p.fk_paiement = cp.id";
342 $sql .=
" WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
343 $sql .=
" ORDER BY p.datep";
345 $resql = $db->query($sql);
347 $num = $db->num_rows($resql);
351 $row = $db->fetch_object($resql);
354 echo
'<td class="right">';
355 echo $langs->transnoentitiesnoconv(
"PaymentTypeShort".$row->code);
357 echo
'<td class="right">';
358 $amount_payment = (isModEnabled(
'multicurrency') &&
$object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
360 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
361 $amount_payment += $row->pos_change;
362 $currency = $conf->currency;
365 $currency = $row->multicurrency_code;
367 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $currency);
370 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
372 echo
'<td class="right">';
373 echo $langs->trans(
"Change");
375 echo
'<td class="right">';
376 echo
price($row->pos_change, 1,
'', 1, - 1, - 1, $currency);
387<div style=
"border-top-style: double;">
392$constFreeText =
'TAKEPOS_FOOTER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
406<script
type=
"text/javascript">
409 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.
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.