appointment.php
5 days ago
employee.php
5 days ago
index.html
5 days ago
package.php
5 days ago
subscription.php
5 days ago
appointment.php
195 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 | <table width="100%" border="0"> |
| 40 | |
| 41 | <tr> |
| 42 | <td> |
| 43 | <table width="100%" border="0" cellspacing="5" cellpadding="5"> |
| 44 | <tr> |
| 45 | <td width="70%">{company_logo}</td> |
| 46 | <td width="30%"align="right" valign="bottom"> |
| 47 | <table width="100%" border="0" cellpadding="1" cellspacing="1"> |
| 48 | <tr> |
| 49 | <td align="right" bgcolor="#FFFFFF"><strong><?php echo JText::translate('VAPINVNUM'); ?> {invoice_number}{invoice_suffix}</strong></td> |
| 50 | </tr> |
| 51 | <tr> |
| 52 | <td align="right" bgcolor="#FFFFFF"><strong><?php echo JText::translate('VAPINVDATE'); ?> {invoice_date}</strong></td> |
| 53 | </tr> |
| 54 | <tr> |
| 55 | <td align="right" bgcolor="#FFFFFF">{company_info}</td> |
| 56 | </tr> |
| 57 | </table> |
| 58 | </td> |
| 59 | </tr> |
| 60 | </table> |
| 61 | </td> |
| 62 | </tr> |
| 63 | |
| 64 | <tr> |
| 65 | <td> |
| 66 | <table width="100%" border="0" cellspacing="1" cellpadding="2"> |
| 67 | <tr bgcolor="#E1E1E1" style="background-color: #E1E1E1;"> |
| 68 | <td width="64%"><strong><?php echo JText::translate('VAPINVITEMDESC'); ?></strong></td> |
| 69 | <td width="12%" align="right"><strong><?php echo JText::translate('VAPINVTOTAL'); ?></strong></td> |
| 70 | <td width="12%" align="right"><strong><?php echo JText::translate('VAPINVTAXES'); ?></strong></td> |
| 71 | <td width="12%" align="right"><strong><?php echo JText::translate('VAPINVITEMPRICE'); ?></strong></td> |
| 72 | </tr> |
| 73 | |
| 74 | <?php |
| 75 | foreach ($order->appointments as $app) |
| 76 | { |
| 77 | if (!JHtml::fetch('vaphtml.status.isapproved', 'appointments', $app->status)) |
| 78 | { |
| 79 | continue; |
| 80 | } |
| 81 | ?> |
| 82 | <tr> |
| 83 | <td width="64%"><strong><?php echo $app->service->name; ?></strong></td> |
| 84 | <td width="12%" align="right"><?php echo $currency->format($app->totals->net); ?></td> |
| 85 | <td width="12%" align="right"><?php echo $currency->format($app->totals->tax); ?></td> |
| 86 | <td width="12%" align="right"><?php echo $currency->format($app->totals->gross); ?></td> |
| 87 | </tr> |
| 88 | <?php |
| 89 | |
| 90 | foreach ($app->options as $opt) |
| 91 | { |
| 92 | ?> |
| 93 | <tr> |
| 94 | <td width="64%"> <?php echo $opt->quantity . 'x ' . $opt->fullName; ?></td> |
| 95 | <td width="12%" align="right"><?php echo $currency->format($opt->totals->net); ?></td> |
| 96 | <td width="12%" align="right"><?php echo $currency->format($opt->totals->tax); ?></td> |
| 97 | <td width="12%" align="right"><?php echo $currency->format($opt->totals->gross); ?></td> |
| 98 | </tr> |
| 99 | <?php |
| 100 | } |
| 101 | } |
| 102 | ?> |
| 103 | |
| 104 | <tr> |
| 105 | <td colspan="4"> </td> |
| 106 | </tr> |
| 107 | <tr> |
| 108 | <td colspan="4"> </td> |
| 109 | </tr> |
| 110 | </table> |
| 111 | </td> |
| 112 | </tr> |
| 113 | |
| 114 | <tr> |
| 115 | <td> |
| 116 | <table width="100%" border="0" cellspacing="1" cellpadding="2"> |
| 117 | <tr bgcolor="#E1E1E1"> |
| 118 | <td width="70%" colspan="2" rowspan="<?php echo $rowspan; ?>" valign="top"> |
| 119 | <strong><?php echo JText::translate('VAPINVCUSTINFO'); ?></strong><br/>{customer_info}<br/>{billing_info} |
| 120 | </td> |
| 121 | <td width="30%" align="left"> |
| 122 | <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
| 123 | <td align="left"><strong><?php echo JText::translate('VAPINVTOTAL'); ?></strong></td> |
| 124 | <td align="right">{invoice_totalnet}</td> |
| 125 | </tr></table> |
| 126 | </td> |
| 127 | </tr> |
| 128 | <?php |
| 129 | if ($order->totals->discount > 0) |
| 130 | { |
| 131 | ?> |
| 132 | <tr bgcolor="#E1E1E1"> |
| 133 | <td width="30%" align="left"> |
| 134 | <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
| 135 | <td align="left"><strong><?php echo JText::translate('VAPSUMMARYDISCOUNT'); ?></strong></td> |
| 136 | <td align="right">{invoice_discount}</td> |
| 137 | </tr></table> |
| 138 | </td> |
| 139 | </tr> |
| 140 | <?php |
| 141 | } |
| 142 | |
| 143 | if ($order->totals->payCharge > 0) |
| 144 | { |
| 145 | ?> |
| 146 | <tr bgcolor="#E1E1E1"> |
| 147 | <td width="30%" align="left"> |
| 148 | <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
| 149 | <td align="left"><strong><?php echo JText::sprintf('VAPINVPAYCHARGE', $order->payment->name); ?></strong></td> |
| 150 | <td align="right">{invoice_paycharge}</td> |
| 151 | </tr></table> |
| 152 | </td> |
| 153 | </tr> |
| 154 | <?php |
| 155 | } |
| 156 | |
| 157 | if ($usetaxbd) |
| 158 | { |
| 159 | foreach ($breakdown as $name => $tax) |
| 160 | { |
| 161 | ?> |
| 162 | <tr bgcolor="#E1E1E1"> |
| 163 | <td width="30%" align="left"> |
| 164 | <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
| 165 | <td align="left"><strong><?php echo $name ?></strong></td> |
| 166 | <td align="right"><?php echo $currency->format($tax); ?></td> |
| 167 | </tr></table> |
| 168 | </td> |
| 169 | </tr> |
| 170 | <?php |
| 171 | } |
| 172 | } |
| 173 | ?> |
| 174 | <tr bgcolor="#E1E1E1"> |
| 175 | <td width="30%" align="left"> |
| 176 | <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
| 177 | <td align="left"><strong><?php echo JText::translate('VAPINVTAXES'); ?></strong></td> |
| 178 | <td align="right">{invoice_totaltax}</td> |
| 179 | </tr></table> |
| 180 | </td> |
| 181 | </tr> |
| 182 | <tr bgcolor="#E1E1E1"> |
| 183 | <td width="30%" align="left" valign="top"> |
| 184 | <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> |
| 185 | <td align="left"><strong><?php echo JText::translate('VAPINVGRANDTOTAL'); ?></strong></td> |
| 186 | <td align="right">{invoice_grandtotal}</td> |
| 187 | </tr></table> |
| 188 | </td> |
| 189 | </tr> |
| 190 | </table> |
| 191 | </td> |
| 192 | </tr> |
| 193 | |
| 194 | </table> |
| 195 |