Révision c6ba8333
Ajouté par Thomas Noël il y a environ 12 ans
extra/modules/myspace.ptl | ||
---|---|---|
35 | 35 |
return Directory._q_traverse(self, path) |
36 | 36 |
|
37 | 37 |
def _q_index [html] (self): |
38 |
user = get_request().user |
|
39 |
if not user or user.anonymous: |
|
40 |
raise errors.AccessUnauthorizedError() |
|
41 |
|
|
38 | 42 |
template.html_top(_('Invoices')) |
39 | 43 |
TextsDirectory.get_html_text('aq-myspace-invoice') |
40 | 44 |
|
41 | 45 |
get_session().display_message() |
42 | 46 |
|
43 |
invoices = Invoice.get_with_indexed_value( |
|
44 |
str('user_id'), str(get_request().user.id)) |
|
47 |
invoices = [] |
|
48 |
invoices.extend(Invoice.get_with_indexed_value( |
|
49 |
str('user_id'), str(user.id))) |
|
50 |
try: |
|
51 |
invoices.extend(Invoice.get_with_indexed_value( |
|
52 |
str('user_hash'), str(user.hash))) |
|
53 |
except AttributeError: |
|
54 |
pass |
|
45 | 55 |
|
46 | 56 |
def cmp_invoice(a, b): |
47 | 57 |
t = cmp(a.regie_id, b.regie_id) |
... | ... | |
67 | 77 |
'<ul>' |
68 | 78 |
|
69 | 79 |
'<li>' |
70 |
if not invoice.paid:
|
|
80 |
if not (invoice.paid or invoice.canceled):
|
|
71 | 81 |
'<input type="checkbox" name="invoice" value="%s"/>' % invoice.id |
72 | 82 |
unpaid = True |
73 | 83 |
misc.localstrftime(invoice.date) |
... | ... | |
77 | 87 |
'%s' % invoice.amount |
78 | 88 |
' €' |
79 | 89 |
' - ' |
80 |
button = '<strong>%s</strong>' % _('Pay') |
|
90 |
button = '<span class="paybutton">%s</span>' % _('Pay') |
|
91 |
if invoice.canceled: |
|
92 |
_('canceled on %s') % misc.localstrftime(invoice.canceled_date) |
|
93 |
' - ' |
|
94 |
button = _('Details') |
|
81 | 95 |
if invoice.paid: |
82 | 96 |
_('paid on %s') % misc.localstrftime(invoice.paid_date) |
83 | 97 |
' - ' |
Formats disponibles : Unified diff
add workflow item "cancel payment" (fix #1255)
+ add_part(invoice) in formdata.evolution