{% extends "base.html" %} {% block title %}Vendor Assignment - {{ jobcard.jobcard_code }}{% endblock %} {% block header %}Vendor Assignment{% endblock %} {% block content %} {% set quote = jobcard.quote %} {% set total_services = services|length %} {% set editable_count = namespace(value=0) %} {% set completed_count = namespace(value=0) %} {% set assigned_count = namespace(value=0) %} {% set remaining_total = namespace(value=0) %} {% for svc in services %} {% set svc_assignments = assignments_by_service.get(svc.id, []) if assignments_by_service is defined else [] %} {% set remaining_qty = remaining_qty_by_service.get(svc.id, 0) if remaining_qty_by_service is defined else 0 %} {% if svc.status == "Completed" %} {% set completed_count.value = completed_count.value + 1 %} {% endif %} {% if svc_assignments|length > 0 %} {% set assigned_count.value = assigned_count.value + 1 %} {% endif %} {% if svc.status != "Completed" and remaining_qty|float > 0 %} {% set editable_count.value = editable_count.value + 1 %} {% endif %} {% set remaining_total.value = remaining_total.value + (remaining_qty|float) %} {% endfor %}
Operations Assignment

{{ jobcard.jobcard_code }}

{{ jobcard.status or 'Submitted' }} {% if quote %} Quote: {{ quote.quote_code }} Currency: {{ quote.currency or 'INR' }} {% endif %}
{% if current_user.has_perm("operations.vendor.manage") %}
{% endif %} Back
Services
{{ total_services }}
Total line items
Assigned
{{ assigned_count.value }}
With assignment rows
Completed
{{ completed_count.value }}
Locked services
Editable
{{ editable_count.value }}
Can assign now
Line Item Workspace
Assign Production Work
Search, filter and expand only the service line you want to work on.
Optional Workload Capture
Shared workload classification
Select once. Tick workload under any internal assignment and enter only its quantity.
Internal assignments only
{% if services|length > 0 %}
{% for svc in services %} {% set svc_assignments = assignments_by_service.get(svc.id, []) if assignments_by_service is defined else [] %} {% set remaining_qty = remaining_qty_by_service.get(svc.id, 0) if remaining_qty_by_service is defined else 0 %} {% set is_completed = svc.status == "Completed" %} {% set can_edit_service = not is_completed %} {% set existing_questions = existing_checklists_by_service.get(svc.id, []) if existing_checklists_by_service is defined else [] %} {% set master_questions = master_checklists_by_service.get(svc.service_id, []) if master_checklists_by_service is defined and svc.service_id else [] %} {% set questions_to_show = existing_questions if existing_questions|length > 0 else master_questions %}

Total Quantity
{{ svc.total_quantity or (svc.quote_item.qty if svc.quote_item else 0) }}
Remaining Quantity
{{ remaining_qty }}
Existing Assignments
{{ svc_assignments|length }}
{% if svc_assignments|length > 0 %}
Existing Assignments
{% for a in svc_assignments %} {% endfor %}
Type Assigned To Qty Rate Total Deadline File Status Action
{{ a.assignment_type }} {{ a.assigned_to_type }} {% if a.vendor %} {{ a.vendor.name }} {% elif a.internal_user %} {{ a.internal_user.name }} {% else %} — {% endif %} {% if a.instruction %}
{{ a.instruction }}
{% endif %}
{{ "%.2f"|format(a.assigned_qty or 0) }} {% if a.assigned_to_type == "VENDOR" %} {{ "%.4f"|format(a.rate or 0) }} {% if a.flat_rate %}
Flat
{% endif %} {% else %} — {% endif %}
{% if a.assigned_to_type == "VENDOR" %} {% if a.flat_rate %} {{ "%.2f"|format(a.rate or 0) }} {% else %} {{ "%.2f"|format((a.assigned_qty or 0) * (a.rate or 0)) }} {% endif %} {% else %} — {% endif %} {{ a.deadline.strftime('%d-%m-%Y %I:%M %p') if a.deadline else '—'|safe }} {% if a.file_path %} {{ a.file_title or 'View File' }} {% else %} — {% endif %} {% if a.status == "Completed" %} Completed {% elif a.assignment_type == "QC" and a.status != "Completed" and a.status != "Replaced" %} {% elif a.status == "Replaced" %} Replaced {% elif a.status == "On Hold" %} On Hold {% else %} {{ a.status or 'Assigned' }} {% endif %} {% if a.assignment_type == "PRODUCTION" and a.assigned_to_type == "VENDOR" and a.status != "Replaced" and svc.status != "Completed" %} {% elif a.assignment_type == "QC" and a.status != "Completed" and a.status != "Replaced" %} {% elif a.status == "Replaced" %} Replaced {% if a.replacement_reason %}
{{ a.replacement_reason }}
{% endif %} {% else %} — {% endif %}
{% endif %} {% if can_edit_service %}
New Assignment
Assign work to vendor / translator and push to PMS.
Assign internally without PMS vendor push.
Uses the shared classification selected at the top. More rows can be added later from the Workload tab.
Quality Check Assignment
Assign an internal or vendor QC task independently from production.
Completion Checklist
Add QC / delivery validation checklist.
{% for cq in questions_to_show %}
{% endfor %}
{% if questions_to_show|length == 0 %}
No checklist added yet.
{% endif %}
{% else %}
{% if is_completed %} This service is completed, so new assignment fields are locked. {% elif remaining_qty|float <= 0 %} No remaining quantity available for assignment. {% else %} This service is not editable. {% endif %}
{% endif %}
{% endfor %}
{% else %}
No service lines found for this jobcard.
{% endif %} {% if editable_count.value > 0 %}
{% endif %}
{% for svc in services %} {% set svc_assignments = assignments_by_service.get(svc.id, []) if assignments_by_service is defined else [] %} {% for a in svc_assignments %} {% if a.assignment_type == "PRODUCTION" and a.assigned_to_type == "VENDOR" and a.status != "Replaced" and svc.status != "Completed" %} {% endif %} {% endfor %} {% endfor %} {% for svc in services %} {% set svc_assignments = assignments_by_service.get(svc.id, []) if assignments_by_service is defined else [] %} {% set is_translation = 'translation' in (svc.service_name or '')|lower %} {% for a in svc_assignments %} {% if a.assignment_type == 'QC' and a.status not in ['Completed','Replaced'] %} {% endif %} {% endfor %} {% endfor %} {% endblock %}