<?= view('admin/layouts/header', ['title' => 'Edit Pembelian']) ?>
<?= view('admin/layouts/sidebar', [
    'activeMenu' => 'pembelian',
    'userName'   => $userName,
    'userEmail'  => $userEmail,
]) ?>
<?= view('admin/layouts/topbar', [
    'pageTitle'    => 'Edit Pembelian',
    'pageSubtitle' => 'Perbarui transaksi pembelian.',
    'topbarAction' => '<a href="' . site_url('admin/pembelian') . '" class="btn btn-outline-dark"><i class="bi bi-arrow-left me-1"></i>Kembali</a>',
]) ?>

<?= view('admin/pembelian/form', [
    'action'            => site_url('admin/pembelian/update/' . $transaksi['id']),
    'transaksi'         => $transaksi,
    'suplier'           => $suplier,
    'tanggalPembelian'      => $transaksi['tanggal_pembelian'],
    'noTransaksi'       => $transaksi['no_transaksi'],
    'initialItems'      => $initialItems,
    'totalDibayar'      => $totalDibayar ?? 0,
    'showInitialPayment' => $showInitialPayment ?? false,
    'submitLabel'       => 'Update Pembelian',
    'lookupUrl'         => site_url('admin/pembelian/barang/lookup'),
    'datatableUrl'      => site_url('admin/pembelian/barang/datatable'),
    'generateNumberUrl' => site_url('admin/pembelian/generate-number'),
]) ?>

<?= view('admin/layouts/footer') ?>
