@extends('layouts.portal.app') @section('content')
@if(Session::has('errorResponse'))
@endif
Download Vouchers
@if(Auth::user()->hasRole('Administrator') || Auth::user()->can('Administer Company') || Auth::user()->can('Prepaid-Vouchers.edit')) Add Voucher @endif
@php $companyServicePlans = \App\Models\CompanyServicePlan::whereCompanyId($activeCompany->id)->whereServicePlanId(1)->whereCompanyRouterId($activeCompanyRouter->id)->get(); @endphp
{{ $activeCompanyRouter->name }} - Which Voucher Plan?
@foreach($companyServicePlans as $companyServicePlan) @endforeach
@if(Auth::user()->hasRole('Administrator') || Auth::user()->hasRole('Client')) @endif @foreach($groupedCompanyPrepaidVouchers as $companyPrepaidVoucher) @php $activeCompanyPrepaidVouchers = \App\Models\CompanyPrepaidVoucher::whereRefNo($companyPrepaidVoucher->ref_no)->whereStatus(1)->count(); @endphp @if(Auth::user()->hasRole('Administrator') || Auth::user()->hasRole('Client')) @endif @include('portal.companies.prepaid-vouchers.vouchers') @endforeach
# Service Plan No. Vouchers Status Date Generated Actions
#{{ $companyPrepaidVoucher->ref_no }} {{ $companyPrepaidVoucher->companyServicePlan? $companyPrepaidVoucher->companyServicePlan->name: '' }} {{ number_format(count($companyPrepaidVoucher->details($companyPrepaidVoucher)['companyPrepaidVouchers'])) }} @if($activeCompanyPrepaidVouchers > 0) active @else used @endif {{ \Carbon\Carbon::parse($companyPrepaidVoucher->created_at)->format('Y F, jS l, h:i A') }} @if(Auth::user()->hasRole('Administrator') || Auth::user()->can('Administer Company') || Auth::user()->can('Prepaid-Vouchers.delete')) @endif
{{ $groupedCompanyPrepaidVouchers->render() }}
@include('portal.companies.prepaid-vouchers.create') @include('portal.companies.prepaid-vouchers.edit') @include('portal.companies.prepaid-vouchers.delete') @include('portal.companies.prepaid-vouchers.deactivate') @endsection