@php if(Auth::user()->franchise && Auth::user()->franchise->countries && Auth::user()->franchise->countries->currency_code) $currencyCode = Auth::user()->franchise->countries->currency_code; else $currencyCode = 'TZS'; @endphp @foreach($taxList->sortBy('tax_title') as $tax) @endforeach @foreach($taxList->sortBy('tax_title') as $tax) @if($tax->tax_title == 'Withholding Tax') @elseif($tax->tax_title !== 'VAT') @endif @endforeach @foreach($paymentVoucherList as $paymentVoucher) @php $whtAmount = 0; @endphp @foreach($taxList->sortBy('tax_title') as $tax) @php $taxValue = $paymentVoucher->taxes->where('tax_title', $tax->tax_title)->first(); if($tax->tax_title == 'Withholding Tax') $whtAmount = $paymentVoucher->total_amount_converted * $taxValue->tax_value / 100; @endphp @endforeach @if($whtAmount != 0) @if($paymentVoucher->certificate) @php $bgclr = '#c3e6cb'; @endphp @else @php $bgclr = '#ffeeba'; @endphp @endif @else @php $bgclr = '#c3e6cb'; @endphp @endif @foreach($taxList->sortBy('tax_title') as $tax) @php $taxValue = $paymentVoucher->taxes->where('tax_title', $tax->tax_title)->first(); if($tax->tax_title == 'Withholding Tax') $whtAmount = $paymentVoucher->total_amount_converted * $taxValue->tax_value / 100; @endphp @endforeach @php $conversion_rate = ($paymentVoucher->currency == 'USD') ? $paymentVoucher->conversion_rate: 1; $accounts = $paymentVoucher->splits->groupBy('account')->mapWithKeys(function ($group, $key) use($conversion_rate) { return [ $key => $group->sum('amount') * $conversion_rate]; })->all(); @endphp @endforeach
Start Date {{ $dates[0] }} End Date {{ $dates[1] }} Total Accounts
PV Date PV Pay Date PV NO Company Description TZS USD Xrate TZS Total{{ ($tax->tax_title == 'Withholding Tax') ? 'WHT' : $tax->tax_title }} (%)WHT Amount WHT Status WHT Outstanding Cost of Goods Sold Human Capital Operational Expense Investment Tax
{{ $paymentVoucher->pv_date_formatted_full }} {{ $paymentVoucher->date_collected_formatted_full }} {{ $paymentVoucher->pv_serial_number }} {{ $paymentVoucher->company->name ?? '' }} {{ $paymentVoucher->description }} @if($paymentVoucher->currency == $currencyCode) {{ round($paymentVoucher->total_amount, 2) }} @endif @if($paymentVoucher->currency == 'USD') {{ round($paymentVoucher->total_amount, 2) }} @endif @if($paymentVoucher->currency == 'USD') {{ round($paymentVoucher->conversion_rate, 2) }} @endif {{ round($paymentVoucher->total_amount_converted, 2) }}{{ $taxValue->tax_value ?? '-' }}{{ ($whtAmount != 0) ? round($whtAmount, 2) : '-' }} {{ ($whtAmount != 0) ? ($paymentVoucher->certificate ? 'Paid' : 'Not Paid') : '-' }} {{ ($whtAmount != 0) ? ($paymentVoucher->certificate ? '-' : round($whtAmount, 2)) : '-' }}{{ isset($accounts['cost_of_goods_sold']) ? round($accounts['cost_of_goods_sold'], 2) : '-' }} {{ isset($accounts['human_capital']) ? round($accounts['human_capital'], 2) : '-' }} {{ isset($accounts['operational_expense']) ? round($accounts['operational_expense'], 2) : '-' }} {{ isset($accounts['investment']) ? round($accounts['investment'], 2) : '-' }} {{ isset($accounts['tax']) ? round($accounts['tax'], 2) : '-' }}