@extends('layouts.app') @section('page_title','Calendar') @section('content')

Financial Calendar

Transactions and loan due dates by effective date.

@foreach(['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] as $d)
{{$d}}
@endforeach
@for($i=0;$i<$month->copy()->startOfMonth()->dayOfWeek;$i++)
@endfor @for($day=1;$day<=$month->daysInMonth;$day++) @php($dateKey=$month->copy()->day($day)->format('Y-m-d'))
{{$day}}
@foreach(($transactions[$dateKey]??collect())->take(3) as $t)
{{$t->type}} · ৳{{number_format($t->amount,0)}}
@endforeach @foreach($loans->where('due_date', $month->copy()->day($day)) as $l)
Loan due · {{$l->contact?->name}}
@endforeach
@endfor
@endsection