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