1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Use parseFloat to parse payment amount

This commit is contained in:
Hillel Coren 2018-02-16 11:58:07 +02:00
parent 9ae464cbb6
commit ef250ec78f

View File

@ -153,7 +153,7 @@ class PaymentService extends BaseService
public function save($input, $payment = null, $invoice = null)
{
// if the payment amount is more than the balance create a credit
if ($invoice && $input['amount'] > $invoice->balance) {
if ($invoice && Utils::parseFloat($input['amount']) > $invoice->balance) {
$credit = Credit::createNew();
$credit->client_id = $invoice->client_id;
$credit->credit_date = date_create()->format('Y-m-d');