Changeset 12793 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 19 Mar 2015, 11:27:36 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12772 r12793 34 34 STARTED, VERIFIED, REJECTED, EXPIRED, CREATED, REQUESTED, 35 35 APPROVED, PROVISIONALLY, AWAITING) 36 from waeup.ikoba.widgets.datewidget import ( 37 FriendlyDateWidget, FriendlyDateDisplayWidget, 38 FriendlyDatetimeDisplayWidget) 36 39 from waeup.ikoba.browser.layout import ( 37 40 IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage, … … 1756 1759 1757 1760 @property 1758 def payment(self): 1759 return get_payments_from_payable_id(self.context.contract_id) 1761 def payment_tuples(self): 1762 payment_tuples = [] 1763 for payment in get_payments_from_payable_id(self.context.contract_id): 1764 form_fields = grok.AutoFields(payment.form_fields_interface).omit( 1765 'payment_items') 1766 form_fields[ 1767 'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 1768 form_fields[ 1769 'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 1770 payment_tuples.append((payment, form_fields)) 1771 return payment_tuples 1760 1772 1761 1773 def render(self): -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12772 r12793 1299 1299 self.payment.gateway_service = 'demo_creditcard' 1300 1300 self.payment.state = STATE_PAID 1301 self.payment.title = u'My payment' 1301 1302 self.app['payments'][self.payment.payment_id] = self.payment 1302 1303 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py
r12772 r12793 395 395 396 396 # Insert payment data 397 if getattr(view, 'payment ', None) is not None:398 data_header = trans(_('Payment Data'), portal_language)397 if getattr(view, 'payment_tuples', None) is not None: 398 data_header = trans(_('Payments'), portal_language) 399 399 data.append(Paragraph(data_header, HEADING_STYLE)) 400 for payment in getattr(view, 'payment', None): 400 payment_number = 0 401 for payment_tuple in getattr(view, 'payment_tuples', None): 402 payment_number += 1 403 payment = payment_tuple[0] 404 payment_form_fields = payment_tuple[1] 401 405 if payment.state != STATE_PAID: 402 406 continue 403 data.append(Paragraph('Payment', HEADLINE1_STYLE)) 404 # XXX: Collect and render payment data 407 data.append(Paragraph("Payment %s" % payment_number, HEADLINE1_STYLE)) 408 separators = getattr(self, 'SEPARATORS_DICT', {}) 409 table = creator.getWidgetsTable( 410 payment_form_fields, payment, None, lang=portal_language, 411 separators=separators) 412 data.append(table) 405 413 406 414 # Insert scanned docs -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/payment.py
r12790 r12793 185 185 grok.provides(IPayment) 186 186 187 form_fields_interface = IPayment 188 187 189 @property 188 190 def amount(self):
Note: See TracChangeset for help on using the changeset viewer.