1
0
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:
Troels Liebe Bentsen 2014-10-30 20:00:33 +01:00
parent 4c74c3e173
commit 964264bdad
17 changed files with 276 additions and 200 deletions

View File

@ -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'));

View File

@ -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'));

View File

@ -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');
});
}
}

View File

@ -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',

View File

@ -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',
);

View File

@ -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;
}

View File

@ -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',

View File

@ -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']);
}

View File

@ -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') }}

View File

@ -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') }}

View File

@ -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') }}

View File

@ -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>

View File

@ -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('');

View File

@ -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),

View File

@ -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),