Remove inventory, delete transactions
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
pageSizes: [20,50,100],
|
||||
sort: null
|
||||
};
|
||||
|
||||
|
||||
vm.gridOptions = {
|
||||
enablePaginationControls: true,
|
||||
paginationPageSize: paginationOptions.pageSize,
|
||||
@@ -65,12 +65,15 @@
|
||||
updateData();
|
||||
|
||||
$scope.editInventory = function (inventoryId) {
|
||||
inventorySvc.getInventory(inventoryId)
|
||||
inventorySvc.find(inventoryId)
|
||||
.success(function(inventory) {
|
||||
$uibModal.open({
|
||||
template: '<edit-inventory inventory="inventory" />',
|
||||
scope: angular.extend($scope.$new(true), { inventory: inventory })
|
||||
});
|
||||
template: '<edit-inventory inventory="inventory" />',
|
||||
scope: angular.extend($scope.$new(true), { inventory: inventory })
|
||||
})
|
||||
.closed.then(function() {
|
||||
updateData();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
(function() {
|
||||
window.app.factory('transactionSvc', transactionSvc);
|
||||
|
||||
transactionSvc.$inject = ['$http'];
|
||||
function transactionSvc($http) {
|
||||
transactionSvc.$inject = ['$http', 'inventorySvc'];
|
||||
function transactionSvc($http, inventorySvc) {
|
||||
|
||||
var svc = {
|
||||
filterByPage: filterByPage,
|
||||
filterByInventoryId: filterByInventoryId
|
||||
filterByInventoryId: filterByInventoryId,
|
||||
deleteTransaction: deleteTransaction
|
||||
};
|
||||
|
||||
return svc;
|
||||
@@ -20,10 +21,17 @@
|
||||
}
|
||||
|
||||
function getTransactions(params) {
|
||||
var url = '/Transaction/GetTransactions';
|
||||
var url = '/Transaction/Get';
|
||||
return $http.post(url, params)
|
||||
.success(function (data) {
|
||||
});
|
||||
}
|
||||
|
||||
function deleteTransaction(transactionId) {
|
||||
return $http.post('/Transaction/Delete', { transactionId: transactionId })
|
||||
.success(function (data) {
|
||||
inventorySvc.refresh(data.inventoryId);
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user