diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 987c29bae70..272ff800977 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1867,7 +1867,7 @@ if ($resql) { $remaintopay = 0; $multicurrency_remaintopay = 0; } - if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consummed + if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consumed $remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id); $remaintopay = -$remaincreditnote; $totalpay = price2num($facturestatic->total_ttc - $remaintopay); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d26724aa618..73eaa702af7 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -427,7 +427,7 @@ if (empty($reshook)) { } else { $idprod = GETPOST('idprod', 'int'); } - $tva_tx = (GETPOST('tva_tx', 'alpha') ? price2num(preg_replace('/\s*\(.*\)/', '', GETPOST('tva_tx', 'alpha'))) : 0); + $tva_tx = GETPOST('tva_tx', 'alpha'); $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS'); $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef), 2) : 0); @@ -467,7 +467,8 @@ if (empty($reshook)) { $date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); - // Ecrase $tva_tx par celui du produit + // Ecrase $tva_tx par celui du produit. TODO Remove this once vat selection is open + // Get and check minimum price if ($idprod > 0) { $prod = new Product($db); $prod->fetch($idprod); @@ -557,11 +558,11 @@ if (empty($reshook)) { // Set unit price to use if (!empty($price_ht) || $price_ht === '0') { $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); + $pu_ttc = price2num($pu_ht * (1 + ((float) $tmpvat / 100)), 'MU'); $price_base_type = 'HT'; } elseif (!empty($price_ttc) || $price_ttc === '0') { $pu_ttc = price2num($price_ttc, 'MU'); - $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); + $pu_ht = price2num($pu_ttc / (1 + ((float) $tmpvat / 100)), 'MU'); $price_base_type = 'TTC'; } } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index ec2ecabcf0d..cafb93a4091 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1565,7 +1565,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $ // If no SQL error, we redirect to the request form if (!$error) { - // Calculcate number of days consummed + // Calculcate number of days consumed $nbopenedday = num_open_day($objecttmp->date_debut_gmt, $objecttmp->date_fin_gmt, 0, 1, $objecttmp->halfday); $soldeActuel = $objecttmp->getCpforUser($objecttmp->fk_user, $objecttmp->fk_type); $newSolde = ($soldeActuel - $nbopenedday); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a8062d624f0..ed9b6560618 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1117,7 +1117,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $extrafieldsobjectkey = $contactstatic->table_element; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - $sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,"; + $sql = "SELECT t.rowid, t.entity, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,"; $sql .= " t.civility as civility_id, t.address, t.zip, t.town"; $sql .= ", t.note_private"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; @@ -1272,6 +1272,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $contactstatic->email = $obj->email; $contactstatic->socialnetworks = $obj->socialnetworks; $contactstatic->photo = $obj->photo; + $contactstatic->entity = $obj->entity; $country_code = getCountry($obj->country_id, 2); $contactstatic->country_code = $country_code; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index b944e8b47a5..f8e998101bc 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1324,7 +1324,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if (!empty($arrayfields['timeconsumed']['checked'])) { // Time spent by everybody print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user + // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user if ($lines[$i]->duration) { print ''; print convertSecondToTime($lines[$i]->duration, 'allhourmin'); @@ -1730,7 +1730,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ if (!empty($arrayfields['timeconsumed']['checked'])) { // Time spent by everybody print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user + // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user if ($lines[$i]->duration) { print ''; print convertSecondToTime($lines[$i]->duration, 'allhourmin'); @@ -2024,7 +2024,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & // Time spent by everybody print ''; - // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user + // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user if ($lines[$i]->duration) { print ''; print convertSecondToTime($lines[$i]->duration, 'allhourmin'); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 0a8f7a5c760..3e800760606 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -586,7 +586,7 @@ if (empty($reshook)) { // If no SQL error, we redirect to the request form if (!$error) { - // Calculcate number of days consummed + // Calculcate number of days consumed $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type); $newSolde = ($soldeActuel - $nbopenedday); @@ -810,7 +810,7 @@ if (empty($reshook)) { $error++; } - // Calculcate number of days consummed + // Calculcate number of days consumed $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);