@php $type = class_basename($task->projectable_type ?? ''); @endphp @php use Carbon\Carbon; $durationText = ''; if ( $type === "Contract" ) { $start = Carbon::parse($task->projectable->start_date); $end = Carbon::parse($task->projectable->end_date); $diff = $start->diff($end); $totalDays = $start->diffInDays($end); $totalWeeks = floor($totalDays / 7); $totalMonths = $diff->m + ($diff->y * 12); if ($diff->y >= 1 && $diff->m == 0 && $diff->d == 0) { // Case 1: Exact year(s) $durationText = $diff->y . ' year' . ($diff->y > 1 ? 's' : ''); } elseif ($totalMonths >= 1 && $totalMonths < 12) { // Case 2: Show in months $durationText = $totalMonths . ' month' . ($totalMonths > 1 ? 's' : ''); } else { // Case 3: Less than 1 month OR non-exact year(s) → show in weeks $durationText = $totalWeeks . ' week' . ($totalWeeks > 1 ? 's' : ''); } } @endphp @if($task->featured_image)
{{ $task->projectable->company->name ?? '—' }}
Invoice ID:
Claim Number:
{{ $task->projectable->getFormatedId() ?? '—' }}
{{ $task->projectable->claim_number ?? '—' }}
Total
Paid
Unpaid
@cMoney($task->projectable->total_invoiced, $task->projectable->currency, true)
@cMoney($task->projectable->paid_amount, $task->projectable->currency, true)
@cMoney($task->projectable->remaining_unpaid, $task->projectable->currency, true)
Contract
Invoiced
Paid
Advance Payment
{{ money($task->projectable->value, $task->projectable->currency, true) }}
{{ money($task->projectable->total_invoiced, $task->projectable->currency, true) }}
{{ money($task->projectable->total_paid, $task->projectable->currency, true) }}
{{ money($task->projectable->advance_payment ?? 0, $task->projectable->currency, true) }}
Project: {{ $task->projectable->name ?? '-' }}
Description: {{ $task->projectable->description ?? '-' }}
Type: {{ $type }}
{{ $task->projectable->description ?? '-' }}
@endswitch