
<div class="modal-body">
	<?php echo form_open(base_url('admin/purchase/cloned_purchase/' . $purchase_info->purchase_id), array('class' => 'space-y-4', 'enctype' => 'multipart/form-data', 'data-parsley-validate' => '', 'role' => 'form')); ?>
	<?php
	$supplier_options = array();
	$supplier_selected = !empty($purchase_info->supplier_id) ? $purchase_info->supplier_id : '';
	if (!empty($all_supplier)) {
		foreach ($all_supplier as $v_supplier) {
			$supplier_options[$v_supplier->supplier_id] = $v_supplier->name;
		}
	}
	?>
	<?= form_select_group('supplier_id', lang('select') . ' ' . lang('supplier'), $supplier_options, $supplier_selected, true, array('class' => 'select_box', 'data-live-search' => 'true')); ?>
	<?= form_datepicker('purchase_date', lang('purchase') . ' ' . lang('date'), !empty($purchase_info->purchase_date) ? $purchase_info->purchase_date : date('Y-m-d'), true, array('data-auto-close' => 'true')); ?>
	<?= form_datepicker('due_date', lang('due_date'), !empty($purchase_info->due_date) ? $purchase_info->due_date : date('Y-m-d', strtotime('+' . config_item('invoices_due_after') . ' days')), false, array('data-auto-close' => 'true')); ?>

	<div class="flex items-center justify-end gap-2 pt-2">
		<button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted" data-dismiss="modal">
			<i data-lucide="x" class="h-4 w-4"></i>
			<?= lang('close') ?>
		</button>
		<button type="submit" class="inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-indigo-500">
			<i data-lucide="copy" class="h-4 w-4"></i>
			<?= lang('clone') ?>
		</button>
	</div>
	<?php echo form_close(); ?>
</div>
