Add xref link to CORE stock purchase view, from equity payment

This commit is contained in:
Lance Edgar 2023-10-15 17:55:51 -05:00
parent 5d61808ec3
commit 14be7cc860

View file

@ -162,6 +162,16 @@ class MemberEquityPaymentViewSupplement(ViewSupplement):
url = f'{url}/reports/Equity/EquityReport.php?memNum={payment.corepos_card_number}'
return [{'url': url, 'text': "View in CORE Office"}]
def get_xref_links(self, payment):
app = self.get_rattail_app()
if payment.corepos_transaction_number:
url = self.request.route_url('corepos.stock_purchases.view',
card_number=payment.corepos_card_number,
datetime=app.localtime(payment.corepos_datetime, from_utc=True),
transaction_number=payment.corepos_transaction_number,
department_number=payment.corepos_department_number)
return [tags.link_to("View CORE-POS Stock Purchase", url)]
def includeme(config):
MembershipTypeViewSupplement.defaults(config)