Merge branch 'NEW/ExpenseReport_ik_add' of github.com:atm-jpb/dolibarr into NEW/ExpenseReport_ik_add

This commit is contained in:
jpb 2022-05-24 09:07:25 +02:00
commit a4c5ba7239
2 changed files with 3 additions and 8 deletions

View File

@ -101,7 +101,6 @@ if (empty($fk_expense) || $fk_expense < 0) {
$rep->response_status = 'success'; $rep->response_status = 'success';
} }
} }
} }
} }
} }

View File

@ -2604,9 +2604,7 @@ class ExpenseReport extends CommonObject
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) { if ($result) {
if ($conf->global->EXPENSEREPORT_CALCULATE_MILEAGE_EXPENSE_COEFFICIENT_ON_CURRENT_YEAR) { if ($conf->global->EXPENSEREPORT_CALCULATE_MILEAGE_EXPENSE_COEFFICIENT_ON_CURRENT_YEAR) {
$arrayDate = dol_getdate(dol_now()); $arrayDate = dol_getdate(dol_now());
$sql = " SELECT count(n.qty) as cumul FROM ".MAIN_DB_PREFIX."expensereport_det n"; $sql = " SELECT count(n.qty) as cumul FROM ".MAIN_DB_PREFIX."expensereport_det n";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport e ON e.rowid = n.fk_expensereport"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport e ON e.rowid = n.fk_expensereport";
@ -2623,7 +2621,6 @@ class ExpenseReport extends CommonObject
$cumulYearQty = $obj->cumul; $cumulYearQty = $obj->cumul;
} }
$qty = $cumulYearQty + $qty; $qty = $cumulYearQty + $qty;
} }
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
@ -2638,7 +2635,6 @@ class ExpenseReport extends CommonObject
for ($i = 0; $i < $num; $i++) { for ($i = 0; $i < $num; $i++) {
if ($i < ($num - 1)) { if ($i < ($num - 1)) {
if ($qty > $ranges[$i]->range_ik && $qty < $ranges[$i+1]->range_ik) { if ($qty > $ranges[$i]->range_ik && $qty < $ranges[$i+1]->range_ik) {
$coef = $ranges[$i]->coef; $coef = $ranges[$i]->coef;
$offset = $ranges[$i]->offset; $offset = $ranges[$i]->offset;