@extends('layouts.admin') @section('content')

Tax Return #{{$taxReturn->id}}

ACTION

INFO

ID
{{$taxReturn->id}}
Name
{{$taxReturn->name}}
UTR
{{$taxReturn->utr}}
End year
{{$taxReturn->taxYear->end_year}}
Status
{{$taxReturn->status}}
Tax calculation
@currency($taxReturn->estimated_tax)

FORM

@php $boxes = \Illuminate\Support\Facades\File::get(resource_path('tax_returns/'.$taxReturn->taxYear->end_year.'/mapping.json')); $boxes = json_decode($boxes, true); @endphp @foreach($taxReturn->forms as $index => $formKey)
@php $formBoxes = $boxes[$formKey]; @endphp @if(is_countable($taxReturn->{$formKey})) @php $numberOfInstance = count($taxReturn->{$formKey}); $businesses = $taxReturn->user->businesses; $employers = $taxReturn->user->employers; @endphp @for($i=0; $i<$numberOfInstance; $i++) @switch($formKey) @case('SA102') @foreach($employers as $employer)
@endforeach @break @case('SA103F') @foreach($businesses as $business)
@endforeach @break @case('SA105')
@break @endswitch @foreach($formBoxes as $formBox)
{{ $formBox }}[{{ $i }}]
{{ $taxReturn->{$formKey}[$i]->{$formBox} }}
@endforeach @endfor @else @foreach($formBoxes as $formBox)
{{ $formBox }}
{{ $taxReturn->{$formKey}->{$formBox} }}
@endforeach @endif
@endforeach

Tax calculation

@php $tax_calc = $taxReturn->tax_calc; ksort($tax_calc); @endphp @foreach($tax_calc as $c => $v)
{{ $c }}
@currency($v)
@endforeach

Submission

{{ $taxReturn->xml() }}
@endsection