Chore: Changed layout to confirm better with the Style Guide
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
var PurchaseEntriesController = ['$scope', '$location', 'asDateFilter', 'purchaseEntries', 'uibDateParser', function ($scope, $location, asDate, purchaseEntries, dateParser) {
|
||||
var _info_StartDate = dateParser.parse(purchaseEntries.StartDate, "dd-MMM-yyyy"),
|
||||
_info_FinishDate = dateParser.parse(purchaseEntries.FinishDate, "dd-MMM-yyyy");
|
||||
$scope.info_StartDate = function (value) {
|
||||
if (arguments.length) {
|
||||
$scope.info.StartDate = asDate(value);
|
||||
_info_StartDate = value;
|
||||
}
|
||||
return _info_StartDate;
|
||||
};
|
||||
$scope.info_FinishDate = function (value) {
|
||||
if (arguments.length) {
|
||||
$scope.info.FinishDate = asDate(value);
|
||||
_info_FinishDate = value;
|
||||
}
|
||||
return _info_FinishDate;
|
||||
};
|
||||
$scope.info = purchaseEntries;
|
||||
|
||||
$scope.show = function () {
|
||||
$location.path('/PurchaseEntries').search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
|
||||
};
|
||||
$scope.foDate = true;
|
||||
}];
|
||||
|
||||
PurchaseEntriesController.resolve = {
|
||||
purchaseEntries: ['$route', 'PurchaseEntries', function ($route, PurchaseEntries) {
|
||||
var startDate = $route.current.params.StartDate,
|
||||
finishDate = $route.current.params.FinishDate;
|
||||
|
||||
if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) {
|
||||
return PurchaseEntries.get({}).$promise;
|
||||
} else {
|
||||
return PurchaseEntries.get({StartDate: startDate, FinishDate: finishDate}).$promise;
|
||||
}
|
||||
}]
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
<form class="form-horizontal" role=form autocomplete="off">
|
||||
<h2>Purchase Entries</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="txtStartDate" class="col-md-2 control-label">Date</label>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="txtStartDate" type="text" uib-datepicker-popup="dd-MMM-yyyy"
|
||||
is-open="sdOpen" ng-focus="sdOpen = true" ng-model="info_StartDate" focus-on="foDate"
|
||||
ng-model-options="{getterSetter: true}"/>
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<input type="text" id="txtFinishDate" class="form-control" uib-datepicker-popup="dd-MMM-yyyy"
|
||||
is-open="fdOpen" ng-focus="fdOpen = true" ng-model="info_FinishDate"
|
||||
ng-model-options="{getterSetter: true}"/>
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button class="btn btn-info" ng-click="show()">Show <i class="glyphicon glyphicon-eye-open"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-condensed table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Supplier</th>
|
||||
<th>Product</th>
|
||||
<th class="text-right">Quantity</th>
|
||||
<th class="text-right">Rate</th>
|
||||
<th class="text-right">Tax</th>
|
||||
<th class="text-right">Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="items in info.Body">
|
||||
<tr ng-repeat="item in items.Products">
|
||||
<td ng-if="$first" rowspan="{{items.Products.length}}" class="no-wrap">{{items.Date}}</td>
|
||||
<td ng-if="$first" rowspan="{{items.Products.length}}"><a href="{{items.Url}}">{{items.Supplier}}</a></td>
|
||||
<td>{{item.Product}}</td>
|
||||
<td class="text-right">{{item.Quantity | number:2}}</td>
|
||||
<td class="text-right">{{item.Rate | currency}}</td>
|
||||
<td class="text-right">{{item.Tax | percent}}</td>
|
||||
<td class="text-right">{{item.Amount | currency}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
Reference in New Issue
Block a user