Skip to content

Commit

Permalink
improved sample data creation
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Apr 20, 2020
1 parent 419f146 commit decd525
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/Listeners/Sale/CreateInvoiceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ public function handle(Event $event)
} 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();
}

Expand Down
2 changes: 1 addition & 1 deletion database/factories/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
];

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));
Expand Down
2 changes: 1 addition & 1 deletion database/factories/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
];

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));
Expand Down
2 changes: 1 addition & 1 deletion database/seeds/SampleData.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function run()
{
Model::reguard();

config(['mail.default' => 'log']);
config(['mail.default' => 'array']);

$count = (int) $this->command->option('count');
$small_count = ($count <= 10) ? $count : 10;
Expand Down

0 comments on commit decd525

Please sign in to comment.