mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 22:44:30 -04:00
Improvements to the user table seeder
This commit is contained in:
parent
25a3f2aae0
commit
54be2f0b84
@ -4,6 +4,8 @@ use App\Models\User;
|
|||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Affiliate;
|
use App\Models\Affiliate;
|
||||||
|
use App\Models\Country;
|
||||||
|
use Faker\Factory;
|
||||||
|
|
||||||
class UserTableSeeder extends Seeder
|
class UserTableSeeder extends Seeder
|
||||||
{
|
{
|
||||||
@ -14,11 +16,23 @@ class UserTableSeeder extends Seeder
|
|||||||
|
|
||||||
Eloquent::unguard();
|
Eloquent::unguard();
|
||||||
|
|
||||||
|
$faker = Faker\Factory::create();
|
||||||
$company = Company::create();
|
$company = Company::create();
|
||||||
|
|
||||||
$account = Account::create([
|
$account = Account::create([
|
||||||
//'name' => 'Test Account',
|
'name' => $faker->name,
|
||||||
|
'address1' => $faker->streetAddress,
|
||||||
|
'address2' => $faker->secondaryAddress,
|
||||||
|
'city' => $faker->city,
|
||||||
|
'state' => $faker->state,
|
||||||
|
'postal_code' => $faker->postcode,
|
||||||
|
'country_id' => Country::all()->random()->id,
|
||||||
'account_key' => str_random(RANDOM_KEY_LENGTH),
|
'account_key' => str_random(RANDOM_KEY_LENGTH),
|
||||||
|
'invoice_terms' => $faker->text($faker->numberBetween(50, 300)),
|
||||||
|
'work_phone' => $faker->phoneNumber,
|
||||||
|
'work_email' => $faker->safeEmail,
|
||||||
|
'invoice_design_id' => $faker->numberBetween(1, 10),
|
||||||
|
'primary_color' => $faker->hexcolor,
|
||||||
'timezone_id' => 1,
|
'timezone_id' => 1,
|
||||||
'company_id' => $company->id,
|
'company_id' => $company->id,
|
||||||
]);
|
]);
|
||||||
@ -30,6 +44,8 @@ class UserTableSeeder extends Seeder
|
|||||||
'password' => Hash::make(TEST_PASSWORD),
|
'password' => Hash::make(TEST_PASSWORD),
|
||||||
'registered' => true,
|
'registered' => true,
|
||||||
'confirmed' => true,
|
'confirmed' => true,
|
||||||
|
'notify_sent' => false,
|
||||||
|
'notify_paid' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Affiliate::create([
|
Affiliate::create([
|
||||||
|
@ -31196,7 +31196,7 @@ NINJA.decodeJavascript = function(invoice, javascript)
|
|||||||
field = toSnakeCase(field);
|
field = toSnakeCase(field);
|
||||||
var value = getDescendantProp(invoice, field);
|
var value = getDescendantProp(invoice, field);
|
||||||
if (match.indexOf('?') < 0 || value) {
|
if (match.indexOf('?') < 0 || value) {
|
||||||
if (invoice.partial && field == 'balance_due') {
|
if (invoice.partial > 0 && field == 'balance_due') {
|
||||||
field = 'partial_due';
|
field = 'partial_due';
|
||||||
} else if (invoice.is_quote) {
|
} else if (invoice.is_quote) {
|
||||||
field = field.replace('invoice', 'quote');
|
field = field.replace('invoice', 'quote');
|
||||||
|
@ -93,14 +93,14 @@
|
|||||||
<div class="container main-container">
|
<div class="container main-container">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 logo">
|
<div class="col-md-6 logo">
|
||||||
@if ($account->hasLogo())
|
@if ($account->hasLogo())
|
||||||
{!! HTML::image($account->getLogoURL()) !!}
|
{!! HTML::image($account->getLogoURL()) !!}
|
||||||
@else
|
@else
|
||||||
<h2>{{ $account->name}}</h2>
|
<h2>{{ $account->name}}</h2>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3 col-md-offset-3 address-details">
|
<div class="col-md-3 address-details">
|
||||||
@if ($account->address1)
|
@if ($account->address1)
|
||||||
{{ $account->address1 }}<br/>
|
{{ $account->address1 }}<br/>
|
||||||
@endif
|
@endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user