No | Bayar | {{--Kota | --}}Supplier | No Nota | Tanggal | {{--Tenggat | --}}Grand Total | Status | Jumlah Terbayar | Sisa | |
---|---|---|---|---|---|---|---|---|---|---|---|
{{ $loop->iteration }} | @if(Auth::user()->role_id == 1)@else | - | @endif {{--{{ $item->supplier->kota ?? '-' }} | --}}{{ $item->supplier->nama_perusahaan ?? '-' }} | {{ $item->no_faktur ?? '-' }} | {{ date('d-m-Y', strtotime($item->tanggal_faktur)) ?? '-' }} | {{--{{ date('d-m-Y', strtotime($item->tanggal_faktur . ' + ' . $item->supplier->tenggat_pembayaran . ' days')) ?? '-' }} --}} | Rp {{ number_format($item->total_harga, 0, ',', '.') ?? '-' }} | {{ str_replace('_', ' ', $item->status_pembayaran) ?? '-' }} |
@php
$termin1 = $item->pembayarans
->where('status_pembayaran', 'Termin 1')
->sum('jumlah_bayar');
$termin2 = $item->pembayarans
->where('status_pembayaran', 'Termin 2')
->sum('jumlah_bayar');
$lunas = $item->pembayarans
->where('status_pembayaran', 'Lunas')
->sum('jumlah_bayar');
@endphp
@if ($termin1 > 0)
Termin 1: Rp {{ number_format($termin1, 0, ',', '.') }} @endif @if ($termin2 > 0) Termin 2: Rp {{ number_format($termin2, 0, ',', '.') }} @endif @if ($lunas > 0) Lunas: Rp {{ number_format($lunas, 0, ',', '.') }} @endif @if ($termin1 == 0 && $termin2 == 0 && $lunas == 0) - @endif |
Rp {{ number_format($item->sisa, 0, ',', '.') ?? '-' }} |