172 lines
10 KiB
PHP
172 lines
10 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Detail Billing')
|
|
|
|
@section('content')
|
|
<div class="container px-6 mx-auto grid">
|
|
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
|
Detail Billing #{{ $billing->IdBilling }}
|
|
</h2>
|
|
|
|
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
|
<!-- Header -->
|
|
<div class="flex justify-between items-center pb-4 border-b dark:border-gray-700">
|
|
<h4 class="text-lg font-semibold text-gray-600 dark:text-gray-300">
|
|
Informasi Billing
|
|
</h4>
|
|
<div class="flex space-x-2">
|
|
<a href="{{ route('billing.edit', $billing->IdBilling) }}"
|
|
class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-yellow-500 border border-transparent rounded-lg active:bg-yellow-600 hover:bg-yellow-600 focus:outline-none focus:shadow-outline-yellow">
|
|
Edit
|
|
</a>
|
|
<a href="{{ route('billing.index') }}"
|
|
class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-gray-600 border border-transparent rounded-lg active:bg-gray-600 hover:bg-gray-700 focus:outline-none focus:shadow-outline-gray">
|
|
Kembali
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Billing Information -->
|
|
<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div class="p-4 bg-gray-50 rounded-lg dark:bg-gray-700">
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">ID Billing</span>
|
|
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
|
{{ $billing->IdBilling }}
|
|
</div>
|
|
</div>
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">ID Registrasi</span>
|
|
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
|
{{ $billing->IdRegistrasi }}
|
|
</div>
|
|
</div>
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Tanggal Billing</span>
|
|
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
|
{{ date('d/m/Y', strtotime($billing->TanggalBilling)) }}
|
|
</div>
|
|
</div>
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Status Pembayaran</span>
|
|
<div class="mt-2">
|
|
@if ($billing->StatusPembayaran == 'Lunas')
|
|
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
|
Lunas
|
|
</span>
|
|
@else
|
|
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
|
|
Belum Lunas
|
|
</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Keterangan</span>
|
|
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
|
{{ $billing->Keterangan ?: '-' }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="p-4 bg-gray-50 rounded-lg dark:bg-gray-700">
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Biaya</span>
|
|
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
|
Rp {{ number_format($billing->TotalBiaya, 0, ',', '.') }}
|
|
</div>
|
|
</div>
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Sudah Dibayar</span>
|
|
<div class="mt-2 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
|
Rp {{ number_format($billing->Dibayar, 0, ',', '.') }}
|
|
</div>
|
|
</div>
|
|
<div class="mb-4">
|
|
<span class="text-sm font-medium text-gray-500 dark:text-gray-400">Sisa Pembayaran</span>
|
|
<div
|
|
class="mt-2 text-lg font-semibold text-{{ $billing->Sisa > 0 ? 'red' : 'green' }}-600 dark:text-{{ $billing->Sisa > 0 ? 'red' : 'green' }}-500">
|
|
Rp {{ number_format($billing->Sisa, 0, ',', '.') }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Additional Payment Form for unpaid billings -->
|
|
@if ($billing->StatusPembayaran == 'Belum Lunas')
|
|
<div class="mt-4 bg-blue-50 p-4 rounded-lg border border-blue-200 dark:bg-blue-700 dark:border-blue-800">
|
|
<h3 class="text-lg font-semibold mb-3 text-blue-700 dark:text-blue-300">Tambah Pembayaran</h3>
|
|
|
|
<form action="{{ route('billing.processPayment', $billing->IdBilling) }}" method="POST">
|
|
@csrf
|
|
<div class="flex items-end space-x-4">
|
|
<div class="flex-grow">
|
|
<label for="jumlah_bayar"
|
|
class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-1">Jumlah
|
|
Pembayaran (Rp)</label>
|
|
<input type="number" name="jumlah_bayar" id="jumlah_bayar" min="1"
|
|
max="{{ $billing->Sisa }}" value="{{ old('jumlah_bayar', $billing->Sisa) }}"
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-200"
|
|
required>
|
|
</div>
|
|
<button type="submit"
|
|
class="px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-blue-700 dark:hover:bg-blue-800">
|
|
Proses Pembayaran
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Transaksi Details -->
|
|
<div class="mt-6">
|
|
<h3 class="text-lg font-semibold mb-3 text-gray-700 dark:text-gray-300">Detail Transaksi</h3>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full bg-white border border-gray-200 dark:bg-gray-800 dark:border-gray-700">
|
|
<thead>
|
|
<tr class="bg-gray-100 dark:bg-gray-700">
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
ID Transaksi</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
Tindakan</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
Tarif</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
Jumlah</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
Subtotal</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 dark:divide-gray-600">
|
|
@forelse($transaksis as $transaksi)
|
|
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
<td class="px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $transaksi->IdTransaksi }}</td>
|
|
<td class="px-4 py-3 text-sm text-gray-900 dark:text-gray-100">
|
|
{{ $transaksi->tindakan->NamaTindakan ?? 'Unknown' }}</td>
|
|
<td class="px-4 py-3 text-sm text-gray-500 dark:text-gray-300">
|
|
Rp {{ number_format($transaksi->tindakan->TarifTindakan ?? 0, 0, ',', '.') }}
|
|
</td>
|
|
<td class="px-4 py-3 text-sm text-gray-500 dark:text-gray-300">
|
|
{{ $transaksi->JmlTindakan }}</td>
|
|
<td class="px-4 py-3 text-sm font-medium text-gray-900 dark:text-gray-100">
|
|
Rp
|
|
{{ number_format(($transaksi->tindakan->TarifTindakan ?? 0) * $transaksi->JmlTindakan, 0, ',', '.') }}
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5"
|
|
class="px-4 py-3 text-sm text-center text-gray-500 dark:text-gray-400">Tidak ada
|
|
data transaksi.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|