@extends('layouts.portal.app') @section('content')
@if(Session::has('errorResponse'))
@endif
@hasrole('Administrator') @endhasrole @if($status == 0) @endif @foreach($companyCustomerInvoices as $companyCustomerInvoice) @hasrole('Administrator') @endhasrole @if($status == 0) @endif @include('portal.companies.invoices.summary') @endforeach
# Customer Period Amount Date Created Actions
#{{ $companyCustomerInvoice->ref_no }} @if($companyCustomerInvoice->RemainingAmount > 0) @endif {{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->names: '' }} @if($companyCustomerInvoice->companyCustomer && $companyCustomerInvoice->companyCustomer->phone != "")
{{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->phone: '' }} @endif
{{ \Carbon\Carbon::parse($companyCustomerInvoice->from_date)->format('d M Y') }} To {{ \Carbon\Carbon::parse($companyCustomerInvoice->to_date)->format('d M Y') }} Expected: Tsh {{ number_format($companyCustomerInvoice->amount) }}
Bal: Tsh {{ number_format($companyCustomerInvoice->RemainingAmount, 2) }}
{{ \Carbon\Carbon::parse($companyCustomerInvoice->created_at)->format('d M Y') }} @if($companyCustomerInvoice->RemainingAmount > 0 && (Auth::user()->hasRole('Administrator') || Auth::user()->can('Administer Company') || Auth::user()->can('Invoices.record_payments'))) @endif @if($companyCustomerInvoice->RemainingAmount > 0 && \Carbon\Carbon::parse($companyCustomerInvoice->created_at)->isCurrentMonth() && (Auth::user()->hasRole('Administrator') || Auth::user()->can('Administer Company') || Auth::user()->can('Invoices.edit'))) @endif @if(count($companyCustomerInvoice->companyCustomerInvoicePayments) == 0 && (Auth::user()->hasRole('Administrator') || Auth::user()->can('Administer Company') || Auth::user()->can('Invoices.delete'))) @endif
{{ $companyCustomerInvoices->render() }}
@include('portal.companies.invoices.edit') @include('portal.companies.invoices.delete') @include('portal.companies.invoices.payments.create')
@endsection