mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for model factories for L8
This commit is contained in:
parent
1c747cb5c8
commit
c65950672d
@ -93,8 +93,8 @@ class CreateTestData extends Command
|
||||
{
|
||||
$this->info('Creating Small Account and Company');
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'slack_webhook_url' => config('ninja.notification.slack'),
|
||||
]);
|
||||
@ -188,8 +188,8 @@ class CreateTestData extends Command
|
||||
{
|
||||
$this->info('Creating Medium Account and Company');
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'slack_webhook_url' => config('ninja.notification.slack'),
|
||||
]);
|
||||
@ -284,8 +284,8 @@ class CreateTestData extends Command
|
||||
{
|
||||
$this->info('Creating Large Account and Company');
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'slack_webhook_url' => config('ninja.notification.slack'),
|
||||
'is_large' => true,
|
||||
|
@ -18,10 +18,19 @@ use App\Factory\InvoiceItemFactory;
|
||||
use App\Helpers\Invoice\InvoiceSum;
|
||||
use App\Jobs\Ninja\CompanySizeCheck;
|
||||
use App\Jobs\Util\VersionCheck;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\CompanyToken;
|
||||
use App\Models\Country;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Expense;
|
||||
use App\Models\Product;
|
||||
use App\Models\Project;
|
||||
use App\Models\Quote;
|
||||
use App\Models\Task;
|
||||
use App\Models\User;
|
||||
use App\Models\Vendor;
|
||||
use App\Models\VendorContact;
|
||||
use App\Repositories\InvoiceRepository;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\GeneratesCounter;
|
||||
@ -30,8 +39,8 @@ use Carbon\Carbon;
|
||||
use Composer\Composer;
|
||||
use Composer\Console\Application;
|
||||
use Composer\Factory;
|
||||
use Composer\Installer;
|
||||
use Composer\IO\NullIO;
|
||||
use Composer\Installer;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
@ -125,8 +134,8 @@ class DemoMode extends Command
|
||||
|
||||
$this->info('Creating Small Account and Company');
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'slack_webhook_url' => config('ninja.notification.slack'),
|
||||
'enabled_modules' => 32767,
|
||||
@ -155,7 +164,7 @@ class DemoMode extends Command
|
||||
$user = User::whereEmail('small@example.com')->first();
|
||||
|
||||
if (! $user) {
|
||||
$user = factory(\App\Models\User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'email' => 'small@example.com',
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
@ -185,7 +194,7 @@ class DemoMode extends Command
|
||||
$u2 = User::where('email', 'demo@invoiceninja.com')->first();
|
||||
|
||||
if (! $u2) {
|
||||
$u2 = factory(\App\Models\User::class)->create([
|
||||
$u2 = User::factory()->create([
|
||||
'email' => 'demo@invoiceninja.com',
|
||||
'password' => Hash::make('demo'),
|
||||
'account_id' => $account->id,
|
||||
@ -211,7 +220,7 @@ class DemoMode extends Command
|
||||
]);
|
||||
}
|
||||
|
||||
factory(\App\Models\Product::class, 50)->create([
|
||||
Product::factory()->count(50)->create([
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
@ -277,19 +286,19 @@ class DemoMode extends Command
|
||||
// dispatch(function () use ($company, $user) {
|
||||
|
||||
// });
|
||||
$client = factory(\App\Models\Client::class)->create([
|
||||
$client = Client::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class)->create([
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $client->id,
|
||||
'company_id' => $company->id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, rand(1, 5))->create([
|
||||
ClientContact::factory()->count(rand(1,5))->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $client->id,
|
||||
'company_id' => $company->id,
|
||||
@ -311,7 +320,7 @@ class DemoMode extends Command
|
||||
|
||||
private function createExpense($client)
|
||||
{
|
||||
factory(\App\Models\Expense::class, rand(1, 5))->create([
|
||||
Expense::factory()->count(rand(1,5))->create([
|
||||
'user_id' => $client->user_id,
|
||||
'client_id' => $client->id,
|
||||
'company_id' => $client->company_id,
|
||||
@ -320,19 +329,19 @@ class DemoMode extends Command
|
||||
|
||||
private function createVendor($client, $assigned_user_id = null)
|
||||
{
|
||||
$vendor = factory(\App\Models\Vendor::class)->create([
|
||||
Vendor::factory()->count(1)->create([
|
||||
'user_id' => $client->user_id,
|
||||
'company_id' => $client->company_id,
|
||||
]);
|
||||
|
||||
factory(\App\Models\VendorContact::class)->create([
|
||||
VendorContact::factory()->create([
|
||||
'user_id' => $client->user->id,
|
||||
'vendor_id' => $vendor->id,
|
||||
'company_id' => $client->company_id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\VendorContact::class, rand(1, 5))->create([
|
||||
VendorContact::factory()->count(rand(1,5))->create([
|
||||
'user_id' => $client->user->id,
|
||||
'vendor_id' => $vendor->id,
|
||||
'company_id' => $client->company_id,
|
||||
@ -342,7 +351,7 @@ class DemoMode extends Command
|
||||
|
||||
private function createTask($client, $assigned_user_id = null)
|
||||
{
|
||||
$vendor = factory(\App\Models\Task::class)->create([
|
||||
$vendor = Task::factory()->create([
|
||||
'user_id' => $client->user->id,
|
||||
'company_id' => $client->company_id,
|
||||
]);
|
||||
@ -350,7 +359,7 @@ class DemoMode extends Command
|
||||
|
||||
private function createProject($client, $assigned_user_id = null)
|
||||
{
|
||||
$vendor = factory(\App\Models\Project::class)->create([
|
||||
$vendor = Project::factory()->create([
|
||||
'user_id' => $client->user->id,
|
||||
'company_id' => $client->company_id,
|
||||
]);
|
||||
@ -430,7 +439,7 @@ class DemoMode extends Command
|
||||
// }
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$credit = factory(\App\Models\Credit::class)->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
$credit = Credit::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
|
||||
if ((bool) rand(0, 1)) {
|
||||
$dateable = Carbon::now()->subDays(rand(0, 90));
|
||||
@ -478,7 +487,7 @@ class DemoMode extends Command
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$quote = factory(\App\Models\Quote::class)->create(['user_id' => $client->user->id, 'company_id' => $client->company_id, 'client_id' => $client->id]);
|
||||
$quote = Quote::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company_id, 'client_id' => $client->id]);
|
||||
|
||||
if ((bool) rand(0, 1)) {
|
||||
$dateable = Carbon::now()->subDays(rand(1, 30));
|
||||
|
@ -107,7 +107,7 @@ class ImportMigrations extends Command
|
||||
|
||||
public function getAccount(): Account
|
||||
{
|
||||
return factory(\App\Models\Account::class)->create();
|
||||
return Account::factory()->create();
|
||||
}
|
||||
|
||||
public function getCompany(Account $account): Company
|
||||
|
@ -20,8 +20,10 @@ use App\Factory\InvoiceInvitationFactory;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\CreateInvoicePdf;
|
||||
use App\Mail\TemplateEmail;
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
@ -80,9 +82,10 @@ class SendTestEmails extends Command
|
||||
$user = User::whereEmail('user@example.com')->first();
|
||||
|
||||
if (! $user) {
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
|
||||
$account = Account::factory()->create();
|
||||
|
||||
$user = factory(\App\Models\User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => '123',
|
||||
'email' => $faker->safeEmail,
|
||||
@ -90,7 +93,7 @@ class SendTestEmails extends Command
|
||||
'last_name' => 'Doe',
|
||||
]);
|
||||
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
@ -115,7 +118,7 @@ class SendTestEmails extends Command
|
||||
$client = ClientFactory::create($company->id, $user->id);
|
||||
$client->save();
|
||||
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $client->id,
|
||||
'company_id' => $company->id,
|
||||
@ -124,7 +127,7 @@ class SendTestEmails extends Command
|
||||
'email' => $faker->safeEmail,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $client->id,
|
||||
'company_id' => $company->id,
|
||||
|
@ -24,12 +24,14 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class BaseModel extends Model
|
||||
{
|
||||
use MakesHash;
|
||||
use UserSessionAttributes;
|
||||
|
||||
use HasFactory;
|
||||
|
||||
//todo customise names of archived_at / updated_at columns
|
||||
///const CREATED_AT = 'creation_date';
|
||||
//const UPDATED_AT = 'last_update';
|
||||
|
@ -14,12 +14,13 @@ namespace App\Models;
|
||||
use App\Models\Company;
|
||||
use App\Models\Language;
|
||||
use App\Models\User;
|
||||
use App\Notifications\ClientContactResetPassword;
|
||||
use App\Notifications\ClientContactResetPassword as ResetPasswordNotification;
|
||||
use App\Notifications\ClientContactResetPassword;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Hashids\Hashids;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@ -33,7 +34,8 @@ class ClientContact extends Authenticatable implements HasLocalePreference
|
||||
use MakesHash;
|
||||
use PresentableTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
use HasFactory;
|
||||
|
||||
/* Used to authenticate a contact */
|
||||
protected $guard = 'contact';
|
||||
|
||||
|
@ -22,6 +22,7 @@ use App\Utils\Traits\UserSessionAttributes;
|
||||
use App\Utils\Traits\UserSettings;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@ -40,7 +41,8 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
use UserSettings;
|
||||
use Filterable;
|
||||
use \Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
|
||||
use HasFactory;
|
||||
|
||||
protected $guard = 'user';
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
@ -14,12 +14,13 @@ namespace App\Models;
|
||||
use App\Models\Company;
|
||||
use App\Models\Language;
|
||||
use App\Models\User;
|
||||
use App\Notifications\ClientContactResetPassword;
|
||||
use App\Notifications\ClientContactResetPassword as ResetPasswordNotification;
|
||||
use App\Notifications\ClientContactResetPassword;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Hashids\Hashids;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@ -33,6 +34,7 @@ class VendorContact extends Authenticatable implements HasLocalePreference
|
||||
use MakesHash;
|
||||
use PresentableTrait;
|
||||
use SoftDeletes;
|
||||
use HasFactory;
|
||||
|
||||
/* Used to authenticate a vendor */
|
||||
protected $guard = 'vendor';
|
||||
|
@ -10,30 +10,39 @@
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Account;
|
||||
use App\Models\ClientContact;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
class ClientContactFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = ClientContact::class;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This directory should contain each of the model factory definitions for
|
||||
| your application. Factories provide a convenient way to generate new
|
||||
| model instances for testing / seeding your application's database.
|
||||
|
|
||||
*/
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'first_name' => $this->faker->firstName,
|
||||
'last_name' => $this->faker->lastName,
|
||||
'phone' => $this->faker->phoneNumber,
|
||||
'email_verified_at' => now(),
|
||||
'email' => $this->faker->unique()->safeEmail,
|
||||
'send_email' => true,
|
||||
'password' => bcrypt('password'),
|
||||
'remember_token' => \Illuminate\Support\Str::random(10),
|
||||
'contact_key' => \Illuminate\Support\Str::random(40),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$factory->define(App\Models\ClientContact::class, function (Faker $faker) {
|
||||
return [
|
||||
'first_name' => $faker->firstName,
|
||||
'last_name' => $faker->lastName,
|
||||
'phone' => $faker->phoneNumber,
|
||||
'email_verified_at' => now(),
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'send_email' => true,
|
||||
'password' => bcrypt('password'),
|
||||
'remember_token' => \Illuminate\Support\Str::random(10),
|
||||
'contact_key' => \Illuminate\Support\Str::random(40),
|
||||
];
|
||||
});
|
||||
|
@ -12,35 +12,53 @@ namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Client;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Client::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->company(),
|
||||
'website' => $faker->url,
|
||||
'private_notes' => $faker->text(200),
|
||||
'balance' => 0,
|
||||
'paid_to_date' => 0,
|
||||
'vat_number' => $faker->numberBetween(123456789, 987654321),
|
||||
'id_number' => '',
|
||||
'custom_value1' => '',
|
||||
'custom_value2' => '',
|
||||
'custom_value3' => '',
|
||||
'custom_value4' => '',
|
||||
'address1' => $faker->buildingNumber,
|
||||
'address2' => $faker->streetAddress,
|
||||
'city' => $faker->city,
|
||||
'state' => $faker->state,
|
||||
'postal_code' => $faker->postcode,
|
||||
'country_id' => 4,
|
||||
'shipping_address1' => $faker->buildingNumber,
|
||||
'shipping_address2' => $faker->streetAddress,
|
||||
'shipping_city' => $faker->city,
|
||||
'shipping_state' => $faker->state,
|
||||
'shipping_postal_code' => $faker->postcode,
|
||||
'shipping_country_id' => 4,
|
||||
'settings' => ClientSettings::defaults(),
|
||||
'client_hash' => \Illuminate\Support\Str::random(40),
|
||||
];
|
||||
});
|
||||
class ClientFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Client::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
|
||||
return [
|
||||
'name' => $this->faker->company(),
|
||||
'website' => $this->faker->url,
|
||||
'private_notes' => $this->faker->text(200),
|
||||
'balance' => 0,
|
||||
'paid_to_date' => 0,
|
||||
'vat_number' => $this->faker->numberBetween(123456789, 987654321),
|
||||
'id_number' => '',
|
||||
'custom_value1' => '',
|
||||
'custom_value2' => '',
|
||||
'custom_value3' => '',
|
||||
'custom_value4' => '',
|
||||
'address1' => $this->faker->buildingNumber,
|
||||
'address2' => $this->faker->streetAddress,
|
||||
'city' => $this->faker->city,
|
||||
'state' => $this->faker->state,
|
||||
'postal_code' => $this->faker->postcode,
|
||||
'country_id' => 4,
|
||||
'shipping_address1' => $this->faker->buildingNumber,
|
||||
'shipping_address2' => $this->faker->streetAddress,
|
||||
'shipping_city' => $this->faker->city,
|
||||
'shipping_state' => $this->faker->state,
|
||||
'shipping_postal_code' => $this->faker->postcode,
|
||||
'shipping_country_id' => 4,
|
||||
'settings' => ClientSettings::defaults(),
|
||||
'client_hash' => \Illuminate\Support\Str::random(40),
|
||||
];
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\ClientLocation::class, function (Faker $faker) {
|
||||
return [
|
||||
'address1' => $faker->buildingNumber,
|
||||
'address2' => $faker->streetAddress,
|
||||
'city' => $faker->city,
|
||||
'state' => $faker->state,
|
||||
'postal_code' => $faker->postcode,
|
||||
'country_id' => 4,
|
||||
'latitude' => $faker->latitude,
|
||||
'longitude' => $faker->longitude,
|
||||
'description' => $faker->paragraph,
|
||||
'private_notes' => $faker->paragraph,
|
||||
];
|
||||
});
|
@ -12,29 +12,47 @@ namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Company;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Company::class, function (Faker $faker) {
|
||||
return [
|
||||
//'name' => $faker->name,
|
||||
'company_key' => strtolower(\Illuminate\Support\Str::random(config('ninja.key_length'))),
|
||||
'ip' => $faker->ipv4,
|
||||
'db' => config('database.default'),
|
||||
'settings' => CompanySettings::defaults(),
|
||||
'is_large' => false,
|
||||
'custom_fields' => (object) [
|
||||
//'invoice1' => 'Custom Date|date',
|
||||
// 'invoice2' => '2|switch',
|
||||
// 'invoice3' => '3|',
|
||||
// 'invoice4' => '4',
|
||||
// 'client1'=>'1',
|
||||
// 'client2'=>'2',
|
||||
// 'client3'=>'3|date',
|
||||
// 'client4'=>'4|switch',
|
||||
// 'company1'=>'1|date',
|
||||
// 'company2'=>'2|switch',
|
||||
// 'company3'=>'3',
|
||||
// 'company4'=>'4',
|
||||
],
|
||||
];
|
||||
});
|
||||
class CompanyFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Company::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
//'name' => $this->faker->name,
|
||||
'company_key' => strtolower(\Illuminate\Support\Str::random(config('ninja.key_length'))),
|
||||
'ip' => $this->faker->ipv4,
|
||||
'db' => config('database.default'),
|
||||
'settings' => CompanySettings::defaults(),
|
||||
'is_large' => false,
|
||||
'custom_fields' => (object) [
|
||||
//'invoice1' => 'Custom Date|date',
|
||||
// 'invoice2' => '2|switch',
|
||||
// 'invoice3' => '3|',
|
||||
// 'invoice4' => '4',
|
||||
// 'client1'=>'1',
|
||||
// 'client2'=>'2',
|
||||
// 'client3'=>'3|date',
|
||||
// 'client4'=>'4|switch',
|
||||
// 'company1'=>'1|date',
|
||||
// 'company2'=>'2|switch',
|
||||
// 'company3'=>'3',
|
||||
// 'company4'=>'4',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -14,28 +14,46 @@ namespace Database\Factories;
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Credit;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Credit::class, function (Faker $faker) {
|
||||
return [
|
||||
'status_id' => App\Models\Credit::STATUS_DRAFT,
|
||||
'discount' => $faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => (bool) random_int(0, 1),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
//'tax_name3' => 'THIRDTAX',
|
||||
//'tax_rate3' => 5,
|
||||
// 'custom_value1' => $faker->numberBetween(1,4),
|
||||
// 'custom_value2' => $faker->numberBetween(1,4),
|
||||
// 'custom_value3' => $faker->numberBetween(1,4),
|
||||
// 'custom_value4' => $faker->numberBetween(1,4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $faker->text(10),
|
||||
'date' => $faker->date(),
|
||||
'due_date' => $faker->date(),
|
||||
'line_items' => InvoiceItemFactory::generateCredit(5),
|
||||
'terms' => $faker->text(500),
|
||||
];
|
||||
});
|
||||
class CreditFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Credit::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'status_id' => Credit::STATUS_DRAFT,
|
||||
'discount' => $this->faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => (bool) random_int(0, 1),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
//'tax_name3' => 'THIRDTAX',
|
||||
//'tax_rate3' => 5,
|
||||
// 'custom_value1' => $this->faker->numberBetween(1,4),
|
||||
// 'custom_value2' => $this->faker->numberBetween(1,4),
|
||||
// 'custom_value3' => $this->faker->numberBetween(1,4),
|
||||
// 'custom_value4' => $this->faker->numberBetween(1,4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $this->faker->text(10),
|
||||
'date' => $this->faker->date(),
|
||||
'due_date' => $this->faker->date(),
|
||||
'line_items' => InvoiceItemFactory::generateCredit(5),
|
||||
'terms' => $this->faker->text(500),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -10,24 +10,38 @@
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Expense;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use Faker\Generator as Faker;
|
||||
class ExpenseFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Expense::class;
|
||||
|
||||
$factory->define(App\Models\Expense::class, function (Faker $faker) {
|
||||
return [
|
||||
'amount' => $faker->numberBetween(1, 10),
|
||||
'custom_value1' => $faker->text(10),
|
||||
'custom_value2' => $faker->text(10),
|
||||
'custom_value3' => $faker->text(10),
|
||||
'custom_value4' => $faker->text(10),
|
||||
'exchange_rate' => $faker->randomFloat(2, 0, 1),
|
||||
'expense_date' => $faker->date(),
|
||||
'is_deleted' => false,
|
||||
'public_notes' => $faker->text(50),
|
||||
'private_notes' => $faker->text(50),
|
||||
'transaction_reference' => $faker->text(5),
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'amount' => $this->faker->numberBetween(1, 10),
|
||||
'custom_value1' => $this->faker->text(10),
|
||||
'custom_value2' => $this->faker->text(10),
|
||||
'custom_value3' => $this->faker->text(10),
|
||||
'custom_value4' => $this->faker->text(10),
|
||||
'exchange_rate' => $this->faker->randomFloat(2, 0, 1),
|
||||
'expense_date' => $this->faker->date(),
|
||||
'is_deleted' => false,
|
||||
'public_notes' => $this->faker->text(50),
|
||||
'private_notes' => $this->faker->text(50),
|
||||
'transaction_reference' => $this->faker->text(5),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -10,19 +10,36 @@
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Gateway;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
class GatewayFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Gateway::class;
|
||||
|
||||
$factory->define(App\Models\Gateway::class, function (Faker $faker) {
|
||||
return [
|
||||
'key' => '3b6621f970ab18887c4f6dca78d3f8bb',
|
||||
'visible' => true,
|
||||
'sort_order' =>1,
|
||||
'name' => 'demo',
|
||||
'provider' => 'test',
|
||||
'is_offsite' => true,
|
||||
'is_secure' => true,
|
||||
'fields' => '',
|
||||
'default_gateway_type_id' => 1,
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'key' => '3b6621f970ab18887c4f6dca78d3f8bb',
|
||||
'visible' => true,
|
||||
'sort_order' =>1,
|
||||
'name' => 'demo',
|
||||
'provider' => 'test',
|
||||
'is_offsite' => true,
|
||||
'is_secure' => true,
|
||||
'fields' => '',
|
||||
'default_gateway_type_id' => 1,
|
||||
];
|
||||
}
|
||||
}
|
@ -14,29 +14,47 @@ namespace Database\Factories;
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Invoice;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Invoice::class, function (Faker $faker) {
|
||||
return [
|
||||
'status_id' => App\Models\Invoice::STATUS_SENT,
|
||||
'number' => $faker->ean13(),
|
||||
'discount' => $faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => (bool) random_int(0, 1),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
//'tax_name3' => 'THIRDTAX',
|
||||
//'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->date,
|
||||
'custom_value2' => rand(0, 1) ? 'yes' : 'no',
|
||||
// 'custom_value3' => $faker->numberBetween(1,4),
|
||||
// 'custom_value4' => $faker->numberBetween(1,4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $faker->text(10),
|
||||
'date' => $faker->date(),
|
||||
'due_date' => $faker->date(),
|
||||
'line_items' => InvoiceItemFactory::generate(5),
|
||||
'terms' => $faker->text(500),
|
||||
];
|
||||
});
|
||||
class InvoiceFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Invoice::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'status_id' => App\Models\Invoice::STATUS_SENT,
|
||||
'number' => $this->faker->ean13(),
|
||||
'discount' => $this->faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => (bool) random_int(0, 1),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
//'tax_name3' => 'THIRDTAX',
|
||||
//'tax_rate3' => 5,
|
||||
'custom_value1' => $this->faker->date,
|
||||
'custom_value2' => rand(0, 1) ? 'yes' : 'no',
|
||||
// 'custom_value3' => $this->faker->numberBetween(1,4),
|
||||
// 'custom_value4' => $this->faker->numberBetween(1,4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $this->faker->text(10),
|
||||
'date' => $this->faker->date(),
|
||||
'due_date' => $this->faker->date(),
|
||||
'line_items' => InvoiceItemFactory::generate(5),
|
||||
'terms' => $this->faker->text(500),
|
||||
];
|
||||
}
|
||||
}
|
@ -10,12 +10,28 @@
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\InvoiceInvitation::class, function (Faker $faker) {
|
||||
return [
|
||||
'key' => Str::random(40),
|
||||
];
|
||||
});
|
||||
class InvoiceInvitationFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = InvoiceInvitation::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'key' => Str::random(40),
|
||||
];
|
||||
}
|
||||
}
|
@ -11,18 +11,34 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Models\Payment;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Payment::class, function (Faker $faker) {
|
||||
return [
|
||||
'is_deleted' => false,
|
||||
'amount' => $faker->numberBetween(1, 10),
|
||||
'date' => $faker->date(),
|
||||
'transaction_reference' => $faker->text(10),
|
||||
'type_id' => Payment::TYPE_CREDIT_CARD,
|
||||
'status_id' => Payment::STATUS_COMPLETED,
|
||||
];
|
||||
});
|
||||
use App\Models\Payment;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class PaymentFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Payment::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'is_deleted' => false,
|
||||
'amount' => $this->faker->numberBetween(1, 10),
|
||||
'date' => $this->faker->date(),
|
||||
'transaction_reference' => $this->faker->text(10),
|
||||
'type_id' => Payment::TYPE_CREDIT_CARD,
|
||||
'status_id' => Payment::STATUS_COMPLETED,
|
||||
];
|
||||
}
|
||||
}
|
@ -11,25 +11,43 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Product;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Product::class, function (Faker $faker) {
|
||||
return [
|
||||
'product_key' => $faker->text(7),
|
||||
'notes' => $faker->text(20),
|
||||
'cost' => $faker->numberBetween(1, 1000),
|
||||
'price' => $faker->numberBetween(1, 1000),
|
||||
'quantity' => $faker->numberBetween(1, 100),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->text(20),
|
||||
'custom_value2' => $faker->text(20),
|
||||
'custom_value3' => $faker->text(20),
|
||||
'custom_value4' => $faker->text(20),
|
||||
'is_deleted' => false,
|
||||
];
|
||||
});
|
||||
class ProductFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Product::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'product_key' => $this->faker->text(7),
|
||||
'notes' => $this->faker->text(20),
|
||||
'cost' => $this->faker->numberBetween(1, 1000),
|
||||
'price' => $this->faker->numberBetween(1, 1000),
|
||||
'quantity' => $this->faker->numberBetween(1, 100),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $this->faker->text(20),
|
||||
'custom_value2' => $this->faker->text(20),
|
||||
'custom_value3' => $this->faker->text(20),
|
||||
'custom_value4' => $this->faker->text(20),
|
||||
'is_deleted' => false,
|
||||
];
|
||||
}
|
||||
}
|
@ -11,13 +11,30 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Project::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name(),
|
||||
'description' => $faker->text(50),
|
||||
];
|
||||
});
|
||||
use App\Models\Project;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProjectFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Project::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name(),
|
||||
'description' => $this->faker->text(50),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -11,27 +11,43 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Quote;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Quote::class, function (Faker $faker) {
|
||||
return [
|
||||
'status_id' => App\Models\Quote::STATUS_DRAFT,
|
||||
'discount' => $faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => $faker->boolean(),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
// 'custom_value1' => $faker->numberBetween(1, 4),
|
||||
// 'custom_value2' => $faker->numberBetween(1, 4),
|
||||
// 'custom_value3' => $faker->numberBetween(1, 4),
|
||||
// 'custom_value4' => $faker->numberBetween(1, 4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $faker->text(10),
|
||||
'line_items' => false,
|
||||
];
|
||||
});
|
||||
class QuoteFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Quote::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'status_id' => Quote::STATUS_DRAFT,
|
||||
'discount' => $this->faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => $this->faker->boolean(),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
// 'custom_value1' => $this->faker->numberBetween(1, 4),
|
||||
// 'custom_value2' => $this->faker->numberBetween(1, 4),
|
||||
// 'custom_value3' => $this->faker->numberBetween(1, 4),
|
||||
// 'custom_value4' => $this->faker->numberBetween(1, 4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $this->faker->text(10),
|
||||
'line_items' => false,
|
||||
];
|
||||
}
|
||||
}
|
@ -11,11 +11,28 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\QuoteInvitation;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\QuoteInvitation::class, function (Faker $faker) {
|
||||
return [
|
||||
'key' => Str::random(40),
|
||||
];
|
||||
});
|
||||
class QuoteInvitationFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = QuoteInvitation::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'key' => Str::random(40),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -11,35 +11,51 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\RecurringInvoice;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\RecurringInvoice::class, function (Faker $faker) {
|
||||
return [
|
||||
'status_id' => App\Models\RecurringInvoice::STATUS_ACTIVE,
|
||||
'discount' => $faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => $faker->boolean(),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $faker->numberBetween(1, 4),
|
||||
'custom_value2' => $faker->numberBetween(1, 4),
|
||||
'custom_value3' => $faker->numberBetween(1, 4),
|
||||
'custom_value4' => $faker->numberBetween(1, 4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $faker->text(10),
|
||||
'date' => $faker->date(),
|
||||
'due_date' => $faker->date(),
|
||||
'line_items' => false,
|
||||
'frequency_id' => App\Models\RecurringInvoice::FREQUENCY_MONTHLY,
|
||||
'last_sent_date' => now()->subMonth(),
|
||||
'next_send_date' => now()->addMonthNoOverflow(),
|
||||
'remaining_cycles' => $faker->numberBetween(1, 10),
|
||||
'amount' => $faker->randomFloat(2, $min = 1, $max = 1000), // 48.8932
|
||||
class RecurringInvoiceFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = RecurringInvoice::class;
|
||||
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'status_id' => App\Models\RecurringInvoice::STATUS_ACTIVE,
|
||||
'discount' => $this->faker->numberBetween(1, 10),
|
||||
'is_amount_discount' => $this->faker->boolean(),
|
||||
'tax_name1' => 'GST',
|
||||
'tax_rate1' => 10,
|
||||
'tax_name2' => 'VAT',
|
||||
'tax_rate2' => 17.5,
|
||||
'tax_name3' => 'THIRDTAX',
|
||||
'tax_rate3' => 5,
|
||||
'custom_value1' => $this->faker->numberBetween(1, 4),
|
||||
'custom_value2' => $this->faker->numberBetween(1, 4),
|
||||
'custom_value3' => $this->faker->numberBetween(1, 4),
|
||||
'custom_value4' => $this->faker->numberBetween(1, 4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $this->faker->text(10),
|
||||
'date' => $this->faker->date(),
|
||||
'due_date' => $this->faker->date(),
|
||||
'line_items' => false,
|
||||
'frequency_id' => App\Models\RecurringInvoice::FREQUENCY_MONTHLY,
|
||||
'last_sent_date' => now()->subMonth(),
|
||||
'next_send_date' => now()->addMonthNoOverflow(),
|
||||
'remaining_cycles' => $this->faker->numberBetween(1, 10),
|
||||
'amount' => $this->faker->randomFloat(2, $min = 1, $max = 1000), // 48.8932
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -11,12 +11,28 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\Task;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$factory->define(App\Models\Task::class, function (Faker $faker) {
|
||||
return [
|
||||
'description' => $faker->text(50),
|
||||
];
|
||||
});
|
||||
class TaskFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Task::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'description' => $this->faker->text(50),
|
||||
];
|
||||
}
|
||||
}
|
@ -11,27 +11,34 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This directory should contain each of the model factory definitions for
|
||||
| your application. Factories provide a convenient way to generate new
|
||||
| model instances for testing / seeding your application's database.
|
||||
|
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = User::class;
|
||||
|
||||
$factory->define(App\Models\User::class, function (Faker $faker) {
|
||||
return [
|
||||
'first_name' => $faker->name,
|
||||
'last_name' => $faker->name,
|
||||
'phone' => $faker->phoneNumber,
|
||||
'email' => config('ninja.testvars.username'),
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt(config('ninja.testvars.password')), // secret
|
||||
'remember_token' => \Illuminate\Support\Str::random(10),
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'first_name' => $this->faker->name,
|
||||
'last_name' => $this->faker->name,
|
||||
'phone' => $this->faker->phoneNumber,
|
||||
'email' => config('ninja.testvars.username'),
|
||||
'email_verified_at' => now(),
|
||||
'password' => bcrypt(config('ninja.testvars.password')), // secret
|
||||
'remember_token' => \Illuminate\Support\Str::random(10),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -11,24 +11,31 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\VendorContact;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This directory should contain each of the model factory definitions for
|
||||
| your application. Factories provide a convenient way to generate new
|
||||
| model instances for testing / seeding your application's database.
|
||||
|
|
||||
*/
|
||||
class VendorContactFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = VendorContact::class;
|
||||
|
||||
$factory->define(App\Models\VendorContact::class, function (Faker $faker) {
|
||||
return [
|
||||
'first_name' => $faker->firstName,
|
||||
'last_name' => $faker->lastName,
|
||||
'phone' => $faker->phoneNumber,
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'first_name' => $this->faker->firstName,
|
||||
'last_name' => $this->faker->lastName,
|
||||
'phone' => $this->faker->phoneNumber,
|
||||
'email' => $this->faker->unique()->safeEmail,
|
||||
];
|
||||
}
|
||||
}
|
@ -10,25 +10,42 @@
|
||||
*/
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Vendor;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
class VendorFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Vendor::class;
|
||||
|
||||
$factory->define(App\Models\Vendor::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name(),
|
||||
'website' => $faker->url,
|
||||
'private_notes' => $faker->text(200),
|
||||
'vat_number' => $faker->text(25),
|
||||
'id_number' => $faker->text(20),
|
||||
'custom_value1' => $faker->text(20),
|
||||
'custom_value2' => $faker->text(20),
|
||||
'custom_value3' => $faker->text(20),
|
||||
'custom_value4' => $faker->text(20),
|
||||
'address1' => $faker->buildingNumber,
|
||||
'address2' => $faker->streetAddress,
|
||||
'city' => $faker->city,
|
||||
'state' => $faker->state,
|
||||
'postal_code' => $faker->postcode,
|
||||
'country_id' => 4,
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name(),
|
||||
'website' => $this->faker->url,
|
||||
'private_notes' => $this->faker->text(200),
|
||||
'vat_number' => $this->faker->text(25),
|
||||
'id_number' => $this->faker->text(20),
|
||||
'custom_value1' => $this->faker->text(20),
|
||||
'custom_value2' => $this->faker->text(20),
|
||||
'custom_value3' => $this->faker->text(20),
|
||||
'custom_value4' => $this->faker->text(20),
|
||||
'address1' => $this->faker->buildingNumber,
|
||||
'address2' => $this->faker->streetAddress,
|
||||
'city' => $this->faker->city,
|
||||
'state' => $this->faker->state,
|
||||
'postal_code' => $this->faker->postcode,
|
||||
'country_id' => 4,
|
||||
];
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,165 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\PaymentLibrary;
|
||||
use App\Models\Size;
|
||||
use App\Models\Timezone;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ConstantsSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Size::create(['name' => '1 - 3']);
|
||||
Size::create(['name' => '4 - 10']);
|
||||
Size::create(['name' => '11 - 50']);
|
||||
Size::create(['name' => '51 - 100']);
|
||||
Size::create(['name' => '101 - 500']);
|
||||
Size::create(['name' => '500+']);
|
||||
|
||||
PaymentLibrary::create(['name' => 'Omnipay']);
|
||||
|
||||
/*
|
||||
d, dd: Numeric date, no leading zero and leading zero, respectively. Eg, 5, 05.
|
||||
D, DD: Abbreviated and full weekday names, respectively. Eg, Mon, Monday.
|
||||
m, mm: Numeric month, no leading zero and leading zero, respectively. Eg, 7, 07.
|
||||
M, MM: Abbreviated and full month names, respectively. Eg, Jan, January
|
||||
yy, yyyy: 2- and 4-digit years, respectively. Eg, 12, 2012.)
|
||||
*/
|
||||
|
||||
$timezones[] = ['name'=>'Pacific/Midway', 'location', 'location' => '(GMT-11:00) Midway Island', 'utc_offset' => -39600];
|
||||
$timezones[] = ['name'=>'US/Samoa', 'location' => '(GMT-11:00) Samoa', 'utc_offset' => -39600];
|
||||
$timezones[] = ['name'=>'US/Hawaii', 'location' => '(GMT-10:00) Hawaii', 'utc_offset' => -36000];
|
||||
$timezones[] = ['name'=>'US/Alaska', 'location' => '(GMT-09:00) Alaska', 'utc_offset' => -32400];
|
||||
$timezones[] = ['name'=>'US/Pacific', 'location' => '(GMT-08:00) Pacific Time (US & Canada)', 'utc_offset' => -28800];
|
||||
$timezones[] = ['name'=>'America/Tijuana', 'location' => '(GMT-08:00) Tijuana', 'utc_offset' => -28800];
|
||||
$timezones[] = ['name'=>'US/Arizona', 'location' => '(GMT-07:00) Arizona', 'utc_offset' => -25200];
|
||||
$timezones[] = ['name'=>'US/Mountain', 'location' => '(GMT-07:00) Mountain Time (US & Canada)', 'utc_offset' => -25200];
|
||||
$timezones[] = ['name'=>'America/Chihuahua', 'location' => '(GMT-07:00) Chihuahua', 'utc_offset' => -25200];
|
||||
$timezones[] = ['name'=>'America/Mazatlan', 'location' => '(GMT-07:00) Mazatlan', 'utc_offset' => -25200];
|
||||
$timezones[] = ['name'=>'America/Mexico_City', 'location' => '(GMT-06:00) Mexico City', 'utc_offset' => -21600];
|
||||
$timezones[] = ['name'=>'America/Monterrey', 'location' => '(GMT-06:00) Monterrey', 'utc_offset' => -21600];
|
||||
$timezones[] = ['name'=>'Canada/Saskatchewan', 'location' => '(GMT-06:00) Saskatchewan', 'utc_offset' => -21600];
|
||||
$timezones[] = ['name'=>'US/Central', 'location' => '(GMT-06:00) Central Time (US & Canada)', 'utc_offset' => -21600];
|
||||
$timezones[] = ['name'=>'US/Eastern', 'location' => '(GMT-05:00) Eastern Time (US & Canada)', 'utc_offset' => -18000];
|
||||
$timezones[] = ['name'=>'US/East-Indiana', 'location' => '(GMT-05:00) Indiana (East)', 'utc_offset' => -18000];
|
||||
$timezones[] = ['name'=>'America/Bogota', 'location' => '(GMT-05:00) Bogota', 'utc_offset' => -18000];
|
||||
$timezones[] = ['name'=>'America/Lima', 'location' => '(GMT-05:00) Lima', 'utc_offset' => -18000];
|
||||
$timezones[] = ['name'=>'America/Caracas', 'location' => '(GMT-04:00) Caracas', 'utc_offset' => -14400];
|
||||
$timezones[] = ['name'=>'Canada/Atlantic', 'location' => '(GMT-04:00) Atlantic Time (Canada)', 'utc_offset' => -14400];
|
||||
$timezones[] = ['name'=>'America/La_Paz', 'location' => '(GMT-04:00) La Paz', 'utc_offset' => -14400];
|
||||
$timezones[] = ['name'=>'America/Santiago', 'location' => '(GMT-04:00) Santiago', 'utc_offset' => -14400];
|
||||
$timezones[] = ['name'=>'Canada/Newfoundland', 'location' => '(GMT-03:30) Newfoundland', 'utc_offset' => -12600];
|
||||
$timezones[] = ['name'=>'America/Buenos_Aires', 'location' => '(GMT-03:00) Buenos Aires', 'utc_offset' => -10800];
|
||||
$timezones[] = ['name'=>'America/Godthab', 'location' => '(GMT-03:00) Greenland', 'utc_offset' => -10800];
|
||||
$timezones[] = ['name'=>'Atlantic/Stanley', 'location' => '(GMT-02:00) Stanley', 'utc_offset' => -7200];
|
||||
$timezones[] = ['name'=>'Atlantic/Azores', 'location' => '(GMT-01:00) Azores', 'utc_offset' => -3600];
|
||||
$timezones[] = ['name'=>'Atlantic/Cape_Verde', 'location' => '(GMT-01:00) Cape Verde Is.', 'utc_offset' => -3600];
|
||||
$timezones[] = ['name'=>'Africa/Casablanca', 'location' => '(GMT) Casablanca', 'utc_offset' => 0];
|
||||
$timezones[] = ['name'=>'Europe/Dublin', 'location' => '(GMT) Dublin', 'utc_offset' => 0];
|
||||
$timezones[] = ['name'=>'Europe/Lisbon', 'location' => '(GMT) Lisbon', 'utc_offset' => 0];
|
||||
$timezones[] = ['name'=>'Europe/London', 'location' => '(GMT) London', 'utc_offset' => 0];
|
||||
$timezones[] = ['name'=>'Africa/Monrovia', 'location' => '(GMT) Monrovia', 'utc_offset' => 0];
|
||||
$timezones[] = ['name'=>'Europe/Amsterdam', 'location' => '(GMT+01:00) Amsterdam', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Belgrade', 'location' => '(GMT+01:00) Belgrade', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Berlin', 'location' => '(GMT+01:00) Berlin', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Bratislava', 'location' => '(GMT+01:00) Bratislava', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Brussels', 'location' => '(GMT+01:00) Brussels', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Budapest', 'location' => '(GMT+01:00) Budapest', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Copenhagen', 'location' => '(GMT+01:00) Copenhagen', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Ljubljana', 'location' => '(GMT+01:00) Ljubljana', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Madrid', 'location' => '(GMT+01:00) Madrid', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Paris', 'location' => '(GMT+01:00) Paris', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Prague', 'location' => '(GMT+01:00) Prague', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Rome', 'location' => '(GMT+01:00) Rome', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Sarajevo', 'location' => '(GMT+01:00) Sarajevo', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Skopje', 'location' => '(GMT+01:00) Skopje', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Stockholm', 'location' => '(GMT+01:00) Stockholm', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Vienna', 'location' => '(GMT+01:00) Vienna', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Warsaw', 'location' => '(GMT+01:00) Warsaw', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Zagreb', 'location' => '(GMT+01:00) Zagreb', 'utc_offset' => 3600];
|
||||
$timezones[] = ['name'=>'Europe/Athens', 'location' => '(GMT+02:00) Athens', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Bucharest', 'location' => '(GMT+02:00) Bucharest', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Africa/Cairo', 'location' => '(GMT+02:00) Cairo', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Africa/Harare', 'location' => '(GMT+02:00) Harare', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Helsinki', 'location' => '(GMT+02:00) Helsinki', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Asia/Jerusalem', 'location' => '(GMT+02:00) Jerusalem', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Kiev', 'location' => '(GMT+02:00) Kyiv', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Minsk', 'location' => '(GMT+02:00) Minsk', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Riga', 'location' => '(GMT+02:00) Riga', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Sofia', 'location' => '(GMT+02:00) Sofia', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Tallinn', 'location' => '(GMT+02:00) Tallinn', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Vilnius', 'location' => '(GMT+02:00) Vilnius', 'utc_offset' => 7200];
|
||||
$timezones[] = ['name'=>'Europe/Istanbul', 'location' => '(GMT+03:00) Istanbul', 'utc_offset' => 10800];
|
||||
$timezones[] = ['name'=>'Asia/Baghdad', 'location' => '(GMT+03:00) Baghdad', 'utc_offset' => 10800];
|
||||
$timezones[] = ['name'=>'Asia/Kuwait', 'location' => '(GMT+03:00) Kuwait', 'utc_offset' => 10800];
|
||||
$timezones[] = ['name'=>'Africa/Nairobi', 'location' => '(GMT+03:00) Nairobi', 'utc_offset' => 10800];
|
||||
$timezones[] = ['name'=>'Asia/Riyadh', 'location' => '(GMT+03:00) Riyadh', 'utc_offset' => 10800];
|
||||
$timezones[] = ['name'=>'Asia/Tehran', 'location' => '(GMT+03:30) Tehran', 'utc_offset' => 12600];
|
||||
$timezones[] = ['name'=>'Europe/Moscow', 'location' => '(GMT+04:00) Moscow', 'utc_offset' => 14400];
|
||||
$timezones[] = ['name'=>'Asia/Baku', 'location' => '(GMT+04:00) Baku', 'utc_offset' => 14400];
|
||||
$timezones[] = ['name'=>'Europe/Volgograd', 'location' => '(GMT+04:00) Volgograd', 'utc_offset' => 14400];
|
||||
$timezones[] = ['name'=>'Asia/Muscat', 'location' => '(GMT+04:00) Muscat', 'utc_offset' => 14400];
|
||||
$timezones[] = ['name'=>'Asia/Tbilisi', 'location' => '(GMT+04:00) Tbilisi', 'utc_offset' => 14400];
|
||||
$timezones[] = ['name'=>'Asia/Yerevan', 'location' => '(GMT+04:00) Yerevan', 'utc_offset' => 14400];
|
||||
$timezones[] = ['name'=>'Asia/Kabul', 'location' => '(GMT+04:30) Kabul', 'utc_offset' => 16200];
|
||||
$timezones[] = ['name'=>'Asia/Karachi', 'location' => '(GMT+05:00) Karachi', 'utc_offset' => 18000];
|
||||
$timezones[] = ['name'=>'Asia/Tashkent', 'location' => '(GMT+05:00) Tashkent', 'utc_offset' => 18000];
|
||||
$timezones[] = ['name'=>'Asia/Kolkata', 'location' => '(GMT+05:30) Kolkata', 'utc_offset' => 19800];
|
||||
$timezones[] = ['name'=>'Asia/Kathmandu', 'location' => '(GMT+05:45) Kathmandu', 'utc_offset' => 20700];
|
||||
$timezones[] = ['name'=>'Asia/Yekaterinburg', 'location' => '(GMT+06:00) Ekaterinburg', 'utc_offset' => 21600];
|
||||
$timezones[] = ['name'=>'Asia/Almaty', 'location' => '(GMT+06:00) Almaty', 'utc_offset' => 21600];
|
||||
$timezones[] = ['name'=>'Asia/Dhaka', 'location' => '(GMT+06:00) Dhaka', 'utc_offset' => 21600];
|
||||
$timezones[] = ['name'=>'Asia/Novosibirsk', 'location' => '(GMT+07:00) Novosibirsk', 'utc_offset' => 25200];
|
||||
$timezones[] = ['name'=>'Asia/Bangkok', 'location' => '(GMT+07:00) Bangkok', 'utc_offset' => 25200];
|
||||
$timezones[] = ['name'=>'Asia/Ho_Chi_Minh', 'location' => '(GMT+07.00) Ho Chi Minh', 'utc_offset' => 25200];
|
||||
$timezones[] = ['name'=>'Asia/Jakarta', 'location' => '(GMT+07:00) Jakarta', 'utc_offset' => 25200];
|
||||
$timezones[] = ['name'=>'Asia/Krasnoyarsk', 'location' => '(GMT+08:00) Krasnoyarsk', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Chongqing', 'location' => '(GMT+08:00) Chongqing', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Hong_Kong', 'location' => '(GMT+08:00) Hong Kong', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Kuala_Lumpur', 'location' => '(GMT+08:00) Kuala Lumpur', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Australia/Perth', 'location' => '(GMT+08:00) Perth', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Singapore', 'location' => '(GMT+08:00) Singapore', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Taipei', 'location' => '(GMT+08:00) Taipei', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Ulaanbaatar', 'location' => '(GMT+08:00) Ulaan Bataar', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Urumqi', 'location' => '(GMT+08:00) Urumqi', 'utc_offset' => 28800];
|
||||
$timezones[] = ['name'=>'Asia/Irkutsk', 'location' => '(GMT+09:00) Irkutsk', 'utc_offset' => 32400];
|
||||
$timezones[] = ['name'=>'Asia/Seoul', 'location' => '(GMT+09:00) Seoul', 'utc_offset' => 32400];
|
||||
$timezones[] = ['name'=>'Asia/Tokyo', 'location' => '(GMT+09:00) Tokyo', 'utc_offset' => 32400];
|
||||
$timezones[] = ['name'=>'Australia/Adelaide', 'location' => '(GMT+09:30) Adelaide', 'utc_offset' => 34200];
|
||||
$timezones[] = ['name'=>'Australia/Darwin', 'location' => '(GMT+09:30) Darwin', 'utc_offset' => 34200];
|
||||
$timezones[] = ['name'=>'Asia/Yakutsk', 'location' => '(GMT+10:00) Yakutsk', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Australia/Brisbane', 'location' => '(GMT+10:00) Brisbane', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Australia/Canberra', 'location' => '(GMT+10:00) Canberra', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Pacific/Guam', 'location' => '(GMT+10:00) Guam', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Australia/Hobart', 'location' => '(GMT+10:00) Hobart', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Australia/Melbourne', 'location' => '(GMT+10:00) Melbourne', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Pacific/Port_Moresby', 'location' => '(GMT+10:00) Port Moresby', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Australia/Sydney', 'location' => '(GMT+10:00) Sydney', 'utc_offset' => 36000];
|
||||
$timezones[] = ['name'=>'Asia/Vladivostok', 'location' => '(GMT+11:00) Vladivostok', 'utc_offset' => 39600];
|
||||
$timezones[] = ['name'=>'Asia/Magadan', 'location' => '(GMT+12:00) Magadan', 'utc_offset' => 43200];
|
||||
$timezones[] = ['name'=>'Pacific/Auckland', 'location' => '(GMT+12:00) Auckland', 'utc_offset' => 43200];
|
||||
$timezones[] = ['name'=>'Pacific/Fiji', 'location' => '(GMT+12:00) Fiji', 'utc_offset' => 43200];
|
||||
|
||||
$x = 1;
|
||||
foreach ($timezones as $timezone) {
|
||||
Timezone::create([
|
||||
'id' => $x,
|
||||
'name' => $timezone['name'],
|
||||
'location' => $timezone['location'],
|
||||
'utc_offset' => $timezone['utc_offset'],
|
||||
]);
|
||||
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Country;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CountriesSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$countries = Countries::getList();
|
||||
|
||||
foreach ($countries as $countryId => $country) {
|
||||
if ($record = Country::whereCountryCode($country['country-code'])->first()) {
|
||||
$record->name = $country['name'];
|
||||
$record->full_name = ((isset($country['full_name'])) ? $country['full_name'] : null);
|
||||
$record->save();
|
||||
} else {
|
||||
\Illuminate\Support\Facades\DB::table('countries')->insert([
|
||||
'id' => $countryId,
|
||||
'capital' => ((isset($country['capital'])) ? $country['capital'] : null),
|
||||
'citizenship' => ((isset($country['citizenship'])) ? $country['citizenship'] : null),
|
||||
'country_code' => $country['country-code'],
|
||||
'currency' => ((isset($country['currency'])) ? $country['currency'] : null),
|
||||
'currency_code' => ((isset($country['currency_code'])) ? $country['currency_code'] : null),
|
||||
'currency_sub_unit' => ((isset($country['currency_sub_unit'])) ? $country['currency_sub_unit'] : null),
|
||||
'full_name' => ((isset($country['full_name'])) ? $country['full_name'] : null),
|
||||
'iso_3166_2' => $country['iso_3166_2'],
|
||||
'iso_3166_3' => $country['iso_3166_3'],
|
||||
'name' => $country['name'],
|
||||
'region_code' => $country['region-code'],
|
||||
'sub_region_code' => $country['sub-region-code'],
|
||||
'eea' => (bool) $country['eea'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Source: http://www.bitboost.com/ref/international-address-formats.html
|
||||
// Source: https://en.wikipedia.org/wiki/Linguistic_issues_concerning_the_euro
|
||||
$countries = [
|
||||
'AR' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'AT' => [ // Austria
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'BE' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'BG' => [ // Belgium
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'CA' => [
|
||||
'thousand_separator' => ',',
|
||||
'decimal_separator' => '.',
|
||||
],
|
||||
'CH' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'CZ' => [ // Czech Republic
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'DE' => [ // Germany
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'DK' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'EE' => [ // Estonia
|
||||
'swap_currency_symbol' => true,
|
||||
'thousand_separator' => ' ',
|
||||
],
|
||||
'ES' => [ // Spain
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'FI' => [ // Finland
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'FR' => [ // France
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'GR' => [ // Greece
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'HR' => [ // Croatia
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'HU' => [ // Hungary
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'GL' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'IE' => [ // Ireland
|
||||
'thousand_separator' => ',',
|
||||
'decimal_separator' => '.',
|
||||
],
|
||||
'IL' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'IS' => [ // Iceland
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'IT' => [ // Italy
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'JP' => [ // Japan
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'LT' => [ // Lithuania
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'LU' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'MT' => [
|
||||
'thousand_separator' => ',',
|
||||
'decimal_separator' => '.',
|
||||
],
|
||||
'MY' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'MX' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'NL' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
'PL' => [ // Poland
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'PT' => [ // Portugal
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'RO' => [ // Romania
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'SE' => [ // Sweden
|
||||
'swap_postal_code' => true,
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'SI' => [ // Slovenia
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'SK' => [ // Slovakia
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'US' => [
|
||||
'thousand_separator' => ',',
|
||||
'decimal_separator' => '.',
|
||||
],
|
||||
'SR' => [ // Suriname
|
||||
'swap_currency_symbol' => true,
|
||||
],
|
||||
'UY' => [
|
||||
'swap_postal_code' => true,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($countries as $code => $data) {
|
||||
$country = Country::where('iso_3166_2', '=', $code)->first();
|
||||
if (isset($data['swap_postal_code'])) {
|
||||
$country->swap_postal_code = true;
|
||||
}
|
||||
if (isset($data['swap_currency_symbol'])) {
|
||||
$country->swap_currency_symbol = true;
|
||||
}
|
||||
if (isset($data['thousand_separator'])) {
|
||||
$country->thousand_separator = $data['thousand_separator'];
|
||||
}
|
||||
if (isset($data['decimal_separator'])) {
|
||||
$country->decimal_separator = $data['decimal_separator'];
|
||||
}
|
||||
$country->save();
|
||||
}
|
||||
|
||||
$p = Country::where('country_code', 275)->first();
|
||||
$p->name = 'Palestine';
|
||||
$p->save();
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\Currency;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CurrenciesSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
// http://www.localeplanet.com/icu/currency.html
|
||||
$currencies = [
|
||||
['id' => 1, 'name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 2, 'name' => 'British Pound', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 3, 'name' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 4, 'name' => 'South African Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 5, 'name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 6, 'name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 7, 'name' => 'Swedish Krona', 'code' => 'SEK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 8, 'name' => 'Kenyan Shilling', 'code' => 'KES', 'symbol' => 'KSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 9, 'name' => 'Canadian Dollar', 'code' => 'CAD', 'symbol' => 'C$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 10, 'name' => 'Philippine Peso', 'code' => 'PHP', 'symbol' => 'P ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 11, 'name' => 'Indian Rupee', 'code' => 'INR', 'symbol' => 'Rs. ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 12, 'name' => 'Australian Dollar', 'code' => 'AUD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 13, 'name' => 'Singapore Dollar', 'code' => 'SGD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 14, 'name' => 'Norske Kroner', 'code' => 'NOK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 15, 'name' => 'New Zealand Dollar', 'code' => 'NZD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 16, 'name' => 'Vietnamese Dong', 'code' => 'VND', 'symbol' => '', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 17, 'name' => 'Swiss Franc', 'code' => 'CHF', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '\'', 'decimal_separator' => '.'],
|
||||
['id' => 18, 'name' => 'Guatemalan Quetzal', 'code' => 'GTQ', 'symbol' => 'Q', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 19, 'name' => 'Malaysian Ringgit', 'code' => 'MYR', 'symbol' => 'RM', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 20, 'name' => 'Brazilian Real', 'code' => 'BRL', 'symbol' => 'R$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 21, 'name' => 'Thai Baht', 'code' => 'THB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 22, 'name' => 'Nigerian Naira', 'code' => 'NGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 23, 'name' => 'Argentine Peso', 'code' => 'ARS', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 24, 'name' => 'Bangladeshi Taka', 'code' => 'BDT', 'symbol' => 'Tk', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 25, 'name' => 'United Arab Emirates Dirham', 'code' => 'AED', 'symbol' => 'DH ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 26, 'name' => 'Hong Kong Dollar', 'code' => 'HKD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 27, 'name' => 'Indonesian Rupiah', 'code' => 'IDR', 'symbol' => 'Rp', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 28, 'name' => 'Mexican Peso', 'code' => 'MXN', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 29, 'name' => 'Egyptian Pound', 'code' => 'EGP', 'symbol' => 'E£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 30, 'name' => 'Colombian Peso', 'code' => 'COP', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 31, 'name' => 'West African Franc', 'code' => 'XOF', 'symbol' => 'CFA ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 32, 'name' => 'Chinese Renminbi', 'code' => 'CNY', 'symbol' => 'RMB ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 33, 'name' => 'Rwandan Franc', 'code' => 'RWF', 'symbol' => 'RF ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 34, 'name' => 'Tanzanian Shilling', 'code' => 'TZS', 'symbol' => 'TSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 35, 'name' => 'Netherlands Antillean Guilder', 'code' => 'ANG', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 36, 'name' => 'Trinidad and Tobago Dollar', 'code' => 'TTD', 'symbol' => 'TT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 37, 'name' => 'East Caribbean Dollar', 'code' => 'XCD', 'symbol' => 'EC$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 38, 'name' => 'Ghanaian Cedi', 'code' => 'GHS', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 39, 'name' => 'Bulgarian Lev', 'code' => 'BGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'],
|
||||
['id' => 40, 'name' => 'Aruban Florin', 'code' => 'AWG', 'symbol' => 'Afl. ', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'],
|
||||
['id' => 41, 'name' => 'Turkish Lira', 'code' => 'TRY', 'symbol' => 'TL ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 42, 'name' => 'Romanian New Leu', 'code' => 'RON', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 43, 'name' => 'Croatian Kuna', 'code' => 'HRK', 'symbol' => 'kn', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 44, 'name' => 'Saudi Riyal', 'code' => 'SAR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 45, 'name' => 'Japanese Yen', 'code' => 'JPY', 'symbol' => '¥', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 46, 'name' => 'Maldivian Rufiyaa', 'code' => 'MVR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 47, 'name' => 'Costa Rican Colón', 'code' => 'CRC', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 48, 'name' => 'Pakistani Rupee', 'code' => 'PKR', 'symbol' => 'Rs ', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 49, 'name' => 'Polish Zloty', 'code' => 'PLN', 'symbol' => 'zł', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 50, 'name' => 'Sri Lankan Rupee', 'code' => 'LKR', 'symbol' => 'LKR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.', 'swap_currency_symbol' => true],
|
||||
['id' => 51, 'name' => 'Czech Koruna', 'code' => 'CZK', 'symbol' => 'Kč', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 52, 'name' => 'Uruguayan Peso', 'code' => 'UYU', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 53, 'name' => 'Namibian Dollar', 'code' => 'NAD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 54, 'name' => 'Tunisian Dinar', 'code' => 'TND', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 55, 'name' => 'Russian Ruble', 'code' => 'RUB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 56, 'name' => 'Mozambican Metical', 'code' => 'MZN', 'symbol' => 'MT', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 57, 'name' => 'Omani Rial', 'code' => 'OMR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 58, 'name' => 'Ukrainian Hryvnia', 'code' => 'UAH', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 59, 'name' => 'Macanese Pataca', 'code' => 'MOP', 'symbol' => 'MOP$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 60, 'name' => 'Taiwan New Dollar', 'code' => 'TWD', 'symbol' => 'NT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 61, 'name' => 'Dominican Peso', 'code' => 'DOP', 'symbol' => 'RD$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 62, 'name' => 'Chilean Peso', 'code' => 'CLP', 'symbol' => '$', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 63, 'name' => 'Icelandic Króna', 'code' => 'ISK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 64, 'name' => 'Papua New Guinean Kina', 'code' => 'PGK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 65, 'name' => 'Jordanian Dinar', 'code' => 'JOD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 66, 'name' => 'Myanmar Kyat', 'code' => 'MMK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 67, 'name' => 'Peruvian Sol', 'code' => 'PEN', 'symbol' => 'S/ ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 68, 'name' => 'Botswana Pula', 'code' => 'BWP', 'symbol' => 'P', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 69, 'name' => 'Hungarian Forint', 'code' => 'HUF', 'symbol' => 'Ft', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
|
||||
['id' => 70, 'name' => 'Ugandan Shilling', 'code' => 'UGX', 'symbol' => 'USh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 71, 'name' => 'Barbadian Dollar', 'code' => 'BBD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 72, 'name' => 'Brunei Dollar', 'code' => 'BND', 'symbol' => 'B$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 73, 'name' => 'Georgian Lari', 'code' => 'GEL', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ','],
|
||||
['id' => 74, 'name' => 'Qatari Riyal', 'code' => 'QAR', 'symbol' => 'QR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 75, 'name' => 'Honduran Lempira', 'code' => 'HNL', 'symbol' => 'L', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 76, 'name' => 'Surinamese Dollar', 'code' => 'SRD', 'symbol' => 'SRD', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 77, 'name' => 'Bahraini Dinar', 'code' => 'BHD', 'symbol' => 'BD ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||
['id' => 78, 'name' => 'Venezuelan Bolivars', 'code' => 'VES', 'symbol' => 'Bs.', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
['id' => 79, 'name' => 'South Korean Won', 'code' => 'KRW', 'symbol' => 'W ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
|
||||
];
|
||||
|
||||
foreach ($currencies as $currency) {
|
||||
$record = Currency::whereCode($currency['code'])->first();
|
||||
if ($record) {
|
||||
$record->name = $currency['name'];
|
||||
$record->symbol = $currency['symbol'];
|
||||
$record->precision = $currency['precision'];
|
||||
$record->thousand_separator = $currency['thousand_separator'];
|
||||
$record->decimal_separator = $currency['decimal_separator'];
|
||||
if (isset($currency['swap_currency_symbol'])) {
|
||||
$record->swap_currency_symbol = $currency['swap_currency_symbol'];
|
||||
}
|
||||
$record->save();
|
||||
} else {
|
||||
Currency::create($currency);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\Timezone;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->command->info('Running DatabaseSeeder');
|
||||
|
||||
if (Timezone::count()) {
|
||||
$this->command->info('Skipping: already run');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Eloquent::unguard();
|
||||
|
||||
$this->call('ConstantsSeeder');
|
||||
$this->call('PaymentLibrariesSeeder');
|
||||
$this->call('BanksSeeder');
|
||||
$this->call('CurrenciesSeeder');
|
||||
$this->call('LanguageSeeder');
|
||||
$this->call('CountriesSeeder');
|
||||
$this->call('IndustrySeeder');
|
||||
//$this->call('PaymentTermsSeeder');
|
||||
$this->call('PaymentTypesSeeder');
|
||||
$this->call('GatewayTypesSeeder');
|
||||
$this->call('DateFormatsSeeder');
|
||||
$this->call('DesignSeeder');
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\DateFormat;
|
||||
use App\Models\DatetimeFormat;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DateFormatsSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
// Date formats
|
||||
$formats = [
|
||||
['id' => 1, 'format' => 'd/M/Y', 'format_moment' => 'DD/MMM/YYYY', 'format_dart' => 'dd/MMM/yyyy'],
|
||||
['id' => 2, 'format' => 'd-M-Y', 'format_moment' => 'DD-MMM-YYYY', 'format_dart' => 'dd-MMM-yyyy'],
|
||||
['id' => 3, 'format' => 'd/F/Y', 'format_moment' => 'DD/MMMM/YYYY', 'format_dart' => 'dd/MMMM/yyyy'],
|
||||
['id' => 4, 'format' => 'd-F-Y', 'format_moment' => 'DD-MMMM-YYYY', 'format_dart' => 'dd-MMMM-yyyy'],
|
||||
['id' => 5, 'format' => 'M j, Y', 'format_moment' => 'MMM D, YYYY', 'format_dart' => 'MMM d, yyyy'],
|
||||
['id' => 6, 'format' => 'F j, Y', 'format_moment' => 'MMMM D, YYYY', 'format_dart' => 'MMMM d, yyyy'],
|
||||
['id' => 7, 'format' => 'D M j, Y', 'format_moment' => 'ddd MMM Do, YYYY', 'format_dart' => 'EEE MMM d, yyyy'],
|
||||
['id' => 8, 'format' => 'Y-m-d', 'format_moment' => 'YYYY-MM-DD', 'format_dart' => 'yyyy-MM-dd'],
|
||||
['id' => 9, 'format' => 'd-m-Y', 'format_moment' => 'DD-MM-YYYY', 'format_dart' => 'dd-MM-yyyy'],
|
||||
['id' => 10, 'format' => 'm/d/Y', 'format_moment' => 'MM/DD/YYYY', 'format_dart' => 'MM/dd/yyyy'],
|
||||
['id' => 11, 'format' => 'd.m.Y', 'format_moment' => 'D.MM.YYYY', 'format_dart' => 'dd.MM.yyyy'],
|
||||
['id' => 12, 'format' => 'j. M. Y', 'format_moment' => 'DD. MMM. YYYY', 'format_dart' => 'd. MMM. yyyy'],
|
||||
['id' => 13, 'format' => 'j. F Y', 'format_moment' => 'DD. MMMM YYYY', 'format_dart' => 'd. MMMM yyyy'],
|
||||
['id' => 14, 'format' => 'dd/mm/yyyy', 'format_moment' => 'DD/MM/YYY', 'format_dart' => 'dd/MM/yyyy'],
|
||||
];
|
||||
|
||||
foreach ($formats as $format) {
|
||||
// use binary to support case-sensitive search
|
||||
$record = DateFormat::whereRaw('BINARY `format`= ?', [$format['format']])->first();
|
||||
if ($record) {
|
||||
$record->format_moment = $format['format_moment'];
|
||||
$record->format_dart = $format['format_dart'];
|
||||
$record->save();
|
||||
} else {
|
||||
DateFormat::create($format);
|
||||
}
|
||||
}
|
||||
|
||||
// Date/time formats
|
||||
$formats = [
|
||||
['id' => 1, 'format' => 'd/M/Y g:i a', 'format_moment' => 'DD/MMM/YYYY h:mm:ss a', 'format_dart' => 'dd/MMM/yyyy h:mm a'],
|
||||
['id' => 2, 'format' => 'd-M-Y g:i a', 'format_moment' => 'DD-MMM-YYYY h:mm:ss a', 'format_dart' => 'dd-MMM-yyyy h:mm a'],
|
||||
['id' => 3, 'format' => 'd/F/Y g:i a', 'format_moment' => 'DD/MMMM/YYYY h:mm:ss a', 'format_dart' => 'dd/MMMM/yyyy h:mm a'],
|
||||
['id' => 4, 'format' => 'd-F-Y g:i a', 'format_moment' => 'DD-MMMM-YYYY h:mm:ss a', 'format_dart' => 'dd-MMMM-yyyy h:mm a'],
|
||||
['id' => 5, 'format' => 'M j, Y g:i a', 'format_moment' => 'MMM D, YYYY h:mm:ss a', 'format_dart' => 'MMM d, yyyy h:mm a'],
|
||||
['id' => 6, 'format' => 'F j, Y g:i a', 'format_moment' => 'MMMM D, YYYY h:mm:ss a', 'format_dart' => 'MMMM d, yyyy h:mm a'],
|
||||
['id' => 7, 'format' => 'D M jS, Y g:i a', 'format_moment' => 'ddd MMM Do, YYYY h:mm:ss a', 'format_dart' => 'EEE MMM d, yyyy h:mm a'],
|
||||
['id' => 8, 'format' => 'Y-m-d g:i a', 'format_moment' => 'YYYY-MM-DD h:mm:ss a', 'format_dart' => 'yyyy-MM-dd h:mm a'],
|
||||
['id' => 9, 'format' => 'd-m-Y g:i a', 'format_moment' => 'DD-MM-YYYY h:mm:ss a', 'format_dart' => 'dd-MM-yyyy h:mm a'],
|
||||
['id' => 10, 'format' => 'm/d/Y g:i a', 'format_moment' => 'MM/DD/YYYY h:mm:ss a', 'format_dart' => 'MM/dd/yyyy h:mm a'],
|
||||
['id' => 11, 'format' => 'd.m.Y g:i a', 'format_moment' => 'D.MM.YYYY h:mm:ss a', 'format_dart' => 'dd.MM.yyyy h:mm a'],
|
||||
['id' => 12, 'format' => 'j. M. Y g:i a', 'format_moment' => 'DD. MMM. YYYY h:mm:ss a', 'format_dart' => 'd. MMM. yyyy h:mm a'],
|
||||
['id' => 13, 'format' => 'j. F Y g:i a', 'format_moment' => 'DD. MMMM YYYY h:mm:ss a', 'format_dart' => 'd. MMMM yyyy h:mm a'],
|
||||
['id' => 14, 'format' => 'dd/mm/yyyy g:i a', 'format_moment' => 'DD/MM/YYYY h:mm:ss a', 'format_dart' => 'dd/MM/yyyy h:mm a'],
|
||||
];
|
||||
|
||||
foreach ($formats as $format) {
|
||||
$record = DatetimeFormat::whereRaw('BINARY `format`= ?', [$format['format']])->first();
|
||||
if ($record) {
|
||||
$record->format_moment = $format['format_moment'];
|
||||
$record->format_dart = $format['format_dart'];
|
||||
$record->save();
|
||||
} else {
|
||||
DatetimeFormat::create($format);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\Bank;
|
||||
use App\Models\Design;
|
||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DesignSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$this->createDesigns();
|
||||
}
|
||||
|
||||
private function createDesigns()
|
||||
{
|
||||
$designs = [
|
||||
['id' => 1, 'name' => 'Plain', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 2, 'name' => 'Clean', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 3, 'name' => 'Bold', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 4, 'name' => 'Modern', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 5, 'name' => 'Business', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 6, 'name' => 'Creative', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 7, 'name' => 'Elegant', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 8, 'name' => 'Hipster', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
['id' => 9, 'name' => 'Playful', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true],
|
||||
];
|
||||
|
||||
foreach ($designs as $design) {
|
||||
$d = Design::find($design['id']);
|
||||
|
||||
if (! $d) {
|
||||
Design::create($design);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Design::all() as $design) {
|
||||
$template = new PdfMakerDesign(strtolower($design->name));
|
||||
$template->document();
|
||||
|
||||
$design_object = new \stdClass;
|
||||
$design_object->includes = $template->getSectionHTML('includes');
|
||||
$design_object->header = $template->getSectionHTML('head', false);
|
||||
$design_object->body = $template->getSectionHTML('body', false);
|
||||
$design_object->product = $template->getSectionHTML('product-table');
|
||||
$design_object->task = $template->getSectionHTML('task-table');
|
||||
$design_object->footer = $template->getSectionHTML('footer', false);
|
||||
|
||||
$design->design = $design_object;
|
||||
$design->save();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\GatewayType;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class GatewayTypesSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$gateway_types = [
|
||||
['id' => 1, 'alias' => 'credit_card', 'name' => 'Credit Card'],
|
||||
['id' => 2, 'alias' => 'bank_transfer', 'name' => 'Bank Transfer'],
|
||||
['id' => 3, 'alias' => 'paypal', 'name' => 'PayPal'],
|
||||
['id' => 4, 'alias' => 'crypto', 'name' => 'Crypto'],
|
||||
['id' => 5, 'alias' => 'dwolla', 'name' => 'Dwolla'],
|
||||
['id' => 6, 'alias' => 'custom1', 'name' => 'Custom'],
|
||||
['id' => 7, 'alias' => 'alipay', 'name' => 'Alipay'],
|
||||
['id' => 8, 'alias' => 'sofort', 'name' => 'Sofort'],
|
||||
['id' => 9, 'alias' => 'sepa', 'name' => 'SEPA'],
|
||||
['id' => 10, 'alias' => 'gocardless', 'name' => 'GoCardless'],
|
||||
['id' => 11, 'alias' => 'apple_pay', 'name' => 'Apple Pay'],
|
||||
['id' => 12, 'alias' => 'custom2', 'name' => 'Custom'],
|
||||
['id' => 13, 'alias' => 'custom3', 'name' => 'Custom'],
|
||||
];
|
||||
|
||||
foreach ($gateway_types as $gateway_type) {
|
||||
$record = GatewayType::where('alias', '=', $gateway_type['alias'])->first();
|
||||
if ($record) {
|
||||
$record->fill($gateway_type);
|
||||
$record->save();
|
||||
} else {
|
||||
GatewayType::create($gateway_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\Industry;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class IndustrySeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$industries = [
|
||||
['id' => 1, 'name' => 'Accounting & Legal'],
|
||||
['id' => 2, 'name' => 'Advertising'],
|
||||
['id' => 3, 'name' => 'Aerospace'],
|
||||
['id' => 4, 'name' => 'Agriculture'],
|
||||
['id' => 5, 'name' => 'Automotive'],
|
||||
['id' => 6, 'name' => 'Banking & Finance'],
|
||||
['id' => 7, 'name' => 'Biotechnology'],
|
||||
['id' => 8, 'name' => 'Broadcasting'],
|
||||
['id' => 9, 'name' => 'Business Services'],
|
||||
['id' => 10, 'name' => 'Commodities & Chemicals'],
|
||||
['id' => 11, 'name' => 'Communications'],
|
||||
['id' => 12, 'name' => 'Computers & Hightech'],
|
||||
['id' => 13, 'name' => 'Defense'],
|
||||
['id' => 14, 'name' => 'Energy'],
|
||||
['id' => 15, 'name' => 'Entertainment'],
|
||||
['id' => 16, 'name' => 'Government'],
|
||||
['id' => 17, 'name' => 'Healthcare & Life Sciences'],
|
||||
['id' => 18, 'name' => 'Insurance'],
|
||||
['id' => 19, 'name' => 'Manufacturing'],
|
||||
['id' => 20, 'name' => 'Marketing'],
|
||||
['id' => 21, 'name' => 'Media'],
|
||||
['id' => 22, 'name' => 'Nonprofit & Higher Ed'],
|
||||
['id' => 23, 'name' => 'Pharmaceuticals'],
|
||||
['id' => 24, 'name' => 'Professional Services & Consulting'],
|
||||
['id' => 25, 'name' => 'Real Estate'],
|
||||
['id' => 26, 'name' => 'Retail & Wholesale'],
|
||||
['id' => 27, 'name' => 'Sports'],
|
||||
['id' => 28, 'name' => 'Transportation'],
|
||||
['id' => 29, 'name' => 'Travel & Luxury'],
|
||||
['id' => 30, 'name' => 'Other'],
|
||||
['id' => 31, 'name' => 'Photography'],
|
||||
['id' => 32, 'name' => 'Construction'],
|
||||
['id' => 33, 'name' => 'Restaurant & Catering'],
|
||||
];
|
||||
|
||||
foreach ($industries as $industry) {
|
||||
$record = Industry::whereName($industry['name'])->first();
|
||||
if (! $record) {
|
||||
Industry::create($industry);
|
||||
}
|
||||
}
|
||||
|
||||
Eloquent::reguard();
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\Language;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class LanguageSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
// https://github.com/caouecs/Laravel-lang
|
||||
// https://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||
|
||||
$languages = [
|
||||
['id' => 1, 'name' => 'English', 'locale' => 'en'],
|
||||
['id' => 2, 'name' => 'Italian', 'locale' => 'it'],
|
||||
['id' => 3, 'name' => 'German', 'locale' => 'de'],
|
||||
['id' => 4, 'name' => 'French', 'locale' => 'fr'],
|
||||
['id' => 5, 'name' => 'Portuguese - Brazilian', 'locale' => 'pt_BR'],
|
||||
['id' => 6, 'name' => 'Dutch', 'locale' => 'nl'],
|
||||
['id' => 7, 'name' => 'Spanish', 'locale' => 'es'],
|
||||
['id' => 8, 'name' => 'Norwegian', 'locale' => 'nb_NO'],
|
||||
['id' => 9, 'name' => 'Danish', 'locale' => 'da'],
|
||||
['id' => 10, 'name' => 'Japanese', 'locale' => 'ja'],
|
||||
['id' => 11, 'name' => 'Swedish', 'locale' => 'sv'],
|
||||
['id' => 12, 'name' => 'Spanish - Spain', 'locale' => 'es_ES'],
|
||||
['id' => 13, 'name' => 'French - Canada', 'locale' => 'fr_CA'],
|
||||
['id' => 14, 'name' => 'Lithuanian', 'locale' => 'lt'],
|
||||
['id' => 15, 'name' => 'Polish', 'locale' => 'pl'],
|
||||
['id' => 16, 'name' => 'Czech', 'locale' => 'cs'],
|
||||
['id' => 17, 'name' => 'Croatian', 'locale' => 'hr'],
|
||||
['id' => 18, 'name' => 'Albanian', 'locale' => 'sq'],
|
||||
['id' => 19, 'name' => 'Greek', 'locale' => 'el'],
|
||||
['id' => 20, 'name' => 'English - United Kingdom', 'locale' => 'en_GB'],
|
||||
['id' => 21, 'name' => 'Portuguese - Portugal', 'locale' => 'pt_PT'],
|
||||
['id' => 22, 'name' => 'Slovenian', 'locale' => 'sl'],
|
||||
['id' => 23, 'name' => 'Finnish', 'locale' => 'fi'],
|
||||
['id' => 24, 'name' => 'Romanian', 'locale' => 'ro'],
|
||||
['id' => 25, 'name' => 'Turkish - Turkey', 'locale' => 'tr_TR'],
|
||||
['id' => 26, 'name' => 'Thai', 'locale' => 'th'],
|
||||
['id' => 27, 'name' => 'Macedonian', 'locale' => 'mk_MK'],
|
||||
['id' => 28, 'name' => 'Chinese - Taiwan', 'locale' => 'zh_TW'],
|
||||
];
|
||||
|
||||
foreach ($languages as $language) {
|
||||
$record = Language::whereLocale($language['locale'])->first();
|
||||
if ($record) {
|
||||
$record->name = $language['name'];
|
||||
$record->save();
|
||||
} else {
|
||||
Language::create($language);
|
||||
}
|
||||
}
|
||||
|
||||
Eloquent::reguard();
|
||||
}
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\Gateway;
|
||||
use App\Models\GatewayType;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PaymentLibrariesSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$gateways = [
|
||||
['id' => 1, 'name' => 'Authorize.Net', 'provider' => 'Authorize', 'sort_order' => 5, 'key' => '3b6621f970ab18887c4f6dca78d3f8bb', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}
|
||||
'],
|
||||
['id' => 2, 'name' => 'CardSave', 'provider' => 'CardSave', 'key' => '46c5c1fed2c43acf4f379bae9c8b9f76', 'fields' => '{"merchantId":"","password":""}
|
||||
'],
|
||||
['id' => 3, 'name' => 'Eway Rapid', 'provider' => 'Eway_RapidShared', 'is_offsite' => true, 'key' => '944c20175bbe6b9972c05bcfe294c2c7', 'fields' => '{"apiKey":"","password":"","testMode":false}'],
|
||||
['id' => 4, 'name' => 'FirstData Connect', 'provider' => 'FirstData_Connect', 'key' => '4e0ed0d34552e6cb433506d1ac03a418', 'fields' => '{"storeId":"","sharedSecret":"","testMode":false}'],
|
||||
['id' => 5, 'name' => 'Migs ThreeParty', 'provider' => 'Migs_ThreeParty', 'key' => '513cdc81444c87c4b07258bc2858d3fa', 'fields' => '{"merchantId":"","merchantAccessCode":"","secureHash":""}'],
|
||||
['id' => 6, 'name' => 'Migs TwoParty', 'provider' => 'Migs_TwoParty', 'key' => '99c2a271b5088951334d1302e038c01a', 'fields' => '{"merchantId":"","merchantAccessCode":"","secureHash":""}'],
|
||||
['id' => 7, 'name' => 'Mollie', 'provider' => 'Mollie', 'is_offsite' => true, 'sort_order' => 8, 'key' => '1bd651fb213ca0c9d66ae3c336dc77e8', 'fields' => '{"apiKey":""}'],
|
||||
['id' => 8, 'name' => 'MultiSafepay', 'provider' => 'MultiSafepay', 'key' => 'c3dec814e14cbd7d86abd92ce6789f8c', 'fields' => '{"accountId":"","siteId":"","siteCode":"","testMode":false}'],
|
||||
['id' => 9, 'name' => 'Netaxept', 'provider' => 'Netaxept', 'key' => '070dffc5ca94f4e66216e44028ebd52d', 'fields' => '{"merchantId":"","password":"","testMode":false}'],
|
||||
['id' => 10, 'name' => 'NetBanx', 'provider' => 'NetBanx', 'key' => '334d419939c06bd99b4dfd8a49243f0f', 'fields' => '{"accountNumber":"","storeId":"","storePassword":"","testMode":false}'],
|
||||
['id' => 11, 'name' => 'PayFast', 'provider' => 'PayFast', 'is_offsite' => true, 'key' => 'd6814fc83f45d2935e7777071e629ef9', 'fields' => '{"merchantId":"","merchantKey":"","pdtKey":"","passphrase":"","testMode":false}'],
|
||||
['id' => 12, 'name' => 'Payflow Pro', 'provider' => 'Payflow_Pro', 'key' => '0d97c97d227f91c5d0cb86d01e4a52c9', 'fields' => '{"username":"","password":"","vendor":"","partner":"","testMode":false}'],
|
||||
['id' => 13, 'name' => 'PaymentExpress PxPay', 'provider' => 'PaymentExpress_PxPay', 'key' => 'a66b7062f4c8212d2c428209a34aa6bf', 'fields' => '{"username":"","password":"","pxPostUsername":"","pxPostPassword":"","testMode":false}', 'default_gateway_type_id' => GatewayType::PAYPAL],
|
||||
['id' => 14, 'name' => 'PaymentExpress PxPost', 'provider' => 'PaymentExpress_PxPost', 'key' => '7e6fc08b89467518a5953a4839f8baba', 'fields' => '{"username":"","password":"","testMode":false}', 'default_gateway_type_id' => GatewayType::PAYPAL],
|
||||
['id' => 15, 'name' => 'PayPal Express', 'provider' => 'PayPal_Express', 'is_offsite' => true, 'sort_order' => 4, 'key' => '38f2c48af60c7dd69e04248cbb24c36e', 'fields' => '{"username":"","password":"","signature":"","testMode":false,"solutionType":["Sole","Mark"],"landingPage":["Billing","Login"],"brandName":"","headerImageUrl":"","logoImageUrl":"","borderColor":""}', 'default_gateway_type_id' => GatewayType::PAYPAL],
|
||||
['id' => 16, 'name' => 'PayPal Pro', 'provider' => 'PayPal_Pro', 'key' => '80af24a6a69f5c0bbec33e930ab40665', 'fields' => '{"username":"","password":"","signature":"","testMode":false}', 'default_gateway_type_id' => GatewayType::PAYPAL],
|
||||
['id' => 17, 'name' => 'Pin', 'provider' => 'Pin', 'key' => '0749cb92a6b36c88bd9ff8aabd2efcab', 'fields' => '{"secretKey":"","testMode":false}'],
|
||||
['id' => 18, 'name' => 'SagePay Direct', 'provider' => 'SagePay_Direct', 'key' => '4c8f4e5d0f353a122045eb9a60cc0f2d', 'fields' => '{"vendor":"","testMode":false,"referrerId":""}'],
|
||||
['id' => 19, 'name' => 'SecurePay DirectPost', 'provider' => 'SecurePay_DirectPost', 'key' => '8036a5aadb2bdaafb23502da8790b6a2', 'fields' => '{"merchantId":"","transactionPassword":"","testMode":false,"enable_ach":"","enable_sofort":"","enable_apple_pay":"","enable_alipay":""}'],
|
||||
['id' => 20, 'name' => 'Stripe', 'provider' => 'Stripe', 'sort_order' => 1, 'key' => 'd14dd26a37cecc30fdd65700bfb55b23', 'fields' => '{"apiKey":"", "publishableKey":""}'],
|
||||
['id' => 21, 'name' => 'TargetPay Direct eBanking', 'provider' => 'TargetPay_Directebanking', 'key' => 'd14dd26a37cdcc30fdd65700bfb55b23', 'fields' => '{"subAccountId":""}'],
|
||||
['id' => 22, 'name' => 'TargetPay Ideal', 'provider' => 'TargetPay_Ideal', 'key' => 'ea3b328bd72d381387281c3bd83bd97c', 'fields' => '{"subAccountId":""}'],
|
||||
['id' => 23, 'name' => 'TargetPay Mr Cash', 'provider' => 'TargetPay_Mrcash', 'key' => 'a0035fc0d87c4950fb82c73e2fcb825a', 'fields' => '{"subAccountId":""}'],
|
||||
['id' => 24, 'name' => 'TwoCheckout', 'provider' => 'TwoCheckout', 'is_offsite' => true, 'key' => '16dc1d3c8a865425421f64463faaf768', 'fields' => '{"accountNumber":"","secretWord":"","testMode":false}'],
|
||||
['id' => 25, 'name' => 'WorldPay', 'provider' => 'WorldPay', 'key' => '43e639234f660d581ddac725ba7bcd29', 'fields' => '{"installationId":"","accountId":"","secretWord":"","callbackPassword":"","testMode":false,"noLanguageMenu":false,"fixContact":false,"hideContact":false,"hideCurrency":false,"signatureFields":"instId:amount:currency:cartId"}'],
|
||||
['id' => 26, 'name' => 'moolah', 'provider' => 'AuthorizeNet_AIM', 'key' => '2f71dc17b0158ac30a7ae0839799e888', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}'],
|
||||
['id' => 27, 'name' => 'Alipay', 'provider' => 'Alipay_Express', 'key' => '733998ee4760b10f11fb48652571e02c', 'fields' => '{"partner":"","key":"","signType":"MD5","inputCharset":"utf-8","transport":"http","paymentType":1,"itBPay":"1d"}'],
|
||||
['id' => 28, 'name' => 'Buckaroo', 'provider' => 'Buckaroo_CreditCard', 'key' => '6312879223e49c5cf92e194646bdee8f', 'fields' => '{"websiteKey":"","secretKey":"","testMode":false}'],
|
||||
['id' => 29, 'name' => 'Coinbase', 'provider' => 'Coinbase', 'is_offsite' => true, 'key' => '106ef7e7da9062b0df363903b455711c', 'fields' => '{"apiKey":"","secret":"","accountId":""}'],
|
||||
['id' => 30, 'name' => 'DataCash', 'provider' => 'DataCash', 'key' => 'e9a38f0896b5b82d196be3b7020c8664', 'fields' => '{"merchantId":"","password":"","testMode":false}'],
|
||||
['id' => 31, 'name' => 'Pacnet', 'provider' => 'Pacnet', 'key' => '0da4e18ed44a5bd5c8ec354d0ab7b301', 'fields' => '{"username":"","sharedSecret":"","paymentRoutingNumber":"","testMode":false}'],
|
||||
['id' => 32, 'name' => 'Realex', 'provider' => 'Realex_Remote', 'key' => 'd3979e62eb603fbdf1c78fe3a8ba7009', 'fields' => '{"merchantId":"","account":"","secret":"","3dSecure":0}'],
|
||||
['id' => 33, 'name' => 'Sisow', 'provider' => 'Sisow', 'key' => '557d98977e7ec02dfa53de4b69b335be', 'fields' => '{"shopId":"","merchantId":""}'],
|
||||
['id' => 34, 'name' => 'Skrill', 'provider' => 'Skrill', 'is_offsite' => true, 'key' => '54dc60c869a7322d87efbec5c0c25805', 'fields' => '{"email":"","notifyUrl":"","testMode":false}'],
|
||||
['id' => 35, 'name' => 'BitPay', 'provider' => 'BitPay', 'is_offsite' => true, 'sort_order' => 7, 'key' => 'e4a02f0a4b235eb5e9e294730703bb74', 'fields' => '{"apiKey":"","testMode":false}'],
|
||||
['id' => 36, 'name' => 'AGMS', 'provider' => 'Agms', 'key' => '1b3c6f3ccfea4f5e7eadeae188cccd7f', 'fields' => '{"username":"","password":"","apiKey":"","accountNumber":""}'],
|
||||
['id' => 37, 'name' => 'Barclays', 'provider' => 'BarclaysEpdq\Essential', 'key' => '7cba6ce5c125f9cb47ea8443ae671b68', 'fields' => '{"clientId":"","testMode":false,"language":"en_US","callbackMethod":"POST"}'],
|
||||
['id' => 38, 'name' => 'Cardgate', 'provider' => 'Cardgate', 'key' => 'b98cfa5f750e16cee3524b7b7e78fbf6', 'fields' => '{"merchantId":"","language":"nl","apiKey":"","siteId":"","notifyUrl":"","returnUrl":"","cancelUrl":"","testMode":false}'],
|
||||
['id' => 39, 'name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false}'],
|
||||
['id' => 40, 'name' => 'Creditcall', 'provider' => 'Creditcall', 'key' => 'cbc7ef7c99d31ec05492fbcb37208263', 'fields' => '{"terminalId":"","transactionKey":"","testMode":false,"verifyCvv":true,"verifyAddress":false,"verifyZip":false}'],
|
||||
['id' => 41, 'name' => 'Cybersource', 'provider' => 'Cybersource', 'key' => 'e186a98d3b079028a73390bdc11bdb82', 'fields' => '{"profileId":"","secretKey":"","accessKey":"","testMode":false}'],
|
||||
['id' => 42, 'name' => 'ecoPayz', 'provider' => 'Ecopayz', 'key' => '761040aca40f685d1ab55e2084b30670', 'fields' => '{"merchantId":"","merchantPassword":"","merchantAccountNumber":"","testMode":false}'],
|
||||
['id' => 43, 'name' => 'Fasapay', 'provider' => 'Fasapay', 'key' => '1b2cef0e8c800204a29f33953aaf3360', 'fields' => ''],
|
||||
['id' => 44, 'name' => 'Komoju', 'provider' => 'Komoju', 'key' => '7ea2d40ecb1eb69ef8c3d03e5019028a', 'fields' => '{"apiKey":"","accountId":"","paymentMethod":"credit_card","testMode":false,"locale":"en"}'],
|
||||
['id' => 45, 'name' => 'Paysafecard', 'provider' => 'Paysafecard', 'key' => '70ab90cd6c5c1ab13208b3cef51c0894', 'fields' => '{"username":"","password":"","testMode":false}'],
|
||||
['id' => 46, 'name' => 'Paytrace', 'provider' => 'Paytrace_CreditCard', 'key' => 'bbd736b3254b0aabed6ad7fda1298c88', 'fields' => '{"username":"","password":"","testMode":false,"endpoint":"https:\/\/paytrace.com\/api\/default.pay"}'],
|
||||
['id' => 47, 'name' => 'Secure Trading', 'provider' => 'SecureTrading', 'key' => '231cb401487b9f15babe04b1ac4f7a27', 'fields' => '{"siteReference":"","username":"","password":"","applyThreeDSecure":false,"accountType":"ECOM"}'],
|
||||
['id' => 48, 'name' => 'SecPay', 'provider' => 'SecPay', 'key' => 'bad8699d581d9fa040e59c0bb721a76c', 'fields' => '{"mid":"","vpnPswd":"","remotePswd":"","usageType":"","confirmEmail":"","testStatus":"true","mailCustomer":"true","additionalOptions":""}'],
|
||||
['id' => 49, 'name' => 'WePay', 'provider' => 'WePay', 'is_offsite' => false, 'sort_order' => 3, 'key' => '8fdeed552015b3c7b44ed6c8ebd9e992', 'fields' => '{"accountId":"","accessToken":"","type":"goods","testMode":false,"feePayer":"payee"}'],
|
||||
['id' => 50, 'name' => 'Braintree', 'provider' => 'Braintree', 'sort_order' => 3, 'key' => 'f7ec488676d310683fb51802d076d713', 'fields' => '{"merchantId":"","publicKey":"","privateKey":"","testMode":false}'],
|
||||
['id' => 51, 'name' => 'FirstData Payeezy', 'provider' => 'FirstData_Payeezy', 'key' => '30334a52fb698046572c627ca10412e8', 'fields' => '{"gatewayId":"","password":"","keyId":"","hmac":"","testMode":false}'],
|
||||
['id' => 52, 'name' => 'GoCardless', 'provider' => 'GoCardlessV2\Redirect', 'sort_order' => 9, 'is_offsite' => true, 'key' => 'b9886f9257f0c6ee7c302f1c74475f6c', 'fields' => '{"accessToken":"","webhookSecret":"","testMode":true}'],
|
||||
['id' => 53, 'name' => 'PagSeguro', 'provider' => 'PagSeguro', 'key' => 'ef498756b54db63c143af0ec433da803', 'fields' => '{"email":"","token":"","sandbox":false}'],
|
||||
['id' => 54, 'name' => 'PAYMILL', 'provider' => 'Paymill', 'key' => 'ca52f618a39367a4c944098ebf977e1c', 'fields' => '{"apiKey":""}'],
|
||||
['id' => 55, 'name' => 'Custom', 'provider' => 'Custom', 'is_offsite' => true, 'sort_order' => 21, 'key' => '54faab2ab6e3223dbe848b1686490baa', 'fields' => '{"name":"","text":""}'],
|
||||
];
|
||||
|
||||
foreach ($gateways as $gateway) {
|
||||
$record = Gateway::whereName($gateway['name'])
|
||||
->whereProvider($gateway['provider'])
|
||||
->first();
|
||||
if ($record) {
|
||||
$record->fill($gateway);
|
||||
$record->save();
|
||||
} else {
|
||||
Gateway::create($gateway);
|
||||
}
|
||||
}
|
||||
|
||||
Gateway::query()->update(['visible' => 0]);
|
||||
|
||||
Gateway::whereIn('id', [1,15,20,39])->update(['visible' => 1]);
|
||||
|
||||
Gateway::all()->each(function ($gateway){
|
||||
|
||||
$gateway->site_url = $gateway->getHelp();
|
||||
$gateway->save();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\PaymentTerm;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PaymentTermsSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$paymentTerms = [
|
||||
['num_days' => 0, 'name' => 'Net 0'],
|
||||
['num_days' => 7, 'name' => ''],
|
||||
['num_days' => 10, 'name' => ''],
|
||||
['num_days' => 14, 'name' => ''],
|
||||
['num_days' => 15, 'name' => ''],
|
||||
['num_days' => 30, 'name' => ''],
|
||||
['num_days' => 60, 'name' => ''],
|
||||
['num_days' => 90, 'name' => ''],
|
||||
];
|
||||
|
||||
foreach ($paymentTerms as $paymentTerm) {
|
||||
PaymentTerm::create($paymentTerm);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\Models\PaymentType;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PaymentTypesSeeder extends Seeder
|
||||
{
|
||||
const BANK_LIBRARY_OFX = 1;
|
||||
const GATEWAY_TYPE_CREDIT_CARD = 1;
|
||||
const GATEWAY_TYPE_BANK_TRANSFER = 2;
|
||||
const GATEWAY_TYPE_PAYPAL = 3;
|
||||
const GATEWAY_TYPE_CRYPTO = 4;
|
||||
const GATEWAY_TYPE_DWOLLA = 5;
|
||||
const GATEWAY_TYPE_CUSTOM1 = 6;
|
||||
const GATEWAY_TYPE_ALIPAY = 7;
|
||||
const GATEWAY_TYPE_SOFORT = 8;
|
||||
const GATEWAY_TYPE_SEPA = 9;
|
||||
const GATEWAY_TYPE_GOCARDLESS = 10;
|
||||
const GATEWAY_TYPE_APPLE_PAY = 11;
|
||||
const GATEWAY_TYPE_CUSTOM2 = 12;
|
||||
const GATEWAY_TYPE_CUSTOM3 = 13;
|
||||
|
||||
public function run()
|
||||
{
|
||||
Eloquent::unguard();
|
||||
|
||||
$paymentTypes = [
|
||||
// ['name' => 'Apply Credit'],
|
||||
['name' => 'Bank Transfer', 'gateway_type_id' => self::GATEWAY_TYPE_BANK_TRANSFER],
|
||||
['name' => 'Cash'],
|
||||
['name' => 'Debit', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'ACH', 'gateway_type_id' => self::GATEWAY_TYPE_BANK_TRANSFER],
|
||||
['name' => 'Visa Card', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'MasterCard', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'American Express', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Discover Card', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Diners Card', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'EuroCard', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Nova', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Credit Card Other', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'PayPal', 'gateway_type_id' => self::GATEWAY_TYPE_PAYPAL],
|
||||
['name' => 'Google Wallet'],
|
||||
['name' => 'Check'],
|
||||
['name' => 'Carte Blanche', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'UnionPay', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'JCB', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Laser', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Maestro', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Solo', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Switch', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'iZettle', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
|
||||
['name' => 'Swish', 'gateway_type_id' => self::GATEWAY_TYPE_BANK_TRANSFER],
|
||||
['name' => 'Venmo'],
|
||||
['name' => 'Money Order'],
|
||||
['name' => 'Alipay', 'gateway_type_id' => self::GATEWAY_TYPE_ALIPAY],
|
||||
['name' => 'Sofort', 'gateway_type_id' => self::GATEWAY_TYPE_SOFORT],
|
||||
['name' => 'SEPA', 'gateway_type_id' => self::GATEWAY_TYPE_SEPA],
|
||||
['name' => 'GoCardless', 'gateway_type_id' => self::GATEWAY_TYPE_GOCARDLESS],
|
||||
['name' => 'Crypto', 'gateway_type_id' => self::GATEWAY_TYPE_CRYPTO],
|
||||
];
|
||||
|
||||
$x = 1;
|
||||
foreach ($paymentTypes as $paymentType) {
|
||||
$record = PaymentType::where('name', '=', $paymentType['name'])->first();
|
||||
|
||||
if ($record) {
|
||||
$record->id = $x;
|
||||
$record->name = $paymentType['name'];
|
||||
$record->gateway_type_id = ! empty($paymentType['gateway_type_id']) ? $paymentType['gateway_type_id'] : null;
|
||||
|
||||
$record->save();
|
||||
} else {
|
||||
$paymentType['id'] = $x;
|
||||
PaymentType::create($paymentType);
|
||||
}
|
||||
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,373 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\DataMapper\DefaultSettings;
|
||||
use App\Events\Invoice\InvoiceWasUpdated;
|
||||
use App\Events\Payment\PaymentWasCreated;
|
||||
use App\Helpers\Invoice\InvoiceSum;
|
||||
use App\Helpers\Invoice\InvoiceSumInclusive;
|
||||
use App\Listeners\Credit\CreateCreditInvitation;
|
||||
use App\Listeners\Invoice\CreateInvoiceInvitation;
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\CompanyGateway;
|
||||
use App\Models\CompanyToken;
|
||||
use App\Models\Credit;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\GroupSetting;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentHash;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\Quote;
|
||||
use App\Models\User;
|
||||
use App\Models\UserAccount;
|
||||
use App\Repositories\CreditRepository;
|
||||
use App\Repositories\InvoiceRepository;
|
||||
use App\Repositories\QuoteRepository;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RandomDataSeeder extends Seeder
|
||||
{
|
||||
use \App\Utils\Traits\MakesHash;
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
/* Warm up the cache !*/
|
||||
$cached_tables = config('ninja.cached_tables');
|
||||
|
||||
foreach ($cached_tables as $name => $class) {
|
||||
if (! Cache::has($name)) {
|
||||
// check that the table exists in case the migration is pending
|
||||
if (! Schema::hasTable((new $class())->getTable())) {
|
||||
continue;
|
||||
}
|
||||
if ($name == 'payment_terms') {
|
||||
$orderBy = 'num_days';
|
||||
} elseif ($name == 'fonts') {
|
||||
$orderBy = 'sort_order';
|
||||
} elseif (in_array($name, ['currencies', 'industries', 'languages', 'countries', 'banks'])) {
|
||||
$orderBy = 'name';
|
||||
} else {
|
||||
$orderBy = 'id';
|
||||
}
|
||||
$tableData = $class::orderBy($orderBy)->get();
|
||||
if ($tableData->count()) {
|
||||
Cache::forever($name, $tableData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->command->info('Running RandomDataSeeder');
|
||||
|
||||
Eloquent::unguard();
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
$account->default_company_id = $company->id;
|
||||
$account->save();
|
||||
|
||||
$user = factory(\App\Models\User::class)->create([
|
||||
'email' => $faker->email,
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
]);
|
||||
|
||||
$company_token = CompanyToken::create([
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id,
|
||||
'account_id' => $account->id,
|
||||
'name' => 'test token',
|
||||
'token' => \Illuminate\Support\Str::random(64),
|
||||
]);
|
||||
|
||||
$user->companies()->attach($company->id, [
|
||||
'account_id' => $account->id,
|
||||
'is_owner' => 1,
|
||||
'is_admin' => 1,
|
||||
'is_locked' => 0,
|
||||
'notifications' => CompanySettings::notificationDefaults(),
|
||||
'permissions' => '',
|
||||
'settings' => null,
|
||||
]);
|
||||
|
||||
$u2 = User::where('email', 'demo@invoiceninja.com')->first();
|
||||
|
||||
if (! $u2) {
|
||||
$u2 = factory(\App\Models\User::class)->create([
|
||||
'email' => 'demo@invoiceninja.com',
|
||||
'password' => Hash::make('demo'),
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
]);
|
||||
|
||||
$company_token = CompanyToken::create([
|
||||
'user_id' => $u2->id,
|
||||
'company_id' => $company->id,
|
||||
'account_id' => $account->id,
|
||||
'name' => 'test token',
|
||||
'token' => 'TOKEN',
|
||||
]);
|
||||
|
||||
$u2->companies()->attach($company->id, [
|
||||
'account_id' => $account->id,
|
||||
'is_owner' => 1,
|
||||
'is_admin' => 1,
|
||||
'is_locked' => 0,
|
||||
'notifications' => CompanySettings::notificationDefaults(),
|
||||
'permissions' => '',
|
||||
'settings' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
$client = factory(\App\Models\Client::class)->create([
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
|
||||
ClientContact::create([
|
||||
'first_name' => $faker->firstName,
|
||||
'last_name' => $faker->lastName,
|
||||
'email' => config('ninja.testvars.username'),
|
||||
'company_id' => $company->id,
|
||||
'password' => Hash::make(config('ninja.testvars.password')),
|
||||
'email_verified_at' => now(),
|
||||
'client_id' =>$client->id,
|
||||
'user_id' => $user->id,
|
||||
'is_primary' => true,
|
||||
'contact_key' => \Illuminate\Support\Str::random(40),
|
||||
]);
|
||||
|
||||
factory(\App\Models\Client::class, 1)->create(['user_id' => $user->id, 'company_id' => $company->id])->each(function ($c) use ($user, $company) {
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $company->id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 5)->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
});
|
||||
|
||||
/* Product Factory */
|
||||
factory(\App\Models\Product::class, 2)->create(['user_id' => $user->id, 'company_id' => $company->id]);
|
||||
|
||||
/* Invoice Factory */
|
||||
factory(\App\Models\Invoice::class, 2)->create(['user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id]);
|
||||
|
||||
$invoices = Invoice::all();
|
||||
$invoice_repo = new InvoiceRepository();
|
||||
|
||||
$invoices->each(function ($invoice) use ($invoice_repo, $user, $company, $client) {
|
||||
$invoice_calc = null;
|
||||
|
||||
if ($invoice->uses_inclusive_taxes) {
|
||||
$invoice_calc = new InvoiceSumInclusive($invoice);
|
||||
} else {
|
||||
$invoice_calc = new InvoiceSum($invoice);
|
||||
}
|
||||
|
||||
$invoice = $invoice_calc->build()->getInvoice();
|
||||
|
||||
$invoice->save();
|
||||
|
||||
//event(new CreateInvoiceInvitation($invoice));
|
||||
|
||||
$invoice->service()->createInvitations()->markSent()->save();
|
||||
|
||||
$invoice->ledger()->updateInvoiceBalance($invoice->balance);
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$payment = App\Models\Payment::create([
|
||||
'date' => now(),
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id,
|
||||
'client_id' => $client->id,
|
||||
'amount' => $invoice->balance,
|
||||
'transaction_reference' => rand(0, 500),
|
||||
'type_id' => PaymentType::CREDIT_CARD_OTHER,
|
||||
'status_id' => Payment::STATUS_COMPLETED,
|
||||
]);
|
||||
|
||||
$payment->invoices()->save($invoice);
|
||||
|
||||
$payment_hash = new PaymentHash;
|
||||
$payment_hash->hash = Str::random(128);
|
||||
$payment_hash->data = [['invoice_id' => $invoice->hashed_id, 'amount' => $invoice->balance]];
|
||||
$payment_hash->fee_total = 0;
|
||||
$payment_hash->fee_invoice_id = $invoice->id;
|
||||
$payment_hash->save();
|
||||
|
||||
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
|
||||
|
||||
$payment->service()->updateInvoicePayment($payment_hash);
|
||||
|
||||
// UpdateInvoicePayment::dispatchNow($payment, $payment->company);
|
||||
}
|
||||
});
|
||||
|
||||
/*Credits*/
|
||||
factory(\App\Models\Credit::class, 2)->create(['user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id]);
|
||||
|
||||
$credits = Credit::cursor();
|
||||
$credit_repo = new CreditRepository();
|
||||
|
||||
$credits->each(function ($credit) use ($credit_repo, $user, $company, $client) {
|
||||
$credit_calc = null;
|
||||
|
||||
if ($credit->uses_inclusive_taxes) {
|
||||
$credit_calc = new InvoiceSumInclusive($credit);
|
||||
} else {
|
||||
$credit_calc = new InvoiceSum($credit);
|
||||
}
|
||||
|
||||
$credit = $credit_calc->build()->getCredit();
|
||||
|
||||
$credit->save();
|
||||
|
||||
//event(new CreateCreditInvitation($credit));
|
||||
$credit->service()->createInvitations()->markSent()->save();
|
||||
|
||||
//$invoice->markSent()->save();
|
||||
});
|
||||
|
||||
/* Recurring Invoice Factory */
|
||||
factory(\App\Models\RecurringInvoice::class, 1)->create(['user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id]);
|
||||
|
||||
// factory(\App\Models\Payment::class,20)->create(['user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id, 'settings' => ClientSettings::buildClientSettings($company->settings, $client->settings)]);
|
||||
|
||||
/*Credits*/
|
||||
factory(\App\Models\Quote::class, 1)->create(['user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id]);
|
||||
|
||||
$quotes = Quote::cursor();
|
||||
$quote_repo = new QuoteRepository();
|
||||
|
||||
$quotes->each(function ($quote) use ($quote_repo, $user, $company, $client) {
|
||||
$quote_calc = null;
|
||||
|
||||
if ($quote->uses_inclusive_taxes) {
|
||||
$quote_calc = new InvoiceSumInclusive($quote);
|
||||
} else {
|
||||
$quote_calc = new InvoiceSum($quote);
|
||||
}
|
||||
|
||||
$quote = $quote_calc->build()->getQuote();
|
||||
|
||||
$quote->save();
|
||||
|
||||
//event(new CreateQuoteInvitation($quote));
|
||||
$quote->service()->createInvitations()->markSent()->save();
|
||||
//$invoice->markSent()->save();
|
||||
});
|
||||
|
||||
$clients = Client::all();
|
||||
|
||||
foreach ($clients as $client) {
|
||||
//$client->getNextClientNumber($client);
|
||||
$client->id_number = $client->getNextClientNumber($client);
|
||||
$client->save();
|
||||
}
|
||||
|
||||
GroupSetting::create([
|
||||
'company_id' => $company->id,
|
||||
'user_id' => $user->id,
|
||||
'settings' => ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults()),
|
||||
'name' => 'Default Client Settings',
|
||||
]);
|
||||
|
||||
if (config('ninja.testvars.stripe')) {
|
||||
$cg = new CompanyGateway;
|
||||
$cg->company_id = $company->id;
|
||||
$cg->user_id = $user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
$cg->require_cvv = true;
|
||||
$cg->show_billing_address = true;
|
||||
$cg->show_shipping_address = true;
|
||||
$cg->update_details = true;
|
||||
$cg->config = encrypt(config('ninja.testvars.stripe'));
|
||||
$cg->save();
|
||||
|
||||
$cg = new CompanyGateway;
|
||||
$cg->company_id = $company->id;
|
||||
$cg->user_id = $user->id;
|
||||
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||
$cg->require_cvv = true;
|
||||
$cg->show_billing_address = true;
|
||||
$cg->show_shipping_address = true;
|
||||
$cg->update_details = true;
|
||||
$cg->config = encrypt(config('ninja.testvars.stripe'));
|
||||
$cg->save();
|
||||
}
|
||||
|
||||
if (config('ninja.testvars.paypal')) {
|
||||
$cg = new CompanyGateway;
|
||||
$cg->company_id = $company->id;
|
||||
$cg->user_id = $user->id;
|
||||
$cg->gateway_key = '38f2c48af60c7dd69e04248cbb24c36e';
|
||||
$cg->require_cvv = true;
|
||||
$cg->show_billing_address = true;
|
||||
$cg->show_shipping_address = true;
|
||||
$cg->update_details = true;
|
||||
$cg->config = encrypt(config('ninja.testvars.paypal'));
|
||||
$cg->save();
|
||||
}
|
||||
|
||||
if (config('ninja.testvars.checkout')) {
|
||||
$cg = new CompanyGateway;
|
||||
$cg->company_id = $company->id;
|
||||
$cg->user_id = $user->id;
|
||||
$cg->gateway_key = '3758e7f7c6f4cecf0f4f348b9a00f456';
|
||||
$cg->require_cvv = true;
|
||||
$cg->show_billing_address = true;
|
||||
$cg->show_shipping_address = true;
|
||||
$cg->update_details = true;
|
||||
$cg->config = encrypt(config('ninja.testvars.checkout'));
|
||||
$cg->save();
|
||||
}
|
||||
|
||||
if (config('ninja.testvars.authorize')) {
|
||||
$cg = new CompanyGateway;
|
||||
$cg->company_id = $company->id;
|
||||
$cg->user_id = $user->id;
|
||||
$cg->gateway_key = '3b6621f970ab18887c4f6dca78d3f8bb';
|
||||
$cg->require_cvv = true;
|
||||
$cg->show_billing_address = true;
|
||||
$cg->show_shipping_address = true;
|
||||
$cg->update_details = true;
|
||||
$cg->config = encrypt(config('ninja.testvars.authorize'));
|
||||
$cg->save();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Database\Seeders;
|
||||
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\DataMapper\DefaultSettings;
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\User;
|
||||
use App\Models\UserAccount;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UsersTableSeeder extends Seeder
|
||||
{
|
||||
use \App\Utils\Traits\MakesHash;
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->command->info('Running UsersTableSeeder');
|
||||
|
||||
Eloquent::unguard();
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
'account_id' => $account->id,
|
||||
'domain' => 'ninja.test',
|
||||
]);
|
||||
|
||||
$account->default_company_id = $company->id;
|
||||
$account->save();
|
||||
|
||||
$user = factory(\App\Models\User::class)->create([
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
]);
|
||||
|
||||
$userPermissions = collect([
|
||||
'view_invoice',
|
||||
'view_client',
|
||||
'edit_client',
|
||||
'edit_invoice',
|
||||
'create_invoice',
|
||||
'create_client',
|
||||
]);
|
||||
|
||||
$user->companies()->attach($company->id, [
|
||||
'account_id' => $account->id,
|
||||
'is_owner' => 1,
|
||||
'is_admin' => 1,
|
||||
'notifications' => CompanySettings::notificationDefaults(),
|
||||
'permissions' => $userPermissions->toJson(),
|
||||
'settings' => null,
|
||||
'is_locked' => 0,
|
||||
]);
|
||||
|
||||
$client = factory(\App\Models\Client::class)->create([
|
||||
'user_id' => $user->id,
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
|
||||
ClientContact::create([
|
||||
'first_name' => $faker->firstName,
|
||||
'last_name' => $faker->lastName,
|
||||
'email' => config('ninja.testvars.clientname'),
|
||||
'company_id' => $company->id,
|
||||
'password' => Hash::make(config('ninja.testvars.password')),
|
||||
'email_verified_at' => now(),
|
||||
'client_id' =>$client->id,
|
||||
]);
|
||||
|
||||
factory(\App\Models\Client::class, 20)->create(['user_id' => $user->id, 'company_id' => $company->id])->each(function ($c) use ($user, $company) {
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $company->id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 10)->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $company->id,
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
123
phpunit.xml
123
phpunit.xml
@ -1,69 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="true"
|
||||
stopOnFailure="true">
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="Integration">
|
||||
<directory suffix="Test.php">./tests/Integration</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="Feature">
|
||||
<directory suffix="Test.php">./tests/Feature</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="Pdf">
|
||||
<directory suffix="Test.php">./tests/Pdf</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./app</directory>
|
||||
<exclude>
|
||||
<directory suffix=".php">./vendor</directory>
|
||||
<directory suffix=".php">./app/Providers</directory>
|
||||
<directory suffix=".php">./app/Http</directory>
|
||||
<directory suffix=".php">./app/Models</directory>
|
||||
<directory suffix=".php">./app/Transformers</directory>
|
||||
<directory suffix=".php">./app/Events</directory>
|
||||
<directory suffix=".php">./app/Observers</directory>
|
||||
<directory suffix=".php">./app/Policies</directory>
|
||||
<directory suffix=".php">./app/Jobs</directory>
|
||||
<directory suffix=".php">./app/Factory</directory>
|
||||
<directory suffix=".php">./app/Helpers</directory>
|
||||
<directory suffix=".php">./app/Libraries</directory>
|
||||
<directory suffix=".php">./app/Listeners</directory>
|
||||
<directory suffix=".php">./app/Mail</directory>
|
||||
<directory suffix=".php">./app/Notifications</directory>
|
||||
<directory suffix=".php">./app/Providers</directory>
|
||||
<directory suffix=".php">./app/Repositories</directory>
|
||||
<directory suffix=".php">./app/Filters</directory>
|
||||
<file>./app/Console/Kernel.php</file>
|
||||
<file>./app/Constants.php</file>
|
||||
<file>./app/Libraries/OFX.php</file>
|
||||
<file>./app/Exceptions/Handler.php</file>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||
<env name="MAIL_MAILER" value="array"/>
|
||||
</php>
|
||||
<logging>
|
||||
<log type="coverage-clover" target="coverage.xml"/>
|
||||
</logging>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="true" stopOnFailure="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">./app</directory>
|
||||
</include>
|
||||
<exclude>
|
||||
<directory suffix=".php">./vendor</directory>
|
||||
<directory suffix=".php">./app/Providers</directory>
|
||||
<directory suffix=".php">./app/Http</directory>
|
||||
<directory suffix=".php">./app/Models</directory>
|
||||
<directory suffix=".php">./app/Transformers</directory>
|
||||
<directory suffix=".php">./app/Events</directory>
|
||||
<directory suffix=".php">./app/Observers</directory>
|
||||
<directory suffix=".php">./app/Policies</directory>
|
||||
<directory suffix=".php">./app/Jobs</directory>
|
||||
<directory suffix=".php">./app/Factory</directory>
|
||||
<directory suffix=".php">./app/Helpers</directory>
|
||||
<directory suffix=".php">./app/Libraries</directory>
|
||||
<directory suffix=".php">./app/Listeners</directory>
|
||||
<directory suffix=".php">./app/Mail</directory>
|
||||
<directory suffix=".php">./app/Notifications</directory>
|
||||
<directory suffix=".php">./app/Providers</directory>
|
||||
<directory suffix=".php">./app/Repositories</directory>
|
||||
<directory suffix=".php">./app/Filters</directory>
|
||||
<file>./app/Console/Kernel.php</file>
|
||||
<file>./app/Constants.php</file>
|
||||
<file>./app/Libraries/OFX.php</file>
|
||||
<file>./app/Exceptions/Handler.php</file>
|
||||
</exclude>
|
||||
<report>
|
||||
<clover outputFile="coverage.xml"/>
|
||||
</report>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Integration">
|
||||
<directory suffix="Test.php">./tests/Integration</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Feature">
|
||||
<directory suffix="Test.php">./tests/Feature</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Pdf">
|
||||
<directory suffix="Test.php">./tests/Pdf</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="BCRYPT_ROUNDS" value="4"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||
<env name="MAIL_MAILER" value="array"/>
|
||||
</php>
|
||||
<logging/>
|
||||
</phpunit>
|
||||
|
@ -134,15 +134,15 @@ class ClientTest extends TestCase
|
||||
*/
|
||||
public function testClientRestEndPoints()
|
||||
{
|
||||
factory(\App\Models\Client::class, 3)->create(['user_id' => $this->user->id, 'company_id' => $this->company->id])->each(function ($c) {
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
Client::factory()->count(3)->create(['user_id' => $this->user->id, 'company_id' => $this->company->id])->each(function ($c) {
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $this->company->id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 2)->create([
|
||||
ClientContact::factory()->count(2)->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $this->company->id,
|
||||
@ -204,15 +204,15 @@ class ClientTest extends TestCase
|
||||
|
||||
public function testDefaultTimeZoneFromClientModel()
|
||||
{
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
$account->default_company_id = $company->id;
|
||||
$account->save();
|
||||
|
||||
$user = factory(\App\Models\User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
'email' => 'whiz@gmail.com',
|
||||
@ -239,15 +239,15 @@ class ClientTest extends TestCase
|
||||
'is_locked' => 0,
|
||||
]);
|
||||
|
||||
factory(\App\Models\Client::class, 3)->create(['user_id' => $user->id, 'company_id' => $company->id])->each(function ($c) use ($user, $company) {
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
Client::factory()->count(3)->create(['user_id' => $user->id, 'company_id' => $company->id])->each(function ($c) use ($user, $company) {
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $company->id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 2)->create([
|
||||
ClientContact::factory()->count(2)->create([
|
||||
'user_id' => $user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $company->id,
|
||||
@ -270,15 +270,15 @@ class ClientTest extends TestCase
|
||||
|
||||
public function testCreatingClientAndContacts()
|
||||
{
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
$account->default_company_id = $company->id;
|
||||
$account->save();
|
||||
|
||||
$user = factory(\App\Models\User::class)->create([
|
||||
$user = User::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
'email' => 'whiz@gmail.com',
|
||||
|
@ -12,6 +12,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Credit;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@ -41,15 +42,15 @@ class CreditTest extends TestCase
|
||||
|
||||
public function testCreditsList()
|
||||
{
|
||||
factory(Client::class, 1)->create(['user_id' => $this->user->id, 'company_id' => $this->company->id])->each(function ($c) {
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
Client::factory()->count(3)->create(['user_id' => $this->user->id, 'company_id' => $this->company->id])->each(function ($c) {
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $this->company->id,
|
||||
'is_primary' => 1,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $c->id,
|
||||
'company_id' => $this->company->id,
|
||||
@ -58,7 +59,7 @@ class CreditTest extends TestCase
|
||||
|
||||
$client = Client::all()->first();
|
||||
|
||||
factory(Credit::class, 1)->create(['user_id' => $this->user->id, 'company_id' => $this->company->id, 'client_id' => $this->client->id]);
|
||||
Credit::factory()->create(['user_id' => $this->user->id, 'company_id' => $this->company->id, 'client_id' => $this->client->id]);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
|
@ -56,8 +56,8 @@ class InvitationTest extends TestCase
|
||||
|
||||
public function testInvoiceCreationAfterInvoiceMarkedSent()
|
||||
{
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$account = Account::factory()->create();
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
|
@ -58,7 +58,7 @@ class LoginTest extends TestCase
|
||||
// $user = factory(User::class)->create([
|
||||
// // 'account_id' => $account->id,
|
||||
// ]);
|
||||
// $company = factory(\App\Models\Company::class)->make([
|
||||
// $company = Company::factory()->make([
|
||||
// 'account_id' => $account->id,
|
||||
// ]);
|
||||
|
||||
@ -90,7 +90,7 @@ class LoginTest extends TestCase
|
||||
// $user = factory(User::class)->create([
|
||||
// // 'account_id' => $account->id,
|
||||
// ]);
|
||||
// $company = factory(\App\Models\Company::class)->make([
|
||||
// $company = Company::factory()->make([
|
||||
// 'account_id' => $account->id,
|
||||
// ]);
|
||||
|
||||
@ -120,7 +120,7 @@ class LoginTest extends TestCase
|
||||
// $user = factory(User::class)->create([
|
||||
// // 'account_id' => $account->id,
|
||||
// ]);
|
||||
// $company = factory(\App\Models\Company::class)->make([
|
||||
// $company = Company::factory()->make([
|
||||
// 'account_id' => $account->id,
|
||||
// ]);
|
||||
|
||||
@ -147,7 +147,7 @@ class LoginTest extends TestCase
|
||||
'password' => \Hash::make('123456'),
|
||||
]);
|
||||
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
|
@ -138,7 +138,7 @@ class UserTest extends TestCase
|
||||
$this->withoutMiddleware(PasswordProtection::class);
|
||||
|
||||
/* Create New Company */
|
||||
$company2 = factory(\App\Models\Company::class)->create([
|
||||
$company2 = Company::factory()->create([
|
||||
'account_id' => $this->account->id,
|
||||
]);
|
||||
|
||||
|
@ -19,6 +19,8 @@ use App\Factory\InvoiceItemFactory;
|
||||
use App\Jobs\Invoice\MarkInvoicePaid;
|
||||
use App\Models\Account;
|
||||
use App\Models\Activity;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Company;
|
||||
use App\Models\CompanyLedger;
|
||||
use App\Models\CompanyToken;
|
||||
@ -79,8 +81,8 @@ class CompanyLedgerTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
$this->account = factory(\App\Models\Account::class)->create();
|
||||
$this->company = factory(\App\Models\Company::class)->create([
|
||||
$this->account = Account::factory()->create();
|
||||
$this->company = Company::factory()->create([
|
||||
'account_id' => $this->account->id,
|
||||
]);
|
||||
|
||||
@ -108,7 +110,7 @@ class CompanyLedgerTest extends TestCase
|
||||
$this->user = User::whereEmail('user@example.com')->first();
|
||||
|
||||
if (! $this->user) {
|
||||
$this->user = factory(\App\Models\User::class)->create([
|
||||
$this->user = User::factory()->create([
|
||||
'account_id' => $this->account->id,
|
||||
'password' => Hash::make('ALongAndBriliantPassword'),
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
@ -130,12 +132,12 @@ class CompanyLedgerTest extends TestCase
|
||||
$company_token->token = $this->token;
|
||||
$company_token->save();
|
||||
|
||||
$this->client = factory(\App\Models\Client::class)->create([
|
||||
$this->client = Client::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
factory(\App\Models\ClientContact::class, 1)->create([
|
||||
ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $this->client->id,
|
||||
'company_id' => $this->company->id,
|
||||
|
@ -40,18 +40,18 @@ class MultiDBUserTest extends TestCase
|
||||
|
||||
User::unguard();
|
||||
|
||||
$ac = factory(\App\Models\Account::class)->make();
|
||||
$ac = Account::factory()->make();
|
||||
|
||||
$ac->setHidden(['hashed_id']);
|
||||
|
||||
$account = Account::on('db-ninja-01')->create($ac->toArray());
|
||||
$account2 = Account::on('db-ninja-02')->create($ac->toArray());
|
||||
|
||||
$company = factory(\App\Models\Company::class)->make([
|
||||
$company = Company::factory()->make([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
$company2 = factory(\App\Models\Company::class)->make([
|
||||
$company2 = Company::factory()->make([
|
||||
'account_id' => $account2->id,
|
||||
]);
|
||||
|
||||
|
@ -42,12 +42,12 @@ class UniqueEmailTest extends TestCase
|
||||
|
||||
$this->rule = new NewUniqueUserRule();
|
||||
|
||||
$ac = factory(\App\Models\Account::class)->make();
|
||||
$ac = Account::factory()->make();
|
||||
$ac->setHidden(['hashed_id']);
|
||||
|
||||
$account = Account::on('db-ninja-01')->create($ac->toArray());
|
||||
|
||||
$company = factory(\App\Models\Company::class)->make([
|
||||
$company = Company::factory()->make([
|
||||
'account_id' => $account->id,
|
||||
]);
|
||||
|
||||
@ -55,11 +55,11 @@ class UniqueEmailTest extends TestCase
|
||||
|
||||
Company::on('db-ninja-01')->create($company->toArray());
|
||||
|
||||
$ac2 = factory(\App\Models\Account::class)->make();
|
||||
$ac2 = Account::factory()->make();
|
||||
$ac2->setHidden(['hashed_id']);
|
||||
$account2 = Account::on('db-ninja-02')->create($ac2->toArray());
|
||||
|
||||
$company2 = factory(\App\Models\Company::class)->make([
|
||||
$company2 = Company::factory()->make([
|
||||
'account_id' => $account2->id,
|
||||
]);
|
||||
|
||||
|
@ -24,17 +24,23 @@ use App\Factory\InvoiceInvitationFactory;
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use App\Factory\InvoiceToRecurringInvoiceFactory;
|
||||
use App\Helpers\Invoice\InvoiceSum;
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Company;
|
||||
use App\Models\CompanyGateway;
|
||||
use App\Models\CompanyToken;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Expense;
|
||||
use App\Models\GroupSetting;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\Quote;
|
||||
use App\Models\QuoteInvitation;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Models\User;
|
||||
use App\Models\Vendor;
|
||||
use App\Models\VendorContact;
|
||||
use App\Utils\Traits\CompanyGatewayFeesAndLimitsSaver;
|
||||
use App\Utils\Traits\GeneratesCounter;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
@ -96,10 +102,11 @@ trait MockAccountData
|
||||
}
|
||||
}
|
||||
|
||||
$this->account = factory(\App\Models\Account::class)->create();
|
||||
$this->company = factory(\App\Models\Company::class)->create([
|
||||
'account_id' => $this->account->id,
|
||||
]);
|
||||
|
||||
$this->account = Account::factory()->create();
|
||||
$this->company = Company::factory()->create([
|
||||
'account_id' => $this->account->id,
|
||||
]);
|
||||
|
||||
$settings = CompanySettings::defaults();
|
||||
|
||||
@ -125,10 +132,11 @@ trait MockAccountData
|
||||
$this->user = User::whereEmail('user@example.com')->first();
|
||||
|
||||
if (! $this->user) {
|
||||
$this->user = factory(\App\Models\User::class)->create([
|
||||
'account_id' => $this->account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
]);
|
||||
|
||||
$this->user = User::factory()->create([
|
||||
'account_id' => $this->account->id,
|
||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||
]);
|
||||
}
|
||||
|
||||
$this->user->password = Hash::make('ALongAndBriliantPassword');
|
||||
@ -150,12 +158,12 @@ trait MockAccountData
|
||||
|
||||
$company_token->save();
|
||||
|
||||
$this->client = factory(\App\Models\Client::class)->create([
|
||||
$this->client = Client::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
$contact = factory(\App\Models\ClientContact::class)->create([
|
||||
$contact = ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $this->client->id,
|
||||
'company_id' => $this->company->id,
|
||||
@ -163,19 +171,21 @@ trait MockAccountData
|
||||
'send_email' => true,
|
||||
]);
|
||||
|
||||
$contact2 = factory(\App\Models\ClientContact::class)->create([
|
||||
|
||||
$contact2 = ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $this->client->id,
|
||||
'company_id' => $this->company->id,
|
||||
'send_email' => true,
|
||||
]);
|
||||
|
||||
$this->vendor = factory(\App\Models\Vendor::class)->create([
|
||||
$this->vendor = Vendor::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
$vendor_contact = factory(\App\Models\VendorContact::class)->create([
|
||||
|
||||
$vendor_contact = VendorContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'vendor_id' => $this->vendor->id,
|
||||
'company_id' => $this->company->id,
|
||||
@ -183,22 +193,20 @@ trait MockAccountData
|
||||
'send_email' => true,
|
||||
]);
|
||||
|
||||
$vendor_contact2 = factory(\App\Models\VendorContact::class)->create([
|
||||
$vendor_contact2 = VendorContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'vendor_id' => $this->vendor->id,
|
||||
'company_id' => $this->company->id,
|
||||
'send_email' => true,
|
||||
]);
|
||||
|
||||
$this->expense = factory(\App\Models\Expense::class)->create([
|
||||
|
||||
|
||||
$this->expense = Expense::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
// $rels = collect($contact, $contact2);
|
||||
// $this->client->setRelation('contacts', $rels);
|
||||
// $this->client->save();
|
||||
|
||||
$gs = new GroupSetting;
|
||||
$gs->name = 'Test';
|
||||
$gs->company_id = $this->client->company_id;
|
||||
@ -238,15 +246,14 @@ trait MockAccountData
|
||||
|
||||
//$this->invoice->service()->createInvitations()->markSent();
|
||||
//$this->invoice->service()->createInvitations();
|
||||
|
||||
factory(\App\Models\InvoiceInvitation::class)->create([
|
||||
InvoiceInvitation::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'client_contact_id' => $contact->id,
|
||||
'invoice_id' => $this->invoice->id,
|
||||
]);
|
||||
|
||||
factory(\App\Models\InvoiceInvitation::class)->create([
|
||||
InvoiceInvitation::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'client_contact_id' => $contact2->id,
|
||||
@ -255,7 +262,7 @@ trait MockAccountData
|
||||
|
||||
$this->invoice->service()->markSent();
|
||||
|
||||
$this->quote = factory(\App\Models\Quote::class)->create([
|
||||
$this->quote = Quote::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'client_id' => $this->client->id,
|
||||
'company_id' => $this->company->id,
|
||||
@ -276,14 +283,14 @@ trait MockAccountData
|
||||
|
||||
//$this->quote->service()->createInvitations()->markSent();
|
||||
|
||||
factory(\App\Models\QuoteInvitation::class)->create([
|
||||
QuoteInvitation::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'client_contact_id' => $contact->id,
|
||||
'quote_id' => $this->quote->id,
|
||||
]);
|
||||
|
||||
factory(\App\Models\QuoteInvitation::class)->create([
|
||||
QuoteInvitation::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'client_contact_id' => $contact2->id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user