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

<?= view('admin/penjualan/form', [
    'action'             => site_url('admin/penjualan/update/' . $transaksi['id']),
    'transaksi'          => $transaksi,
    'pelanggan'          => $pelanggan,
    'tanggalPenjualan'   => $transaksi['tanggal_penjualan'],
    'noTransaksi'        => $transaksi['no_transaksi'],
    'initialItems'       => $initialItems,
    'totalDibayar'       => $totalDibayar ?? 0,
    'showInitialPayment' => $showInitialPayment ?? false,
    'pajakPersen'        => $transaksi['pajak_persen'] ?? 11,
    'submitLabel'        => 'Update Penjualan',
    'lookupUrl'          => site_url('admin/penjualan/barang/lookup'),
    'datatableUrl'       => site_url('admin/penjualan/barang/datatable'),
    'generateNumberUrl'  => site_url('admin/penjualan/generate-number'),
]) ?>

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