Inventory and Type reports

This commit is contained in:
2016-09-22 14:14:12 -04:00
parent 02555eba7e
commit 9f50a4635c
19 changed files with 426 additions and 191 deletions
@@ -3,14 +3,14 @@
window.app.controller('InventoryListController', InventoryListController);
InventoryListController.$inject = ['$uibModal', 'inventorySvc'];
function InventoryListController($uibModal, inventorySvc) {
InventoryListController.$inject = ['$uibModal', 'inventorySvc', 'downloadSvc'];
function InventoryListController($uibModal, inventorySvc, downloadSvc) {
var vm = this;
vm.add = add;
vm.distribute = distribute;
vm.inventories = inventorySvc.inventories;
function add() {
$uibModal.open({
template: '<inventory-add />',
@@ -24,5 +24,10 @@
backdrop: 'static'
});
}
vm.export = function () {
inventorySvc.exportInventory()
.success(downloadSvc.success);
}
}
})();
@@ -15,7 +15,8 @@
inventories: inventories,
get: get,
refresh: refresh,
find: find
find: find,
exportInventory: exportInventory
};
return svc;
@@ -27,6 +28,10 @@
});
}
function exportInventory() {
return $http.post('/Inventory/Export', {}, { responseType: 'arraybuffer' });
}
function add(inventory) {
return $http.post('/Inventory/Add', inventory)
.success(function(inventory) {