Merge pull request #1265 from burakcakirel/fix-amount-precision

Fix amount precision in Invoice and Bill factory
This commit is contained in:
Denis Duliçi 2020-02-17 23:30:04 +03:00 committed by GitHub
commit b1fe9e3425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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));