Stored in DMH
{{ queue_stats.total_processed_count if queue_stats else summary.total_pdfs }}
Total Invoices Processed
Completed GRNs stored in DMH
Queue 1
{{ queue_stats.pending_po_count if queue_stats else 0 }}
Pending PO Numbers
Awaiting PO verification
Queue 2
{{ queue_stats.pending_item_code_count if queue_stats else 0 }}
Pending Item Codes
Awaiting standardized codes
Master DB
{{ queue_stats.catalog_count if queue_stats else 14324 }}
Drug Master Catalog
Standardized items available
Staff & Admins
{{ all_users|length if all_users else 1 }}
Registered Accounts
Active system operators
Invoices Today
{{ summary.today_pdfs }}
Active Staff Today
{{ summary.today_active_users }}
Total Items Processed
{{ summary.total_items }}
Direct & Auto-Matched
{{ summary.total_items - summary.total_manual - summary.total_missing }}
Manual Mappings
{{ summary.total_manual }}
Pending / Missing Codes
{{ summary.total_missing }}
PO Approvals Today
{{ summary.today_po_approved }}
Total PO Approvals
{{ summary.total_po_approved }}
Item Code Approvals
{{ summary.total_item_code_approved }}
{% if stats %} {% for day in stats %}

Activity for {{ day.date }} {% if day.date == today %}TODAY{% endif %}

Daily audit breakdown by pharmacy staff operator & PO approval actions

{{ day.users|length }} Staff Active {{ day.day_po_approved }} POs Approved {{ day.day_item_approved }} Items Approved
{% for u in day.users %} {% endfor %}
Staff Member Invoices Line Items With Code Auto-Matched Manual Mapped Missing Code PO Approvals Item Approvals
{{ u.username }} {{ u.pdfs_processed }} {{ u.total_items }} {{ u.items_with_code }} {{ u.items_auto_matched }} {{ u.items_manual }} {% if u.items_missing > 0 %}{{ u.items_missing }} {% else %}0{% endif %} {% if u.po_approved > 0 %}{{ u.po_approved }} {% else %}0{% endif %} {% if u.item_code_approved > 0 %}{{ u.item_code_approved }} {% else %}0{% endif %}
PO & Item Code Activity History ({{ day.po_history|length }})
{% if day.po_history %}
{% for item in day.po_history %} {% endfor %}
Time Staff Operator Invoice # Vendor Approved PO # Action Type Resolution Status Audit Log Notes
{{ item.time }} {{ item.approved_by }} {{ item.invoice_number }} {{ item.vendor_name }} {% if item.po_number_approved and item.po_number_approved != '--' %} {{ item.po_number_approved }} {% else %} None {% endif %} {% if item.approval_type == 'item_code_approval' %} Item Code Approved {% elif item.approval_status == 'rejected' %} Rejected {% else %} PO Approved {% endif %} {% if item.approval_status in ('approved', 'completed') %} {{ item.approval_status|capitalize }} {% elif item.approval_status == 'pending_item_code' %} Pending Item Codes {% elif item.approval_status == 'rejected' %} Rejected {% else %} {{ item.approval_status|capitalize }} {% endif %} {{ item.notes }}
{% else %}
No manual PO or Item Code approval actions recorded on this date (extractions processed directly or awaiting queue action).
{% endif %}
{% endfor %} {% else %}
No Extractions Recorded
Daily user extraction audit records will appear here as staff process invoices.
{% endif %}

Registered Pharmacy Staff & Administrator Accounts

Manage system access, create new staff operators, promote administrators, and reset passwords.

{% for user in all_users %} {% endfor %}
Username Email Role Registered Date Last Login Account Status Actions
{{ user.username }} {{ user.email }} {% if user.is_admin %} ADMIN {% else %} PHARMACY STAFF {% endif %} {{ user.created_at[:10] if user.created_at else 'N/A' }} {{ user.last_login[:10] if user.last_login else 'Never' }} {% if user.is_active %} Active {% else %} Inactive {% endif %} {% if user.username != 'admin' and user.username != 'dmh' %} {% else %} Protected Admin {% endif %}

Drug Master Catalog (14,324 items)

Search, manage and update the hospital's standardized drug items, formulas, and hospital item codes.

Item Code Medicine Name / Description Category Last Updated Actions
Loading catalog database...

Catalog Distribution by Category

Total standardized medicines registered under each pharmaceutical group.

Drug Category Standardized Items

Unmapped Invoice Items Requiring Review

Line items extracted from invoices where no matching hospital item code was found.

Item Description Uploaded By Source Filename Extraction Date