diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css
index 3566fe03e..0dfb19d6d 100644
--- a/admin-dev/themes/default/css/admin.css
+++ b/admin-dev/themes/default/css/admin.css
@@ -345,7 +345,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
#statsContainer #calendar p, #referrersContainer #calendar p { margin:2px;}
#statsContainer #calendar p span, #referrersContainer #calendar p span { float:left; display:block; padding:3px;}
#statsContainer .blocStats { background-color: #EBEDF4;border: 1px solid #C2C4D9; display: block; position:relative; padding: 10px;}
-#statsContainer .blocStats h2 { font-weight:normal; margin:0;}
+#statsContainer .blocStats h2 { font-weight:normal; margin:0; font-size:1.4em}
#statsContainer .blocStats h2.icon-statsproduct span,
#statsContainer .blocStats h2.icon-statsbestsuppliers span,
#statsContainer .blocStats h2.icon-statsforecast span,
@@ -493,4 +493,8 @@ ul.listForm li {padding-bottom:3px;}
.selected-line {background:#fff1b5;}
-#changedFiles ul{list-style-type: square; padding-left: 40px;}
\ No newline at end of file
+#changedFiles ul{list-style-type: square; padding-left: 40px;}
+
+#account_list { background-color: #EBEDF4;border: 1px solid #C2C4D9; display: block; position:relative; padding: 10px;}
+#account_list h2 { font-weight:normal; margin:0; font-size: 1.4em; padding-bottom:10px;}
+#account_list table td, table th {width:100px;}
diff --git a/admin-dev/themes/default/template/controllers/accounting_management/content.tpl b/admin-dev/themes/default/template/controllers/accounting_management/content.tpl
index a8bcc79d6..3cbb4e3cd 100644
--- a/admin-dev/themes/default/template/controllers/accounting_management/content.tpl
+++ b/admin-dev/themes/default/template/controllers/accounting_management/content.tpl
@@ -31,7 +31,9 @@
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
- {$title|default:' '}
+
+ {$title|default:' '}
+
diff --git a/admin-dev/themes/default/template/controllers/accounting_registered_number/content.tpl b/admin-dev/themes/default/template/controllers/accounting_registered_number/content.tpl
new file mode 100644
index 000000000..ad20194c9
--- /dev/null
+++ b/admin-dev/themes/default/template/controllers/accounting_registered_number/content.tpl
@@ -0,0 +1,65 @@
+{*
+* 2007-2012 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-2012 PrestaShop SA
+* @version Release: $Revision: 9856 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+
+
+
+ {foreach from=$account_number_list item=detail key=name}
+
{$detail['title']}
+ {if $detail['list']|count}
+
+
+ {if $detail['list']|count}
+ {foreach from=$detail['fields'] item=col_name key=sql_name}
+ | {$col_name} |
+ {/foreach}
+ {/if}
+
+
+ {foreach from=$detail['list'] item=row key=row_number}
+
+ {foreach from=$row item=value key=value_num}
+ | {$value} |
+ {/foreach}
+
+ {/foreach}
+
+
+ {else}
+
{l s='No defined account number for this list'}
+ {/if}
+
+ {/foreach}
+
diff --git a/classes/Customer.php b/classes/Customer.php
index d2d85dc1d..94a83aaec 100644
--- a/classes/Customer.php
+++ b/classes/Customer.php
@@ -133,6 +133,8 @@ class CustomerCore extends ObjectModel
public $groupBox;
+ public $account_number;
+
protected $webserviceParameters = array(
'fields' => array(
'id_default_group' => array('xlink_resource' => 'groups'),
@@ -169,6 +171,7 @@ class CustomerCore extends ObjectModel
'optin' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'website' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl'),
'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
+ 'account_number' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 65000, 'copy_from_front' => false),
'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', 'copy_post' => false),
@@ -756,4 +759,4 @@ class CustomerCore extends ObjectModel
$this->addGroups($groups);
return true;
}
-}
\ No newline at end of file
+}
diff --git a/controllers/admin/AdminAccountingManagementController.php b/controllers/admin/AdminAccountingManagementController.php
index 07db34892..eeb6750a8 100644
--- a/controllers/admin/AdminAccountingManagementController.php
+++ b/controllers/admin/AdminAccountingManagementController.php
@@ -73,9 +73,9 @@ class AdminAccountingManagementControllerCore extends AdminController
'title' => $this->l('Accounting Management'),
'table' => 'accounting'
));
- parent::initContent();
+ parent::initContent();
}
-
+
/**
* AdminController::init() override
* @see AdminController::postProcess()
@@ -135,4 +135,4 @@ class AdminAccountingManagementControllerCore extends AdminController
}
}
-}
\ No newline at end of file
+}
diff --git a/controllers/admin/AdminAccountingRegisteredNumberController.php b/controllers/admin/AdminAccountingRegisteredNumberController.php
new file mode 100644
index 000000000..936a69dfe
--- /dev/null
+++ b/controllers/admin/AdminAccountingRegisteredNumberController.php
@@ -0,0 +1,156 @@
+
+* @copyright 2007-2012 PrestaShop SA
+* @version Release: $Revision: 9841 $
+* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+class AdminAccountingRegisteredNumberControllerCore extends AdminController
+{
+ public $account_number_list = array();
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->className = 'Accounting';
+ $id_lang = $this->context->language->id;
+
+ // p. => main table, s. => join table
+ // Contains rules to build sql query
+ $this->account_number_list = array(
+ // Product definition
+ 'product' => array(
+ 'table' => 'accounting_product_zone_shop',
+ 'fields' => array(
+ 'p.account_number' => $this->l('Account number'),
+ 'COUNT(*) AS total' => $this->l('Number of product associated to this account')
+ ),
+ 'group_by' => 'account_number',
+ 'condition' => 'p.account_number <> ""',
+ 'title' => $this->l('Product account number list'),
+ 'list' => array()),
+
+ // Taxes definition
+ 'taxes' => array(
+ 'table' => 'tax',
+ 'fields' => array(
+ 'account_number' => $this->l('Account number'),
+ 'COUNT(*) AS total' => $this->l('Number of taxes associated to this account')
+ ),
+ 'group_by' => 'account_number',
+ 'condition' => 'account_number <> ""',
+ 'title' => $this->l('Taxes Account number list'),
+ 'list' => array()),
+
+ // Gift wrapping definition, for now Only one available using Configuration
+ 'gift_wrapping' => array(
+ 'table' => '',
+ 'fields' => array(
+ 'account_number' => $this->l('Account number'),
+ 'total' => $this->l('Number of gift-wrapping associated to this account')
+ ),
+ 'condition' => 'account_number <> ""',
+ 'group_by' => 'account_number',
+ 'title' => $this->l('Gift wrapping account number list'),
+ 'list' => array()),
+
+ // Customer definition
+ 'customer' => array(
+ 'table' => 'customer',
+ 'fields' => array(
+ 'account_number' => $this->l('Account number'),
+ 'firstname' => $this->l('First name'),
+ 'lastname' => $this->l('Last name')
+ ),
+ 'group_by' => 'account_number',
+ 'condition' => 'account_number <> ""',
+ 'title' => $this->l('Customer account number list'),
+ 'list' => array()),
+
+ // Zone shop definition
+ 'zone_shop' => array(
+ 'table' => 'accounting_zone_shop',
+ 'fields' => array(
+ 'p.account_number' => $this->l('Account number'),
+ 'COUNT(*) AS total' => $this->l('Number of zone associated to this account')
+ ),
+ 'group_by' => 'account_number',
+ 'condition' => 'account_number <> ""',
+ 'title' => $this->l('Zone shop account number list'),
+ 'list' => array())
+ );
+ }
+
+ public function initToolbar()
+ {
+ $this->initToolbarTitle();
+ $this->toolbar_btn = array();
+
+ }
+
+ public function initContent()
+ {
+ $this->initToolbar();
+ $this->initAccountNumberList();
+ }
+
+ public function initAccountNumberList()
+ {
+ foreach ($this->account_number_list as $name => &$detail)
+ {
+ if (isset($detail['table']) && !empty($detail['table']))
+ {
+ $join = '';
+
+ if (isset($detail['left_join']))
+ {
+ $join = 'LEFT JOIN '._DB_PREFIX_.$detail['left_join']['table'].' s ON (';
+ foreach ($detail['left_join']['on'] as $on)
+ $join .= 'p.'.$on.' = s.'.$on.' AND ';
+ $join = rtrim($join, ' AND ').')';
+ }
+
+ $query = 'SELECT '.implode(', ', array_keys($detail['fields'])).'
+ FROM `'._DB_PREFIX_.$detail['table'].'` p '.$join.'
+ WHERE '.$detail['condition'];
+
+ if (isset($detail['group_by']))
+ $query .= ' GROUP BY '.$detail['group_by'];
+
+ $detail['list'] = Db::getInstance()->executeS($query);
+ }
+ }
+
+ $num = Configuration::get('PS_GIFT_WRAPPING_ACCOUNT_NUMBER');
+ if (!empty($num))
+ $this->account_number_list['gift_wrapping']['list'][] = array($num, '1');
+
+ $this->context->smarty->assign(array(
+ 'toolbar_btn' => $this->toolbar_btn,
+ 'title' => $this->l('Accounting Plan'),
+ 'account_number_list' => $this->account_number_list));
+
+ parent::initContent();
+ }
+}
diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php
index 3018e634b..c5abd5c25 100644
--- a/controllers/admin/AdminCustomersController.php
+++ b/controllers/admin/AdminCustomersController.php
@@ -290,6 +290,14 @@ class AdminCustomersControllerCore extends AdminController
'required' => ($obj->id ? false : true),
'desc' => ($obj->id ? $this->l('Leave blank if no change') : $this->l('5 characters min., only letters, numbers, or').' -_')
),
+ array(
+ 'type' => 'text',
+ 'label' => $this->l('Accounting number:'),
+ 'name' => 'account_number',
+ 'size' => 33,
+ 'required' => false,
+ 'desc' => $this->l('Used for the accounting export')
+ ),
array(
'type' => 'birthday',
'label' => $this->l('Birthday:'),
diff --git a/controllers/admin/AdminPreferencesController.php b/controllers/admin/AdminPreferencesController.php
index 4db22728d..382e0df0e 100644
--- a/controllers/admin/AdminPreferencesController.php
+++ b/controllers/admin/AdminPreferencesController.php
@@ -249,6 +249,14 @@ class AdminPreferencesControllerCore extends AdminController
'list' => $taxes,
'identifier' => 'id'
),
+ 'PS_GIFT_WRAPPING_ACCOUNT_NUMBER' => array(
+ 'title' => $this->l('Gift-wrapping account number'),
+ 'desc' => $this->l('Set an account number for your gift-wrapping (used for accounting)'),
+ 'validation' => 'isString',
+ 'type' => 'text',
+ 'size' => 30,
+ ),
+
'PS_ATTACHMENT_MAXIMUM_SIZE' => array(
'title' => $this->l('Attachment maximum size'),
'desc' => $this->l('Set the maximum size of attachment files (in MegaBytes).').' '.$this->l('Maximum:').' '.
diff --git a/install-dev/data/db_structure.sql b/install-dev/data/db_structure.sql
index 347936ccd..7a3dc0e9d 100644
--- a/install-dev/data/db_structure.sql
+++ b/install-dev/data/db_structure.sql
@@ -542,6 +542,7 @@ CREATE TABLE `PREFIX_customer` (
`passwd` varchar(32) NOT NULL,
`last_passwd_gen` timestamp NOT NULL default CURRENT_TIMESTAMP,
`birthday` date default NULL,
+ `account_number` varchar(128) NOT NULL,
`newsletter` tinyint(1) unsigned NOT NULL default '0',
`ip_registration_newsletter` varchar(15) default NULL,
`newsletter_date_add` datetime default NULL,
diff --git a/install-dev/data/xml/tab.xml b/install-dev/data/xml/tab.xml
index 04fa3433b..37e805bd4 100644
--- a/install-dev/data/xml/tab.xml
+++ b/install-dev/data/xml/tab.xml
@@ -9,7 +9,7 @@
AdminHome
-
+
AdminLogin
@@ -177,6 +177,21 @@
AdminModulesPositions
+
+ AdminProfiles
+
+
+ AdminAccess
+
+
+ AdminContacts
+
+
+ AdminTabs
+
+
+ AdminCustomerThreads
+
AdminContact
@@ -252,21 +267,6 @@
AdminRequestSql
-
- AdminProfiles
-
-
- AdminAccess
-
-
- AdminContacts
-
-
- AdminTabs
-
-
- AdminCustomerThreads
-
AdminGroupShop
@@ -300,5 +300,8 @@
AdminAccountingExport
+
+ AdminAccountingRegisteredNumber
+
diff --git a/install-dev/langs/de/data/tab.xml b/install-dev/langs/de/data/tab.xml
index 597185265..6756b2f8a 100644
--- a/install-dev/langs/de/data/tab.xml
+++ b/install-dev/langs/de/data/tab.xml
@@ -1,7 +1,7 @@
-
+
@@ -57,6 +57,11 @@
+
+
+
+
+
@@ -82,11 +87,6 @@
-
-
-
-
-
@@ -98,4 +98,5 @@
+
diff --git a/install-dev/langs/en/data/tab.xml b/install-dev/langs/en/data/tab.xml
index 9f9aaf6fc..36dda8195 100644
--- a/install-dev/langs/en/data/tab.xml
+++ b/install-dev/langs/en/data/tab.xml
@@ -1,7 +1,7 @@
-
+
@@ -57,6 +57,11 @@
+
+
+
+
+
@@ -82,11 +87,6 @@
-
-
-
-
-
@@ -98,4 +98,5 @@
+
diff --git a/install-dev/langs/es/data/tab.xml b/install-dev/langs/es/data/tab.xml
index 9df62385e..dde14d97a 100644
--- a/install-dev/langs/es/data/tab.xml
+++ b/install-dev/langs/es/data/tab.xml
@@ -1,7 +1,7 @@
-
+
@@ -57,6 +57,11 @@
+
+
+
+
+
@@ -82,11 +87,6 @@
-
-
-
-
-
@@ -98,4 +98,5 @@
+
diff --git a/install-dev/langs/fr/data/tab.xml b/install-dev/langs/fr/data/tab.xml
index 4b5ade650..205f46583 100644
--- a/install-dev/langs/fr/data/tab.xml
+++ b/install-dev/langs/fr/data/tab.xml
@@ -1,7 +1,7 @@
-
+
@@ -57,6 +57,11 @@
+
+
+
+
+
@@ -82,11 +87,6 @@
-
-
-
-
-
@@ -98,4 +98,5 @@
+
diff --git a/install-dev/langs/it/data/tab.xml b/install-dev/langs/it/data/tab.xml
index 102f2f688..3f94e7c73 100644
--- a/install-dev/langs/it/data/tab.xml
+++ b/install-dev/langs/it/data/tab.xml
@@ -1,7 +1,7 @@
-
+
@@ -57,6 +57,11 @@
+
+
+
+
+
@@ -82,11 +87,6 @@
-
-
-
-
-
@@ -98,4 +98,5 @@
+
diff --git a/install-dev/upgrade/sql/1.5.0.7.sql b/install-dev/upgrade/sql/1.5.0.7.sql
index b042783b7..5770e8485 100644
--- a/install-dev/upgrade/sql/1.5.0.7.sql
+++ b/install-dev/upgrade/sql/1.5.0.7.sql
@@ -8,6 +8,8 @@ UPDATE `PREFIX_product` set is_virtual = 1 WHERE id_product IN (SELECT id_produc
ALTER TABLE `PREFIX_employee` ADD `bo_width` int(10) unsigned NOT NULL DEFAULT 0 AFTER `bo_theme`;
+
+
CREATE TABLE `PREFIX_product_tax_rules_group_shop` (
`id_product` INT(11) UNSIGNED NOT NULL,
`id_tax_rules_group` INT(11) UNSIGNED NOT NULL,
@@ -30,8 +32,6 @@ INSERT INTO `PREFIX_carrier_tax_rules_group_shop` (`id_carrier`, `id_tax_rules_g
(SELECT `id_carrier`, `id_tax_rules_group`, `id_shop` FROM `PREFIX_carrier`, `PREFIX_shop`);
ALTER TABLE `PREFIX_carrier` DROP `id_tax_rules_group`;
-ALTER TABLE `PREFIX_specific_price` DROP INDEX `id_product`;
- KEY (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `id_customer`, `from_quantity`, `from`, `to`),
+ALTER TABLE `PREFIX_customer` ADD `account_number` VARCHAR(128) NOT NULL AFTER `birthday`
-ALTER TABLE `PREFIX_specific_price` ADD UNIQUE (`id_product`,`id_shop`,`id_group_shop`,`id_currency`,`id_country`,`id_group`,`id_customer`,`id_product_attribute`,`from_quantity`,`from`,`to`);
-ALTER TABLE `PREFIX_specific_price` ADD INDEX (`id_cart`);
+ALTER TABLE `PREFIX_product_shop` ADD `id_category_default` INT( 11 ) UNSIGNED DEFAULT NULL;