Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-10-04 19:08:38 +02:00
commit 2ef65a2877
5 changed files with 19 additions and 19 deletions

View File

@ -724,7 +724,7 @@ function getFormeJuridiqueLabel($code)
function getCountriesInEEC()
{
// List of all country codes that are in europe for european vat rules
// List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9
// List found on https://ec.europa.eu/taxation_customs/territorial-status-eu-countries-and-certain-territories_en
global $conf, $db;
$country_code_in_EEC = array();

View File

@ -277,10 +277,14 @@ if (empty($reshook)) {
}
}
if (!$error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS) && $object->periode_existe($fuser, $object->date_debut, $object->date_fin)) {
$error++;
setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors');
$action = 'create';
if (!$error && empty($conf->global->EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS)) {
$overlappingExpenseReportID = $object->periode_existe($fuser, $object->date_debut, $object->date_fin, true);
if ($overlappingExpenseReportID > 0) {
$error++;
setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'. $langs->trans('ShowTrip').'</a>', null, 'errors');
$action = 'create';
}
}
if (!$error) {

View File

@ -2213,8 +2213,6 @@ class ExpenseReport extends CommonObject
$date_d_form = $date_debut;
$date_f_form = $date_fin;
$existe = false;
while ($i < $num_rows) {
$objp = $this->db->fetch_object($result);
@ -2222,17 +2220,13 @@ class ExpenseReport extends CommonObject
$date_f_req = $this->db->jdate($objp->date_fin); // 4
if (!($date_f_form < $date_d_req || $date_d_form > $date_f_req)) {
$existe = true;
return $objp->rowid;
}
$i++;
}
if ($existe) {
return 1;
} else {
return 0;
}
return 0;
} else {
return 0;
}

View File

@ -279,5 +279,5 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (24
-- Set field eec
UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');
UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');

View File

@ -618,11 +618,13 @@ if ($search_ref_supplier) {
$param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
}
// Add $param from extra fields
foreach ($search_array_options as $key => $val) {
$crit = $val;
$tmpkey = preg_replace('/search_options_/', '', $key);
if ($val != '') {
$param .= '&search_options_'.$tmpkey.'='.urlencode($val);
if ($search_array_options) {
foreach ($search_array_options as $key => $val) {
$crit = $val;
$tmpkey = preg_replace('/search_options_/', '', $key);
if ($val != '') {
$param .= '&search_options_' . $tmpkey . '=' . urlencode($val);
}
}
}