FIX : Using function getSommePaiement() instead of using SQL request

This commit is contained in:
Adrien Raze 2021-03-09 11:35:24 +01:00
parent c55c1ab854
commit 07015ef29e

View File

@ -604,15 +604,11 @@ if ($id) {
$morehtmlref .= '</form>';
}
$sql = 'SELECT fk_salary, amount';
$sql .= ' FROM '.MAIN_DB_PREFIX.'payment_salary';
$sql .= ' WHERE fk_salary = '.$object->id;
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);
$sal = new Salary($db);
$sal->fetch($object->id);
//Employee
if ($action != 'editfk_user') {
if (!empty($obj) && !empty($object->fk_user)) {
if ($sal->getSommePaiement() > 0 && !empty($object->fk_user)){
$userstatic = new User($db);
$result = $userstatic->fetch($object->fk_user);
if ($result > 0) {