fix: add get_office_employee_url() method for corepos handler

This commit is contained in:
Lance Edgar 2025-01-24 19:35:14 -06:00
parent e6921c8533
commit 1a9929c734
2 changed files with 32 additions and 0 deletions

View file

@ -180,6 +180,28 @@ class CoreposHandler(GenericHandler):
if office_url:
return f'{office_url}/item/departments/DepartmentEditor.php?did={dept_id}'
def get_office_employee_url(
self,
employee_id,
office_url=None,
require=False):
"""
Returns the CORE Office URL for an Employee.
:param employee_id: Employee ID for the URL.
:param office_url: Root URL from :meth:`get_office_url()`.
:param require: If true, an error is raised when URL cannot be
determined.
:returns: URL as string.
"""
if not office_url:
office_url = self.get_office_url(require=require)
if office_url:
return f'{office_url}/admin/Cashiers/CashierEditor.php?emp_no={employee_id}'
def get_office_likecode_url(
self,
likecode_id,