@if(Auth::user()->franchise && Auth::user()->franchise->countries && Auth::user()->franchise->countries->currency_code) @else @endif
Month {{ date('M-Y', strtotime($dates['year'] . '-' . $dates['month'])) }} (Amounts are in {{ Auth::user()->franchise->countries->currency_code }})(Amounts are in TZS)
VAT Log Report
@php $vatExclusive = 0; $vatAmount = 0; $grossAmount = 0; @endphp @foreach($vatLogs as $vat_log) @php $vatExclusive += ($vat_log->is_payment_voucher) ? $vat_log->total_amount_converted : $vat_log->total_amount; $vatAmount += $vat_log->vat_amount; $grossAmount += ($vat_log->is_payment_voucher) ? ($vat_log->total_amount_converted + $vat_log->vat_amount) : ($vat_log->total_amount + $vat_log->vat_amount); @endphp @endforeach
PV / PC Number VRN Company Name Receipt Invoice Number Date Description VAT Exclusive VAT VAT Inclusive
@if($vat_log->is_payment_voucher) PV{{ $vat_log->pv_serial_number ?? '' }} @else PC{{ $vat_log->serial_number ?? '' }} @endif {{ $vat_log->company->registrations[0]->registration_value ?? '' }} {{ $vat_log->company->name ?? '' }} @if($vat_log->is_payment_voucher) {{ $vat_log->lpo_receipt_invoice_number }} @else {{ $vat_log->receipt_number }} @endif @if($vat_log->is_payment_voucher) {{ $vat_log->receipt_date_formatted }} @else {{ $vat_log->date_formatted }} @endif @if($vat_log->is_payment_voucher) {{ $vat_log->description }} @else {{ $vat_log->short_description }} @endif @if($vat_log->is_payment_voucher) {{ round($vat_log->total_amount_converted, 2) }} @else {{ round($vat_log->total_amount, 2) }} @endif {{ round($vat_log->vat_amount, 2) }} @if($vat_log->is_payment_voucher) {{ round(($vat_log->total_amount_converted + $vat_log->vat_amount), 2) }} @else {{ round(($vat_log->total_amount + $vat_log->vat_amount), 2) }} @endif
{{ round($vatExclusive, 2) }} {{ round($vatAmount, 2) }} {{ round($grossAmount, 2) }}
VAT Payable and Allocation
@foreach($departmentList as $dept) @endforeach @foreach ($departmentList as $dept) @if($dept->subdepts_count > 0) @foreach($dept->subdepts as $sub_dept) @endforeach @else @endif @endforeach @foreach($departmentList as $dept) @if($dept->subdepts_count > 0) @foreach($dept->subdepts as $sub_dept) @endforeach @else @endif @endforeach @foreach($departmentList as $dept) @if($dept->subdepts_count > 0) @foreach($dept->subdepts as $sub_dept) @endforeach @else @endif @endforeach @foreach($departmentList as $dept) @if($dept->subdepts_count > 0) @foreach($dept->subdepts as $sub_dept) @endforeach @else @endif @endforeach @foreach($departmentList as $dept) @if($dept->subdepts_count > 0) @foreach($dept->subdepts as $sub_dept) @endforeach @else @endif @endforeach
subdepts_count > 0) colspan="{{ $dept->subdepts_count }}" @endif style="border: 1px solid black; text-align: center; background-color: @if($loop->odd) #CCB2FF @elseif($loop->even) #FFE6AB @endif">{{ $dept->name }}Total
{{ $sub_dept->name }}-
Total Revenue (VAT) @isset($vatLogRevenue['subdepts'][$sub_dept->id]) {{ round($vatLogRevenue['subdepts'][$sub_dept->id], 2) }} @endisset @isset($vatLogRevenue['depts'][$dept->id]) {{ round($vatLogRevenue['depts'][$dept->id], 2) }} @endisset @isset($vatLogRevenue['total']) {{ round($vatLogRevenue['total'], 2) }} @endisset
Total Expense (VAT) @isset($vatLogExpense['subdepts'][$sub_dept->id]) {{ round($vatLogExpense['subdepts'][$sub_dept->id], 2) }} @endisset @isset($vatLogExpense['depts'][$dept->id]) {{ round($vatLogExpense['depts'][$dept->id], 2) }} @endisset @isset($vatLogExpense['total']) {{ round($vatLogExpense['total'], 2) }} @endisset
VAT Payable @isset($vatLogRevenue['subdepts'][$sub_dept->id]) @php $tempPayable['sub_dept'][$sub_dept->id] = (isset($vatLogRevenue['subdepts'][$sub_dept->id]) ? $vatLogRevenue['subdepts'][$sub_dept->id] : 0) - (isset($vatLogExpense['subdepts'][$sub_dept->id]) ? $vatLogExpense['subdepts'][$sub_dept->id] : 0); @endphp @if($tempPayable['sub_dept'][$sub_dept->id] > 0) @php if(isset($totalVatPayable)) $totalVatPayable += $tempPayable['sub_dept'][$sub_dept->id]; else $totalVatPayable = $tempPayable['sub_dept'][$sub_dept->id]; @endphp {{ round($tempPayable['sub_dept'][$sub_dept->id], 2) }} @endif @endisset @isset($vatLogRevenue['depts'][$dept->id]) @php $tempPayable['dept'][$dept->id] = $vatLogRevenue['depts'][$dept->id] - (isset($vatLogExpense['depts'][$dept->id]) ? $vatLogExpense['depts'][$dept->id] : 0);; @endphp @if(isset($tempPayable['dept'][$dept->id]) && $tempPayable['dept'][$dept->id] > 0) @php if(isset($totalVatPayable)) $totalVatPayable += $tempPayable['dept'][$dept->id]; else $totalVatPayable = $tempPayable['dept'][$dept->id]; @endphp {{ round($tempPayable['dept'][$dept->id], 2) }} @endif @endisset @isset($totalVatPayable) @if($totalVatPayable > 0) {{ round($totalVatPayable, 2) }} @endif @endisset
Allocation @if(isset($vatLogRevenue['subdepts'][$sub_dept->id]) && isset($tempPayable['sub_dept'][$sub_dept->id]) && isset($totalVatPayable)) @php $tempPercentage = ($tempPayable['sub_dept'][$sub_dept->id] * 100) / $totalVatPayable; @endphp @if($totalVatPayable > 0 && $tempPercentage > 0) @php if(isset($totalPercentage)) $totalPercentage += $tempPercentage; else $totalPercentage = $tempPercentage; @endphp {{ round($tempPercentage, 2) }}% @endif @endif @if(isset($vatLogRevenue['depts'][$dept->id]) && isset($tempPayable['dept'][$dept->id]) && isset($totalVatPayable)) @php $tempPercentage = ($tempPayable['dept'][$dept->id] * 100) / $totalVatPayable; @endphp @if($totalVatPayable > 0 && $tempPercentage > 0) @php if(isset($totalPercentage)) $totalPercentage += $tempPercentage; else $totalPercentage = $tempPercentage; @endphp {{ round($tempPercentage, 2) }}% @endif @endif @if(isset($totalPercentage)) {{ round(($totalPercentage > 100) ? '100.00' : $totalPercentage, 2) }}% @endif