From bfa445c322e54e75cd1fbea4e13b2a14bdf4b7e7 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 16 Dec 2019 10:39:09 +0300 Subject: [PATCH 1/4] added expense state --- database/factories/Transaction.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/database/factories/Transaction.php b/database/factories/Transaction.php index 5e65dd21e..f2ef53cc8 100644 --- a/database/factories/Transaction.php +++ b/database/factories/Transaction.php @@ -5,10 +5,10 @@ use App\Models\Banking\Transaction; use Faker\Generator as Faker; use Illuminate\Http\UploadedFile; -$factory->define(Transaction::class, function (Faker $faker) { - $user = User::first(); - $company = $user->companies()->first(); +$user = User::first(); +$company = $user->companies()->first(); +$factory->define(Transaction::class, function (Faker $faker) use ($company) { setting()->setExtraColumns(['company_id' => $company->id]); $attachment = UploadedFile::fake()->create('image.jpg'); @@ -22,9 +22,18 @@ $factory->define(Transaction::class, function (Faker $faker) { 'currency_code' => setting('default.currency'), 'currency_rate' => '1', 'description' => $faker->text(5), - 'category_id' => $company->categories()->type('income')->first()->id, + 'category_id' => $company->categories()->type('income')->pluck('id')->first(), 'reference' => $faker->text(5), 'payment_method' => setting('default.payment_method'), //'attachment' => $attachment, ]; }); + +$factory->state(Transaction::class, 'income', []); + +$factory->state(Transaction::class, 'expense', function (Faker $faker) use ($company) { + return [ + 'type' => 'expense', + 'category_id' => $company->categories()->type('expense')->pluck('id')->first(), + ]; +}); From 1e2b5a36210a5ceff8b3f59868d8526fe1e011d1 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 16 Dec 2019 12:04:27 +0300 Subject: [PATCH 2/4] updated migrations --- ...2017_09_01_000000_create_accounts_table.php | 1 + .../2017_09_01_000000_create_bills_table.php | 1 + ...17_09_01_000000_create_categories_table.php | 1 + ...017_09_01_000000_create_companies_table.php | 1 + ...17_09_01_000000_create_currencies_table.php | 1 + ...017_09_01_000000_create_customers_table.php | 1 + ...2017_09_01_000000_create_invoices_table.php | 1 + .../2017_09_01_000000_create_items_table.php | 1 + .../2017_09_01_000000_create_jobs_table.php | 4 ++-- .../2017_09_01_000000_create_modules_table.php | 1 + ...09_01_000000_create_notifications_table.php | 4 ++-- ..._01_000000_create_password_resets_table.php | 4 ++-- ...2017_09_01_000000_create_payments_table.php | 1 + ...2017_09_01_000000_create_revenues_table.php | 1 + .../2017_09_01_000000_create_roles_table.php | 2 ++ ...2017_09_01_000000_create_sessions_table.php | 4 ++-- ...2017_09_01_000000_create_settings_table.php | 4 ++-- .../2017_09_01_000000_create_taxes_table.php | 1 + ...017_09_01_000000_create_transfers_table.php | 1 + .../2017_09_01_000000_create_users_table.php | 4 ++-- .../2017_09_01_000000_create_vendors_table.php | 1 + ...7_10_11_000000_create_bill_totals_table.php | 1 + ...0_11_000000_create_invoice_totals_table.php | 1 + ...7_11_16_000000_create_failed_jobs_table.php | 1 + .../2017_12_09_000000_add_currency_columns.php | 6 ++++-- ...017_12_30_000000_create_mediable_tables.php | 4 ++-- ...p_attachment_column_bill_payments_table.php | 4 ++-- ...0000_drop_attachment_column_bills_table.php | 4 ++-- ...ttachment_column_invoice_payments_table.php | 4 ++-- ...0_drop_attachment_column_invoices_table.php | 4 ++-- ...0_drop_attachment_column_payments_table.php | 4 ++-- ...0_drop_attachment_column_revenues_table.php | 4 ++-- ..._000000_drop_picture_column_items_table.php | 4 ++-- ..._000000_drop_picture_column_users_table.php | 4 ++-- ...0000_add_category_column_invoices_bills.php | 10 ++++++---- ...018_04_26_000000_create_recurring_table.php | 1 + .../2018_04_30_000000_add_parent_column.php | 18 ++++++++++-------- .../2018_06_23_000000_modify_email_column.php | 1 + ...2018_06_30_000000_modify_enabled_column.php | 1 + .../2018_07_07_000000_modify_date_column.php | 1 + ...6_000000_add_reference_column_customers.php | 6 ++++-- ..._26_000000_add_reference_column_vendors.php | 6 ++++-- ..._22_000000_create_bill_item_taxes_table.php | 1 + ..._000000_create_invoice_item_taxes_table.php | 1 + ...2018_10_27_000000_add_reconciled_column.php | 18 ++++++++++-------- ..._27_000000_create_reconciliations_table.php | 1 + .../2018_11_05_000000_add_tax_columns.php | 6 ++++-- .../2019_01_07_000000_drop_tax_id_column.php | 4 ++-- ...00_modify_deleted_at_column_media_table.php | 1 + ...000000_add_footer_column_invoices_table.php | 6 ++++-- ...2019_11_14_000000_create_contacts_table.php | 1 + ...19_11_14_000000_create_dashboards_table.php | 1 + ..._14_000000_create_email_templates_table.php | 2 +- ...2019_11_14_000000_create_firewall_table.php | 1 + .../2019_11_14_000000_create_reports_table.php | 2 +- ..._11_14_000000_create_transactions_table.php | 1 + ...00_modify_domain_column_companies_table.php | 1 + ...0000_modify_status_column_modules_table.php | 1 + ..._modify_sku_quantity_column_items_table.php | 13 ++++++++++++- ...00000_drop_enabled_column_reports_table.php | 2 +- .../2020_01_01_000000_add_locale_column.php | 6 ++++-- 61 files changed, 130 insertions(+), 68 deletions(-) diff --git a/database/migrations/2017_09_01_000000_create_accounts_table.php b/database/migrations/2017_09_01_000000_create_accounts_table.php index d95bc1b98..e69227598 100644 --- a/database/migrations/2017_09_01_000000_create_accounts_table.php +++ b/database/migrations/2017_09_01_000000_create_accounts_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateAccountsTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_bills_table.php b/database/migrations/2017_09_01_000000_create_bills_table.php index 2ba4376fb..6947f7754 100644 --- a/database/migrations/2017_09_01_000000_create_bills_table.php +++ b/database/migrations/2017_09_01_000000_create_bills_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateBillsTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_categories_table.php b/database/migrations/2017_09_01_000000_create_categories_table.php index 82a1a2ccf..a548417c3 100644 --- a/database/migrations/2017_09_01_000000_create_categories_table.php +++ b/database/migrations/2017_09_01_000000_create_categories_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateCategoriesTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_companies_table.php b/database/migrations/2017_09_01_000000_create_companies_table.php index 970129d99..23847b18a 100644 --- a/database/migrations/2017_09_01_000000_create_companies_table.php +++ b/database/migrations/2017_09_01_000000_create_companies_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateCompaniesTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_currencies_table.php b/database/migrations/2017_09_01_000000_create_currencies_table.php index 49ca90f60..33584837a 100644 --- a/database/migrations/2017_09_01_000000_create_currencies_table.php +++ b/database/migrations/2017_09_01_000000_create_currencies_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateCurrenciesTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_customers_table.php b/database/migrations/2017_09_01_000000_create_customers_table.php index 0a65a5174..d0840d783 100644 --- a/database/migrations/2017_09_01_000000_create_customers_table.php +++ b/database/migrations/2017_09_01_000000_create_customers_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateCustomersTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_invoices_table.php b/database/migrations/2017_09_01_000000_create_invoices_table.php index 123a2f850..4ad4ec570 100644 --- a/database/migrations/2017_09_01_000000_create_invoices_table.php +++ b/database/migrations/2017_09_01_000000_create_invoices_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateInvoicesTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_items_table.php b/database/migrations/2017_09_01_000000_create_items_table.php index d76144ae8..2ad69782e 100644 --- a/database/migrations/2017_09_01_000000_create_items_table.php +++ b/database/migrations/2017_09_01_000000_create_items_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateItemsTable extends Migration { diff --git a/database/migrations/2017_09_01_000000_create_jobs_table.php b/database/migrations/2017_09_01_000000_create_jobs_table.php index ae05432ad..bbd1f7f7c 100644 --- a/database/migrations/2017_09_01_000000_create_jobs_table.php +++ b/database/migrations/2017_09_01_000000_create_jobs_table.php @@ -1,8 +1,8 @@ string('precision')->nullable(); $table->string('symbol')->nullable(); $table->integer('symbol_first')->default(1); @@ -27,7 +29,7 @@ class AddCurrencyColumns extends Migration */ public function down() { - Schema::table('currencies', function ($table) { + Schema::table('currencies', function (Blueprint $table) { $table->dropColumn([ 'precision', 'symbol', diff --git a/database/migrations/2017_12_30_000000_create_mediable_tables.php b/database/migrations/2017_12_30_000000_create_mediable_tables.php index ec7ed0c2c..b297bb751 100644 --- a/database/migrations/2017_12_30_000000_create_mediable_tables.php +++ b/database/migrations/2017_12_30_000000_create_mediable_tables.php @@ -1,8 +1,8 @@ integer('category_id')->default(); }); - Schema::table('bills', function ($table) { + Schema::table('bills', function (Blueprint $table) { $table->integer('category_id')->default(); }); } @@ -27,11 +29,11 @@ class AddCategoryColumnInvoicesBills extends Migration */ public function down() { - Schema::table('invoices', function ($table) { + Schema::table('invoices', function (Blueprint $table) { $table->dropColumn('category_id'); }); - Schema::table('bills', function ($table) { + Schema::table('bills', function (Blueprint $table) { $table->dropColumn('category_id'); }); } diff --git a/database/migrations/2018_04_26_000000_create_recurring_table.php b/database/migrations/2018_04_26_000000_create_recurring_table.php index 0057ca08d..4c87cda84 100644 --- a/database/migrations/2018_04_26_000000_create_recurring_table.php +++ b/database/migrations/2018_04_26_000000_create_recurring_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateRecurringTable extends Migration { diff --git a/database/migrations/2018_04_30_000000_add_parent_column.php b/database/migrations/2018_04_30_000000_add_parent_column.php index 89ba2776a..b12e3fe8c 100644 --- a/database/migrations/2018_04_30_000000_add_parent_column.php +++ b/database/migrations/2018_04_30_000000_add_parent_column.php @@ -1,6 +1,8 @@ integer('parent_id')->default(0); }); - Schema::table('revenues', function ($table) { + Schema::table('revenues', function (Blueprint $table) { $table->integer('parent_id')->default(0); }); - Schema::table('bills', function ($table) { + Schema::table('bills', function (Blueprint $table) { $table->integer('parent_id')->default(0); }); - Schema::table('payments', function ($table) { + Schema::table('payments', function (Blueprint $table) { $table->integer('parent_id')->default(0); }); } @@ -35,19 +37,19 @@ class AddParentColumn extends Migration */ public function down() { - Schema::table('invoices', function ($table) { + Schema::table('invoices', function (Blueprint $table) { $table->dropColumn('parent_id'); }); - Schema::table('revenues', function ($table) { + Schema::table('revenues', function (Blueprint $table) { $table->dropColumn('parent_id'); }); - Schema::table('bills', function ($table) { + Schema::table('bills', function (Blueprint $table) { $table->dropColumn('parent_id'); }); - Schema::table('payments', function ($table) { + Schema::table('payments', function (Blueprint $table) { $table->dropColumn('parent_id'); }); } diff --git a/database/migrations/2018_06_23_000000_modify_email_column.php b/database/migrations/2018_06_23_000000_modify_email_column.php index 7fefdb8c2..9aa8f1719 100644 --- a/database/migrations/2018_06_23_000000_modify_email_column.php +++ b/database/migrations/2018_06_23_000000_modify_email_column.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class ModifyEmailColumn extends Migration { diff --git a/database/migrations/2018_06_30_000000_modify_enabled_column.php b/database/migrations/2018_06_30_000000_modify_enabled_column.php index aaf5fb8eb..992ea360b 100644 --- a/database/migrations/2018_06_30_000000_modify_enabled_column.php +++ b/database/migrations/2018_06_30_000000_modify_enabled_column.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class ModifyEnabledColumn extends Migration { diff --git a/database/migrations/2018_07_07_000000_modify_date_column.php b/database/migrations/2018_07_07_000000_modify_date_column.php index 0e0125a93..9c9505c3c 100644 --- a/database/migrations/2018_07_07_000000_modify_date_column.php +++ b/database/migrations/2018_07_07_000000_modify_date_column.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class ModifyDateColumn extends Migration { diff --git a/database/migrations/2018_09_26_000000_add_reference_column_customers.php b/database/migrations/2018_09_26_000000_add_reference_column_customers.php index ee4a2bda4..550dd9c8a 100644 --- a/database/migrations/2018_09_26_000000_add_reference_column_customers.php +++ b/database/migrations/2018_09_26_000000_add_reference_column_customers.php @@ -1,6 +1,8 @@ string('reference')->nullable(); }); } @@ -23,7 +25,7 @@ class AddReferenceColumnCustomers extends Migration */ public function down() { - Schema::table('customers', function ($table) { + Schema::table('customers', function (Blueprint $table) { $table->dropColumn('reference'); }); } diff --git a/database/migrations/2018_09_26_000000_add_reference_column_vendors.php b/database/migrations/2018_09_26_000000_add_reference_column_vendors.php index 168647908..49fea58e5 100644 --- a/database/migrations/2018_09_26_000000_add_reference_column_vendors.php +++ b/database/migrations/2018_09_26_000000_add_reference_column_vendors.php @@ -1,6 +1,8 @@ string('reference')->nullable(); }); } @@ -23,7 +25,7 @@ class AddReferenceColumnVendors extends Migration */ public function down() { - Schema::table('vendors', function ($table) { + Schema::table('vendors', function (Blueprint $table) { $table->dropColumn('reference'); }); } diff --git a/database/migrations/2018_10_22_000000_create_bill_item_taxes_table.php b/database/migrations/2018_10_22_000000_create_bill_item_taxes_table.php index 7338aca0d..b1244eec8 100644 --- a/database/migrations/2018_10_22_000000_create_bill_item_taxes_table.php +++ b/database/migrations/2018_10_22_000000_create_bill_item_taxes_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateBillItemTaxesTable extends Migration { diff --git a/database/migrations/2018_10_22_000000_create_invoice_item_taxes_table.php b/database/migrations/2018_10_22_000000_create_invoice_item_taxes_table.php index db24d8471..5d3e42e71 100644 --- a/database/migrations/2018_10_22_000000_create_invoice_item_taxes_table.php +++ b/database/migrations/2018_10_22_000000_create_invoice_item_taxes_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateInvoiceItemTaxesTable extends Migration { diff --git a/database/migrations/2018_10_27_000000_add_reconciled_column.php b/database/migrations/2018_10_27_000000_add_reconciled_column.php index 9aa23f498..9175022d0 100644 --- a/database/migrations/2018_10_27_000000_add_reconciled_column.php +++ b/database/migrations/2018_10_27_000000_add_reconciled_column.php @@ -1,6 +1,8 @@ boolean('reconciled')->default(0); }); - Schema::table('invoice_payments', function ($table) { + Schema::table('invoice_payments', function (Blueprint $table) { $table->boolean('reconciled')->default(0); }); - Schema::table('payments', function ($table) { + Schema::table('payments', function (Blueprint $table) { $table->boolean('reconciled')->default(0); }); - Schema::table('revenues', function ($table) { + Schema::table('revenues', function (Blueprint $table) { $table->boolean('reconciled')->default(0); }); } @@ -35,19 +37,19 @@ class AddReconciledColumn extends Migration */ public function down() { - Schema::table('bill_payments', function ($table) { + Schema::table('bill_payments', function (Blueprint $table) { $table->dropColumn('reconciled'); }); - Schema::table('invoice_payments', function ($table) { + Schema::table('invoice_payments', function (Blueprint $table) { $table->dropColumn('reconciled'); }); - Schema::table('payments', function ($table) { + Schema::table('payments', function (Blueprint $table) { $table->dropColumn('reconciled'); }); - Schema::table('revenues', function ($table) { + Schema::table('revenues', function (Blueprint $table) { $table->dropColumn('reconciled'); }); } diff --git a/database/migrations/2018_10_27_000000_create_reconciliations_table.php b/database/migrations/2018_10_27_000000_create_reconciliations_table.php index 1f0fb4f13..7bc6939fe 100644 --- a/database/migrations/2018_10_27_000000_create_reconciliations_table.php +++ b/database/migrations/2018_10_27_000000_create_reconciliations_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateReconciliationsTable extends Migration { diff --git a/database/migrations/2018_11_05_000000_add_tax_columns.php b/database/migrations/2018_11_05_000000_add_tax_columns.php index 9edb97750..1e31d94a6 100644 --- a/database/migrations/2018_11_05_000000_add_tax_columns.php +++ b/database/migrations/2018_11_05_000000_add_tax_columns.php @@ -1,6 +1,8 @@ string('type')->default('normal'); }); } @@ -23,7 +25,7 @@ class AddTaxColumns extends Migration */ public function down() { - Schema::table('taxes', function ($table) { + Schema::table('taxes', function (Blueprint $table) { $table->dropColumn([ 'type', ]); diff --git a/database/migrations/2019_01_07_000000_drop_tax_id_column.php b/database/migrations/2019_01_07_000000_drop_tax_id_column.php index 3b78caa10..e8352e10a 100644 --- a/database/migrations/2019_01_07_000000_drop_tax_id_column.php +++ b/database/migrations/2019_01_07_000000_drop_tax_id_column.php @@ -1,8 +1,8 @@ text('footer')->nullable(); }); } @@ -23,7 +25,7 @@ class AddFooterColumnInvoicesTable extends Migration */ public function down() { - Schema::table('invoices', function ($table) { + Schema::table('invoices', function (Blueprint $table) { $table->dropColumn('footer'); }); } diff --git a/database/migrations/2019_11_14_000000_create_contacts_table.php b/database/migrations/2019_11_14_000000_create_contacts_table.php index 02f518129..926e866c5 100644 --- a/database/migrations/2019_11_14_000000_create_contacts_table.php +++ b/database/migrations/2019_11_14_000000_create_contacts_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateContactsTable extends Migration { diff --git a/database/migrations/2019_11_14_000000_create_dashboards_table.php b/database/migrations/2019_11_14_000000_create_dashboards_table.php index c3a9ce448..006ed1fd9 100644 --- a/database/migrations/2019_11_14_000000_create_dashboards_table.php +++ b/database/migrations/2019_11_14_000000_create_dashboards_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateDashboardsTable extends Migration { diff --git a/database/migrations/2019_11_14_000000_create_email_templates_table.php b/database/migrations/2019_11_14_000000_create_email_templates_table.php index 1616169dc..95dc5a354 100644 --- a/database/migrations/2019_11_14_000000_create_email_templates_table.php +++ b/database/migrations/2019_11_14_000000_create_email_templates_table.php @@ -1,8 +1,8 @@ string('sku')->nullable()->change(); $table->integer('quantity')->default(1)->change(); - $table->dropUnique(['company_id', 'sku', 'deleted_at']); + + $connection = Schema::getConnection(); + $d_table = $connection->getDoctrineSchemaManager()->listTableDetails($connection->getTablePrefix() . 'items'); + + if ($d_table->hasIndex('items_company_id_sku_deleted_at_unique')) { + // 1.3 update + $table->dropUnique('items_company_id_sku_deleted_at_unique'); + } else { + // 2.0 install + $table->dropUnique(['company_id', 'sku', 'deleted_at']); + } }); } diff --git a/database/migrations/2019_11_19_000000_drop_enabled_column_reports_table.php b/database/migrations/2019_11_19_000000_drop_enabled_column_reports_table.php index dcf825d2c..e57b59725 100644 --- a/database/migrations/2019_11_19_000000_drop_enabled_column_reports_table.php +++ b/database/migrations/2019_11_19_000000_drop_enabled_column_reports_table.php @@ -1,8 +1,8 @@ string('locale')->default(config('app.locale')); }); } @@ -23,7 +25,7 @@ class AddLocaleColumn extends Migration */ public function down() { - Schema::table('users', function ($table) { + Schema::table('users', function (Blueprint $table) { $table->dropColumn('locale'); }); } From b03ded8a57c2bc798c786a7119a1a7b70fccdd00 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 16 Dec 2019 13:19:09 +0300 Subject: [PATCH 3/4] factory in tests --- database/factories/Transaction.php | 4 ---- tests/Feature/Expenses/PaymentsTest.php | 28 ++++--------------------- tests/Feature/Incomes/RevenuesTest.php | 28 ++++--------------------- 3 files changed, 8 insertions(+), 52 deletions(-) diff --git a/database/factories/Transaction.php b/database/factories/Transaction.php index f2ef53cc8..04abbed45 100644 --- a/database/factories/Transaction.php +++ b/database/factories/Transaction.php @@ -3,7 +3,6 @@ use App\Models\Auth\User; use App\Models\Banking\Transaction; use Faker\Generator as Faker; -use Illuminate\Http\UploadedFile; $user = User::first(); $company = $user->companies()->first(); @@ -11,8 +10,6 @@ $company = $user->companies()->first(); $factory->define(Transaction::class, function (Faker $faker) use ($company) { setting()->setExtraColumns(['company_id' => $company->id]); - $attachment = UploadedFile::fake()->create('image.jpg'); - return [ 'company_id' => $company->id, 'type' => 'income', @@ -25,7 +22,6 @@ $factory->define(Transaction::class, function (Faker $faker) use ($company) { 'category_id' => $company->categories()->type('income')->pluck('id')->first(), 'reference' => $faker->text(5), 'payment_method' => setting('default.payment_method'), - //'attachment' => $attachment, ]; }); diff --git a/tests/Feature/Expenses/PaymentsTest.php b/tests/Feature/Expenses/PaymentsTest.php index 2c8fec124..479a47033 100644 --- a/tests/Feature/Expenses/PaymentsTest.php +++ b/tests/Feature/Expenses/PaymentsTest.php @@ -3,7 +3,7 @@ namespace Tests\Feature\Expenses; use App\Jobs\Banking\CreateTransaction; -use Illuminate\Http\UploadedFile; +use App\Models\Banking\Transaction; use Tests\Feature\FeatureTestCase; class PaymentsTest extends FeatureTestCase @@ -27,7 +27,7 @@ class PaymentsTest extends FeatureTestCase public function testItShouldCreatePayment() { $this->loginAs() - ->post(route('payments.store'), $this->getPaymentRequest()) + ->post(route('payments.store'), factory(Transaction::class)->states('expense')->raw()) ->assertStatus(200); $this->assertFlashLevel('success'); @@ -35,7 +35,7 @@ class PaymentsTest extends FeatureTestCase public function testItShouldUpdatePayment() { - $request = $this->getPaymentRequest(); + $request = factory(Transaction::class)->states('expense')->raw(); $payment = $this->dispatch(new CreateTransaction($request)); @@ -50,7 +50,7 @@ class PaymentsTest extends FeatureTestCase public function testItShouldDeletePayment() { - $payment = $this->dispatch(new CreateTransaction($this->getPaymentRequest())); + $payment = $this->dispatch(new CreateTransaction(factory(Transaction::class)->states('expense')->raw())); $this->loginAs() ->delete(route('payments.destroy', $payment->id)) @@ -58,24 +58,4 @@ class PaymentsTest extends FeatureTestCase $this->assertFlashLevel('success'); } - - private function getPaymentRequest() - { - $attachment = UploadedFile::fake()->create('image.jpg'); - - return [ - 'company_id' => $this->company->id, - 'type' => 'expense', - 'account_id' => setting('default.account'), - 'paid_at' => $this->faker->date(), - 'amount' => $this->faker->randomFloat(2, 2), - 'currency_code' => setting('default.currency'), - 'currency_rate' => '1', - 'description' => $this->faker->text(5), - 'category_id' => $this->company->categories()->type('expense')->first()->id, - 'payment_method' => setting('default.payment_method'), - 'reference' => $this->faker->text(5), - 'attachment' => $attachment, - ]; - } } diff --git a/tests/Feature/Incomes/RevenuesTest.php b/tests/Feature/Incomes/RevenuesTest.php index b39fb2fc0..3fe9104ee 100644 --- a/tests/Feature/Incomes/RevenuesTest.php +++ b/tests/Feature/Incomes/RevenuesTest.php @@ -3,7 +3,7 @@ namespace Tests\Feature\Incomes; use App\Jobs\Banking\CreateTransaction; -use Illuminate\Http\UploadedFile; +use App\Models\Banking\Transaction; use Tests\Feature\FeatureTestCase; class RevenuesTest extends FeatureTestCase @@ -27,7 +27,7 @@ class RevenuesTest extends FeatureTestCase public function testItShouldCreateRevenue() { $this->loginAs() - ->post(route('revenues.store'), $this->getRevenueRequest()) + ->post(route('revenues.store'), factory(Transaction::class)->raw()) ->assertStatus(200); $this->assertFlashLevel('success'); @@ -35,7 +35,7 @@ class RevenuesTest extends FeatureTestCase public function testItShouldUpdateRevenue() { - $request = $this->getRevenueRequest(); + $request = factory(Transaction::class)->raw(); $revenue = $this->dispatch(new CreateTransaction($request)); @@ -50,7 +50,7 @@ class RevenuesTest extends FeatureTestCase public function testItShouldDeleteRevenue() { - $revenue = $this->dispatch(new CreateTransaction($this->getRevenueRequest())); + $revenue = $this->dispatch(new CreateTransaction(factory(Transaction::class)->raw())); $this->loginAs() ->delete(route('revenues.destroy', $revenue->id)) @@ -58,24 +58,4 @@ class RevenuesTest extends FeatureTestCase $this->assertFlashLevel('success'); } - - private function getRevenueRequest() - { - $attachment = UploadedFile::fake()->create('image.jpg'); - - return [ - 'company_id' => $this->company->id, - 'type' => 'income', - 'account_id' => setting('default.account'), - 'paid_at' => $this->faker->date(), - 'amount' => $this->faker->randomFloat(2, 2), - 'currency_code' => setting('default.currency'), - 'currency_rate' => '1', - 'description' => $this->faker->text(5), - 'category_id' => $this->company->categories()->type('income')->first()->id, - 'reference' => $this->faker->text(5), - 'payment_method' => setting('default.payment_method'), - 'attachment' => $attachment, - ]; - } } From 5d9bc556b79542feb7444dff4e730dc456b60435 Mon Sep 17 00:00:00 2001 From: batuhanbas Date: Mon, 16 Dec 2019 17:03:53 +0300 Subject: [PATCH 4/4] hidden classes updated --- public/css/custom.css | 74 ------------------- .../views/auth/permissions/index.blade.php | 12 +-- resources/views/auth/roles/index.blade.php | 12 +-- resources/views/auth/users/index.blade.php | 16 ++-- .../views/banking/accounts/index.blade.php | 16 ++-- .../banking/reconciliations/create.blade.php | 24 +++--- .../banking/reconciliations/edit.blade.php | 22 +++--- .../banking/reconciliations/index.blade.php | 20 ++--- .../banking/transactions/index.blade.php | 16 ++-- .../views/banking/transfers/index.blade.php | 16 ++-- .../views/common/companies/index.blade.php | 20 ++--- resources/views/common/items/index.blade.php | 20 ++--- .../views/expenses/bills/index.blade.php | 24 +++--- resources/views/expenses/bills/show.blade.php | 4 +- .../views/expenses/payments/index.blade.php | 20 ++--- .../views/expenses/vendors/index.blade.php | 20 ++--- .../views/expenses/vendors/show.blade.php | 16 ++-- .../views/incomes/customers/index.blade.php | 20 ++--- .../views/incomes/customers/show.blade.php | 16 ++-- .../views/incomes/invoices/index.blade.php | 24 +++--- .../views/incomes/invoices/print.blade.php | 4 +- .../views/incomes/invoices/show.blade.php | 4 +- .../views/incomes/revenues/index.blade.php | 20 ++--- .../views/install/updates/edit.blade.php | 2 +- .../views/install/updates/index.blade.php | 8 +- .../views/partials/admin/navbar.blade.php | 2 +- .../views/partials/admin/pagination.blade.php | 8 +- .../form/bulk_action_row_group.blade.php | 2 +- .../views/partials/modules/reviews.blade.php | 2 +- .../views/partials/portal/navbar.blade.php | 2 +- .../partials/portal/pagination.blade.php | 6 +- .../payment_method/redirect/show.blade.php | 46 ++++++------ .../payment_method/redirect/signed.blade.php | 5 +- .../views/partials/widget/head.blade.php | 2 +- .../views/portal/invoices/index.blade.php | 12 +-- .../views/portal/invoices/show.blade.php | 6 +- .../views/portal/payments/index.blade.php | 8 +- .../views/settings/categories/index.blade.php | 16 ++-- .../views/settings/currencies/index.blade.php | 16 ++-- .../views/settings/taxes/index.blade.php | 16 ++-- .../vendor/pagination/bootstrap-4.blade.php | 4 +- 41 files changed, 263 insertions(+), 340 deletions(-) diff --git a/public/css/custom.css b/public/css/custom.css index 596c09420..158bd301d 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -196,14 +196,6 @@ /*--------Action Column Finish--------*/ -/*--------Table Search--------*/ -.table-text -{ - font-size: .875rem; -} -/*--------Table Search Finish--------*/ - - /*--------Customer/Vendor Show--------*/ .show-transaction-card-header { @@ -733,14 +725,6 @@ table .align-items-center td span.badge { .col-xs-11 {width: 91.66%;} .col-xs-12 {width: 100%;} - .hidden-sm, - .hidden-md, - .hidden-lg, - .hidden-xl - { - display: none; - } - .btn-alone { width: 100%; @@ -778,11 +762,6 @@ table .align-items-center td span.badge { font-size: 0.75rem !important; } - .card-header-search - { - margin-left: -1rem; - } - .col-aka { margin-left: 0; @@ -823,18 +802,6 @@ table .align-items-center td span.badge { /*--------S Breakpoint--------*/ @media (min-width: 576px) and (max-width: 767.98px) { - .hidden-md, - .hidden-lg, - .hidden-xl - { - display: none; - } - - .card-header-search - { - margin-left: -1rem; - } - .dashboard-action { margin-left: 4rem !important; @@ -854,17 +821,6 @@ table .align-items-center td span.badge { /*--------M Breakpoint--------*/ @media (min-width: 768px) and (max-width: 991.98px) { - .hidden-lg, - .hidden-xl - { - display: none; - } - - .card-header-search - { - margin-left: -1rem; - } - .sidenav .navbar-nav .dropdown-menu { left: 1rem !important; @@ -880,26 +836,6 @@ table .align-items-center td span.badge { /*--------L Breakpoint--------*/ @media (min-width: 992px) and (max-width: 1199.98px) { - .hidden-xl - { - display: none; - } - - .card-header-search - { - margin-left: -1rem; - } - - .card-header-search-text - { - padding-left: 17px; - } - - .card-header-space - { - white-space: nowrap; - } - .sidenav .navbar-nav .dropdown-menu { left: 1rem; @@ -911,15 +847,5 @@ table .align-items-center td span.badge { } } /*--------L Breakpoint Finish--------*/ - -/*--------XL Breakpoint--------*/ -@media (min-width: 1200px) and (max-width: 1327.98px) -{ - .hidden-xl - { - display: none; - } -} -/*--------XL Breakpoint Finish--------*/ /*----------------RESPONSIVE END LINE----------------*/ diff --git a/resources/views/auth/permissions/index.blade.php b/resources/views/auth/permissions/index.blade.php index 7417823f5..fe0762dd4 100644 --- a/resources/views/auth/permissions/index.blade.php +++ b/resources/views/auth/permissions/index.blade.php @@ -18,8 +18,8 @@ 'class' => 'mb-0' ]) !!}
- @@ -32,10 +32,10 @@ - + - + @@ -43,10 +43,10 @@ @foreach($permissions as $item) - + - +
{{ Form::bulkActionAllGroup() }} @sortablelink('display_name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow']) @sortablelink('name', trans('general.code'))@sortablelink('description', trans('general.description'))@sortablelink('description', trans('general.description')) {{ trans('general.actions') }}
{{ Form::bulkActionGroup($item->id, $item->name) }} {{ $item->display_name }} {{ $item->name }}{{ $item->description }}{{ $item->description }}