{% extends "base.html" %} {% block title %}Internal Process Task{% endblock %} {% block header %}Internal Process Task{% endblock %} {% block content %} {% set process = assignment.jobcard_process %} {% set process_master = process.process_master if process else None %} {% set jobcard = process.jobcard if process else None %} {% set quote = jobcard.quote if jobcard else None %} {% set svc = assignment.jobcard_service %} {% set process_code = (process_master.code if process_master and process_master.code else '')|lower|trim %} {% set process_name = (process_master.name if process_master and process_master.name else '')|lower|trim %} {% set is_mtpe = process_code == 'mtpe' or process_name == 'mtpe' or process_name == 'mtpe()' or 'mtpe' in process_code or 'mtpe' in process_name %} {% set internal_transfer_users = internal_transfer_users if internal_transfer_users is defined else [] %} {% set delegated_child_rows = delegated_child_rows if delegated_child_rows is defined else [] %} {% set remaining_delegatable_qty = remaining_delegatable_qty if remaining_delegatable_qty is defined else assignment.assigned_qty %} {% set delegated_qty = delegated_qty if delegated_qty is defined else 0 %} {% set completed_delegated_qty = completed_delegated_qty if completed_delegated_qty is defined else 0 %} {% set is_child_task = assignment.parent_assignment_id is defined and assignment.parent_assignment_id is not none %} {% set is_delegated_parent = assignment.parent_assignment_id is defined and assignment.parent_assignment_id is none and assignment.status == "Delegated" %} {% set can_modify_assignment = jobcard is not none and jobcard.status not in ["Ready For Billing", "Closure Approval Pending"] %} {% set can_delegate_assignment = can_delegate_assignment if can_delegate_assignment is defined else (assignment.status not in ["Completed", "Delegated", "Cancelled"] and can_modify_assignment and not is_child_task and remaining_delegatable_qty and remaining_delegatable_qty > 0) %} {% set can_update_status = assignment.status != "Delegated" %}
Internal Process Task

{{ process_master.name if process_master else 'Internal Process' }}

{% if jobcard %} {{ jobcard.jobcard_code }} {% endif %} {% if quote %} • {{ quote.quote_code }} {% endif %} {% if svc %} • {{ svc.service_name }} {% endif %} {% if is_mtpe %} • MTPE Evaluation Required {% endif %} {% if is_child_task %} • Delegated Process Task {% endif %}
Status
{% if assignment.status == "Completed" %} {% elif assignment.status == "In Progress" %} {% elif assignment.status == "On Hold" %} {% elif assignment.status == "Delegated" %} {% else %} {% endif %} {{ assignment.status or 'Assigned' }}
{% if is_delegated_parent %} Fully Delegated Parent Task {% elif is_child_task %} Delegated Child Task {% elif delegated_child_rows|length > 0 %} Partially Delegated {% endif %}
{% if can_delegate_assignment %} {% endif %} Back to My Tasks {% if jobcard %} Open Jobcard {% endif %}
{% if is_delegated_parent %}
This internal process task has been fully delegated.
The parent task cannot be completed directly. Completion will be counted through delegated child process tasks.
{% endif %} {% if is_child_task %}
This is a delegated internal process task.
Complete your assigned quantity and update MTPE details if this process requires them.
{% endif %}
Assigned Qty

{{ assignment.assigned_qty or 0 }}

Total task quantity
Delegated Qty

{{ delegated_qty or 0 }}

Already delegated
Completed Delegated Qty

{{ completed_delegated_qty or 0 }}

Completed by child users
Remaining Qty

{{ remaining_delegatable_qty or 0 }}

Available to delegate
{% if delegated_child_rows|length > 0 %}
Delegation Details
Delegated Internal Process Users
Total delegated: {{ delegated_qty or 0 }} | Completed: {{ completed_delegated_qty or 0 }} | Remaining: {{ remaining_delegatable_qty or 0 }}
{% if remaining_delegatable_qty and remaining_delegatable_qty > 0 and can_modify_assignment and assignment.status != "Completed" and not is_child_task %} {% endif %}
{% for child in delegated_child_rows %} {% endfor %}
User Qty Deadline Status Assigned On Instruction
{{ child.internal_user.name if child.internal_user else '—' }}
{{ child.internal_user.email if child.internal_user and child.internal_user.email else '' }}
{{ child.assigned_qty or 0 }} {% if child.deadline %}
{{ child.deadline.strftime('%d %b %Y') }}
{{ child.deadline.strftime('%I:%M %p') }}
{% else %} — {% endif %}
{% if child.status == "Completed" %} Completed {% elif child.status == "In Progress" %} In Progress {% elif child.status == "On Hold" %} On Hold {% elif child.status == "Delegated" %} Delegated {% else %} {{ child.status or 'Assigned' }} {% endif %} {% if child.assigned_at %}
{{ child.assigned_at.strftime('%d %b %Y') }}
{{ child.assigned_at.strftime('%I:%M %p') }}
{% else %} — {% endif %}
{% if child.instruction %}
{{ child.instruction }}
{% else %} — {% endif %}
{% endif %}
Task Details
Assignment Information
Process
{{ process_master.name if process_master else '—' }}
{% if process_master and process_master.description %}
{{ process_master.description }}
{% endif %}
Service Line
{{ svc.service_name if svc else '—' }}
{% if svc and svc.quote_item %}
{{ svc.quote_item.item_name }}
{% endif %}
Quantity
{{ assignment.assigned_qty or 0 }}
Rate
{{ assignment.rate or 0 }}
{% if assignment.flat_rate %}
Flat rate
{% else %}
Per unit
{% endif %}
Deadline
{{ assignment.deadline.strftime('%d %b %Y') if assignment.deadline else '—' }}
{% if assignment.deadline %}
{{ assignment.deadline.strftime('%I:%M %p') }}
{% endif %}
Instruction
{{ assignment.instruction or '—' }}
{% if assignment.file_path %}
File
{{ assignment.file_title or 'Attached file' }}
Open File
{% endif %}
{% if is_mtpe %}
MTPE Details
Machine Translation Post Editing Evaluation
MTPE fields are required before completion
Fill Language Pair, MT Name, Accuracy, Post Editor Feedback and Remarks before marking this task as Completed.
Language Pair
{{ assignment.mtpe_language_pair or '—' }}
MT Name
{{ assignment.mtpe_mt_name or '—' }}
Accuracy
{% if assignment.mtpe_accuracy is not none %} {{ assignment.mtpe_accuracy }}% {% else %} — {% endif %}
Post Editor Feedback
{{ assignment.mtpe_feedback or '—' }}
Remarks
{{ assignment.mtpe_remarks or '—' }}
{% endif %}
Update
Task Status
{% if can_update_status %}
{% if is_mtpe %}
MTPE Completion Fields
Required when status is Completed.
{% endif %}
{% else %}
This parent process task is fully delegated. Complete delegated child tasks instead.
{% endif %} {% if assignment.completed_at %}
Completed on {{ assignment.completed_at.strftime('%d %b %Y %I:%M %p') }}
{% endif %}
Delegation Summary
Quantity Split
Parent Qty
{{ assignment.assigned_qty or 0 }}
Delegated Qty
{{ delegated_qty or 0 }}
Remaining Qty
{{ remaining_delegatable_qty or 0 }}
Related Records
Reference
Jobcard
{{ jobcard.jobcard_code if jobcard else '—' }}
Quote
{% if quote %} {{ quote.quote_code }} {% else %}
—
{% endif %}
Client
{{ jobcard.client.company_name if jobcard and jobcard.client else '—' }}
{% if can_delegate_assignment or (remaining_delegatable_qty and remaining_delegatable_qty > 0 and can_modify_assignment and assignment.status != "Completed" and not is_child_task) %} {% endif %} {% if is_mtpe %} {% endif %} {% endblock %}