diff --git a/app/Listeners/Sale/CreateInvoiceTransaction.php b/app/Listeners/Sale/CreateInvoiceTransaction.php index 06465ab58..064522a24 100644 --- a/app/Listeners/Sale/CreateInvoiceTransaction.php +++ b/app/Listeners/Sale/CreateInvoiceTransaction.php @@ -26,9 +26,11 @@ class CreateInvoiceTransaction } catch (\Exception $e) { $message = $e->getMessage(); - if (!$user = user()) { + $user = user(); + + if (empty($user)) { flash($message)->error(); - + redirect()->route('signed.invoices.show', $invoice->id)->send(); } diff --git a/database/factories/Bill.php b/database/factories/Bill.php index daed8e6c3..c63624cfd 100644 --- a/database/factories/Bill.php +++ b/database/factories/Bill.php @@ -171,7 +171,7 @@ $factory->afterCreating(Bill::class, function ($bill, $faker) use ($company) { ]; if ($init_status == 'partial') { - $payment_request['amount'] = round($amount / 3, $bill->currency->precision); + $payment_request['amount'] = (int) 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 7c0cabd89..59c06e806 100644 --- a/database/factories/Invoice.php +++ b/database/factories/Invoice.php @@ -180,7 +180,7 @@ $factory->afterCreating(Invoice::class, function ($invoice, $faker) use ($compan ]; if ($init_status == 'partial') { - $payment_request['amount'] = round($amount / 3, $invoice->currency->precision); + $payment_request['amount'] = (int) round($amount / 3, $invoice->currency->precision); } event(new PaymentReceived($updated_invoice, $payment_request)); diff --git a/database/seeds/SampleData.php b/database/seeds/SampleData.php index 86d066993..47414b85f 100755 --- a/database/seeds/SampleData.php +++ b/database/seeds/SampleData.php @@ -23,7 +23,7 @@ class SampleData extends Seeder { Model::reguard(); - config(['mail.default' => 'log']); + config(['mail.default' => 'array']); $count = (int) $this->command->option('count'); $small_count = ($count <= 10) ? $count : 10;