Add links to CORE Office for each customer account associated with a person
for use in "view profile" page, to open account in CORE Office
This commit is contained in:
parent
79c6829f3c
commit
099783ce62
|
@ -26,6 +26,8 @@ CORE POS customer views
|
|||
|
||||
from corepos.db.office_op import model as corepos
|
||||
|
||||
from rattail_corepos.config import core_office_customer_account_url
|
||||
|
||||
from .master import CoreOfficeMasterView
|
||||
|
||||
|
||||
|
@ -86,8 +88,9 @@ class CustomerView(CoreOfficeMasterView):
|
|||
f.remove_field('last_change')
|
||||
|
||||
def core_office_object_url(self, office_url, customer):
|
||||
return '{}/mem/MemberEditor.php?memNum={}'.format(
|
||||
office_url, customer.card_number)
|
||||
return core_office_customer_account_url(self.rattail_config,
|
||||
customer.card_number,
|
||||
office_url=office_url)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
Person views
|
||||
"""
|
||||
|
||||
from rattail_corepos.config import core_office_customer_account_url
|
||||
|
||||
from tailbone.views import people as base
|
||||
|
||||
|
||||
|
@ -59,3 +61,13 @@ class PersonView(base.PeopleView):
|
|||
super(PersonView, self).configure_form(f)
|
||||
|
||||
f.append('corepos_customer_id')
|
||||
|
||||
def get_context_customers(self, person):
|
||||
data = super(PersonView, self).get_context_customers(person)
|
||||
|
||||
# add CORE Office URL for each customer account
|
||||
for customer in data:
|
||||
customer['view_corepos_url'] = core_office_customer_account_url(
|
||||
self.rattail_config, customer['number'])
|
||||
|
||||
return data
|
||||
|
|
Loading…
Reference in a new issue