Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
<?php
/**
* installmentpayment.php, Allows you to set a percentage payment for orders
* @author Magavenue <contact@magavenue.com>
* @copyright Magavenue
* @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0
* @category modules
*
* @note If you want to customize the module, contact us at contact@magavenue.com
*/
class HTMLTemplateInvoice extends HTMLTemplateInvoiceCore
{
public function getHeader()
{
if (Tools::getIsset('installmentpayment')) {
$this->title = HTMLTemplateInvoice::l('Facture acompte n°') . $this->order->id;
}
return parent::getHeader();
}
public function getFilename()
{
if (Tools::getIsset('installmentpayment')) {
$id_lang = Context::getContext()->language->id;
$id_shop = (int) $this->order->id_shop;
return Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, $id_shop) . sprintf('%06d', $this->order->id) . '.pdf';
}
return parent::getFilename();
}
public function getContent()
{
parent::getContent();
$iso_code = Context::getContext()->language->iso_code;
$sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'installmentpayment` WHERE id_cart=' . (int) $this->order->id_cart;
$installmentpayment = Db::getInstance()->getRow($sql);
if (isset($installmentpayment['rest']) && $installmentpayment['rest'] > 0) {
$data = array(
'paid' => $installmentpayment['payer'],
'rest' => $installmentpayment['rest'],
'acompte' => Tools::getIsset('installmentpayment') ? 1 : 0
);
$this->smarty->assign($data);
}
if (Tools::getIsset('installmentpayment')) {
$tpls = array(
'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')),
'addresses_tab' => $this->smarty->fetch($this->getTemplate('invoice.addresses-tab')),
'summary_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'installmentpayment/views/templates/hook/pdf/invoice.empty.tpl'),
'tax_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'installmentpayment/views/templates/hook/pdf/invoice.tax-tab2_' . $iso_code . '.tpl'),
'product_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'installmentpayment/views/templates/hook/pdf/invoice.empty2.tpl'),
'payment_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'installmentpayment/views/templates/hook/pdf/invoice.empty2.tpl'),
'total_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'installmentpayment/views/templates/hook/pdf/invoice.total-tab2_' . $iso_code . '.tpl')
);
} else {
$tpls = array(
'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')),
'addresses_tab' => $this->smarty->fetch($this->getTemplate('invoice.addresses-tab')),
'summary_tab' => $this->smarty->fetch($this->getTemplate('invoice.summary-tab')),
'product_tab' => $this->smarty->fetch($this->getTemplate('invoice.product-tab')),
'tax_tab' => $this->getTaxTabContent(),
'payment_tab' => $this->smarty->fetch($this->getTemplate('invoice.payment-tab')),
'total_tab' => $this->smarty->fetch(_PS_MODULE_DIR_ . 'installmentpayment/views/templates/hook/invoice.total-tab_' . $iso_code . '.tpl')
);
}
$this->smarty->assign($tpls);
$country = new Country((int) $this->order->id_address_invoice);
return $this->smarty->fetch($this->getTemplateByCountry($country->iso_code));
}
}

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;