Changeset 12762 for main/waeup.ikoba/trunk/src
- Timestamp:
- 14 Mar 2015, 13:49:29 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/browser.txt
r12540 r12762 47 47 And then change back to English by clicking on the third link containing 'en' 48 48 behind 'Anfragen' and 'Einloggen':: 49 >>> browser.getLink('en', index= 2).click()49 >>> browser.getLink('en', index=3).click() 50 50 >>> print browser.contents 51 51 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12760 r12762 50 50 payment_states 51 51 ) 52 from waeup.ikoba.payments.catalog import search as search_payments 52 53 from waeup.ikoba.widgets.hrefwidget import HREFDisplayWidget 53 54 from waeup.ikoba.utils.helpers import ( … … 59 60 IContractSelectProduct, 60 61 ) 61 from waeup.ikoba.customers.catalog import search 62 from waeup.ikoba.customers.catalog import search as search_customers 62 63 from waeup.ikoba.customers.workflow import PAYMENT_TRANSITIONS 63 64 … … 160 161 type="danger") 161 162 return 162 self.hitlist = search (query=self.searchterm,163 self.hitlist = search_customers(query=self.searchterm, 163 164 searchtype=self.searchtype, view=self) 164 165 if not self.hitlist: … … 203 204 return 204 205 if not 'entries' in form: 205 self.hitlist = search (query=self.searchterm,206 self.hitlist = search_customers(query=self.searchterm, 206 207 searchtype=self.searchtype, view=self) 207 208 if not self.hitlist: … … 218 219 del self.context[entry] 219 220 deleted.append(entry) 220 self.hitlist = search (query=self.searchterm,221 self.hitlist = search_customers(query=self.searchterm, 221 222 searchtype=self.searchtype, view=self) 222 223 if len(deleted): … … 1729 1730 1730 1731 def payments(self): 1731 values = [] 1732 payable = None 1733 for payment in get_payments_from_payer_id( 1734 self.context.customer.customer_id): 1735 payable_object = find_payable_from_payable_id(payment.payable_id) 1736 if payable_object is not None: 1737 payable = IPayable(payable_object) 1738 values.append((payment, payable, payable_object)) 1739 return values 1732 return search_payments( 1733 query=self.context.customer_id, searchtype='payer_id') -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/paymentspage.pt
r12757 r12762 1 1 <br /> 2 <table class="ikoba-data-table dataTable Manage">2 <table class="ikoba-data-table dataTable"> 3 3 <thead> 4 4 <tr> … … 20 20 <td tal:content="python: view.gateway_services[value[0].gateway_service].title">SERVICE</td> 21 21 <td tal:content="python: value[0].amount">AMOUNT</td> 22 <td tal:content="python: value[0].currency"> AMOUNT</td>22 <td tal:content="python: value[0].currency">CURRENCY</td> 23 23 <td tal:content="python: view.payment_states.getTerm(value[0].state).title">STATE</td> 24 24 <td> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py
r12757 r12762 166 166 text = _(u'Documents') 167 167 168 168 169 class CustomerManagePaymentsLink(CustomerManageLink): 169 170 grok.order(5) -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py
r12444 r12762 275 275 276 276 # Documents can be removed 277 self.browser.getLink("en", index= 2).click()277 self.browser.getLink("en", index=3).click() 278 278 self.browser.getLink("Documents").click() 279 279 self.browser.getLink("Manage").click() -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/browser.py
r12761 r12762 20 20 import grok 21 21 from waeup.ikoba.browser.breadcrumbs import Breadcrumb 22 from waeup.ikoba.interfaces import IIkobaObject 22 23 from waeup.ikoba.interfaces import MessageFactory as _ 23 from waeup.ikoba.payments.interfaces import IPayment 24 from waeup.ikoba.payments.payment import find_payable_from_payable_id 24 from waeup.ikoba.browser.viewlets import PrimaryNavTab 25 from waeup.ikoba.browser.layout import ( 26 IkobaPage, IkobaEditFormPage, IkobaDisplayFormPage, 27 NullValidator, jsaction, action, UtilityView) 28 from waeup.ikoba.utils.helpers import get_current_principal 29 30 from waeup.ikoba.payments.interfaces import ( 31 IPaymentsContainer, IPayment, payment_states 32 ) 33 from waeup.ikoba.payments.payment import ( 34 find_payable_from_payable_id, 35 get_payment_providers 36 ) 37 from waeup.ikoba.payments.catalog import search 38 39 40 grok.context(IIkobaObject) # Make IIkobaObject the default context 41 grok.templatedir('templates') 42 43 44 class PaymentsTab(PrimaryNavTab): 45 """Payments tab in primary navigation. 46 """ 47 48 grok.context(IIkobaObject) 49 grok.order(3) 50 grok.require('waeup.Public') 51 grok.name('paymentstab') 52 53 pnav = 5 54 tab_title = _(u'Payments') 55 56 @property 57 def link_target(self): 58 return self.view.application_url('payments') 59 60 61 class PaymentsBreadcrumb(Breadcrumb): 62 """A breadcrumb for the payments container. 63 """ 64 grok.context(IPaymentsContainer) 65 title = _('Payments') 66 25 67 26 68 class PaymentBreadcrumb(Breadcrumb): … … 46 88 return (grok.getSite(), 'index') 47 89 return (payable, 'index') 90 91 92 class PaymentsContainerPage(IkobaPage): 93 """The standard view for payment containers. 94 """ 95 grok.context(IPaymentsContainer) 96 grok.name('index') 97 grok.require('waeup.managePortal') 98 grok.template('containerpage') 99 label = _('Find payments') 100 search_button = _('Find payment(s)') 101 pnav = 5 102 103 @property 104 def gateway_services(self): 105 return get_payment_providers() 106 107 @property 108 def payment_states(self): 109 return payment_states 110 111 def update(self, *args, **kw): 112 form = self.request.form 113 self.hitlist = [] 114 if 'searchterm' in form and form['searchterm']: 115 self.searchterm = form['searchterm'] 116 self.searchtype = form['searchtype'] 117 elif 'old_searchterm' in form: 118 self.searchterm = form['old_searchterm'] 119 self.searchtype = form['old_searchtype'] 120 else: 121 if 'search' in form: 122 self.flash(_('Empty search string'), type="warning") 123 return 124 self.hitlist = search(query=self.searchterm, 125 searchtype=self.searchtype) 126 if not self.hitlist: 127 self.flash(_('No payment found.'), type="warning") 128 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/catalog.py
r12671 r12762 19 19 """ 20 20 import grok 21 from hurry.query import Eq, Text 22 from hurry.query.query import Query 23 from zope.catalog.interfaces import ICatalog 24 from zope.component import queryUtility 21 25 from waeup.ikoba.interfaces import ICompany 22 from waeup.ikoba.payments.interfaces import IPayment 26 from waeup.ikoba.payments.interfaces import ( 27 IPayment, IPayable 28 ) 29 from waeup.ikoba.payments.payment import ( 30 find_payable_from_payable_id 31 ) 32 33 34 def search(query=None, searchtype=None): 35 hitlist = [] 36 # Temporary solution to display all payments added 37 if query == '*': 38 cat = queryUtility(ICatalog, name='payments_catalog') 39 results = cat.searchResults(payment_id=(None, None)) 40 else: 41 results = Query().searchResults( 42 Eq(('payments_catalog', searchtype), query)) 43 hitlist = [] 44 for payment in results: 45 payable_object = find_payable_from_payable_id(payment.payable_id) 46 if payable_object is not None: 47 payable = IPayable(payable_object) 48 else: 49 payable = None 50 hitlist.append((payment, payable, payable_object)) 51 return hitlist 23 52 24 53 … … 32 61 payment_id = grok.index.Field(attribute='payment_id') 33 62 payer_id = grok.index.Field(attribute='payer_id') 63 payable_id = grok.index.Field(attribute='payable_id') 34 64 state = grok.index.Field(attribute='state') 35 65 amount = grok.index.Field(attribute='amount') -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/viewlets.py
r12067 r12762 42 42 43 43 grok.context(IIkobaObject) 44 grok.order( 1)44 grok.order(2) 45 45 grok.require('waeup.Public') 46 46 grok.name('productstab')
Note: See TracChangeset for help on using the changeset viewer.