@extends('layouts.app') @section('title', __('project::lang.invoices')) @section('content')

@lang('project::lang.invoice') @lang('messages.edit')

{!! Form::open(['url' => action([\Modules\Project\Http\Controllers\InvoiceController::class, 'update'], $transaction->id), 'id' => 'invoice_form', 'method' => 'put']) !!}
{!! Form::label('pjt_title', __('project::lang.title') . ':*' )!!} {!! Form::text('pjt_title', $transaction->pjt_title, ['class' => 'form-control', 'required' ]) !!}
{!! Form::hidden('pjt_project_id', $transaction->pjt_project_id, ['class' => 'form-control']) !!}
{!! Form::label('contact_id', __('role.customer') . ':*' )!!} {!! Form::select('contact_id', $customers, $transaction->contact_id, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required', 'style' => 'width: 100%;']); !!}
{!! Form::label('location_id', __('business.business_location') . ':*' )!!} {!! Form::select('location_id', $business_locations, $transaction->location_id, ['class' => 'form-control', 'placeholder' => __('messages.please_select'), 'required', 'style' => 'width: 100%;']); !!}
{!! Form::label('transaction_date', __('project::lang.invoice_date') . ':*' )!!} {!! Form::text('transaction_date', @format_date($transaction->transaction_date), ['class' => 'form-control date-picker','required', 'readonly']); !!}
{!! Form::label('pay_term_number', __('contact.pay_term') . ':') !!} @show_tooltip(__('tooltip.pay_term'))
{!! Form::number('pay_term_number', $transaction->pay_term_number, ['class' => 'form-control width-40 pull-left', 'placeholder' => __('contact.pay_term')]); !!} {!! Form::select('pay_term_type', ['months' => __('lang_v1.months'), 'days' => __('lang_v1.days')], $transaction->pay_term_type, ['class' => 'form-control width-60 pull-left','placeholder' => __('messages.please_select')]); !!}
{!! Form::label('status', __('sale.status') . ':*' )!!} {!! Form::select('status', $statuses, $transaction->status, ['class' => 'form-control', 'placeholder' => __('messages.please_select'), 'required', 'style' => 'width: 100%;']); !!}
@foreach($transaction->invoiceLines as $key => $invoiceLine)
{!! Form::hidden('invoice_line_id[]', $invoiceLine->id, ['class' => 'form-control']) !!}
{!! Form::text('existing_task[]', $invoiceLine->task, ['class' => 'form-control', 'required' ]) !!}
{!! Form::text('existing_rate[]', @num_format($invoiceLine->rate), ['class' => 'form-control rate input_number', 'required' ]) !!}
{!! Form::text('existing_quantity[]', @format_quantity($invoiceLine->quantity), ['class' => 'form-control quantity input_number', 'required' ]) !!}
{!! Form::select('existing_tax_rate_id[]', $taxes, $invoiceLine->tax_rate_id, ['class' => 'form-control tax'], $tax_attributes); !!}
{!! Form::text('existing_total[]', @num_format($invoiceLine->total), ['class' => 'form-control total input_number', 'required', 'readonly']) !!}
@if($key != 0)
@endif
{!! Form::textarea('existing_description[]', $invoiceLine->description, ['class' => 'form-control ', 'placeholder' => __('lang_v1.description'), 'rows' => '3']); !!}
@endforeach

@includeIf('project::invoice.partials.invoice_line_row')
@lang('sale.subtotal'): 0.00
{!! Form::label('discount_type', __('sale.discount_type') . ':' )!!} {!! Form::select('discount_type', $discount_types, $transaction->discount_type, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'style' => 'width: 100%;']); !!}
{!! Form::label('discount_amount', __('sale.discount_amount') . ':' )!!} {!! Form::text('discount_amount', @num_format($transaction->discount_amount), ['class' => 'form-control input_number']) !!}

@lang('project::lang.invoice_total'): 0.00

{!! Form::label('staff_note', __('project::lang.terms') . ':') !!} {!! Form::textarea('staff_note', $transaction->staff_note, ['class' => 'form-control ', 'rows' => '3']); !!}
{!! Form::label('additional_notes', __('project::lang.notes') . ':') !!} {!! Form::textarea('additional_notes', $transaction->additional_notes, ['class' => 'form-control ', 'rows' => '3']); !!}
{!! Form::close() !!}
@endsection @section('javascript') @endsection