Qual: Uniformize search date for lists.
This commit is contained in:
parent
c4c82f84c5
commit
270eaf7aca
@ -289,12 +289,13 @@ if ($result)
|
||||
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="16" name="search_societe" value="'.$search_societe.'">';
|
||||
print '<input class="flat" type="text" size="12" name="search_societe" value="'.$search_societe.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input class="flat" type="text" size="16" name="search_town" value="'.$search_town.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" type="text" size="10" name="search_town" value="'.$search_town.'"></td>';
|
||||
print '<td class="liste_titre" colspan="1" align="center">';
|
||||
print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
print ' '.$langs->trans('Year').': ';
|
||||
//print $langs->trans('Month').': ';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
//print ' '.$langs->trans('Year').': ';
|
||||
$syear = $year;
|
||||
$formother->select_year($syear,'year',1, 20, 5);
|
||||
print '</td>';
|
||||
@ -376,15 +377,8 @@ if ($result)
|
||||
|
||||
// Date proposal
|
||||
print '<td align="center">';
|
||||
$y = dol_print_date($db->jdate($objp->dp),'%Y');
|
||||
$m = dol_print_date($db->jdate($objp->dp),'%m');
|
||||
$mt= dol_print_date($db->jdate($objp->dp),'%b');
|
||||
$d = dol_print_date($db->jdate($objp->dp),'%d');
|
||||
print $d."\n";
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'&month='.$m.'">';
|
||||
print $mt."</a>\n";
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'?year='.$y.'">';
|
||||
print $y."</a></td>\n";
|
||||
print dol_print_date($db->jdate($obj->dp), 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Date end validity
|
||||
if ($objp->dfv)
|
||||
|
||||
@ -162,15 +162,15 @@ if ($viewstatut <> '')
|
||||
if ($ordermonth > 0)
|
||||
{
|
||||
if ($orderyear > 0 && empty($day))
|
||||
$sql.= " AND c.date_valid BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'";
|
||||
$sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'";
|
||||
else if ($orderyear > 0 && ! empty($day))
|
||||
$sql.= " AND c.date_valid BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $day, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $day, $orderyear))."'";
|
||||
$sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $day, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $day, $orderyear))."'";
|
||||
else
|
||||
$sql.= " AND date_format(c.date_valid, '%m') = '".$ordermonth."'";
|
||||
$sql.= " AND date_format(c.date_commande, '%m') = '".$ordermonth."'";
|
||||
}
|
||||
else if ($orderyear > 0)
|
||||
{
|
||||
$sql.= " AND c.date_valid BETWEEN '".$db->idate(dol_get_first_day($orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($orderyear,12,false))."'";
|
||||
$sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,1,false))."' AND '".$db->idate(dol_get_last_day($orderyear,12,false))."'";
|
||||
}
|
||||
if ($deliverymonth > 0)
|
||||
{
|
||||
@ -297,8 +297,14 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> ';
|
||||
print '</td><td class="liste_titre"> ';
|
||||
print '<td class="liste_titre">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="orderday" value="'.$orderday.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="ordermonth" value="'.$ordermonth.'">';
|
||||
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
|
||||
print '</td><td class="liste_titre">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="deliverymonth" value="'.$deliverymonth.'">';
|
||||
$formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5);
|
||||
print '</td><td class="liste_titre"> ';
|
||||
print '</td><td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
@ -370,25 +376,13 @@ if ($resql)
|
||||
print '</td>';
|
||||
|
||||
// Order date
|
||||
$y = dol_print_date($db->jdate($objp->date_commande),'%Y');
|
||||
$m = dol_print_date($db->jdate($objp->date_commande),'%m');
|
||||
$ml = dol_print_date($db->jdate($objp->date_commande),'%B');
|
||||
$d = dol_print_date($db->jdate($objp->date_commande),'%d');
|
||||
print '<td align="right">';
|
||||
print $d;
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?orderyear='.$y.'&ordermonth='.$m.'">'.$ml.'</a>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?orderyear='.$y.'">'.$y.'</a>';
|
||||
print dol_print_date($db->jdate($objp->date_commande), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Delivery date
|
||||
$y = dol_print_date($db->jdate($objp->date_livraison),'%Y');
|
||||
$m = dol_print_date($db->jdate($objp->date_livraison),'%m');
|
||||
$ml = dol_print_date($db->jdate($objp->date_livraison),'%B');
|
||||
$d = dol_print_date($db->jdate($objp->date_livraison),'%d');
|
||||
print '<td align="right">';
|
||||
print $d;
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?deliveryyear='.$y.'&deliverymonth='.$m.'">'.$ml.'</a>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?deliveryyear='.$y.'">'.$y.'</a>';
|
||||
print dol_print_date($db->jdate($objp->date_delivery), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Amount HT
|
||||
|
||||
@ -218,10 +218,10 @@ if ($search_user > 0)
|
||||
}
|
||||
if (! $sall)
|
||||
{
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total,f.tva, f.total_ttc,';
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.increment, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' f.datef, f.date_lim_reglement,';
|
||||
$sql.= ' f.paye, f.fk_statut,';
|
||||
$sql.= ' s.nom, s.rowid, f.note_private';
|
||||
$sql.= ' s.nom, s.rowid, s.code_client, s.client';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user