anu
This commit is contained in:
parent
345c053ab2
commit
4a765b28d9
|
@ -4,10 +4,7 @@ import ModalInput from '@/Components/ModalInput';
|
|||
|
||||
export default function ManualPayment({ santri, penalty, bill, fields }) {
|
||||
const [selectedSantri, setSelectedSantri] = useState(null);
|
||||
|
||||
return (
|
||||
|
||||
|
||||
<div className='text-red-500'>
|
||||
<Head title="Manual Payment" />
|
||||
<ModalInput fields={fields} tableName={['payments', 'detail_payments']} initialData={selectedSantri} onClose={() => setSelectedSantri(null)} />
|
||||
|
@ -21,16 +18,53 @@ export default function ManualPayment({ santri, penalty, bill, fields }) {
|
|||
<p className="font-semibold">Payments:</p>
|
||||
{item.payments.map((payment) => (
|
||||
<div key={payment.id} className="ml-4">
|
||||
{payment.detail_payments && payment.detail_payments.length > 0 ? (
|
||||
<ul className="ml-6 list-disc">
|
||||
{payment.detail_payments.map((detail) => (
|
||||
<li key={detail.id}>
|
||||
{detail.penalty ? `Denda: Rp ${detail.penalty}` : 'Tidak ada denda'}
|
||||
<p>{detail.status}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : <p className="ml-4 text-gray-500">Tidak ada detail pembayaran.</p>}
|
||||
{/* {payment.detail_payments && payment.detail_payments.length > 0 ? ( */}
|
||||
|
||||
{payment.detail_payments.map((detail) => (
|
||||
<div key={detail.id}>
|
||||
<p>{detail.penalty ? `Denda: Rp ${detail.penalty}` : 'Tidak ada denda'}</p>
|
||||
<p>{detail.status}</p>
|
||||
|
||||
<label htmlFor="my_modal_7" className="btn">show pembayaran</label>
|
||||
|
||||
<input type="checkbox" id="my_modal_7" className="modal-toggle" />
|
||||
<div className="modal" role="dialog">
|
||||
<div className="modal-box">
|
||||
<h3 className="text-lg font-bold">data pembayaran</h3>
|
||||
<p className="py-4">{detail.payment_type?.payment_type}</p>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>tipe pembayaran</th>
|
||||
<th>tahun</th>
|
||||
<th>bulan</th>
|
||||
<th>denda</th>
|
||||
<th>status pemabayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{detail.payment_type?.payment_type}</th>
|
||||
<td className='text-center'>{detail.payment_year}</td>
|
||||
<td className='text-center'>{detail.payment_month}</td>
|
||||
<td className='text-center'>{detail.penalty}</td>
|
||||
<td className='text-center'>
|
||||
<div className='p-2 bg-red-600 text-white rounded-md'>
|
||||
{detail.status}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<label className="modal-backdrop" htmlFor="my_modal_7">Close</label>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{/* ) : <p className="ml-4 text-gray-500">Tidak ada detail pembayaran.</p>} */}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
@ -38,7 +72,6 @@ export default function ManualPayment({ santri, penalty, bill, fields }) {
|
|||
|
||||
<div>
|
||||
<button className='btn btn-accent text-white mt-2' onClick={() => {
|
||||
// console.log(item)
|
||||
setSelectedSantri({
|
||||
nama: item.nama,
|
||||
alamat: item.alamat,
|
||||
|
|
Loading…
Reference in New Issue