Skip to content

Commit 2607582

Browse files
authored
Merge pull request #1164 from Blair2004/v4.8.x
V4.8.x
2 parents 2458aa9 + 1682d80 commit 2607582

12 files changed

+34
-7
lines changed

app/Casts/FloatConvertCasting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FloatConvertCasting implements CastsAttributes
1717
*/
1818
public function get($model, string $key, $value, array $attributes)
1919
{
20-
return ns()->currency->getRaw( $value );
20+
return ns()->math->set( $value ?: 0 )->toFloat();
2121
}
2222

2323
/**

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/Providers/AppServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use App\Services\DemoService;
1717
use App\Services\ExpenseService;
1818
use App\Services\Helper;
19+
use App\Services\MathService;
1920
use App\Services\MediaService;
2021
use App\Services\MenuService;
2122
use App\Services\NotificationService;
@@ -129,7 +130,8 @@ public function register()
129130
app()->make( OrdersService::class ),
130131
app()->make( NotificationService::class ),
131132
app()->make( ProcurementService::class ),
132-
app()->make( Options::class )
133+
app()->make( Options::class ),
134+
app()->make( MathService::class )
133135
);
134136
});
135137

app/Services/CoreService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public function __construct(
2929
public OrdersService $order,
3030
public NotificationService $notification,
3131
public ProcurementService $procurement,
32-
public Options $option
32+
public Options $option,
33+
public MathService $math
3334
) {
3435
// ...
3536
}

app/Services/MathService.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
namespace App\Services;
3+
4+
use Brick\Math\BigNumber;
5+
6+
class MathService
7+
{
8+
public function set( $value )
9+
{
10+
return BigNumber::of( $value );
11+
}
12+
}

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
}

public/css/animations.cb4544d9bb06aeaa8e48.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/css/app.5fa7c899f29731ce3255.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)