Add commodity and quantity to input forms
This commit is contained in:
@@ -11,14 +11,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
controller.$inject = ['$scope', 'inventorySvc'];
|
||||
function controller($scope, inventorySvc) {
|
||||
controller.$inject = ['$scope', 'inventorySvc', 'inventoryTypeSvc'];
|
||||
function controller($scope, inventorySvc, inventoryTypeSvc) {
|
||||
var vm = this;
|
||||
vm.add = add;
|
||||
|
||||
vm.saving = false;
|
||||
vm.inventory = {};
|
||||
vm.inventoryTypes = inventoryTypeSvc.inventoryTypes;
|
||||
vm.errorMessage = null;
|
||||
vm.quantity = quantity;
|
||||
|
||||
function quantity() {
|
||||
vm.inventory.quantity =
|
||||
$scope.palletCount * $scope.casesPerPallet + $scope.caseCount;
|
||||
return vm.inventory.quantity;
|
||||
}
|
||||
|
||||
function add() {
|
||||
vm.saving = true;
|
||||
@@ -34,5 +42,10 @@
|
||||
vm.saving = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$watch('commodity', function (newValue, oldValue) {
|
||||
if (newValue)
|
||||
vm.inventory.inventoryTypeId = newValue.id;
|
||||
});
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user