diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 29d4f91952b..a088d94a01c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3556,7 +3556,7 @@ if ($action == 'create') { if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1) { $(".retained-warranty-line").show(); - $("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'"); + $("#new-situation-invoice-retained-warranty").val("'.floatval($retained_warranty_js_default).'"); } else{ $(".retained-warranty-line").hide(); diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index ed3981d243d..364565af3aa 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -437,7 +437,7 @@ class CUnits // extends CommonObject */ public function unitConverter($value, $fk_unit, $fk_new_unit = 0) { - $value = doubleval(price2num($value)); + $value = floatval(price2num($value)); $fk_unit = intval($fk_unit); // Calcul en unité de base @@ -469,10 +469,10 @@ class CUnits // extends CommonObject if ($unit) { // TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60 if ($unit->unit_type == 'time') { - return doubleval($unit->scale); + return floatval($unit->scale); } - return pow($base, doubleval($unit->scale)); + return pow($base, floatval($unit->scale)); } return 0; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 0315e848e94..ffa06ebd508 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2694,7 +2694,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide // define progress color according to time spend vs workload $progressBarClass = 'progress-bar-info'; if ($task->planned_workload) { - $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2); + $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); // this conf is actually hidden, by default we use 10% for "be carefull or warning" $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; @@ -2702,12 +2702,12 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $diffTitle = '
'.$langs->trans('ProgressDeclared').' : '.$task->progress.($task->progress ? '%' : ''); $diffTitle .= '
'.$langs->trans('ProgressCalculated').' : '.$progressCalculated.($progressCalculated ? '%' : ''); - //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.doubleval($task->progress * $warningRatio)); - if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) { + //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.floatval($task->progress * $warningRatio)); + if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) { $progressBarClass = 'progress-bar-danger'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress - $progressCalculated).'%'; - } elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10% + } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10% $progressBarClass = 'progress-bar-warning'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress - $progressCalculated).'%'; @@ -2771,18 +2771,18 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $out .= ''; $out .= '
'; - $diffval = doubleval($task->progress) - doubleval($progressCalculated); + $diffval = floatval($task->progress) - floatval($progressCalculated); if ($diffval >= 0) { // good - $out .= '
'; + $out .= '
'; if (!empty($task->progress)) { - $out .= '
'; + $out .= '
'; } $out .= '
'; } else { // bad - $out .= '
'; - $out .= '
'; + $out .= '
'; + $out .= '
'; $out .= '
'; } $out .= '
'; @@ -2811,17 +2811,17 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '') // define color according to time spend vs workload $badgeClass = 'badge '; if ($task->planned_workload) { - $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2); + $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); // this conf is actually hidden, by default we use 10% for "be carefull or warning" $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; - if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) { + if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) { $badgeClass .= 'badge-danger'; if (empty($tooltip)) { $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%'; } - } elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10% + } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10% $badgeClass .= 'badge-warning'; if (empty($tooltip)) { $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%'; diff --git a/htdocs/index.php b/htdocs/index.php index 5485f9bc7be..91b2de32087 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -472,7 +472,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $classe = (!empty($classes[$keyIndex]) ? $classes[$keyIndex] : ''); if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) { $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0; - $nbTotal = doubleval($groupElement['globalStats']['total']); + $nbTotal = floatval($groupElement['globalStats']['total']); if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).'k'; } diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 762d2eff124..29cfdf731f9 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -513,8 +513,8 @@ class ProductCombination if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) { $new_type = $parent->multiprices_base_type[$i]; $new_min_price = $parent->multiprices_min[$i]; - $variation_price = doubleval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price); - $variation_price_percentage = doubleval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage); + $variation_price = floatval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price); + $variation_price_percentage = floatval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage); if ($parent->prices_by_qty_list[$i]) { $new_psq = 1; @@ -1093,9 +1093,9 @@ class ProductCombinationLevel } $this->id = $obj->rowid; - $this->fk_product_attribute_combination = doubleval($obj->fk_product_attribute_combination); + $this->fk_product_attribute_combination = floatval($obj->fk_product_attribute_combination); $this->fk_price_level = intval($obj->fk_price_level); - $this->variation_price = doubleval($obj->variation_price); + $this->variation_price = floatval($obj->variation_price); $this->variation_price_percentage = (bool) $obj->variation_price_percentage; return 1; @@ -1129,7 +1129,7 @@ class ProductCombinationLevel // Update if (!empty($this->id)) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET variation_price = '.doubleval($this->variation_price).' , variation_price_percentage = '.intval($this->variation_price_percentage); + $sql .= ' SET variation_price = '.floatval($this->variation_price).' , variation_price_percentage = '.intval($this->variation_price_percentage); $sql .= ' WHERE rowid = '.((int) $this->id); $res = $this->db->query($sql); @@ -1147,7 +1147,7 @@ class ProductCombinationLevel $sql .= ") VALUES ("; $sql .= (int) $this->fk_product_attribute_combination; $sql .= ", ".intval($this->fk_price_level); - $sql .= ", ".doubleval($this->variation_price); + $sql .= ", ".floatval($this->variation_price); $sql .= ", ".intval($this->variation_price_percentage); $sql .= ")"; diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index 6bf43bf78f6..621a4a7a286 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.php @@ -169,7 +169,7 @@ function createPayment($authentication, $payment) $soc->fetch($payment['thirdparty_id']); $new_payment = new Paiement($db); - $new_payment->amount = doubleval($payment['amount']); + $new_payment->amount = floatval($payment['amount']); $new_payment->num_payment = $payment['num_payment']; $new_payment->fk_account = intval($payment['bank_account']); $new_payment->paiementid = !empty($payment['payment_mode_id']) ? intval($payment['payment_mode_id']) : $soc->mode_reglement_id;