Bug correction in Invoices class

There was an error in Invoices class, leading to an undefined result if
the user was not in the invoice.
This commit is contained in:
Phyks 2013-11-09 18:00:00 +01:00
parent 9535c47810
commit 38e8bcc766
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@
}
// Amount is stored in cents
return round($this->amount / 100 / (count($users_in) + $guests) * (1 + $users_in[(int) $id]), 2); // Note : $users_in[(int) $id] is the number of guests for user $id
return (isset($users_in[(int) $id])) ? round($this->amount / 100 / (count($users_in) + $guests) * (1 + $users_in[(int) $id]), 2) : 0; // Note : $users_in[(int) $id] is the number of guests for user $id
}
// Maps htmlspecialchars on the class before display