Inventory and Type reports
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
window.app.controller('InventoryTypeController', InventoryTypeController);
|
||||
|
||||
InventoryTypeController.$inject = ['$uibModal', 'inventoryTypeSvc'];
|
||||
function InventoryTypeController($uibModal, inventoryTypeSvc) {
|
||||
InventoryTypeController.$inject = ['$uibModal', 'inventoryTypeSvc', 'downloadSvc'];
|
||||
function InventoryTypeController($uibModal, inventoryTypeSvc, downloadSvc) {
|
||||
var vm = this;
|
||||
|
||||
vm.add = add;
|
||||
@@ -24,5 +24,10 @@
|
||||
backdrop: 'static'
|
||||
});
|
||||
}
|
||||
|
||||
vm.export = function () {
|
||||
inventoryTypeSvc.exportInventoryTypes()
|
||||
.success(downloadSvc.success);
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -10,7 +10,8 @@
|
||||
var svc = {
|
||||
add: add,
|
||||
update: update,
|
||||
inventoryTypes: inventoryTypes
|
||||
inventoryTypes: inventoryTypes,
|
||||
exportInventoryTypes: exportInventoryTypes
|
||||
};
|
||||
|
||||
return svc;
|
||||
@@ -22,6 +23,10 @@
|
||||
});
|
||||
}
|
||||
|
||||
function exportInventoryTypes() {
|
||||
return $http.post('/InventoryType/Export', {}, { responseType: 'arraybuffer' });
|
||||
}
|
||||
|
||||
function add(inventoryType) {
|
||||
return $http.post('/InventoryType/Add', inventoryType)
|
||||
.success(function (inventoryType) {
|
||||
|
||||
Reference in New Issue
Block a user