<?= message_box('success') ?>
<?= message_box('error') ?>

<?php
$edited = can_action('152', 'edited');
$deleted = can_action('152', 'deleted');
?>

<div class="space-y-4">
	<div class="rounded-2xl border border-border bg-card shadow-sm">
		<div class="table-responsive p-4">
			<table class="table table-striped DataTables" id="DataTables" cellspacing="0" width="100%">
				<thead>
					<tr>
						<th><?= lang('payment_date') ?></th>
						<th><?= lang('purchase') . ' ' . lang('date') ?></th>
						<th><?= lang('purchase') ?></th>
						<th><?= lang('supplier') ?></th>
						<th><?= lang('amount') ?></th>
						<th><?= lang('payment_method') ?></th>
						<?php if (!empty($edited) || !empty($deleted)) { ?>
						<th class="col-options no-sort hidden-print text-right"><?= lang('action') ?></th>
						<?php } ?>
					</tr>
				</thead>
				<tbody></tbody>
			</table>
		</div>
	</div>
</div>

<script>
	list = base_url + "admin/purchase/paymentList";
	window.erpDatatablePreload = window.erpDatatablePreload || {};
	window.erpDatatablePreload.DataTables = window.erpDatatablePreload.DataTables || {};
	<?php if (!empty($datatable_preload)) { ?>
	window.erpDatatablePreload.DataTables["list"] = <?= json_encode($datatable_preload, JSON_UNESCAPED_SLASHES) ?>;
	<?php } ?>
</script>
