mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 19:18:22 +01:00
Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts: htdocs/core/lib/functions.lib.php htdocs/holiday/month_report.php
This commit is contained in:
@@ -4944,20 +4944,18 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
$nbofdectoround = '';
|
||||
if ($rounding == 'MU') {
|
||||
$nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_UNIT;
|
||||
}
|
||||
elseif ($rounding == 'MT') {
|
||||
} elseif ($rounding == 'MT') {
|
||||
$nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_TOT;
|
||||
}
|
||||
elseif ($rounding == 'MS') {
|
||||
$nbofdectoround = empty($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
|
||||
}
|
||||
elseif ($rounding == 'CU') {
|
||||
} elseif ($rounding == 'MS') {
|
||||
$nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? $conf->global->MAIN_MAX_DECIMALS_STOCK : 5;
|
||||
} elseif ($rounding == 'CU') {
|
||||
$nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_UNIT, 8); // TODO Use param of currency
|
||||
}
|
||||
elseif ($rounding == 'CT') {
|
||||
} elseif ($rounding == 'CT') {
|
||||
$nbofdectoround = max($conf->global->MAIN_MAX_DECIMALS_TOT, 8); // TODO Use param of currency
|
||||
} elseif (is_numeric($rounding)) {
|
||||
$nbofdectoround = $rounding;
|
||||
}
|
||||
elseif (is_numeric($rounding)) $nbofdectoround = $rounding;
|
||||
|
||||
//print " RR".$amount.' - '.$nbofdectoround.'<br>';
|
||||
if (dol_strlen($nbofdectoround)) $amount = round(is_string($amount) ? (float) $amount : $amount, $nbofdectoround); // $nbofdectoround can be 0.
|
||||
else return 'ErrorBadParameterProvidedToFunction';
|
||||
|
||||
@@ -1927,7 +1927,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
|
||||
if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
|
||||
{
|
||||
$prev_progress = 0;
|
||||
if (method_exists($object, 'get_prev_progress'))
|
||||
if (method_exists($object->lines[$i], 'get_prev_progress'))
|
||||
{
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
}
|
||||
|
||||
@@ -139,8 +139,11 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
|
||||
$sql .= " WHERE cp.rowid > 0";
|
||||
$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
|
||||
$sql .= " AND (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
|
||||
|
||||
$sql .= " AND (";
|
||||
$sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
|
||||
$sql .= " OR"; // For leave over several months
|
||||
$sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
|
||||
$sql .= " )";
|
||||
if (!empty($search_ref)) {
|
||||
$sql .= natural_search('cp.ref', $search_ref);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user