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);
86$hookmanager->initHooks(array(
'takeposfrontend'));
87$reshook = $hookmanager->executeHooks(
'TakeposReceipt', $parameters, $object);
88if (!empty($hookmanager->resPrint)) {
89 print $hookmanager->resPrint;
108<div style=
"font-size: 1.5em">
109<?php echo
'<b>'.$mysoc->name.
'</b>'; ?>
115$constFreeText =
'TAKEPOS_HEADER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
125 print nl2br($newfreetext);
136 print str_replace(
")",
"", str_replace(
"-",
" ".$langs->trans(
'Place').
" ", str_replace(
"(PROV-POS", $langs->trans(
"Terminal").
" ",
$object->ref)));
146 $soc->fetch(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$_SESSION[
"takeposterminal"]));
148 print
"<br>".$langs->trans(
"Customer").
': '.$soc->name;
152 print
"<br>".$langs->trans(
"DateOfPrinting").
': '.
dol_print_date(
dol_now(),
'dayhour',
'tzuserrel').
'<br>';
158<
table width=
"100%" style=
"border-top-style: double;">
161 <th
class=
"center"><?php print $langs->trans(
"Label"); ?></th>
162 <th
class=
"right"><?php print $langs->trans(
"Qty"); ?></th>
163 <th
class=
"right"><?php
if ($gift != 1) {
164 print $langs->trans(
"Price");
167 <th
class=
"right"><?php
if ($gift != 1) {
168 print $langs->trans(
"TotalHT");
171 <th
class=
"right"><?php
if ($gift != 1) {
172 print $langs->trans(
"TotalTTC");
178 if ($action ==
'without_details') {
181 print
'<td>' .
GETPOST(
'label',
'alphanohtml') .
'</td>';
182 print
'<td class="right">' . $qty .
'</td>';
185 print
'<td class="right">' .
price(
$object->total_ht, 1) .
'</td>';
187 print
'<td class="right">' .
price(
$object->total_ttc, 1) .
'</td>';
190 foreach (
$object->lines as $line) {
194 <?php
if (!empty($line->product_label)) {
195 echo $line->product_label;
197 echo $line->description;
200 <td
class=
"right"><?php echo $line->qty; ?></td>
201 <td
class=
"right"><?php
if ($gift != 1) {
206 <td
class=
"right"><?php
if ($gift != 1) {
207 echo
price($line->total_ht, 1);
211 <td
class=
"right"><?php
if ($gift != 1) {
212 echo
price($line->total_ttc, 1);
224 <th
class=
"right"><?php
if ($gift != 1) {
225 echo $langs->trans(
"TotalHT");
227 <td
class=
"right"><?php
if ($gift != 1) {
228 echo
price(
$object->total_ht, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
232 $vat_groups = array();
233 foreach (
$object->lines as $line) {
234 if (!array_key_exists($line->tva_tx, $vat_groups)) {
235 $vat_groups[$line->tva_tx] = 0;
237 $vat_groups[$line->tva_tx] += $line->total_tva;
240 foreach ($vat_groups as $key => $val) {
243 <th align=
"right"><?php
if ($gift != 1) {
244 echo $langs->trans(
"VAT").
' '.
vatrate($key, 1);
246 <td align=
"right"><?php
if ($gift != 1) {
247 echo
price($val, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
254 <th
class=
"right"><?php
if ($gift != 1) {
255 echo $langs->trans(
"TotalVAT").
'</th><td class="right">'.
price(
$object->total_tva, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
262if (
price2num(
$object->total_localtax1,
'MU') || $mysoc->useLocalTax(1)) { ?>
264 <th
class=
"right"><?php
if ($gift != 1) {
265 echo
''.$langs->trans(
"TotalLT1").
'</th><td class="right">'.
price(
$object->total_localtax1, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
269<?php
if (
price2num(
$object->total_localtax2,
'MU') || $mysoc->useLocalTax(2)) { ?>
271 <th
class=
"right"><?php
if ($gift != 1) {
272 echo
''.$langs->trans(
"TotalLT2").
'</th><td class="right">'.
price(
$object->total_localtax2, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
277 <th
class=
"right"><?php
if ($gift != 1) {
278 echo
''.$langs->trans(
"TotalTTC").
'</th><td class="right">'.
price(
$object->total_ttc, 1,
'', 1, - 1, - 1, $conf->currency).
"\n";
282if (isModEnabled(
'multicurrency') && !empty($_SESSION[
"takeposcustomercurrency"]) && $_SESSION[
"takeposcustomercurrency"] !=
"" && $conf->currency != $_SESSION[
"takeposcustomercurrency"]) {
284 include_once DOL_DOCUMENT_ROOT.
'/multicurrency/class/multicurrency.class.php';
286 $multicurrency->fetch(0, $_SESSION[
"takeposcustomercurrency"]);
287 echo
'<tr><th class="right">';
289 echo
''.$langs->trans(
"TotalTTC").
' '.$_SESSION[
"takeposcustomercurrency"].
'</th><td class="right">'.
price(
$object->total_ttc * $multicurrency->rate->rate, 1,
'', 1, - 1, - 1, $_SESSION[
"takeposcustomercurrency"]).
"\n";
298 echo
'<td class="right">';
299 echo $langs->transnoentitiesnoconv(
"PaymentTypeShortLIQ");
301 echo
'<td class="right">';
303 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $conf->currency);
307 $sql =
"SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num,";
308 $sql .=
" f.multicurrency_code,";
309 $sql .=
" pf.amount as amount, pf.multicurrency_amount,";
311 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiement_facture as pf, ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"paiement as p";
312 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON p.fk_paiement = cp.id";
313 $sql .=
" WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid AND pf.fk_facture = ".((int) $facid);
314 $sql .=
" ORDER BY p.datep";
316 $resql = $db->query($sql);
318 $num = $db->num_rows($resql);
322 $row = $db->fetch_object($resql);
325 echo
'<td class="right">';
326 echo $langs->transnoentitiesnoconv(
"PaymentTypeShort".$row->code);
328 echo
'<td class="right">';
329 $amount_payment = (isModEnabled(
'multicurrency') &&
$object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
331 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
332 $amount_payment += $row->pos_change;
333 $currency = $conf->currency;
336 $currency = $row->multicurrency_code;
338 echo
price($amount_payment, 1,
'', 1, - 1, - 1, $currency);
341 if ((!isModEnabled(
'multicurrency') ||
$object->multicurrency_tx == 1) && $row->code ==
"LIQ" && $row->pos_change > 0) {
343 echo
'<td class="right">';
344 echo $langs->trans(
"Change");
346 echo
'<td class="right">';
347 echo
price($row->pos_change, 1,
'', 1, - 1, - 1, $currency);
358<div style=
"border-top-style: double;">
363$constFreeText =
'TAKEPOS_FOOTER'.(empty($_SESSION[
'takeposterminal']) ?
'0' : $_SESSION[
'takeposterminal']);
377<script
type=
"text/javascript">
380 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 '.
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_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.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
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.