improved sample data creation

This commit is contained in:
denisdulici 2020-04-20 11:35:20 +03:00
parent 419f146d8d
commit decd525e55
4 changed files with 7 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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