diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 7a758137133..6b36e950f78 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -349,6 +349,7 @@ if (empty($reshook)) $newprice = price2num($newprice, 'MU'); $newprice_min = price2num($val['price_min'], 'MU'); + $newvattx = price2num($val['vat_tx']); if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) { setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, - 1, - 1, 'auto')), null, 'errors'); @@ -356,10 +357,11 @@ if (empty($reshook)) break; } - if ($object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type']) + if ($object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type']) { $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); - else $res = 0; - + } else { + $res = 0; + } if ($res < 0) { $error++; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index a4a37f22a31..79a259f1ccc 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -207,7 +207,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') { // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) $sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; - $sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 9a95f8abf79..63c7d160e0a 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -164,7 +164,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') { // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) $sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; - $sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index c29486302af..d7c0f874383 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -220,7 +220,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') { // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) $sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; - $sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'"; $resql = $db->query($sql); if ($resql) {