';
print ' | ';
print ' | ';
- print '';
- if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
- print '';
- }
- print '';
- $formother->select_year($search_year, 'search_year', 1, 20, 5);
+ print ' | ';
+ print ' ';
+ print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print ' ';
+ print '';
+ print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+ print ' ';
print ' | ';
print ' | ';
//print ' | ';
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index deed1299fd5..90e7213c8f9 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -54,9 +54,14 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
-$search_day = GETPOST("search_day", "int");
-$search_month = GETPOST("search_month", "int");
-$search_year = GETPOST("search_year", "int");
+$search_date_startday = GETPOST('search_date_startday', 'int');
+$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
+$search_date_startyear = GETPOST('search_date_startyear', 'int');
+$search_date_endday = GETPOST('search_date_endday', 'int');
+$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
+$search_date_endyear = GETPOST('search_date_endyear', 'int');
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_country = GETPOST('search_country', 'alpha');
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
@@ -112,9 +117,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_amount = '';
$search_account = '';
$search_vat = '';
- $search_day = '';
- $search_month = '';
- $search_year = '';
+ $search_date_startday = '';
+ $search_date_startmonth = '';
+ $search_date_startyear = '';
+ $search_date_endday = '';
+ $search_date_endmonth = '';
+ $search_date_endyear = '';
+ $search_date_start = '';
+ $search_date_end = '';
$search_country = '';
$search_tvaintra = '';
}
@@ -234,7 +244,12 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("l.tva_tx", price2num($search_vat), 1);
}
-$sql .= dolSqlDateFilter('f.datef', $search_day, $search_month, $search_year);
+if ($search_date_start) {
+ $sql .= " AND f.datef >= '".$db->idate($search_date_start)."'";
+}
+if ($search_date_end) {
+ $sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
+}
if (strlen(trim($search_country))) {
$arrayofcode = getCountriesInEEC();
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
@@ -315,14 +330,23 @@ if ($result) {
if ($search_vat) {
$param .= "&search_vat=".urlencode($search_vat);
}
- if ($search_day) {
- $param .= '&search_day='.urlencode($search_day);
+ if ($search_date_startday) {
+ $param .= '&search_date_startday='.urlencode($search_date_startday);
}
- if ($search_month) {
- $param .= '&search_month='.urlencode($search_month);
+ if ($search_date_startmonth) {
+ $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
}
- if ($search_year) {
- $param .= '&search_year='.urlencode($search_year);
+ if ($search_date_startyear) {
+ $param .= '&search_date_startyear='.urlencode($search_date_startyear);
+ }
+ if ($search_date_endday) {
+ $param .= '&search_date_endday='.urlencode($search_date_endday);
+ }
+ if ($search_date_endmonth) {
+ $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
+ }
+ if ($search_date_endyear) {
+ $param .= '&search_date_endyear='.urlencode($search_date_endyear);
}
if ($search_country) {
$param .= "&search_country=".urlencode($search_country);
@@ -359,12 +383,13 @@ if ($result) {
print ' | ';
print ' | ';
print ' | ';
- print '';
- if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
- print '';
- }
- print '';
- $formother->select_year($search_year, 'search_year', 1, 20, 5);
+ print ' | ';
+ print ' ';
+ print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print ' ';
+ print '';
+ print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+ print ' ';
print ' | ';
print ' | ';
print ' | ';
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index dda111856d3..cc3430af872 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2013-2020 Alexandre Spangaro
+ * Copyright (C) 2013-2021 Alexandre Spangaro
* Copyright (C) 2014-2015 Ari Elbaz (elarifr)
* Copyright (C) 2013-2014 Florian Henry
* Copyright (C) 2014 Juanjo Menent s
@@ -60,9 +60,14 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
-$search_day = GETPOST("search_day", "int");
-$search_month = GETPOST("search_month", "int");
-$search_year = GETPOST("search_year", "int");
+$search_date_startday = GETPOST('search_date_startday', 'int');
+$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
+$search_date_startyear = GETPOST('search_date_startyear', 'int');
+$search_date_endday = GETPOST('search_date_endday', 'int');
+$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
+$search_date_endyear = GETPOST('search_date_endyear', 'int');
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_country = GETPOST('search_country', 'alpha');
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
@@ -140,9 +145,14 @@ if (empty($reshook)) {
$search_amount = '';
$search_account = '';
$search_vat = '';
- $search_day = '';
- $search_month = '';
- $search_year = '';
+ $search_date_startday = '';
+ $search_date_startmonth = '';
+ $search_date_startyear = '';
+ $search_date_endday = '';
+ $search_date_endmonth = '';
+ $search_date_endyear = '';
+ $search_date_start = '';
+ $search_date_end = '';
$search_country = '';
$search_tvaintra = '';
}
@@ -293,7 +303,12 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("l.tva_tx", price2num($search_vat), 1);
}
-$sql .= dolSqlDateFilter('f.datef', $search_day, $search_month, $search_year);
+if ($search_date_start) {
+ $sql .= " AND f.datef >= '".$db->idate($search_date_start)."'";
+}
+if ($search_date_end) {
+ $sql .= " AND f.datef <= '".$db->idate($search_date_end)."'";
+}
if (strlen(trim($search_country))) {
$arrayofcode = getCountriesInEEC();
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
@@ -372,14 +387,23 @@ if ($result) {
if ($search_lineid) {
$param .= '&search_lineid='.urlencode($search_lineid);
}
- if ($search_day) {
- $param .= '&search_day='.urlencode($search_day);
+ if ($search_date_startday) {
+ $param .= '&search_date_startday='.urlencode($search_date_startday);
}
- if ($search_month) {
- $param .= '&search_month='.urlencode($search_month);
+ if ($search_date_startmonth) {
+ $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
}
- if ($search_year) {
- $param .= '&search_year='.urlencode($search_year);
+ if ($search_date_startyear) {
+ $param .= '&search_date_startyear='.urlencode($search_date_startyear);
+ }
+ if ($search_date_endday) {
+ $param .= '&search_date_endday='.urlencode($search_date_endday);
+ }
+ if ($search_date_endmonth) {
+ $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
+ }
+ if ($search_date_endyear) {
+ $param .= '&search_date_endyear='.urlencode($search_date_endyear);
}
if ($search_invoice) {
$param .= '&search_invoice='.urlencode($search_invoice);
@@ -444,12 +468,13 @@ if ($result) {
print ' | ';
print ' | ';
//print ' | ';
- print '';
- if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
- print '';
- }
- print '';
- $formother->select_year($search_year, 'search_year', 1, 20, 5);
+ print ' | ';
+ print ' ';
+ print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print ' ';
+ print '';
+ print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+ print ' ';
print ' | ';
print ' | ';
print ' | ';