Skip to content

Commit

Permalink
Reference field in Vendors/Customers
Browse files Browse the repository at this point in the history
  • Loading branch information
Batuhan Baş committed Sep 26, 2018
1 parent 5cc1c03 commit f1eafda
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Models/Expense/Vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Vendor extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'name', 'email', 'tax_number', 'phone', 'address', 'website', 'currency_code', 'enabled'];
protected $fillable = ['company_id', 'name', 'email', 'tax_number', 'phone', 'address', 'website', 'currency_code', 'reference', 'enabled'];

/**
* Sortable columns.
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Income/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Customer extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'user_id', 'name', 'email', 'tax_number', 'phone', 'address', 'website', 'currency_code', 'enabled'];
protected $fillable = ['company_id', 'user_id', 'name', 'email', 'tax_number', 'phone', 'address', 'website', 'currency_code', 'reference', 'enabled'];

/**
* Sortable columns.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Illuminate\Database\Migrations\Migration;

class AddReferenceColumnCustomers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('customers', function ($table) {
$table->string('reference')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('customers', function ($table) {
$table->dropColumn('reference');
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Illuminate\Database\Migrations\Migration;

class AddReferenceColumnVendors extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('vendors', function ($table) {
$table->string('reference')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('vendors', function ($table) {
$table->dropColumn('reference');
});
}
}
3 changes: 3 additions & 0 deletions resources/views/expenses/vendors/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
{{ Form::fileGroup('logo', trans_choice('general.pictures', 1)) }}

{{ Form::radioGroup('enabled', trans('general.enabled')) }}

{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}

</div>
<!-- /.box-body -->

Expand Down
3 changes: 3 additions & 0 deletions resources/views/expenses/vendors/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
{{ Form::fileGroup('logo', trans_choice('general.logos', 1)) }}

{{ Form::radioGroup('enabled', trans('general.enabled')) }}

{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}

</div>
<!-- /.box-body -->

Expand Down
5 changes: 5 additions & 0 deletions resources/views/expenses/vendors/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<li class="list-group-item">
<b>{{ trans('general.tax_number') }}</b> <a class="pull-right">{{ $vendor->tax_number }}</a>
</li>
@if ($vendor->refence)
<li class="list-group-item">
<b>{{ trans('general.reference') }}</b> <a class="pull-right">{{ $vendor->refence }}</a>
</li>
@endif
</ul>
</div>
<!-- /.box-body -->
Expand Down
3 changes: 3 additions & 0 deletions resources/views/incomes/customers/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

{{ Form::radioGroup('enabled', trans('general.enabled')) }}

{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}


@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
<strong>{{ trans('customers.allow_login') }}</strong> &nbsp; {{ Form::checkbox('create_user', '1', null, ['id' => 'create_user']) }}
Expand Down
2 changes: 2 additions & 0 deletions resources/views/incomes/customers/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

{{ Form::radioGroup('enabled', trans('general.enabled')) }}

{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}

@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
@if ($customer->user_id)
Expand Down
5 changes: 5 additions & 0 deletions resources/views/incomes/customers/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<li class="list-group-item">
<b>{{ trans('general.tax_number') }}</b> <a class="pull-right">{{ $customer->tax_number }}</a>
</li>
@if ($customer->refence)
<li class="list-group-item">
<b>{{ trans('general.reference') }}</b> <a class="pull-right">{{ $customer->refence }}</a>
</li>
@endif
</ul>
</div>
<!-- /.box-body -->
Expand Down

0 comments on commit f1eafda

Please sign in to comment.