-
+
@@ -27,9 +27,9 @@
- @removeForm.FormGroupFor(m => m.Quantity)
@removeForm.FormGroupFor(m => m.RemovedDate)
@removeForm.FormGroupFor(m => m.Memo)
diff --git a/InventoryTraker.Web/js/inventoryType/InventoryTypeAddDirective.js b/InventoryTraker.Web/js/inventoryType/InventoryTypeAddDirective.js
deleted file mode 100644
index f6dba5d..0000000
--- a/InventoryTraker.Web/js/inventoryType/InventoryTypeAddDirective.js
+++ /dev/null
@@ -1,40 +0,0 @@
-(function() {
- "use strict";
-
- window.app.directive("inventoryTypeAdd",
- function() {
- return {
- templateUrl: "/inventoryType/template/inventoryTypeAdd.tmpl.cshtml",
- controller: controller,
- controllerAs: "vm"
- };
- });
-
- controller.$inject = ['$scope', 'inventoryTypeSvc'];
- function controller($scope, inventoryTypeSvc){
- var vm = this;
-
- vm.add = add;
- vm.saving = false;
- vm.inventoryType = {};
-
- vm.statusMessage = "Add a new commodity";
- vm.errorMessages = [];
-
- function add() {
- vm.statusMessage = null;
- vm.saving = true;
- inventoryTypeSvc.add(vm.inventoryType)
- .success(function () {
- //Close the modal
- $scope.$close();
- })
- .error(function (data) {
- vm.errorMessages = angular.copy(data.errorMessages, vm.errorMessages);
- })
- .finally(function() {
- vm.saving = false;
- });
- }
- }
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/InventoryTypeController.js b/InventoryTraker.Web/js/inventoryType/InventoryTypeController.js
deleted file mode 100644
index 13ce7f7..0000000
--- a/InventoryTraker.Web/js/inventoryType/InventoryTypeController.js
+++ /dev/null
@@ -1,24 +0,0 @@
-(function() {
- "use strict";
-
- window.app.controller("InventoryTypeController",
- [
- "$uibModal", "inventoryTypeSvc", "downloadSvc",
- function($uibModal, inventoryTypeSvc, downloadSvc) {
- var vm = this;
-
- vm.inventoryTypes = inventoryTypeSvc.inventoryTypes;
-
- vm.add = function() {
- $uibModal.open({
- template: "
",
- backdrop: "static"
- });
- };
- vm.export = function() {
- inventoryTypeSvc.exportInventoryTypes()
- .success(downloadSvc.success);
- };
- }
- ]);
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/InventoryTypeEditDirective.js b/InventoryTraker.Web/js/inventoryType/InventoryTypeEditDirective.js
deleted file mode 100644
index f7be05e..0000000
--- a/InventoryTraker.Web/js/inventoryType/InventoryTypeEditDirective.js
+++ /dev/null
@@ -1,44 +0,0 @@
-(function() {
- "use strict";
-
- window.app.directive('editInventoryType',
- function() {
- return {
- scope: {
- inventoryType: "="
- },
- templateUrl: '/inventoryType/template/inventoryTypeEdit.tmpl.cshtml',
- controller: controller,
- controllerAs: 'vm'
- }
- });
-
- controller.$inject = ['$scope', 'inventoryTypeSvc'];
- function controller($scope, inventoryTypeSvc) {
- var vm = this;
- vm.inventoryType = angular.copy($scope.inventoryType);
- vm.save = save;
-
- vm.saving = false;
- vm.inventoryTypeSvc = inventoryTypeSvc;
-
- vm.statusMessage = "Edit this commodity";
- vm.errorMessages = [];
-
- function save() {
- vm.statusMessage = null;
- vm.saving = true;
- inventoryTypeSvc.update($scope.inventoryType, vm.inventoryType)
- .success(function () {
- //Close the modal
- $scope.$parent.$close();
- })
- .error(function(data) {
- vm.errorMessages = angular.copy(data.errorMessages, vm.errorMessages);
- })
- .finally(function() {
- vm.saving = false;
- });
- }
- }
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/InventoryTypeListDirective.js b/InventoryTraker.Web/js/inventoryType/InventoryTypeListDirective.js
deleted file mode 100644
index 878de27..0000000
--- a/InventoryTraker.Web/js/inventoryType/InventoryTypeListDirective.js
+++ /dev/null
@@ -1,27 +0,0 @@
-(function() {
- 'use strict';
-
- window.app.directive('inventoryTypeList',
- function() {
- return {
- scope: { "inventoryTypes": "=" },
- templateUrl: '/inventoryType/template/inventoryTypeList.tmpl.cshtml',
- controller: controller,
- controllerAs: 'vm'
- }
- });
-
- controller.$inject = ['$scope', '$uibModal'];
- function controller($scope, $uibModal) {
- var vm = this;
-
- vm.inventoryTypes = $scope.inventoryTypes;
-
- vm.edit = function(inventoryType) {
- $uibModal.open({
- template: '
',
- scope: angular.extend($scope.$new(true), { inventoryType: inventoryType })
- });
- };
- }
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/inventoryTypeSvc.js b/InventoryTraker.Web/js/inventoryType/inventoryTypeSvc.js
deleted file mode 100644
index 88c360a..0000000
--- a/InventoryTraker.Web/js/inventoryType/inventoryTypeSvc.js
+++ /dev/null
@@ -1,45 +0,0 @@
-(function() {
- window.app.factory("inventoryTypeSvc",
- [
- "$http",
- function($http) {
- var inventoryTypes = [];
-
- loadInventoryTypes();
-
- var svc = {
- add: add,
- update: update,
- inventoryTypes: inventoryTypes,
- exportInventoryTypes: exportInventoryTypes
- };
-
- return svc;
-
- function loadInventoryTypes() {
- $http.post("/InventoryType/All")
- .success(function(data) {
- inventoryTypes.addRange(data);
- });
- }
-
- function exportInventoryTypes() {
- return $http.post("/InventoryType/Export", {}, { responseType: "arraybuffer" });
- }
-
- function add(inventoryType) {
- return $http.post("/InventoryType/Add", inventoryType)
- .success(function(inventoryType) {
- inventoryTypes.unshift(inventoryType);
- });
- }
-
- function update(existingInventoryType, updatedInventoryType) {
- return $http.post("/InventoryType/Update", updatedInventoryType)
- .success(function(inventoryType) {
- angular.extend(existingInventoryType, inventoryType);
- });
- }
- }
- ]);
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeAdd.tmpl.cshtml b/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeAdd.tmpl.cshtml
deleted file mode 100644
index a74b9b3..0000000
--- a/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeAdd.tmpl.cshtml
+++ /dev/null
@@ -1,27 +0,0 @@
-@using InventoryTraker.Web.Helpers
-@model InventoryTraker.Web.Models.InventoryTypeViewModel
-
-
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeEdit.tmpl.cshtml b/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeEdit.tmpl.cshtml
deleted file mode 100644
index ef2c8a4..0000000
--- a/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeEdit.tmpl.cshtml
+++ /dev/null
@@ -1,27 +0,0 @@
-@using InventoryTraker.Web.Helpers
-@model InventoryTraker.Web.Models.InventoryTypeViewModel
-
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeList.tmpl.cshtml b/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeList.tmpl.cshtml
deleted file mode 100644
index 650657c..0000000
--- a/InventoryTraker.Web/js/inventoryType/templates/inventoryTypeList.tmpl.cshtml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- |
- ID |
- Name |
- Units per Case |
- Container Type |
- Weight Per Case |
- Price Per Case |
-
-
-
-
- |
- {{inventoryType.identifier}} |
- {{inventoryType.name}} |
- {{inventoryType.unitsPerCase}} |
- {{inventoryType.containerType}} |
- {{inventoryType.weightPerCase}} lbs |
- {{inventoryType.pricePerCase | currency}} |
-
-
-
diff --git a/InventoryTraker.Web/js/report/DistributionReportController.js b/InventoryTraker.Web/js/report/DistributionReportController.js
deleted file mode 100644
index a320918..0000000
--- a/InventoryTraker.Web/js/report/DistributionReportController.js
+++ /dev/null
@@ -1,18 +0,0 @@
-(function() {
- "use strict";
-
- window.app.controller("DistributionReportController",
- [
- "$scope", "reportSvc", "downloadSvc",
- function($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);
- };
- }
- ]);
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/report/DistributionReportDirective.js b/InventoryTraker.Web/js/report/DistributionReportDirective.js
deleted file mode 100644
index 54a61d9..0000000
--- a/InventoryTraker.Web/js/report/DistributionReportDirective.js
+++ /dev/null
@@ -1,19 +0,0 @@
-(function() {
- 'use strict';
-
- window.app.directive('distributionReport',
- function () {
- return {
- scope: {distributionData: "="},
- templateUrl: '/report/template/distributionReport.tmpl.cshtml',
- controller: controller,
- controllerAs: 'vm'
- }
- });
-
- controller.$inject = ['$scope'];
- function controller($scope) {
- var vm = this;
- vm.distributionData = $scope.distributionData;
- }
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/report/MovementReportController.js b/InventoryTraker.Web/js/report/MovementReportController.js
deleted file mode 100644
index 30dc33e..0000000
--- a/InventoryTraker.Web/js/report/MovementReportController.js
+++ /dev/null
@@ -1,17 +0,0 @@
-(function() {
- "use strict";
-
- window.app.controller("MovementReportController",
- [
- "$scope", "reportSvc", "downloadSvc",
- function($scope, reportSvc, downloadSvc) {
- var vm = this;
- vm.loadData = reportSvc.loadMovementData;
- vm.movementData = reportSvc.movementData;
- vm.export = function(month) {
- reportSvc.exportMovementData({ month: month })
- .success(downloadSvc.success);
- };
- }
- ]);
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/report/MovementReportDirective.js b/InventoryTraker.Web/js/report/MovementReportDirective.js
deleted file mode 100644
index b04cada..0000000
--- a/InventoryTraker.Web/js/report/MovementReportDirective.js
+++ /dev/null
@@ -1,29 +0,0 @@
-(function() {
- 'use strict';
-
- window.app.directive('movementReport',
- function() {
- return {
- scope: { movementData: "=" },
- templateUrl: '/report/template/movementReport.tmpl.cshtml',
- controller: controller,
- controllerAs: 'vm'
- }
- });
-
- controller.$inject = ['$scope', '$uibModal', 'inventorySvc'];
- function controller($scope, $uibModal, inventorySvc) {
- var vm = this;
- vm.movementData = $scope.movementData;
-
- vm.editInventory = function (inventoryId) {
- inventorySvc.find(inventoryId)
- .success(function (inventory) {
- $uibModal.open({
- template: '
',
- scope: angular.extend($scope.$new(true), { inventory: inventory })
- });
- });
- }
- }
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/report/reportSvc.js b/InventoryTraker.Web/js/report/reportSvc.js
deleted file mode 100644
index b44c094..0000000
--- a/InventoryTraker.Web/js/report/reportSvc.js
+++ /dev/null
@@ -1,46 +0,0 @@
-(function() {
- window.app.factory("reportSvc",
- [
- "$http",
- function($http) {
- var distributionData = [];
- var distributionQuery = {};
- var movementData = {};
-
- var svc = {
- distributionData: distributionData,
- distributionQuery: distributionQuery,
- loadDistributionReport: loadDistributionReport,
- exportDistributionReport: exportDistributionReport,
- movementData: movementData,
- loadMovementData: loadMovementData,
- exportMovementData: exportMovementData
- };
-
- return svc;
-
- 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) {
- angular.copy(data, movementData);
- });
- }
-
- function exportMovementData(query) {
- return $http.post("/Report/MovementExcel", query, { responseType: "arraybuffer" });
- }
- }
- ]);
-})();
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/report/templates/distributionReport.tmpl.cshtml b/InventoryTraker.Web/js/report/templates/distributionReport.tmpl.cshtml
deleted file mode 100644
index 0c40c08..0000000
--- a/InventoryTraker.Web/js/report/templates/distributionReport.tmpl.cshtml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
{{distribution.destination}}
-
{{distribution.date | date:'shortDate'}}
-
-
-
- | Name of Commodity |
- Units per Case / Container Type |
- Exp. Date |
- Case Qty |
- Unit Qty |
- Weight |
-
-
-
-
- | {{transaction.name}} |
- {{transaction.unitsPerCase}} / {{transaction.containerType}} |
- {{transaction.expirationDate | date:'shortDate'}} |
- {{transaction.removedQuantity}} |
- {{transaction.removedQuantity * transaction.unitsPerCase}} |
- {{transaction.weightPerCase * transaction.removedQuantity | number:0 }} lbs |
-
-
-
-
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/report/templates/movementReport.tmpl.cshtml b/InventoryTraker.Web/js/report/templates/movementReport.tmpl.cshtml
deleted file mode 100644
index 7d7d522..0000000
--- a/InventoryTraker.Web/js/report/templates/movementReport.tmpl.cshtml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
- @* | *@
- Name of Commodity |
- Pack Size / Units per Case |
- Beginning Inventory |
- Units Rec'd |
- Total Units Available |
- Adjustments (show + or -) |
- Units Distributed |
- Ending Inventory |
-
-
-
-
- @*| | *@
- {{item.inventoryType.name}} |
- {{item.inventoryType.unitsPerCase}} / {{item.inventoryType.containerType}} |
-
- {{item.beginningQuantity | toUnits:item.inventoryType.unitsPerCase}}
- {{item.beginningQuantity | formatCases}}
- |
-
- {{item.addedQuantity | hideZero | toUnits:item.inventoryType.unitsPerCase}}
- {{item.addedQuantity | hideZero | formatCases}}
- |
-
- {{item.totalAvailableQuantity | hideZero | toUnits:item.inventoryType.unitsPerCase}}
- {{item.totalAvailableQuantity | hideZero | formatCases}}
- |
-
- {{item.adjustmentQuantity ? '-' : ''}}
- {{item.adjustmentQuantity | hideZero | toUnits:item.inventoryType.unitsPerCase}}
- {{item.adjustmentQuantity | hideZero | formatCases}}
- |
-
- {{item.distributedQuantity | hideZero | toUnits:item.inventoryType.unitsPerCase}}
- {{item.distributedQuantity | hideZero | formatCases}}
- |
-
- {{item.endingQuantity | toUnits:item.inventoryType.unitsPerCase}}
- {{item.endingQuantity | formatCases}}
- |
-
-
-
\ No newline at end of file
diff --git a/InventoryTraker.Web/js/transaction/TransactionController.js b/InventoryTraker.Web/js/transaction/TransactionController.js
index e1b15ad..3aae51e 100644
--- a/InventoryTraker.Web/js/transaction/TransactionController.js
+++ b/InventoryTraker.Web/js/transaction/TransactionController.js
@@ -22,27 +22,29 @@
enableSorting: false,
columnDefs: [
{
- field: "name",
+ field: "inventoryId",
cellTooltip: function(row) {
- return row.entity.name + "\r" + row.entity.unitsPerCase + " / " + row.entity.containerType;
+ return row.entity.name;
},
cellTemplate: '
' +
+ 'title="{{row.entity.inventoryId}}">' +
'
' +
- "{{row.entity.name}}
",
- width: "20%"
+ "{{row.entity.inventoryId}}
",
+ width: "10%"
},
- { field: "transactionType", name: "Type", width: "10%" },
- { field: "destination", cellTooltip: true, width: "10%" },
- { field: "memo", cellTooltip: true, width: "15%" },
+ {
+ field: "programName",
+ cellTemplate: '' +
+ "{{row.entity.programName}}" +
+ "{{(row.entity.programSubtype ? ' ' + row.entity.programSubtype : '')}}" +
+ "
",
+ width: "15%"
+ },
+ { field: "description", cellTooltip: true, width: "15%" },
{ field: "transactionDate", name: "Transaction Date", cellFilter: "date:'shortDate'", width: "10%" },
- { field: "previousQuantity", name: "Prev Qty", width: "10%", enableSorting: false },
- { field: "addedQuantity", name: "Add Qty", width: "10%", enableSorting: false, cellFilter: "hideZero" },
- { field: "removedQuantity", name: "Remove Qty", width: "10%", enableSorting: false, cellFilter: "hideZero" },
- { field: "currentQuantity", name: "Current Qty", width: "10%", enableSorting: false }
+ { field: "transactionType", cellToolTip: true, width: "10%" },
+ { field: "memo", cellTooltip: true, width: "15%" }
],
onRegisterApi: function(gridApi) {
vm.gridApi = gridApi;
@@ -68,8 +70,9 @@
updateData();
$scope.editInventory = function(inventoryId) {
- inventorySvc.find(inventoryId)
- .success(function(inventory) {
+ inventorySvc.load(inventoryId)
+ .success(function () {
+ var inventory = inventorySvc.get(inventoryId);
$uibModal.open({
template: '