{{ page_header( title='Dashboard', subtitle='Welcome back, ' ~
current_user.email, breadcrumbs=[{'label': 'Dashboard', 'url': None}],
actions=[ {'label': '', 'icon': 'fas fa-sync', 'class':
'btn-outline-secondary', 'attrs': 'onclick="location.reload()"', 'tooltip':
'Refresh Data', 'type': 'button'} ] ) }}
{% set alert_count =
((alerts.crm.tickets | length) if alerts.crm and alerts.crm.tickets is defined else 0)
+ ((alerts.crm.stale_tickets | length) if alerts.crm and alerts.crm.stale_tickets is defined else 0)
+ ((alerts.crm.leads | length) if alerts.crm and alerts.crm.leads is defined else 0)
+ ((alerts.erp.invoices | length) if alerts.erp and alerts.erp.invoices is defined else 0)
+ ((alerts.erp.tasks | length) if alerts.erp and alerts.erp.tasks is defined else 0)
+ ((alerts.erp.projects | length) if alerts.erp and alerts.erp.projects is defined else 0)
+ ((alerts.erp.past_due_projects | length) if alerts.erp and alerts.erp.past_due_projects is defined else 0)
+ ((alerts.hris.unfinalized_payroll | length) if alerts.hris and alerts.hris.unfinalized_payroll is defined else 0)
+ ((alerts.hris.unpaid_payslips | length) if alerts.hris and alerts.hris.unpaid_payslips is defined else 0)
+ ((alerts.collab.unread_messages | length) if alerts.collab and alerts.collab.unread_messages is defined else 0)
%}
{% if alert_count > 0 %}
Actionable Alerts: You have {{ alert_count }} pending items requiring
attention.
View Details
Critical Tasks
{% if alerts.erp and alerts.erp.invoices %} {% for inv in
alerts.erp.invoices %}
Overdue Invoice{{ inv.number }}
{% endfor %} {% endif %} {% if alerts.crm and alerts.crm.tickets %}
{% for t in alerts.crm.tickets %}
{% if modules.erp and current_user.has_permission('erp.manage') %}
New Project
{% endif %}
{% if widgets.projects %}
{% for p in widgets.projects %}
{{ p.title }}
{% set bcol = 'danger' if p.priority == 'Hot' else 'warning' %}
{{ p.priority }}
{{ p.desc }}
Progress{{ p.progress }}%
{% for member in p.members %}
{% set colors = ['#0d6efd', '#6f42c1', '#d63384', '#fd7e14', '#20c997', '#0dcaf0'] %}
{% set col = colors[loop.index0 % colors|length] %}
{{ member }}
{% endfor %}
{% if p.module == 'erp' and p._comments_count is defined %}
{{ p._comments_count }}
{% endif %}
{% endfor %}
{% else %}
No active projects or hot leads to display.
{% endif %}
Upcoming Tasks
{% if widgets.upcoming %}
{% for u in widgets.upcoming %}
{{ u.title }}
{{ u.date }}
{% if u.is_unassigned %}
Unassigned
{% else %}
{% for member in u.members %}
{{ member }}
{% endfor %}
{% endif %}
{{ u.status }}
{% endfor %}
{% else %}
No upcoming tasks scheduled.
{% endif %}
{% if current_user.is_authenticated and (current_user.has_permission('crm.manage') or current_user.has_permission('erp.manage')) %}
Milestone Tracker
{% if modules.crm and current_user.has_permission('crm.manage') %}
Lead Velocity
{% endif %}
{% if modules.erp and current_user.has_permission('erp.manage') %}
Projects
{% endif %}
{% endif %}
{% if current_user.is_authenticated and current_user.is_admin() %}