removed invoice/bill status tables
This commit is contained in:
@@ -556,7 +556,6 @@ class CoreV1 extends Migration
|
||||
Schema::drop('bill_histories');
|
||||
Schema::drop('bill_items');
|
||||
Schema::drop('bill_item_taxes');
|
||||
Schema::drop('bill_statuses');
|
||||
Schema::drop('bill_totals');
|
||||
Schema::drop('categories');
|
||||
Schema::drop('companies');
|
||||
@@ -565,7 +564,6 @@ class CoreV1 extends Migration
|
||||
Schema::drop('invoice_histories');
|
||||
Schema::drop('invoice_items');
|
||||
Schema::drop('invoice_item_taxes');
|
||||
Schema::drop('invoice_statuses');
|
||||
Schema::drop('invoice_totals');
|
||||
Schema::drop('items');
|
||||
Schema::drop('jobs');
|
||||
|
@@ -41,6 +41,7 @@ class CoreV200 extends Migration
|
||||
});
|
||||
|
||||
$rename_bills = [
|
||||
'bill_status_code' => 'status',
|
||||
'vendor_id' => 'contact_id',
|
||||
'vendor_name' => 'contact_name',
|
||||
'vendor_email' => 'contact_email',
|
||||
@@ -55,7 +56,14 @@ class CoreV200 extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
Schema::table('bill_histories', function (Blueprint $table) {
|
||||
$table->renameColumn('status_code', 'status');
|
||||
});
|
||||
|
||||
Schema::drop('bill_statuses');
|
||||
|
||||
$rename_invoices = [
|
||||
'invoice_status_code' => 'status',
|
||||
'customer_id' => 'contact_id',
|
||||
'customer_name' => 'contact_name',
|
||||
'customer_email' => 'contact_email',
|
||||
@@ -70,6 +78,12 @@ class CoreV200 extends Migration
|
||||
});
|
||||
}
|
||||
|
||||
Schema::table('invoice_histories', function (Blueprint $table) {
|
||||
$table->renameColumn('status_code', 'status');
|
||||
});
|
||||
|
||||
Schema::drop('invoice_statuses');
|
||||
|
||||
// Dashboards
|
||||
Schema::create('dashboards', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
@@ -129,7 +143,7 @@ class CoreV200 extends Migration
|
||||
$table->boolean('blocked')->default(1);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
|
||||
$table->index('ip');
|
||||
$table->unique(['ip', 'deleted_at']);
|
||||
});
|
||||
@@ -145,7 +159,7 @@ class CoreV200 extends Migration
|
||||
$table->text('request')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
|
||||
$table->index('ip');
|
||||
});
|
||||
|
||||
|
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeds;
|
||||
|
||||
use App\Abstracts\Model;
|
||||
use App\Models\Purchase\BillStatus;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class BillStatuses extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
$this->create();
|
||||
|
||||
Model::reguard();
|
||||
}
|
||||
|
||||
private function create()
|
||||
{
|
||||
$company_id = $this->command->argument('company');
|
||||
|
||||
$rows = [
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('bills.status.draft'),
|
||||
'code' => 'draft',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('bills.status.received'),
|
||||
'code' => 'received',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('bills.status.partial'),
|
||||
'code' => 'partial',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('bills.status.paid'),
|
||||
'code' => 'paid',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
BillStatus::create($row);
|
||||
}
|
||||
}
|
||||
}
|
@@ -12,11 +12,9 @@ class CompanySeeder extends Seeder
|
||||
public function run()
|
||||
{
|
||||
$this->call(Database\Seeds\Accounts::class);
|
||||
$this->call(Database\Seeds\BillStatuses::class);
|
||||
$this->call(Database\Seeds\Categories::class);
|
||||
$this->call(Database\Seeds\Currencies::class);
|
||||
$this->call(Database\Seeds\EmailTemplates::class);
|
||||
$this->call(Database\Seeds\InvoiceStatuses::class);
|
||||
$this->call(Database\Seeds\Modules::class);
|
||||
$this->call(Database\Seeds\Reports::class);
|
||||
$this->call(Database\Seeds\Settings::class);
|
||||
|
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeds;
|
||||
|
||||
use App\Abstracts\Model;
|
||||
use App\Models\Sale\InvoiceStatus;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class InvoiceStatuses extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
$this->create();
|
||||
|
||||
Model::reguard();
|
||||
}
|
||||
|
||||
private function create()
|
||||
{
|
||||
$company_id = $this->command->argument('company');
|
||||
|
||||
$rows = [
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('invoices.status.draft'),
|
||||
'code' => 'draft',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('invoices.status.sent'),
|
||||
'code' => 'sent',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('invoices.status.viewed'),
|
||||
'code' => 'viewed',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('invoices.status.approved'),
|
||||
'code' => 'approved',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('invoices.status.partial'),
|
||||
'code' => 'partial',
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('invoices.status.paid'),
|
||||
'code' => 'paid',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
InvoiceStatus::create($row);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user