File manager - Edit - /home/verseaumee/ptitsanes/plugins/solidres/invoice/layouts/invoices/invoice_customer_pdf_layout_2.php
Back
<?php /*------------------------------------------------------------------------ Solidres - Hotel booking extension for Joomla ------------------------------------------------------------------------ @Author Solidres Team @Website http://www.solidres.com @Copyright Copyright (C) 2013 - 2016 Solidres. All Rights Reserved. @License GNU General Public License version 3, or later ------------------------------------------------------------------------*/ defined('_JEXEC') or die; extract($displayData); $baseCurrency = new SRCurrency(0, $reservation->currency_id); // Total room cost $totalPriceTaxExcl = clone $baseCurrency; $totalPriceTaxExcl->setValue($reservation->total_price_tax_excl); // Total discount $totalDiscount = clone $baseCurrency; $totalDiscount->setValue($reservation->total_discount); // Room Tax amount $roomTaxAmount = $reservation->tax_amount; $roomTax = clone $baseCurrency; $roomTax->setValue($roomTaxAmount); // Extra cost (tax incl and tax excl) $extraCostTaxInclAmount = $reservation->total_extra_price_tax_incl; $extraCostTaxIncl = clone $baseCurrency; $extraCostTaxIncl->setValue($extraCostTaxInclAmount); $extraCostTaxExclAmount = $reservation->total_extra_price_tax_excl; $extraCostTaxExcl = clone $baseCurrency; $extraCostTaxExcl->setValue($extraCostTaxExclAmount); // Extra tax $extraTaxAmount = $extraCostTaxInclAmount - $extraCostTaxExclAmount; $extraTax = clone $baseCurrency; $extraTax->setValue($extraTaxAmount); // Tourist tax $touristTax = clone $baseCurrency; $touristTax->setValue($reservation->tourist_tax_amount); // Payment method surcharge and discount $paymentMethodSurcharge = clone $baseCurrency; $paymentMethodSurcharge->setValue($reservation->payment_method_surcharge); $paymentMethodDiscount = clone $baseCurrency; $paymentMethodDiscount->setValue($reservation->payment_method_discount); // Total paid $totalPaidAmount = !empty($reservation->total_paid) ? $reservation->total_paid : 0; $totalPaid = clone $baseCurrency; $totalPaid->setValue($totalPaidAmount); // Grand total $grandTotal = clone $baseCurrency; if ($reservation->discount_pre_tax) : $grandTotalAmount = $reservation->total_price_tax_excl - $reservation->total_discount + $reservation->tax_amount + $extraCostTaxInclAmount; else : $grandTotalAmount = $reservation->total_price_tax_excl + $reservation->tax_amount - $reservation->total_discount + $extraCostTaxInclAmount; endif; if ($reservation->tourist_tax_amount > 0) : $grandTotalAmount += $reservation->tourist_tax_amount; endif; if ($reservation->payment_method_surcharge > 0) : $grandTotalAmount += $reservation->payment_method_surcharge; endif; if ($reservation->payment_method_discount > 0) : $grandTotalAmount -= $reservation->payment_method_discount; endif; $grandTotal->setValue($grandTotalAmount); $totalDue = clone $baseCurrency; $totalDue->setValue($grandTotalAmount - $totalPaidAmount); $dateFormat = $solidresConfig->get('date_format'); $useCompanyInfo = false; if (isset($asset->params['use_company_info'])) : $useCompanyInfo = $asset->params['use_company_info']; endif; if ($useCompanyInfo) : $companyName = $asset->params['company_name']; $companyVAT = $asset->params['company_vat_number']; $companyAddress = $asset->params['company_address']; $companyPhone = $asset->params['company_phone']; $companyFax = $asset->params['company_fax']; $companyEmail = $asset->params['company_email']; $companyWebsite = $asset->params['company_website']; endif; $colors = array( 0 => '#000', 1 => 'green', 2 => 'red', 3 => 'orange' ); $paymentStatuses = array( 0 => JText::_('SR_RESERVATION_PAYMENT_STATUS_UNPAID'), 1 => JText::_('SR_RESERVATION_PAYMENT_STATUS_COMPLETED'), 2 => JText::_('SR_RESERVATION_PAYMENT_STATUS_CANCELLED'), 3 => JText::_('SR_RESERVATION_PAYMENT_STATUS_PENDING'), ); $paymentMethodLabel = ''; if ($reservation->payment_method_id) : $paymentMethodLabel = JText::_('SR_PAYMENT_METHOD_' . $reservation->payment_method_id); endif; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction ?>"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width"/> <title><?php echo $asset->name ?></title> <style> .invoice-box { max-width: 800px; margin: 0 auto; padding: 20px; background: #fff; color: #333; } .invoice-box .title { margin-top: 10px; padding: 10px; text-align: center; border-top: 1px solid #333; border-bottom: 1px solid #333; } .invoice-box .title .h1 { font-size: 24px; color: #1f496e; } .invoice-box table { width: 100%; } .invoice-box table tr td { vertical-align: top; } </style> </head> <body> <div class="invoice-box"> <div style="text-align: center;"> <?php $assetLogo = $asset->params['logo']; if (isset($assetLogo) && !empty($assetLogo)) : if(file_exists(JPATH_ROOT . '/media/com_solidres/assets/images/system/' . $assetLogo)) : ?> <img src="<?php echo SRURI_MEDIA . '/assets/images/system/' . $assetLogo ?>" alt="logo" style="height: 50px;"/> <?php endif; endif; ?> </div> <div class="title"> <span class="h1"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_TITLE') . ' - ' . $invoiceNumber ?></span><br/> <span><?php echo JText::_('SR_EMAIL_INVOICE_PDF_DATE') . JDate::getInstance('now', $timezone)->format($dateFormat, true) ?></span><br/> <span> <?php $color = '#000'; if (isset($colors[$reservation->payment_status])) { $color = $colors[$reservation->payment_status]; } echo JText::_('SR_EMAIL_INVOICE_PAYMENT_STATUS') . '<span style="font-weight: bold; color: ' . $color . '">' . $paymentStatuses[$reservation->payment_status] . '</span>' ?> </span><br/> <!--<span><?php /*echo JText::_('SR_EMAIL_INVOICE_PDF_INVOICE_ORIGIN_2') . $reservation->origin */?></span><br/>--> </div> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> </td> </tr> <tr> <td width="60%"> <span style="font-size: 12px; text-transform: uppercase;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_INVOICE_TO_CUSTOMER') ?></span><br/> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_NAME')) ?></td> <td width="75%"><?php echo JText::sprintf('SR_EMAIL_INVOICE_GREETING_NAME', $reservation->customer_firstname, $reservation->customer_middlename, $reservation->customer_lastname) ?></td> </tr> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_COMPANY')) ?></td> <td width="75%"><?php echo $reservation->customer_company ?></td> </tr> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_VAT')) ?></td> <td width="75%"><?php echo $reservation->customer_vat_number ?></td> </tr> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_ADDRESS')) ?></td> <td width="75%"><?php echo $reservation->customer_address1 ?></td> </tr> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_CITY')) ?></td> <td width="75%"><?php echo $reservation->customer_city ?></td> </tr> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_PHONE')) ?></td> <td width="70%"><?php echo $reservation->customer_phonenumber ?></td> </tr> <tr> <td width="25%" style="text-align: right; color: #1f496e; font-size: 12px; font-weight: bold;"><?php echo strtoupper(JText::_('SR_EMAIL_INVOICE_PDF_CUSTOMER_MOBILEPHONE')) ?></td> <td width="75%"><?php echo $reservation->customer_mobilephone ?></td> </tr> </table> </td> <td width="40%" style="text-align: right;"> <span style="color: #1f496e; font-size: 17px; font-weight: bold;"><?php echo $asset->name ?></span><br/> <?php if ($useCompanyInfo) : ?> <span><?php echo $companyName ?></span><br/> <?php if (!empty($companyVAT)) : ?> <span><?php echo $companyVAT ?></span><br/> <?php endif ?> <?php if (!empty($companyAddress)) : ?> <span><?php echo $companyAddress ?></span><br/> <?php endif ?> <?php if (!empty($companyPhone)) : ?> <span><?php echo $companyPhone ?></span><br/> <?php endif ?> <?php if (!empty($companyFax)) : ?> <span><?php echo $companyFax ?></span><br/> <?php endif ?> <?php if (!empty($companyEmail)) : ?> <span><?php echo $companyEmail ?></span><br/> <?php endif ?> <?php if (!empty($companyWebsite)) : ?> <span><?php echo $companyWebsite ?></span><br/> <?php endif ?> <?php else : ?> <span><?php echo $asset->address_1 . ', ' ?></span><br/> <span><?php echo $asset->city . ', ' . (!empty($asset->geostate_code_2) ? $asset->geostate_code_2 . ' ' : '') . $asset->postcode ?></span><br/> <span><?php echo $asset->phone ?></span><br/> <span><?php echo $asset->fax ?></span><br/> <span><?php echo $asset->email ?></span><br/> <span><?php echo $asset->website ?></span><br/> <?php endif ?> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="49%"> <table border="1" cellspacing="0" cellpadding="5"> <tr> <td width="50%" style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_RESERVATION_CODE') ?></td> <td><?php echo $reservation->code ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_PAYMENT_METHOD') ?></td> <td><?php echo $paymentMethodLabel ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_CHECKIN') ?></td> <td><?php echo JDate::getInstance($reservation->checkin, $timezone)->format($dateFormat, true) ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_CHECKOUT') ?></td> <td><?php echo JDate::getInstance($reservation->checkout, $timezone)->format($dateFormat, true) ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_LENGTH_OF_STAY') ?></td> <td><?php echo ($reservation->booking_type == 0 ? JText::plural('SR_NIGHTS', $stayLength) : JText::plural('SR_DAYS', $stayLength + 1)) ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_GUESTS') ?></td> <td><?php echo $reservedAdults . ' / ' . $reservedChildren ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_ROOMS') ?></td> <td><?php echo implode(', ', $reservedRooms) ?></td> </tr> <tr> <td style="background-color: #eee; font-weight: bold;"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_ROOM_DESC') ?><div> </div><h5> </h5></td> <td><?php echo implode(', ', $reservedRoomTypes) ?></td> </tr> </table> </td> <td width="2%"> </td> <td width="49%"> <table border="1" cellspacing="0" cellpadding="5"> <thead> <tr style="background-color: #eee; font-weight: bold;"> <th width="50%" style="text-align: left"><?php echo JText::_('SR_EMAIL_INVOICE_PDF_COST_DESC') ?></th> <th style="text-align: right"><?php echo JText::sprintf('SR_EMAIL_INVOICE_PDF_AMOUNT', $baseCurrency->getCode()) ?></th> </tr> </thead> <tbody> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_ROOM_COST') ?></td> <td style="text-align: right"><?php echo $totalPriceTaxExcl->format(false) ?></td> </tr> <?php if ($reservation->discount_pre_tax && !is_null($reservation->total_discount)) : ?> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_TOTAL_DISCOUNT') ?></td> <td style="text-align: right"><?php echo '-' . $totalDiscount->format(false) ?></td> </tr> <?php endif ?> <tr> <td><?php echo JText::_('SR_TOTAL_ROOM_TAX') ?></td> <td style="text-align: right"><?php echo $roomTax->format(false) ?></td> </tr> <?php if (!$reservation->discount_pre_tax && !is_null($reservation->total_discount)) : ?> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_TOTAL_DISCOUNT') ?></td> <td style="text-align: right"><?php echo '-' . $totalDiscount->format(false) ?></td> </tr> <?php endif ?> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_EXTRA_COST') ?></td> <td style="text-align: right"><?php echo $extraCostTaxExcl->format(false) ?></td> </tr> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_EXTRA_TAX') ?></td> <td style="text-align: right"><?php echo $extraTax->format(false) ?></td> </tr> <?php if ($reservation->payment_method_surcharge > 0) : ?> <tr> <td><?php echo JText::sprintf('SR_EMAIL_INVOICE_PDF_PAYMENT_METHOD_SURCHARGE', $paymentMethodLabel) ?></td> <td style="text-align: right"><?php echo $paymentMethodSurcharge->format(false) ?></td> </tr> <?php endif ?> <?php if ($reservation->payment_method_discount > 0) : ?> <tr> <td><?php echo JText::sprintf('SR_EMAIL_INVOICE_PDF_PAYMENT_METHOD_DISCOUNT', $paymentMethodLabel) ?></td> <td style="text-align: right"><?php echo '-' . $paymentMethodDiscount->format(false) ?></td> </tr> <?php endif ?> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_TOURIST_TAX') ?></td> <td style="text-align: right"><?php echo $touristTax->format(false) ?></td> </tr> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_GRAND_TOTAL') ?></td> <td style="color: #1f496e; text-align: right"><?php echo $grandTotal->format(false) ?></td> </tr> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_PAID') ?></td> <td style="color: #1f496e; text-align: right"><?php echo $totalPaid->format(false) ?></td> </tr> <tr> <td><?php echo JText::_('SR_EMAIL_INVOICE_PDF_TOTAL_DUE') ?></td> <td style="color: #1f496e; font-weight: bold; text-align: right"><?php echo $totalDue->format(false) ?></td> </tr> </tbody> </table> </td> </tr> </table> <div class="invoice-note"> <p> </p> <?php echo $invoiceNote ?> </div> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings