Export Distribution report
This commit is contained in:
@@ -3,10 +3,15 @@
|
||||
|
||||
window.app.controller('DistributionReportController', DistributionReportController);
|
||||
|
||||
DistributionReportController.$inject = ['$scope', 'reportSvc'];
|
||||
function DistributionReportController($scope, reportSvc) {
|
||||
DistributionReportController.$inject = ['$scope', 'reportSvc', 'downloadSvc'];
|
||||
function DistributionReportController($scope, reportSvc, downloadSvc) {
|
||||
var vm = this;
|
||||
vm.loadData = reportSvc.loadDistributionReport;
|
||||
vm.query = reportSvc.distributionQuery;
|
||||
vm.distributionData = reportSvc.distributionData;
|
||||
vm.export = function (params) {
|
||||
reportSvc.exportDistributionReport(params)
|
||||
.success(downloadSvc.success);
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -4,11 +4,14 @@
|
||||
reportSvc.$inject = ['$http'];
|
||||
function reportSvc($http) {
|
||||
var distributionData = [];
|
||||
var distributionQuery = {};
|
||||
var movementData = {};
|
||||
|
||||
var svc = {
|
||||
distributionData: distributionData,
|
||||
distributionQuery: distributionQuery,
|
||||
loadDistributionReport: loadDistributionReport,
|
||||
exportDistributionReport: exportDistributionReport,
|
||||
movementData: movementData,
|
||||
loadMovementData: loadMovementData,
|
||||
exportMovementData: exportMovementData
|
||||
@@ -19,10 +22,15 @@
|
||||
function loadDistributionReport(query) {
|
||||
return $http.post('/Report/Distribution', query)
|
||||
.success(function (data) {
|
||||
distributionQuery = angular.copy(query, distributionQuery);
|
||||
angular.copy(data, distributionData);
|
||||
});
|
||||
}
|
||||
|
||||
function exportDistributionReport(query) {
|
||||
return $http.post('/Report/DistributionExcel', query, { responseType: 'arraybuffer' });
|
||||
}
|
||||
|
||||
function loadMovementData(query) {
|
||||
return $http.post('/Report/Movement', query)
|
||||
.success(function (data) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">Name</th>
|
||||
<th class="col-md-3">Units per Case</th>
|
||||
<th class="col-md-3">Name of Commodity</th>
|
||||
<th class="col-md-3">Units per Case / Container Type</th>
|
||||
<th class="col-md-2">Exp. Date</th>
|
||||
<th class="col-md-1">Case Qty</th>
|
||||
<th class="col-md-1">Unit Qty</th>
|
||||
@@ -19,7 +19,7 @@
|
||||
<td>{{transaction.expirationDate | date:'shortDate'}}</td>
|
||||
<td>{{transaction.removedQuantity}}</td>
|
||||
<td>{{transaction.removedQuantity * transaction.unitsPerCase}}</td>
|
||||
<td>{{transaction.weightPerCase * transaction.unitsPerCase | number:0 }} lbs</td>
|
||||
<td>{{transaction.weightPerCase * transaction.removedQuantity | number:0 }} lbs</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user