// Update Accounting for the return display html
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10145 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -32,7 +32,7 @@ class AccountingCore
|
||||
* @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, $table)
|
||||
public static function setAccountNumberByZoneShop($assoZoneShopList)
|
||||
{
|
||||
$query = '
|
||||
REPLACE INTO`'._DB_PREFIX_.'accounting_zone_shop`
|
||||
|
||||
@@ -138,9 +138,9 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
private function checkRights()
|
||||
{
|
||||
if (!is_writeable($this->downloadDir))
|
||||
$this->prevent['errors'][] = $this->l('The download folder doesn\'t have the sufficient right…');
|
||||
$this->_errors[] = $this->l('The download folder doesn\'t have the sufficient right…');
|
||||
if (!($this->fd = fopen($this->downloadFile, 'w+')))
|
||||
$this->prevent['errors'][] = $this->l('The file can\'t be opened or created, please check the right');
|
||||
$this->_errors[] = $this->l('The file can\'t be opened or created, please check the right');
|
||||
@chmod($this->downloadFile, 0777);
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
{
|
||||
$this->checkRights();
|
||||
|
||||
if (!count($this->prevent['errors']) && $this->fd !== NULL)
|
||||
if (!count($this->_errors) && $this->fd !== NULL)
|
||||
{
|
||||
$buffer = '';
|
||||
foreach($this->exportTypeList[$this->exportSelected]['fields'] as $key => $translation)
|
||||
@@ -238,6 +238,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
$buffer .= $val.';';
|
||||
fwrite($this->fd, rtrim($buffer, ';')."\r\n");
|
||||
}
|
||||
$this->confirmations[] = $this->l('Export has been successfully done');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,12 +133,12 @@ class AdminAccountingManagementControllerCore extends AdminController
|
||||
'num' => $num);
|
||||
|
||||
// Save to the database the account
|
||||
if (count($tab))
|
||||
{
|
||||
Accounting::setAccountNumberByZoneShop($tab);
|
||||
$token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
|
||||
Tools::redirectAdmin(self::$currentIndex.'&token='.$token);
|
||||
}
|
||||
if (count($tab) && Accounting::setAccountNumberByZoneShop($tab))
|
||||
$this->confirmations[] = $this->l('Account numbers have been updated');
|
||||
else
|
||||
$this->_errors[] = $this->l('Account Numbers could not be updated or added in the database');
|
||||
//$token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
|
||||
//Tools::redirectAdmin(self::$currentIndex.'&token='.$token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -810,7 +810,7 @@ class AdminProductsController extends AdminController
|
||||
{
|
||||
$specificPrice = new SpecificPrice();
|
||||
$specificPrice->id_product = $id_product;
|
||||
$specificPrice->id_product_attribute = (int)Tools::getValue('sp_id_product_attribute');
|
||||
$specificPrice->id_product_attribute = (int)Tools::getValue('id_product_attribute');
|
||||
$specificPrice->id_shop = (int)$id_shop;
|
||||
$specificPrice->id_currency = (int)($id_currency);
|
||||
$specificPrice->id_country = (int)($id_country);
|
||||
@@ -1848,11 +1848,13 @@ if (false)
|
||||
}
|
||||
return $preview_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post traitment for accounting
|
||||
*/
|
||||
public function postProcessFormAccounting()
|
||||
{
|
||||
|
||||
if (Validate::isLoadedObject($product = new Product((int)(Tools::getValue('id_product')))))
|
||||
{
|
||||
$id_shop = $this->context->shop->getID();
|
||||
@@ -1870,8 +1872,11 @@ if (false)
|
||||
'id_shop' => $id_shop,
|
||||
'num' => $num);
|
||||
|
||||
if (count($tab))
|
||||
Accounting::saveProductAccountingInformations($tab);
|
||||
// Save to the database the account
|
||||
if (count($tab) && Accounting::saveProductAccountingInformations($tab))
|
||||
$this->confirmations[] = $this->l('Account numbers have been updated');
|
||||
else
|
||||
$this->_errors[] = $this->l('Account Numbers could not be updated or added in the database');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user