This commit is contained in:
cuneytsenturk 2018-07-11 15:16:24 +03:00
parent 9a2adf777c
commit 80901078ea
2 changed files with 20 additions and 0 deletions

View File

@ -601,6 +601,16 @@ class Bills extends Controller
$total_amount -= $bill->payments()->paid();
}
// For amount cover integer
$multiplier = 1;
for ($i = 0; $i < $currency->precision; $i++) {
$multiplier *= 10;
}
$amount *= $multiplier;
$total_amount *= $multiplier;
if ($amount > $total_amount) {
$message = trans('messages.error.over_payment');

View File

@ -738,6 +738,16 @@ class Invoices extends Controller
$total_amount -= $invoice->payments()->paid();
}
// For amount cover integer
$multiplier = 1;
for ($i = 0; $i < $currency->precision; $i++) {
$multiplier *= 10;
}
$amount *= $multiplier;
$total_amount *= $multiplier;
if ($amount > $total_amount) {
$message = trans('messages.error.over_payment');