Fixing style errors.
This commit is contained in:
parent
c546f105fa
commit
d425e14d0d
@ -90,7 +90,7 @@ if (empty($fk_expense) || $fk_expense < 0) {
|
|||||||
} else {
|
} else {
|
||||||
$expense = new ExpenseReport($db);
|
$expense = new ExpenseReport($db);
|
||||||
$result = $expense->fetch($fk_expense);
|
$result = $expense->fetch($fk_expense);
|
||||||
if ($result){
|
if ($result) {
|
||||||
$result = $expense->computeTotalKm($fk_c_exp_tax_cat, $qty, $vatrate);
|
$result = $expense->computeTotalKm($fk_c_exp_tax_cat, $qty, $vatrate);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$rep->error = $result;
|
$rep->error = $result;
|
||||||
@ -101,7 +101,6 @@ if (empty($fk_expense) || $fk_expense < 0) {
|
|||||||
$rep->response_status = 'success';
|
$rep->response_status = 'success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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";
|
||||||
@ -2616,12 +2614,11 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql.= " AND e.fk_statut = ".(int) ExpenseReport::STATUS_VALIDATED;
|
$sql.= " AND e.fk_statut = ".(int) ExpenseReport::STATUS_VALIDATED;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resql){
|
if ($resql) {
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$cumulYearQty = $obj->cumul;
|
$cumulYearQty = $obj->cumul;
|
||||||
}
|
}
|
||||||
$qty = $cumulYearQty + $qty;
|
$qty = $cumulYearQty + $qty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
@ -2636,7 +2633,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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user