@extends('layouts/contentNavbarLayout') @section('title', 'Generate Invoices') @section('content')

Home /Generate Invoice

@isset($invoice) {!! Form::model($invoice, ['route' => ['generate-invoices.update', Crypt::encrypt($invoice->id)], 'method' => 'put', 'class' => 'p-4 progress-form', 'id' => 'progress-form', 'files' => true]) !!} @else {!! Form::open(['url' => '/generate-invoices', 'class' => 'p-4 progress-form', 'id' => 'progress-form', 'lang' => 'en', 'files' => true]) !!} @endisset
Invoice Creation
{!! Form::label('invoice_no', 'Invoice Number', ['class' => 'form-label']) !!} {!! Form::text('invoice_no', @$invoice_no, ['class' => 'form-control', 'readonly', 'placeholder' => 'Invoice Number']) !!}
{!! Form::label('issue_date', 'Date of Issue', ['class' => 'form-label']) !!} {!! Form::date('issue_date', @$invoice->issue_date ? $invoice->issue_date : \Carbon\Carbon::now(), ['class' => 'form-control']) !!}
{!! Form::label('due_date', 'Due Date', ['class' => 'form-label']) !!} {!! Form::date('due_date', @$invoice->due_date, ['class' => 'form-control']) !!}
Resident Billing Information
{!! Form::label('resident_id', 'Resident Name/ID', ['class' => 'form-label']) !!} {!! Form::select('resident_id', $residents, @$invoice->resident_id, ['class' => 'form-select form-select-lg', 'placeholder' => 'Select Resident Name/ID', 'id'=>'resident_id', 'onchange' => "getResidentDetails()"]) !!}
{!! Form::label('street', 'Street', ['class' => 'col-sm-12 col-form-label']) !!} {!! Form::text('street', @$invoice->street, ['class' => 'form-control', 'placeholder' => 'Street', 'id'=>'street', 'required' => 'required']) !!}
{!! Form::label('city', 'City', ['class' => 'col-sm-12 col-form-label']) !!} {!! Form::text('city', @$invoice->city, ['class' => 'form-control', 'placeholder' => 'City', 'id'=>'city', 'required' => 'required']) !!}
{!! Form::label('state', 'State', ['class' => 'col-sm-12 col-form-label']) !!} {!! Form::text('state', @$invoice->state, ['class' => 'form-control', 'placeholder' => 'State', 'id'=>'state', 'required' => 'required']) !!}
{!! Form::label('zip', 'Zip', ['class' => 'col-sm-12 col-form-label']) !!} {!! Form::text('zip', @$invoice->zip, ['class' => 'form-control', 'placeholder' => 'XP12DK3', 'id'=>'zip_code', 'required' => 'required']) !!}
{!! Form::label('email', 'Email Address', ['class' => 'form-label']) !!} {!! Form::email('email', @$inovice->email, ['class' => 'form-control', 'placeholder' => 'jhon@xyz.com']) !!}
Invoice Items     
@if (@$invoice) @foreach (@$invoice->invoice_items['description'] as $index => $description)
{!! Form::label('description', 'Description', ['class' => 'form-label']) !!} {!! Form::textarea('invoice_items[description][]', @$invoice->invoice_items['description'][$index], ['class' => 'form-control', 'id' => 'description', 'rows'=>'2']) !!}
{!! Form::label('price', 'Price', ['class' => 'form-label']) !!} {!! Form::number('invoice_items[price][]', @$invoice->invoice_items['price'][$index], ['class' => 'form-control', 'onchange' => "changeTotal(this)", 'id' => 'price']) !!}
{!! Form::label('total', 'Total', ['class' => 'form-label']) !!} {!! Form::number('invoice_items[total][]', @$invoice->invoice_items['total'][$index], ['class' => 'form-control', 'readonly', 'id' => "total"]) !!}
@endforeach @else
{!! Form::label('description', 'Description', ['class' => 'form-label']) !!} {!! Form::textarea('invoice_items[description][]', '', ['class' => 'form-control', 'id' => 'description', 'rows'=>'2']) !!}
{!! Form::label('price', 'Price', ['class' => 'form-label']) !!} {!! Form::number('invoice_items[price][]', 0, ['class' => 'form-control', 'onchange' => "changeTotal(this)", 'id' => 'price']) !!}
{!! Form::label('total', 'Total', ['class' => 'form-label']) !!} {!! Form::number('invoice_items[total][]', 0, ['class' => 'form-control', 'readonly', 'id' => "total"]) !!}
@endif
Payment Details
{!! Form::label('late_fees', 'Late Fee', ['class' => 'form-label']) !!} {!! Form::number('late_fees', @$invoice->late_fees ? $invoice->late_fees : 0, ['class' => 'form-control', 'onchange' => "changeFianlTotal()"]) !!}
{!! Form::label('sub_total', 'Subtotal', ['class' => 'form-label']) !!} {!! Form::number('sub_total', @$invoice->sub_total, ['class' => 'form-control', 'id' => 'sub_total', 'readonly']) !!}
{!! Form::label('taxes', 'Taxes(7%)', ['class' => 'form-label']) !!} {!! Form::number('taxes', @$invoice->taxes, ['class' => 'form-control', 'id' => 'taxes', 'onchange' => "changeTotal()", 'readonly']) !!}
{!! Form::label('total_amount', 'Total Amount Due', ['class' => 'form-label']) !!} {!! Form::number('total_amount', @$invoice->total_amount, ['class' => 'form-control', 'id' => 'total_amount', 'readonly']) !!}
Invoice Notes
{!! Form::label('notes', 'Notes', ['class' => 'form-check-label']) !!} {!! Form::textarea('notes', @$invoice->notes, ['class' => 'form-control', 'id' => 'note']) !!}
{!! Form::button('Submit', ['type' => 'submit', 'class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
@endsection @section('page-script') @endsection