forked from andreubisquerra/Odoo-Frontend-for-TakePOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreceipt.php
104 lines (97 loc) · 3.17 KB
/
receipt.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/* Copyright (C) 2007-2008 Jeremie Ollivier <[email protected]>
* Copyright (C) 2011 Laurent Destailleur <[email protected]>
* Copyright (C) 2012 Marcos García <[email protected]>
* Copyright (C) 2018 Andreu Bisquerra <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$res=@include("../main.inc.php");
if (! $res) $res=@include("../../main.inc.php");
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("main");
$langs->load('cashdesk');
top_httphead('text/html');
$facid=GETPOST('facid','int');
$place=GETPOST('place','int');
if ($place>0){
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where facnumber='ProvPOS-$place'";
$resql = $db->query($sql);
$row = $db->fetch_array ($resql);
$facid=$row[0];
}
$object=new Facture($db);
$object->fetch($facid);
// IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolut path.
?>
<html>
<body>
<center>
<font size="4">
<?php echo $mysoc->name; ?>
</font>
</center>
<br>
<p align="left">
<?php print dol_nl2br(dol_format_address($mysoc)); ?>
</p>
<p align="right">
<?php
print $langs->trans('Date')." ".dol_print_date($object->date, 'day').'<br>';
if ($mysoc->country_code == 'ES') print "Factura simplificada ";
print $object->ref;
?>
</p>
<br>
<table width="100%">
<thead>
<tr>
<th align="center"><?php print $langs->trans("Label"); ?></th>
<th align="right"><?php print $langs->trans("Qty"); ?></th>
<th align="right"><?php print $langs->trans("TotalTTC"); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($object->lines as $line)
{
?>
<tr>
<td><?php echo $line->product_label;?></td>
<td align="right"><?php echo $line->qty;?></td>
<td align="right"><?php echo price($line->total_ttc);?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<br>
<table align="right">
<tr>
<th align="right"><?php echo $langs->trans("TotalHT");?></th>
<td align="right"><?php echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
</tr>
<tr>
<th align="right"><?php echo $langs->trans("TotalVAT").'</th><td align="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
</tr>
<tr>
<th align="right"><?php echo ''.$langs->trans("TotalTTC").'</th><td align="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
</tr>
</table>
<script type="text/javascript">
window.print();
</script>
</body>
</html>