appointments.php
3 days ago
employees.php
3 days ago
index.html
3 days ago
packages.php
3 days ago
subscriptions.php
3 days ago
subscriptions.php
70 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 | VAPLoader::import('libraries.invoice.classes.appointments'); |
| 15 | |
| 16 | /** |
| 17 | * Class used to generate the invoices of the customers subscriptions. |
| 18 | * Since the invoices of the subscriptions are almost equals to the invoices |
| 19 | * of the appointments, this class will extend the methods declared by |
| 20 | * VAPInvoiceAppointments. |
| 21 | * |
| 22 | * @since 1.7 |
| 23 | */ |
| 24 | class VAPInvoiceSubscriptions extends VAPInvoiceAppointments |
| 25 | { |
| 26 | /** |
| 27 | * @override |
| 28 | * Returns the destination absolute path of the invoices folder. |
| 29 | * |
| 30 | * @return string The invoice folder path. |
| 31 | */ |
| 32 | public function getInvoiceFolderPath() |
| 33 | { |
| 34 | return parent::getInvoiceFolderPath() . DIRECTORY_SEPARATOR . 'subscriptions'; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @override |
| 39 | * Returns the destination URI of the invoices folder. |
| 40 | * |
| 41 | * @return string The invoice folder URI. |
| 42 | */ |
| 43 | public function getInvoiceFolderURI() |
| 44 | { |
| 45 | return parent::getInvoiceFolderURI() . 'subscriptions/'; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * @override |
| 50 | * Returns the page template that will be used to |
| 51 | * generate the invoice. |
| 52 | * |
| 53 | * @return string The base HTML. |
| 54 | */ |
| 55 | protected function getPageTemplate() |
| 56 | { |
| 57 | $data = array( |
| 58 | 'order' => $this->order, |
| 59 | ); |
| 60 | |
| 61 | // create layout file (always read from the site section of VikAppointments) |
| 62 | $layout = new JLayoutFile('templates.invoice.subscription', null, [ |
| 63 | 'component' => 'com_vikappointments', |
| 64 | 'client' => 'site', |
| 65 | ]); |
| 66 | |
| 67 | return $layout->render($data); |
| 68 | } |
| 69 | } |
| 70 |