diff --git a/app/Entities/BaseRepository.php b/app/Entities/BaseRepository.php index 2c0a317..67895bd 100755 --- a/app/Entities/BaseRepository.php +++ b/app/Entities/BaseRepository.php @@ -35,8 +35,8 @@ abstract class BaseRepository extends EloquentRepository public function getCustomersAndVendorsList() { $partners = [ - 'Customer' => Customer::orderBy('name')->pluck('name', 'id')->all(), - 'Vendor' => Vendor::orderBy('name')->pluck('name', 'id')->all(), + __('customer.customer') => Customer::orderBy('name')->pluck('name', 'id')->all(), + __('vendor.vendor') => Vendor::orderBy('name')->pluck('name', 'id')->all(), ]; return $partners; diff --git a/app/Http/Controllers/PaymentsController.php b/app/Http/Controllers/PaymentsController.php index 873680e..7f26ab5 100755 --- a/app/Http/Controllers/PaymentsController.php +++ b/app/Http/Controllers/PaymentsController.php @@ -99,9 +99,9 @@ class PaymentsController extends Controller if ($payment->partner_type == 'App\Entities\Users\User') { $partners = $this->repo->getWorkersList(); } elseif ($payment->partner_type == 'App\Entities\Partners\Customer') { - $partners = ['Customer' => $this->repo->getCustomersList()]; + $partners = [__('customer.customer') => $this->repo->getCustomersList()]; } else { - $partners = ['Vendor' => $this->repo->getVendorsList()]; + $partners = [__('vendor.vendor') => $this->repo->getVendorsList()]; } return view('payments.edit', compact('payment', 'projects', 'partners')); diff --git a/resources/views/payments/edit.blade.php b/resources/views/payments/edit.blade.php index 687f40a..7458da3 100755 --- a/resources/views/payments/edit.blade.php +++ b/resources/views/payments/edit.blade.php @@ -8,13 +8,13 @@
- {!! Form::model($payment, ['route'=>['payments.update', $payment->id], 'method' => 'patch']) !!} + {!! Form::model($payment, ['route' => ['payments.update', $payment], 'method' => 'patch']) !!}

{{ __('payment.edit') }}

- {!! FormField::radios('in_out', [__('payment.out'), __('payment.in')], ['label'=> __('payment.in_out')]) !!} + {!! FormField::radios('in_out', [__('payment.out'), __('payment.in')], ['label' => __('payment.in_out')]) !!}
{!! FormField::radios('type_id', PaymentType::toArray(), ['label' => __('payment.type'), 'list_style' => 'unstyled']) !!} @@ -22,30 +22,33 @@
- {!! FormField::text('date', ['label'=> __('app.date')]) !!} + {!! FormField::text('date', ['label' => __('app.date')]) !!}
- {!! FormField::price('amount', ['label'=> __('payment.amount'), 'currency' => Option::get('money_sign', 'Rp')]) !!} + {!! FormField::price('amount', ['label' => __('payment.amount'), 'currency' => Option::get('money_sign', 'Rp')]) !!}
- {!! FormField::select('project_id', $projects, ['label'=> __('payment.project')]) !!} + {!! FormField::select('project_id', $projects, ['label' => __('payment.project')]) !!}
@if ($payment->partner_type == 'App\Entities\Users\User') {{ Form::hidden('partner_type', 'users') }} @endif - {!! FormField::select('partner_id', $partners, ['label'=> __('payment.customer')]) !!} + {!! FormField::select('partner_id', $partners, [ + 'label' => __('payment.customer'), + 'placeholder' => $payment->in_out ? __('customer.select') : __('vendor.select') + ]) !!}
- {!! FormField::textarea('description', ['label'=> __('payment.description')]) !!} + {!! FormField::textarea('description', ['label' => __('payment.description')]) !!}
{!! Form::close() !!} @@ -73,7 +76,7 @@ $('#in_out_0').click(function() { $.post("{{ route('api.vendors.index') }}", {}, function(data) { - var string = ''; + var string = ' '; string = string + ``; $.each(data, function(index, value) { string = string + ``; @@ -86,7 +89,7 @@ $('#in_out_1').click(function() { $.post("{{ route('api.customers.index') }}", {}, function(data) { - var string = ''; + var string = ' '; string = string + ``; $.each(data, function(index, value) { string = string + ``;