Fix amount precision in Invoice and Bill factory

This commit is contained in:
Burak Çakırel 2020-02-17 23:24:58 +03:00
parent 100c815776
commit cc5157b2a6
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -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));