Fix amount precision in Invoice and Bill factory
This commit is contained in:
parent
100c815776
commit
cc5157b2a6
@ -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));
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user