show
This commit is contained in:
parent
1dc2887d95
commit
345c053ab2
|
@ -18,7 +18,8 @@ public function indexManualPayment(cekDenda $cekDenda, GenerateMonthlyBill $gene
|
|||
|
||||
|
||||
$santri = Santri::with([
|
||||
'payments.detailPayments.paymentType'
|
||||
'payments.detailPayments.paymentType',
|
||||
'user'
|
||||
])->get();
|
||||
|
||||
// $santri = Payment::with('detailPayments')->get();
|
||||
|
|
|
@ -31,7 +31,6 @@ public function index()
|
|||
],
|
||||
]);
|
||||
}
|
||||
public function create() {}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ export default function ManualPayment({ santri, penalty, bill, fields }) {
|
|||
<ModalInput fields={fields} tableName={['payments', 'detail_payments']} initialData={selectedSantri} onClose={() => setSelectedSantri(null)} />
|
||||
{santri && santri.length > 0 ? santri.map((item, i) => (
|
||||
<div key={i} className="p-4 border-b">
|
||||
<p>Nis: {item.user.nis}</p>
|
||||
<p><strong>Santri:</strong> {item.nama}</p>
|
||||
|
||||
{item.payments && item.payments.length > 0 ? (
|
||||
|
@ -37,7 +38,14 @@ export default function ManualPayment({ santri, penalty, bill, fields }) {
|
|||
|
||||
<div>
|
||||
<button className='btn btn-accent text-white mt-2' onClick={() => {
|
||||
setSelectedSantri(item)
|
||||
// console.log(item)
|
||||
setSelectedSantri({
|
||||
nama: item.nama,
|
||||
alamat: item.alamat,
|
||||
status_santri: item.status_santri,
|
||||
role_santri: item.role_santri,
|
||||
nis: item.user?.nis
|
||||
})
|
||||
document.getElementById('modal_input').checked = true
|
||||
}}>Bayar</button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue