mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
12b8f0785d
@ -1 +1 @@
|
|||||||
5.8.7
|
5.8.8
|
@ -100,6 +100,31 @@ class CreateSingleAccount extends Command
|
|||||||
$this->warmCache();
|
$this->warmCache();
|
||||||
|
|
||||||
$this->createSmallAccount();
|
$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()
|
private function createSmallAccount()
|
||||||
|
@ -17,8 +17,8 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => env('APP_VERSION', '5.8.7'),
|
'app_version' => env('APP_VERSION', '5.8.8'),
|
||||||
'app_tag' => env('APP_TAG', '5.8.7'),
|
'app_tag' => env('APP_TAG', '5.8.8'),
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', false),
|
'api_secret' => env('API_SECRET', false),
|
||||||
|
@ -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
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user