Index: main/waeup.ikoba/trunk/src/waeup/ikoba/payments/catalog.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/payments/catalog.py	(revision 12823)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/payments/catalog.py	(revision 12824)
@@ -19,6 +19,4 @@
 """
 import grok
-from hurry.query import Eq
-from hurry.query.query import Query
 from zope.catalog.interfaces import ICatalog
 from zope.component import queryUtility
@@ -30,13 +28,29 @@
     """Search payments catalog.
 
-    `query` gives a string we search, `searchtype` the fieldname.
+    `query` gives a string we search for, `searchtype` the fieldname.
+
+    Query '*' returns all entries stored.
+
+    Fields containing strings are searched in a
+    'startswith'-manner. That means, we find all entries starting with
+    the given query string.
+
+    For other fields we only return exact matches. For instance for
+    `anount`, we require a decimal number (no string) and will find
+    all payments with that very amount given in `query`.
+
+    Returns a (possibly empty) catalog result set.
     """
     # Temporary solution to display all payments added
+    cat = queryUtility(ICatalog, name='payments_catalog')
     if query == '*':
-        cat = queryUtility(ICatalog, name='payments_catalog')
-        results = cat.searchResults(payment_id=(None, None))
+        searchtype, query, upper_bound = 'payment_id', None, None
     else:
-        results = Query().searchResults(
-            Eq(('payments_catalog', searchtype), query))
+        if searchtype.endswith('_id'):
+            upper_bound = query + ('Z' * 48)
+        else:
+            upper_bound = query
+    search_params = {searchtype: (query, upper_bound)}
+    results = cat.searchResults(**search_params)
     return results
 
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_catalog.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_catalog.py	(revision 12823)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_catalog.py	(revision 12824)
@@ -1,7 +1,8 @@
+import decimal
 from zope.catalog.interfaces import ICatalog
 from zope.component import queryUtility
 from zope.component.hooks import setSite
 from waeup.ikoba.app import Company
-from waeup.ikoba.payments.payment import Payment
+from waeup.ikoba.payments.payment import Payment, PaymentItem
 from waeup.ikoba.payments.testing import FakePayer, FakePayable
 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase
@@ -45,2 +46,47 @@
         result = [x for x in result]
         self.assertEqual(len(result), 1)
+
+    def test_search_payer_id_starts_with_query(self):
+        # we can find payer_ids starting with query string.
+        app = self.create_app()
+        payer1, payer2, payer3 = FakePayer(), FakePayer(), FakePayer()
+        payer1.payer_id = u'PAYER_11'
+        payer2.payer_id = u'PAYER_12'
+        payer3.payer_id = u'PAYER_20'
+        payment1 = Payment(payer=payer1, payable=FakePayable())
+        payment2 = Payment(payer=payer2, payable=FakePayable())
+        payment3 = Payment(payer=payer3, payable=FakePayable())
+        app['p1'], app['p2'], app['p3'] = payment1, payment2, payment3
+        result1 = search(query='PAYER_1', searchtype='payer_id')
+        result1 = [x for x in result1]
+        self.assertEqual(len(result1), 2)
+        result2 = search(query='PAYER_2', searchtype='payer_id')
+        result2 = [x for x in result2]
+        self.assertEqual(len(result2), 1)
+        result3 = search(query='PAYER_3', searchtype='payer_id')
+        result3 = [x for x in result3]
+        self.assertEqual(len(result3), 0)
+        result4 = search(query='PAYER_11', searchtype='payer_id')
+        result4 = [x for x in result4]
+        self.assertEqual(len(result4), 1)
+
+    def test_search_amount(self):
+        # we can find given amounts starting with query string.
+        app = self.create_app()
+        payable1, payable2 = FakePayable(), FakePayable()
+        payable1.payment_items = (
+            PaymentItem(u'Item 1', decimal.Decimal("1.0")), )
+        payable2.payment_items = (
+            PaymentItem(u'Item 2', decimal.Decimal("2.0")), )
+        payment1 = Payment(payer=FakePayer(), payable=payable1)
+        payment2 = Payment(payer=FakePayer(), payable=payable2)
+        app['p1'], app['p2'] = payment1, payment2
+        result1 = search(query=decimal.Decimal("1.00"), searchtype='amount')
+        result1 = [x for x in result1]
+        self.assertEqual(len(result1), 1)
+        result2 = search(query=decimal.Decimal("2.00"), searchtype='amount')
+        result2 = [x for x in result2]
+        self.assertEqual(len(result2), 1)
+        result3 = search(query=decimal.Decimal("3.00"), searchtype='amount')
+        result3 = [x for x in result3]
+        self.assertEqual(len(result3), 0)
