From ecbdb5be215c9fe52e66ac0eaa039c9a7a96f595 Mon Sep 17 00:00:00 2001 From: tliero Date: Mon, 1 Aug 2016 13:38:01 +0200 Subject: [PATCH] Bugfix for matcher order --- pom.xml | 2 +- src/main/resources/static/app/controllers.js | 6 +++--- src/main/resources/static/app/import-list.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 8d9ee5b..08c8e59 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 de.tilman next-transactions - 1.5.4 + 1.5.5 org.springframework.boot diff --git a/src/main/resources/static/app/controllers.js b/src/main/resources/static/app/controllers.js index 5421d5a..130b238 100644 --- a/src/main/resources/static/app/controllers.js +++ b/src/main/resources/static/app/controllers.js @@ -465,13 +465,12 @@ transactionControllers.controller('ImportListCtrl', [ '$scope', '$resource', '$l } for (i = 0; i < $scope.csv.length; i++) { - var matched = false; var j = 0; - while (!matched && j < $scope.matchers.length) { + while (j < $scope.matchers.length) { var match = true; - if (match && $scope.matchers[j].dateMatcher) + if ($scope.matchers[j].dateMatcher) match = $scope.matchers[j].dateMatcher($scope.csv[i][1]); if (match && $scope.matchers[j].typeMatcher) match = $scope.matchers[j].typeMatcher($scope.csv[i][2]); @@ -487,6 +486,7 @@ transactionControllers.controller('ImportListCtrl', [ '$scope', '$resource', '$l if ($scope.categories[k].name == $scope.matchers[j].targetCategory.name) $scope.csv[i].targetCategory = $scope.categories[k]; } + break; } j++; diff --git a/src/main/resources/static/app/import-list.html b/src/main/resources/static/app/import-list.html index f0e7991..517bbb4 100644 --- a/src/main/resources/static/app/import-list.html +++ b/src/main/resources/static/app/import-list.html @@ -42,7 +42,7 @@
- +