From 5b562051e786c673e73eac18a3e8b8b2d03a8e04 Mon Sep 17 00:00:00 2001 From: tanshu Date: Fri, 15 Apr 2016 00:02:28 +0530 Subject: [PATCH] Fix: Ledger (Alt+R/U) was not working because the $watchGroup does not do object equality. Reverted the change. Fix: Major parts for keyboard navigation were missing. Added. Fix: Autocomplete="off" added to major parts --- brewman/static/partial/issue.html | 2 +- brewman/static/partial/journal.html | 5 +++-- brewman/static/partial/ledger.html | 5 +++-- brewman/static/partial/payment.html | 2 +- brewman/static/partial/purchase-return.html | 4 ++-- brewman/static/partial/purchase.html | 4 ++-- brewman/static/partial/receipt.html | 2 +- brewman/static/partial/reconcile.html | 6 +++--- brewman/static/scripts/ledger.js | 8 +++++++- brewman/static/scripts/reconcile.js | 6 +++--- brewman/views/reports/reconcile.py | 4 ++-- 11 files changed, 28 insertions(+), 20 deletions(-) diff --git a/brewman/static/partial/issue.html b/brewman/static/partial/issue.html index 5f5ce3b7..4e7280b0 100644 --- a/brewman/static/partial/issue.html +++ b/brewman/static/partial/issue.html @@ -45,7 +45,7 @@
-
diff --git a/brewman/static/partial/journal.html b/brewman/static/partial/journal.html index d6a488a5..2709d1fe 100644 --- a/brewman/static/partial/journal.html +++ b/brewman/static/partial/journal.html @@ -24,7 +24,7 @@
-
@@ -86,7 +86,8 @@ diff --git a/brewman/static/partial/ledger.html b/brewman/static/partial/ledger.html index 35f90deb..327cea89 100644 --- a/brewman/static/partial/ledger.html +++ b/brewman/static/partial/ledger.html @@ -28,7 +28,7 @@
- @@ -51,7 +51,8 @@ - {{item.Date}} {{item.Name}} diff --git a/brewman/static/partial/payment.html b/brewman/static/partial/payment.html index 3dc80467..0b97250b 100644 --- a/brewman/static/partial/payment.html +++ b/brewman/static/partial/payment.html @@ -28,7 +28,7 @@
-
diff --git a/brewman/static/partial/purchase-return.html b/brewman/static/partial/purchase-return.html index 68c72d8a..ff376838 100644 --- a/brewman/static/partial/purchase-return.html +++ b/brewman/static/partial/purchase-return.html @@ -15,7 +15,7 @@
- Batch
-
diff --git a/brewman/static/partial/purchase.html b/brewman/static/partial/purchase.html index 0cb0508f..8f445cde 100644 --- a/brewman/static/partial/purchase.html +++ b/brewman/static/partial/purchase.html @@ -16,7 +16,7 @@
- @@ -27,7 +27,7 @@
-
diff --git a/brewman/static/partial/receipt.html b/brewman/static/partial/receipt.html index e4cbd6f9..f0b42e61 100644 --- a/brewman/static/partial/receipt.html +++ b/brewman/static/partial/receipt.html @@ -28,7 +28,7 @@
-
diff --git a/brewman/static/partial/reconcile.html b/brewman/static/partial/reconcile.html index 3941b0a1..6d096026 100644 --- a/brewman/static/partial/reconcile.html +++ b/brewman/static/partial/reconcile.html @@ -28,7 +28,7 @@
- @@ -38,7 +38,7 @@
- +
@@ -49,7 +49,7 @@ - + diff --git a/brewman/static/scripts/ledger.js b/brewman/static/scripts/ledger.js index 7dae224d..8a947885 100644 --- a/brewman/static/scripts/ledger.js +++ b/brewman/static/scripts/ledger.js @@ -35,7 +35,13 @@ var LedgerController = ['$scope', '$routeParams', '$location', 'asDateFilter', ' $scope.selected = index; }; - $scope.$watchGroup(['info', 'hidden'], function () { + $scope.$watch('hidden', function () { + var filtered = $scope.doFilter($scope.hidden, $scope.info.Body); + $scope.ledger = filtered.Body; + $scope.footer = filtered.Footer; + }, true); + + $scope.$watch('info', function () { var filtered = $scope.doFilter($scope.hidden, $scope.info.Body); $scope.ledger = filtered.Body; $scope.footer = filtered.Footer; diff --git a/brewman/static/scripts/reconcile.js b/brewman/static/scripts/reconcile.js index cbcb7eda..25d96764 100644 --- a/brewman/static/scripts/reconcile.js +++ b/brewman/static/scripts/reconcile.js @@ -91,7 +91,7 @@ var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter' 'up': function (e) { if ($scope.selected > 0) { $scope.$apply(function () { - $scope.selected = Math.min(Math.max(0, $scope.selected - 1), $scope.ledger.length - 1); + $scope.selected = Math.min(Math.max(0, $scope.selected - 1), $scope.body.length - 1); }); $("#" + $scope.selected).scrollintoview(); e.preventDefault(); @@ -100,14 +100,14 @@ var ReconcileController = ['$scope', '$routeParams', '$location', 'asDateFilter' 'down': function (e) { if ($scope.selected < $scope.info.Body.length - 1) { $scope.$apply(function () { - $scope.selected = Math.min(Math.max(0, $scope.selected + 1), $scope.ledger.length - 1); + $scope.selected = Math.min(Math.max(0, $scope.selected + 1), $scope.body.length - 1); }); $("#" + $scope.selected).scrollintoview(); e.preventDefault(); } }, 'enter': function (e) { - var path = $scope.info.Body[$scope.selected].Url.replace(/^(?:\/\/|[^\/]+)*/, ""); + var path = $scope.body[$scope.selected].Url.replace(/^(?:\/\/|[^\/]+)*/, ""); $scope.$apply(function () { $location.path(path).search('StartDate', null).search('FinishDate', null); }); diff --git a/brewman/views/reports/reconcile.py b/brewman/views/reports/reconcile.py index 655a88fb..5c029247 100644 --- a/brewman/views/reports/reconcile.py +++ b/brewman/views/reports/reconcile.py @@ -107,8 +107,8 @@ def opening_balance(ledgerID, start_date): else: debit = opening credit = 0 - return {'Date': start_date, 'ID': 'OB', 'Name': 'Opening Balance', 'Type': 'Opening Balance', - 'Narration': '', 'Debit': debit, 'Credit': credit, 'Running': opening, 'Posted': True} + return {'Date': start_date, 'ID': 'OB', 'Name': 'Opening Balance', 'Type': 'Opening Balance', 'Narration': '', + 'Debit': debit, 'Credit': credit, 'Running': opening, 'IsReconciled': True, 'ReconcileDate': start_date} @view_config(request_method='POST', route_name='api_reconcile_id', renderer='json', permission='Reconcile')
DateReconcile Date
{{item.Date}} {{item.Name}}