Inventory details

This commit is contained in:
2016-09-02 12:33:38 -04:00
parent f5e438e994
commit 9cdf90b1e9
18 changed files with 206 additions and 171 deletions
@@ -1,30 +0,0 @@
@using InventoryTraker.Web.Helpers
@model InventoryTraker.Web.Models.InventoryViewModel
@{
var inventory = Html.Angular().ModelFor("inventory");
}
<table class="table">
<thead>
<tr>
<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()"><i class="fa fa-edit"></i></a> @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>@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>
@@ -23,10 +23,15 @@
@distribution.FormGroupFor(m => m.Destination)
<table class="table" ng-class="vm.getValidationClass()">
@distribution.FormGroupFor(m => m.DistributedDate)
@distribution.FormGroupFor(m => m.Memo)
<table class="table table-condensed" ng-class="vm.getValidationClass()">
<thead>
<tr>
<th>Name<br/>Units per Case<br/>Expiration Date</th>
<th>Name<br/>Units per Case</th>
<th>Expiration Date</th>
<th>Available Case Qty</th>
<th>Distribute Case Qty</th>
</tr>
@@ -34,13 +39,13 @@
<tbody>
<tr ng-repeat="inventory in vm.quantities" inventory="inventory">
<td>
{{inventory.name}}<br />
{{inventory.name}}<br/>
{{inventory.unitsPerCase}} / {{inventory.containerType}}<br/>
Exp: {{inventory.expirationDate | date:'shortDate'}}
</td>
<td>{{inventory.expirationDate | date:'shortDate'}}</td>
<td>{{inventory.quantity}}</td>
<td>
<div class="form-group col-sm-7" form-group-validation="DistributeQuantity{{inventory.name}}">
<div class="form-group col-sm-9" form-group-validation="DistributeQuantity{{inventory.name}}">
<input name="DistributeQuantity{{inventory.name}}" type="number"
class="form-control"
ng-model="inventory.distributeQuantity"
@@ -53,10 +58,6 @@
</table>
@distribution.FormGroupFor(m => m.DistributedDate)
@distribution.FormGroupFor(m => m.Memo)
</div>
<div class="modal-footer">
@@ -6,25 +6,56 @@
<fieldset ng-disabled="vm.saving">
<div class="modal-header">
<h3 class="modal-title"><i class="fa fa-cubes"></i> Edit Inventory</h3>
<h3 class="modal-title"><i class="fa fa-cubes"></i> Inventory Details</h3>
</div>
<div class="modal-body">
<div class="alert alert-info" ng-hide="vm.errorMessage != null">
Make changes to the inventory below.
</div>
<div class="alert alert-danger" ng-show="vm.errorMessage != null">
{{vm.errorMessage}}
</div>
@Html.Angular().FormForModel("vm.inventory")
<dl class="dl-horizontal">
<dt>Name</dt>
<dd>{{vm.inventory.name}}</dd>
<dt>Added</dt>
<dd>{{vm.inventory.addedDate | date:'shortDate'}}</dd>
<dt>Expiration</dt>
<dd>{{vm.inventory.expirationDate | date:'shortDate'}}</dd>
</dl>
</div>
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Memo</th>
<th>Transaction Date</th>
<th>Add Qty</th>
<th>Remove Qty</th>
<th>Qty</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="transaction in vm.transactions | orderBy:'-transactionDate'">
<td>{{transaction.transactionType}}</td>
<td>{{transaction.memo}}</td>
<td>{{transaction.transactionDate | date:'shortDate'}}</td>
<td>{{transaction.addedQuantity}}</td>
<td>{{transaction.removedQuantity}}</td>
<td>{{transaction.currentQuantity}}</td>
<td><a href="" ng-show="$first"><i class="fa fa-trash"></i></a></td>
</tr>
</tbody>
</table>
<div >
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success">Save</button>
<button type="button" class="btn btn-warning" ng-click="$parent.$dismiss()">Cancel</button>
<button type="button" class="btn" ng-click="$parent.$dismiss()">Cancel</button>
</div>
</fieldset>
@@ -0,0 +1,34 @@
@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)"><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>