dolibarr  7.0.0-beta
ticket.tpl.php
1 <?php
2 /* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
3  * Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2012 Marcos GarcĂ­a <marcosgdf@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 // Protection to avoid direct call of template
21 if (empty($langs) || ! is_object($langs))
22 {
23  print "Error, template page can't be called as URL";
24  exit;
25 }
26 
27 
28 include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
29 
30 $langs->load("main");
31 $langs->load('cashdesk');
32 
33 top_httphead('text/html');
34 
35 $facid=GETPOST('facid','int');
36 $object=new Facture($db);
37 $object->fetch($facid);
38 
39 ?>
40 <html>
41  <head>
42  <title><?php echo $langs->trans('PrintTicket') ?></title>
43  <link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT;?>/cashdesk/css/ticket.css">
44 </head>
45 
46 <body>
47 
48 <div class="entete">
49  <div class="logo">
50  <?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
51  </div>
52  <div class="infos">
53  <p class="address"><?php echo $mysoc->name; ?><br>
54  <?php print dol_nl2br(dol_format_address($mysoc)); ?><br>
55  </p>
56 
57  <p class="date_heure"><?php
58  // Recuperation et affichage de la date et de l'heure
59  $now = dol_now();
60  print dol_print_date($now,'dayhourtext').'<br>';
61  print $object->ref;
62  ?></p>
63  </div>
64 </div>
65 
66 <br>
67 
68 <table class="liste_articles">
69  <thead>
70  <tr class="titres">
71  <th><?php print $langs->trans("Code"); ?></th>
72  <th><?php print $langs->trans("Label"); ?></th>
73  <th><?php print $langs->trans("Qty"); ?></th>
74  <th><?php print $langs->trans("Discount").' (%)'; ?></th>
75  <th><?php print $langs->trans("TotalHT"); ?></th>
76  </tr>
77  </thead>
78  <tbody>
79  <?php
80 
81  $tab=array();
82  $tab = $_SESSION['poscart'];
83 
84  $tab_size=count($tab);
85  for($i=0;$i < $tab_size;$i++)
86  {
87  $remise = $tab[$i]['remise'];
88  ?>
89  <tr>
90  <td><?php echo $tab[$i]['ref'];?></td>
91  <td><?php echo $tab[$i]['label'];?></td>
92  <td><?php echo $tab[$i]['qte'];?></td>
93  <td><?php echo $tab[$i]['remise_percent'];?></td>
94  <td class="total"><?php echo price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency);?></td>
95  </tr>
96  <?php
97  }
98  ?>
99  </tbody>
100 </table>
101 
102 <table class="totaux">
103 <tr>
104  <th class="nowrap"><?php echo $langs->trans("TotalHT");?></th>
105  <td class="nowrap"><?php echo price(price2num($obj_facturation->prixTotalHt(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
106 </tr>
107 <tr>
108  <th class="nowrap"><?php echo $langs->trans("TotalVAT").'</th><td class="nowrap">'.price(price2num($obj_facturation->montantTva(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
109 </tr>
110 <tr>
111  <th class="nowrap"><?php echo ''.$langs->trans("TotalTTC").'</th><td class="nowrap">'.price(price2num($obj_facturation->prixTotalTtc(),'MT'),'',$langs,0,-1,-1,$conf->currency)."\n";?></td>
112 </tr>
113 </table>
114 
115 <script type="text/javascript">
116  window.print();
117 </script>
118 
119 <a class="lien" href="#" onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a>
120 </body>
121 </html>
dol_format_address($object, $withcountry=0, $sep="\n", $outputlangs='', $mode=0)
Return a formated address (part address/zip/town/state) according to country rules.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_now($mode='gmt')
Return date for now.
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_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print
Draft customers invoices.
Definition: index.php:91
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html')
Show HTTP header.
Definition: main.inc.php:1052
Class to manage invoices.
type
Definition: viewcat.php:283
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...