2025-04-27 23:36:33 +07:00

78 lines
3.4 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="card">
<div class="card-header">
<h3>Detail Transaksi #{{ $transaksi->id }}</h3>
<p>Pasien: {{ $transaksi->registrasi->pasien->nama_pasien }}</p>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>Tindakan</th>
<th>Jumlah</th>
<th>Tarif Satuan</th>
<th>Subtotal</th>
</tr>
</thead>
<tbody>
@foreach ($transaksi->details as $detail)
<tr>
<td>{{ $detail->tindakan->nama_tindakan }}</td>
<td>{{ $detail->jumlah_tindakan }}</td>
<td>Rp {{ number_format($detail->tarif_satuan) }}</td>
<td>Rp {{ number_format($detail->subtotal) }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="3">Total</th>
<th>Rp {{ number_format($transaksi->total_tarif) }}</th>
</tr>
</tfoot>
</table>
<form action="{{ route('transaksi.bayar', $transaksi->id) }}" method="POST">
@csrf
<div class="form-group">
<label for="metode_pembayaran">Metode Pembayaran</label>
<select name="metode_pembayaran" class="form-control" required>
@foreach (['cash', 'transfer', 'debit', 'asuransi', 'qris'] as $metode)
<option value="{{ $metode }}"
{{ old('metode_pembayaran', $transaksi->metode_pembayaran) == $metode ? 'selected' : '' }}>
{{ ucfirst($metode) }}
</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="status_pembayaran">Status Pembayaran</label>
<select name="status_pembayaran" class="form-control" required>
<option value="belum lunas"
{{ old('status_pembayaran', $transaksi->status_pembayaran) == 'belum lunas' ? 'selected' : '' }}>
Belum Lunas</option>
<option value="lunas"
{{ old('status_pembayaran', $transaksi->status_pembayaran) == 'lunas' ? 'selected' : '' }}>
Lunas</option>
</select>
</div>
<div class="form-group">
<label for="tanggal_pembayaran">Tanggal Pembayaran</label>
<input type="date" name="tanggal_pembayaran" class="form-control"
value="{{ old('tanggal_pembayaran', $transaksi->tanggal_pembayaran ? \Carbon\Carbon::parse($transaksi->tanggal_pembayaran)->format('Y-m-d') : '') }}">
</div>
<button type="submit" class="btn btn-success my-3">
<i class="fas fa-money-bill-wave"></i> Proses Pembayaran
</button>
</form>
</div>
</div>
@endsection