From 00f93226fdc83c0ec6eedaae252a2130273b1af2 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Tue, 7 Apr 2026 12:50:01 +0530 Subject: [PATCH] Added: download and print functionality for payment receipts in the back-office --- .../controllers/orders/helpers/view/view.tpl | 12 +- classes/order/Order.php | 21 ++ classes/order/OrderPayment.php | 24 +++ classes/pdf/HTMLTemplatePaymentReceipt.php | 164 ++++++++++++++ classes/pdf/PDF.php | 1 + controllers/admin/AdminOrdersController.php | 1 + .../admin/AdminPaymentReceiptsController.php | 135 ++++++++++++ controllers/admin/AdminPdfController.php | 28 ++- install/data/db_structure.sql | 1 + install/data/xml/configuration.xml | 6 + install/data/xml/tab.xml | 3 + install/langs/en/data/configuration.xml | 3 + install/langs/en/data/tab.xml | 1 + pdf/payment-receipt.tpl | 79 +++++++ pdf/receipt.addresses-tab.tpl | 52 +++++ pdf/receipt.payment-info-tab.tpl | 63 ++++++ pdf/receipt.style-tab.tpl | 203 ++++++++++++++++++ 17 files changed, 794 insertions(+), 3 deletions(-) create mode 100644 classes/pdf/HTMLTemplatePaymentReceipt.php create mode 100644 controllers/admin/AdminPaymentReceiptsController.php create mode 100644 pdf/payment-receipt.tpl create mode 100644 pdf/receipt.addresses-tab.tpl create mode 100644 pdf/receipt.payment-info-tab.tpl create mode 100644 pdf/receipt.style-tab.tpl diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index c0c841758..11a6e1da7 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -419,6 +419,11 @@
 {l s="Payment"} {$order->getOrderPayments()|@count} + {if count($order->getOrderPayments()) > 0 && $receipt_management_active} + + {l s='View Payments '} + + {/if}
{if count($order->getOrderPayments()) > 0}

total_paid_tax_incl, 2) == round($total_paid, 2) || (isset($currentState) && $currentState->id == 6)} style="display: none;"{/if}> @@ -451,7 +456,7 @@ {l s='Transaction ID'} {l s='Amount'} {l s='Invoice'} - + @@ -463,6 +468,11 @@ {$payment['transaction_id']|escape:'html':'UTF-8'} {displayPrice price=$payment['real_paid_amount'] currency=$payment['id_currency']} {if isset($payment['invoice_number'])}{$payment['invoice_number']}{else}--{/if} + {if isset($receipt_management_active) && $receipt_management_active} + + {l s='View'} + + {/if} {l s='Details'} diff --git a/classes/order/Order.php b/classes/order/Order.php index 7bceb94cf..336fbec2e 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -1874,6 +1874,16 @@ class OrderCore extends ObjectModel $order_payment->amount = $amount_paid; $order_payment->date_add = ($date ? $date : null); + $number = Configuration::get('PS_PAYMENT_RECEIPTS_START_NUMBER', null, null, $this->id_shop); + // If payment start number has been set, you clean the value of this configuration + if ($number) { + Configuration::updateValue('PS_PAYMENT_RECEIPTS_START_NUMBER', false, false, null, $this->id_shop); + }else{ + $number = Order::getLastPaymentNumber() + 1; + } + + $order_payment->number = $number; + // Add time to the date if needed if ($order_payment->date_add != null && preg_match('/^[0-9]+-[0-9]+-[0-9]+$/', $order_payment->date_add)) { $order_payment->date_add .= ' '.date('H:i:s'); @@ -1935,6 +1945,17 @@ class OrderCore extends ObjectModel return false; } + public static function getLastPaymentNumber() + { + $sql = 'SELECT MAX(`number`) FROM `'._DB_PREFIX_.'order_payment`'; + if (Configuration::get('PS_PAYMENT_RECEIPTS_RESET')) { + $sql .= ' WHERE DATE_FORMAT(`date_add`, "%Y") = '.(int)date('Y'); + } + return Db::getInstance()->getValue($sql); + } + + + /** * Returns the correct product taxes breakdown. * diff --git a/classes/order/OrderPayment.php b/classes/order/OrderPayment.php index b3f3c981b..4ad21bf86 100644 --- a/classes/order/OrderPayment.php +++ b/classes/order/OrderPayment.php @@ -32,6 +32,7 @@ class OrderPaymentCore extends ObjectModel public $order_reference; public $id_currency; + public $number; public $amount; public $payment_method; public $payment_type; @@ -52,6 +53,7 @@ class OrderPaymentCore extends ObjectModel 'fields' => array( 'order_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9), 'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), + 'number' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254), 'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isNegativePrice', 'required' => true), 'payment_method' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'payment_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), @@ -159,4 +161,26 @@ class OrderPaymentCore extends ObjectModel { return Db::getInstance()->getValue('SELECT (SUM(`amount` * `conversion_rate`) / SUM(`amount`)) FROM `'._DB_PREFIX_.'order_payment` WHERE `order_reference` = \''.pSQL($order_reference).'\' AND `id_currency` = '.(int)$idCurrency); } + + public static function getTransactionDetailByOrderid($id_order) + { + return ObjectModel::hydrateCollection('OrderPayment', Db::getInstance()->executeS(' + SELECT DISTINCT op.* + FROM `'._DB_PREFIX_.'order_payment` op + INNER JOIN `'._DB_PREFIX_.'order_payment_detail` opd ON (opd.`id_order_payment` = op.`id_order_payment`) + WHERE opd.`id_order` = '.(int) $id_order.' + ORDER BY op.`date_add` ASC, op.`id_order_payment` ASC + ')); + } + + public function getPaymentReceiptNumberFormated($id_lang, $id_shop = null) + { + $format = '%1$s%2$06d'; + + if (Configuration::get('PS_PAYMENT_RECEIPTS_USE_YEAR')) { + $format = '%1$s%2$06d/%3$s'; + } + + return sprintf($format, Configuration::get('PS_PAYMENT_RECEIPTS_PREFIX', (int)$id_lang, null, (int)$id_shop), $this->number, date('Y', strtotime($this->date_add))); + } } diff --git a/classes/pdf/HTMLTemplatePaymentReceipt.php b/classes/pdf/HTMLTemplatePaymentReceipt.php new file mode 100644 index 000000000..f6ea80f9e --- /dev/null +++ b/classes/pdf/HTMLTemplatePaymentReceipt.php @@ -0,0 +1,164 @@ + + * @copyright 2007-2017 PrestaShop SA + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + +/** + * @since 1.5 + */ +class HTMLTemplatePaymentReceiptCore extends HTMLTemplate +{ + public $orderPayment; + public $order; + /** + * @param OrderPayment $orderPayment + * @param $smarty + * @throws PrestaShopException + */ + public function __construct(OrderPayment $orderPayment, $smarty, $bulk_mode = false) + { + $id_order = (int) Tools::getValue('id_order'); + $this->orderPayment = $orderPayment; + $this->order = new Order((int)$id_order); + $this->smarty = $smarty; + // header informations + $this->date = Tools::displayDate($this->orderPayment->date_add); + $id_lang = Context::getContext()->language->id; + $this->shop = new Shop((int)$this->order->id_shop); + $this->title = $this->orderPayment->getPaymentReceiptNumberFormated($id_lang, (int)$this->order->id_shop); + + } + + /** + * Returns the template's HTML header + * + * @return string HTML header + */ + public function getHeader() + { + $this->assignCommonHeaderData(); + $this->smarty->assign(array( + 'header' => HTMLTemplatePaymentReceipt::l('Receipt'), + )); + + return $this->smarty->fetch($this->getTemplate('header')); + } + + public function getFooter() + { + $shop_address = $this->getShopAddress(); + + $id_shop = (int)$this->shop->id; + + $this->smarty->assign(array( + 'shop_address' => $shop_address, + 'shop_fax' => Configuration::get('PS_SHOP_FAX', null, null, $id_shop), + 'shop_phone' => Configuration::get('PS_SHOP_PHONE', null, null, $id_shop), + 'shop_email' => Configuration::get('PS_SHOP_EMAIL', null, null, $id_shop), + 'free_text' => Configuration::get('PS_PAYMENT_RECEIPTS_FREE_TEXT', (int)Context::getContext()->language->id, null, $id_shop) + )); + + return $this->smarty->fetch($this->getTemplate('footer')); + } + + public function getContent() + { + $delivery_address = $invoice_address = new Address((int)$this->order->id_address_invoice); + $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '
', ' '); + $formatted_delivery_address = ''; + + if ($this->order->id_address_delivery != $this->order->id_address_invoice) { + $delivery_address = new Address((int)$this->order->id_address_delivery); + $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '
', ' '); + } + + $formattedHotelAddress = ''; + if (Module::isInstalled('hotelreservationsystem')) { + if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($this->order->id)) { + $objHotelBranchInfo = new HotelBranchInformation((int) $idHotel, Context::getContext()->language->id); + $invoiceAddressPatternRules['avoid'][] = 'lastname'; + if ($idHotelAddress = $objHotelBranchInfo->getHotelIdAddress()) { + $objHotelAddress = new Address((int) $idHotelAddress); + $objHotelAddress->firstname = $objHotelBranchInfo->hotel_name; + $formattedHotelAddress = AddressFormat::generateAddress($objHotelAddress, $invoiceAddressPatternRules, '
', ' '); + } + } + } + $customer = new Customer((int)$this->order->id_customer); + + $this->orderPayment->payment_type = $this->getPaymentType($this->orderPayment->payment_type); + + $legal_free_text = Configuration::get('PS_PAYMENT_RECEIPTS_LEGAL_FREE_TEXT', (int)Context::getContext()->language->id, null, (int)$this->order->id_shop); + + $this->smarty->assign(array( + 'order' => $this->order, + 'payment_list' => array($this->orderPayment), + 'delivery_address' => $formatted_delivery_address, + 'invoice_address' => $formatted_invoice_address, + 'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address), + 'customer' => $customer, + 'hotel_address' => $formattedHotelAddress, + 'legal_free_text' => $legal_free_text, + )); + + $tpls = array( + 'style_tab' => $this->smarty->fetch($this->getTemplate('receipt.style-tab')), + 'addresses_tab' => $this->smarty->fetch($this->getTemplate('receipt.addresses-tab')), + 'payment_info_tab' => $this->smarty->fetch($this->getTemplate('receipt.payment-info-tab')), + ); + $this->smarty->assign($tpls); + $html = $this->smarty->fetch($this->getTemplate('payment-receipt')); + return($html); + } + + public function getFilename() + { + return 'payment-receipt-'.sprintf('%06d', $this->orderPayment->id).'.pdf'; + } + + public function getBulkFilename() + { + return 'payment-receipts.pdf'; + } + + protected function getPaymentType($paymentType = null) + { + $paymentTypeName = null; + switch ($paymentType) { + case OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL: + $paymentTypeName = HTMLTemplatePaymentReceipt::l('Pay at hotel'); + break; + case OrderPayment::PAYMENT_TYPE_ONLINE: + $paymentTypeName = HTMLTemplatePaymentReceipt::l('Online'); + break; + case OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT: + $paymentTypeName = HTMLTemplatePaymentReceipt::l('Remote payment'); + break; + default: + $paymentTypeName = null; + break; + } + return $paymentTypeName; + } +} \ No newline at end of file diff --git a/classes/pdf/PDF.php b/classes/pdf/PDF.php index 626d3a51a..833d5b17e 100644 --- a/classes/pdf/PDF.php +++ b/classes/pdf/PDF.php @@ -41,6 +41,7 @@ class PDFCore const TEMPLATE_ORDER_SLIP = 'OrderSlip'; const TEMPLATE_DELIVERY_SLIP = 'DeliverySlip'; const TEMPLATE_SUPPLY_ORDER_FORM = 'SupplyOrderForm'; + const TEMPLATE_PAYMENT_RECEIPT = 'PaymentReceipt'; /** * @param $objects diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 30026bcca..1817c0269 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -3676,6 +3676,7 @@ class AdminOrdersControllerCore extends AdminController 'payment_methods' => $payment_methods, 'payment_types' => $this->getPaymentsTypes(), 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop), + 'receipt_management_active' => Configuration::get('PS_PAYMENT_RECEIPTS', null, null, $order->id_shop), 'display_warehouse' => (int)Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), 'HOOK_CONTENT_ORDER' => Hook::exec( 'displayAdminOrderContentOrder', diff --git a/controllers/admin/AdminPaymentReceiptsController.php b/controllers/admin/AdminPaymentReceiptsController.php new file mode 100644 index 000000000..44336b9f1 --- /dev/null +++ b/controllers/admin/AdminPaymentReceiptsController.php @@ -0,0 +1,135 @@ + +* @copyright 2007-2017 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +class AdminPaymentReceiptsControllerCore extends AdminControllerCore +{ + public function __construct() + { + $this->bootstrap = true; + parent::__construct(); + $this->context = Context::getContext(); + $this->lang = false; + $this->table = 'order_payment'; + + $this->fields_options = array( + 'general' => array( + 'title' => $this->l('Payment receipts options'), + 'fields' => array( + 'PS_PAYMENT_RECEIPTS' => array( + 'title' => $this->l('Enable Receipts'), + 'desc' => $this->l('If enabled, your customers will receive a receipt for their purchase(s).'), + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_PAYMENT_RECEIPTS_PREFIX' => array( + 'title' => $this->l('Receipt prefix'), + 'desc' => $this->l('Prefix used for receipt name (e.g. #IN00001).'), + 'size' => 6, + 'type' => 'textLang' + ), + 'PS_PAYMENT_RECEIPTS_USE_YEAR' => array( + 'title' => $this->l('Add current year to receipt number'), + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_PAYMENT_RECEIPTS_RESET' => array( + 'title' => $this->l('Reset Receipt progressive number at beginning of the year'), + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_PAYMENT_RECEIPTS_START_NUMBER' => array( + 'title' => $this->l('Receipt number'), + 'desc' => sprintf($this->l('The next receipt will begin with this number, and then increase with each additional receipt. Set to 0 if you want to keep the current number (which is #%s).'), Order::getLastPaymentNumber() + 1), + 'size' => 6, + 'type' => 'text', + 'cast' => 'intval' + ), + 'PS_PAYMENT_RECEIPTS_LEGAL_FREE_TEXT' => array( + 'title' => $this->l('Legal free text'), + 'desc' => $this->l('Use this field to display additional text on your receipt, like specific legal information. It will appear below the payment methods summary.'), + 'size' => 50, + 'type' => 'textareaLang', + ), + 'PS_PAYMENT_RECEIPTS_FREE_TEXT' => array( + 'title' => $this->l('Footer text'), + 'desc' => $this->l('This text will appear at the bottom of the receipt, below your company details.'), + 'size' => 50, + 'type' => 'textLang', + ), + 'PS_PDF_USE_CACHE' => array( + 'title' => $this->l('Use the disk as cache for PDF receipts'), + 'desc' => $this->l('Saves memory but slows down the PDF generation.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool' + ) + ), + 'submit' => array('title' => $this->l('Save')) + ) + ); + } + + public function initContent() + { + $this->display = 'edit'; + $this->initTabModuleList(); + $this->initToolbar(); + $this->initPageHeaderToolbar(); + $this->table = 'order_payment'; + $this->content .= $this->renderOptions(); + + $this->context->smarty->assign(array( + 'content' => $this->content, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn + )); + } + + public function initToolbarTitle() + { + $this->toolbar_title = array_unique($this->breadcrumbs); + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + unset($this->page_header_toolbar_btn['cancel']); + } + + public function postProcess() + { + parent::postProcess(); + } + + public function beforeUpdateOptions() + { + if ((int)Tools::getValue('PS_PAYMENT_RECEIPTS_START_NUMBER') != 0 && (int)Tools::getValue('PS_PAYMENT_RECEIPTS_START_NUMBER') <= Order::getLastPaymentNumber()) { + $this->errors[] = $this->l('Invalid receipt number.').Order::getLastPaymentNumber().')'; + } + } +} + diff --git a/controllers/admin/AdminPdfController.php b/controllers/admin/AdminPdfController.php index 7fba0f8e1..279529b2a 100644 --- a/controllers/admin/AdminPdfController.php +++ b/controllers/admin/AdminPdfController.php @@ -93,7 +93,6 @@ class AdminPdfControllerCore extends AdminController public function processGenerateInvoicesPDF() { $order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')); - if (!count($order_invoice_collection)) { die(Tools::displayError('No invoice was found.')); } @@ -150,14 +149,39 @@ class AdminPdfControllerCore extends AdminController $id_supply_order = (int)Tools::getValue('id_supply_order'); $supply_order = new SupplyOrder($id_supply_order); - if (!Validate::isLoadedObject($supply_order)) { die(Tools::displayError('The supply order cannot be found within your database.')); } $this->generatePDF($supply_order, PDF::TEMPLATE_SUPPLY_ORDER_FORM); + } + + public function processGeneratePaymentReceipt() + { + $idOrderPayment = (int) Tools::getValue('id_order_payment'); + $idOrder = (int) Tools::getValue('id_order'); + + if ($idOrderPayment <= 0 && $idOrder <= 0) { + die(Tools::displayError('The order or order payment id is missing.')); + } + + if ($idOrderPayment > 0) { + $orderPayment = new OrderPayment($idOrderPayment); + + if (!Validate::isLoadedObject($orderPayment)) { + die(Tools::displayError('The order payment cannot be found.')); + } + } else { + $orderPayment = OrderPayment::getTransactionDetailByOrderid($idOrder); + if (!$orderPayment || !count($orderPayment)) { + die(Tools::displayError('No payment found for this order.')); + } + } + + $this->generatePDF($orderPayment, PDF::TEMPLATE_PAYMENT_RECEIPT); } + public function generateDeliverySlipPDFByIdOrder($id_order) { $order = new Order((int)$id_order); diff --git a/install/data/db_structure.sql b/install/data/db_structure.sql index 7550fbcad..8cfeeb755 100644 --- a/install/data/db_structure.sql +++ b/install/data/db_structure.sql @@ -1496,6 +1496,7 @@ CREATE TABLE `PREFIX_order_payment` ( `order_reference` VARCHAR(9), `id_currency` INT UNSIGNED NOT NULL, `amount` DECIMAL(10,2) NOT NULL, + `number` varchar(255) NOT NULL, `payment_method` varchar(255) NOT NULL, `payment_type` INT UNSIGNED NOT NULL, `conversion_rate` decimal(13,6) NOT NULL DEFAULT 1, diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index 1c754ae50..dd1245e17 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -133,6 +133,9 @@ #IN + + + #IN {"avoid":[]} @@ -152,6 +155,9 @@ 1 + + 1 + 360 diff --git a/install/data/xml/tab.xml b/install/data/xml/tab.xml index 09eed80f3..8909ed603 100644 --- a/install/data/xml/tab.xml +++ b/install/data/xml/tab.xml @@ -102,6 +102,9 @@ AdminInvoices + + AdminPaymentReceipts + diff --git a/install/langs/en/data/configuration.xml b/install/langs/en/data/configuration.xml index b4bf4ef61..610649713 100644 --- a/install/langs/en/data/configuration.xml +++ b/install/langs/en/data/configuration.xml @@ -3,6 +3,9 @@ #IN + + #IN + #DE diff --git a/install/langs/en/data/tab.xml b/install/langs/en/data/tab.xml index ab5391a0f..2ccd45418 100644 --- a/install/langs/en/data/tab.xml +++ b/install/langs/en/data/tab.xml @@ -32,6 +32,7 @@ + diff --git a/pdf/payment-receipt.tpl b/pdf/payment-receipt.tpl new file mode 100644 index 000000000..470b49eae --- /dev/null +++ b/pdf/payment-receipt.tpl @@ -0,0 +1,79 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{$style_tab} + + + + + + + + + + + + + + + + + + + + + + + + + {if isset($HOOK_DISPLAY_PDF)} + + + + + + + + {/if} + +
+ + {$addresses_tab} + +
 
+ {$payment_info_tab} +
 
+ + + + + +
+

{$legal_free_text|escape:'html':'UTF-8'|nl2br}

+
+ +
 
+ {$HOOK_DISPLAY_PDF} +
diff --git a/pdf/receipt.addresses-tab.tpl b/pdf/receipt.addresses-tab.tpl new file mode 100644 index 000000000..df5e70de0 --- /dev/null +++ b/pdf/receipt.addresses-tab.tpl @@ -0,0 +1,52 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + + + +
+ {if !empty($hotel_address)} + {l s='Hotel Detail' pdf='true'}

+ {$hotel_address} + {/if} +
+ {l s='Customer Detail' pdf='true'}

+ {if $invoice_address} + {$invoice_address} + {else} + {$customer->firstname} {$customer->lastname} +
+ {$customer->phone} + {/if} +
\ No newline at end of file diff --git a/pdf/receipt.payment-info-tab.tpl b/pdf/receipt.payment-info-tab.tpl new file mode 100644 index 000000000..d39879c19 --- /dev/null +++ b/pdf/receipt.payment-info-tab.tpl @@ -0,0 +1,63 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if isset($payment_list) && $payment_list} + + + + + + + + + + + + + + + {foreach from=$payment_list key=rm_k item=payment} + {cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class} + + + + + + + + {/foreach} + +
{l s='Payment Details' pdf='true'}
{l s='Payment Date' pdf='true'}{l s='Payment Method' pdf='true'}{l s='Payment Type' pdf='true'}{l s='Transaction ID' pdf='true'}{l s='Amount' pdf='true'}
+ {dateFormat date=$payment->date_add full=true} + + {$payment->payment_method} + + {$payment->payment_type} + + {$payment->transaction_id} + + {displayPrice currency=$payment->id_currency price=$payment->amount} +
+{/if} \ No newline at end of file diff --git a/pdf/receipt.style-tab.tpl b/pdf/receipt.style-tab.tpl new file mode 100644 index 000000000..e34c365c9 --- /dev/null +++ b/pdf/receipt.style-tab.tpl @@ -0,0 +1,203 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{assign var=color_header value="#F0F0F0"} +{assign var=color_border value="#000000"} +{assign var=color_border_lighter value="#CCCCCC"} +{assign var=color_line_even value="#FFFFFF"} +{assign var=color_line_odd value="#F9F9F9"} +{assign var=font_size_text value="9pt"} +{assign var=font_size_header value="9pt"} +{assign var=font_size_product value="9pt"} +{assign var=height_header value="20px"} +{assign var=table_padding value="4px"} + +