Skip to content

Commit ddd5474

Browse files
committed
Update
- Fixed: #1161 Unserialize issue for Carbon instances.
1 parent e1a14b7 commit ddd5474

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

app/Jobs/RecomputeCashFlowForDate.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Models\Role;
66
use App\Services\ReportService;
7+
use Carbon\Carbon;
78
use Illuminate\Bus\Queueable;
89
use Illuminate\Contracts\Queue\ShouldQueue;
910
use Illuminate\Foundation\Bus\Dispatchable;
@@ -40,6 +41,9 @@ public function handle()
4041
Auth::login( $user );
4142
}
4243

44+
$this->fromDate = Carbon::parse( $this->fromDate );
45+
$this->toDate = Carbon::parse( $this->toDate );
46+
4347
/**
4448
* @var ReportService $reportService
4549
*/

app/Services/UpdateService.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public function getMigrations( $ignoreMigrations = false ): Collection
3030
$migrations = Migration::get()->map( fn( $migration ) => $migration->migration );
3131
}
3232

33-
$files = collect( Storage::disk( 'ns' )->allFiles( 'database/migrations' ) )->map( function( $file ) {
33+
$files = collect( Storage::disk( 'ns' )->allFiles( 'database/migrations' ) )
34+
->filter( fn( $file ) => pathinfo( $file )[ 'extension' ] === 'php' )
35+
->map( function( $file ) {
3436
$fileInfo = pathinfo( $file );
3537

3638
return $fileInfo[ 'filename' ];
@@ -41,7 +43,9 @@ public function getMigrations( $ignoreMigrations = false ): Collection
4143

4244
public function getMatchingFullPath( $file )
4345
{
44-
$files = collect( Storage::disk( 'ns' )->allFiles( 'database/migrations' ) )->mapWithKeys( function( $file ) {
46+
$files = collect( Storage::disk( 'ns' )->allFiles( 'database/migrations' ) )
47+
->filter( fn( $file ) => pathinfo( $file )[ 'extension' ] === 'php' )
48+
->mapWithKeys( function( $file ) {
4549
$fileInfo = pathinfo( $file );
4650

4751
return [ $fileInfo[ 'filename' ] => $file ];

config/nexopos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
return [
4-
'version' => '4.8.7',
4+
'version' => '4.8.8',
55
'languages' => [
66
'en' => 'English',
77
'fr' => 'Français',

database/migrations/update/2022_01_02_200145_wipe_cash_flow_transaction_2janv22.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function up()
2020
$fromDate = Carbon::parse( $order->created_at );
2121
$toDate = ns()->date->copy()->endOfDay();
2222

23-
RecomputeCashFlowForDate::dispatch( $fromDate, $toDate )
23+
RecomputeCashFlowForDate::dispatch( $fromDate->toDateTimeString(), $toDate->toDateTimeString() )
2424
->delay( now()->addMinute() );
2525
}
2626
}

0 commit comments

Comments
 (0)