Improve display for member equity payments
This commit is contained in:
parent
b1ec1b8817
commit
ecf46fa6fe
|
@ -144,9 +144,10 @@ class MemberView(MasterView):
|
||||||
rows_title = "Equity Payments"
|
rows_title = "Equity Payments"
|
||||||
|
|
||||||
row_grid_columns = [
|
row_grid_columns = [
|
||||||
'amount',
|
|
||||||
'received',
|
'received',
|
||||||
|
'amount',
|
||||||
'description',
|
'description',
|
||||||
|
'source',
|
||||||
'transaction_identifier',
|
'transaction_identifier',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -408,18 +409,22 @@ class MemberEquityPaymentView(MasterView):
|
||||||
has_versions = True
|
has_versions = True
|
||||||
|
|
||||||
grid_columns = [
|
grid_columns = [
|
||||||
|
'received',
|
||||||
|
'_member_key_',
|
||||||
'member',
|
'member',
|
||||||
'amount',
|
'amount',
|
||||||
'received',
|
|
||||||
'description',
|
'description',
|
||||||
|
'source',
|
||||||
'transaction_identifier',
|
'transaction_identifier',
|
||||||
]
|
]
|
||||||
|
|
||||||
form_fields = [
|
form_fields = [
|
||||||
|
'_member_key_',
|
||||||
'member',
|
'member',
|
||||||
'amount',
|
'amount',
|
||||||
'received',
|
'received',
|
||||||
'description',
|
'description',
|
||||||
|
'source',
|
||||||
'transaction_identifier',
|
'transaction_identifier',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -435,14 +440,31 @@ class MemberEquityPaymentView(MasterView):
|
||||||
super().configure_grid(g)
|
super().configure_grid(g)
|
||||||
model = self.model
|
model = self.model
|
||||||
|
|
||||||
|
# member_key
|
||||||
|
field = self.get_member_key_field()
|
||||||
|
attr = getattr(model.Member, field)
|
||||||
|
g.set_renderer(field, self.render_member_key)
|
||||||
|
g.set_filter(field, attr,
|
||||||
|
label=self.get_member_key_label(),
|
||||||
|
default_active=True)
|
||||||
|
g.set_sorter(field, attr)
|
||||||
|
|
||||||
|
# member (name)
|
||||||
g.set_joiner('member', lambda q: q.outerjoin(model.Person))
|
g.set_joiner('member', lambda q: q.outerjoin(model.Person))
|
||||||
g.set_sorter('member', model.Person.display_name)
|
g.set_sorter('member', model.Person.display_name)
|
||||||
g.set_link('member')
|
g.set_link('member')
|
||||||
|
g.set_filter('member', model.Person.display_name,
|
||||||
|
label="Member Name")
|
||||||
|
|
||||||
g.set_type('amount', 'currency')
|
g.set_type('amount', 'currency')
|
||||||
|
|
||||||
g.set_sort_defaults('received', 'desc')
|
g.set_sort_defaults('received', 'desc')
|
||||||
g.set_link('received')
|
g.set_link('received')
|
||||||
|
g.set_link('transaction_identifier')
|
||||||
|
|
||||||
|
def render_member_key(self, payment, field):
|
||||||
|
key = getattr(payment.member, field)
|
||||||
|
return key
|
||||||
|
|
||||||
def configure_form(self, f):
|
def configure_form(self, f):
|
||||||
super().configure_form(f)
|
super().configure_form(f)
|
||||||
|
|
Loading…
Reference in a new issue