refs #412
This commit is contained in:
@ -601,6 +601,16 @@ class Bills extends Controller
|
|||||||
$total_amount -= $bill->payments()->paid();
|
$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) {
|
if ($amount > $total_amount) {
|
||||||
$message = trans('messages.error.over_payment');
|
$message = trans('messages.error.over_payment');
|
||||||
|
|
||||||
|
@ -738,6 +738,16 @@ class Invoices extends Controller
|
|||||||
$total_amount -= $invoice->payments()->paid();
|
$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) {
|
if ($amount > $total_amount) {
|
||||||
$message = trans('messages.error.over_payment');
|
$message = trans('messages.error.over_payment');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user