mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Add company id and do minor fixes for vat number
This commit is contained in:
parent
4c74c3e173
commit
964264bdad
@ -818,6 +818,7 @@ class AccountController extends \BaseController {
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
$account->name = trim(Input::get('name'));
|
||||
$account->id_number = trim(Input::get('id_number'));
|
||||
$account->vat_number = trim(Input::get('vat_number'));
|
||||
$account->work_email = trim(Input::get('work_email'));
|
||||
$account->work_phone = trim(Input::get('work_phone'));
|
||||
|
@ -199,6 +199,7 @@ class ClientController extends \BaseController {
|
||||
}
|
||||
|
||||
$client->name = trim(Input::get('name'));
|
||||
$client->id_number = trim(Input::get('id_number'));
|
||||
$client->vat_number = trim(Input::get('vat_number'));
|
||||
$client->work_phone = trim(Input::get('work_phone'));
|
||||
$client->custom_value1 = trim(Input::get('custom_value1'));
|
||||
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCompanyIdNumber extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('accounts', function($table)
|
||||
{
|
||||
$table->string('id_number')->nullable();
|
||||
});
|
||||
|
||||
Schema::table('clients', function($table)
|
||||
{
|
||||
$table->string('id_number')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('accounts', function($table)
|
||||
{
|
||||
$table->dropColumn('id_number');
|
||||
});
|
||||
Schema::table('clients', function($table)
|
||||
{
|
||||
$table->dropColumn('id_number');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -5,7 +5,8 @@ return array(
|
||||
// client
|
||||
'organization' => 'Organisation',
|
||||
'name' => 'Navn',
|
||||
'vat_number' => 'CVR nummer',
|
||||
'id_number' => 'SE/CVR nummer',
|
||||
'vat_number' => 'SE/CVR nummer',
|
||||
'website' => 'Webside',
|
||||
'work_phone' => 'Telefon',
|
||||
'address' => 'Adresse',
|
||||
|
@ -458,5 +458,8 @@ return array(
|
||||
'buy' => 'Buy',
|
||||
'bought_designs' => 'Successfully added additional invoice designs',
|
||||
|
||||
'id_number' => 'ID Number',
|
||||
'vat_number' => 'VAT Number',
|
||||
|
||||
'timesheets' => 'Timesheets',
|
||||
);
|
||||
|
@ -131,11 +131,23 @@ class Client extends EntityModel
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function getIdNumber()
|
||||
{
|
||||
$str = '';
|
||||
|
||||
if ($this->id_number)
|
||||
{
|
||||
$str .= '<i class="fa fa-vat-number" style="width: 20px"></i>' . $this->vat_number;
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function getVatNumber()
|
||||
{
|
||||
$str = '';
|
||||
|
||||
if ($this->work_phone)
|
||||
if ($this->vat_number)
|
||||
{
|
||||
$str .= '<i class="fa fa-vat-number" style="width: 20px"></i>' . $this->vat_number;
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ class Invoice extends EntityModel
|
||||
|
||||
$this->client->setVisible([
|
||||
'name',
|
||||
'id_number',
|
||||
'vat_number',
|
||||
'address1',
|
||||
'address2',
|
||||
@ -111,6 +112,7 @@ class Invoice extends EntityModel
|
||||
|
||||
$this->account->setVisible([
|
||||
'name',
|
||||
'id_number',
|
||||
'vat_number',
|
||||
'address1',
|
||||
'address2',
|
||||
|
@ -62,6 +62,9 @@ class ClientRepository
|
||||
if (isset($data['name'])) {
|
||||
$client->name = trim($data['name']);
|
||||
}
|
||||
if (isset($data['id_number'])) {
|
||||
$client->id_number = trim($data['id_number']);
|
||||
}
|
||||
if (isset($data['vat_number'])) {
|
||||
$client->vat_number = trim($data['vat_number']);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
{{ Former::legend('details') }}
|
||||
{{ Former::text('name') }}
|
||||
{{ Former::text('id_number') }}
|
||||
{{ Former::text('vat_number') }}
|
||||
{{ Former::text('work_email') }}
|
||||
{{ Former::text('work_phone') }}
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
{{ Former::legend('Organization') }}
|
||||
{{ Former::text('name') }}
|
||||
{{ Former::text('id_number') }}
|
||||
{{ Former::text('vat_number') }}
|
||||
{{ Former::text('work_phone')->label('Phone') }}
|
||||
{{ Former::textarea('notes') }}
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
{{ Former::legend('organization') }}
|
||||
{{ Former::text('name')->data_bind("attr { placeholder: placeholderName }") }}
|
||||
{{ Former::text('id_number') }}
|
||||
{{ Former::text('vat_number') }}
|
||||
{{ Former::text('website') }}
|
||||
{{ Former::text('work_phone') }}
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3>{{ trans('texts.details') }}</h3>
|
||||
<p>{{ $client->getIdNumber() }}</p>
|
||||
<p>{{ $client->getVatNumber() }}</p>
|
||||
<p>{{ $client->getAddress() }}</p>
|
||||
<p>{{ $client->getCustomFields() }}</p>
|
||||
|
@ -341,6 +341,7 @@
|
||||
|
||||
{{ Former::legend('organization') }}
|
||||
{{ Former::text('name')->data_bind("value: name, valueUpdate: 'afterkeydown', attr { placeholder: name.placeholder }") }}
|
||||
{{ Former::text('id_number')->data_bind("value: id_number, valueUpdate: 'afterkeydown'") }}
|
||||
{{ Former::text('vat_number')->data_bind("value: vat_number, valueUpdate: 'afterkeydown'") }}
|
||||
|
||||
{{ Former::text('website')->data_bind("value: website, valueUpdate: 'afterkeydown'") }}
|
||||
@ -1222,6 +1223,7 @@
|
||||
var self = this;
|
||||
self.public_id = ko.observable(0);
|
||||
self.name = ko.observable('');
|
||||
self.id_number = ko.observable('');
|
||||
self.vat_number = ko.observable('');
|
||||
self.work_phone = ko.observable('');
|
||||
self.custom_value1 = ko.observable('');
|
||||
|
@ -32069,6 +32069,7 @@ function displayAccount(doc, invoice, x, y, layout) {
|
||||
|
||||
var data1 = [
|
||||
account.name,
|
||||
account.id_number,
|
||||
account.vat_number,
|
||||
account.work_email,
|
||||
account.work_phone
|
||||
@ -32107,6 +32108,7 @@ function displayClient(doc, invoice, x, y, layout) {
|
||||
}
|
||||
var data = [
|
||||
getClientDisplayName(client),
|
||||
client.id_number,
|
||||
client.vat_number,
|
||||
concatStrings(client.address1, client.address2),
|
||||
concatStrings(client.city, client.state, client.postal_code),
|
||||
|
@ -637,6 +637,7 @@ function displayAccount(doc, invoice, x, y, layout) {
|
||||
|
||||
var data1 = [
|
||||
account.name,
|
||||
account.id_number,
|
||||
account.vat_number,
|
||||
account.work_email,
|
||||
account.work_phone
|
||||
@ -675,6 +676,7 @@ function displayClient(doc, invoice, x, y, layout) {
|
||||
}
|
||||
var data = [
|
||||
getClientDisplayName(client),
|
||||
client.id_number,
|
||||
client.vat_number,
|
||||
concatStrings(client.address1, client.address2),
|
||||
concatStrings(client.city, client.state, client.postal_code),
|
||||
|
Loading…
Reference in New Issue
Block a user