NEW Propal list - Add date start & date end
This commit is contained in:
parent
d972fa8bcb
commit
938d997e51
@ -13,6 +13,7 @@
|
|||||||
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
|
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -75,15 +76,12 @@ $search_zip=GETPOST('search_zip', 'alpha');
|
|||||||
$search_state=trim(GETPOST("search_state"));
|
$search_state=trim(GETPOST("search_state"));
|
||||||
$search_country=GETPOST("search_country", 'int');
|
$search_country=GETPOST("search_country", 'int');
|
||||||
$search_type_thirdparty=GETPOST("search_type_thirdparty", 'int');
|
$search_type_thirdparty=GETPOST("search_type_thirdparty", 'int');
|
||||||
$search_day=GETPOST("search_day", "int");
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||||
$search_month=GETPOST("search_month", "int");
|
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||||
$search_year=GETPOST("search_year", "int");
|
$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
|
||||||
$search_dayfin=GETPOST("search_dayfin", "int");
|
$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
|
||||||
$search_month_end=GETPOST("search_month_end", "int");
|
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
|
||||||
$search_yearfin=GETPOST("search_yearfin", "int");
|
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
|
||||||
$search_daydelivery=GETPOST("search_daydelivery", "int");
|
|
||||||
$search_monthdelivery=GETPOST("search_monthdelivery", "int");
|
|
||||||
$search_yeardelivery=GETPOST("search_yeardelivery", "int");
|
|
||||||
$search_availability=GETPOST('search_availability', 'int');
|
$search_availability=GETPOST('search_availability', 'int');
|
||||||
$search_categ_cus=trim(GETPOST("search_categ_cus", 'int'));
|
$search_categ_cus=trim(GETPOST("search_categ_cus", 'int'));
|
||||||
$search_btn=GETPOST('button_search', 'alpha');
|
$search_btn=GETPOST('button_search', 'alpha');
|
||||||
@ -219,15 +217,12 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_type='';
|
$search_type='';
|
||||||
$search_country='';
|
$search_country='';
|
||||||
$search_type_thirdparty='';
|
$search_type_thirdparty='';
|
||||||
$search_year='';
|
$search_date_start='';
|
||||||
$search_month='';
|
$search_date_end='';
|
||||||
$search_day='';
|
$search_dateend_start='';
|
||||||
$search_yearfin='';
|
$search_dateend_end='';
|
||||||
$search_month_end='';
|
$search_datedelivery_start='';
|
||||||
$search_dayfin='';
|
$search_datedelivery_end='';
|
||||||
$search_yeardelivery='';
|
|
||||||
$search_monthdelivery='';
|
|
||||||
$search_daydelivery='';
|
|
||||||
$search_availability='';
|
$search_availability='';
|
||||||
$viewstatut='';
|
$viewstatut='';
|
||||||
$object_statut='';
|
$object_statut='';
|
||||||
@ -341,9 +336,12 @@ if ($viewstatut != '' && $viewstatut != '-1')
|
|||||||
{
|
{
|
||||||
$sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')';
|
$sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')';
|
||||||
}
|
}
|
||||||
$sql.= dolSqlDateFilter("p.datep", $search_day, $search_month, $search_year);
|
if ($search_date_start) $sql.= " AND p.datep >= '" . $db->idate($search_date_start) . "'";
|
||||||
$sql.= dolSqlDateFilter("p.fin_validite", $search_dayfin, $search_month_end, $search_yearfin);
|
if ($search_date_end) $sql.= " AND p.datep <= '" . $db->idate($search_date_end) . "'";
|
||||||
$sql.= dolSqlDateFilter("p.date_livraison", $search_daydelivery, $search_monthdelivery, $search_yeardelivery);
|
if ($search_dateend_start) $sql.= " AND p.fin_validite >= '" . $db->idate($search_dateend_start) . "'";
|
||||||
|
if ($search_dateend_end) $sql.= " AND p.fin_validite <= '" . $db->idate($search_dateend_end) . "'";
|
||||||
|
if ($search_datedelivery_start) $sql.= " AND p.date_livraison >= '" . $db->idate($search_datedelivery_start) . "'";
|
||||||
|
if ($search_datedelivery_end) $sql.= " AND p.date_livraison <= '" . $db->idate($search_datedelivery_end) . "'";
|
||||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale);
|
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale);
|
||||||
if ($search_user > 0)
|
if ($search_user > 0)
|
||||||
{
|
{
|
||||||
@ -594,34 +592,43 @@ if ($resql)
|
|||||||
// Date
|
// Date
|
||||||
if (! empty($arrayfields['p.date']['checked']))
|
if (! empty($arrayfields['p.date']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre nowraponall" align="center">';
|
print '<td class="liste_titre center">';
|
||||||
//print $langs->trans('Month').': ';
|
print '<div class="nowrap">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25" type="text" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
|
print $langs->trans('From') . ' ';
|
||||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
|
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
|
||||||
//print ' '.$langs->trans('Year').': ';
|
print '</div>';
|
||||||
$formother->select_year($search_year, 'search_year', 1, 20, 5);
|
print '<div class="nowrap">';
|
||||||
|
print $langs->trans('to') . ' ';
|
||||||
|
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
|
||||||
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date end
|
// Date end
|
||||||
if (! empty($arrayfields['p.fin_validite']['checked']))
|
if (! empty($arrayfields['p.fin_validite']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre nowraponall" align="center">';
|
print '<td class="liste_titre center">';
|
||||||
//print $langs->trans('Month').': ';
|
print '<div class="nowrap">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25" type="text" maxlength="2" name="search_dayfin" value="'.dol_escape_htmltag($search_dayfin).'">';
|
print $langs->trans('From') . ' ';
|
||||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_month_end" value="'.dol_escape_htmltag($search_month_end).'">';
|
print $form->selectDate($search_dateend_start?$search_dateend_start:-1, 'search_dateend_start', 0, 0, 1);
|
||||||
//print ' '.$langs->trans('Year').': ';
|
print '</div>';
|
||||||
$formother->select_year($search_yearfin, 'search_yearfin', 1, 20, 5);
|
print '<div class="nowrap">';
|
||||||
|
print $langs->trans('to') . ' ';
|
||||||
|
print $form->selectDate($search_dateend_end?$search_dateend_end:-1, 'search_dateend_end', 0, 0, 1);
|
||||||
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date delivery
|
// Date delivery
|
||||||
if (! empty($arrayfields['p.date_livraison']['checked']))
|
if (! empty($arrayfields['p.date_livraison']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre nowraponall" align="center">';
|
print '<td class="liste_titre center">';
|
||||||
//print $langs->trans('Month').': ';
|
print '<div class="nowrap">';
|
||||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25" type="text" size="1" maxlength="2" name="search_daydelivery" value="'.dol_escape_htmltag($search_daydelivery).'">';
|
print $langs->trans('From') . ' ';
|
||||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="search_monthdelivery" value="'.dol_escape_htmltag($search_monthdelivery).'">';
|
print $form->selectDate($search_datedelivery_start?$search_datedelivery_start:-1, 'search_datedelivery_start', 0, 0, 1);
|
||||||
//print ' '.$langs->trans('Year').': ';
|
print '</div>';
|
||||||
$formother->select_year($search_yeardelivery, 'search_yeardelivery', 1, 20, 5);
|
print '<div class="nowrap">';
|
||||||
|
print $langs->trans('to') . ' ';
|
||||||
|
print $form->selectDate($search_datedelivery_end?$search_datedelivery_end:-1, 'search_datedelivery_end', 0, 0, 1);
|
||||||
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Availability
|
// Availability
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user