From cf862a22863ed8461734c5015d66c21606239db6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 May 2011 11:29:09 +0000 Subject: [PATCH] Fix: Select a date year now show past and future date. --- htdocs/cashdesk/sql/llx_pos_tmp.sql | 31 --------------------------- htdocs/comm/propal.php | 15 ++++++------- htdocs/compta/facture.php | 9 ++++---- htdocs/compta/propal.php | 3 +-- htdocs/core/class/html.form.class.php | 12 +++++------ htdocs/fourn/facture/index.php | 2 +- htdocs/product/stock/mouvement.php | 2 +- 7 files changed, 20 insertions(+), 54 deletions(-) delete mode 100755 htdocs/cashdesk/sql/llx_pos_tmp.sql diff --git a/htdocs/cashdesk/sql/llx_pos_tmp.sql b/htdocs/cashdesk/sql/llx_pos_tmp.sql deleted file mode 100755 index 8771b0ddda8..00000000000 --- a/htdocs/cashdesk/sql/llx_pos_tmp.sql +++ /dev/null @@ -1,31 +0,0 @@ --- =========================================================================== --- Copyright (C) 2010 Laurent Destailleur --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- =========================================================================== - -CREATE TABLE llx_pos_tmp ( - id integer AUTO_INCREMENT PRIMARY KEY, - fk_article integer NOT NULL, - qte real NOT NULL, - fk_tva integer NOT NULL, - remise_percent real NOT NULL, - remise real NOT NULL, - total_ht double(24,8) NOT NULL, - total_tva double(24,8) NOT NULL, - total_ttc double(24,8) NOT NULL -) ENGINE=innodb; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 2fed1737e49..adb368af4c2 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1018,9 +1018,9 @@ if ($id > 0 || ! empty($ref)) $head = propal_prepare_head($object); dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); - + $formconfirm=''; - + // Clone confirmation if ($action == 'clone') { @@ -1078,7 +1078,7 @@ if ($id > 0 || ! empty($ref)) $formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); } - + // Hook of thirdparty module if (empty($formconfirm) && ! empty($object->hooks)) { @@ -1087,7 +1087,7 @@ if ($id > 0 || ! empty($ref)) if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid); } } - + // Print form confirm print $formconfirm; @@ -1312,7 +1312,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - + // Origine de la demande print ''; print '
'; @@ -1465,7 +1465,7 @@ if ($id > 0 || ! empty($ref)) // Show object lines if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid); - + //print ''; /* @@ -1841,10 +1841,9 @@ else print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; // Label of movement print '
'; print $langs->trans('Month').': '; print ' '.$langs->trans('Year').': '; - $max_year = date("Y"); $syear = $year; //if($syear == '') $syear = date("Y"); - $html->select_year($syear,'year',1, '', $max_year); + $html->select_year($syear,'year',1, 20, 5); print ' '; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e84adf9f4a6..12a3739b88e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1871,7 +1871,7 @@ else $head = facture_prepare_head($object); dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill'); - + $formconfirm=''; // Confirmation de la conversion de l'avoir en reduc @@ -2014,7 +2014,7 @@ else // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes',1); } - + // Hook of thirdparty module if (empty($formconfirm) && ! empty($object->hooks)) { @@ -2023,7 +2023,7 @@ else if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid); } } - + // Print form confirm print $formconfirm; @@ -3044,10 +3044,9 @@ else print ''; print ''; //print ' '.$langs->trans('Year').': '; - $max_year = date("Y"); $syear = $year; //if ($syear == '') $syear = date("Y"); - $html->select_year($syear,'year',1, '', $max_year); + $html->select_year($syear,'year',1, 20, 5); print ' '; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 470862e58b8..06e2d8607d3 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -622,11 +622,10 @@ else print ''; print $langs->trans('Month').': '; print ' '.$langs->trans('Year').': '; - $max_year = date("Y"); $syear = $year; if($syear == '') $syear = date("Y"); - $html->select_year($syear,'year',1, '', $max_year); + $html->select_year($syear,'year',1, 20, 5); print ''; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 610381ca5f4..1120e901b87 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3301,12 +3301,12 @@ class Form } /** - * \brief Return HTML combo list of years - * \param selected Preselected value (''=current year, -1=none, year otherwise) - * \param htmlname Name of HTML select object - * \param useempty Affiche valeur vide dans liste - * \param $min_year Offset of minimum year into list (by default current year -10) - * \param $max_year Offset of maximum year into list (by default current year + 5) + * Return HTML combo list of years + * @param selected Preselected value (''=current year, -1=none, year otherwise) + * @param htmlname Name of HTML select object + * @param useempty Affiche valeur vide dans liste + * @param $min_year Offset of minimum year into list (by default current year -10) + * @param $max_year Offset of maximum year into list (by default current year + 5) * TODO Move into html.formother */ function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5) diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index 99655e4f777..632e7a26302 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -206,7 +206,7 @@ if ($resql) //print ' '.$langs->trans('Year').': '; $syear = $year; //if ($syear == '') $syear = date("Y"); - $html->select_year($syear?$syear:-1,'year',1, 10, 10); + $html->select_year($syear?$syear:-1,'year',1, 20, 5); print ' '; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index d0bba651987..278a944a4df 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -264,7 +264,7 @@ if ($resql) print ' '.$langs->trans('Year').': '; $max_year = date("Y"); $syear = $year; - $form->select_year($syear,'year',1, '', $max_year); + $form->select_year($syear,'year',1, 20, 5); print '';