@php $addFollowUpPermission = user()->permission('add_invoice_follow_up'); $viewFollowUpPermission = user()->permission('view_invoice_follow_up'); $editFollowUpPermission = user()->permission('edit_invoice_follow_up'); $deleteFollowUpPermission = user()->permission('delete_invoice_follow_up'); $invoiceFollowUps = $invoiceFollowUps ?? collect(); @endphp
@if ($invoice->status == 'paid') @lang('messages.cantAddFollowup') @endif @if ($invoice->status != 'paid' && ($addFollowUpPermission == 'all' || $addFollowUpPermission == 'added')) @endif
@if ($viewFollowUpPermission == 'all' || $viewFollowUpPermission == 'added') @lang('app.createdOn') @lang('modules.lead.nextFollowUp') @lang('app.remark') @lang('app.status') @lang('app.action') @forelse ($invoiceFollowUps as $followUp) {{ $followUp->created_at->timezone(company()->timezone)->format(company()->date_format . ' ' . company()->time_format) }} {{-- {{ $followUp->next_follow_up_date->format(company()->date_format . ' ' . company()->time_format) }} --}} @if (!$followUp->next_follow_up_date) -- @else @php $date = \Carbon\Carbon::parse($followUp->next_follow_up_date) ->timezone(company()->timezone); $formatted = $date->translatedFormat(company()->date_format) . '
' . $date->translatedFormat(company()->time_format); $currentDate = now()->timezone(company()->timezone); if ($date->toDateString() < $currentDate && $followUp->status == 'pending' ) { // $formatted .= '
'; $formatted = '' . $formatted . ''; } echo $formatted; @endphp @endif {{ $followUp->remark }} @if ($editFollowUpPermission == 'all' || ($editFollowUpPermission == 'added' && $followUp->added_by == user()->id)) @else @if ($followUp->status == 'pending') @elseif ($followUp->status == 'canceled') @elseif ($followUp->status == 'completed') @endif {{ ucfirst($followUp->status) }} @endif @empty @endforelse
@endif