Merge pull request #9129 from turbo124/v5-develop

v5.8.8
This commit is contained in:
David Bomba 2024-01-10 18:18:29 +11:00 committed by GitHub
commit 12b8f0785d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 3 deletions

View File

@ -1 +1 @@
5.8.7
5.8.8

View File

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

View File

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

View File

@ -0,0 +1,53 @@
<?php
use App\Utils\Ninja;
use App\Models\Invoice;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(Ninja::isHosted()) {
return;
}
set_time_limit(0);
Invoice::withTrashed()
->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
{
//
}
};