diff --git a/database/factories/Bill.php b/database/factories/Bill.php index b5f8bd3e5..a2fa331d0 100644 --- a/database/factories/Bill.php +++ b/database/factories/Bill.php @@ -135,7 +135,7 @@ $factory->afterCreating(Bill::class, function ($bill, $faker) use ($company) { ]; if ($init_status == 'partial') { - $payment_request['amount'] = (double) $amount / 3; + $payment_request['amount'] = round($amount / 3, $bill->currency->precision); } $transaction = dispatch_now(new CreateDocumentTransaction($updated_bill, $payment_request)); diff --git a/database/factories/Invoice.php b/database/factories/Invoice.php index 2222f9aa8..3fde72571 100644 --- a/database/factories/Invoice.php +++ b/database/factories/Invoice.php @@ -144,7 +144,7 @@ $factory->afterCreating(Invoice::class, function ($invoice, $faker) use ($compan ]; if ($init_status == 'partial') { - $payment_request['amount'] = (double) $amount / 3; + $payment_request['amount'] = round($amount / 3, $invoice->currency->precision); } event(new PaymentReceived($updated_invoice, $payment_request));