@using InventoryTraker.Web.Helpers
@model InventoryTraker.Web.Models.InventoryViewModel
@{
	var inventory = Html.Angular().ModelFor("inventory");
}

<table class="table table-striped">
    <thead>
    <tr>
        <th class="control-column"></th>
        <th>Name</th>
        <th>Units per Case</th>
        <th>Case Qty</th>
        <th>Unit Qty</th>
        <th>Exp Date</th>
        <th>Added Date</th>
        <th>Memo</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="inventory in vm.inventories">
        <td>
            <a href="" ng-click="vm.edit(inventory)" title="Details"><i class="fa fa-edit"></i></a>
        </td>
        <td>@inventory.BindingFor(x => x.Name)</td>
        <td>@inventory.BindingFor(x => x.UnitsPerCase) / @inventory.BindingFor(x => x.ContainerType)</td>
        <td>@inventory.BindingFor(x => x.Quantity)</td>
        <td>{{inventory.quantity * inventory.unitsPerCase}}</td>
        <td ng-class="{ danger: inventory.isExpired }">
            @inventory.BindingFor(x => x.ExpirationDate, "date:'shortDate'")
        </td>
        <td>@inventory.BindingFor(x => x.AddedDate, "date:'shortDate'")</td>
        <td>@inventory.BindingFor(x => x.Memo)</td>
    </tr>
   </tbody>
</table>
