Updates: Bootstrap updated to 3.3.1
Chosen updated to 1.3.0 AngularJS updated to 1.3.8 jQuery updated to 2.1.3 angular-loading-bar updated to 0.6.0 ui-bootstrap updated to 0.12.0 -- All the datepickers updated for is-open so that they open on focus. Chore: Replaces this in controllers with $scope. Don't know the downsides of using "this", but to prevent any unknown side-effects. Chore: Rename Crtl to Controller for all controllers.
This commit is contained in:
1 parent
b323a85f3a
commit
8347a3e603
114 files changed
+10295
-5548
No files matched your search
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var AccountListCtrl = ['$scope', '$location', '$routeParams', 'Tokenizer', 'accounts', function ($scope, $location, $routeParams, Tokenizer, accounts) {
|
||||
var AccountListController = ['$scope', '$location', '$routeParams', 'Tokenizer', 'accounts', function ($scope, $location, $routeParams, Tokenizer, accounts) {
|
||||
$scope.search = $routeParams.q || '';
|
||||
$scope.info = accounts;
|
||||
|
||||
@@ -70,13 +70,13 @@ var AccountListCtrl = ['$scope', '$location', '$routeParams', 'Tokenizer', 'acco
|
||||
}
|
||||
};
|
||||
}];
|
||||
AccountListCtrl.resolve = {
|
||||
AccountListController.resolve = {
|
||||
accounts: ['Account', function (Account) {
|
||||
return Account.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var AccountCtrl = ['$scope', '$location', '$modal', 'account', 'accountTypes', 'costCenters', function ($scope, $location, $modal, account, accountTypes, costCenters) {
|
||||
var AccountController = ['$scope', '$location', '$modal', 'account', 'accountTypes', 'costCenters', function ($scope, $location, $modal, account, accountTypes, costCenters) {
|
||||
$scope.account = account;
|
||||
|
||||
$scope.accountTypes = accountTypes;
|
||||
@@ -123,7 +123,7 @@ var AccountCtrl = ['$scope', '$location', '$modal', 'account', 'accountTypes', '
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
AccountCtrl.resolve = {
|
||||
AccountController.resolve = {
|
||||
account: ['$route', 'Account', function ($route, Account) {
|
||||
var id = $route.current.params.id;
|
||||
return Account.get({id: id}).$promise;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ overlordDirective.directive('ngGrowl', ['growl', '$parse', function (growl, $par
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attrs) {
|
||||
var options = {
|
||||
dismiss_function: attrs["toClose"]
|
||||
dismissFunction: attrs["toClose"]
|
||||
};
|
||||
growl.show(element, scope, options);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var AttendanceCtrl = ['$scope', '$location', 'asDateFilter', 'Attendance', 'attendanceTypes', 'info', function ($scope, $location, asDate, Attendance, attendanceTypes, info) {
|
||||
var AttendanceController = ['$scope', '$location', 'asDateFilter', 'Attendance', 'attendanceTypes', 'info', function ($scope, $location, asDate, Attendance, attendanceTypes, info) {
|
||||
$scope.attendanceTypes = attendanceTypes;
|
||||
$scope.info = info;
|
||||
$scope.show = function () {
|
||||
@@ -18,7 +18,7 @@ var AttendanceCtrl = ['$scope', '$location', 'asDateFilter', 'Attendance', 'atte
|
||||
$('#txtDate').focus();
|
||||
}];
|
||||
|
||||
var AttendanceSubCtrl = ['$scope', function ($scope) {
|
||||
var AttendanceSubController = ['$scope', function ($scope) {
|
||||
$scope.original = {};
|
||||
angular.copy($scope.item, $scope.original);
|
||||
|
||||
@@ -43,7 +43,7 @@ var AttendanceSubCtrl = ['$scope', function ($scope) {
|
||||
};
|
||||
}];
|
||||
|
||||
AttendanceCtrl.resolve = {
|
||||
AttendanceController.resolve = {
|
||||
info: ['$route', 'Attendance', function ($route, Attendance) {
|
||||
var date = $route.current.params.date;
|
||||
if (angular.isUndefined(date)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var BalanceSheetCtrl = ['$scope', '$location', 'asDateFilter', 'info', function ($scope, $location, asDate, info) {
|
||||
var BalanceSheetController = ['$scope', '$location', 'asDateFilter', 'info', function ($scope, $location, asDate, info) {
|
||||
$scope.info = info;
|
||||
$scope.show = function () {
|
||||
var date = asDate($scope.info.Date);
|
||||
@@ -9,7 +9,7 @@ var BalanceSheetCtrl = ['$scope', '$location', 'asDateFilter', 'info', function
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
|
||||
BalanceSheetCtrl.resolve = {
|
||||
BalanceSheetController.resolve = {
|
||||
info: ['$route', 'BalanceSheet', function ($route, BalanceSheet) {
|
||||
var date = $route.current.params.date;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var CashFlowCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'cashFlow', function ($scope, $routeParams, $location, asDate, cashFlow) {
|
||||
var CashFlowController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'cashFlow', function ($scope, $routeParams, $location, asDate, cashFlow) {
|
||||
$scope.info = cashFlow;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -9,7 +9,7 @@ var CashFlowCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'cash
|
||||
};
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
CashFlowCtrl.resolve = {
|
||||
CashFlowController.resolve = {
|
||||
cashFlow: ['$route', 'CashFlow', function ($route, CashFlow) {
|
||||
var id = $route.current.params.id,
|
||||
startDate = $route.current.params.StartDate,
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var ClientListCtrl = ['$scope', 'clients', function ($scope, clients) {
|
||||
var ClientListController = ['$scope', 'clients', function ($scope, clients) {
|
||||
$scope.info = clients;
|
||||
}];
|
||||
|
||||
ClientListCtrl.resolve = {
|
||||
ClientListController.resolve = {
|
||||
clients: ['Client', function (Client) {
|
||||
return Client.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var ClientCtrl = ['$scope', '$location', '$modal', 'client', function ($scope, $location, $modal, client) {
|
||||
var ClientController = ['$scope', '$location', '$modal', 'client', function ($scope, $location, $modal, client) {
|
||||
$scope.client = client;
|
||||
|
||||
$scope.save = function () {
|
||||
@@ -54,7 +54,7 @@ var ClientCtrl = ['$scope', '$location', '$modal', 'client', function ($scope, $
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
ClientCtrl.resolve = {
|
||||
ClientController.resolve = {
|
||||
client: ['$route', 'Client', function ($route, Client) {
|
||||
var id = $route.current.params.id;
|
||||
return Client.get({id: id}).$promise;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ClosingStockCtrl = ['$scope', '$location', 'asDateFilter', 'info', function ($scope, $location, asDate, info) {
|
||||
var ClosingStockController = ['$scope', '$location', 'asDateFilter', 'info', function ($scope, $location, asDate, info) {
|
||||
$scope.info = info;
|
||||
$scope.show = function () {
|
||||
var date = asDate($scope.info.Date);
|
||||
@@ -9,7 +9,7 @@ var ClosingStockCtrl = ['$scope', '$location', 'asDateFilter', 'info', function
|
||||
$('#txtDate').focus();
|
||||
}];
|
||||
|
||||
ClosingStockCtrl.resolve = {
|
||||
ClosingStockController.resolve = {
|
||||
info: ['$route', 'ClosingStock', function ($route, ClosingStock) {
|
||||
var date = $route.current.params.date;
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var CostCenterListCtrl = ['$scope', 'costCenters', function ($scope, costCenters) {
|
||||
var CostCenterListController = ['$scope', 'costCenters', function ($scope, costCenters) {
|
||||
$scope.info = costCenters;
|
||||
}];
|
||||
|
||||
CostCenterListCtrl.resolve = {
|
||||
CostCenterListController.resolve = {
|
||||
costCenters: ['CostCenter', function (CostCenter) {
|
||||
return CostCenter.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var CostCenterCtrl = ['$scope', '$routeParams', '$location', 'costCenter', function ($scope, $routeParams, $location, costCenter) {
|
||||
var CostCenterController = ['$scope', '$routeParams', '$location', 'costCenter', function ($scope, $routeParams, $location, costCenter) {
|
||||
$scope.costCenter = costCenter;
|
||||
|
||||
$scope.save = function () {
|
||||
@@ -33,7 +33,7 @@ var CostCenterCtrl = ['$scope', '$routeParams', '$location', 'costCenter', funct
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
CostCenterCtrl.resolve = {
|
||||
CostCenterController.resolve = {
|
||||
costCenter: ['$route', 'CostCenter', function ($route, CostCenter) {
|
||||
var id = $route.current.params.id;
|
||||
return CostCenter.get({id: id}).$promise;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var DaybookCtrl = ['$scope', '$location', 'asDateFilter', 'info', function ($scope, $location, asDate, info) {
|
||||
var DaybookController = ['$scope', '$location', 'asDateFilter', 'info', function ($scope, $location, asDate, info) {
|
||||
$scope.info = info;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -9,7 +9,7 @@ var DaybookCtrl = ['$scope', '$location', 'asDateFilter', 'info', function ($sco
|
||||
};
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
DaybookCtrl.resolve = {
|
||||
DaybookController.resolve = {
|
||||
info: ['$route', 'Daybook', function ($route, Daybook) {
|
||||
var startDate = $route.current.params.StartDate,
|
||||
finishDate = $route.current.params.FinishDate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var EmployeeAttendanceCtrl = ['$scope', '$location', '$routeParams', 'asDateFilter', 'EmployeeAttendance', 'attendanceTypes', 'info', 'Employee', function ($scope, $location, $routeParams, asDate, EmployeeAttendance, attendanceTypes, info, Employee) {
|
||||
var EmployeeAttendanceController = ['$scope', '$location', '$routeParams', 'asDateFilter', 'EmployeeAttendance', 'attendanceTypes', 'info', 'Employee', function ($scope, $location, $routeParams, asDate, EmployeeAttendance, attendanceTypes, info, Employee) {
|
||||
$scope.attendanceTypes = attendanceTypes;
|
||||
$scope.info = info;
|
||||
$scope.show = function () {
|
||||
@@ -31,7 +31,7 @@ var EmployeeAttendanceCtrl = ['$scope', '$location', '$routeParams', 'asDateFilt
|
||||
$('#txtEmployee').focus();
|
||||
}];
|
||||
|
||||
var EmployeeAttendanceSubCtrl = ['$scope', function ($scope) {
|
||||
var EmployeeAttendanceSubController = ['$scope', function ($scope) {
|
||||
$scope.original = {};
|
||||
angular.copy($scope.item, $scope.original);
|
||||
|
||||
@@ -55,7 +55,7 @@ var EmployeeAttendanceSubCtrl = ['$scope', function ($scope) {
|
||||
return !angular.equals($scope.original, $scope.item)
|
||||
};
|
||||
}];
|
||||
EmployeeAttendanceCtrl.resolve = {
|
||||
EmployeeAttendanceController.resolve = {
|
||||
info: ['$route', 'EmployeeAttendance', function ($route, EmployeeAttendance) {
|
||||
var id = $route.current.params.id,
|
||||
startDate = $route.current.params.StartDate,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var EmployeeFunctionsCtrl = ['$scope', '$http', 'asDateFilter', function ($scope, $http, asDate) {
|
||||
var EmployeeFunctionsController = ['$scope', '$http', 'asDateFilter', function ($scope, $http, asDate) {
|
||||
$scope.record = {};
|
||||
$scope.creditSalary = function () {
|
||||
if (!angular.isDate($scope.salaryMonth)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var EmployeeListCtrl = ['$scope', '$location', '$routeParams', 'Tokenizer', 'employees', function ($scope, $location, $routeParams, Tokenizer, employees) {
|
||||
var EmployeeListController = ['$scope', '$location', '$routeParams', 'Tokenizer', 'employees', function ($scope, $location, $routeParams, Tokenizer, employees) {
|
||||
$scope.search = $routeParams.q || '';
|
||||
$scope.info = employees;
|
||||
|
||||
@@ -73,13 +73,13 @@ var EmployeeListCtrl = ['$scope', '$location', '$routeParams', 'Tokenizer', 'emp
|
||||
};
|
||||
}];
|
||||
|
||||
EmployeeListCtrl.resolve = {
|
||||
EmployeeListController.resolve = {
|
||||
employees: ['Employee', function (Employee) {
|
||||
return Employee.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var EmployeeCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$modal', 'employee', 'costCenters', function ($scope, $routeParams, $location, asDate, $modal, employee, costCenters) {
|
||||
var EmployeeController = ['$scope', '$routeParams', '$location', 'asDateFilter', '$modal', 'employee', 'costCenters', function ($scope, $routeParams, $location, asDate, $modal, employee, costCenters) {
|
||||
$scope.employee = employee;
|
||||
|
||||
$scope.costCenters = costCenters;
|
||||
@@ -128,7 +128,7 @@ var EmployeeCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$mod
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
EmployeeCtrl.resolve = {
|
||||
EmployeeController.resolve = {
|
||||
employee: ['$route', 'Employee', function ($route, Employee) {
|
||||
var id = $route.current.params.id;
|
||||
return Employee.get({id: id}).$promise;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var GroupListCtrl = ['$scope', 'groups', function ($scope, groups) {
|
||||
var GroupListController = ['$scope', 'groups', function ($scope, groups) {
|
||||
$scope.info = groups;
|
||||
}];
|
||||
|
||||
GroupListCtrl.resolve = {
|
||||
GroupListController.resolve = {
|
||||
groups: ['Group', function (Group) {
|
||||
return Group.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var GroupCtrl = ['$scope', '$location', 'group', function ($scope, $location, group) {
|
||||
var GroupController = ['$scope', '$location', 'group', function ($scope, $location, group) {
|
||||
$scope.group = group;
|
||||
|
||||
$scope.save = function () {
|
||||
@@ -33,7 +33,7 @@ var GroupCtrl = ['$scope', '$location', 'group', function ($scope, $location, gr
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
GroupCtrl.resolve = {
|
||||
GroupController.resolve = {
|
||||
group: ['$route', 'Group', function ($route, Group) {
|
||||
var id = $route.current.params.id;
|
||||
return Group.get({id: id}).$promise;
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
|
||||
overlordService.factory('growl', ['$http', '$compile', '$timeout', function ($http, $compile, $timeout) {
|
||||
var growl = {};
|
||||
growl.default_options = {
|
||||
growl.defaultOptions = {
|
||||
offset: {
|
||||
from: "top",
|
||||
amount: 20
|
||||
},
|
||||
align: "right",
|
||||
width: 250,
|
||||
duration:500,
|
||||
duration: 500,
|
||||
delay: 4000,
|
||||
stackup_spacing: 10
|
||||
};
|
||||
|
||||
growl.show = function (element, scope, options) {
|
||||
var options = jQuery.extend({}, growl.default_options, options);
|
||||
var options = jQuery.extend({}, growl.defaultOptions, options);
|
||||
if (options.top_offset) {
|
||||
options.offset = {
|
||||
from: "top",
|
||||
@@ -52,13 +52,12 @@ overlordService.factory('growl', ['$http', '$compile', '$timeout', function ($ht
|
||||
element.fadeIn(options.duration);
|
||||
if (options.delay > 0) {
|
||||
$timeout(function () {
|
||||
element.fadeOut(options.duration, function() {
|
||||
scope.$eval(options.dismiss_function);
|
||||
element.fadeOut(options.duration, function () {
|
||||
scope.$eval(options.dismissFunction);
|
||||
});
|
||||
}, options.delay);
|
||||
}
|
||||
return element;
|
||||
};
|
||||
return growl;
|
||||
}])
|
||||
;
|
||||
}]);
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var HomeCtrl = ['$scope', '$location', '$http', 'asDateFilter', 'messages', 'dashboard', 'Message', function ($scope, $location, $http, asDate, messages, dashboard, Message) {
|
||||
var HomeController = ['$scope', '$location', '$http', 'asDateFilter', 'messages', 'dashboard', 'Message', function ($scope, $location, $http, asDate, messages, dashboard, Message) {
|
||||
$scope.chosen = messages.Type;
|
||||
$scope.dashboard = dashboard;
|
||||
$scope.info = messages.Threads;
|
||||
@@ -105,7 +105,7 @@ var HomeCtrl = ['$scope', '$location', '$http', 'asDateFilter', 'messages', 'das
|
||||
|
||||
formatData();
|
||||
}];
|
||||
HomeCtrl.resolve = {
|
||||
HomeController.resolve = {
|
||||
messages: ['Message', function (Message) {
|
||||
return Message.query({type: 'open'}).$promise;
|
||||
}],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher', 'costCenters', 'smallGrid', 'IssueGrid', 'Voucher', '$modal', 'Batch', function ($scope, $routeParams, $location, asDate, voucher, costCenters, smallGrid, IssueGrid, Voucher, $modal, Batch) {
|
||||
var IssueController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher', 'costCenters', 'smallGrid', 'IssueGrid', 'Voucher', '$modal', 'Batch', function ($scope, $routeParams, $location, asDate, voucher, costCenters, smallGrid, IssueGrid, Voucher, $modal, Batch) {
|
||||
$scope.voucher = voucher;
|
||||
$scope.costCenters = costCenters;
|
||||
$scope.smallGrid = smallGrid;
|
||||
@@ -19,7 +19,7 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
}
|
||||
|
||||
$scope.add = function () {
|
||||
var oldInventory = getOld($scope.batch.Product.ProductID, this.voucher.Inventories),
|
||||
var oldInventory = getOld($scope.batch.Product.ProductID, $scope.voucher.Inventories),
|
||||
quantity = Number($scope.quantity),
|
||||
consumption = (getDebitCredit($scope.voucher.Journals, -1) === '7b845f95-dfef-fa4a-897c-f0baf15284a3');
|
||||
|
||||
@@ -37,7 +37,7 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
}
|
||||
|
||||
if (angular.isUndefined(oldInventory) && (!consumption || quantity <= $scope.batch.QuantityRemaining)) {
|
||||
this.voucher.Inventories.push(
|
||||
$scope.voucher.Inventories.push(
|
||||
{
|
||||
Product: $scope.batch.Product,
|
||||
Quantity: quantity,
|
||||
@@ -53,8 +53,8 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
}
|
||||
};
|
||||
$scope.removeInventory = function (inventory) {
|
||||
var index = this.voucher.Inventories.indexOf(inventory);
|
||||
this.voucher.Inventories.splice(index, 1);
|
||||
var index = $scope.voucher.Inventories.indexOf(inventory);
|
||||
$scope.voucher.Inventories.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('voucher.Date', function (newDate, oldDate) {
|
||||
@@ -64,9 +64,16 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
|
||||
if (nDate !== oDate && !angular.isUndefined(nDate)) {
|
||||
if (!angular.isUndefined($routeParams.Source) && !angular.isUndefined($routeParams.Destination) && !angular.isUndefined($routeParams.id)) {
|
||||
$location.path('/Issue/' + nDate).search({Source: $routeParams.Source, Destination: $routeParams.Destination});
|
||||
$location.path('/Issue/' + nDate).search({
|
||||
Source: $routeParams.Source,
|
||||
Destination: $routeParams.Destination
|
||||
});
|
||||
} else {
|
||||
$scope.smallGrid = IssueGrid.query({date: nDate, Source: $routeParams.Source, Destination: $routeParams.Destination});
|
||||
$scope.smallGrid = IssueGrid.query({
|
||||
date: nDate,
|
||||
Source: $routeParams.Source,
|
||||
Destination: $routeParams.Destination
|
||||
});
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
@@ -90,9 +97,16 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
}
|
||||
|
||||
if (!angular.isUndefined($routeParams.Source) && !angular.isUndefined($routeParams.Destination) && !angular.isUndefined($routeParams.id)) {
|
||||
$location.path('/Issue/' + $scope.voucher.Date).search({Source: getDebitCredit(newJournals, -1), Destination: getDebitCredit(newJournals, 1)});
|
||||
$location.path('/Issue/' + $scope.voucher.Date).search({
|
||||
Source: getDebitCredit(newJournals, -1),
|
||||
Destination: getDebitCredit(newJournals, 1)
|
||||
});
|
||||
} else {
|
||||
$scope.smallGrid = IssueGrid.query({date: $scope.voucher.Date, Source: getDebitCredit(newJournals, -1), Destination: getDebitCredit(newJournals, 1)});
|
||||
$scope.smallGrid = IssueGrid.query({
|
||||
date: $scope.voucher.Date,
|
||||
Source: getDebitCredit(newJournals, -1),
|
||||
Destination: getDebitCredit(newJournals, 1)
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
|
||||
@@ -159,10 +173,19 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
};
|
||||
$scope.redirectOnSave = function (voucher) {
|
||||
if (!angular.isUndefined($routeParams.Source) && !angular.isUndefined($routeParams.Destination) && !angular.isUndefined($routeParams.id)) {
|
||||
Voucher.get({type: 'Issue', Date: $routeParams.id, Source: $routeParams.Source, Destination: $routeParams.Destination}, function (u, putResponseHeaders) {
|
||||
Voucher.get({
|
||||
type: 'Issue',
|
||||
Date: $routeParams.id,
|
||||
Source: $routeParams.Source,
|
||||
Destination: $routeParams.Destination
|
||||
}, function (u, putResponseHeaders) {
|
||||
$scope.voucher = u;
|
||||
});
|
||||
$scope.smallGrid = IssueGrid.query({date: $routeParams.id, Source: $routeParams.Source, Destination: $routeParams.Destination});
|
||||
$scope.smallGrid = IssueGrid.query({
|
||||
date: $routeParams.id,
|
||||
Source: $routeParams.Source,
|
||||
Destination: $routeParams.Destination
|
||||
});
|
||||
} else {
|
||||
var date = voucher.Date;
|
||||
var source = getDebitCredit(voucher.Journals, -1);
|
||||
@@ -177,11 +200,14 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
angular.copy($scope.selectedInventory, edit);
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: true,
|
||||
size: 'lg',
|
||||
templateUrl: '/partial/issue-modal.html',
|
||||
controller: IssueModalCtrl,
|
||||
resolve: {edit: function () {
|
||||
return edit;
|
||||
}}
|
||||
controller: IssueModalController,
|
||||
resolve: {
|
||||
edit: function () {
|
||||
return edit;
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function (updated) {
|
||||
if (updated.Product.ProductID !== $scope.selectedInventory.Batch.Product.ProductID) {
|
||||
@@ -226,7 +252,7 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'voucher
|
||||
};
|
||||
}];
|
||||
|
||||
IssueCtrl.resolve = {
|
||||
IssueController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id,
|
||||
source = $route.current.params.Source,
|
||||
@@ -258,7 +284,7 @@ IssueCtrl.resolve = {
|
||||
}]
|
||||
};
|
||||
|
||||
var IssueModalCtrl = ['$scope', '$modalInstance', 'edit', 'Batch', function ($scope, $modalInstance, edit, Batch) {
|
||||
var IssueModalController = ['$scope', '$modalInstance', 'edit', 'Batch', function ($scope, $modalInstance, edit, Batch) {
|
||||
$scope.edit = edit;
|
||||
$scope.ok = function () {
|
||||
$scope.edit.Product = $scope.edit.Batch.Product;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var JournalCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account) {
|
||||
var JournalController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account) {
|
||||
$('#txtAccount').focus();
|
||||
|
||||
$scope.voucher = voucher;
|
||||
@@ -38,7 +38,7 @@ var JournalCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
if (!$scope.account || !$scope.account.LedgerID || !$scope.amount || Number(!$scope.amount)) {
|
||||
return;
|
||||
}
|
||||
var oldJournal = getOld($scope.account.LedgerID, this.voucher.Journals);
|
||||
var oldJournal = getOld($scope.account.LedgerID, $scope.voucher.Journals);
|
||||
if (!angular.isUndefined(oldJournal)) {
|
||||
var amount = (oldJournal.Debit * oldJournal.Amount) + (parseInt($scope.debit) * Number($scope.amount));
|
||||
if (amount < 0) {
|
||||
@@ -49,7 +49,7 @@ var JournalCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
oldJournal.Amount = amount;
|
||||
}
|
||||
} else {
|
||||
this.voucher.Journals.push({Debit: $scope.debit, Amount: Number($scope.amount), Ledger: $scope.account});
|
||||
$scope.voucher.Journals.push({Debit: $scope.debit, Amount: Number($scope.amount), Ledger: $scope.account});
|
||||
}
|
||||
delete $scope.account;
|
||||
delete $scope.amount;
|
||||
@@ -57,8 +57,8 @@ var JournalCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
};
|
||||
|
||||
$scope.removeJournal = function (journal) {
|
||||
var index = this.voucher.Journals.indexOf(journal);
|
||||
this.voucher.Journals.splice(index, 1);
|
||||
var index = $scope.voucher.Journals.indexOf(journal);
|
||||
$scope.voucher.Journals.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('voucher.Journals', function (journals) {
|
||||
@@ -118,11 +118,14 @@ var JournalCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
angular.copy($scope.selectedJournal, edit);
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: true,
|
||||
size: 'lg',
|
||||
templateUrl: '/partial/journal-modal.html',
|
||||
controller: JournalModalCtrl,
|
||||
resolve: {edit: function () {
|
||||
return edit;
|
||||
}}
|
||||
controller: JournalModalController,
|
||||
resolve: {
|
||||
edit: function () {
|
||||
return edit;
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function (updated) {
|
||||
if (updated.Ledger.LedgerID !== $scope.selectedJournal.Ledger.LedgerID) {
|
||||
@@ -166,7 +169,7 @@ var JournalCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
};
|
||||
}];
|
||||
|
||||
JournalCtrl.resolve = {
|
||||
JournalController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id;
|
||||
if (angular.isUndefined(id)) {
|
||||
@@ -177,7 +180,7 @@ JournalCtrl.resolve = {
|
||||
}]
|
||||
};
|
||||
|
||||
var JournalModalCtrl = ['$scope', '$modalInstance', 'edit', 'Account', function ($scope, $modalInstance, edit, Account) {
|
||||
var JournalModalController = ['$scope', '$modalInstance', 'edit', 'Account', function ($scope, $modalInstance, edit, Account) {
|
||||
$scope.toggleDebit = function () {
|
||||
$scope.edit.Debit = ($scope.edit.Debit === 1) ? -1 : 1;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var LedgerCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ledger', 'Ledger', 'Account', function ($scope, $routeParams, $location, asDate, ledger, Ledger, Account) {
|
||||
var LedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ledger', 'Ledger', 'Account', function ($scope, $routeParams, $location, asDate, ledger, Ledger, Account) {
|
||||
$scope.info = ledger;
|
||||
$scope.hidden = [];
|
||||
$scope.show = function () {
|
||||
@@ -138,7 +138,7 @@ var LedgerCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ledger
|
||||
};
|
||||
}];
|
||||
|
||||
LedgerCtrl.resolve = {
|
||||
LedgerController.resolve = {
|
||||
ledger: ['$route', 'Ledger', function ($route, Ledger) {
|
||||
var id = $route.current.params.id,
|
||||
startDate = $route.current.params.StartDate,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var LoginCtrl = ['$scope', '$http', '$location', '$routeParams', '$cookieStore', function ($scope, $http, $location, $routeParams, $cookieStore) {
|
||||
var LoginController = ['$scope', '$http', '$location', '$routeParams', '$cookieStore', function ($scope, $http, $location, $routeParams, $cookieStore) {
|
||||
$scope.showOTP = false;
|
||||
$scope.submit = function () {
|
||||
var data;
|
||||
@@ -32,7 +32,7 @@ var LoginCtrl = ['$scope', '$http', '$location', '$routeParams', '$cookieStore',
|
||||
$('#username').focus();
|
||||
}];
|
||||
|
||||
var LogoutCtrl = ['$scope', '$http', '$location', function ($scope, $http, $location) {
|
||||
var LogoutController = ['$scope', '$http', '$location', function ($scope, $http, $location) {
|
||||
$http.
|
||||
post('/logout').
|
||||
success(function () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var MessageCtrl = ['$scope', '$location', 'asDateFilter', 'message', 'tags', 'users', 'priorities', function ($scope, $location, asDate, message, tags, users, priorities) {
|
||||
var MessageController = ['$scope', '$location', 'asDateFilter', 'message', 'tags', 'users', 'priorities', function ($scope, $location, asDate, message, tags, users, priorities) {
|
||||
$scope.message = message;
|
||||
$scope.priorities = priorities
|
||||
$scope.tags = tags;
|
||||
@@ -36,7 +36,7 @@ var MessageCtrl = ['$scope', '$location', 'asDateFilter', 'message', 'tags', 'us
|
||||
$('#txtTitle').focus();
|
||||
}];
|
||||
|
||||
MessageCtrl.resolve = {
|
||||
MessageController.resolve = {
|
||||
message: ['$route', 'Message', function ($route, Message) {
|
||||
var id = $route.current.params.id;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var NetTransactionsCtrl = ['$scope', '$location', 'asDateFilter', 'netTransactions', function ($scope, $location, asDate, netTransactions) {
|
||||
var NetTransactionsController = ['$scope', '$location', 'asDateFilter', 'netTransactions', function ($scope, $location, asDate, netTransactions) {
|
||||
$scope.info = netTransactions;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -10,7 +10,7 @@ var NetTransactionsCtrl = ['$scope', '$location', 'asDateFilter', 'netTransactio
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
|
||||
NetTransactionsCtrl.resolve = {
|
||||
NetTransactionsController.resolve = {
|
||||
netTransactions: ['$route', 'NetTransactions', function ($route, NetTransactions) {
|
||||
var startDate = $route.current.params.StartDate,
|
||||
finishDate = $route.current.params.FinishDate;
|
||||
|
||||
@@ -3,109 +3,109 @@
|
||||
var overlord = angular.module('overlord', ['overlord.directive', 'overlord.filter', 'overlord.service', 'ngCookies', 'ngRoute', 'ui.bootstrap', 'chieffancypants.loadingBar'])
|
||||
.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
|
||||
$routeProvider.
|
||||
when('/', {templateUrl: '/partial/home.html', controller: HomeCtrl, resolve: HomeCtrl.resolve}).
|
||||
when('/login', {templateUrl: '/partial/login.html', controller: LoginCtrl}).
|
||||
when('/logout', {templateUrl: '/partial/home.html', controller: LogoutCtrl}).
|
||||
when('/', {templateUrl: '/partial/home.html', controller: HomeController, resolve: HomeController.resolve}).
|
||||
when('/login', {templateUrl: '/partial/login.html', controller: LoginController}).
|
||||
when('/logout', {templateUrl: '/partial/home.html', controller: LogoutController}).
|
||||
|
||||
when('/Journal', {templateUrl: '/partial/journal.html', controller: JournalCtrl, resolve: JournalCtrl.resolve}).
|
||||
when('/Journal/:id', {templateUrl: '/partial/journal.html', controller: JournalCtrl, resolve: JournalCtrl.resolve}).
|
||||
when('/Journal', {templateUrl: '/partial/journal.html', controller: JournalController, resolve: JournalController.resolve}).
|
||||
when('/Journal/:id', {templateUrl: '/partial/journal.html', controller: JournalController, resolve: JournalController.resolve}).
|
||||
|
||||
when('/Payment', {templateUrl: '/partial/payment.html', controller: PaymentCtrl, resolve: PaymentCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Payment/:id', {templateUrl: '/partial/payment.html', controller: PaymentCtrl, resolve: PaymentCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Payment', {templateUrl: '/partial/payment.html', controller: PaymentController, resolve: PaymentController.resolve, reloadOnSearch:false}).
|
||||
when('/Payment/:id', {templateUrl: '/partial/payment.html', controller: PaymentController, resolve: PaymentController.resolve, reloadOnSearch:false}).
|
||||
|
||||
when('/Receipt', {templateUrl: '/partial/receipt.html', controller: ReceiptCtrl, resolve: ReceiptCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Receipt/:id', {templateUrl: '/partial/receipt.html', controller: ReceiptCtrl, resolve: ReceiptCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Receipt', {templateUrl: '/partial/receipt.html', controller: ReceiptController, resolve: ReceiptController.resolve, reloadOnSearch:false}).
|
||||
when('/Receipt/:id', {templateUrl: '/partial/receipt.html', controller: ReceiptController, resolve: ReceiptController.resolve, reloadOnSearch:false}).
|
||||
|
||||
when('/Purchase', {templateUrl: '/partial/purchase.html', controller: PurchaseCtrl, resolve: PurchaseCtrl.resolve}).
|
||||
when('/Purchase/:id', {templateUrl: '/partial/purchase.html', controller: PurchaseCtrl, resolve: PurchaseCtrl.resolve}).
|
||||
when('/Purchase', {templateUrl: '/partial/purchase.html', controller: PurchaseController, resolve: PurchaseController.resolve}).
|
||||
when('/Purchase/:id', {templateUrl: '/partial/purchase.html', controller: PurchaseController, resolve: PurchaseController.resolve}).
|
||||
|
||||
when('/Return', {templateUrl: '/partial/purchase-return.html', controller: PurchaseReturnCtrl, resolve: PurchaseReturnCtrl.resolve}).
|
||||
when('/Return/:id', {templateUrl: '/partial/purchase-return.html', controller: PurchaseReturnCtrl, resolve: PurchaseReturnCtrl.resolve}).
|
||||
when('/Return', {templateUrl: '/partial/purchase-return.html', controller: PurchaseReturnController, resolve: PurchaseReturnController.resolve}).
|
||||
when('/Return/:id', {templateUrl: '/partial/purchase-return.html', controller: PurchaseReturnController, resolve: PurchaseReturnController.resolve}).
|
||||
|
||||
when('/Issue', {templateUrl: '/partial/issue.html', controller: IssueCtrl, resolve: IssueCtrl.resolve}).
|
||||
when('/Issue/:id', {templateUrl: '/partial/issue.html', controller: IssueCtrl, resolve: IssueCtrl.resolve}).
|
||||
when('/Issue', {templateUrl: '/partial/issue.html', controller: IssueController, resolve: IssueController.resolve}).
|
||||
when('/Issue/:id', {templateUrl: '/partial/issue.html', controller: IssueController, resolve: IssueController.resolve}).
|
||||
|
||||
when('/SalaryDeduction', {templateUrl: '/partial/salary-deduction.html', controller: SalaryDeductionCtrl, resolve: SalaryDeductionCtrl.resolve}).
|
||||
when('/SalaryDeduction/:id', {templateUrl: '/partial/salary-deduction.html', controller: SalaryDeductionCtrl, resolve: SalaryDeductionCtrl.resolve}).
|
||||
when('/SalaryDeduction', {templateUrl: '/partial/salary-deduction.html', controller: SalaryDeductionController, resolve: SalaryDeductionController.resolve}).
|
||||
when('/SalaryDeduction/:id', {templateUrl: '/partial/salary-deduction.html', controller: SalaryDeductionController, resolve: SalaryDeductionController.resolve}).
|
||||
|
||||
when('/Ledger', {templateUrl: '/partial/ledger.html', controller: LedgerCtrl, resolve: LedgerCtrl.resolve}).
|
||||
when('/Ledger/:id', {templateUrl: '/partial/ledger.html', controller: LedgerCtrl, resolve: LedgerCtrl.resolve}).
|
||||
when('/Ledger', {templateUrl: '/partial/ledger.html', controller: LedgerController, resolve: LedgerController.resolve}).
|
||||
when('/Ledger/:id', {templateUrl: '/partial/ledger.html', controller: LedgerController, resolve: LedgerController.resolve}).
|
||||
|
||||
when('/Reconcile', {templateUrl: '/partial/reconcile.html', controller: ReconcileCtrl, resolve: ReconcileCtrl.resolve}).
|
||||
when('/Reconcile/:id', {templateUrl: '/partial/reconcile.html', controller: ReconcileCtrl, resolve: ReconcileCtrl.resolve}).
|
||||
when('/Reconcile', {templateUrl: '/partial/reconcile.html', controller: ReconcileController, resolve: ReconcileController.resolve}).
|
||||
when('/Reconcile/:id', {templateUrl: '/partial/reconcile.html', controller: ReconcileController, resolve: ReconcileController.resolve}).
|
||||
|
||||
when('/ProductLedger', {templateUrl: '/partial/product-ledger.html', controller: ProductLedgerCtrl, resolve: ProductLedgerCtrl.resolve}).
|
||||
when('/ProductLedger/:id', {templateUrl: '/partial/product-ledger.html', controller: ProductLedgerCtrl, resolve: ProductLedgerCtrl.resolve}).
|
||||
when('/ProductLedger', {templateUrl: '/partial/product-ledger.html', controller: ProductLedgerController, resolve: ProductLedgerController.resolve}).
|
||||
when('/ProductLedger/:id', {templateUrl: '/partial/product-ledger.html', controller: ProductLedgerController, resolve: ProductLedgerController.resolve}).
|
||||
|
||||
when('/CashFlow', {templateUrl: '/partial/cash-flow.html', controller: CashFlowCtrl, resolve: CashFlowCtrl.resolve}).
|
||||
when('/CashFlow/:id', {templateUrl: '/partial/cash-flow.html', controller: CashFlowCtrl, resolve: CashFlowCtrl.resolve}).
|
||||
when('/CashFlow', {templateUrl: '/partial/cash-flow.html', controller: CashFlowController, resolve: CashFlowController.resolve}).
|
||||
when('/CashFlow/:id', {templateUrl: '/partial/cash-flow.html', controller: CashFlowController, resolve: CashFlowController.resolve}).
|
||||
|
||||
when('/RawMaterialCost', {templateUrl: '/partial/raw-material-cost.html', controller: RawMaterialCostCtrl, resolve: RawMaterialCostCtrl.resolve}).
|
||||
when('/RawMaterialCost/:id', {templateUrl: '/partial/raw-material-cost-detail.html', controller: RawMaterialCostCtrl, resolve: RawMaterialCostCtrl.resolve}).
|
||||
when('/RawMaterialCost', {templateUrl: '/partial/raw-material-cost.html', controller: RawMaterialCostController, resolve: RawMaterialCostController.resolve}).
|
||||
when('/RawMaterialCost/:id', {templateUrl: '/partial/raw-material-cost-detail.html', controller: RawMaterialCostController, resolve: RawMaterialCostController.resolve}).
|
||||
|
||||
when('/Attendance', {templateUrl: '/partial/attendance.html', controller: AttendanceCtrl, resolve: AttendanceCtrl.resolve}).
|
||||
when('/Attendance/:date', {templateUrl: '/partial/attendance.html', controller: AttendanceCtrl, resolve: AttendanceCtrl.resolve}).
|
||||
when('/Attendance', {templateUrl: '/partial/attendance.html', controller: AttendanceController, resolve: AttendanceController.resolve}).
|
||||
when('/Attendance/:date', {templateUrl: '/partial/attendance.html', controller: AttendanceController, resolve: AttendanceController.resolve}).
|
||||
|
||||
when('/EmployeeAttendance', {templateUrl: '/partial/employee-attendance.html', controller: EmployeeAttendanceCtrl, resolve: EmployeeAttendanceCtrl.resolve}).
|
||||
when('/EmployeeAttendance/:id', {templateUrl: '/partial/employee-attendance.html', controller: EmployeeAttendanceCtrl, resolve: EmployeeAttendanceCtrl.resolve}).
|
||||
when('/EmployeeAttendance', {templateUrl: '/partial/employee-attendance.html', controller: EmployeeAttendanceController, resolve: EmployeeAttendanceController.resolve}).
|
||||
when('/EmployeeAttendance/:id', {templateUrl: '/partial/employee-attendance.html', controller: EmployeeAttendanceController, resolve: EmployeeAttendanceController.resolve}).
|
||||
|
||||
when('/Daybook', {templateUrl: '/partial/daybook.html', controller: DaybookCtrl, resolve: DaybookCtrl.resolve}).
|
||||
when('/Unposted', {templateUrl: '/partial/unposted.html', controller: UnpostedCtrl, resolve: UnpostedCtrl.resolve}).
|
||||
when('/ProfitLoss', {templateUrl: '/partial/profit-loss.html', controller: ProfitLossCtrl, resolve: ProfitLossCtrl.resolve}).
|
||||
when('/StockMovement', {templateUrl: '/partial/stock-movement.html', controller: StockMovementCtrl, resolve: StockMovementCtrl.resolve}).
|
||||
when('/NetTransactions', {templateUrl: '/partial/net-transactions.html', controller: NetTransactionsCtrl, resolve: NetTransactionsCtrl.resolve}).
|
||||
when('/PurchaseEntries', {templateUrl: '/partial/purchase-entries.html', controller: PurchaseEntriesCtrl, resolve: PurchaseEntriesCtrl.resolve}).
|
||||
when('/Purchases', {templateUrl: '/partial/purchases.html', controller: PurchasesCtrl, resolve: PurchasesCtrl.resolve}).
|
||||
when('/EmployeeFunctions', {templateUrl: '/partial/employee-functions.html', controller: EmployeeFunctionsCtrl}).
|
||||
when('/Daybook', {templateUrl: '/partial/daybook.html', controller: DaybookController, resolve: DaybookController.resolve}).
|
||||
when('/Unposted', {templateUrl: '/partial/unposted.html', controller: UnpostedController, resolve: UnpostedController.resolve}).
|
||||
when('/ProfitLoss', {templateUrl: '/partial/profit-loss.html', controller: ProfitLossController, resolve: ProfitLossController.resolve}).
|
||||
when('/StockMovement', {templateUrl: '/partial/stock-movement.html', controller: StockMovementController, resolve: StockMovementController.resolve}).
|
||||
when('/NetTransactions', {templateUrl: '/partial/net-transactions.html', controller: NetTransactionsController, resolve: NetTransactionsController.resolve}).
|
||||
when('/PurchaseEntries', {templateUrl: '/partial/purchase-entries.html', controller: PurchaseEntriesController, resolve: PurchaseEntriesController.resolve}).
|
||||
when('/Purchases', {templateUrl: '/partial/purchases.html', controller: PurchasesController, resolve: PurchasesController.resolve}).
|
||||
when('/EmployeeFunctions', {templateUrl: '/partial/employee-functions.html', controller: EmployeeFunctionsController}).
|
||||
|
||||
when('/BalanceSheet', {templateUrl: '/partial/balance-sheet.html', controller: BalanceSheetCtrl, resolve: BalanceSheetCtrl.resolve}).
|
||||
when('/BalanceSheet/:date', {templateUrl: '/partial/balance-sheet.html', controller: BalanceSheetCtrl, resolve: BalanceSheetCtrl.resolve}).
|
||||
when('/BalanceSheet', {templateUrl: '/partial/balance-sheet.html', controller: BalanceSheetController, resolve: BalanceSheetController.resolve}).
|
||||
when('/BalanceSheet/:date', {templateUrl: '/partial/balance-sheet.html', controller: BalanceSheetController, resolve: BalanceSheetController.resolve}).
|
||||
|
||||
when('/TrialBalance', {templateUrl: '/partial/trial-balance.html', controller: TrialBalanceCtrl, resolve: TrialBalanceCtrl.resolve}).
|
||||
when('/TrialBalance/:date', {templateUrl: '/partial/trial-balance.html', controller: TrialBalanceCtrl, resolve: TrialBalanceCtrl.resolve}).
|
||||
when('/TrialBalance', {templateUrl: '/partial/trial-balance.html', controller: TrialBalanceController, resolve: TrialBalanceController.resolve}).
|
||||
when('/TrialBalance/:date', {templateUrl: '/partial/trial-balance.html', controller: TrialBalanceController, resolve: TrialBalanceController.resolve}).
|
||||
|
||||
when('/ClosingStock', {templateUrl: '/partial/closing-stock.html', controller: ClosingStockCtrl, resolve: ClosingStockCtrl.resolve}).
|
||||
when('/ClosingStock/:date', {templateUrl: '/partial/closing-stock.html', controller: ClosingStockCtrl, resolve: ClosingStockCtrl.resolve}).
|
||||
when('/ClosingStock', {templateUrl: '/partial/closing-stock.html', controller: ClosingStockController, resolve: ClosingStockController.resolve}).
|
||||
when('/ClosingStock/:date', {templateUrl: '/partial/closing-stock.html', controller: ClosingStockController, resolve: ClosingStockController.resolve}).
|
||||
|
||||
when('/Accounts', {templateUrl: '/partial/account-list.html', controller: AccountListCtrl, resolve: AccountListCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Account', {templateUrl: '/partial/account-detail.html', controller: AccountCtrl, resolve: AccountCtrl.resolve}).
|
||||
when('/Account/:id', {templateUrl: '/partial/account-detail.html', controller: AccountCtrl, resolve: AccountCtrl.resolve}).
|
||||
when('/Accounts', {templateUrl: '/partial/account-list.html', controller: AccountListController, resolve: AccountListController.resolve, reloadOnSearch:false}).
|
||||
when('/Account', {templateUrl: '/partial/account-detail.html', controller: AccountController, resolve: AccountController.resolve}).
|
||||
when('/Account/:id', {templateUrl: '/partial/account-detail.html', controller: AccountController, resolve: AccountController.resolve}).
|
||||
|
||||
when('/Employees', {templateUrl: '/partial/employee-list.html', controller: EmployeeListCtrl, resolve: EmployeeListCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Employee', {templateUrl: '/partial/employee-detail.html', controller: EmployeeCtrl, resolve: EmployeeCtrl.resolve}).
|
||||
when('/Employee/:id', {templateUrl: '/partial/employee-detail.html', controller: EmployeeCtrl, resolve: EmployeeCtrl.resolve}).
|
||||
when('/Employees', {templateUrl: '/partial/employee-list.html', controller: EmployeeListController, resolve: EmployeeListController.resolve, reloadOnSearch:false}).
|
||||
when('/Employee', {templateUrl: '/partial/employee-detail.html', controller: EmployeeController, resolve: EmployeeController.resolve}).
|
||||
when('/Employee/:id', {templateUrl: '/partial/employee-detail.html', controller: EmployeeController, resolve: EmployeeController.resolve}).
|
||||
|
||||
when('/CostCenters', {templateUrl: '/partial/cost-center-list.html', controller: CostCenterListCtrl, resolve: CostCenterListCtrl.resolve}).
|
||||
when('/CostCenter', {templateUrl: '/partial/cost-center-detail.html', controller: CostCenterCtrl, resolve: CostCenterCtrl.resolve}).
|
||||
when('/CostCenter/:id', {templateUrl: '/partial/cost-center-detail.html', controller: CostCenterCtrl, resolve: CostCenterCtrl.resolve}).
|
||||
when('/CostCenters', {templateUrl: '/partial/cost-center-list.html', controller: CostCenterListController, resolve: CostCenterListController.resolve}).
|
||||
when('/CostCenter', {templateUrl: '/partial/cost-center-detail.html', controller: CostCenterController, resolve: CostCenterController.resolve}).
|
||||
when('/CostCenter/:id', {templateUrl: '/partial/cost-center-detail.html', controller: CostCenterController, resolve: CostCenterController.resolve}).
|
||||
|
||||
when('/Products', {templateUrl: '/partial/product-list.html', controller: ProductListCtrl, resolve: ProductListCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Product', {templateUrl: '/partial/product-detail.html', controller: ProductCtrl, resolve: ProductCtrl.resolve}).
|
||||
when('/Product/:id', {templateUrl: '/partial/product-detail.html', controller: ProductCtrl, resolve: ProductCtrl.resolve}).
|
||||
when('/Products', {templateUrl: '/partial/product-list.html', controller: ProductListController, resolve: ProductListController.resolve, reloadOnSearch:false}).
|
||||
when('/Product', {templateUrl: '/partial/product-detail.html', controller: ProductController, resolve: ProductController.resolve}).
|
||||
when('/Product/:id', {templateUrl: '/partial/product-detail.html', controller: ProductController, resolve: ProductController.resolve}).
|
||||
|
||||
when('/Recipes', {templateUrl: '/partial/recipe-list.html', controller: RecipeListCtrl, resolve: RecipeListCtrl.resolve, reloadOnSearch:false}).
|
||||
when('/Recipe', {templateUrl: '/partial/recipe-detail.html', controller: RecipeCtrl, resolve: RecipeCtrl.resolve}).
|
||||
when('/Recipe/:id', {templateUrl: '/partial/recipe-detail.html', controller: RecipeCtrl, resolve: RecipeCtrl.resolve}).
|
||||
when('/Recipes', {templateUrl: '/partial/recipe-list.html', controller: RecipeListController, resolve: RecipeListController.resolve, reloadOnSearch:false}).
|
||||
when('/Recipe', {templateUrl: '/partial/recipe-detail.html', controller: RecipeController, resolve: RecipeController.resolve}).
|
||||
when('/Recipe/:id', {templateUrl: '/partial/recipe-detail.html', controller: RecipeController, resolve: RecipeController.resolve}).
|
||||
|
||||
when('/ProductGroups', {templateUrl: '/partial/product-group-list.html', controller: ProductGroupListCtrl, resolve: ProductGroupListCtrl.resolve}).
|
||||
when('/ProductGroup', {templateUrl: '/partial/product-group-detail.html', controller: ProductGroupCtrl, resolve: ProductGroupCtrl.resolve}).
|
||||
when('/ProductGroup/:id', {templateUrl: '/partial/product-group-detail.html', controller: ProductGroupCtrl, resolve: ProductGroupCtrl.resolve}).
|
||||
when('/ProductGroups', {templateUrl: '/partial/product-group-list.html', controller: ProductGroupListController, resolve: ProductGroupListController.resolve}).
|
||||
when('/ProductGroup', {templateUrl: '/partial/product-group-detail.html', controller: ProductGroupController, resolve: ProductGroupController.resolve}).
|
||||
when('/ProductGroup/:id', {templateUrl: '/partial/product-group-detail.html', controller: ProductGroupController, resolve: ProductGroupController.resolve}).
|
||||
|
||||
when('/Users', {templateUrl: '/partial/user-list.html', controller: UserListCtrl, resolve: UserListCtrl.resolve}).
|
||||
when('/User', {templateUrl: '/partial/user-detail.html', controller: UserCtrl, resolve: UserCtrl.resolve}).
|
||||
when('/User/:id', {templateUrl: '/partial/user-detail.html', controller: UserCtrl, resolve: UserCtrl.resolve}).
|
||||
when('/Users', {templateUrl: '/partial/user-list.html', controller: UserListController, resolve: UserListController.resolve}).
|
||||
when('/User', {templateUrl: '/partial/user-detail.html', controller: UserController, resolve: UserController.resolve}).
|
||||
when('/User/:id', {templateUrl: '/partial/user-detail.html', controller: UserController, resolve: UserController.resolve}).
|
||||
|
||||
when('/Groups', {templateUrl: '/partial/group-list.html', controller: GroupListCtrl, resolve: GroupListCtrl.resolve}).
|
||||
when('/Group', {templateUrl: '/partial/group-detail.html', controller: GroupCtrl, resolve: GroupCtrl.resolve}).
|
||||
when('/Group/:id', {templateUrl: '/partial/group-detail.html', controller: GroupCtrl, resolve: GroupCtrl.resolve}).
|
||||
when('/Groups', {templateUrl: '/partial/group-list.html', controller: GroupListController, resolve: GroupListController.resolve}).
|
||||
when('/Group', {templateUrl: '/partial/group-detail.html', controller: GroupController, resolve: GroupController.resolve}).
|
||||
when('/Group/:id', {templateUrl: '/partial/group-detail.html', controller: GroupController, resolve: GroupController.resolve}).
|
||||
|
||||
when('/Clients', {templateUrl: '/partial/client-list.html', controller: ClientListCtrl, resolve: ClientListCtrl.resolve}).
|
||||
when('/Client/:id', {templateUrl: '/partial/client-detail.html', controller: ClientCtrl, resolve: ClientCtrl.resolve}).
|
||||
when('/Clients', {templateUrl: '/partial/client-list.html', controller: ClientListController, resolve: ClientListController.resolve}).
|
||||
when('/Client/:id', {templateUrl: '/partial/client-detail.html', controller: ClientController, resolve: ClientController.resolve}).
|
||||
|
||||
when('/Message', {templateUrl: '/partial/message-detail.html', controller: MessageCtrl, resolve: MessageCtrl.resolve}).
|
||||
when('/Message/:id', {templateUrl: '/partial/message-detail.html', controller: MessageCtrl, resolve: MessageCtrl.resolve}).
|
||||
when('/Message', {templateUrl: '/partial/message-detail.html', controller: MessageController, resolve: MessageController.resolve}).
|
||||
when('/Message/:id', {templateUrl: '/partial/message-detail.html', controller: MessageController, resolve: MessageController.resolve}).
|
||||
|
||||
when('/Settings', {templateUrl: '/partial/settings.html', controller: SettingsCtrl, resolve: SettingsCtrl.resolve}).
|
||||
when('/Settings', {templateUrl: '/partial/settings.html', controller: SettingsController, resolve: SettingsController.resolve}).
|
||||
|
||||
otherwise({templateUrl: '/partial/404.html'});
|
||||
$locationProvider.html5Mode(true).hashPrefix('!');
|
||||
@@ -134,7 +134,7 @@ var overlord = angular.module('overlord', ['overlord.directive', 'overlord.filte
|
||||
};
|
||||
}]);
|
||||
|
||||
overlord.controller('BaseCtrl', ['$rootScope', '$scope', 'Auth', '$location', '$routeParams', function ($rootScope, $scope, Auth, $location, $routeParams) {
|
||||
overlord.controller('BaseController', ['$rootScope', '$scope', 'Auth', '$location', '$routeParams', function ($rootScope, $scope, Auth, $location, $routeParams) {
|
||||
$rootScope.$on('loginRequired', function () {
|
||||
if ($rootScope.auth.isAuthenticated) {
|
||||
$location.path('/');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var PaymentCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Account) {
|
||||
var PaymentController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Account', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Account) {
|
||||
$('#txtAccount').focus();
|
||||
|
||||
$scope.voucher = voucher;
|
||||
@@ -38,9 +38,9 @@ var PaymentCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
if (!$scope.account || !$scope.account.LedgerID || !$scope.amount || Number(!$scope.amount)) {
|
||||
return;
|
||||
}
|
||||
var oldJournal = getOld($scope.account.LedgerID, this.voucher.Journals);
|
||||
var oldJournal = getOld($scope.account.LedgerID, $scope.voucher.Journals);
|
||||
if (angular.isUndefined(oldJournal)) {
|
||||
this.voucher.Journals.push({Debit: 1, Amount: Number($scope.amount), Ledger: $scope.account});
|
||||
$scope.voucher.Journals.push({Debit: 1, Amount: Number($scope.amount), Ledger: $scope.account});
|
||||
} else {
|
||||
if (oldJournal.Debit === 1) {
|
||||
oldJournal.Amount = oldJournal.Amount + Number($scope.amount);
|
||||
@@ -54,8 +54,8 @@ var PaymentCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
};
|
||||
|
||||
$scope.removeJournal = function (journal) {
|
||||
var index = this.voucher.Journals.indexOf(journal);
|
||||
this.voucher.Journals.splice(index, 1);
|
||||
var index = $scope.voucher.Journals.indexOf(journal);
|
||||
$scope.voucher.Journals.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('voucher.Journals', function (journals, oldValue) {
|
||||
@@ -119,11 +119,14 @@ var PaymentCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
angular.copy($scope.selectedJournal, edit);
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: true,
|
||||
size: 'lg',
|
||||
templateUrl: '/partial/payment-modal.html',
|
||||
controller: PaymentModalCtrl,
|
||||
resolve: {edit: function () {
|
||||
return edit;
|
||||
}}
|
||||
controller: PaymentModalController,
|
||||
resolve: {
|
||||
edit: function () {
|
||||
return edit;
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function (updated) {
|
||||
if (updated.Ledger.LedgerID !== $scope.selectedJournal.Ledger.LedgerID) {
|
||||
@@ -166,7 +169,7 @@ var PaymentCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIma
|
||||
};
|
||||
}];
|
||||
|
||||
PaymentCtrl.resolve = {
|
||||
PaymentController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id,
|
||||
account = $route.current.params.a;
|
||||
@@ -186,7 +189,7 @@ PaymentCtrl.resolve = {
|
||||
}]
|
||||
};
|
||||
|
||||
var PaymentModalCtrl = ['$scope', '$modalInstance', 'edit', 'Account', function ($scope, $modalInstance, edit, Account) {
|
||||
var PaymentModalController = ['$scope', '$modalInstance', 'edit', 'Account', function ($scope, $modalInstance, edit, Account) {
|
||||
$scope.edit = edit;
|
||||
$scope.ok = function () {
|
||||
$scope.edit.Amount = Number($scope.edit.Amount);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var ProductGroupListCtrl = ['$scope', 'productGroups', function ($scope, productGroups) {
|
||||
var ProductGroupListController = ['$scope', 'productGroups', function ($scope, productGroups) {
|
||||
$scope.info = productGroups;
|
||||
}];
|
||||
|
||||
ProductGroupListCtrl.resolve = {
|
||||
ProductGroupListController.resolve = {
|
||||
productGroups: ['ProductGroup', function (ProductGroup) {
|
||||
return ProductGroup.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var ProductGroupCtrl = ['$scope', '$location', 'productGroup', function ($scope, $location, productGroup) {
|
||||
var ProductGroupController = ['$scope', '$location', 'productGroup', function ($scope, $location, productGroup) {
|
||||
$scope.productGroup = productGroup;
|
||||
|
||||
$scope.save = function () {
|
||||
@@ -33,7 +33,7 @@ var ProductGroupCtrl = ['$scope', '$location', 'productGroup', function ($scope,
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
ProductGroupCtrl.resolve = {
|
||||
ProductGroupController.resolve = {
|
||||
productGroup: ['$route', 'ProductGroup', function ($route, ProductGroup) {
|
||||
var id = $route.current.params.id;
|
||||
return ProductGroup.get({id: id}).$promise;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ProductLedgerCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'productLedger', 'ProductLedger', 'Product', function ($scope, $routeParams, $location, asDate, productLedger, ProductLedger, Product) {
|
||||
var ProductLedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'productLedger', 'ProductLedger', 'Product', function ($scope, $routeParams, $location, asDate, productLedger, ProductLedger, Product) {
|
||||
$scope.info = productLedger;
|
||||
$scope.show = function () {
|
||||
var id = $scope.info.Product.ProductID,
|
||||
@@ -27,7 +27,7 @@ var ProductLedgerCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter',
|
||||
|
||||
$('#txtProduct').focus();
|
||||
}];
|
||||
ProductLedgerCtrl.resolve = {
|
||||
ProductLedgerController.resolve = {
|
||||
productLedger: ['$route', 'ProductLedger', function ($route, ProductLedger) {
|
||||
var id = $route.current.params.id,
|
||||
startDate = $route.current.params.StartDate,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ProductListCtrl = ['$scope', '$location', '$routeParams', 'Tokenizer', 'products', function ($scope, $location, $routeParams, Tokenizer, products) {
|
||||
var ProductListController = ['$scope', '$location', '$routeParams', 'Tokenizer', 'products', function ($scope, $location, $routeParams, Tokenizer, products) {
|
||||
$scope.search = $routeParams.q || '';
|
||||
$scope.showExtended = false;
|
||||
$scope.info = products;
|
||||
@@ -80,13 +80,13 @@ var ProductListCtrl = ['$scope', '$location', '$routeParams', 'Tokenizer', 'prod
|
||||
};
|
||||
}];
|
||||
|
||||
ProductListCtrl.resolve = {
|
||||
ProductListController.resolve = {
|
||||
products: ['Product', function (Product) {
|
||||
return Product.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var ProductCtrl = ['$scope', '$location', '$window', '$modal', 'product', 'productGroups', function ($scope, $location, $window, $modal, product, productGroups) {
|
||||
var ProductController = ['$scope', '$location', '$window', '$modal', 'product', 'productGroups', function ($scope, $location, $window, $modal, product, productGroups) {
|
||||
$scope.product = product;
|
||||
$scope.productGroups = productGroups;
|
||||
|
||||
@@ -132,7 +132,7 @@ var ProductCtrl = ['$scope', '$location', '$window', '$modal', 'product', 'produ
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
ProductCtrl.resolve = {
|
||||
ProductController.resolve = {
|
||||
product: ['$route', 'Product', function ($route, Product) {
|
||||
var id = $route.current.params.id;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ProfitLossCtrl = ['$scope', '$location', 'asDateFilter', 'profit_loss', function ($scope, $location, asDate, profit_loss) {
|
||||
var ProfitLossController = ['$scope', '$location', 'asDateFilter', 'profit_loss', function ($scope, $location, asDate, profit_loss) {
|
||||
$scope.info = profit_loss;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -10,7 +10,7 @@ var ProfitLossCtrl = ['$scope', '$location', 'asDateFilter', 'profit_loss', func
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
|
||||
ProfitLossCtrl.resolve = {
|
||||
ProfitLossController.resolve = {
|
||||
profit_loss: ['$route', 'ProfitLoss', function ($route, ProfitLoss) {
|
||||
var startDate = $route.current.params.StartDate,
|
||||
finishDate = $route.current.params.FinishDate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var PurchaseEntriesCtrl = ['$scope', '$location', 'asDateFilter', 'purchaseEntries', function ($scope, $location, asDate, purchaseEntries) {
|
||||
var PurchaseEntriesController = ['$scope', '$location', 'asDateFilter', 'purchaseEntries', function ($scope, $location, asDate, purchaseEntries) {
|
||||
$scope.info = purchaseEntries;
|
||||
|
||||
$scope.show = function () {
|
||||
@@ -11,7 +11,7 @@ var PurchaseEntriesCtrl = ['$scope', '$location', 'asDateFilter', 'purchaseEntri
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
|
||||
PurchaseEntriesCtrl.resolve = {
|
||||
PurchaseEntriesController.resolve = {
|
||||
purchaseEntries: ['$route', 'PurchaseEntries', function ($route, PurchaseEntries) {
|
||||
var startDate = $route.current.params.StartDate,
|
||||
finishDate = $route.current.params.FinishDate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var PurchaseReturnCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', 'Batch', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Batch) {
|
||||
var PurchaseReturnController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', 'Batch', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Batch) {
|
||||
$scope.voucher = voucher;
|
||||
$scope.rate = 0;
|
||||
function getOld(productID, inventories) {
|
||||
@@ -33,7 +33,7 @@ var PurchaseReturnCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uplo
|
||||
};
|
||||
|
||||
$scope.add = function () {
|
||||
var oldInventory = getOld($scope.batch.Product.ProductID, this.voucher.Inventories),
|
||||
var oldInventory = getOld($scope.batch.Product.ProductID, $scope.voucher.Inventories),
|
||||
quantity = Number($scope.quantity);
|
||||
|
||||
if (!$scope.batch || !$scope.batch.Product.ProductID || !quantity) {
|
||||
@@ -41,7 +41,7 @@ var PurchaseReturnCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uplo
|
||||
}
|
||||
|
||||
if (angular.isUndefined(oldInventory) && quantity <= $scope.batch.QuantityRemaining) {
|
||||
this.voucher.Inventories.push(
|
||||
$scope.voucher.Inventories.push(
|
||||
{
|
||||
Product: $scope.batch.Product,
|
||||
Quantity: quantity,
|
||||
@@ -58,8 +58,8 @@ var PurchaseReturnCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uplo
|
||||
}
|
||||
};
|
||||
$scope.removeInventory = function (inventory) {
|
||||
var index = this.voucher.Inventories.indexOf(inventory);
|
||||
this.voucher.Inventories.splice(index, 1);
|
||||
var index = $scope.voucher.Inventories.indexOf(inventory);
|
||||
$scope.voucher.Inventories.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('voucher.Inventories', function (inventories) {
|
||||
@@ -128,11 +128,14 @@ var PurchaseReturnCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uplo
|
||||
angular.copy($scope.selectedInventory, edit);
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: true,
|
||||
size: 'lg',
|
||||
templateUrl: '/partial/purchase-return-modal.html',
|
||||
controller: PurchaseReturnModalCtrl,
|
||||
resolve: {edit: function () {
|
||||
return edit;
|
||||
}}
|
||||
controller: PurchaseReturnModalController,
|
||||
resolve: {
|
||||
edit: function () {
|
||||
return edit;
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function (updated) {
|
||||
if (updated.Product.ProductID !== $scope.selectedInventory.Batch.Product.ProductID) {
|
||||
@@ -179,7 +182,7 @@ var PurchaseReturnCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uplo
|
||||
};
|
||||
}];
|
||||
|
||||
PurchaseReturnCtrl.resolve = {
|
||||
PurchaseReturnController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id;
|
||||
if (angular.isUndefined(id)) {
|
||||
@@ -191,7 +194,7 @@ PurchaseReturnCtrl.resolve = {
|
||||
};
|
||||
|
||||
|
||||
var PurchaseReturnModalCtrl = ['$scope', '$modalInstance', 'edit', 'Batch', function ($scope, $modalInstance, edit, Batch) {
|
||||
var PurchaseReturnModalController = ['$scope', '$modalInstance', 'edit', 'Batch', function ($scope, $modalInstance, edit, Batch) {
|
||||
$scope.edit = edit;
|
||||
$scope.ok = function () {
|
||||
$scope.edit.Product = $scope.edit.Batch.Product;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var PurchaseCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', 'Product', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Product) {
|
||||
var PurchaseController = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'Account', 'Product', function ($scope, $location, asDate, $modal, uploadedImageResizer, voucher, Account, Product) {
|
||||
$scope.voucher = voucher;
|
||||
function getOld(productID, inventories) {
|
||||
return _.find(inventories, function (inventory) {
|
||||
@@ -32,7 +32,7 @@ var PurchaseCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIm
|
||||
};
|
||||
|
||||
$scope.add = function () {
|
||||
var oldInventory = getOld($scope.product.ProductID, this.voucher.Inventories),
|
||||
var oldInventory = getOld($scope.product.ProductID, $scope.voucher.Inventories),
|
||||
quantity = Number($scope.quantity),
|
||||
tax = ($scope.tax) ? Number($scope.tax) : 0,
|
||||
discount = ($scope.discount) ? Number($scope.discount) : 0,
|
||||
@@ -43,7 +43,7 @@ var PurchaseCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIm
|
||||
}
|
||||
|
||||
if (angular.isUndefined(oldInventory)) {
|
||||
this.voucher.Inventories.push(
|
||||
$scope.voucher.Inventories.push(
|
||||
{
|
||||
Product: $scope.product,
|
||||
Quantity: quantity,
|
||||
@@ -60,8 +60,8 @@ var PurchaseCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIm
|
||||
}
|
||||
};
|
||||
$scope.removeInventory = function (inventory) {
|
||||
var index = this.voucher.Inventories.indexOf(inventory);
|
||||
this.voucher.Inventories.splice(index, 1);
|
||||
var index = $scope.voucher.Inventories.indexOf(inventory);
|
||||
$scope.voucher.Inventories.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('voucher.Inventories', function (inventories, oldValue) {
|
||||
@@ -129,11 +129,14 @@ var PurchaseCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIm
|
||||
angular.copy($scope.selectedInventory, edit);
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: true,
|
||||
size: 'lg',
|
||||
templateUrl: '/partial/purchase-modal.html',
|
||||
controller: PurchaseModalCtrl,
|
||||
resolve: {edit: function () {
|
||||
return edit;
|
||||
}}
|
||||
controller: PurchaseModalController,
|
||||
resolve: {
|
||||
edit: function () {
|
||||
return edit;
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function (updated) {
|
||||
if (updated.Product.ProductID !== $scope.selectedInventory.Product.ProductID) {
|
||||
@@ -180,7 +183,7 @@ var PurchaseCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'uploadedIm
|
||||
};
|
||||
}];
|
||||
|
||||
PurchaseCtrl.resolve = {
|
||||
PurchaseController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id;
|
||||
|
||||
@@ -192,7 +195,7 @@ PurchaseCtrl.resolve = {
|
||||
}]
|
||||
};
|
||||
|
||||
var PurchaseModalCtrl = ['$scope', '$modalInstance', 'edit', 'Product', function ($scope, $modalInstance, edit, Product) {
|
||||
var PurchaseModalController = ['$scope', '$modalInstance', 'edit', 'Product', function ($scope, $modalInstance, edit, Product) {
|
||||
$scope.edit = edit;
|
||||
$scope.ok = function () {
|
||||
$scope.edit.Quantity = Number(edit.Quantity);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var PurchasesCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'purchases', function ($scope, $routeParams, $location, asDate, purchases) {
|
||||
var PurchasesController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'purchases', function ($scope, $routeParams, $location, asDate, purchases) {
|
||||
$scope.info = purchases;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -8,7 +8,7 @@ var PurchasesCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'pur
|
||||
$location.path('/Purchases').search({s: startDate, f: finishDate});
|
||||
};
|
||||
}];
|
||||
PurchasesCtrl.resolve = {
|
||||
PurchasesController.resolve = {
|
||||
purchases: ['$route', 'Purchases', function ($route, Purchases) {
|
||||
var startDate = $route.current.params.s,
|
||||
finishDate = $route.current.params.f;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var RawMaterialCostCtrl = ['$scope', '$location', 'asDateFilter', 'rawMaterialCost', function ($scope, $location, asDate, rawMaterialCost) {
|
||||
var RawMaterialCostController = ['$scope', '$location', 'asDateFilter', 'rawMaterialCost', function ($scope, $location, asDate, rawMaterialCost) {
|
||||
$scope.info = rawMaterialCost;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -10,7 +10,7 @@ var RawMaterialCostCtrl = ['$scope', '$location', 'asDateFilter', 'rawMaterialCo
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
|
||||
RawMaterialCostCtrl.resolve = {
|
||||
RawMaterialCostController.resolve = {
|
||||
rawMaterialCost: ['$route', 'RawMaterialCost', function ($route, RawMaterialCost) {
|
||||
var id = $route.current.params.id,
|
||||
startDate = $route.current.params.StartDate,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ReceiptCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Voucher', 'Account', function ($scope, $routeParams, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Voucher, Account) {
|
||||
var ReceiptController = ['$scope', '$routeParams', '$location', 'asDateFilter', '$modal', 'uploadedImageResizer', 'voucher', 'ledgers', 'Voucher', 'Account', function ($scope, $routeParams, $location, asDate, $modal, uploadedImageResizer, voucher, ledgers, Voucher, Account) {
|
||||
$('#txtAccount').focus();
|
||||
|
||||
$scope.voucher = voucher;
|
||||
@@ -38,9 +38,9 @@ var ReceiptCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$moda
|
||||
if (!$scope.account || !$scope.account.LedgerID || !$scope.amount || Number(!$scope.amount)) {
|
||||
return;
|
||||
}
|
||||
var oldJournal = getOld($scope.account.LedgerID, this.voucher.Journals);
|
||||
var oldJournal = getOld($scope.account.LedgerID, $scope.voucher.Journals);
|
||||
if (angular.isUndefined(oldJournal)) {
|
||||
this.voucher.Journals.push({Debit: -1, Amount: Number($scope.amount), Ledger: $scope.account});
|
||||
$scope.voucher.Journals.push({Debit: -1, Amount: Number($scope.amount), Ledger: $scope.account});
|
||||
} else {
|
||||
if (oldJournal.Debit === -1) {
|
||||
oldJournal.Amount = oldJournal.Amount + Number($scope.amount);
|
||||
@@ -54,8 +54,8 @@ var ReceiptCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$moda
|
||||
};
|
||||
|
||||
$scope.removeJournal = function (journal) {
|
||||
var index = this.voucher.Journals.indexOf(journal);
|
||||
this.voucher.Journals.splice(index, 1);
|
||||
var index = $scope.voucher.Journals.indexOf(journal);
|
||||
$scope.voucher.Journals.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('voucher.Journals', function (journals, oldValue) {
|
||||
@@ -119,11 +119,14 @@ var ReceiptCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$moda
|
||||
angular.copy($scope.selectedJournal, edit);
|
||||
var modalInstance = $modal.open({
|
||||
backdrop: true,
|
||||
size: 'lg',
|
||||
templateUrl: '/partial/receipt-modal.html',
|
||||
controller: ReceiptModalCtrl,
|
||||
resolve: {edit: function () {
|
||||
return edit;
|
||||
}}
|
||||
controller: ReceiptModalController,
|
||||
resolve: {
|
||||
edit: function () {
|
||||
return edit;
|
||||
}
|
||||
}
|
||||
});
|
||||
modalInstance.result.then(function (updated) {
|
||||
if (updated.Ledger.LedgerID !== $scope.selectedJournal.Ledger.LedgerID) {
|
||||
@@ -166,7 +169,7 @@ var ReceiptCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', '$moda
|
||||
};
|
||||
}];
|
||||
|
||||
ReceiptCtrl.resolve = {
|
||||
ReceiptController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id,
|
||||
account = $route.current.params.a;
|
||||
@@ -186,7 +189,7 @@ ReceiptCtrl.resolve = {
|
||||
}]
|
||||
};
|
||||
|
||||
var ReceiptModalCtrl = ['$scope', '$modalInstance', 'edit', 'Account', function ($scope, $modalInstance, edit, Account) {
|
||||
var ReceiptModalController = ['$scope', '$modalInstance', 'edit', 'Account', function ($scope, $modalInstance, edit, Account) {
|
||||
$scope.edit = edit;
|
||||
$scope.ok = function () {
|
||||
$scope.edit.Amount = Number($scope.edit.Amount);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var RecipeListCtrl = ['$scope', 'recipes', function ($scope, recipes) {
|
||||
var RecipeListController = ['$scope', 'recipes', function ($scope, recipes) {
|
||||
$scope.info = recipes;
|
||||
$scope.display = $scope.info;
|
||||
$scope.productTypeSelected = 'all';
|
||||
@@ -33,13 +33,13 @@ var RecipeListCtrl = ['$scope', 'recipes', function ($scope, recipes) {
|
||||
};
|
||||
}];
|
||||
|
||||
RecipeListCtrl.resolve = {
|
||||
RecipeListController.resolve = {
|
||||
recipes: ['Recipe', function (Recipe) {
|
||||
return Recipe.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var RecipeCtrl = ['$scope', '$location', '$window', '$modal', 'asDateFilter', 'Product', 'recipe', 'productGroups', function ($scope, $location, $window, $modal, asDate, Product, recipe, productGroups) {
|
||||
var RecipeController = ['$scope', '$location', '$window', '$modal', 'asDateFilter', 'Product', 'recipe', 'productGroups', function ($scope, $location, $window, $modal, asDate, Product, recipe, productGroups) {
|
||||
$scope.recipe = recipe;
|
||||
$scope.original = {};
|
||||
angular.copy($scope.recipe, $scope.original);
|
||||
@@ -55,11 +55,11 @@ var RecipeCtrl = ['$scope', '$location', '$window', '$modal', 'asDateFilter', 'P
|
||||
if (!$scope.product || !$scope.product.ProductID || !$scope.quantity || Number(!$scope.quantity)) {
|
||||
return;
|
||||
}
|
||||
var oldItem = getOld($scope.product.ProductID, this.recipe.RecipeItems);
|
||||
var oldItem = getOld($scope.product.ProductID, $scope.recipe.RecipeItems);
|
||||
if (angular.isUndefined(oldItem)) {
|
||||
var quantity = Number($scope.quantity);
|
||||
var price = Number($scope.product.Price);
|
||||
this.recipe.RecipeItems.push({
|
||||
$scope.recipe.RecipeItems.push({
|
||||
Product: $scope.product,
|
||||
Quantity: quantity,
|
||||
Price: price
|
||||
@@ -73,8 +73,8 @@ var RecipeCtrl = ['$scope', '$location', '$window', '$modal', 'asDateFilter', 'P
|
||||
};
|
||||
|
||||
$scope.removeItem = function (item) {
|
||||
var index = this.recipe.RecipeItems.indexOf(item);
|
||||
this.recipe.RecipeItems.splice(index, 1);
|
||||
var index = $scope.recipe.RecipeItems.indexOf(item);
|
||||
$scope.recipe.RecipeItems.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.$watch('recipe.RecipeItems', function (recipeItems) {
|
||||
@@ -163,7 +163,7 @@ var RecipeCtrl = ['$scope', '$location', '$window', '$modal', 'asDateFilter', 'P
|
||||
|
||||
}];
|
||||
|
||||
RecipeCtrl.resolve = {
|
||||
RecipeController.resolve = {
|
||||
recipe: ['$route', 'Recipe', function ($route, Recipe) {
|
||||
var id = $route.current.params.id;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ReconcileCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'reconcile', 'Reconcile', 'Account', function ($scope, $routeParams, $location, asDate, reconcile, Reconcile, Account) {
|
||||
var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter', 'reconcile', 'Reconcile', 'Account', function ($scope, $routeParams, $location, asDate, reconcile, Reconcile, Account) {
|
||||
$scope.info = reconcile;
|
||||
$scope.show = function () {
|
||||
var id = $scope.info.Account.LedgerID,
|
||||
@@ -78,7 +78,7 @@ var ReconcileCtrl = ['$scope', '$routeParams', '$location', 'asDateFilter', 'rec
|
||||
};
|
||||
}];
|
||||
|
||||
ReconcileCtrl.resolve = {
|
||||
ReconcileController.resolve = {
|
||||
reconcile: ['$route', 'Reconcile', function ($route, Reconcile) {
|
||||
var id = $route.current.params.id,
|
||||
startDate = $route.current.params.StartDate,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var SalaryDeductionCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'voucher', 'Employee', function ($scope, $location, asDate, $modal, voucher, Employee) {
|
||||
var SalaryDeductionController = ['$scope', '$location', 'asDateFilter', '$modal', 'voucher', 'Employee', function ($scope, $location, asDate, $modal, voucher, Employee) {
|
||||
$scope.voucher = voucher;
|
||||
|
||||
function getOldItem(ledgerID, items) {
|
||||
@@ -155,7 +155,7 @@ var SalaryDeductionCtrl = ['$scope', '$location', 'asDateFilter', '$modal', 'vou
|
||||
}];
|
||||
|
||||
|
||||
SalaryDeductionCtrl.resolve = {
|
||||
SalaryDeductionController.resolve = {
|
||||
voucher: ['$route', 'Voucher', function ($route, Voucher) {
|
||||
var id = $route.current.params.id;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var SettingsCtrl = ['$scope', '$http', 'asDateFilter', '$modal', 'lockInfo', 'Product', function ($scope, $http, asDate, $modal, lockInfo, Product) {
|
||||
var SettingsController = ['$scope', '$http', 'asDateFilter', '$modal', 'lockInfo', 'Product', function ($scope, $http, asDate, $modal, lockInfo, Product) {
|
||||
$scope.lockInfo = lockInfo.data;
|
||||
$scope.rebaseDate = '';
|
||||
$scope.setLockDate = function () {
|
||||
@@ -123,7 +123,7 @@ var SettingsCtrl = ['$scope', '$http', 'asDateFilter', '$modal', 'lockInfo', 'Pr
|
||||
};
|
||||
}];
|
||||
|
||||
SettingsCtrl.resolve = {
|
||||
SettingsController.resolve = {
|
||||
lockInfo: ['$http', function ($http) {
|
||||
return $http.get('/api/LockInfo', {}).then(function (data) {
|
||||
return data;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var StockMovementCtrl = ['$scope', '$location', 'asDateFilter', 'stockMovement', function ($scope, $location, asDate, stockMovement) {
|
||||
var StockMovementController = ['$scope', '$location', 'asDateFilter', 'stockMovement', function ($scope, $location, asDate, stockMovement) {
|
||||
$scope.info = stockMovement;
|
||||
$scope.show = function () {
|
||||
var startDate = asDate($scope.info.StartDate),
|
||||
@@ -10,7 +10,7 @@ var StockMovementCtrl = ['$scope', '$location', 'asDateFilter', 'stockMovement',
|
||||
$('#txtStartDate').focus();
|
||||
}];
|
||||
|
||||
StockMovementCtrl.resolve = {
|
||||
StockMovementController.resolve = {
|
||||
stockMovement: ['$route', 'StockMovement', function ($route, StockMovement) {
|
||||
var startDate = $route.current.params.StartDate,
|
||||
finishDate = $route.current.params.FinishDate;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var TrialBalanceCtrl = ['$scope', '$location', 'asDateFilter', 'trialBalance', function ($scope, $location, asDate, trialBalance) {
|
||||
var TrialBalanceController = ['$scope', '$location', 'asDateFilter', 'trialBalance', function ($scope, $location, asDate, trialBalance) {
|
||||
$scope.info = trialBalance;
|
||||
$scope.show = function () {
|
||||
$location.path('/TrialBalance/' + asDate($scope.info.Date));
|
||||
};
|
||||
$('#txtDate').focus();
|
||||
}];
|
||||
TrialBalanceCtrl.resolve = {
|
||||
TrialBalanceController.resolve = {
|
||||
trialBalance: ['$route', 'TrialBalance', function ($route, TrialBalance) {
|
||||
var date = $route.current.params.date;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var UnpostedCtrl = ['$scope', 'info', 'Unposted', function ($scope, info, Unposted) {
|
||||
var UnpostedController = ['$scope', 'info', 'Unposted', function ($scope, info, Unposted) {
|
||||
$scope.info = info;
|
||||
$scope.refresh = function () {
|
||||
Unposted.query({}, function (result) {
|
||||
@@ -9,7 +9,7 @@ var UnpostedCtrl = ['$scope', 'info', 'Unposted', function ($scope, info, Unpost
|
||||
});
|
||||
};
|
||||
}];
|
||||
UnpostedCtrl.resolve = {
|
||||
UnpostedController.resolve = {
|
||||
info:['Unposted', function (Unposted) {
|
||||
return Unposted.query({}).$promise;
|
||||
}]
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var UserListCtrl = ['$scope', 'users', function ($scope, users) {
|
||||
var UserListController = ['$scope', 'users', function ($scope, users) {
|
||||
$scope.info = users;
|
||||
}];
|
||||
|
||||
UserListCtrl.resolve = {
|
||||
UserListController.resolve = {
|
||||
users: ['User', function (User) {
|
||||
return User.query({}).$promise;
|
||||
}]
|
||||
};
|
||||
|
||||
var UserCtrl = ['$scope', '$location', 'user', function ($scope, $location, user) {
|
||||
var UserController = ['$scope', '$location', 'user', function ($scope, $location, user) {
|
||||
$scope.user = user;
|
||||
|
||||
$scope.save = function () {
|
||||
@@ -33,7 +33,7 @@ var UserCtrl = ['$scope', '$location', 'user', function ($scope, $location, user
|
||||
$('#txtName').focus();
|
||||
}];
|
||||
|
||||
UserCtrl.resolve = {
|
||||
UserController.resolve = {
|
||||
user: ['$route', 'User', function ($route, User) {
|
||||
var id = $route.current.params.id;
|
||||
return User.get({id: id}).$promise;
|
||||
|
||||
Reference in new issue
Block a user