mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-05-29 14:44:55 +00:00
Setup pint & run code style fix
This commit is contained in:
@@ -45,7 +45,7 @@ class CreateCustomFieldsTable extends Migration
|
||||
{
|
||||
Schema::table('custom_fields', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'company_id' ] );
|
||||
$table->dropForeign(['company_id']);
|
||||
}
|
||||
});
|
||||
Schema::dropIfExists('custom_fields');
|
||||
|
||||
@@ -39,7 +39,7 @@ class CreateCustomFieldValuesTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('custom_field_values', function (Blueprint $table){
|
||||
Schema::table('custom_field_values', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign(['custom_field_id']);
|
||||
$table->dropForeign(['company_id']);
|
||||
|
||||
@@ -29,7 +29,7 @@ class AddCompanyToAddressesTable extends Migration
|
||||
{
|
||||
Schema::table('addresses', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'company_id' ] );
|
||||
$table->dropForeign(['company_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCreatorInInvoicesTable extends Migration
|
||||
{
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'creator_id' ] );
|
||||
$table->dropForeign(['creator_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCreatorInEstimatesTable extends Migration
|
||||
{
|
||||
Schema::table('estimates', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'creator_id' ] );
|
||||
$table->dropForeign(['creator_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCreatorInPaymentsTable extends Migration
|
||||
{
|
||||
Schema::table('payments', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'creator_id' ] );
|
||||
$table->dropForeign(['creator_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCreatorInExpensesTable extends Migration
|
||||
{
|
||||
Schema::table('expenses', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'creator_id' ] );
|
||||
$table->dropForeign(['creator_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCreatorInItemsTable extends Migration
|
||||
{
|
||||
Schema::table('items', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'creator_id' ] );
|
||||
$table->dropForeign(['creator_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCreatorInUsersTable extends Migration
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'creator_id' ] );
|
||||
$table->dropForeign(['creator_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion320 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Address;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
@@ -10,7 +11,6 @@ use InvoiceShelf\Models\Item;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateCraterVersion400 extends Migration
|
||||
{
|
||||
@@ -38,7 +38,7 @@ class UpdateCraterVersion400 extends Migration
|
||||
|
||||
Address::where('user_id', $user->id)->update([
|
||||
'company_id' => $user->company_id,
|
||||
'user_id' => null
|
||||
'user_id' => null,
|
||||
]);
|
||||
|
||||
// Update company settings
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion401 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class RemoveTemplateIdFromInvoicesAndEstimatesTable extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion402 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion403 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion404 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNumberLengthSetting extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion410 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion420 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Silber\Bouncer\Database\Models;
|
||||
@@ -76,8 +75,8 @@ class CreateBouncerTables extends Migration
|
||||
);
|
||||
|
||||
$table->foreign('role_id')
|
||||
->references('id')->on(Models::table('roles'))
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
->references('id')->on(Models::table('roles'))
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create(Models::table('permissions'), function (Blueprint $table) {
|
||||
@@ -94,8 +93,8 @@ class CreateBouncerTables extends Migration
|
||||
);
|
||||
|
||||
$table->foreign('ability_id')
|
||||
->references('id')->on(Models::table('abilities'))
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
->references('id')->on(Models::table('abilities'))
|
||||
->onUpdate('cascade')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
use InvoiceShelf\Models\Address;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\CustomField;
|
||||
@@ -9,10 +13,6 @@ use InvoiceShelf\Models\Expense;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UpdateCustomerIdInAllTables extends Migration
|
||||
{
|
||||
@@ -34,34 +34,34 @@ class UpdateCustomerIdInAllTables extends Migration
|
||||
|
||||
Address::where('user_id', $user->id)->update([
|
||||
'customer_id' => $newCustomer->id,
|
||||
'user_id' => null
|
||||
'user_id' => null,
|
||||
]);
|
||||
|
||||
Expense::where('user_id', $user->id)->update([
|
||||
'customer_id' => $newCustomer->id,
|
||||
'user_id' => null
|
||||
'user_id' => null,
|
||||
]);
|
||||
|
||||
Estimate::where('user_id', $user->id)->update([
|
||||
'customer_id' => $newCustomer->id,
|
||||
'user_id' => null
|
||||
'user_id' => null,
|
||||
]);
|
||||
|
||||
Invoice::where('user_id', $user->id)->update([
|
||||
'customer_id' => $newCustomer->id,
|
||||
'user_id' => null
|
||||
'user_id' => null,
|
||||
]);
|
||||
|
||||
Payment::where('user_id', $user->id)->update([
|
||||
'customer_id' => $newCustomer->id,
|
||||
'user_id' => null
|
||||
'user_id' => null,
|
||||
]);
|
||||
|
||||
CustomFieldValue::where('custom_field_valuable_id', $user->id)
|
||||
->where('custom_field_valuable_type', 'InvoiceShelf\Models\User')
|
||||
->update([
|
||||
'custom_field_valuable_type' => 'InvoiceShelf\Models\Customer',
|
||||
'custom_field_valuable_id' => $newCustomer->id
|
||||
'custom_field_valuable_id' => $newCustomer->id,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class UpdateCustomerIdInAllTables extends Migration
|
||||
|
||||
if ($customFields) {
|
||||
foreach ($customFields as $customField) {
|
||||
$customField->model_type = "Customer";
|
||||
$customField->model_type = 'Customer';
|
||||
$customField->slug = Str::upper('CUSTOM_'.$customField->model_type.'_'.Str::slug($customField->label, '_'));
|
||||
$customField->save();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class ChangeRelationshipOfCompany extends Migration
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class AddOwnerIdToCompaniesTable extends Migration
|
||||
{
|
||||
@@ -53,7 +53,7 @@ class AddOwnerIdToCompaniesTable extends Migration
|
||||
Schema::table('companies', function (Blueprint $table) {
|
||||
$table->dropColumn('slug');
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'owner_id' ] );
|
||||
$table->dropForeign(['owner_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Note;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\Note;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class AddCompanyToNotesTable extends Migration
|
||||
{
|
||||
@@ -40,7 +40,7 @@ class AddCompanyToNotesTable extends Migration
|
||||
{
|
||||
Schema::table('notes', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'company_id' ] );
|
||||
$table->dropForeign(['company_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddRecurringInvoiceIdToInvoicesTable extends Migration
|
||||
{
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'recurring_invoice_id' ] );
|
||||
$table->dropForeign(['recurring_invoice_id']);
|
||||
}
|
||||
$table->dropColumn('recurring_invoice_id');
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ class AddRecurringInvoiceIdToInvoiceItemsTable extends Migration
|
||||
{
|
||||
Schema::table('invoice_items', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'recurring_invoice_id' ] );
|
||||
$table->dropForeign(['recurring_invoice_id']);
|
||||
}
|
||||
$table->dropColumn('recurring_invoice_id');
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ class AddBaseColumnsIntoInvoicesTable extends Migration
|
||||
'base_sub_total',
|
||||
'base_total',
|
||||
'base_tax',
|
||||
'base_due_amount'
|
||||
'base_due_amount',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class AddBaseColumnsIntoInvoiceItemsTable extends Migration
|
||||
'exchange_rate',
|
||||
'base_discount_val',
|
||||
'base_tax',
|
||||
'base_total'
|
||||
'base_total',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class AddBaseColumnsIntoEstimateItemsTable extends Migration
|
||||
'base_discount_val',
|
||||
'base_price',
|
||||
'base_tax',
|
||||
'base_total'
|
||||
'base_total',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCurrencyIdIntoInvoicesTable extends Migration
|
||||
{
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'currency_id' ] );
|
||||
$table->dropForeign(['currency_id']);
|
||||
}
|
||||
$table->dropColumn('currency_id');
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCurrencyIdIntoPaymentsTable extends Migration
|
||||
{
|
||||
Schema::table('payments', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'currency_id' ] );
|
||||
$table->dropForeign(['currency_id']);
|
||||
}
|
||||
$table->dropColumn('currency_id');
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCurrencyIdIntoItemsTable extends Migration
|
||||
{
|
||||
Schema::table('items', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'currency_id' ] );
|
||||
$table->dropForeign(['currency_id']);
|
||||
}
|
||||
$table->dropColumn('currency_id');
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCurrencyIdIntoTaxesTable extends Migration
|
||||
{
|
||||
Schema::table('taxes', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'currency_id' ] );
|
||||
$table->dropForeign(['currency_id']);
|
||||
}
|
||||
$table->dropColumn('currency_id');
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddCurrencyIdIntoEstimatesTable extends Migration
|
||||
{
|
||||
Schema::table('estimates', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'currency_id' ] );
|
||||
$table->dropForeign(['currency_id']);
|
||||
}
|
||||
$table->dropColumn('currency_id');
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Item;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\Item;
|
||||
|
||||
class AddTaxPerItemIntoItemsTable extends Migration
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class AddSequenceColumn extends Migration
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class AddSequenceColumn extends Migration
|
||||
if ($invoices) {
|
||||
$customerSequence = 1;
|
||||
$invoices->map(function ($invoice) use ($customerSequence) {
|
||||
$invoiceNumber = explode("-", $invoice->invoice_number);
|
||||
$invoiceNumber = explode('-', $invoice->invoice_number);
|
||||
$invoice->sequence_number = intval(end($invoiceNumber));
|
||||
$invoice->customer_sequence_number = $customerSequence;
|
||||
$invoice->save();
|
||||
@@ -55,7 +55,7 @@ class AddSequenceColumn extends Migration
|
||||
if ($estimates) {
|
||||
$customerSequence = 1;
|
||||
$estimates->map(function ($estimate) use ($customerSequence) {
|
||||
$estimateNumber = explode("-", $estimate->estimate_number);
|
||||
$estimateNumber = explode('-', $estimate->estimate_number);
|
||||
$estimate->sequence_number = intval(end($estimateNumber));
|
||||
$estimate->customer_sequence_number = $customerSequence;
|
||||
$estimate->save();
|
||||
@@ -67,7 +67,7 @@ class AddSequenceColumn extends Migration
|
||||
if ($estimates) {
|
||||
$customerSequence = 1;
|
||||
$payments->map(function ($payment) use ($customerSequence) {
|
||||
$paymentNumber = explode("-", $payment->payment_number);
|
||||
$paymentNumber = explode('-', $payment->payment_number);
|
||||
$payment->sequence_number = intval(end($paymentNumber));
|
||||
$payment->customer_sequence_number = $customerSequence;
|
||||
$payment->save();
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddRecurringInvoiceIdToTaxesTable extends Migration
|
||||
{
|
||||
Schema::table('taxes', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'recurring_invoice_id' ] );
|
||||
$table->dropForeign(['recurring_invoice_id']);
|
||||
}
|
||||
$table->dropColumn('recurring_invoice_id');
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddPaymentMethodToExpenseTable extends Migration
|
||||
{
|
||||
Schema::table('expenses', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'payment_method_id' ] );
|
||||
$table->dropForeign(['payment_method_id']);
|
||||
}
|
||||
$table->dropColumn('payment_method_id');
|
||||
});
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Item;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CalculateBaseValuesForExistingData extends Migration
|
||||
{
|
||||
@@ -42,7 +42,7 @@ class CalculateBaseValuesForExistingData extends Migration
|
||||
'base_sub_total' => $invoice->sub_total,
|
||||
'base_total' => $invoice->total,
|
||||
'base_tax' => $invoice->tax,
|
||||
'base_due_amount' => $invoice->due_amount
|
||||
'base_due_amount' => $invoice->due_amount,
|
||||
]);
|
||||
} else {
|
||||
$invoice->update([
|
||||
@@ -72,7 +72,7 @@ class CalculateBaseValuesForExistingData extends Migration
|
||||
'base_discount_val' => $estimate->sub_total,
|
||||
'base_sub_total' => $estimate->sub_total,
|
||||
'base_total' => $estimate->total,
|
||||
'base_tax' => $estimate->tax
|
||||
'base_tax' => $estimate->tax,
|
||||
]);
|
||||
} else {
|
||||
$estimate->update([
|
||||
@@ -89,7 +89,7 @@ class CalculateBaseValuesForExistingData extends Migration
|
||||
$payment->update([
|
||||
'currency_id' => $currency_id,
|
||||
'base_amount' => $payment->amount,
|
||||
'exchange_rate' => 1
|
||||
'exchange_rate' => 1,
|
||||
]);
|
||||
} else {
|
||||
$payment->update([
|
||||
@@ -110,7 +110,7 @@ class CalculateBaseValuesForExistingData extends Migration
|
||||
'base_discount_val' => $item->discount_val * $model->exchange_rate,
|
||||
'base_price' => $item->price * $model->exchange_rate,
|
||||
'base_tax' => $item->tax * $model->exchange_rate,
|
||||
'base_total' => $item->total * $model->exchange_rate
|
||||
'base_total' => $item->total * $model->exchange_rate,
|
||||
]);
|
||||
|
||||
$this->taxes($item, $model->currency_id);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddNewCompanySettings extends Migration
|
||||
{
|
||||
@@ -35,7 +35,7 @@ class AddNewCompanySettings extends Migration
|
||||
'estimate_set_expiry_date_automatically' => 'YES',
|
||||
'estimate_expiry_date_days' => 7,
|
||||
'estimate_convert_action' => 'no_action',
|
||||
'bulk_exchange_rate_configured' => "NO",
|
||||
'bulk_exchange_rate_configured' => 'NO',
|
||||
'invoice_number_format' => "{{SERIES:{$oldSettings['invoice_prefix']}}}{{DELIMITER:-}}{{SEQUENCE:{$oldSettings['invoice_number_length']}}}",
|
||||
'estimate_number_format' => "{{SERIES:{$oldSettings['estimate_prefix']}}}{{DELIMITER:-}}{{SEQUENCE:{$oldSettings['estimate_number_length']}}}",
|
||||
'payment_number_format' => "{{SERIES:{$oldSettings['payment_prefix']}}}{{DELIMITER:-}}{{SEQUENCE:{$oldSettings['payment_number_length']}}}",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion500 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion501 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class CalculateBaseDueAmount extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion502 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion503 extends Migration
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddTransactionIdToPaymentsTable extends Migration
|
||||
{
|
||||
Schema::table('payments', function (Blueprint $table) {
|
||||
if (config('database.default') !== 'sqlite') {
|
||||
$table->dropForeign( [ 'transaction_id' ] );
|
||||
$table->dropForeign(['transaction_id']);
|
||||
}
|
||||
$table->dropColumn('transaction_id');
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\PaymentMethod;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\PaymentMethod;
|
||||
|
||||
class AddTypeToPaymentMethodsTable extends Migration
|
||||
{
|
||||
@@ -44,7 +44,7 @@ class AddTypeToPaymentMethodsTable extends Migration
|
||||
'driver',
|
||||
'type',
|
||||
'settings',
|
||||
'active'
|
||||
'active',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion504 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CalculateBaseValuesForExpenses extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion505 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCreaterVersion506 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
|
||||
class CalculateBaseAmountOfPaymentsTable extends Migration
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\Company;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\User;
|
||||
|
||||
class AddFieldsToEmailLogsTable extends Migration
|
||||
{
|
||||
@@ -25,7 +25,7 @@ class AddFieldsToEmailLogsTable extends Migration
|
||||
if ($user) {
|
||||
$settings = [
|
||||
'automatically_expire_public_links' => 'Yes',
|
||||
'link_expiry_days' => 7
|
||||
'link_expiry_days' => 7,
|
||||
];
|
||||
|
||||
$companies = Company::all();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
|
||||
class ChangeEnablePortalFieldOfCustomersTable extends Migration
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\TaxType;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use InvoiceShelf\Models\TaxType;
|
||||
|
||||
class AddTypeToTaxTypesTable extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion600 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Company;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Str;
|
||||
use InvoiceShelf\Models\Company;
|
||||
|
||||
class AddSlugToCompanies extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion601 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion602 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion603 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion604 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class CraterVersion605 extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
|
||||
class ChangeOverDueStatusToSent extends Migration
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\InvoiceItem;
|
||||
use InvoiceShelf\Models\Tax;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CalculateBaseValuesForInvoiceItems extends Migration
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use InvoiceShelf\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use InvoiceShelf\Models\Setting;
|
||||
|
||||
class UpdateCraterVersion606 extends Migration
|
||||
{
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
||||
|
||||
return new class () extends Migration {
|
||||
return new class() extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user