<div class="widget">
	<div class="widget-content">
		<div class="headline">
			<h4>Stock Reports</h4>
		</div>
		<br>
		<div class="form-inline">
			<div class="radio-inline">
				<strong class="muted">Records: </strong>
				<select name="items" ng-model="filters.limit" class="form-control">
					<option value="10">10</option>
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
				</select>
			</div>

			<select name="status_id" ng-model="filters.type" class="form-control">
            	<option value="">All reports </option>
            	<option value="mismatched">Mismatches</option>
            	<option value="matched">Matches</option>
            </select>

			<label class="checkbox-inline">
				<input type="checkbox" name="aknowledged" value="1" ng-model="filters.aknowledged">
				<strong class="muted">Aknowledged</strong>
			</label>

        	<div class="input-group pull-right">
				<input type="text" class="form-control" placeholder="Search" ng-model="filters.search" />
				<span class="input-group-addon">
					<i class="fa fa-search"></i>
				</span>
			</div>

		</div>

		<br>
		<table class="table table-striped">
			<thead class="table-header">
				<th>Reported At</th>
				<th>Type</th>
				<th width="20%">Stock Item</th>
				<th class="centered">In Stock</th>
				<th class="centered">Actual</th>
				<th class="centered">Reported By</th>
				<th width="10%"></th>
			</thead>
			<tbody>
				<tr ng-repeat="report in reports" ng-hide="filers.aknowledged == '0' && report.aknowledged == '1'">
					<td>{[{ report.created_at | fromNow }]}</td>
					<td>
						<span ng-show="report.old_quantity == report.new_quantity" class="label label-success">Match</span>
						<span ng-show="report.old_quantity != report.new_quantity" class="label label-danger">Missmatch</span>
					</td>
					<td>{[{ report.stock.name }]}</td>
					<td class="centered">{[{ report.old_quantity }]}</td>
					<td class="centered">{[{ report.new_quantity }]}</td>
					<td class="centered">{[{ report.user.name }]}</td>
					<td>
						<div class="pull-right">
							<span class="btn btn-warning" ng-hide=" report.aknowledged == '1' || report.old_quantity == report.new_quantity" ng-click="markAsAknowledged(report)" >Aknowledged</span>
						</div>
					</td>

				</tr>
			</tbody>
		</table>
		<div paginator="paginator"></div>
	</div>
</div>