From 12a127a3e71c15e9d82601acdad6e1e713818deb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 10 Jan 2024 17:15:53 +1100 Subject: [PATCH 1/2] Updates for ronin --- app/Console/Commands/CreateSingleAccount.php | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index 07a1355fb103..7170eec2c27f 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -100,6 +100,31 @@ class CreateSingleAccount extends Command $this->warmCache(); $this->createSmallAccount(); + + + try { + $pdo = \DB::connection('ronin')->getPdo(); + + if(class_exists(\Modules\Ronin\app\Models\Admin::class)){ + $this->info('Creating Ronin Account'); + $this->createRoninAccount(); + } + + } catch (\Exception $e) { + + } + + } + + private function createRoninAccount() + { + $admin = \Modules\Ronin\app\Models\Admin::create([ + 'first_name' => 'small', + 'last_name' => 'example', + 'email' => 'small@example.com', + 'password' => Hash::make('password'), + ]); + } private function createSmallAccount() From caa5b4b4308b87429159234b9e28bd8551a9d88e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 10 Jan 2024 18:18:02 +1100 Subject: [PATCH 2/2] v5.8.8 --- VERSION.txt | 2 +- config/ninja.php | 4 +- ...10_071427_normalize_product_cost_types.php | 53 +++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2024_01_10_071427_normalize_product_cost_types.php diff --git a/VERSION.txt b/VERSION.txt index 97276d1dee4b..6f4fe76b0940 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.7 \ No newline at end of file +5.8.8 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index add7d2a3baf8..92afeebfa804 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.7'), - 'app_tag' => env('APP_TAG', '5.8.7'), + 'app_version' => env('APP_VERSION', '5.8.8'), + 'app_tag' => env('APP_TAG', '5.8.8'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/database/migrations/2024_01_10_071427_normalize_product_cost_types.php b/database/migrations/2024_01_10_071427_normalize_product_cost_types.php new file mode 100644 index 000000000000..8c9530c4aca6 --- /dev/null +++ b/database/migrations/2024_01_10_071427_normalize_product_cost_types.php @@ -0,0 +1,53 @@ +where('is_deleted', false) + ->cursor() + ->each(function (Invoice $invoice) { + + + $line_items = $invoice->line_items; + + foreach ($line_items as $key => $item) { + + if(property_exists($item, 'product_cost')) { + $line_items[$key]->product_cost = (float) $line_items[$key]->product_cost; + } + + } + + $invoice->line_items = $line_items; + $invoice->saveQuietly(); + + }); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +};