{{ trans('invoice.items') }}

@foreach($invoice->items as $key => $item) {{ Form::open(['route' => ['invoices.items.update', $invoice], 'method' => 'patch']) }} {{ Form::hidden('item_key['.$key.']', $key) }} {{ Form::close() }} @endforeach {{ Form::open(['route' => ['invoices.items.store', $invoice]]) }} {{ Form::close() }}
{{ __('app.table_no') }} {{ __('app.description') }} {{ __('invoice.item_amount') }} {{ __('app.action') }}
{{ $no }} {!! FormField::textarea( 'description['.$key.']', ['id' => 'description-'.$key, 'value' => $item['description'], 'label' => false] ) !!} {!! FormField::price( 'amount['.$key.']', [ 'id' => 'amount-'.$key, 'value' => $item['amount'], 'label' => false, 'currency' => Option::get('money_sign', 'Rp') ] ) !!} {{ Form::submit(__('app.update'), ['id' => 'update-item-'.$key, 'class' => 'btn btn-success btn-xs pull-right']) }} {!! FormField::delete([ 'route' => ['invoices.items.destroy', $invoice], 'class' => '', ], 'x', ['id' => 'remove-item-'.$key, 'class' => 'btn btn-danger btn-xs show-on-hover' ,'title' => __('invoice.item_remove')], ['item_index' => $key]) !!}
{{ __('invoice.add_item') }}
{!! FormField::textarea( 'new_item_description', ['id' => 'new_item_description', 'label' => false, 'placeholder' => trans('invoice.item_description')] ) !!} {!! FormField::price( 'new_item_amount', [ 'id' => 'new_item_amount', 'label' => false, 'placeholder' => trans('invoice.item_amount'), 'currency' => Option::get('money_sign', 'Rp') ] ) !!} {{ Form::submit(trans('invoice.add_item'), ['class' => 'btn btn-primary btn-block']) }}
{{ trans('invoice.amount') }} : {{ format_money(collect($invoice->items)->sum('amount')) }}