<!-- 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">Sales 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">Sales 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/sales-return-save" class="btn btn-block bg-gradient-primary"><i class="fa fa-plus"></i>&nbsp;&nbsp;&nbsp;<strong>Add New Sales Return</strong></a>
			</div>
		</div>

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

					<div class="card-body">
						<table id="data-table" class="table table-bordered table-hover">
							<thead>
								<tr>
									<th>Sales Return No</th>
									<th>Sales Return Date</th>
									<th>Customer</th>
									<th>Total Qty.</th>
									<th>Total Amount</th>
									<th class="col-md-2 text-center">Action</th>
								</tr>
							</thead>
							<tbody>
								<?php foreach ( $sales_returns as $sales_return ): ?>
									<tr>
										<td><a href="inventory/sales-return-preview/<?php echo $sales_return['sales_return_no']; ?>"><strong><?php echo $sales_return['sales_return_no']; ?></strong></a></td>
										<td><?php echo date( 'jS M, Y ', strtotime( $sales_return['sales_return_date'] ) ); ?></td>
										<td><?php echo $sales_return['customer_name']; ?></td>
										<td><?php echo $sales_return['item_qty']; ?></td>
										<td><?php echo number_format( $sales_return['amount'], 2 ); ?></td>
										<td class="col-md-2 text-center">
											<a class="btn-sm btn-warning" href="inventory/sales-save/<?php echo $sales_return['id']; ?>"><i class="fa fa-edit"></i> Edit</a>
											<a class="btn-sm btn-danger del" href="inventory/sales-delete/<?php echo $sales_return['id']; ?>"><i class="fa fa-remove"></i> Delete</a>
										</td>
									</tr>
								<?php endforeach;?>
							</tbody>
							<tfoot>
								<tr>
									<th>Sales Return No</th>
									<th>Sales Return Date</th>
									<th>Customer</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>