From e050010261eb7dba284d8b1111d987e92469f136 Mon Sep 17 00:00:00 2001 From: vSchoener Date: Thu, 17 Nov 2011 16:38:32 +0000 Subject: [PATCH] // Update Accounting form git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10226 b9a71923-0436-4b27-9f14-aed3839534dd --- .../template/accounting_export/common_form.tpl | 16 ++-------------- .../accounting_export/global_export.tpl | 6 +++--- .../themes/template/accounting_export/menu.tpl | 17 +++++++++++++++++ .../accounting_export/reconciliation_export.tpl | 4 ++-- .../template/accounting_management/content.tpl | 2 +- .../themes/template/products/accounting.tpl | 5 ++++- .../admin/AdminAccountingExportController.php | 4 ++++ 7 files changed, 33 insertions(+), 21 deletions(-) diff --git a/admin-dev/themes/template/accounting_export/common_form.tpl b/admin-dev/themes/template/accounting_export/common_form.tpl index 300925ba6..a8eb50632 100644 --- a/admin-dev/themes/template/accounting_export/common_form.tpl +++ b/admin-dev/themes/template/accounting_export/common_form.tpl @@ -24,18 +24,6 @@ * International Registered Trademark & Property of PrestaShop SA *} - - {if $existingExport}
{l s='The last export has been for this section:'} @@ -51,10 +39,10 @@
- +
- +
diff --git a/admin-dev/themes/template/accounting_export/global_export.tpl b/admin-dev/themes/template/accounting_export/global_export.tpl index 9e3105829..afacb801d 100644 --- a/admin-dev/themes/template/accounting_export/global_export.tpl +++ b/admin-dev/themes/template/accounting_export/global_export.tpl @@ -27,14 +27,14 @@
{$title} -
+ {include file="$pathAccountExportTpl/common_form.tpl"}
- +
- +
diff --git a/admin-dev/themes/template/accounting_export/menu.tpl b/admin-dev/themes/template/accounting_export/menu.tpl index 1bf539f8d..ec5a24826 100644 --- a/admin-dev/themes/template/accounting_export/menu.tpl +++ b/admin-dev/themes/template/accounting_export/menu.tpl @@ -40,6 +40,23 @@ }); }); $('#' + '{$defaultType}').fadeIn('fast'); + + $('.datepicker').each(function() { + console.log($(this)); + $(this).datepicker({ + prevText: '', + nextText: '', + dateFormat: 'yy-mm-dd' + }); + }); + + $('.formAccountingExport form input[type="submit"]').each(function() + { + $(this).click(function() { + dateRegex = /^[2-9]\d{2}-\d{3}-\d{4}$/ + return false; + }); + }); }); diff --git a/admin-dev/themes/template/accounting_export/reconciliation_export.tpl b/admin-dev/themes/template/accounting_export/reconciliation_export.tpl index 5b970ca8c..c2f415160 100644 --- a/admin-dev/themes/template/accounting_export/reconciliation_export.tpl +++ b/admin-dev/themes/template/accounting_export/reconciliation_export.tpl @@ -27,11 +27,11 @@
{$title} -
+ {include file="$pathAccountExportTpl/common_form.tpl"}
- +
diff --git a/admin-dev/themes/template/accounting_management/content.tpl b/admin-dev/themes/template/accounting_management/content.tpl index fd44248b9..dbfd1984e 100644 --- a/admin-dev/themes/template/accounting_management/content.tpl +++ b/admin-dev/themes/template/accounting_management/content.tpl @@ -39,13 +39,13 @@ {l s='Account number'}
{l s='Configure the account number by zone for:'} {$shop['name']}. - {l s='If a zone field is empty it will use the default number set.'}

+

{l s='If a zone field is empty it will use this default number.'}

{foreach from=$shop['zones'] key=id_zone item=currentZone} diff --git a/admin-dev/themes/template/products/accounting.tpl b/admin-dev/themes/template/products/accounting.tpl index 60bdd7815..b8756ecc7 100644 --- a/admin-dev/themes/template/products/accounting.tpl +++ b/admin-dev/themes/template/products/accounting.tpl @@ -30,7 +30,7 @@
{l s='Account number'}
- {l s='Configure the account number of the product for each zone, if a field is empty, it will use the default one of the shop set in the Accounting Management tab :'} + {l s='Configure the account number of the product for each zone, if a field is empty, it will use the default one of the shop set in the Accounting Management tab'}

{foreach from=$productAccountNumberList['zones'] key=id_zone item=currentZone} @@ -43,6 +43,9 @@
+
+ {l s='Theses fields are used for the accounting export'} +
{/if} \ No newline at end of file diff --git a/controllers/admin/AdminAccountingExportController.php b/controllers/admin/AdminAccountingExportController.php index f66340ee5..f354e0d02 100644 --- a/controllers/admin/AdminAccountingExportController.php +++ b/controllers/admin/AdminAccountingExportController.php @@ -154,6 +154,9 @@ class AdminAccountingExportControllerCore extends AdminController $this->context->smarty->assign(array( 'clientPrefix' => Configuration::get('ACCOUNTING_CLIENT_PREFIX_EXPORT'), + 'journal' => Configuration::get('ACCOUNTING_JOURNAL_EXPORT'), + 'begin_date' => Tools::getValue('beginDate'), + 'end_date' => Tools::getValue('endDate'), 'pathAccountExportTpl' => $this->pathAccountExportTpl, 'urlDownload' => Tools::getShopDomain().'/download/' )); @@ -201,6 +204,7 @@ class AdminAccountingExportControllerCore extends AdminController break; case 'global_export': $this->runGlobalExport(); + Configuration::updateValue('ACCOUNTING_JOURNAL_EXPORT', Tools::getValue('journal')); break; default: // If not defined, set export type to default