remove work_ prefix

This commit is contained in:
David Bomba 2019-10-04 21:01:52 +10:00
parent 9b09cbe183
commit 187fb67275
9 changed files with 25 additions and 22 deletions

View File

@ -35,7 +35,7 @@ class UpdateProductRequest extends Request
//when updating you need to ignore the column ID
return [
'product_key' => 'unique:products,product_key,'.$this->product->id.',id,company_id,'.auth()->user()->companyId(),
//'product_key' => 'unique:products,product_key,'.$this->product->id.',id,company_id,'.auth()->user()->companyId(),
'cost' => 'numeric',
'price' => 'numeric',
'quantity' => 'numeric',

View File

@ -51,8 +51,8 @@ class Company extends BaseModel
'city',
'state',
'postal_code',
'work_phone',
'work_email',
'phone',
'email',
'country_id',
'domain',
'vat_number',
@ -188,7 +188,7 @@ class Company extends BaseModel
public function getLogo()
{
return $this->logo ? config('ninja.site_url').$this->logo : '';
return $this->logo ? config('ninja.site_url').$this->logo : null;
}
/**

View File

@ -48,11 +48,11 @@ class CompanyPresenter extends EntityPresenter
if ($country = $company->country) {
$str .= e($country->name) . '<br/>';
}
if ($company->work_phone) {
$str .= ctrans('texts.work_phone') . ": ". e($company->work_phone) .'<br/>';
if ($company->phone) {
$str .= ctrans('texts.work_phone') . ": ". e($company->phone) .'<br/>';
}
if ($company->work_email) {
$str .= ctrans('texts.work_email') . ": ". e($company->work_email) .'<br/>';
if ($company->email) {
$str .= ctrans('texts.work_email') . ": ". e($company->email) .'<br/>';
}
return $str;

View File

@ -61,8 +61,8 @@ class User extends Authenticatable implements MustVerifyEmail
protected $fillable = [
'first_name',
'last_name',
'email',
'phone',
// 'email',
// 'phone',
'signature',
'avatar',
'accepted_terms_version',
@ -89,6 +89,7 @@ class User extends Authenticatable implements MustVerifyEmail
'updated_at' => 'timestamp',
'created_at' => 'timestamp',
'deleted_at' => 'timestamp',
'last_login' => 'timestamp',
];
public function getHashedIdAttribute()

View File

@ -1,3 +1,4 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com)
@ -61,7 +62,7 @@ class ClientTransformer extends EntityTransformer
'balance' => (float) $client->balance,
'currency_id' => (string)$client->currency_id ?: '',
'paid_to_date' => (float) $client->paid_to_date,
'last_login' => $client->last_login ?: '',
'last_login' => (int)$client->last_login,
'address1' => $client->address1 ?: '',
'address2' => $client->address2 ?: '',
'city' => $client->city ?: '',
@ -81,7 +82,6 @@ class ClientTransformer extends EntityTransformer
'shipping_country_id' => $client->shipping_country_id ?: '',
'settings' => $client->settings ?: '',
'is_deleted' => (bool) $client->is_deleted,
'payment_terms' => (int) $client->payment_terms,
'vat_number' => $client->vat_number ?: '',
'id_number' => $client->id_number ?: '',
'updated_at' => $client->updated_at,

View File

@ -66,6 +66,7 @@ class CompanyTransformer extends EntityTransformer
return [
'id' => (string)$this->encodePrimaryKey($company->id),
'name' => (string)$company->name ?: '',
'website' => (string)$company->website ?: '',
'logo_url' => (string)$company->getLogo(),
'company_key' => (string)$company->company_key ?: '',
'address1' => (string)$company->address1 ?: '',
@ -73,8 +74,8 @@ class CompanyTransformer extends EntityTransformer
'city' => (string)$company->city ?: '',
'state' => (string)$company->state ?: '',
'postal_code' => (string)$company->postal_code ?: '',
'work_phone' => (string)$company->work_phone ?: '',
'work_email' => (string)$company->work_email ?: '',
'phone' => (string)$company->phone ?: '',
'email' => (string)$company->email ?: '',
'country_id' => (string) $company->country_id ?: '',
'vat_number' => (string)$company->vat_number ?: '',
'id_number' => (string)$company->id_number ?: '',

View File

@ -109,7 +109,7 @@ trait MakesInvoiceValues
'credit_issued_to',
'credit_to',
'your_credit',
'work_phone',
'phone',
'invoice_total',
'outstanding',
'invoice_due_date',
@ -212,8 +212,8 @@ trait MakesInvoiceValues
$data['$company_state'] = $this->company->state;
$data['$company_postal_code'] = $this->company->postal_code;
$data['$company_country'] = $this->company->country ? $this->company->country->name : '';
$data['$company_phone'] = $this->company->work_phone;
$data['$company_email'] = $this->company->work_email;
$data['$company_phone'] = $this->company->phone;
$data['$company_email'] = $this->company->email;
$data['$company_vat_number'] = $this->company->vat_number;
$data['$company_id_number'] = $this->company->id_number;
$data['$company_address'] = $this->company->present()->address();
@ -234,7 +234,7 @@ trait MakesInvoiceValues
$data['$credit_issued_to'] = ;
$data['$credit_to'] = ;
$data['$your_credit'] = ;
$data['$work_phone'] = ;
$data['$phone'] = ;
$data['$invoice_total'] = ;
$data['$outstanding'] = ;
$data['$invoice_due_date'] = ;

View File

@ -16,8 +16,8 @@ $factory->define(App\Models\Company::class, function (Faker $faker) {
'state' => $faker->state,
'postal_code' => $faker->postcode,
'country_id' => 4,
'work_phone' => $faker->phoneNumber,
'work_email' => $faker->safeEmail,
'phone' => $faker->phoneNumber,
'email' => $faker->safeEmail,
'logo' => 'https://www.invoiceninja.com/wp-content/themes/invoice-ninja/images/logo.png',
];
});

View File

@ -138,8 +138,8 @@ class CreateUsersTable extends Migration
$table->string('city')->nullable();
$table->string('state')->nullable();
$table->string('postal_code')->nullable();
$table->string('work_phone')->nullable();
$table->string('work_email')->nullable();
$table->string('phone')->nullable();
$table->string('email')->nullable();
$table->unsignedInteger('country_id')->nullable();
$table->string('domain')->nullable();
$table->string('db')->nullable();
@ -807,6 +807,7 @@ class CreateUsersTable extends Migration
$table->unsignedInteger('bank_company_id');
$table->string('account_name')->nullable();
$table->string('website')->nullable();
$table->string('account_number')->nullable();
$table->timestamps(6);