Browse Source

Add tax_id entry on agency profile

pull/26/head
Nafies Luthfi 7 years ago
parent
commit
bbf576118b
  1. 2
      app/Http/Controllers/Users/AgencyController.php
  2. 1
      resources/lang/de/agency.php
  3. 1
      resources/lang/en/agency.php
  4. 1
      resources/lang/id/agency.php
  5. 7
      resources/views/users/agency/edit.blade.php
  6. 1
      resources/views/users/agency/show.blade.php
  7. 5
      tests/Feature/AgencyProfileTest.php

2
app/Http/Controllers/Users/AgencyController.php

@ -47,6 +47,7 @@ class AgencyController extends Controller
'address' => 'required|string|max:255',
'city' => 'required|string|max:100',
'phone' => 'required|string|max:255',
'tax_id' => 'nullable|string|max:255',
]);
Option::set('agency_name', request('name'));
@ -56,6 +57,7 @@ class AgencyController extends Controller
Option::set('agency_address', request('address'));
Option::set('agency_city', request('city'));
Option::set('agency_phone', request('phone'));
Option::set('agency_tax_id', request('tax_id'));
flash(__('agency.updated'), 'success');

1
resources/lang/de/agency.php

@ -22,4 +22,5 @@ return [
'address' => 'Agentur Adresse',
'phone' => 'Agentur Telefon',
'logo' => 'Agentur Logo',
'tax_id' => 'Tax ID Number',
];

1
resources/lang/en/agency.php

@ -22,4 +22,5 @@ return [
'address' => 'Agency Address',
'phone' => 'Agency Phone',
'logo' => 'Agency Logo',
'tax_id' => 'Tax ID Number',
];

1
resources/lang/id/agency.php

@ -22,4 +22,5 @@ return [
'address' => 'Alamat Agensi',
'phone' => 'Telp. Agensi',
'logo' => 'Logo Agensi',
'tax_id' => 'NPWP',
];

7
resources/views/users/agency/edit.blade.php

@ -21,8 +21,11 @@
<div class="col-md-6">{!! FormField::text('phone', ['value' => Option::get('agency_phone')]) !!}</div>
</div>
{!! FormField::textarea('address', ['value' => Option::get('agency_address')]) !!}
{!! FormField::text('city', ['value' => Option::get('agency_city')]) !!}
{!! FormField::text('website', ['value' => Option::get('agency_website')]) !!}
<div class="row">
<div class="col-md-6">{!! FormField::text('city', ['value' => Option::get('agency_city')]) !!}</div>
<div class="col-md-6">{!! FormField::text('website', ['value' => Option::get('agency_website')]) !!}</div>
</div>
{!! FormField::text('tax_id', ['label' => __('agency.tax_id'), 'value' => Option::get('agency_tax_id')]) !!}
</div>
{{ Form::close() }}
<div class="col-md-3 text-center">

1
resources/views/users/agency/show.blade.php

@ -28,6 +28,7 @@
<tr><th>{{ trans('address.address') }}</th><td>{!! nl2br(Option::get('agency_address')) !!}</td></tr>
<tr><th>{{ trans('address.city') }}</th><td>{{ Option::get('agency_city') }}</td></tr>
<tr><th>{{ trans('contact.website') }}</th><td>{{ Option::get('agency_website') }}</td></tr>
<tr><th>{{ trans('agency.tax_id') }}</th><td>{{ Option::get('agency_tax_id') }}</td></tr>
</table>
</div>
</div>

5
tests/Feature/AgencyProfileTest.php

@ -36,6 +36,7 @@ class AgencyProfileTest extends TestCase
'phone' => '081234567890',
'city' => 'Jakarta',
'website' => 'https://example.com',
'tax_id' => '14.817.xxx.x-xxx.000',
]);
$this->see(trans('agency.updated'));
@ -69,6 +70,10 @@ class AgencyProfileTest extends TestCase
'key' => 'agency_tagline',
'value' => 'Tagline agensi saya',
]);
$this->seeInDatabase('site_options', [
'key' => 'agency_tax_id',
'value' => '14.817.xxx.x-xxx.000',
]);
}
/** @test */

Loading…
Cancel
Save