[+] BO : Add Accounting Management

This commit is contained in:
vSchoener
2011-11-08 14:20:24 +00:00
parent 79abbc000f
commit d7649ae28a
12 changed files with 407 additions and 16 deletions
+68
View File
@@ -0,0 +1,68 @@
<?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 AccountingCore
{
/**
* Set an account number to a zone
* @var array $assoZoneShopList correspond to an associated list of id_zone - id_shop - num
* @return bool To know if any modification in the database succeed
*/
public static function setAccountNumberByZoneShop($assoZoneShopList)
{
$query = '
REPLACE INTO`'._DB_PREFIX_.'accounting_zone_shop`
(id_zone, id_shop, account_number)
VALUES %s';
$values = '';
foreach($assoZoneShopList as $asso)
if (array_key_exists('id_zone', $asso) &&
array_key_exists('id_shop', $asso) &&
array_key_exists('num', $asso))
$values .= '('.(int)$asso['id_zone'].','.(int)$asso['id_shop'].', \''.pSQL($asso['num']).'\'), ';
$query = sprintf($query, rtrim($values, ', '));
if (!empty($values))
return Db::getInstance()->execute($query);
return false;
}
/**
* Get an account number by zone
* @var int $id_zone
* @return string
*/
public static function getAccountNumberByZone($id_zone, $id_shop)
{
return Db::getInstance()->getValue('
SELECT `accounting_account_number`
FROM `'._DB_PREFIX_.'accounting_zone_shop`
WHERE `id_zone` = '.(int)$id_zone).'
AND id_shop` = '.(int)$id_shop;
}
}
+3 -3
View File
@@ -60,7 +60,7 @@ class AdminControllerCore extends Controller
public $id = -1;
/** @var array noTabLink array of admintab names witch have no content */
public $noTabLink = array('AdminCatalog', 'AdminTools', 'AdminStock');
public $noTabLink = array('AdminCatalog', 'AdminTools', 'AdminStock', 'AdminAccounting');
/** @var string Security token */
public $token;
@@ -360,8 +360,8 @@ class AdminControllerCore extends Controller
$token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
// Sub included tab postProcessing
$this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset'));
$this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset'));
if (!empty($this->action) && method_exists($this, 'process'.ucfirst(Tools::toCamelCase($this->action))))
$this->{'process'.Tools::toCamelCase($this->action)}($token);
else if (method_exists($this, $this->action))
+1 -1
View File
@@ -53,7 +53,7 @@ class GroupShopCore extends ObjectModel
'group' => array('type' => 'group_shop'),
'manufacturer' => array('type' => 'group_shop'),
'supplier' => array('type' => 'group_shop'),
'zone' => array('type' => 'group_shop'),
'zone' => array('type' => 'shop'),
'tax_rules_group' => array('type' => 'group_shop'),
);
+1
View File
@@ -83,6 +83,7 @@ class ShopCore extends ObjectModel
'referrer' => array('type' => 'shop'),
'scene' => array('type' => 'shop'),
'store' => array('type' => 'shop'),
'zone_shop' => array('type' => 'shop'),
'webservice_account' => array('type' => 'shop'),
);