Fix: Select a date year now show past and future date.

This commit is contained in:
Laurent Destailleur 2011-05-03 11:29:09 +00:00
parent 6da49f1960
commit cf862a2286
7 changed files with 20 additions and 54 deletions

View File

@ -1,31 +0,0 @@
-- ===========================================================================
-- Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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;

View File

@ -1018,9 +1018,9 @@ if ($id > 0 || ! empty($ref))
$head = propal_prepare_head($object); $head = propal_prepare_head($object);
dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal');
$formconfirm=''; $formconfirm='';
// Clone confirmation // Clone confirmation
if ($action == 'clone') 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); $formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1);
} }
// Hook of thirdparty module // Hook of thirdparty module
if (empty($formconfirm) && ! empty($object->hooks)) if (empty($formconfirm) && ! empty($object->hooks))
{ {
@ -1087,7 +1087,7 @@ if ($id > 0 || ! empty($ref))
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid); if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
} }
} }
// Print form confirm // Print form confirm
print $formconfirm; print $formconfirm;
@ -1312,7 +1312,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Origine de la demande // Origine de la demande
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1465,7 +1465,7 @@ if ($id > 0 || ! empty($ref))
// Show object lines // Show object lines
if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid); if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid);
//print '<table id="tablelines" class="noborder" width="100%">'; //print '<table id="tablelines" class="noborder" width="100%">';
/* /*
@ -1841,10 +1841,9 @@ else
print '<td class="liste_titre" colspan="1" align="right">'; print '<td class="liste_titre" colspan="1" align="right">';
print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">'; print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
print '&nbsp;'.$langs->trans('Year').': '; print '&nbsp;'.$langs->trans('Year').': ';
$max_year = date("Y");
$syear = $year; $syear = $year;
//if($syear == '') $syear = date("Y"); //if($syear == '') $syear = date("Y");
$html->select_year($syear,'year',1, '', $max_year); $html->select_year($syear,'year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre" colspan="1">&nbsp;</td>'; print '<td class="liste_titre" colspan="1">&nbsp;</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';

View File

@ -1871,7 +1871,7 @@ else
$head = facture_prepare_head($object); $head = facture_prepare_head($object);
dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill'); dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), 0, 'bill');
$formconfirm=''; $formconfirm='';
// Confirmation de la conversion de l'avoir en reduc // Confirmation de la conversion de l'avoir en reduc
@ -2014,7 +2014,7 @@ else
// Paiement incomplet. On demande si motif = escompte ou autre // 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); $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 // Hook of thirdparty module
if (empty($formconfirm) && ! empty($object->hooks)) if (empty($formconfirm) && ! empty($object->hooks))
{ {
@ -2023,7 +2023,7 @@ else
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid); if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
} }
} }
// Print form confirm // Print form confirm
print $formconfirm; print $formconfirm;
@ -3044,10 +3044,9 @@ else
print '<td class="liste_titre" colspan="1" align="center">'; print '<td class="liste_titre" colspan="1" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
//print '&nbsp;'.$langs->trans('Year').': '; //print '&nbsp;'.$langs->trans('Year').': ';
$max_year = date("Y");
$syear = $year; $syear = $year;
//if ($syear == '') $syear = date("Y"); //if ($syear == '') $syear = date("Y");
$html->select_year($syear,'year',1, '', $max_year); $html->select_year($syear,'year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="left">&nbsp;</td>'; print '<td class="liste_titre" align="left">&nbsp;</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';

View File

@ -622,11 +622,10 @@ else
print '<td class="liste_titre" colspan="1" align="right">'; print '<td class="liste_titre" colspan="1" align="right">';
print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">'; print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">';
print '&nbsp;'.$langs->trans('Year').': '; print '&nbsp;'.$langs->trans('Year').': ';
$max_year = date("Y");
$syear = $year; $syear = $year;
if($syear == '') if($syear == '')
$syear = date("Y"); $syear = date("Y");
$html->select_year($syear,'year',1, '', $max_year); $html->select_year($syear,'year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET['search_montant_ht'].'">'; print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET['search_montant_ht'].'">';

View File

@ -3301,12 +3301,12 @@ class Form
} }
/** /**
* \brief Return HTML combo list of years * Return HTML combo list of years
* \param selected Preselected value (''=current year, -1=none, year otherwise) * @param selected Preselected value (''=current year, -1=none, year otherwise)
* \param htmlname Name of HTML select object * @param htmlname Name of HTML select object
* \param useempty Affiche valeur vide dans liste * @param useempty Affiche valeur vide dans liste
* \param $min_year Offset of minimum year into list (by default current year -10) * @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) * @param $max_year Offset of maximum year into list (by default current year + 5)
* TODO Move into html.formother * TODO Move into html.formother
*/ */
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5) function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5)

View File

@ -206,7 +206,7 @@ if ($resql)
//print '&nbsp;'.$langs->trans('Year').': '; //print '&nbsp;'.$langs->trans('Year').': ';
$syear = $year; $syear = $year;
//if ($syear == '') $syear = date("Y"); //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 '</td>'; print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';

View File

@ -264,7 +264,7 @@ if ($resql)
print '&nbsp;'.$langs->trans('Year').': '; print '&nbsp;'.$langs->trans('Year').': ';
$max_year = date("Y"); $max_year = date("Y");
$syear = $year; $syear = $year;
$form->select_year($syear,'year',1, '', $max_year); $form->select_year($syear,'year',1, 20, 5);
print '</td>'; print '</td>';
// Label of movement // Label of movement
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';