<!-- Content Header (Page header) -->
<section class="content-header">
	<div class="container-fluid">
		<div class="row mb-2">
			<div class="col-sm-6">
				<h1 class="m-0">Purchase Return</h1>
			</div>

			<div class="col-sm-6">
				<ol class="breadcrumb float-sm-right">
					<li class="breadcrumb-item"><a href="dashboard">Dashboard</a></li>
					<li class="breadcrumb-item"><a href="inventory">Inventory</a></li>
					<li class="breadcrumb-item active">Purchase Return</li>
				</ol>
			</div>
		</div>
	</div>
</section>

<!-- Main content -->
<section class="content">
	<div class="container-fluid">
		<div class="row mb-4">
			<div class="col-md-12">
				<?php $this->load->view( 'flash_message' );?>
			</div>

			<div class="col-lg-3 col-md-6">
				<a href="inventory/purchase-return-save" class="btn btn-block bg-gradient-primary"><i class="fa fa-plus"></i>&nbsp;&nbsp;&nbsp;<strong>Add New Purchase Return</strong></a>
			</div>
		</div>

		<div class="row">
			<div class="col-12">
				<div class="card">
					<div class="card-header">
						<h3 class="card-title">Purchase Return List</h3>
					</div>

					<div class="card-body">
						<table id="data-table" class="table table-bordered table-hover">
							<thead>
								<tr>
									<th>Purchase Return No</th>
									<th>Purchase Return Date</th>
									<th>Supplier</th>
									<th>Total Qty.</th>
									<th>Total Amount</th>
									<th class="col-md-2 text-center">Action</th>
								</tr>
							</thead>
							<tbody>
								<?php foreach ( $purchase_returns as $purchase_return ): ?>
									<tr>
										<td><a href="inventory/purchase-return-preview/<?php echo $purchase_return['purchase_return_no']; ?>"><strong>
											<?php echo $purchase_return['purchase_return_no']; ?></strong></a>
										</td>
										<td><?php echo date( 'jS M, Y ', strtotime( $purchase_return['purchase_return_date'] ) ); ?></td>
										<td><?php echo $purchase_return['supplier_name']; ?></td>
										<td><?php echo $purchase_return['total_qty']; ?></td>
										<td><?php echo number_format( $purchase_return['total_price'], 2 ); ?></td>
										<td class="col-md-2 text-center">
											<a class="btn-sm btn-warning" href="inventory/purchase-return-save/<?php echo $purchase_return['id']; ?>"><i class="ion-edit"></i> Edit</a>
											<a class="btn-sm btn-danger del" href="inventory/purchase-return-delete/<?php echo $purchase_return['id']; ?>"><i class="ion-trash-b"></i> Delete</a>
										</td>
									</tr>
								<?php endforeach;?>
							</tbody>
							<tfoot>
								<tr>
									<th>Purchase Return No</th>
									<th>Purchase Return Date</th>
									<th>Supplier</th>
									<th>Total Qty.</th>
									<th>Total Amount</th>
									<th class="col-md-2 text-center">Action</th>
								</tr>
							</tfoot>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>