diff --git a/brewman/static/app/account/account.controller.js b/brewman/static/app/account/account.controller.js
index bbed5ee3..d516ba2d 100644
--- a/brewman/static/app/account/account.controller.js
+++ b/brewman/static/app/account/account.controller.js
@@ -1,6 +1,10 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('AccountListController', AccountListController);
-var AccountListController = ['$scope', '$location', '$routeParams', 'Tokenizer', 'accounts', function ($scope, $location, $routeParams, Tokenizer, accounts) {
+AccountListController.$inject = ['$scope', '$location', '$routeParams', 'Tokenizer', 'accounts'];
+
+function AccountListController($scope, $location, $routeParams, Tokenizer, accounts) {
$scope.search = $routeParams.q || '';
$scope.info = accounts;
@@ -69,14 +73,20 @@ var AccountListController = ['$scope', '$location', '$routeParams', 'Tokenizer',
}
}
};
-}];
-AccountListController.resolve = {
- accounts: ['Account', function (Account) {
- return Account.query({}).$promise;
- }]
};
-var AccountController = ['$scope', '$location', '$uibModal', 'account', 'accountTypes', 'costCentres', function ($scope, $location, $modal, account, accountTypes, costCentres) {
+function AccountListResolver(Account) {
+ return Account.query({}).$promise;
+}
+AccountListResolver.$inject = ['Account'];
+
+angular
+ .module('overlord')
+ .controller('AccountController', AccountController);
+
+AccountController.$inject = ['$scope', '$location', '$uibModal', 'account', 'accountTypes', 'costCentres'];
+
+function AccountController($scope, $location, $modal, account, accountTypes, costCentres) {
$scope.account = account;
$scope.accountTypes = accountTypes;
@@ -121,7 +131,7 @@ var AccountController = ['$scope', '$location', '$uibModal', 'account', 'account
});
};
$scope.foName = true;
-}];
+};
AccountController.resolve = {
account: ['$route', 'Account', function ($route, Account) {
diff --git a/brewman/static/app/attendance/attendance.controller.js b/brewman/static/app/attendance/attendance.controller.js
index 6c508d04..531fd2c9 100644
--- a/brewman/static/app/attendance/attendance.controller.js
+++ b/brewman/static/app/attendance/attendance.controller.js
@@ -1,6 +1,9 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('AttendanceController', AttendanceController);
-var AttendanceController = ['$scope', '$location', 'asDateFilter', 'Attendance', 'attendanceTypes', 'info', 'uibDateParser', function ($scope, $location, asDate, Attendance, attendanceTypes, info, dateParser) {
+AttendanceController.$inject = ['$scope', '$location', 'asDateFilter', 'Attendance', 'attendanceTypes', 'info', 'uibDateParser'];
+function AttendanceController($scope, $location, asDate, Attendance, attendanceTypes, info, dateParser) {
var _info_Date = dateParser.parse(info.Date, "dd-MMM-yyyy");
$scope.info_Date = function (value) {
if (arguments.length) {
@@ -22,9 +25,14 @@ var AttendanceController = ['$scope', '$location', 'asDateFilter', 'Attendance',
});
};
$scope.foDate = true;
-}];
+}
-var AttendanceSubController = ['$scope', function ($scope) {
+angular
+ .module('overlord')
+ .controller('AttendanceSubController', AttendanceSubController);
+
+AttendanceSubController.$inject = ['$scope'];
+function AttendanceSubController($scope) {
$scope.original = {};
angular.copy($scope.item, $scope.original);
@@ -47,7 +55,7 @@ var AttendanceSubController = ['$scope', function ($scope) {
$scope.isDirty = function () {
return !angular.equals($scope.original, $scope.item);
};
-}];
+}
AttendanceController.resolve = {
info: ['$route', 'Attendance', function ($route, Attendance) {
diff --git a/brewman/static/app/balance-sheet/balance-sheet.controller.js b/brewman/static/app/balance-sheet/balance-sheet.controller.js
index 6601a9e0..fc4bf110 100644
--- a/brewman/static/app/balance-sheet/balance-sheet.controller.js
+++ b/brewman/static/app/balance-sheet/balance-sheet.controller.js
@@ -1,6 +1,9 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('BalanceSheetController', BalanceSheetController);
-var BalanceSheetController = ['$scope', '$location', 'asDateFilter', 'info', 'uibDateParser', function ($scope, $location, asDate, info, dateParser) {
+BalanceSheetController.$inject = ['$scope', '$location', 'asDateFilter', 'info', 'uibDateParser'];
+function BalanceSheetController($scope, $location, asDate, info, dateParser) {
var _info_Date = dateParser.parse(info.Date, "dd-MMM-yyyy");
$scope.info_Date = function (value) {
if (arguments.length) {
@@ -14,7 +17,7 @@ var BalanceSheetController = ['$scope', '$location', 'asDateFilter', 'info', 'ui
$location.path('/BalanceSheet/' + $scope.info.Date);
};
$scope.foDate = true;
-}];
+}
BalanceSheetController.resolve = {
info: ['$route', 'BalanceSheet', function ($route, BalanceSheet) {
diff --git a/brewman/static/app/cash-flow/cash-flow.controller.js b/brewman/static/app/cash-flow/cash-flow.controller.js
index f2289f76..89f1f986 100644
--- a/brewman/static/app/cash-flow/cash-flow.controller.js
+++ b/brewman/static/app/cash-flow/cash-flow.controller.js
@@ -1,6 +1,9 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('CashFlowController', CashFlowController);
-var CashFlowController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'cashFlow', 'uibDateParser', function ($scope, $routeParams, $location, asDate, cashFlow, dateParser) {
+CashFlowController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'cashFlow', 'uibDateParser'];
+function CashFlowController($scope, $routeParams, $location, asDate, cashFlow, dateParser) {
var _info_StartDate = dateParser.parse(cashFlow.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(cashFlow.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -27,7 +30,8 @@ var CashFlowController = ['$scope', '$routeParams', '$location', 'asDateFilter',
}, 0);
};
$scope.foDate = true;
-}];
+}
+
CashFlowController.resolve = {
cashFlow: ['$route', 'CashFlow', function ($route, CashFlow) {
var id = $route.current.params.id,
diff --git a/brewman/static/app/client/client.controller.js b/brewman/static/app/client/client.controller.js
index 0abc73dd..b774b0ee 100644
--- a/brewman/static/app/client/client.controller.js
+++ b/brewman/static/app/client/client.controller.js
@@ -1,8 +1,11 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('ClientListController', ClientListController);
-var ClientListController = ['$scope', 'clients', function ($scope, clients) {
+ClientListController.$inject = ['$scope', 'clients'];
+function ClientListController($scope, clients) {
$scope.info = clients;
-}];
+}
ClientListController.resolve = {
clients: ['Client', function (Client) {
@@ -10,7 +13,12 @@ ClientListController.resolve = {
}]
};
-var ClientController = ['$scope', '$location', '$uibModal', 'client', function ($scope, $location, $modal, client) {
+angular
+ .module('overlord')
+ .controller('ClientController', ClientController);
+
+ClientController.$inject = ['$scope', '$location', '$uibModal', 'client'];
+function ClientController($scope, $location, $modal, client) {
$scope.client = client;
$scope.save = function () {
@@ -52,7 +60,7 @@ var ClientController = ['$scope', '$location', '$uibModal', 'client', function (
});
};
$scope.foName = true;
-}];
+}
ClientController.resolve = {
client: ['$route', 'Client', function ($route, Client) {
diff --git a/brewman/static/app/closing-stock/closing-stock.controller.js b/brewman/static/app/closing-stock/closing-stock.controller.js
index 8572ac22..057dd056 100644
--- a/brewman/static/app/closing-stock/closing-stock.controller.js
+++ b/brewman/static/app/closing-stock/closing-stock.controller.js
@@ -1,6 +1,9 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('ClosingStockController', ClosingStockController);
-var ClosingStockController = ['$scope', '$location', 'asDateFilter', 'info', 'uibDateParser', function ($scope, $location, asDate, info, dateParser) {
+ClosingStockController.$inject = ['$scope', '$location', 'asDateFilter', 'info', 'uibDateParser'];
+function ClosingStockController($scope, $location, asDate, info, dateParser) {
var _info_Date = dateParser.parse(info.Date, "dd-MMM-yyyy");
$scope.info_Date = function (value) {
if (arguments.length) {
@@ -14,7 +17,7 @@ var ClosingStockController = ['$scope', '$location', 'asDateFilter', 'info', 'ui
$location.path('/ClosingStock/' + $scope.info.Date);
};
$scope.foDate = true;
-}];
+}
ClosingStockController.resolve = {
info: ['$route', 'ClosingStock', function ($route, ClosingStock) {
diff --git a/brewman/static/app/cost-centre/cost-centre.controller.js b/brewman/static/app/cost-centre/cost-centre.controller.js
index 594e6b72..14dd7902 100644
--- a/brewman/static/app/cost-centre/cost-centre.controller.js
+++ b/brewman/static/app/cost-centre/cost-centre.controller.js
@@ -1,8 +1,11 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('CostCentreListController', CostCentreListController);
-var CostCentreListController = ['$scope', 'costCentres', function ($scope, costCentres) {
+CostCentreListController.$inject = ['$scope', 'costCentres'];
+function CostCentreListController($scope, costCentres) {
$scope.info = costCentres;
-}];
+}
CostCentreListController.resolve = {
costCentres: ['CostCentre', function (CostCentre) {
@@ -10,7 +13,12 @@ CostCentreListController.resolve = {
}]
};
-var CostCentreController = ['$scope', '$routeParams', '$location', 'costCentre', function ($scope, $routeParams, $location, costCentre) {
+angular
+ .module('overlord')
+ .controller('CostCentreController', CostCentreController);
+
+CostCentreController.$inject = ['$scope', '$routeParams', '$location', 'costCentre'];
+function CostCentreController($scope, $routeParams, $location, costCentre) {
$scope.costCentre = costCentre;
$scope.save = function () {
@@ -31,7 +39,7 @@ var CostCentreController = ['$scope', '$routeParams', '$location', 'costCentre',
});
};
$scope.foName = true;
-}];
+}
CostCentreController.resolve = {
costCentre: ['$route', 'CostCentre', function ($route, CostCentre) {
diff --git a/brewman/static/app/daybook/daybook.controller.js b/brewman/static/app/daybook/daybook.controller.js
index 77eaaa0c..0973ba05 100644
--- a/brewman/static/app/daybook/daybook.controller.js
+++ b/brewman/static/app/daybook/daybook.controller.js
@@ -1,6 +1,9 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('DaybookController', DaybookController);
-var DaybookController = ['$scope', '$location', 'asDateFilter', 'info', 'uibDateParser', function ($scope, $location, asDate, info, dateParser) {
+DaybookController.$inject = ['$scope', '$location', 'asDateFilter', 'info', 'uibDateParser'];
+function DaybookController($scope, $location, asDate, info, dateParser) {
var _info_StartDate = dateParser.parse(info.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(info.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -22,7 +25,7 @@ var DaybookController = ['$scope', '$location', 'asDateFilter', 'info', 'uibDate
$location.path('/Daybook').search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
};
$scope.foDate = true;
-}];
+}
DaybookController.resolve = {
info: ['$route', 'Daybook', function ($route, Daybook) {
var startDate = $route.current.params.StartDate,
diff --git a/brewman/static/app/employee/employee-attendance.controller.js b/brewman/static/app/employee/employee-attendance.controller.js
index 71995962..95688e3e 100644
--- a/brewman/static/app/employee/employee-attendance.controller.js
+++ b/brewman/static/app/employee/employee-attendance.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var EmployeeAttendanceController = ['$scope', '$location', '$routeParams', 'asDateFilter', 'EmployeeAttendance', 'attendanceTypes', 'info', 'Employee', 'uibDateParser', function ($scope, $location, $routeParams, asDate, EmployeeAttendance, attendanceTypes, info, Employee, dateParser) {
+angular
+ .module('overlord')
+ .controller('EmployeeAttendanceController', EmployeeAttendanceController);
+EmployeeAttendanceController.$inject = ['$scope', '$location', '$routeParams', 'asDateFilter', 'EmployeeAttendance', 'attendanceTypes', 'info', 'Employee', 'uibDateParser'];
+function EmployeeAttendanceController($scope, $location, $routeParams, asDate, EmployeeAttendance, attendanceTypes, info, Employee, dateParser) {
var _info_StartDate = dateParser.parse(info.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(info.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -22,12 +24,19 @@ var EmployeeAttendanceController = ['$scope', '$location', '$routeParams', 'asDa
$scope.show = function () {
var id = $scope.info.Employee.LedgerID;
if (id === $routeParams.id && $scope.info.StartDate === $routeParams.StartDate && $scope.info.FinishDate === $routeParams.FinishDate) {
- EmployeeAttendance.get({id: id, StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate}, function (data) {
+ EmployeeAttendance.get({
+ id: id,
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ }, function (data) {
$scope.info = data;
});
}
else {
- $location.path('/EmployeeAttendance/' + id).search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
+ $location.path('/EmployeeAttendance/' + id).search({
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ });
}
};
@@ -43,9 +52,13 @@ var EmployeeAttendanceController = ['$scope', '$location', '$routeParams', 'asDa
});
};
$scope.foEmployee = true;
-}];
+}
-var EmployeeAttendanceSubController = ['$scope', function ($scope) {
+angular
+ .module('overlord')
+ .controller('EmployeeAttendanceSubController', EmployeeAttendanceSubController);
+EmployeeAttendanceSubController.$inject = ['$scope'];
+function EmployeeAttendanceSubController($scope) {
$scope.original = {};
angular.copy($scope.item, $scope.original);
@@ -68,7 +81,7 @@ var EmployeeAttendanceSubController = ['$scope', function ($scope) {
$scope.isDirty = function () {
return !angular.equals($scope.original, $scope.item);
};
-}];
+}
EmployeeAttendanceController.resolve = {
info: ['$route', 'EmployeeAttendance', function ($route, EmployeeAttendance) {
var id = $route.current.params.id,
diff --git a/brewman/static/app/employee/employee-functions.controller.js b/brewman/static/app/employee/employee-functions.controller.js
index c2febef3..51c2feb4 100644
--- a/brewman/static/app/employee/employee-functions.controller.js
+++ b/brewman/static/app/employee/employee-functions.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var EmployeeFunctionsController = ['$scope', '$http', 'asDateFilter', function ($scope, $http, asDate) {
+angular
+ .module('overlord')
+ .controller('EmployeeFunctionsController', EmployeeFunctionsController);
+EmployeeFunctionsController.$inject = ['$scope', '$http', 'asDateFilter'];
+function EmployeeFunctionsController($scope, $http, asDate) {
var _record_StartDate,
_record_FinishDate;
$scope.record_StartDate = function (value) {
@@ -62,5 +64,5 @@ var EmployeeFunctionsController = ['$scope', '$http', 'asDateFilter', function (
$scope.toasts.push({Type: 'Danger', Message: data});
});
};
-}];
+}
diff --git a/brewman/static/app/employee/employee.controller.js b/brewman/static/app/employee/employee.controller.js
index bb584d4a..4eaae3fa 100644
--- a/brewman/static/app/employee/employee.controller.js
+++ b/brewman/static/app/employee/employee.controller.js
@@ -1,6 +1,9 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('EmployeeListController', EmployeeListController);
-var EmployeeListController = ['$scope', '$location', '$routeParams', 'Tokenizer', 'employees', function ($scope, $location, $routeParams, Tokenizer, employees) {
+EmployeeListController.$inject = ['$scope', '$location', '$routeParams', 'Tokenizer', 'employees'];
+function EmployeeListController($scope, $location, $routeParams, Tokenizer, employees) {
$scope.search = $routeParams.q || '';
$scope.info = employees;
@@ -71,7 +74,7 @@ var EmployeeListController = ['$scope', '$location', '$routeParams', 'Tokenizer'
}
}
};
-}];
+}
EmployeeListController.resolve = {
employees: ['Employee', function (Employee) {
@@ -79,7 +82,11 @@ EmployeeListController.resolve = {
}]
};
-var EmployeeController = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'employee', 'costCentres', 'uibDateParser', function ($scope, $routeParams, $location, asDate, $modal, employee, costCentres, dateParser) {
+angular
+ .module('overlord')
+ .controller('EmployeeController', EmployeeController);
+EmployeeController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'employee', 'costCentres', 'uibDateParser'];
+function EmployeeController($scope, $routeParams, $location, asDate, $modal, employee, costCentres, dateParser) {
var _employee_JoiningDate = dateParser.parse(employee.JoiningDate, "dd-MMM-yyyy"),
_employee_LeavingDate = dateParser.parse(employee.LeavingDate, "dd-MMM-yyyy");
$scope.employee_JoiningDate = function (value) {
@@ -139,7 +146,7 @@ var EmployeeController = ['$scope', '$routeParams', '$location', 'asDateFilter',
});
};
$scope.foName = true;
-}];
+}
EmployeeController.resolve = {
employee: ['$route', 'Employee', function ($route, Employee) {
diff --git a/brewman/static/app/group/group.controller.js b/brewman/static/app/group/group.controller.js
index a2bd1be7..f6a3947b 100644
--- a/brewman/static/app/group/group.controller.js
+++ b/brewman/static/app/group/group.controller.js
@@ -1,8 +1,10 @@
-'use strict';
-
-var GroupListController = ['$scope', 'groups', function ($scope, groups) {
+angular
+ .module('overlord')
+ .controller('GroupListController', GroupListController);
+GroupListController.$inject = ['$scope', 'groups'];
+function GroupListController($scope, groups) {
$scope.info = groups;
-}];
+}
GroupListController.resolve = {
groups: ['Group', function (Group) {
@@ -10,7 +12,11 @@ GroupListController.resolve = {
}]
};
-var GroupController = ['$scope', '$location', 'group', function ($scope, $location, group) {
+angular
+ .module('overlord')
+ .controller('GroupController', GroupController);
+GroupController.$inject = ['$scope', '$location', 'group'];
+function GroupController($scope, $location, group) {
$scope.group = group;
$scope.save = function () {
@@ -31,7 +37,7 @@ var GroupController = ['$scope', '$location', 'group', function ($scope, $locati
});
};
$scope.foName = true;
-}];
+}
GroupController.resolve = {
group: ['$route', 'Group', function ($route, Group) {
diff --git a/brewman/static/app/home.controller.js b/brewman/static/app/home.controller.js
index 894055e4..b40a64a5 100644
--- a/brewman/static/app/home.controller.js
+++ b/brewman/static/app/home.controller.js
@@ -1,6 +1,7 @@
-'use strict';
-
-var HomeController = ['$location', function ($location) {
-}];
-HomeController.resolve = {
-};
\ No newline at end of file
+angular
+ .module('overlord')
+ .controller('HomeController', HomeController);
+HomeController.$inject = ['$location'];
+function HomeController($location) {
+}
+HomeController.resolve = {};
\ No newline at end of file
diff --git a/brewman/static/app/issue/issue.controller.js b/brewman/static/app/issue/issue.controller.js
index 92b898b6..22a8c21a 100644
--- a/brewman/static/app/issue/issue.controller.js
+++ b/brewman/static/app/issue/issue.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var IssueController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher', 'costCentres', 'smallGrid', 'IssueGrid', 'Voucher', '$uibModal', 'Batch', 'uibDateParser', function ($scope, $routeParams, $location, asDate, voucher, costCentres, smallGrid, IssueGrid, Voucher, $modal, Batch, dateParser) {
+angular
+ .module('overlord')
+ .controller('IssueController', IssueController);
+IssueController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher', 'costCentres', 'smallGrid', 'IssueGrid', 'Voucher', '$uibModal', 'Batch', 'uibDateParser'];
+function IssueController($scope, $routeParams, $location, asDate, voucher, costCentres, smallGrid, IssueGrid, Voucher, $modal, Batch, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -257,7 +259,7 @@ var IssueController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'v
var params = {term: $viewValue, count: 20, date: $scope.voucher.Date};
return Batch.autocomplete(params).$promise;
};
-}];
+}
IssueController.resolve = {
voucher: ['$route', 'Voucher', function ($route, Voucher) {
@@ -291,7 +293,11 @@ IssueController.resolve = {
}]
};
-var IssueModalController = ['$scope', '$uibModalInstance', 'edit', 'Batch', function ($scope, $modalInstance, edit, Batch) {
+angular
+ .module('overlord')
+ .controller('IssueModalController', IssueModalController);
+IssueModalController.$inject = ['$scope', '$uibModalInstance', 'edit', 'Batch'];
+function IssueModalController($scope, $modalInstance, edit, Batch) {
$scope.edit = edit;
$scope.ok = function () {
$scope.edit.Product = $scope.edit.Batch.Product;
@@ -308,4 +314,4 @@ var IssueModalController = ['$scope', '$uibModalInstance', 'edit', 'Batch', func
$scope.batches = function ($viewValue) {
return Batch.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/brewman/static/app/journal/journal.controller.js b/brewman/static/app/journal/journal.controller.js
index 9b15c82e..790bf412 100644
--- a/brewman/static/app/journal/journal.controller.js
+++ b/brewman/static/app/journal/journal.controller.js
@@ -1,6 +1,10 @@
-'use strict';
+angular
+ .module('overlord')
+ .controller('JournalController', JournalController);
-var JournalController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'mathSolver', 'voucher', 'Account', 'uibDateParser', function ($scope, $location, asDate, $modal, uploadedImageResizer, mathSolver, voucher, Account, dateParser) {
+JournalController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'mathSolver', 'voucher', 'Account', 'uibDateParser'];
+
+function JournalController($scope, $location, asDate, $modal, uploadedImageResizer, mathSolver, voucher, Account, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -197,7 +201,7 @@ var JournalController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'up
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
JournalController.resolve = {
voucher: ['$route', 'Voucher', function ($route, Voucher) {
@@ -210,7 +214,11 @@ JournalController.resolve = {
}]
};
-var JournalModalController = ['$scope', '$uibModalInstance', 'mathSolver', 'edit', 'Account', function ($scope, $modalInstance, mathSolver, edit, Account) {
+angular
+ .module('overlord')
+ .controller('JournalModalController', JournalModalController);
+JournalModalController.$inject = ['$scope', '$uibModalInstance', 'mathSolver', 'edit', 'Account'];
+function JournalModalController($scope, $modalInstance, mathSolver, edit, Account) {
$scope.toggleDebit = function () {
$scope.edit.Debit = ($scope.edit.Debit === 1) ? -1 : 1;
};
@@ -233,4 +241,4 @@ var JournalModalController = ['$scope', '$uibModalInstance', 'mathSolver', 'edit
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
diff --git a/brewman/static/app/journal/journal.html b/brewman/static/app/journal/journal.html
index 68c46f25..09757a81 100644
--- a/brewman/static/app/journal/journal.html
+++ b/brewman/static/app/journal/journal.html
@@ -25,7 +25,7 @@
-
diff --git a/brewman/static/app/ledger/ledger.controller.js b/brewman/static/app/ledger/ledger.controller.js
index 978d6658..e6b0824b 100644
--- a/brewman/static/app/ledger/ledger.controller.js
+++ b/brewman/static/app/ledger/ledger.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var LedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ledger', 'Ledger', 'Account', 'uibDateParser', function ($scope, $routeParams, $location, asDate, ledger, Ledger, Account, dateParser) {
+angular
+ .module('overlord')
+ .controller('LedgerController', LedgerController);
+LedgerController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ledger', 'Ledger', 'Account', 'uibDateParser'];
+function LedgerController($scope, $routeParams, $location, asDate, ledger, Ledger, Account, dateParser) {
var _info_StartDate = dateParser.parse(ledger.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(ledger.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -149,7 +151,7 @@ var LedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', '
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
LedgerController.resolve = {
ledger: ['$route', 'Ledger', function ($route, Ledger) {
diff --git a/brewman/static/app/login/login.controller.js b/brewman/static/app/login/login.controller.js
index 39570f89..3094eb4e 100644
--- a/brewman/static/app/login/login.controller.js
+++ b/brewman/static/app/login/login.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var LoginController = ['$scope', '$http', '$location', '$routeParams', '$cookies', function ($scope, $http, $location, $routeParams, $cookies) {
+angular
+ .module('overlord')
+ .controller('LoginController', LoginController);
+LoginController.$inject = ['$scope', '$http', '$location', '$routeParams', '$cookies'];
+function LoginController($scope, $http, $location, $routeParams, $cookies) {
$scope.showOTP = false;
$scope.submit = function () {
var data;
@@ -30,9 +32,13 @@ var LoginController = ['$scope', '$http', '$location', '$routeParams', '$cookies
});
};
$scope.foUsername = true;
-}];
+}
-var LogoutController = ['$scope', '$http', '$location', function ($scope, $http, $location) {
+angular
+ .module('overlord')
+ .controller('LogoutController', LogoutController);
+LogoutController.$inject = ['$scope', '$http', '$location'];
+function LogoutController($scope, $http, $location) {
$http.
post('/logout').
then(function () {
@@ -42,4 +48,4 @@ var LogoutController = ['$scope', '$http', '$location', function ($scope, $http,
catch(function (errorMessage) {
$scope.toasts.push({Type: 'Danger', Message: errorMessage.data});
});
-}];
+}
diff --git a/brewman/static/app/net-transactions/net-transactions.controller.js b/brewman/static/app/net-transactions/net-transactions.controller.js
index 1fd85564..9c65d953 100644
--- a/brewman/static/app/net-transactions/net-transactions.controller.js
+++ b/brewman/static/app/net-transactions/net-transactions.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var NetTransactionsController = ['$scope', '$location', 'asDateFilter', 'netTransactions', 'uibDateParser', function ($scope, $location, asDate, netTransactions, dateParser) {
+angular
+ .module('overlord')
+ .controller('NetTransactionsController', NetTransactionsController);
+NetTransactionsController.$inject = ['$scope', '$location', 'asDateFilter', 'netTransactions', 'uibDateParser'];
+function NetTransactionsController($scope, $location, asDate, netTransactions, dateParser) {
var _info_StartDate = dateParser.parse(netTransactions.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(netTransactions.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -19,10 +21,13 @@ var NetTransactionsController = ['$scope', '$location', 'asDateFilter', 'netTran
};
$scope.info = netTransactions;
$scope.show = function () {
- $location.path('/NetTransactions').search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
+ $location.path('/NetTransactions').search({
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ });
};
$scope.foDate = true;
-}];
+}
NetTransactionsController.resolve = {
netTransactions: ['$route', 'NetTransactions', function ($route, NetTransactions) {
diff --git a/brewman/static/app/payment/payment.controller.js b/brewman/static/app/payment/payment.controller.js
index 09b16727..3df116b9 100644
--- a/brewman/static/app/payment/payment.controller.js
+++ b/brewman/static/app/payment/payment.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var PaymentController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'mathSolver', 'voucher', 'ledgers', 'Account', 'uibDateParser', function ($scope, $location, asDate, $modal, uploadedImageResizer, mathSolver, voucher, ledgers, Account, dateParser) {
+angular
+ .module('overlord')
+ .controller('PaymentController', PaymentController);
+PaymentController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'mathSolver', 'voucher', 'ledgers', 'Account', 'uibDateParser'];
+function PaymentController($scope, $location, asDate, $modal, uploadedImageResizer, mathSolver, voucher, ledgers, Account, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -191,7 +193,7 @@ var PaymentController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'up
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
PaymentController.resolve = {
voucher: ['$route', 'Voucher', function ($route, Voucher) {
@@ -213,7 +215,11 @@ PaymentController.resolve = {
}]
};
-var PaymentModalController = ['$scope', '$uibModalInstance', 'mathSolver', 'edit', 'Account', function ($scope, $modalInstance, mathSolver, edit, Account) {
+angular
+ .module('overlord')
+ .controller('PaymentModalController', PaymentModalController);
+PaymentModalController.$inject = ['$scope', '$uibModalInstance', 'mathSolver', 'edit', 'Account'];
+function PaymentModalController($scope, $modalInstance, mathSolver, edit, Account) {
$scope.edit = edit;
$scope.ok = function () {
$scope.edit.Amount = mathSolver($scope.edit.Amount);
@@ -225,4 +231,4 @@ var PaymentModalController = ['$scope', '$uibModalInstance', 'mathSolver', 'edit
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
diff --git a/brewman/static/app/product-group/product-group.controller.js b/brewman/static/app/product-group/product-group.controller.js
index e9a67f08..97f8c06c 100644
--- a/brewman/static/app/product-group/product-group.controller.js
+++ b/brewman/static/app/product-group/product-group.controller.js
@@ -1,8 +1,10 @@
-'use strict';
-
-var ProductGroupListController = ['$scope', 'productGroups', function ($scope, productGroups) {
+angular
+ .module('overlord')
+ .controller('ProductGroupListController', ProductGroupListController);
+ProductGroupListController.$inject = ['$scope', 'productGroups'];
+function ProductGroupListController($scope, productGroups) {
$scope.info = productGroups;
-}];
+}
ProductGroupListController.resolve = {
productGroups: ['ProductGroup', function (ProductGroup) {
@@ -10,7 +12,11 @@ ProductGroupListController.resolve = {
}]
};
-var ProductGroupController = ['$scope', '$location', 'productGroup', function ($scope, $location, productGroup) {
+angular
+ .module('overlord')
+ .controller('ProductGroupController', ProductGroupController);
+ProductGroupController.$inject = ['$scope', '$location', 'productGroup'];
+function ProductGroupController($scope, $location, productGroup) {
$scope.productGroup = productGroup;
$scope.save = function () {
@@ -31,7 +37,7 @@ var ProductGroupController = ['$scope', '$location', 'productGroup', function ($
});
};
$scope.foName = true;
-}];
+}
ProductGroupController.resolve = {
productGroup: ['$route', 'ProductGroup', function ($route, ProductGroup) {
diff --git a/brewman/static/app/product-ledger/product-ledger.controller.js b/brewman/static/app/product-ledger/product-ledger.controller.js
index 718e2d81..9183e03d 100644
--- a/brewman/static/app/product-ledger/product-ledger.controller.js
+++ b/brewman/static/app/product-ledger/product-ledger.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var ProductLedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'productLedger', 'ProductLedger', 'Product', 'uibDateParser', function ($scope, $routeParams, $location, asDate, productLedger, ProductLedger, Product, dateParser) {
+angular
+ .module('overlord')
+ .controller('ProductLedgerController', ProductLedgerController);
+ProductLedgerController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'productLedger', 'ProductLedger', 'Product', 'uibDateParser'];
+function ProductLedgerController($scope, $routeParams, $location, asDate, productLedger, ProductLedger, Product, dateParser) {
var _info_StartDate = dateParser.parse(productLedger.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(productLedger.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -21,7 +23,11 @@ var ProductLedgerController = ['$scope', '$routeParams', '$location', 'asDateFil
$scope.show = function () {
var id = $scope.info.Product.ProductID;
if (id === $routeParams.id && $scope.info.StartDate === $routeParams.StartDate && $scope.info.FinishDate === $routeParams.FinishDate) {
- ProductLedger.get({id: id, StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate}, function (data) {
+ ProductLedger.get({
+ id: id,
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ }, function (data) {
$scope.info = data;
});
} else {
@@ -39,7 +45,7 @@ var ProductLedgerController = ['$scope', '$routeParams', '$location', 'asDateFil
return Product.autocomplete({term: $viewValue, count: 20}).$promise;
};
$scope.foProduct = true;
-}];
+}
ProductLedgerController.resolve = {
productLedger: ['$route', 'ProductLedger', function ($route, ProductLedger) {
var id = $route.current.params.id,
diff --git a/brewman/static/app/product/product.controller.js b/brewman/static/app/product/product.controller.js
index 0f63a4b3..acec5edb 100644
--- a/brewman/static/app/product/product.controller.js
+++ b/brewman/static/app/product/product.controller.js
@@ -1,15 +1,17 @@
-'use strict';
-
-var ProductListController = ['$scope', '$location', '$routeParams', 'Tokenizer', 'products', function ($scope, $location, $routeParams, Tokenizer, products) {
+angular
+ .module('overlord')
+ .controller('ProductListController', ProductListController);
+ProductListController.$inject = ['$scope', '$location', '$routeParams', 'Tokenizer', 'products'];
+function ProductListController($scope, $location, $routeParams, Tokenizer, products) {
$scope.search = $routeParams.q || '';
$scope.showExtended = false;
$scope.info = products;
$scope.product_groups = _.reduce(products, function (acculumator, item) {
- if (!acculumator.includes(item.ProductGroup)){
+ if (!acculumator.includes(item.ProductGroup)) {
acculumator.push(item.ProductGroup);
}
return acculumator;
- },[]).sort();
+ }, []).sort();
$scope.isPurchased = function (isPurchased) {
if (arguments.length === 0) {
return $scope._isPurchased;
@@ -122,7 +124,7 @@ var ProductListController = ['$scope', '$location', '$routeParams', 'Tokenizer',
}
}
};
-}];
+}
ProductListController.resolve = {
products: ['Product', function (Product) {
@@ -130,7 +132,11 @@ ProductListController.resolve = {
}]
};
-var ProductController = ['$scope', '$location', '$window', '$mdDialog', 'product', 'productGroups', function ($scope, $location, $window, $mdDialog, product, productGroups) {
+angular
+ .module('overlord')
+ .controller('ProductController', ProductController);
+ProductController.$inject = ['$scope', '$location', '$window', '$mdDialog', 'product', 'productGroups'];
+function ProductController($scope, $location, $window, $mdDialog, product, productGroups) {
$scope.product = product;
$scope.productGroups = productGroups;
@@ -175,7 +181,7 @@ var ProductController = ['$scope', '$location', '$window', '$mdDialog', 'product
});
};
$scope.foName = true;
-}];
+}
ProductController.resolve = {
product: ['$route', 'Product', function ($route, Product) {
diff --git a/brewman/static/app/purchase-entries/purchase-entries.controller.js b/brewman/static/app/purchase-entries/purchase-entries.controller.js
index e4f24e28..85da136a 100644
--- a/brewman/static/app/purchase-entries/purchase-entries.controller.js
+++ b/brewman/static/app/purchase-entries/purchase-entries.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var PurchaseEntriesController = ['$scope', '$location', 'asDateFilter', 'purchaseEntries', 'uibDateParser', function ($scope, $location, asDate, purchaseEntries, dateParser) {
+angular
+ .module('overlord')
+ .controller('PurchaseEntriesController', PurchaseEntriesController);
+PurchaseEntriesController.$inject = ['$scope', '$location', 'asDateFilter', 'purchaseEntries', 'uibDateParser'];
+function PurchaseEntriesController($scope, $location, asDate, purchaseEntries, dateParser) {
var _info_StartDate = dateParser.parse(purchaseEntries.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(purchaseEntries.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -20,10 +22,13 @@ var PurchaseEntriesController = ['$scope', '$location', 'asDateFilter', 'purchas
$scope.info = purchaseEntries;
$scope.show = function () {
- $location.path('/PurchaseEntries').search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
+ $location.path('/PurchaseEntries').search({
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ });
};
$scope.foDate = true;
-}];
+}
PurchaseEntriesController.resolve = {
purchaseEntries: ['$route', 'PurchaseEntries', function ($route, PurchaseEntries) {
diff --git a/brewman/static/app/purchase-return/purchase-return.controller.js b/brewman/static/app/purchase-return/purchase-return.controller.js
index f21cac71..666458cb 100644
--- a/brewman/static/app/purchase-return/purchase-return.controller.js
+++ b/brewman/static/app/purchase-return/purchase-return.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var PurchaseReturnController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'voucher', 'Account', 'Batch', 'uibDateParser', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Batch, dateParser) {
+angular
+ .module('overlord')
+ .controller('PurchaseReturnController', PurchaseReturnController);
+PurchaseReturnController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'voucher', 'Account', 'Batch', 'uibDateParser'];
+function PurchaseReturnController($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Batch, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -186,7 +188,7 @@ var PurchaseReturnController = ['$scope', '$location', 'asDateFilter', '$uibModa
var params = {term: $viewValue, count: 20, date: $scope.voucher.Date};
return Batch.autocomplete(params).$promise;
};
-}];
+}
PurchaseReturnController.resolve = {
voucher: ['$route', 'Voucher', function ($route, Voucher) {
@@ -200,7 +202,11 @@ PurchaseReturnController.resolve = {
};
-var PurchaseReturnModalController = ['$scope', '$uibModalInstance', 'edit', 'Batch', function ($scope, $modalInstance, edit, Batch) {
+angular
+ .module('overlord')
+ .controller('PurchaseReturnModalController', PurchaseReturnModalController);
+PurchaseReturnModalController.$inject = ['$scope', '$uibModalInstance', 'edit', 'Batch'];
+function PurchaseReturnModalController($scope, $modalInstance, edit, Batch) {
$scope.edit = edit;
$scope.ok = function () {
$scope.edit.Product = $scope.edit.Batch.Product;
@@ -217,4 +223,4 @@ var PurchaseReturnModalController = ['$scope', '$uibModalInstance', 'edit', 'Bat
$scope.batches = function ($viewValue) {
return Batch.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/brewman/static/app/purchase/purchase.controller.js b/brewman/static/app/purchase/purchase.controller.js
index a209f2cc..c7b77e84 100644
--- a/brewman/static/app/purchase/purchase.controller.js
+++ b/brewman/static/app/purchase/purchase.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var PurchaseController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'voucher', 'Account', 'Product', 'uibDateParser', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Product, dateParser) {
+angular
+ .module('overlord')
+ .controller('PurchaseController', PurchaseController);
+PurchaseController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'voucher', 'Account', 'Product', 'uibDateParser'];
+function PurchaseController($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Product, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -188,7 +190,7 @@ var PurchaseController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'u
$scope.products = function ($viewValue) {
return Product.autocomplete({term: $viewValue, count: 20, a: true}).$promise;
};
-}];
+}
PurchaseController.resolve = {
voucher: ['$route', 'Voucher', function ($route, Voucher) {
@@ -202,7 +204,11 @@ PurchaseController.resolve = {
}]
};
-var PurchaseModalController = ['$scope', '$uibModalInstance', 'edit', 'Product', function ($scope, $modalInstance, edit, Product) {
+angular
+ .module('overlord')
+ .controller('PurchaseModalController', PurchaseModalController);
+PurchaseModalController.$inject = ['$scope', '$uibModalInstance', 'edit', 'Product'];
+function PurchaseModalController($scope, $modalInstance, edit, Product) {
$scope.edit = edit;
$scope.ok = function () {
$scope.edit.Quantity = Number(edit.Quantity);
@@ -218,4 +224,4 @@ var PurchaseModalController = ['$scope', '$uibModalInstance', 'edit', 'Product',
$scope.products = function ($viewValue) {
return Product.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
diff --git a/brewman/static/app/purchases/purchases.controller.js b/brewman/static/app/purchases/purchases.controller.js
index a9044c2a..28024db8 100644
--- a/brewman/static/app/purchases/purchases.controller.js
+++ b/brewman/static/app/purchases/purchases.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var PurchasesController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'purchases', 'uibDateParser', function ($scope, $routeParams, $location, asDate, purchases, dateParser) {
+angular
+ .module('overlord')
+ .controller('PurchasesController', PurchasesController);
+PurchasesController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'purchases', 'uibDateParser'];
+function PurchasesController($scope, $routeParams, $location, asDate, purchases, dateParser) {
var _info_StartDate = dateParser.parse(purchases.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(purchases.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -21,7 +23,7 @@ var PurchasesController = ['$scope', '$routeParams', '$location', 'asDateFilter'
$scope.show = function () {
$location.path('/Purchases').search({s: $scope.info.StartDate, f: $scope.info.FinishDate});
};
-}];
+}
PurchasesController.resolve = {
purchases: ['$route', 'Purchases', function ($route, Purchases) {
var startDate = $route.current.params.s,
diff --git a/brewman/static/app/raw-material-cost/raw-material-cost.controller.js b/brewman/static/app/raw-material-cost/raw-material-cost.controller.js
index df253f6c..1708f72f 100644
--- a/brewman/static/app/raw-material-cost/raw-material-cost.controller.js
+++ b/brewman/static/app/raw-material-cost/raw-material-cost.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var RawMaterialCostController = ['$scope', '$location', 'asDateFilter', 'rawMaterialCost', 'uibDateParser', function ($scope, $location, asDate, rawMaterialCost, dateParser) {
+angular
+ .module('overlord')
+ .controller('RawMaterialCostController', RawMaterialCostController);
+RawMaterialCostController.$inject = ['$scope', '$location', 'asDateFilter', 'rawMaterialCost', 'uibDateParser'];
+function RawMaterialCostController($scope, $location, asDate, rawMaterialCost, dateParser) {
var _info_StartDate = dateParser.parse(rawMaterialCost.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(rawMaterialCost.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -19,10 +21,13 @@ var RawMaterialCostController = ['$scope', '$location', 'asDateFilter', 'rawMate
};
$scope.info = rawMaterialCost;
$scope.show = function () {
- $location.path('/RawMaterialCost').search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
+ $location.path('/RawMaterialCost').search({
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ });
};
$scope.foDate = true;
-}];
+}
RawMaterialCostController.resolve = {
rawMaterialCost: ['$route', 'RawMaterialCost', function ($route, RawMaterialCost) {
diff --git a/brewman/static/app/receipt/receipt.controller.js b/brewman/static/app/receipt/receipt.controller.js
index 218bf4e2..48199887 100644
--- a/brewman/static/app/receipt/receipt.controller.js
+++ b/brewman/static/app/receipt/receipt.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var ReceiptController = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'mathSolver', 'voucher', 'ledgers', 'Voucher', 'Account', 'uibDateParser', function ($scope, $routeParams, $location, asDate, $modal, uploadedImageResizer, mathSolver, voucher, ledgers, Voucher, Account, dateParser) {
+angular
+ .module('overlord')
+ .controller('ReceiptController', ReceiptController);
+ReceiptController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'uploadedImageResizer', 'mathSolver', 'voucher', 'ledgers', 'Voucher', 'Account', 'uibDateParser'];
+function ReceiptController($scope, $routeParams, $location, asDate, $modal, uploadedImageResizer, mathSolver, voucher, ledgers, Voucher, Account, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -190,7 +192,7 @@ var ReceiptController = ['$scope', '$routeParams', '$location', 'asDateFilter',
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20, 'a': true}).$promise;
};
-}];
+}
ReceiptController.resolve = {
voucher: ['$route', 'Voucher', function ($route, Voucher) {
@@ -212,7 +214,11 @@ ReceiptController.resolve = {
}]
};
-var ReceiptModalController = ['$scope', '$uibModalInstance', 'mathSolver', 'edit', 'Account', function ($scope, $modalInstance, mathSolver, edit, Account) {
+angular
+ .module('overlord')
+ .controller('ReceiptModalController', ReceiptModalController);
+ReceiptModalController.$inject = ['$scope', '$uibModalInstance', 'mathSolver', 'edit', 'Account'];
+function ReceiptModalController($scope, $modalInstance, mathSolver, edit, Account) {
$scope.edit = edit;
$scope.ok = function () {
$scope.edit.Amount = mathSolver($scope.edit.Amount);
@@ -224,4 +230,4 @@ var ReceiptModalController = ['$scope', '$uibModalInstance', 'mathSolver', 'edit
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
diff --git a/brewman/static/app/recipe/recipe.controller.js b/brewman/static/app/recipe/recipe.controller.js
index 4d165702..22672338 100644
--- a/brewman/static/app/recipe/recipe.controller.js
+++ b/brewman/static/app/recipe/recipe.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var RecipeListController = ['$scope', 'recipes', '$location', '$routeParams', '$filter', 'Tokenizer', function ($scope, recipes, $location, $routeParams, $filter, Tokenizer) {
+angular
+ .module('overlord')
+ .controller('RecipeListController', RecipeListController);
+RecipeListController.$inject = ['$scope', 'recipes', '$location', '$routeParams', '$filter', 'Tokenizer'];
+function RecipeListController($scope, recipes, $location, $routeParams, $filter, Tokenizer) {
$scope.info = recipes;
$scope.search = $routeParams.q || '';
$scope.product_groups = _.reduce(recipes, function (acculumator, item) {
@@ -113,7 +115,7 @@ var RecipeListController = ['$scope', 'recipes', '$location', '$routeParams', '$
}
return $filter('orderBy')(arr, o);
}
-}];
+}
RecipeListController.resolve = {
recipes: ['Recipe', function (Recipe) {
@@ -121,7 +123,11 @@ RecipeListController.resolve = {
}]
};
-var RecipeController = ['$scope', '$location', '$window', '$uibModal', 'asDateFilter', 'Product', 'recipe', function ($scope, $location, $window, $modal, asDate, Product, recipe) {
+angular
+ .module('overlord')
+ .controller('RecipeController', RecipeController);
+RecipeController.$inject = ['$scope', '$location', '$window', '$uibModal', 'asDateFilter', 'Product', 'recipe'];
+function RecipeController($scope, $location, $window, $modal, asDate, Product, recipe) {
recipe.ValidFrom = moment(recipe.ValidFrom, 'DD-MMM-YYYY').toDate();
recipe.ValidTo = moment(recipe.ValidTo, 'DD-MMM-YYYY').toDate();
$scope.recipe = recipe;
@@ -225,9 +231,7 @@ var RecipeController = ['$scope', '$location', '$window', '$uibModal', 'asDateFi
e: true
}, options)).$promise;
};
-
-
-}];
+}
RecipeController.resolve = {
recipe: ['$route', 'Recipe', function ($route, Recipe) {
diff --git a/brewman/static/app/reconcile/reconcile.controller.js b/brewman/static/app/reconcile/reconcile.controller.js
index a3f25fd0..4b9a10ec 100644
--- a/brewman/static/app/reconcile/reconcile.controller.js
+++ b/brewman/static/app/reconcile/reconcile.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'reconcile', 'Reconcile', 'Account', 'uibDateParser', function ($scope, $routeParams, $location, asDate, reconcile, Reconcile, Account, dateParser) {
+angular
+ .module('overlord')
+ .controller('ReconcileController', ReconcileController);
+ReconcileController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'reconcile', 'Reconcile', 'Account', 'uibDateParser'];
+function ReconcileController($scope, $routeParams, $location, asDate, reconcile, Reconcile, Account, dateParser) {
var _info_StartDate = dateParser.parse(reconcile.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(reconcile.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -21,7 +23,11 @@ var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter'
$scope.show = function () {
var id = $scope.info.Account.LedgerID;
if (id === $routeParams.id && $scope.info.StartDate === $routeParams.StartDate && $scope.info.FinishDate === $routeParams.FinishDate) {
- Reconcile.get({id: id, StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate}, function (data) {
+ Reconcile.get({
+ id: id,
+ StartDate: $scope.info.StartDate,
+ FinishDate: $scope.info.FinishDate
+ }, function (data) {
$scope.info = data;
});
} else {
@@ -129,7 +135,7 @@ var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter'
$scope.accounts = function ($viewValue) {
return Account.autocomplete({term: $viewValue, count: 20, r: true}).$promise;
};
-}];
+}
ReconcileController.resolve = {
reconcile: ['$route', 'Reconcile', function ($route, Reconcile) {
diff --git a/brewman/static/app/salary-deduction/salary-deduction.controller.js b/brewman/static/app/salary-deduction/salary-deduction.controller.js
index 9823e5e2..5a2da503 100644
--- a/brewman/static/app/salary-deduction/salary-deduction.controller.js
+++ b/brewman/static/app/salary-deduction/salary-deduction.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var SalaryDeductionController = ['$scope', '$location', 'asDateFilter', '$uibModal', 'voucher', 'Employee', 'uibDateParser', function ($scope, $location, asDate, $modal, voucher, Employee, dateParser) {
+angular
+ .module('overlord')
+ .controller('SalaryDeductionController', SalaryDeductionController);
+SalaryDeductionController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'voucher', 'Employee', 'uibDateParser'];
+function SalaryDeductionController($scope, $location, asDate, $modal, voucher, Employee, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -159,7 +161,7 @@ var SalaryDeductionController = ['$scope', '$location', 'asDateFilter', '$uibMod
$scope.employees = function ($viewValue) {
return Employee.autocomplete({term: $viewValue, count: 20}).$promise;
};
-}];
+}
SalaryDeductionController.resolve = {
diff --git a/brewman/static/app/service-charge/service-charge.controller.js b/brewman/static/app/service-charge/service-charge.controller.js
index cbb45ffc..7cbb120e 100644
--- a/brewman/static/app/service-charge/service-charge.controller.js
+++ b/brewman/static/app/service-charge/service-charge.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var ServiceChargeController = ['$scope', '$location', '$routeParams', 'numberFilter', 'asDateFilter', '$uibModal', 'voucher', 'uibDateParser', function ($scope, $location, $routeParams, numberFilter, asDate, $modal, voucher, dateParser) {
+angular
+ .module('overlord')
+ .controller('ServiceChargeController', ServiceChargeController);
+ServiceChargeController.$inject = ['$scope', '$location', '$routeParams', 'numberFilter', 'asDateFilter', '$uibModal', 'voucher', 'uibDateParser'];
+function ServiceChargeController($scope, $location, $routeParams, numberFilter, asDate, $modal, voucher, dateParser) {
var _voucher_Date = dateParser.parse(voucher.Date, "dd-MMM-yyyy");
$scope.voucher_Date = function (value) {
if (arguments.length) {
@@ -105,7 +107,7 @@ var ServiceChargeController = ['$scope', '$location', '$routeParams', 'numberFil
$scope.delete();
});
};
-}];
+}
ServiceChargeController.resolve = {
diff --git a/brewman/static/app/settings/settings.controller.js b/brewman/static/app/settings/settings.controller.js
index 7fbfff4e..3f3fe87a 100644
--- a/brewman/static/app/settings/settings.controller.js
+++ b/brewman/static/app/settings/settings.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var SettingsController = ['$scope', '$http', 'asDateFilter', '$uibModal', 'lockInfo', 'maintenance', 'Product', 'uibDateParser', function ($scope, $http, asDate, $modal, lockInfo, maintenance, Product, dateParser) {
+angular
+ .module('overlord')
+ .controller('SettingsController', SettingsController);
+SettingsController.$inject = ['$scope', '$http', 'asDateFilter', '$uibModal', 'lockInfo', 'maintenance', 'Product', 'uibDateParser'];
+function SettingsController($scope, $http, asDate, $modal, lockInfo, maintenance, Product, dateParser) {
var _lockInfo_Start_Date,
_lockInfo_Finish_Date;
if (!angular.isUndefined(lockInfo.Start.Date)) {
@@ -162,7 +164,7 @@ var SettingsController = ['$scope', '$http', 'asDateFilter', '$uibModal', 'lockI
$scope.toasts.push({Type: 'Danger', Message: errorMessage});
});
};
-}];
+}
SettingsController.resolve = {
lockInfo: ['$http', function ($http) {
diff --git a/brewman/static/app/stock-movement/stock-movement.controller.js b/brewman/static/app/stock-movement/stock-movement.controller.js
index e2c5e026..4379927f 100644
--- a/brewman/static/app/stock-movement/stock-movement.controller.js
+++ b/brewman/static/app/stock-movement/stock-movement.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var StockMovementController = ['$scope', '$location', 'asDateFilter', 'stockMovement', 'uibDateParser', function ($scope, $location, asDate, stockMovement, dateParser) {
+angular
+ .module('overlord')
+ .controller('StockMovementController', StockMovementController);
+StockMovementController.$inject = ['$scope', '$location', 'asDateFilter', 'stockMovement', 'uibDateParser'];
+function StockMovementController($scope, $location, asDate, stockMovement, dateParser) {
var _info_StartDate = dateParser.parse(stockMovement.StartDate, "dd-MMM-yyyy"),
_info_FinishDate = dateParser.parse(stockMovement.FinishDate, "dd-MMM-yyyy");
$scope.info_StartDate = function (value) {
@@ -22,7 +24,7 @@ var StockMovementController = ['$scope', '$location', 'asDateFilter', 'stockMove
$location.path('/StockMovement').search({StartDate: $scope.info.StartDate, FinishDate: $scope.info.FinishDate});
};
$scope.foDate = true;
-}];
+}
StockMovementController.resolve = {
stockMovement: ['$route', 'StockMovement', function ($route, StockMovement) {
diff --git a/brewman/static/app/trial-balance/trial-balance.controller.js b/brewman/static/app/trial-balance/trial-balance.controller.js
index a4a126cc..b408b182 100644
--- a/brewman/static/app/trial-balance/trial-balance.controller.js
+++ b/brewman/static/app/trial-balance/trial-balance.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var TrialBalanceController = ['$scope', '$location', 'asDateFilter', 'trialBalance', 'uibDateParser', function ($scope, $location, asDate, trialBalance, dateParser) {
+angular
+ .module('overlord')
+ .controller('TrialBalanceController', TrialBalanceController);
+TrialBalanceController.$inject = ['$scope', '$location', 'asDateFilter', 'trialBalance', 'uibDateParser'];
+function TrialBalanceController($scope, $location, asDate, trialBalance, dateParser) {
var _info_Date = dateParser.parse(trialBalance.Date, "dd-MMM-yyyy");
$scope.info_Date = function (value) {
if (arguments.length) {
@@ -14,7 +16,7 @@ var TrialBalanceController = ['$scope', '$location', 'asDateFilter', 'trialBalan
$location.path('/TrialBalance/' + $scope.info.Date);
};
$scope.foDate = true;
-}];
+}
TrialBalanceController.resolve = {
trialBalance: ['$route', 'TrialBalance', function ($route, TrialBalance) {
var date = $route.current.params.date;
diff --git a/brewman/static/app/unposted/unposted.controller.js b/brewman/static/app/unposted/unposted.controller.js
index 1305337d..1b4e7344 100644
--- a/brewman/static/app/unposted/unposted.controller.js
+++ b/brewman/static/app/unposted/unposted.controller.js
@@ -1,6 +1,8 @@
-'use strict';
-
-var UnpostedController = ['$scope', 'info', 'Unposted', function ($scope, info, Unposted) {
+angular
+ .module('overlord')
+ .controller('UnpostedController', UnpostedController);
+UnpostedController.$inject = ['$scope', 'info', 'Unposted'];
+function UnpostedController($scope, info, Unposted) {
$scope.info = info;
$scope.refresh = function () {
Unposted.query({}, function (result) {
@@ -8,9 +10,9 @@ var UnpostedController = ['$scope', 'info', 'Unposted', function ($scope, info,
$scope.apply();
});
};
-}];
+}
UnpostedController.resolve = {
- info:['Unposted', function (Unposted) {
+ info: ['Unposted', function (Unposted) {
return Unposted.query({}).$promise;
}]
};
\ No newline at end of file
diff --git a/brewman/static/app/user/user.controller.js b/brewman/static/app/user/user.controller.js
index 641108b2..991b2a08 100644
--- a/brewman/static/app/user/user.controller.js
+++ b/brewman/static/app/user/user.controller.js
@@ -1,8 +1,10 @@
-'use strict';
-
-var UserListController = ['$scope', 'users', function ($scope, users) {
+angular
+ .module('overlord')
+ .controller('UserListController', UserListController);
+UserListController.$inject = ['$scope', 'users'];
+function UserListController($scope, users) {
$scope.info = users;
-}];
+}
UserListController.resolve = {
users: ['User', function (User) {
@@ -10,7 +12,11 @@ UserListController.resolve = {
}]
};
-var UserController = ['$scope', '$location', 'user', function ($scope, $location, user) {
+angular
+ .module('overlord')
+ .controller('UserController', UserController);
+UserController.$inject = ['$scope', '$location', 'user'];
+function UserController($scope, $location, user) {
$scope.user = user;
$scope.save = function () {
@@ -31,7 +37,7 @@ var UserController = ['$scope', '$location', 'user', function ($scope, $location
});
};
$scope.foName = true;
-}];
+}
UserController.resolve = {
user: ['$route', 'User', function ($route, User) {