Commented out jQuery UI and Mousetrap as they were not needed.

Fixed: Error in purchase-modal where it picked up the product price and not the new price entered.
This commit is contained in:
Tanshu 2013-09-28 13:24:56 +05:30
parent 8f58f42aef
commit 55741f49c3
7 changed files with 11 additions and 12 deletions

View File

@ -140,7 +140,7 @@ var IssueCtrl = ['$scope', '$routeParams', '$location', '$q', 'dateFilter', 'vou
$scope.save = function () {
if (angular.isDate($scope.voucher.Date)) {
$scope.voucher.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
$scope.voucher.Date = dateFilter($scope.voucher.Date, 'dd-MMM-yyyy');
}
$scope.voucher.$save({type: 'Issue'}, function (u, putResponseHeaders) {
$scope.toasts.push({Type: 'Success', Message: ''});

View File

@ -75,7 +75,7 @@ var PaymentCtrl = ['$scope', '$location', '$q', 'dateFilter', '$modal', 'voucher
$scope.save = function () {
if (angular.isDate($scope.voucher.Date)) {
$scope.voucher.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
$scope.voucher.Date = dateFilter($scope.voucher.Date, 'dd-MMM-yyyy');
}
$scope.voucher.$save({type: 'Payment'}, function (u, putResponseHeaders) {
$scope.toasts.push({Type: 'Success', Message: ''});

View File

@ -82,7 +82,7 @@ var PurchaseReturnCtrl = ['$scope', '$location', '$q', 'dateFilter', '$modal', '
$scope.save = function () {
if (angular.isDate($scope.voucher.Date)) {
$scope.voucher.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
$scope.voucher.Date = dateFilter($scope.voucher.Date, 'dd-MMM-yyyy');
}
$scope.voucher.$save({type: 'Purchase Return'}, function (u, putResponseHeaders) {
$scope.toasts.push({Type: 'Success', Message: ''});

View File

@ -87,7 +87,7 @@ var PurchaseCtrl = ['$scope', '$location', '$q', 'dateFilter', '$modal', 'vouche
$scope.save = function () {
if (angular.isDate($scope.voucher.Date)) {
$scope.voucher.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
$scope.voucher.Date = dateFilter($scope.voucher.Date, 'dd-MMM-yyyy');
}
$scope.voucher.$save({type: 'Purchase'}, function (u, putResponseHeaders) {
$scope.toasts.push({Type: 'Success', Message: ''});
@ -176,9 +176,8 @@ var PurchaseCtrl = ['$scope', '$location', '$q', 'dateFilter', '$modal', 'vouche
deferred.resolve(result);
});
return deferred.promise;
}
}]
};
}];
PurchaseCtrl.resolve = {
voucher: ['$q', '$route', 'Voucher', function ($q, $route, Voucher) {
@ -205,7 +204,7 @@ var PurchaseModalCtrl = ['$scope', '$modalInstance', '$q', 'edit', 'Product', fu
$scope.edit.Quantity = Number(edit.Quantity);
$scope.edit.Tax = ($scope.edit.Tax) ? Number($scope.edit.Tax) : 0;
$scope.edit.Discount = ($scope.edit.Discount) ? Number($scope.edit.Discount) : 0;
$scope.edit.Rate = Number($scope.edit.Product.Price);
$scope.edit.Rate = Number($scope.edit.Rate);
$scope.edit.Amount = $scope.edit.Quantity * $scope.edit.Rate * (1 + $scope.edit.Tax) * (1 - $scope.edit.Discount);
$modalInstance.close($scope.edit);
};

View File

@ -75,7 +75,7 @@ var ReceiptCtrl = ['$scope', '$routeParams', '$location', '$q', 'dateFilter', '$
$scope.save = function () {
if (angular.isDate($scope.voucher.Date)) {
$scope.voucher.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
$scope.voucher.Date = dateFilter($scope.voucher.Date, 'dd-MMM-yyyy');
}
$scope.voucher.$save({type: 'Receipt'}, function (u, putResponseHeaders) {
$scope.toasts.push({Type: 'Success', Message: ''});

View File

@ -111,7 +111,7 @@ var SalaryDeductionCtrl = ['$scope', '$location', '$q', 'dateFilter', '$modal',
$scope.save = function () {
if (angular.isDate($scope.voucher.Date)) {
$scope.voucher.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
$scope.voucher.Date = dateFilter($scope.voucher.Date, 'dd-MMM-yyyy');
}
$scope.voucher.$save({type: 'Salary Deduction'}, function (u, putResponseHeaders) {
$scope.toasts.push({Type: 'Success', Message: ''});

View File

@ -25,9 +25,9 @@
}
</style>
<script src="/js/mousetrap.min-1.4.5.js"></script>
## <script src="/js/mousetrap.min-1.4.5.js"></script>
<script src="/js/jquery-2.0.2.min.js"></script>
<script src="/js/jquery-ui-1.10.3.custom.min.js"></script>
## <script src="/js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="/js/bootstrap.min-3.0.0.js"></script>
<script src="/js/ace/ace.js"></script>
<script src="/js/showdown.min.js"></script>