make 0 the smallest reimbursed amount
continuous-integration/drone/push Build is passing Details

pull/2226/head
Max Mehl 2021-10-19 17:02:34 +02:00
parent 2e74fd1c65
commit 0ecabe1e47
Signed by: max.mehl
GPG Key ID: 2704E4AB371E2E92
1 changed files with 5 additions and 0 deletions

View File

@ -204,6 +204,11 @@ foreach ($use as $d => $day) { // calculate for each day
$reimb_day[$d] = $reimb_day[$d] - $maxamount_full * $rate_dinner;
}
// Avoid negative amounts
if ($reimb_day[$d] < 0) {
$reimb_day[$d] = 0;
}
// add on top of total reimbursement
$reimb_total = $reimb_total + $reimb_day[$d];