[-] BO : Update accounting for export and configuration
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
{*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
<div class="toolbarBox">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
<span id="current_obj" style="font-weight: normal;">
|
||||
{$title|default:' '}
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if !$has_shop_selected}
|
||||
<div class="hint" style="display:block">{l s='Please select the shop you want to configure'}</div>
|
||||
{else}
|
||||
<form action="{$current}&token={$token}" id="{$table}_form" method="post" enctype="multipart/form-data">
|
||||
{foreach from=$input_category_list item=category key=name_category}
|
||||
<fieldset style="margin: 20px 0;">
|
||||
<legend>{$category['title']}</legend>
|
||||
{foreach from=$category['fields'] item=input key=input_name}
|
||||
<div style="clear: both; padding-top:15px;" id="conf_id_{$input_name}" >
|
||||
<label class="conf_title">{$input['title']}</label>
|
||||
{if $input['type'] == 'text'}
|
||||
<input type="text" name="{$input_name|htmlentities}" {if isset($input['id'])}id="{$input['id']|htmlentities}"{/if} value="{$input['value']|htmlentities}" />
|
||||
{/if}
|
||||
<div class="margin-form">
|
||||
{if isset($input['desc'])}<p class="preference_description">{$input['desc']}</p>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
{/foreach}
|
||||
</fieldset>
|
||||
{/foreach}
|
||||
<div class="margin-form">
|
||||
<input type="submit" class="button" id="{$table}_form_submit_btn" name="update_cfg" value="{l s='Save'}"/>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
@@ -1,51 +0,0 @@
|
||||
{*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
{if $existingExport}
|
||||
<div class="hint" style="display:block;">
|
||||
{l s='The last export has been found for this section:'}
|
||||
<a href="{$smarty.server.REQUEST_URI}&download={$type}">{l s='Click here'}</a>
|
||||
</div>
|
||||
<br />
|
||||
{/if}
|
||||
|
||||
<label for="clientPrefix">{l s='Client prefix:'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" value="{$clientPrefix|htmlentities}" name="clientPrefix" />
|
||||
<span class="input-error"></span>
|
||||
</div>
|
||||
|
||||
<label for="beginDate">{l s='Begin to:'}</label>
|
||||
<div class="margin-form">
|
||||
<input class="datepicker" id="beginDate_{$type}" type="text" name="beginDate" value="{$begin_date}" />
|
||||
<span class="input-error">{l s='The date has not the right format'}</span>
|
||||
</div>
|
||||
|
||||
<label for="endDate">{l s='End to:'}</label>
|
||||
<div class="margin-form">
|
||||
<input class="datepicker" id="endDate_{$type}" type="text" name="endDate" value="{$end_date}" />
|
||||
<span class="input-error">{l s='The date has not the right format'}</span>
|
||||
</div>
|
||||
@@ -140,7 +140,7 @@
|
||||
<div class="margin-form">
|
||||
<select id="type" name="type">
|
||||
<option value="">{l s='Choose export type'}</option>
|
||||
<option value="global_export" {if $export_type == 'global_export'} selected="selected"{/if}>
|
||||
<option value="accounting_export" {if $export_type == 'accounting_export'} selected="selected"{/if}>
|
||||
{l s='Accounting export'}
|
||||
</option>
|
||||
<option value="reconciliation_export" {if $export_type == 'reconciliation_export'} selected="selected"{/if}>
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
{*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
<div class="formAccountingExport" id="block_global_export">
|
||||
<fieldset>
|
||||
<legend>{$title}</legend>
|
||||
<form id="reconfiliation_form" action="{$smarty.server.REQUEST_URI}" method="POST">
|
||||
{include file="controllers/accounting_export/common_form.tpl"}
|
||||
<label for="clientPrefix">{l s='Journal:'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="journal" value="{$journal|htmlentities}"/>
|
||||
</div>
|
||||
<div class="margin-form">
|
||||
<input id="submitGlobalExport" type="submit" class="button" name="submitAccountingExportType" />
|
||||
<input type="hidden" name="exportType" value="global_export"/>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -1,37 +0,0 @@
|
||||
{*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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=$preventList key=name item=preventType}
|
||||
{if !empty($preventType)}
|
||||
<div class="{$name}">
|
||||
{foreach from=$preventType item=translationPrevent}
|
||||
{$translationPrevent}
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
||||
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
{*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
<div class="formAccountingExport" id="block_reconciliation_export">
|
||||
<fieldset>
|
||||
<legend>{$title}</legend>
|
||||
<form id="reconfiliation_form" action="{$smarty.server.REQUEST_URI}" method="POST">
|
||||
{include file="controllers/accounting_export/common_form.tpl"}
|
||||
|
||||
<div class="margin-form">
|
||||
<input id="submitReconciliationExport" type="submit" class="button" name="submitAccountingExportType" />
|
||||
<input type="hidden" name="exportType" value="reconciliation_export"/>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -1,65 +0,0 @@
|
||||
{*
|
||||
* 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*}
|
||||
|
||||
{if !empty($error)}
|
||||
<div class="hint" style="display:block">{$error}</div>
|
||||
{else}
|
||||
<div class="toolbarBox">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
<span id="current_obj" style="font-weight: normal;">
|
||||
{$title|default:' '}
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset>
|
||||
<legend>{l s='Account number'}</legend>
|
||||
<div class="hint" style="display:block">
|
||||
{l s='Configure the account number by zone for:'} <b>{$shop_details['name']}</b>
|
||||
</div>
|
||||
<br />
|
||||
<form id="{$table}_form" method="POST" action="{$smarty.server.REQUEST_URI}">
|
||||
<label>{l s='Default number for this shop'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="default_account_number" value="{$shop_details['default_account_number']|htmlentities}" />
|
||||
<p>{l s='If a zone field is empty it will use this default number.'}</p>
|
||||
</div>
|
||||
{foreach from=$shop_details['zones'] key=id_zone item=currentZone}
|
||||
<label>{$currentZone['name']}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="zone_{$id_zone}" value="{$currentZone['account_number']|escape:htmlall|htmlentities}" />
|
||||
|
||||
</div>
|
||||
{/foreach}
|
||||
<div class="margin-form">
|
||||
<input type="submit" class="button" id="{$table}_form_submit_btn" name="UpdateNumbers" value="{l s='Save'}"/>
|
||||
</div>
|
||||
</form>
|
||||
<div class="separation"></div>
|
||||
</fieldset>
|
||||
{/if}
|
||||
@@ -29,83 +29,14 @@ class AdminAccountingConfigurationControllerCore extends AdminController
|
||||
{
|
||||
public $acc_conf = array();
|
||||
|
||||
public $fields_list = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->acc_conf = Accounting::getConfiguration();
|
||||
$this->className = 'Accounting';
|
||||
|
||||
$this->options = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('Export'),
|
||||
'fields' => array(
|
||||
'customer_prefix' => array(
|
||||
'title' => $this->l('Customer prefix:'),
|
||||
'desc' => $this->l('Set your default customer prefix'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['customer_prefix'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'journal' => array(
|
||||
'title' => $this->l('Journal:'),
|
||||
'desc' => '',
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['journal'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_length' => array(
|
||||
'title' => $this->l('Customer account length:'),
|
||||
'desc' => $this->l('Set the length of the customer account number (the prefix will always be displayed with the customer id)'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_length'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'account_number_list' => array(
|
||||
'title' => $this->l('Default account number Management'),
|
||||
'fields' => array(
|
||||
'account_submit_shipping_charge' => array(
|
||||
'title' => $this->l('Submited shipping charge account:'),
|
||||
'desc' => $this->l('Set the account for submited shipping charged'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_submit_shipping_charge'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_unsubmit_shipping_charge' => array(
|
||||
'title' => $this->l('Unsubmited shipping charge account:'),
|
||||
'desc' => $this->l('Set the account for unsubmited shipping charged'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_unsubmit_shipping_charge'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_gift_wripping' => array(
|
||||
'title' => $this->l('Gift-wrapping account number:'),
|
||||
'desc' => $this->l('Set the account number for the gift-wrapping'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_gift_wripping'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_handling' => array(
|
||||
'title' => $this->l('Handling account number:'),
|
||||
'desc' => $this->l('Set the account number for handling'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_handling'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
)
|
||||
),
|
||||
'submit' => array('name' => 'update_cfg')
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
@@ -115,23 +46,142 @@ class AdminAccountingConfigurationControllerCore extends AdminController
|
||||
'href' => '#',
|
||||
'desc' => $this->l('Save')
|
||||
);
|
||||
}
|
||||
|
||||
public function initAccountZoneShop()
|
||||
{
|
||||
$zones = Zone::getZones();
|
||||
$id_shop = $this->context->shop->id;
|
||||
$fields_option = array();
|
||||
|
||||
// Set default zone value to the shop and sort it
|
||||
foreach ($zones as $zone)
|
||||
$fields_option['zone_'.$zone['id_zone']] = array(
|
||||
'title' => $zone['name'],
|
||||
'type' => 'text',
|
||||
'value' => '',
|
||||
'size' => '15',
|
||||
'id' => 'zone_'.$zone['id_zone'],
|
||||
'name' => 'zone_'.$zone['id_zone'],
|
||||
'auto_value' => false
|
||||
);
|
||||
|
||||
ksort($fields_option);
|
||||
$zone_shop_list = Accounting::getAccountNumberZoneShop($id_shop);
|
||||
|
||||
$this->fields_list['zone'] = array(
|
||||
'title' => $this->l('Account number by zone'),
|
||||
'fields' => array(
|
||||
'default_account_number' => array(
|
||||
'title' => $this->l('Default number for this shop'),
|
||||
'desc' => $this->l('If a zone field is empty it will use this default number'),
|
||||
'type' => 'text',
|
||||
'value' => Configuration::get('default_account_number', null, null, $id_shop),
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
))
|
||||
);
|
||||
|
||||
// Set Account number to the id_zone for the id_shop if exist
|
||||
foreach ($zone_shop_list as $zone_shop)
|
||||
$fields_option['zone_'.$zone_shop['id_zone']]['value'] = $zone_shop['account_number'];
|
||||
|
||||
$this->fields_list['zone']['fields'] = array_merge($this->fields_list['zone']['fields'], $fields_option);
|
||||
}
|
||||
|
||||
public function initAccountingForm()
|
||||
{
|
||||
// Only text type available for this configuration, handle new missing type in the tpl file (as the options.tpl helper file)
|
||||
$this->fields_list = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('Export'),
|
||||
'fields' => array(
|
||||
'customer_prefix' => array(
|
||||
'title' => $this->l('Customer prefix:'),
|
||||
'desc' => $this->l('Set your default customer prefix'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['customer_prefix'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'journal' => array(
|
||||
'title' => $this->l('Journal:'),
|
||||
'desc' => '',
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['journal'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_length' => array(
|
||||
'title' => $this->l('Customer account length:'),
|
||||
'desc' => $this->l('Set the length of the customer account number (the prefix will always be displayed with the customer id)'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_length'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
)
|
||||
)
|
||||
),
|
||||
'account_number_list' => array(
|
||||
'title' => $this->l('Default account number Management'),
|
||||
'fields' => array(
|
||||
'account_submit_shipping_charge' => array(
|
||||
'title' => $this->l('Submited shipping charge account:'),
|
||||
'desc' => $this->l('Set the account for submited shipping charged'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_submit_shipping_charge'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_unsubmit_shipping_charge' => array(
|
||||
'title' => $this->l('Unsubmited shipping charge account:'),
|
||||
'desc' => $this->l('Set the account for unsubmited shipping charged'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_unsubmit_shipping_charge'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_gift_wripping' => array(
|
||||
'title' => $this->l('Gift-wrapping account number:'),
|
||||
'desc' => $this->l('Set the account number for the gift-wrapping'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_gift_wripping'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
),
|
||||
'account_handling' => array(
|
||||
'title' => $this->l('Handling account number:'),
|
||||
'desc' => $this->l('Set the account number for handling'),
|
||||
'type' => 'text',
|
||||
'value' => $this->acc_conf['account_handling'],
|
||||
'size' => '15',
|
||||
'auto_value' => false
|
||||
)
|
||||
),
|
||||
'submit' => array('name' => 'update_cfg')
|
||||
),
|
||||
);
|
||||
|
||||
$this->initAccountZoneShop();
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$this->display = 'options';
|
||||
parent::initContent();
|
||||
|
||||
$this->initToolbar();
|
||||
//$this->initInputList();
|
||||
|
||||
$this->initAccountingForm();
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'title' => $this->l('Accounting Configuration'),
|
||||
'acc_conf' => $this->acc_conf,
|
||||
'input_category_list' => $this->fields_list,
|
||||
'table' => 'accounting',
|
||||
'has_shop_selected' => (count(Shop::getContextListShopID()) == 1),
|
||||
'toolbar_btn' => $this->toolbar_btn
|
||||
));
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
@@ -142,9 +192,44 @@ class AdminAccountingConfigurationControllerCore extends AdminController
|
||||
$this->acc_conf[$name] = Tools::getValue($name);
|
||||
|
||||
Accounting::updateConfiguration($this->acc_conf);
|
||||
|
||||
$this->updateAccountNumber();
|
||||
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&update=true');
|
||||
}
|
||||
else if (Tools::getValue('update'))
|
||||
$this->confirmations[] = $this->l('Configuration updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the account number for each shop liable to their zones
|
||||
*/
|
||||
protected function updateAccountNumber()
|
||||
{
|
||||
$id_shop = $this->context->shop->id;
|
||||
|
||||
// Update the current default shop account number
|
||||
Configuration::updateValue(
|
||||
'default_account_number',
|
||||
Tools::getValue('default_account_number'),
|
||||
false, null,
|
||||
$id_shop);
|
||||
|
||||
// If zone still exist, then update the database with the new value
|
||||
if (count($zones = Zone::getZones()))
|
||||
{
|
||||
$tab = array();
|
||||
foreach ($zones as $zone)
|
||||
if (($num = Tools::getValue('zone_'.$zone['id_zone'])) !== null)
|
||||
$tab[] = array(
|
||||
'id_zone' => $zone['id_zone'],
|
||||
'id_shop' => $id_shop,
|
||||
'num' => $num);
|
||||
|
||||
// Save to the database the account
|
||||
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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
|
||||
$this->content = '';
|
||||
$this->downloadDir = _PS_ADMIN_DIR_.'/export/';
|
||||
$this->exportSelected = 'global_export';
|
||||
$this->exportSelected = 'accounting_export';
|
||||
|
||||
$this->initExportFieldList();
|
||||
parent::__construct();
|
||||
@@ -75,10 +75,10 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
protected function initExportFieldList()
|
||||
{
|
||||
$this->exportTypeList = array(
|
||||
'global_export' => array(
|
||||
'accounting_export' => array(
|
||||
'name' => $this->l('Global Export'),
|
||||
'type' => 'global_export',
|
||||
'file' => 'accounting_global_export.csv',
|
||||
'type' => 'accounting_export',
|
||||
'file' => 'accounting_export.csv',
|
||||
'fields' => array(
|
||||
'invoice_date' => $this->l('Invoice Date', 'AdminTab', false, false),
|
||||
'journal' => $this->l('Journal', 'AdminTab', false, false),
|
||||
@@ -223,7 +223,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
case 'reconciliation_export':
|
||||
$succeed = $this->runReconciliationExport();
|
||||
break;
|
||||
case 'global_export':
|
||||
case 'accounting_export':
|
||||
$succeed = $this->runGlobalExport();
|
||||
break;
|
||||
default:
|
||||
@@ -236,7 +236,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
$this->prevent['error'][] = $this->l('Please select the date');
|
||||
}
|
||||
else if (($file = Tools::getValue('download')) && file_exists($this->downloadDir.$file))
|
||||
$this->launchDownloadFile($this->downloadDir.$file);
|
||||
$this->launchDownloadFile($file);
|
||||
}
|
||||
|
||||
public function isAlreadyGenerated()
|
||||
@@ -309,7 +309,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
o.`total_paid_real`,
|
||||
oi.`date_add` as invoice_date,
|
||||
pcc.`transaction_id`,
|
||||
CONCAT(\''.pSQL($this->acc_conf['client_prefix']).'\', LPAD(c.`id_customer`, 6, "0")) AS account_client
|
||||
CONCAT(\''.pSQL($this->acc_conf['customer_prefix']).'\', LPAD(c.`id_customer`, 6, "0")) AS account_client
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = o.`id_customer`
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` a ON a.`id_customer` = o.`id_customer`
|
||||
@@ -474,7 +474,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
pcc.`transaction_id`,
|
||||
o.`payment` AS payment_type,
|
||||
currency.`iso_code` AS currency_code,
|
||||
CONCAT(\''.pSQL($this->acc_conf['client_prefix']).'\', LPAD(customer.`id_customer`, 6, "0")) AS account_client,
|
||||
CONCAT(\''.pSQL($this->acc_conf['customer_prefix']).'\', LPAD(customer.`id_customer`, 6, "0")) AS account_client,
|
||||
CASE
|
||||
WHEN (customer.`account_number` != "" AND customer.`account_number` IS NOT NULL) THEN customer.`account_number`
|
||||
WHEN (a.`company` != "" AND a.`company` IS NOT NULL) THEN a.`company`
|
||||
|
||||
@@ -17,7 +17,7 @@ $_LANGADM['AdminAccessf1206f9fadc5ce41694f69129aecac26'] = 'Configurer';
|
||||
$_LANGADM['AdminAccessf2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_LANGADM['AdminAccessfce31125ecc3fdca7df70c417a0de59c'] = ' : le module est installé dans la base de données, mais ses fichiers sont soit manquants, soit incompatibles.';
|
||||
$_LANGADM['AdminAccountingConfiguration0095a9fa74d1713e43e370a7d7846224'] = 'Export';
|
||||
$_LANGADM['AdminAccountingConfiguration1fff75732a15be33f0468b49bedd77af'] = 'Compte charge transporteur non soumie';
|
||||
$_LANGADM['AdminAccountingConfiguration1fff75732a15be33f0468b49bedd77af'] = 'Compte charge transporteur non soumi';
|
||||
$_LANGADM['AdminAccountingConfiguration20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_LANGADM['AdminAccountingConfiguration395a8d39c70bb14fe5d4683201ee6611'] = 'Définir le numéro de compte pour les emballages cadeau';
|
||||
$_LANGADM['AdminAccountingConfiguration483037b0519492ed2b34db804be76d4c'] = 'Définir le numéro de compte pour les frais de manutention';
|
||||
@@ -26,14 +26,14 @@ $_LANGADM['AdminAccountingConfiguration493a59c0b9bc3c85ae2a908f031a15a1'] = 'Dé
|
||||
$_LANGADM['AdminAccountingConfiguration512e058007a9c2a968324c5b871cfe80'] = 'Compte emballage cadeau';
|
||||
$_LANGADM['AdminAccountingConfiguration57dd1c53d865dfc5330c808028a83849'] = 'Journal';
|
||||
$_LANGADM['AdminAccountingConfiguration59a17feefb0f40c2bf00c624ac7750a1'] = 'Definir la longueur max du compte client (le préfix sera toujours affiché avec l\'id du client)';
|
||||
$_LANGADM['AdminAccountingConfiguration6a8777c9d4ab5b2f43c4444d423e28c1'] = 'Définir le numéro de compte pour les charge transporteur soumie';
|
||||
$_LANGADM['AdminAccountingConfiguration7f2b2a335da5985bfb129f9f07762162'] = 'Définir le numéro de compte pour les charge transporteur non soumie';
|
||||
$_LANGADM['AdminAccountingConfigurationac4aac5f983a61b933a75d5569adffa9'] = 'Compte charge transporteur soumie';
|
||||
$_LANGADM['AdminAccountingConfiguration6a8777c9d4ab5b2f43c4444d423e28c1'] = 'Définir le numéro de compte pour les charge transporteur soumi';
|
||||
$_LANGADM['AdminAccountingConfiguration7f2b2a335da5985bfb129f9f07762162'] = 'Définir le numéro de compte pour les charge transporteur non soumi';
|
||||
$_LANGADM['AdminAccountingConfigurationac4aac5f983a61b933a75d5569adffa9'] = 'Compte charge transporteur soumi';
|
||||
$_LANGADM['AdminAccountingConfigurationc490d21c78b2234e4d7e49e88c317f4d'] = 'Configuration Comptable';
|
||||
$_LANGADM['AdminAccountingConfigurationc9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder';
|
||||
$_LANGADM['AdminAccountingConfigurationcdb61c11332ee5b498f24af3cd2ec02b'] = 'Compte manutention';
|
||||
$_LANGADM['AdminAccountingConfigurationd025a6b1509119c8ac95588d367aa1e8'] = 'Longueur du compte client';
|
||||
$_LANGADM['AdminAccountingConfigurationd7d502b813c3879cf2e8b5c624e5781c'] = 'Prefix du client';
|
||||
$_LANGADM['AdminAccountingConfigurationd7d502b813c3879cf2e8b5c624e5781c'] = 'Préfixe du client';
|
||||
$_LANGADM['AdminAccountingExport02529440bcda5643c95e24a499fab046'] = 'Date de début';
|
||||
$_LANGADM['AdminAccountingExport05688c675e3bf04e69b30913bfe1a5b1'] = 'Le dossier de téléchargement (export) n\'a pas les droits suffisants';
|
||||
$_LANGADM['AdminAccountingExport08bd40c7543007ad06e4fce31618f6ec'] = 'Compte';
|
||||
@@ -98,7 +98,7 @@ $_LANGADM['AdminAccountingRegisteredNumber22a5fe87a20a1de38ea8f7f74a984334'] = '
|
||||
$_LANGADM['AdminAccountingRegisteredNumber28f9afe243937deab17a152767b9051a'] = 'Liste des numéros de compte pour les taxes';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber2b049bee214584343fc5a815954ede5d'] = 'Aucun numéro de compte défini dans cette liste';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber2b30051fd4e14c0edee4b9a919e852a0'] = 'Nombre de zone associés à ce compte';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber3404de45011c5931336a0dc190ec9da1'] = 'LIste des numéros de comptes pour les charge transporteur non soumie';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber3404de45011c5931336a0dc190ec9da1'] = 'Liste des numéros de comptes pour les charge transporteur non soumie';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber4fa6da62620c0b6f006a4c43b46be5c6'] = 'Nombre de charge transporteur soumie associé à ce compte';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber628c592f941aedfae6d887c274540ea4'] = 'Liste des numéros de compte pour les charge transporteur soumie ';
|
||||
$_LANGADM['AdminAccountingRegisteredNumber7c4ea6246042db896f89e9ca34ef4f1e'] = 'Plan coomptable';
|
||||
@@ -109,7 +109,7 @@ $_LANGADM['AdminAccountingRegisteredNumberd9af9ede92dcd07aaf3b0181a00682e2'] = '
|
||||
$_LANGADM['AdminAccountingRegisteredNumbere0f83dbb81ed86890fc524a7181218dc'] = 'Nombre de charge transporteur non soumie associé à ce compte';
|
||||
$_LANGADM['AdminAccountingRegisteredNumbere5a88b695354918bdad33daf1a487de9'] = 'Nombre de produits associés à ce compte';
|
||||
$_LANGADM['AdminAccountingRegisteredNumberfcc9d5c44a91ca391543e986c5c0db63'] = 'Liste des numéros de compte pour les produits';
|
||||
$_LANGADM['AdminAccountingRegisteredNumberfea2e739b079eaa408a57512e1b0ef97'] = 'LIste des numéros de compte pour les emballages cadeau';
|
||||
$_LANGADM['AdminAccountingRegisteredNumberfea2e739b079eaa408a57512e1b0ef97'] = 'Liste des numéros de compte pour les emballages cadeau';
|
||||
$_LANGADM['AdminAddresses1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Société';
|
||||
$_LANGADM['AdminAddresses20db0bfeecd8fe60533206a2b5e9891a'] = 'Prénom';
|
||||
$_LANGADM['AdminAddresses284b47b0bb63ae2df3b29f0e691d6fcf'] = 'Adresses';
|
||||
|
||||
Reference in New Issue
Block a user