@extends('admin.layouts.main') @section('title') {{ trans('finance.vat_log') }} @endsection @section('content')
@include('admin.common.sidebar')

{{ @trans('finance.vat_log_report') }}

date_range
@permission('vat-log-read') @if(count($vatLogs) > 0) Export @endif @endpermission
@if(count($vatLogs))
@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) {{ number_format($vat_log->total_amount_converted, 2) }} @else {{ number_format($vat_log->total_amount, 2) }} @endif {{ number_format($vat_log->vat_amount, 2) }} @if($vat_log->is_payment_voucher) {{ number_format(($vat_log->total_amount_converted + $vat_log->vat_amount), 2) }} @else {{ number_format(($vat_log->total_amount + $vat_log->vat_amount), 2) }} @endif
{{ number_format($vatExclusive, 2) }} {{ number_format($vatAmount, 2) }} {{ number_format($grossAmount, 2) }}
@else
@endif
@if(count($vatLogs) > 0 && count($departmentList) > 0)

{{ @trans('finance.vat_payable') }}

@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 class="text-center top-head @if($loop->odd) table-cl-purple @elseif($loop->even) table-cl-yellow @endif">{{ $dept->name }}Total
{{ $sub_dept->name }}-
Total Revenue (VAT) @isset($vatLogRevenue['subdepts'][$sub_dept->id]) {{ number_format($vatLogRevenue['subdepts'][$sub_dept->id], 2) }} @endisset @isset($vatLogRevenue['depts'][$dept->id]) {{ number_format($vatLogRevenue['depts'][$dept->id], 2) }} @endisset @isset($vatLogRevenue['total']) {{ number_format($vatLogRevenue['total'], 2) }} @endisset
Total Expense (VAT) @isset($vatLogExpense['subdepts'][$sub_dept->id]) {{ number_format($vatLogExpense['subdepts'][$sub_dept->id], 2) }} @endisset @isset($vatLogExpense['depts'][$dept->id]) {{ number_format($vatLogExpense['depts'][$dept->id], 2) }} @endisset @isset($vatLogExpense['total']) {{ number_format($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 {{ number_format($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 {{ number_format($tempPayable['dept'][$dept->id], 2) }} @endif @endisset @isset($totalVatPayable) @if($totalVatPayable > 0) {{ number_format($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 {{ number_format($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 {{ number_format($tempPercentage, 2) }}% @endif @endif @if(isset($totalPercentage)) {{ number_format(($totalPercentage > 100) ? '100.00' : $totalPercentage, 2) }}% @endif
@endif
@endsection @push('pageJs') @endpush