{% extends "base.html" %} {% block title %}My Internal Tasks{% endblock %} {% block header %}My Internal Tasks{% endblock %} {% block content %}
{% set internal_transfer_users = internal_transfer_users if internal_transfer_users is defined else [] %} {% if summary is defined %} {% set total_tasks = summary.total %} {% set assigned_count = summary.assigned %} {% set progress_count = summary.in_progress %} {% set completed_count = summary.completed %} {% else %} {% set total_tasks = pagination.total %} {% set assigned_count = pagination.items | selectattr("status", "equalto", "Assigned") | list | length %} {% set progress_count = pagination.items | selectattr("status", "equalto", "In Progress") | list | length %} {% set completed_count = pagination.items | selectattr("status", "equalto", "Completed") | list | length %} {% endif %}
Operations Desk

My Internal Tasks

Track service tasks, internal process assignments, checklist status and progress.
Total Tasks
{{ total_tasks }}
Assigned
{{ assigned_count }}
In Progress
{{ progress_count }}
Completed
{{ completed_count }}
Reset
{% for item in pagination.items %} {% if item is mapping %} {% set task_type = item.task_type %} {% set assignment = item.assignment %} {% set process_assignment = item.process_assignment %} {% set quote = item.quote %} {% set jc = item.jobcard %} {% set line_title = item.line_title %} {% set line_subtitle = item.line_subtitle %} {% set quantity = item.quantity %} {% set assigned_at = item.assigned_at %} {% set row_status = item.status %} {% set checklist_status = item.checklist_status %} {% set detail_url = item.detail_url %} {% else %} {# Backward compatibility if route still sends old OperationsJobcardAssignment rows #} {% set task_type = "SERVICE" %} {% set assignment = item %} {% set process_assignment = none %} {% set svc = assignment.jobcard_service %} {% set jc = svc.jobcard if svc else none %} {% set quote = jc.quote if jc else none %} {% set line_title = svc.service_name if svc else "Service Not Mapped" %} {% set line_subtitle = svc.quote_item.item_name if svc and svc.quote_item else "" %} {% set quantity = assignment.assigned_qty or 0 %} {% set assigned_at = assignment.assigned_at %} {% set row_status = assignment.status or "Assigned" %} {% set checklist_status = assignment.checklist_status %} {% set detail_url = url_for('operations.internal_task_detail', assignment_id=assignment.id) %} {% endif %} {% else %} {% endfor %}
Quote Jobcard Task / Line Item Quantity Assigned On Status Action
{% if quote %} {{ quote.quote_code }}
Quote ID: #{{ quote.id }}
{% else %} — {% endif %}
JC
{{ jc.jobcard_code if jc else '—' }}
{% if jc and jc.client %} {{ jc.client.company_name }} {% elif quote and quote.client %} {{ quote.client.company_name }} {% else %} — {% endif %}
{{ line_title or '—' }}
{% if task_type == "PROCESS" %} Internal Process {% else %} Service Task {% endif %}
{% if line_subtitle %}
{{ line_subtitle }}
{% endif %} {% if task_type == "SERVICE" and assignment and assignment.instruction %}
{{ assignment.instruction[:80] }}{% if assignment.instruction|length > 80 %}...{% endif %}
{% endif %} {% if task_type == "PROCESS" and process_assignment and process_assignment.instruction %}
{{ process_assignment.instruction[:80] }}{% if process_assignment.instruction|length > 80 %}...{% endif %}
{% endif %}
{{ quantity or 0 }}
Assigned qty
{{ assigned_at.strftime('%d %b %Y') if assigned_at else '—' }}
{{ assigned_at.strftime('%I:%M %p') if assigned_at else '' }}
{% if row_status == "Completed" %} Completed {% elif row_status == "In Progress" %} In Progress {% elif row_status == "On Hold" %} On Hold {% elif row_status == "Assigned" %} Assigned {% else %} {{ row_status or 'Assigned' }} {% endif %} {% if task_type == "SERVICE" %} {% if checklist_status == "Submitted" %}
Checklist submitted
{% else %}
Checklist pending
{% endif %} {% else %}
Process assignment
{% endif %}
{% set can_transfer_assignment = ( task_type == "SERVICE" and assignment and row_status != "Completed" and jc and jc.status not in ["Ready For Billing", "Closure Approval Pending"] ) %}
View {% if can_transfer_assignment %} {% endif %}
No internal tasks assigned
Service assignments and internal process assignments will appear here.
{% for item in pagination.items %} {% if item is mapping %} {% set task_type = item.task_type %} {% set assignment = item.assignment %} {% set jc = item.jobcard %} {% else %} {% set task_type = "SERVICE" %} {% set assignment = item %} {% set svc = assignment.jobcard_service %} {% set jc = svc.jobcard if svc else none %} {% endif %} {% if task_type == "SERVICE" and assignment %} {% set svc = assignment.jobcard_service %} {% set can_transfer_assignment = ( assignment.status != "Completed" and jc and jc.status not in ["Ready For Billing", "Closure Approval Pending"] ) %} {% if can_transfer_assignment %} {% endif %} {% endif %} {% endfor %} {% if pagination.pages > 1 %} {% endif %}
{% endblock %}