1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Improvements to the user table seeder

This commit is contained in:
Hillel Coren 2016-05-05 20:18:02 +03:00
parent 25a3f2aae0
commit 54be2f0b84
3 changed files with 20 additions and 4 deletions

View File

@ -4,6 +4,8 @@ use App\Models\User;
use App\Models\Account;
use App\Models\Company;
use App\Models\Affiliate;
use App\Models\Country;
use Faker\Factory;
class UserTableSeeder extends Seeder
{
@ -14,11 +16,23 @@ class UserTableSeeder extends Seeder
Eloquent::unguard();
$faker = Faker\Factory::create();
$company = Company::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),
'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,
'company_id' => $company->id,
]);
@ -30,6 +44,8 @@ class UserTableSeeder extends Seeder
'password' => Hash::make(TEST_PASSWORD),
'registered' => true,
'confirmed' => true,
'notify_sent' => false,
'notify_paid' => false,
]);
Affiliate::create([

View File

@ -31196,7 +31196,7 @@ NINJA.decodeJavascript = function(invoice, javascript)
field = toSnakeCase(field);
var value = getDescendantProp(invoice, field);
if (match.indexOf('?') < 0 || value) {
if (invoice.partial && field == 'balance_due') {
if (invoice.partial > 0 && field == 'balance_due') {
field = 'partial_due';
} else if (invoice.is_quote) {
field = field.replace('invoice', 'quote');

View File

@ -93,14 +93,14 @@
<div class="container main-container">
<div class="row">
<div class="col-md-3 logo">
<div class="col-md-6 logo">
@if ($account->hasLogo())
{!! HTML::image($account->getLogoURL()) !!}
@else
<h2>{{ $account->name}}</h2>
@endif
</div>
<div class="col-md-3 col-md-offset-3 address-details">
<div class="col-md-3 address-details">
@if ($account->address1)
{{ $account->address1 }}<br/>
@endif