PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / layouts / templates / invoice / package.php
vikappointments / site / layouts / templates / invoice Last commit date
appointment.php 6 days ago employee.php 6 days ago index.html 6 days ago package.php 6 days ago subscription.php 6 days ago
package.php
183 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 $order = isset($displayData['order']) ? $displayData['order'] : array();
15 $breakdown = isset($displayData['breakdown']) ? $displayData['breakdown'] : array();
16 $usetaxbd = isset($displayData['usetaxbd']) ? $displayData['usetaxbd'] : false;
17
18 $rowspan = 3;
19
20 if ($order->totals->payCharge > 0)
21 {
22 $rowspan++;
23 }
24
25 if ($order->totals->discount > 0)
26 {
27 $rowspan++;
28 }
29
30 if ($usetaxbd)
31 {
32 // increase row size by the number of fetched tax breakdowns
33 $rowspan += count($breakdown);
34 }
35
36 $currency = VAPFactory::getCurrency();
37
38 ?>
39
40 <table width="100%" border="0">
41
42 <tr>
43 <td>
44 <table width="100%" border="0" cellspacing="5" cellpadding="5">
45 <tr>
46 <td width="70%">{company_logo}</td>
47 <td width="30%"align="right" valign="bottom">
48 <table width="100%" border="0" cellpadding="1" cellspacing="1">
49 <tr>
50 <td align="right" bgcolor="#FFFFFF"><strong><?php echo JText::translate('VAPINVNUM'); ?> {invoice_number}{invoice_suffix}</strong></td>
51 </tr>
52 <tr>
53 <td align="right" bgcolor="#FFFFFF"><strong><?php echo JText::translate('VAPINVDATE'); ?> {invoice_date}</strong></td>
54 </tr>
55 <tr>
56 <td align="right" bgcolor="#FFFFFF">{company_info}</td>
57 </tr>
58 </table>
59 </td>
60 </tr>
61 </table>
62 </td>
63 </tr>
64
65 <tr>
66 <td>
67 <table width="100%" border="0" cellspacing="1" cellpadding="2">
68 <tr bgcolor="#E1E1E1" style="background-color: #E1E1E1;">
69 <td width="56%"><strong><?php echo JText::translate('VAPINVITEMDESC'); ?></strong></td>
70 <td width="8%" align="center"><strong><?php echo JText::translate('VAPINVQTY'); ?></strong></td>
71 <td width="12%" align="right"><strong><?php echo JText::translate('VAPINVTOTAL'); ?></strong></td>
72 <td width="12%" align="right"><strong><?php echo JText::translate('VAPINVTAXES'); ?></strong></td>
73 <td width="12%" align="right"><strong><?php echo JText::translate('VAPINVITEMPRICE'); ?></strong></td>
74 </tr>
75
76 <?php
77 foreach ($order->packages as $item)
78 {
79 ?>
80 <tr>
81 <td width="56%"><strong><?php echo $item->name; ?></strong></td>
82 <td width="8%" align="center">x<?php echo $item->quantity; ?></td>
83 <td width="12%" align="right"><?php echo $currency->format($item->totals->net); ?></td>
84 <td width="12%" align="right"><?php echo $currency->format($item->totals->tax); ?></td>
85 <td width="12%" align="right"><?php echo $currency->format($item->totals->gross); ?></td>
86 </tr>
87 <?php
88 }
89 ?>
90
91 <tr>
92 <td>&nbsp;</td>
93 <td>&nbsp;</td>
94 </tr>
95 <tr>
96 <td>&nbsp;</td>
97 <td>&nbsp;</td>
98 </tr>
99 </table>
100 </td>
101 </tr>
102
103 <tr>
104 <td>
105 <table width="100%" border="0" cellspacing="1" cellpadding="2">
106 <tr bgcolor="#E1E1E1">
107 <td width="70%" colspan="2" rowspan="<?php echo $rowspan; ?>" valign="top">
108 <strong><?php echo JText::translate('VAPINVCUSTINFO'); ?></strong><br/>{customer_info}<br/>{billing_info}
109 </td>
110 <td width="30%" align="left">
111 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
112 <td align="left"><strong><?php echo JText::translate('VAPINVTOTAL'); ?></strong></td>
113 <td align="right">{invoice_totalnet}</td>
114 </tr></table>
115 </td>
116 </tr>
117 <?php
118 if ($order->totals->discount > 0)
119 {
120 ?>
121 <tr bgcolor="#E1E1E1">
122 <td width="30%" align="left">
123 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
124 <td align="left"><strong><?php echo JText::translate('VAPSUMMARYDISCOUNT'); ?></strong></td>
125 <td align="right">{invoice_discount}</td>
126 </tr></table>
127 </td>
128 </tr>
129 <?php
130 }
131
132 if ($order->totals->payCharge > 0)
133 {
134 ?>
135 <tr bgcolor="#E1E1E1">
136 <td width="30%" align="left">
137 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
138 <td align="left"><strong><?php echo JText::sprintf('VAPINVPAYCHARGE', $order->payment->name); ?></strong></td>
139 <td align="right">{invoice_paycharge}</td>
140 </tr></table>
141 </td>
142 </tr>
143 <?php
144 }
145
146 if ($usetaxbd)
147 {
148 foreach ($breakdown as $name => $tax)
149 {
150 ?>
151 <tr bgcolor="#E1E1E1">
152 <td width="30%" align="left">
153 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
154 <td align="left"><strong><?php echo $name ?></strong></td>
155 <td align="right"><?php echo $currency->format($tax); ?></td>
156 </tr></table>
157 </td>
158 </tr>
159 <?php
160 }
161 }
162 ?>
163 <tr bgcolor="#E1E1E1">
164 <td width="30%" align="left">
165 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
166 <td align="left"><strong><?php echo JText::translate('VAPINVTAXES'); ?></strong></td>
167 <td align="right">{invoice_totaltax}</td>
168 </tr></table>
169 </td>
170 </tr>
171 <tr bgcolor="#E1E1E1">
172 <td width="30%" align="left" valign="top">
173 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
174 <td align="left"><strong><?php echo JText::translate('VAPINVGRANDTOTAL'); ?></strong></td>
175 <td align="right">{invoice_grandtotal}</td>
176 </tr></table>
177 </td>
178 </tr>
179 </table>
180 </td>
181 </tr>
182
183 </table>