[+] Project : B2B Features
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{*
|
||||
* 2007-2011 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 <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 9589 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{* Generate HTML code for printing Invoice Icon with link *}
|
||||
<span style="width:20px; margin-right:5px;">
|
||||
<a href="pdf.php?id_order_invoice={$id_invoice}&pdf"><img src="../img/admin/tab-invoice.gif" alt="invoice" /></a>
|
||||
</span>
|
||||
Vendored
+6
-2
@@ -150,8 +150,6 @@
|
||||
'Notification' => 'override/classes/Notification.php',
|
||||
'ObjectModelCore' => 'classes/ObjectModel.php',
|
||||
'ObjectModel' => 'override/classes/ObjectModel.php',
|
||||
'PDFCore' => 'classes/pdf/PDF.php',
|
||||
'PDF' => 'override/classes/pdf/PDF.php',
|
||||
'PackCore' => 'classes/Pack.php',
|
||||
'Pack' => 'override/classes/Pack.php',
|
||||
'PageCore' => 'classes/Page.php',
|
||||
@@ -182,6 +180,8 @@
|
||||
'RequestSql' => 'override/classes/RequestSql.php',
|
||||
'RijndaelCore' => 'classes/Rijndael.php',
|
||||
'Rijndael' => 'override/classes/Rijndael.php',
|
||||
'RiskCore' => 'classes/Risk.php',
|
||||
'Risk' => '',
|
||||
'SceneCore' => 'classes/Scene.php',
|
||||
'Scene' => 'override/classes/Scene.php',
|
||||
'SearchCore' => 'classes/Search.php',
|
||||
@@ -292,6 +292,8 @@
|
||||
'HTMLTemplateOrderSlip' => 'override/classes/pdf/HTMLTemplateOrderSlip.php',
|
||||
'HTMLTemplateSupplyOrderFormCore' => 'classes/pdf/HTMLTemplateSupplyOrderForm.php',
|
||||
'HTMLTemplateSupplyOrderForm' => 'override/classes/pdf/HTMLTemplateSupplyOrderForm.php',
|
||||
'PDFCore' => 'classes/pdf/PDF.php',
|
||||
'PDF' => 'override/classes/pdf/PDF.php',
|
||||
'PDFGeneratorCore' => 'classes/pdf/PDFGenerator.php',
|
||||
'PDFGenerator' => 'override/classes/pdf/PDFGenerator.php',
|
||||
'GroupShopCore' => 'classes/shop/GroupShop.php',
|
||||
@@ -315,6 +317,7 @@
|
||||
'StockMvt' => 'override/classes/stock/StockMvt.php',
|
||||
'StockMvtReasonCore' => 'classes/stock/StockMvtReason.php',
|
||||
'StockMvtReason' => 'override/classes/stock/StockMvtReason.php',
|
||||
'StockMvtWS' => 'classes/stock/StockMvtWS.php',
|
||||
'SupplyOrderCore' => 'classes/stock/SupplyOrder.php',
|
||||
'SupplyOrder' => 'override/classes/stock/SupplyOrder.php',
|
||||
'SupplyOrderDetailCore' => 'classes/stock/SupplyOrderDetail.php',
|
||||
@@ -463,6 +466,7 @@
|
||||
'AdminOrderMessageController' => 'override/controllers/admin/AdminOrderMessageController.php',
|
||||
'AdminOrdersControllerCore' => 'controllers/admin/AdminOrdersController.php',
|
||||
'AdminOrdersController' => 'override/controllers/admin/AdminOrdersController.php',
|
||||
'AdminOutstandingController' => 'controllers/admin/AdminOutstandingController.php',
|
||||
'AdminPPreferencesControllerCore' => 'controllers/admin/AdminPPreferencesController.php',
|
||||
'AdminPPreferencesController' => 'override/controllers/admin/AdminPPreferencesController.php',
|
||||
'AdminPaymentControllerCore' => 'controllers/admin/AdminPaymentController.php',
|
||||
|
||||
@@ -69,6 +69,30 @@ class CustomerCore extends ObjectModel
|
||||
/** @var boolean Opt-in subscription */
|
||||
public $optin;
|
||||
|
||||
/** @var string WebSite **/
|
||||
public $website;
|
||||
|
||||
/** @var string Company */
|
||||
public $company;
|
||||
|
||||
/** @var string SIRET */
|
||||
public $siret;
|
||||
|
||||
/** @var string APE */
|
||||
public $ape;
|
||||
|
||||
/** @var float Outstanding allow amount (B2B opt) */
|
||||
public $outstanding_allow_amount = 0;
|
||||
|
||||
/** @var integer Show public prices (B2B opt) */
|
||||
public $show_public_prices = 0;
|
||||
|
||||
/** @var int Risk ID (B2B opt) */
|
||||
public $id_risk;
|
||||
|
||||
/** @var integer Max payment day */
|
||||
public $max_payment_days = 0;
|
||||
|
||||
/** @var integer Password */
|
||||
public $passwd;
|
||||
|
||||
@@ -140,6 +164,14 @@ class CustomerCore extends ObjectModel
|
||||
'newsletter_date_add' => array('type' => self::TYPE_DATE),
|
||||
'ip_registration_newsletter' => array('type' => self::TYPE_STRING),
|
||||
'optin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'website' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl'),
|
||||
'company' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||
'siret' => array('type' => self::TYPE_STRING, 'validate' => 'isSiret'),
|
||||
'ape' => array('type' => self::TYPE_STRING, 'validate' => 'isApe'),
|
||||
'outstanding_allow_amount' => array('type' => self::TYPE_INT, 'validate' => 'isFloat'),
|
||||
'show_public_prices' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'id_risk' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_payment_days' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'note' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 65000),
|
||||
@@ -693,4 +725,25 @@ class CustomerCore extends ObjectModel
|
||||
$cart = new Cart((int)$cart['id_cart']);
|
||||
return ($cart->nbProducts() === 0 ? (int)$cart->id : false);
|
||||
}
|
||||
|
||||
public function getOutstanding()
|
||||
{
|
||||
$query = new DbQuery();
|
||||
$query->select('SUM(oi.total_paid_tax_incl)')
|
||||
->from('order_invoice', 'oi')
|
||||
->leftJoin('orders', 'o', 'oi.id_order = o.id_order')
|
||||
->groupBy('o.id_customer')
|
||||
->where('o.id_customer = '.(int)$this->id);
|
||||
$total_paid = (float)Db::getInstance()->getValue($query->build());
|
||||
|
||||
$query = new DbQuery();
|
||||
$query->select('SUM(op.amount)')
|
||||
->from('order_payment', 'op')
|
||||
->leftJoin('orders', 'o', 'op.id_order = o.id_order')
|
||||
->groupBy('o.id_customer')
|
||||
->where('o.id_customer = '.(int)$this->id);
|
||||
$total_rest = (float)Db::getInstance()->getValue($query->build());
|
||||
|
||||
return $total_paid - $total_rest;
|
||||
}
|
||||
}
|
||||
@@ -285,6 +285,7 @@ class FrontControllerCore extends Controller
|
||||
'vat_management' => (int)Configuration::get('VATNUMBER_MANAGEMENT'),
|
||||
'opc' => (bool)Configuration::get('PS_ORDER_PROCESS_TYPE'),
|
||||
'PS_CATALOG_MODE' => (bool)Configuration::get('PS_CATALOG_MODE') OR !(bool)Group::getCurrent()->show_prices,
|
||||
'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE')
|
||||
));
|
||||
|
||||
// Deprecated
|
||||
|
||||
@@ -2531,6 +2531,14 @@ class ProductCore extends ObjectModel
|
||||
return Product::getPriceStatic((int)$this->id, $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity);
|
||||
}
|
||||
|
||||
public function getPublicPrice($tax = true, $id_product_attribute = null, $decimals = 6,
|
||||
$divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1)
|
||||
{
|
||||
$specific_price_output = null;
|
||||
return Product::getPriceStatic((int)$this->id, $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity,
|
||||
false, null, null, null, $specific_price_output, true, true, null, false);
|
||||
}
|
||||
|
||||
public function getIdProductAttributeMostExpensive()
|
||||
{
|
||||
if (!Combination::isFeatureActive())
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 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-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 11158 $
|
||||
* @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.0
|
||||
*/
|
||||
class RiskCore extends ObjectModel
|
||||
{
|
||||
public $id_risk;
|
||||
public $name;
|
||||
public $color;
|
||||
public $percent;
|
||||
|
||||
protected $fieldsRequired = array('percent');
|
||||
protected $fieldsSize = array();
|
||||
protected $fieldsValidate = array();
|
||||
protected $fieldsRequiredLang = array('name');
|
||||
protected $fieldsSizeLang = array('name' => 20);
|
||||
protected $fieldsValidateLang = array('name' => 'isString');
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'risk',
|
||||
'primary' => 'id_risk',
|
||||
'multilang' => true,
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
$fields['id_risk'] = (int)$this->id_risk;
|
||||
$fields['color'] = pSQL($this->color);
|
||||
$fields['percent'] = (int)$this->percent;
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check then return multilingual fields for database interaction
|
||||
*
|
||||
* @return array Multilingual fields
|
||||
*/
|
||||
public function getTranslationsFieldsChild()
|
||||
{
|
||||
$this->validateFieldsLang();
|
||||
return $this->getTranslationsFields(array(
|
||||
'name',
|
||||
));
|
||||
}
|
||||
|
||||
public static function getRisks($id_lang = null)
|
||||
{
|
||||
if (is_null($id_lang))
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
$risks = new Collection('Risk', $id_lang);
|
||||
return $risks;
|
||||
}
|
||||
}
|
||||
@@ -226,6 +226,76 @@ class TabCore extends ObjectModel
|
||||
return (isset(self::$_getIdFromClassName[$class_name]) ? (int)self::$_getIdFromClassName[$class_name] : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get collection from module name
|
||||
* @static
|
||||
* @param $module string Module name
|
||||
* @param null $id_lang integer Language ID
|
||||
* @return array|Collection Collection of tabs (or empty array)
|
||||
*/
|
||||
public static function getCollectionFromModule($module, $id_lang = null)
|
||||
{
|
||||
if (is_null($id_lang))
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
if (!Validate::isModuleName($module))
|
||||
return array();
|
||||
|
||||
$tabs = new Collection('Tab', (int)$id_lang);
|
||||
$tabs->where('module', '=', $module);
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enabling tabs for module
|
||||
* @static
|
||||
* @param $module string Module Name
|
||||
* @return bool Status
|
||||
*/
|
||||
public static function enablingForModule($module)
|
||||
{
|
||||
$tabs = self::getCollectionFromModule($module);
|
||||
if (!empty($tabs)) {
|
||||
foreach ($tabs as $tab) {
|
||||
$tab->active = 1;
|
||||
$tab->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disabling tabs for module
|
||||
* @static
|
||||
* @param $module string Module name
|
||||
* @return bool Status
|
||||
*/
|
||||
public static function disablingForModule($module)
|
||||
{
|
||||
$tabs = self::getCollectionFromModule($module);
|
||||
if (!empty($tabs)) {
|
||||
foreach ($tabs as $tab) {
|
||||
$tab->active = 0;
|
||||
$tab->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Instance from tab class name
|
||||
* @static
|
||||
* @param $class_name Name of tab class
|
||||
* @return Tab Tab object (empty if bad id or class name)
|
||||
*/
|
||||
public static function getInstanceFromClassName($class_name)
|
||||
{
|
||||
$id_tab = (int)self::getIdFromClassName($class_name);
|
||||
return new self($id_tab);
|
||||
}
|
||||
|
||||
public static function getNbTabs($id_parent = null)
|
||||
{
|
||||
return (int)Db::getInstance()->getValue('
|
||||
|
||||
@@ -934,5 +934,36 @@ class ValidateCore
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate SIRET Code
|
||||
* @static
|
||||
* @param $siret SIRET Code
|
||||
* @return boolean Return true if is valid
|
||||
*/
|
||||
public static function isSiret($siret)
|
||||
{
|
||||
if (Tools::strlen($siret) != 14)
|
||||
return false;
|
||||
$sum = 0;
|
||||
for($i=0; $i != 14; $i++) {
|
||||
$tmp = ((($i + 1) % 2) + 1) * intval($siret[$i]);
|
||||
if ($tmp >= 10)
|
||||
$tmp -= 9;
|
||||
$sum += $tmp;
|
||||
}
|
||||
return ($sum % 10 === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate APE Code
|
||||
* @static
|
||||
* @param $ape APE Code
|
||||
* @return boolean Return true if is valid
|
||||
*/
|
||||
public static function isApe($ape)
|
||||
{
|
||||
return (bool)preg_match('/^[0-9]{3,4}[a-zA-Z]{1}$/s', $ape);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
'delivery_address' => $formatted_delivery_address,
|
||||
'invoice_address' => $formatted_invoice_address,
|
||||
'tax_excluded_display' => Group::getPriceDisplayMethod($customer->id_default_group),
|
||||
'tax_tab' => $this->getTaxTabContent()
|
||||
'tax_tab' => $this->getTaxTabContent(),
|
||||
'customer' => $customer
|
||||
));
|
||||
|
||||
return $this->smarty->fetch($this->getTemplate($country->iso_code));
|
||||
@@ -109,9 +110,10 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
*/
|
||||
protected function getTemplate($iso_country)
|
||||
{
|
||||
$template = _PS_THEME_DIR_.'/pdf/invoice.tpl';
|
||||
$file = Configuration::get('PS_INVOICE_MODEL');
|
||||
$template = _PS_THEME_DIR_.'/pdf/'.$file.'.tpl';
|
||||
|
||||
$iso_template = _PS_THEME_DIR_.'/pdf/invoice.'.$iso_country.'.tpl';
|
||||
$iso_template = _PS_THEME_DIR_.'/pdf/'.$file.'.'.$iso_country.'.tpl';
|
||||
if (file_exists($iso_template))
|
||||
$template = $iso_template;
|
||||
|
||||
|
||||
@@ -375,6 +375,93 @@ class AdminCustomersControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_B2B_ENABLE')) {
|
||||
$risks = Risk::getRisks();
|
||||
|
||||
$list_risks = array();
|
||||
foreach ($risks as $key => $risk)
|
||||
{
|
||||
$list_risks[$key]['id_risk'] = (int) $risk->id;
|
||||
$list_risks[$key]['name'] = $risk->name;
|
||||
}
|
||||
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Company:'),
|
||||
'name' => 'company',
|
||||
'size' => 33
|
||||
);
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('SIRET:'),
|
||||
'name' => 'siret',
|
||||
'size' => 14
|
||||
);
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('APE:'),
|
||||
'name' => 'ape',
|
||||
'size' => 5
|
||||
);
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Website:'),
|
||||
'name' => 'website',
|
||||
'size' => 33
|
||||
);
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Outstanding allow:'),
|
||||
'name' => 'outstanding_allow_amount',
|
||||
'size' => 10,
|
||||
'hint' => $this->l('Valid characters:').' 0-9',
|
||||
'suffix' => '¤'
|
||||
);
|
||||
/*
|
||||
@todo RC Version
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'radio',
|
||||
'label' => $this->l('Show public prices:'),
|
||||
'name' => 'show_public_prices',
|
||||
'required' => false,
|
||||
'class' => 't',
|
||||
'is_bool' => true,
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'show_public_prices_on',
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'show_public_prices_off',
|
||||
'value' => 0,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
'desc' => $this->l('Show public prices on the front office if specific prices have been set ')
|
||||
);
|
||||
*/
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Max payment days:'),
|
||||
'name' => 'max_payment_days',
|
||||
'size' => 10,
|
||||
'hint' => $this->l('Valid characters:').' 0-9'
|
||||
);
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Risk:'),
|
||||
'name' => 'id_risk',
|
||||
'required' => false,
|
||||
'class' => 't',
|
||||
'options' => array(
|
||||
'query' => $list_risks,
|
||||
'id' => 'id_risk',
|
||||
'name' => 'name'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$this->fields_form['submit'] = array(
|
||||
'title' => $this->l(' Save '),
|
||||
'class' => 'button'
|
||||
|
||||
@@ -62,6 +62,13 @@ class AdminInvoicesControllerCore extends AdminController
|
||||
'type' => 'textareaLang',
|
||||
'cols' => 40,
|
||||
'rows' => 8
|
||||
),
|
||||
'PS_INVOICE_MODEL' => array(
|
||||
'title' => $this->l('Invoice model:'),
|
||||
'desc' => $this->l('Choose an invoice model'),
|
||||
'type' => 'select',
|
||||
'identifier' => 'value',
|
||||
'list' => $this->getInvoicesModels()
|
||||
)
|
||||
),
|
||||
'submit' => array()
|
||||
@@ -240,4 +247,21 @@ class AdminInvoicesControllerCore extends AdminController
|
||||
if ((int)Tools::getValue('PS_INVOICE_START_NUMBER') != 0 && (int)Tools::getValue('PS_INVOICE_START_NUMBER') <= Order::getLastInvoiceNumber())
|
||||
$this->_errors[] = $this->l('Invalid invoice number (must be > ').Order::getLastInvoiceNumber().')';
|
||||
}
|
||||
|
||||
protected function getInvoicesModels()
|
||||
{
|
||||
$models = array(array('value'=>'invoice', 'name'=>'invoice'));
|
||||
$d = dir(_PS_THEME_DIR_.'/pdf/');
|
||||
while (false !== ($entry = $d->read()))
|
||||
{
|
||||
if (preg_match('`^(invoice-[a-z0-9]+)\.tpl$`', $entry, $matches)) {
|
||||
$models[] = array(
|
||||
'value' => $matches[1],
|
||||
'name' => $matches[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
return $models;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 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-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class AdminOutstandingController extends AdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'order_invoice';
|
||||
$this->className = 'OrderInvoice';
|
||||
$this->addRowAction('view');
|
||||
|
||||
$this->context = Context::getContext();
|
||||
|
||||
$this->_select = '`id_order_invoice` AS `id_invoice`,
|
||||
`id_order_invoice` AS `outstanding`,
|
||||
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
|
||||
c.`outstanding_allow_amount`,
|
||||
r.`color`,
|
||||
rl.`name` AS `risk`';
|
||||
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = a.`id_order`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'risk` r ON (r.`id_risk` = c.`id_risk`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'risk_lang` rl ON (r.`id_risk` = rl.`id_risk` AND rl.`id_lang` = '.(int)$this->context->language->id.')';
|
||||
|
||||
$risks = array();
|
||||
foreach (Risk::getRisks() as $risk)
|
||||
{
|
||||
$risks[$risk->id] = $risk->name;
|
||||
}
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'number' => array(
|
||||
'title' => $this->l('Invoice Number'),
|
||||
'align' => 'center',
|
||||
'width' => 20
|
||||
),
|
||||
'date_add' => array(
|
||||
'title' => $this->l('Date'),
|
||||
'width' => 150,
|
||||
'type' => 'date',
|
||||
'align' => 'right'
|
||||
),
|
||||
'customer' => array(
|
||||
'title' => $this->l('Customer'),
|
||||
'filter_key' => 'customer',
|
||||
'tmpTableFilter' => true
|
||||
),
|
||||
'company' => array(
|
||||
'title' => $this->l('Company'),
|
||||
'align' => 'center',
|
||||
'width' => 20
|
||||
),
|
||||
'risk' => array(
|
||||
'title' => $this->l('Risk'),
|
||||
'align' => 'center',
|
||||
'width' => 100,
|
||||
'orderby' => false,
|
||||
'type' => 'select',
|
||||
'color' => 'color',
|
||||
'list' => $risks,
|
||||
'filter_key' => 'r!id_risk',
|
||||
'filter_type' => 'int'
|
||||
),
|
||||
'outstanding_allow_amount' => array(
|
||||
'title' => $this->l('Outstanding Allow'),
|
||||
'align' => 'center',
|
||||
'width' => 50,
|
||||
'prefix' => '<b>',
|
||||
'suffix' => '</b>',
|
||||
'type' => 'price'
|
||||
),
|
||||
'outstanding' => array(
|
||||
'title' => $this->l('Current Outstanding'),
|
||||
'align' => 'center',
|
||||
'width' => 50,
|
||||
'callback' => 'printOutstandingCalculation',
|
||||
'orderby' => false,
|
||||
'search' => false
|
||||
),
|
||||
'id_invoice' => array(
|
||||
'title' => $this->l('PDF'),
|
||||
'width' => 35,
|
||||
'align' => 'center',
|
||||
'callback' => 'printPDFIcons',
|
||||
'orderby' => false,
|
||||
'search' => false
|
||||
)
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toolbar initialisation
|
||||
* @return bool Force true (Hide New button)
|
||||
*/
|
||||
public function initToolbar()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Column callback for print PDF incon
|
||||
* @param $id_invoice integer Invoice ID
|
||||
* @param $tr array Row data
|
||||
* @return string HTML content
|
||||
*/
|
||||
public function printPDFIcons($id_invoice, $tr)
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'id_invoice' => $id_invoice
|
||||
));
|
||||
|
||||
return $this->context->smarty->fetch('outstanding/_print_pdf_icon.tpl');
|
||||
}
|
||||
|
||||
public function printOutstandingCalculation($id_invoice, $tr)
|
||||
{
|
||||
$order_invoice = new OrderInvoice($id_invoice);
|
||||
if (!Validate::isLoadedObject($order_invoice))
|
||||
throw new PrestashopException('object OrderInvoice can\'t be loaded');
|
||||
$order = new Order($order_invoice->id_order);
|
||||
if (!Validate::isLoadedObject($order))
|
||||
throw new PrestashopException('object Order can\'t be loaded');
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
if (!Validate::isLoadedObject($order_invoice))
|
||||
throw new PrestashopException('object Customer can\'t be loaded');
|
||||
|
||||
return '<b>'.$customer->getOutstanding().'</b>';
|
||||
}
|
||||
|
||||
/**
|
||||
* View render
|
||||
* @throws PrestashopException Invalid objects
|
||||
*/
|
||||
public function renderView()
|
||||
{
|
||||
$order_invoice = new OrderInvoice((int) Tools::getValue('id_order_invoice'));
|
||||
if (!Validate::isLoadedObject($order_invoice))
|
||||
throw new PrestashopException('object OrderInvoice can\'t be loaded');
|
||||
$order = new Order($order_invoice->id_order);
|
||||
if (!Validate::isLoadedObject($order))
|
||||
throw new PrestashopException('object Order can\'t be loaded');
|
||||
|
||||
$link = $this->context->link->getAdminLink('AdminOrders');
|
||||
$link .= '&vieworder&id_order='.$order->id;
|
||||
$this->redirect_after = $link;
|
||||
$this->redirect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,13 @@ class AdminPreferencesControllerCore extends AdminController
|
||||
'default' => '480',
|
||||
'visibility' => Shop::CONTEXT_ALL
|
||||
),
|
||||
'PS_B2B_ENABLE' => array(
|
||||
'title' => $this->l('Enable B2B mode'),
|
||||
'desc' => $this->l('Activate or deactivate B2B mode. When this option is enable some features about B2B appear.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_ORDER_PROCESS_TYPE' => array(
|
||||
'title' => $this->l('Order process type'),
|
||||
'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'),
|
||||
@@ -389,4 +396,25 @@ class AdminPreferencesControllerCore extends AdminController
|
||||
$value = ($max_size < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $max_size : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE');
|
||||
Configuration::update('PS_ATTACHMENT_MAXIMUM_SIZE', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update PS_B2B_ENABLE and enables / disables the associated tabs
|
||||
* @param $value integer Value of option
|
||||
*/
|
||||
public function updateOptionPsB2bEnable($value)
|
||||
{
|
||||
$value = (int)$value;
|
||||
|
||||
$tabs_class_name = array('AdminOutstanding');
|
||||
if (!empty($tabs_class_name)) {
|
||||
foreach ($tabs_class_name as $tab_class_name) {
|
||||
$tab = Tab::getInstanceFromClassName($tab_class_name);
|
||||
if (Validate::isLoadedObject($tab)) {
|
||||
$tab->active = $value;
|
||||
$tab->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Configuration::updateValue('PS_B2B_ENABLE', $value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,6 +516,10 @@ CREATE TABLE `PREFIX_customer` (
|
||||
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`id_gender` int(10) unsigned NOT NULL,
|
||||
`id_default_group` int(10) unsigned NOT NULL DEFAULT '1',
|
||||
`id_risk` int(10) unsigned NOT NULL DEFAULT '1',
|
||||
`company` varchar(64),
|
||||
`siret` varchar(14),
|
||||
`ape` varchar(5),
|
||||
`firstname` varchar(32) NOT NULL,
|
||||
`lastname` varchar(32) NOT NULL,
|
||||
`email` varchar(128) NOT NULL,
|
||||
@@ -526,6 +530,10 @@ CREATE TABLE `PREFIX_customer` (
|
||||
`ip_registration_newsletter` varchar(15) default NULL,
|
||||
`newsletter_date_add` datetime default NULL,
|
||||
`optin` tinyint(1) unsigned NOT NULL default '0',
|
||||
`website` varchar(128),
|
||||
`outstanding_allow_amount` DECIMAL( 10,6 ) NOT NULL default '0.00',
|
||||
`show_public_prices` tinyint(1) unsigned NOT NULL default '0',
|
||||
`max_payment_days` int(10) unsigned NOT NULL default '60',
|
||||
`secure_key` varchar(32) NOT NULL default '-1',
|
||||
`note` text,
|
||||
`active` tinyint(1) unsigned NOT NULL default '0',
|
||||
@@ -2339,3 +2347,18 @@ CREATE TABLE `PREFIX_specific_price_rule_condition` (
|
||||
PRIMARY KEY (`id_specific_price_rule_condition`),
|
||||
INDEX (`id_specific_price_rule_condition_group`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_risk` (
|
||||
`id_risk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`percent` tinyint(3) NOT NULL,
|
||||
`color` varchar(32) NULL,
|
||||
PRIMARY KEY (`id_risk`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_risk_lang` (
|
||||
`id_risk` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(20) NOT NULL,
|
||||
PRIMARY KEY (`id_risk`,`id_lang`),
|
||||
KEY `id_risk` (`id_risk`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
@@ -339,7 +339,9 @@ INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_a
|
||||
(162, 'PS_UNIDENTIFIED_GROUP', '1', NOW(), NOW()),
|
||||
(163, 'PS_GUEST_GROUP', '2', NOW(), NOW()),
|
||||
(164, 'PS_CUSTOMER_GROUP', '3', NOW(), NOW()),
|
||||
(165, 'PS_SMARTY_CONSOLE', 0, NOW(), NOW());
|
||||
(165, 'PS_SMARTY_CONSOLE', 0, NOW(), NOW()),
|
||||
(166, 'PS_B2B_ENABLE', '0', NOW(), NOW()),
|
||||
(167, 'PS_INVOICE_MODEL', 'invoice', NOW(), NOW());
|
||||
|
||||
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES
|
||||
(36, 1, 'IN', NOW()),(36, 2, 'FA', NOW()),(36, 3, 'CU', NOW()),(36, 4, 'FA', NOW()),(36, 5, 'FA', NOW()),
|
||||
@@ -931,6 +933,7 @@ INSERT INTO `PREFIX_contact_lang` (`id_contact`, `id_lang`, `name`, `description
|
||||
INSERT INTO `PREFIX_profile` (`id_profile`) VALUES (1);
|
||||
INSERT INTO `PREFIX_profile_lang` (`id_profile`, `id_lang`, `name`) VALUES (1, 1, 'SuperAdmin'),(1, 2, 'SuperAdmin'),(1, 3, 'SuperAdmin'),(1, 4, 'SuperAdmin'),(1, 5, 'SuperAdmin');
|
||||
|
||||
/* Active tabs */
|
||||
INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUES (1, 'AdminCatalog', 0, 1),(2, 'AdminCustomers', 0, 2),(3, 'AdminOrders', 0, 3),
|
||||
(4, 'AdminPayment', 0, 4),(5, 'AdminShipping', 0, 5),(6, 'AdminStats', 0, 6),(7, 'AdminModules', 0, 7),(29, 'AdminEmployees', 0, 8),(8, 'AdminPreferences', 0, 9),
|
||||
(9, 'AdminTools', 0, 10),(82, 'AdminStores', 9, 11),(60, 'AdminTracking', 1, 3),(10, 'AdminManufacturers', 1, 4),(34, 'AdminSuppliers', 1, 5),(11, 'AdminAttributesGroups', 1, 6),
|
||||
@@ -966,6 +969,9 @@ INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUE
|
||||
(108, 'AdminStockConfiguration', 95, 7),
|
||||
(109, 'AdminSpecificPriceRule', 1, 11);
|
||||
|
||||
/* Inactive tabs */
|
||||
INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`, `active`) VALUES (110, 'AdminOutstanding', 2, 5, 0);
|
||||
|
||||
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) (SELECT 1, id_tab, 1, 1, 1, 1 FROM `PREFIX_tab`);
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
@@ -997,7 +1003,8 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(1, 105, 'CMS categories'),
|
||||
(1, 106, 'CMS pages'),
|
||||
(1, 108, 'Configuration'),
|
||||
(1, 109, 'Catalog price rules');
|
||||
(1, 109, 'Catalog price rules'),
|
||||
(1, 110, 'Outstanding');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(2, 1, 'Catalogue'),(2, 2, 'Clients'),(2, 3, 'Commandes'),(2, 4, 'Paiement'),(2, 5, 'Transport'),
|
||||
@@ -1028,7 +1035,8 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(2, 105, 'Catégories CMS'),
|
||||
(2, 106, 'Pages CMS'),
|
||||
(2, 108, 'Configuration'),
|
||||
(2, 109, 'Règles de prix catalogue');
|
||||
(2, 109, 'Règles de prix catalogue'),
|
||||
(2, 110, 'Encours');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(3, 1, 'Catálogo'),(3, 2, 'Clientes'),(3, 3, 'Pedidos'),(3, 4, 'Pago'),(3, 5, 'Transporte'),
|
||||
@@ -1058,7 +1066,8 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(3, 105, 'CMS categories'),
|
||||
(3, 106, 'CMS pages'),
|
||||
(3, 108, 'Configuration'),
|
||||
(3, 110, 'Catalog price rules');
|
||||
(3, 109, 'Catalog price rules'),
|
||||
(3, 110, 'Outstanding');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(4, 1, 'Katalog'),(4, 2, 'Kunden'),(4, 3, 'Bestellungen'),(4, 4, 'Zahlung'),
|
||||
@@ -1089,7 +1098,8 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(4, 105, 'CMS categories'),
|
||||
(4, 106, 'CMS pages'),
|
||||
(4, 108, 'Configuration'),
|
||||
(4, 109, 'Catalog price rules');
|
||||
(4, 109, 'Catalog price rules'),
|
||||
(4, 110, 'Outstanding');
|
||||
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(5, 1, 'Catalogo'),(5, 2, 'Clienti'),(5, 3, 'Ordini'),(5, 4, 'Pagamento'),
|
||||
@@ -1120,7 +1130,8 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(5, 105, 'CMS categories'),
|
||||
(5, 106, 'CMS pages'),
|
||||
(5, 108, 'Configuration'),
|
||||
(5, 109, 'Catalog price rules');
|
||||
(5, 109, 'Catalog price rules'),
|
||||
(5, 110, 'Outstanding');
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`)
|
||||
(SELECT `id_tab`, id_lang, (SELECT tl.`name`
|
||||
@@ -1606,3 +1617,31 @@ INSERT INTO `PREFIX_supply_order_state_lang` (`id_supply_order_state`, `id_lang`
|
||||
(6, 3, 'order fenced'),
|
||||
(6, 4, 'order fenced'),
|
||||
(6, 5, 'order fenced');
|
||||
|
||||
INSERT INTO `PREFIX_risk` (`id_risk`, `percent`, `color`) VALUES
|
||||
(1, 0, 'LimeGreen'),
|
||||
(2, 35, 'DarkOrange'),
|
||||
(3, 75, 'Crimson'),
|
||||
(4, 100, '#ec2e15');
|
||||
|
||||
INSERT INTO `PREFIX_risk_lang` (`id_risk`, `id_lang`, `name`) VALUES
|
||||
(1, 1, 'None'),
|
||||
(2, 1, 'Low'),
|
||||
(3, 1, 'Middle'),
|
||||
(4, 1, 'Hight'),
|
||||
(1, 2, 'Aucun'),
|
||||
(2, 2, 'Faible'),
|
||||
(3, 2, 'Moyen'),
|
||||
(4, 2, 'Élevé'),
|
||||
(1, 3, 'None'),
|
||||
(2, 3, 'Low'),
|
||||
(3, 3, 'Middle'),
|
||||
(4, 3, 'Hight'),
|
||||
(1, 4, 'None'),
|
||||
(2, 4, 'Low'),
|
||||
(3, 4, 'Middle'),
|
||||
(4, 4, 'Hight'),
|
||||
(1, 5, 'None'),
|
||||
(2, 5, 'Low'),
|
||||
(3, 5, 'Middle'),
|
||||
(4, 5, 'Hight');
|
||||
@@ -295,7 +295,7 @@ DELETE FROM `PREFIX_configuration` WHERE `name` = 'PS_PDF_FONT';
|
||||
ALTER TABLE `PREFIX_order_detail`
|
||||
ADD `reduction_amount_tax_incl` FLOAT( 20.6 ) NOT NULL AFTER `reduction_amount` ,
|
||||
ADD `reduction_amount_tax_excl` FLOAT( 20.6 ) NOT NULL AFTER `reduction_amount_tax_incl`,
|
||||
ADD `total_price_tax_incl` DECIMAL(20, 6) NOT NULL AFTER `download_deadline`,
|
||||
ADD `total_price_tax_incl` DECIMAL(20, 6) NOT NULL AFTER `download_deadline`,,
|
||||
ADD `total_price_tax_excl` DECIMAL(20, 6) NOT NULL AFTER `total_price_tax_incl`,
|
||||
ADD `unit_price_tax_incl` DECIMAL(20, 6) NOT NULL AFTER `total_price_tax_excl`,
|
||||
ADD `unit_price_tax_excl` DECIMAL(20, 6) NOT NULL AFTER `unit_price_tax_incl`,
|
||||
@@ -391,12 +391,11 @@ INSERT INTO `PREFIX_order_payment` (`id_order_invoice`, `id_order`, `id_currency
|
||||
)
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES
|
||||
('PS_SMARTY_CONSOLE', '0', NOW(), NOW());
|
||||
('PS_SMARTY_CONSOLE', '0', NOW(), NOW(),('PS_INVOICE_MODEL', 'invoice', NOW(), NOW());
|
||||
ALTER TABLE `PREFIX_specific_price` ADD `id_cart` INT(11) UNSIGNED NOT NULL AFTER `id_specific_price_rule`;
|
||||
ALTER TABLE `PREFIX_specific_price` ADD INDEX `id_cart` (`id_cart`);
|
||||
/* PHP:update_modules_multishop.php; */;
|
||||
|
||||
|
||||
UPDATE `PREFIX_tab`
|
||||
SET `position` = (
|
||||
SELECT MAX(`position`)+1
|
||||
@@ -411,8 +410,4 @@ SET `position` = (
|
||||
FROM `PREFIX_tab`
|
||||
WHERE `id_parent` = 0
|
||||
)
|
||||
WHERE `class_name` = 'AdminAccounting';
|
||||
|
||||
ALTER TABLE `PREFIX_order_slip_detail` CHANGE `amount` `amount_tax_excl` DECIMAL( 10, 2 ) NOT NULL;
|
||||
ALTER TABLE `PREFIX_order_slip_detail` ADD COLUMN `amount_tax_incl` DECIMAL(10,2) NOT NULL AFTER `amount_tax_excl`;
|
||||
|
||||
WHERE `class_name` = 'AdminAccounting';
|
||||
@@ -450,6 +450,27 @@ $(function(){ldelim}
|
||||
</p>
|
||||
{/if}
|
||||
</fieldset>
|
||||
{if $b2b_enable}
|
||||
<fieldset class="account_creation">
|
||||
<h3>{l s='Your company informations'}</h3>
|
||||
<p class="text">
|
||||
<label for="">{l s='Company'}</label>
|
||||
<input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
|
||||
</p>
|
||||
<p class="text">
|
||||
<label for="siret">{l s='SIRET'}</label>
|
||||
<input type="text" class="text" id="siret" name="siret" value="{if isset($smarty.post.siret)}{$smarty.post.siret}{/if}" />
|
||||
</p>
|
||||
<p class="text">
|
||||
<label for="ape">{l s='APE'}</label>
|
||||
<input type="text" class="text" id="ape" name="ape" value="{if isset($smarty.post.ape)}{$smarty.post.ape}{/if}" />
|
||||
</p>
|
||||
<p class="text">
|
||||
<label for="website">{l s='Website'}</label>
|
||||
<input type="text" class="text" id="website" name="website" value="{if isset($smarty.post.website)}{$smarty.post.website}{/if}" />
|
||||
</p>
|
||||
</fieldset>
|
||||
{/if}
|
||||
{if isset($PS_REGISTRATION_PROCESS_TYPE) && $PS_REGISTRATION_PROCESS_TYPE}
|
||||
<fieldset class="account_creation">
|
||||
<h3>{l s='Your address'}</h3>
|
||||
|
||||
Executable
+293
@@ -0,0 +1,293 @@
|
||||
{*
|
||||
* 2007-2011 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 <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 6753 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<div style="font-size: 8pt; color: #444">
|
||||
|
||||
<table>
|
||||
<tr><td> </td></tr>
|
||||
</table>
|
||||
|
||||
<!-- ADDRESSES -->
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 15%"></td>
|
||||
<td style="width: 85%">
|
||||
{if !empty($delivery_address)}
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Delivery Address' pdf='true'}</span><br />
|
||||
{$delivery_address}
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing Address' pdf='true'}</span><br />
|
||||
{$invoice_address}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{else}
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<span style="font-weight: bold; font-size: 10pt; color: #9E9F9E">{l s='Billing & Delivery Address.' pdf='true'}</span><br />
|
||||
{$invoice_address}
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- / ADDRESSES -->
|
||||
|
||||
<div style="line-height: 1pt"> </div>
|
||||
|
||||
{if $customer->siret or $customer->ape}
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 15%"></td>
|
||||
<td style="width: 85%">
|
||||
{if $customer->siret}
|
||||
<b>{l s='Company:'}</b> {$customer->company}
|
||||
{/if}
|
||||
{if $customer->siret}
|
||||
<br />
|
||||
<b>{l s='SIRET:'}</b> {$customer->siret}
|
||||
{/if}
|
||||
{if $customer->ape}
|
||||
<br />
|
||||
<b>{l s='APE:'}</b> {$customer->ape}
|
||||
{/if}
|
||||
</td>
|
||||
<td style="width: 15%"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- / B2B -->
|
||||
{/if}
|
||||
|
||||
<div style="line-height: 1pt"> </div>
|
||||
|
||||
<!-- PRODUCTS TAB -->
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 15%; padding-right: 7px; text-align: right; vertical-align: top; font-size: 7pt;">
|
||||
<!-- CUSTOMER INFORMATIONS -->
|
||||
<b>{l s='Order Number:' pdf='true'}</b><br />
|
||||
{'%06d'|sprintf:$order->id}<br />
|
||||
<br />
|
||||
<b>{l s='Order Date:' pdf='true'}</b><br />
|
||||
{$order->date_add|date_format:"%d-%m-%Y %H:%M"}<br />
|
||||
<br />
|
||||
<b>{l s='Payment Method:' pdf='true'}</b><br />
|
||||
<table style="width: 100%;">
|
||||
{foreach from=$order_invoice->getOrderPaymentCollection() item=payment}
|
||||
<tr>
|
||||
<td style="width: 50%">{$payment->payment_method}</td>
|
||||
<td style="width: 50%">{displayPrice price=$payment->amount currency=$order->id_currency}</td>
|
||||
</tr>
|
||||
{foreachelse}
|
||||
<tr>
|
||||
<td>{l s='No payment'}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
<br />
|
||||
<!-- / CUSTOMER INFORMATIONS -->
|
||||
</td>
|
||||
<td style="width: 85%; text-align: right">
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr style="line-height:4px;">
|
||||
<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 45%">{l s='Product / Reference' pdf='true'}</td>
|
||||
<!-- unit price tax excluded is mandatory -->
|
||||
{if !$tax_excluded_display}
|
||||
<td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;; width: 10%">{l s='Unit Price' pdf='true'} <br />{l s='(Tax Excl.)' pdf='true'}</td>
|
||||
{/if}
|
||||
<td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;; width: 10%">{l s='Unit Price' pdf='true'}</td>
|
||||
<td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;; width: 10%">{l s='Discount' pdf='true'}</td>
|
||||
<td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 10%">{l s='Qty' pdf='true'}</td>
|
||||
<td style="background-color: #4D4D4D; color: #FFF; text-align: right; font-weight: bold;; width: 15%">{l s='Total' pdf='true'}</td>
|
||||
</tr>
|
||||
{foreach $order_details as $order_detail}
|
||||
{cycle values='#FFF,#DDD' assign=bgcolor}
|
||||
<tr style="line-height:6px;background-color:{$bgcolor};">
|
||||
<td style="text-align: left; width: 45%">{$order_detail.product_name}</td>
|
||||
<!-- unit price tax excluded is mandatory -->
|
||||
{if !$tax_excluded_display}
|
||||
<td style="text-align: right; width: 10%">
|
||||
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
|
||||
</td>
|
||||
{/if}
|
||||
<td style="text-align: right; width: 10%">
|
||||
{if $tax_excluded_display}
|
||||
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl}
|
||||
{else}
|
||||
{displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
<td style="text-align: right; width: 10%">
|
||||
{if (isset($order_detail.reduction_amount) && $order_detail.reduction_amount > 0)}
|
||||
-{displayPrice currency=$order->id_currency price=$order_detail.reduction_amount}
|
||||
{else if (isset($order_detail.reduction_percent) && $order_detail.reduction_percent > 0)}
|
||||
-{$order_detail.reduction_percent}%
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td style="text-align: center; width: 10%">{$order_detail.product_quantity}</td>
|
||||
<td style="width: 15%; text-align: right; width: 15%">
|
||||
{if $tax_excluded_display}
|
||||
{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_excl}
|
||||
{else}
|
||||
{displayPrice currency=$order->id_currency price=$order_detail.total_price_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{foreach $order_detail.customizedDatas as $customization}
|
||||
<tr style="line-height:6px;background-color:{$bgcolor}; ">
|
||||
<td style="line-height:3px; text-align: left; width: 60%; vertical-align: top">
|
||||
{foreach $customization.datas as $customization_types}
|
||||
<blockquote>
|
||||
{foreach $customization_types as $customization_infos name=custo_foreach}
|
||||
{$customization_infos.name}: {$customization_infos.value}
|
||||
{if !$smarty.foreach.custo_foreach.last}<br />
|
||||
{else}
|
||||
<div style="line-height:0.4pt"> </div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</blockquote>
|
||||
{/foreach}
|
||||
</td>
|
||||
<td style="text-align: right; width: 15%"></td>
|
||||
<td style="text-align: center; width: 10%; vertical-align: top">({$customization.quantity})</td>
|
||||
<td style="width: 15%; text-align: right;"></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
{if (($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl) > 0)}
|
||||
<tr style="line-height:5px;">
|
||||
<td style="width: 85%; text-align: right; font-weight: bold">{l s='Product Total (Tax Excl.)' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products}</td>
|
||||
</tr>
|
||||
|
||||
<tr style="line-height:5px;">
|
||||
<td style="width: 85%; text-align: right; font-weight: bold">{l s='Product Total (Tax Incl.)' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products_wt}</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr style="line-height:5px;">
|
||||
<td style="width: 85%; text-align: right; font-weight: bold">{l s='Product Total' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_products}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $order_invoice->total_discount_tax_incl > 0}
|
||||
<tr style="line-height:5px;">
|
||||
<td style="text-align: right; font-weight: bold">{l s='Total Vouchers' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">-{displayPrice currency=$order->id_currency price=$order_invoice->total_discount_tax_incl}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $order_invoice->total_wrapping_tax_incl > 0}
|
||||
<tr style="line-height:5px;">
|
||||
<td style="text-align: right; font-weight: bold">{l s='Wrapping Cost' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">
|
||||
{if $tax_excluded_display}
|
||||
{displayPrice currency=$order->id_currency price=$order_invoice->total_wrapping_tax_excl}
|
||||
{else}
|
||||
{displayPrice currency=$order->id_currency price=$order_invoice->total_wrapping_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $order_invoice->total_shipping_tax_incl > 0}
|
||||
<tr style="line-height:5px;">
|
||||
<td style="text-align: right; font-weight: bold">{l s='Shipping Cost' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">
|
||||
{if $tax_excluded_display}
|
||||
{displayPrice currency=$order->id_currency price=$order_invoice->total_shipping_tax_excl}
|
||||
{else}
|
||||
{displayPrice currency=$order->id_currency price=$order_invoice->total_shipping_tax_incl}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if ($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl) > 0}
|
||||
<tr style="line-height:5px;">
|
||||
<td style="text-align: right; font-weight: bold">{l s='Total Tax' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=($order_invoice->total_paid_tax_incl - $order_invoice->total_paid_tax_excl)}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr style="line-height:5px;">
|
||||
<td style="text-align: right; font-weight: bold">{l s='Total' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_paid_tax_incl}</td>
|
||||
</tr>
|
||||
|
||||
{if $order_invoice->getRestPaid()}
|
||||
<tr style="line-height:5px;color:red;">
|
||||
<td style="text-align: right; font-weight: bold">{l s='Total rest paid' pdf='true'}</td>
|
||||
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->getRestPaid()}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- / PRODUCTS TAB -->
|
||||
|
||||
<div style="line-height: 1pt"> </div>
|
||||
|
||||
{$tax_tab}
|
||||
|
||||
{if isset($order_invoice->note) && $order_invoice->note}
|
||||
<div style="line-height: 1pt"> </div>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 15%"></td>
|
||||
<td style="width: 85%">{$order_invoice->note|nl2br}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
{if isset($HOOK_DISPLAY_PDF)}
|
||||
<div style="line-height: 1pt"> </div>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 15%"></td>
|
||||
<td style="width: 85%">{$HOOK_DISPLAY_PDF}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user