@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
Start Date | {{ $dates[0] }} | End Date | {{ $dates[1] }} | Total | Accounts | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PV Date | PV Pay Date | PV NO | Company | Description | TZS | USD | Xrate | TZS Total | @foreach($taxList->sortBy('tax_title') as $tax){{ ($tax->tax_title == 'Withholding Tax') ? 'WHT' : $tax->tax_title }} (%) | @endforeach @foreach($taxList->sortBy('tax_title') as $tax) @if($tax->tax_title == 'Withholding Tax')WHT Amount | WHT Status | WHT Outstanding | @elseif($tax->tax_title !== 'VAT')@endif @endforeach | 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) }} | @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{{ $taxValue->tax_value ?? '-' }} | @endforeach{{ ($whtAmount != 0) ? round($whtAmount, 2) : '-' }} | {{ ($whtAmount != 0) ? ($paymentVoucher->certificate ? 'Paid' : 'Not Paid') : '-' }} | {{ ($whtAmount != 0) ? ($paymentVoucher->certificate ? '-' : round($whtAmount, 2)) : '-' }} | @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{{ 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) : '-' }} |