{% extends "base.html" %} {% block title %}Jobcard - {{ jobcard.jobcard_code }}{% endblock %} {% block header %}Operations Jobcard{% endblock %} {% block content %} {% set quote = jobcard.quote %} {% set client_deadline = jobcard.client_deadline or (quote.client_deadline if quote else none) %} {% set client_deadline_source = 'Jobcard' if jobcard.client_deadline else ('Quote fallback' if quote and quote.client_deadline else none) %} {% set branch = jobcard.branch %} {% set opp = quote.opportunity if quote else none %} {% set client_name = jobcard.client.company_name if jobcard.client else (opp.company if opp else '—') %} {% set contact_name = opp.contact_name if opp and opp.contact_name else '—' %} {% set contact_email = opp.contact_email if opp and opp.contact_email else '—' %} {% set contact_phone = opp.contact_phone if opp and opp.contact_phone else '—' %} {% set owner_id = jobcard.current_owner_id or jobcard.assigned_to_id %} {% set can_manage_jobcard = (owner_id == current_user.id) or current_user.has_perm("operations.jobcard.view_all") %} {% set latest_pi = latest_pi if latest_pi is defined else none %} {% set latest_invoice = latest_invoice if latest_invoice is defined else none %} {% set is_closed = jobcard.status == "Ready For Billing" %} {% set pending_closure_approval_request = pending_closure_approval_request if pending_closure_approval_request is defined else none %} {% set is_closure_approval_pending = pending_closure_approval_request is not none %} {% set is_billing_locked = latest_pi or latest_invoice %} {% set jobcard_processes = jobcard_processes if jobcard_processes is defined else [] %} {% set process_assignments_by_process = process_assignments_by_process if process_assignments_by_process is defined else {} %} {% set missing_required_fields_by_service = missing_required_fields_by_service if missing_required_fields_by_service is defined else {} %} {% set workload_summary = workload_summary if workload_summary is defined else {'required_count': 0, 'completed_count': 0, 'missing_count': 0, 'is_complete': true} %} {% set deadline_extension_requests = deadline_extension_requests if deadline_extension_requests is defined else [] %} {% set pending_deadline_extension_request = pending_deadline_extension_request if pending_deadline_extension_request is defined else none %} {% set latest_approved_deadline_extension = latest_approved_deadline_extension if latest_approved_deadline_extension is defined else none %} {% set deadline_extension_quote_owner = deadline_extension_quote_owner if deadline_extension_quote_owner is defined else none %} {% set can_request_deadline_extension = current_user.has_perm("operations.vendor.assign") and client_deadline and not pending_deadline_extension_request and not is_billing_locked %} {% set is_mtpe_jobcard = jobcard.mtpe_required or jobcard.mtpe_language_pair or jobcard.mtpe_mt_name or jobcard.mtpe_accuracy or jobcard.mtpe_feedback or jobcard.mtpe_remarks %} {% set language_pairs = language_pairs if language_pairs is defined else [] %} {% set mt_names = mt_names if mt_names is defined else [] %} {% set service_count = jobcard.services.count() if jobcard.services else 0 %} {% set process_count = jobcard_processes|length if jobcard_processes else 0 %} {% set completed_count = namespace(value=0) %} {% set assigned_count = namespace(value=0) %} {% set checklist_pending_count = namespace(value=0) %} {% set qc_pending_count = namespace(value=0) %} {% set internal_process_completed_count = namespace(value=0) %} {% set internal_process_assigned_count = namespace(value=0) %} {% set can_create_ticket = current_user.has_perm("ticketing.create") %} {% set can_view_ticketing = current_user.has_perm("ticketing.view") %} {% set rework_ticket_count = namespace(value=0) %} {% for svc in jobcard.services %} {% if svc.status == "Completed" %} {% set completed_count.value = completed_count.value + 1 %} {% endif %} {% set svc_assignments = assignments_by_service.get(svc.id, []) if assignments_by_service is defined else [] %} {% set production_assignments = svc_assignments | selectattr("assignment_type", "equalto", "PRODUCTION") | list %} {% if production_assignments|length > 0 or svc.status == "Completed" %} {% set assigned_count.value = assigned_count.value + 1 %} {% endif %} {% if svc.checklist_questions.count() > 0 and svc.checklist_status != "Submitted" %} {% set checklist_pending_count.value = checklist_pending_count.value + 1 %} {% endif %} {% if svc.rework_tickets is defined %} {% set rework_ticket_count.value = rework_ticket_count.value + svc.rework_tickets.count() %} {% endif %} {% for a in svc_assignments %} {% if a.assignment_type == "QC" and a.status != "Completed" %} {% set qc_pending_count.value = qc_pending_count.value + 1 %} {% endif %} {% endfor %} {% endfor %} {% for jp in jobcard_processes %} {% set jp_assignments = process_assignments_by_process.get(jp.id, []) %} {% if jp.status == "Completed" %} {% set internal_process_completed_count.value = internal_process_completed_count.value + 1 %} {% endif %} {% if jp_assignments|length > 0 %} {% set internal_process_assigned_count.value = internal_process_assigned_count.value + 1 %} {% endif %} {% endfor %}
| # | Language Pair | MT Engine / MT Name | Accuracy | Feedback | Remarks | Added By | Added At |
|---|---|---|---|---|---|---|---|
| {{ loop.index }} | {{ row.language_pair }} | {{ row.mt_name }} | {{ "%.2f"|format(row.accuracy or 0) }}% | {{ row.feedback }} | {{ row.remarks }} | {{ row.created_by.name if row.created_by else '—' }} | {{ row.created_at.strftime('%d-%m-%Y %I:%M %p') if row.created_at else '—' }} |
| Assigned To | Qty | Rate | Total | Deadline | Checklist | File | Status | Action |
|---|---|---|---|---|---|---|---|---|
|
{% if a.assigned_to_type == "INTERNAL" %}
Internal: {{ a.internal_user.name if a.internal_user else '—' }}
{% else %}
Vendor: {{ a.vendor.name if a.vendor 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 '—' }} | {% if a.checklist_status == "Submitted" %} Submitted {% else %} Pending {% endif %} {% if a.external_checklist_url %} {% endif %} | {% if a.file_path %} {{ a.file_title or 'View File' }} {% else %} — {% endif %} | {% if a.status == "Completed" %} Completed {% else %} {{ a.status }} {% endif %} | {% if can_manage_jobcard and not is_closed and not is_billing_locked and not is_closure_approval_pending %} {% if a.assigned_to_type == "VENDOR" and a.status not in ["Completed", "Cancelled", "Replaced"] and a.external_checklist_url %} {% endif %} {% if a.assignment_type == "PRODUCTION" and a.assigned_to_type == "VENDOR" and a.status not in ["Cancelled", "Replaced"] and not is_closed and not is_billing_locked and not is_closure_approval_pending %} {% endif %} {% if a.checklist_status != "Submitted" %} {% endif %} {% if a.status != "Completed" %} {% endif %} {% else %} — {% endif %} |
| Field | Value |
|---|---|
| {{ f.field_master.field_label if f.field_master else f.field_key }} {% if f.field_master and f.field_master.is_required and not f.field_value and not f.file_path %} Required {% endif %} | {% if f.file_path %} View File {% elif f.field_value %} {{ f.field_value }} {% else %} — {% endif %} |
| No field values captured. | |
| QC Assigned To | Qty | Deadline | Status | Action |
|---|---|---|---|---|
|
{% if qc.assigned_to_type == "INTERNAL" %}
Internal: {{ qc.internal_user.name if qc.internal_user else '—' }}
{% else %}
Vendor: {{ qc.vendor.name if qc.vendor else '—' }}
{% endif %}
{% if qc.instruction %}
{{ qc.instruction }}
{% endif %}
{% if qc.file_path %}
{{ qc.file_title or 'View File' }}
{% endif %}
|
{{ qc.assigned_qty }} | {{ qc.deadline.strftime('%d-%m-%Y %I:%M %p') if qc.deadline else '—' }} | {% if qc.status == "Completed" %} Completed {% else %} Pending {% endif %} | {% if can_manage_jobcard and qc.status != "Completed" and not is_closed and not is_billing_locked %} {% else %} — {% endif %} |
| Service Line | Assigned To | Qty | Rate | Total | Deadline | File | Status | Update |
|---|---|---|---|---|---|---|---|---|
|
{{ pa.jobcard_service.service_name if pa.jobcard_service else '—' }}
{% if pa.jobcard_service and pa.jobcard_service.quote_item %}
{{ pa.jobcard_service.quote_item.item_name }}
{% endif %}
|
{% if pa.assigned_to_type == "INTERNAL" %}
Internal:
{{ pa.internal_user.name if pa.internal_user else '—' }}
{% else %}
Vendor:
{{ pa.vendor.name if pa.vendor else '—' }}
{% endif %}
{% if pa.instruction %}
{{ pa.instruction }}
{% endif %}
|
{{ "%.2f"|format(pa.assigned_qty or 0) }} |
{% if pa.assigned_to_type == "VENDOR" %}
{{ "%.4f"|format(pa.rate or 0) }}
{% if pa.flat_rate %}
Flat
{% endif %}
{% else %}
—
{% endif %}
|
{% if pa.assigned_to_type == "VENDOR" %} {% if pa.flat_rate %} {{ "%.2f"|format(pa.rate or 0) }} {% else %} {{ "%.2f"|format((pa.assigned_qty or 0) * (pa.rate or 0)) }} {% endif %} {% else %} — {% endif %} | {{ pa.deadline.strftime('%d-%m-%Y %I:%M %p') if pa.deadline else '—' }} | {% if pa.file_path %} {{ pa.file_title or 'View File' }} {% else %} — {% endif %} | {% if pa.status == "Completed" %} Completed {% elif pa.status == "In Progress" %} In Progress {% elif pa.status == "On Hold" %} On Hold {% elif pa.status == "Cancelled" %} Cancelled {% else %} {{ pa.status or 'Assigned' }} {% endif %} | {% set can_update_process_assignment = can_manage_jobcard or (pa.assigned_to_type == "INTERNAL" and pa.internal_user_id == current_user.id) or current_user.has_perm("operations.jobcard.view_all") %} {% if current_user.has_perm("operations.internal_process.update") and can_update_process_assignment and not is_closed and not is_billing_locked and not is_closure_approval_pending %} {% else %} — {% endif %} |
| Quote | Opportunity | Currency | Subtotal | Tax | Total |
|---|---|---|---|---|---|
| {{ quote.quote_code }} |
{% if opp %}
{{ opp.title }}
{{ opp.company or '—' }}
{% else %}
—
{% endif %}
|
{{ quote.currency or 'INR' }} | {{ indian_amount(quote.subtotal or 0) }} | {{ indian_amount(quote.tax or 0) }} | {{ indian_amount(quote.total_amount or quote.total or 0) }} |
| Ticket No | Service Line | Type | Priority | Status | Raised By | Date | Action |
|---|---|---|---|---|---|---|---|
| {{ t.ticket_no }} |
{{ svc.service_name or '—' }}
{% if svc.quote_item %}
{{ svc.quote_item.item_name }}
{% endif %}
|
{{ t.feedback_type }} | {% if t.priority == "Critical" %} Critical {% elif t.priority == "High" %} High {% else %} {{ t.priority }} {% endif %} | {{ t.status }} | {{ t.raised_by.name if t.raised_by else '—' }} | {{ t.created_at.strftime('%d-%m-%Y %I:%M %p') if t.created_at else '—' }} | Open |
| From | To | Transferred By | Remark | Date |
|---|---|---|---|---|
| {{ row.from_user.name if row.from_user else '—' }} | {{ row.to_user.name if row.to_user else '—' }} | {{ row.transferred_by.name if row.transferred_by else '—' }} | {{ row.remark }} | {{ row.transferred_at.strftime('%d-%m-%Y %I:%M %p') if row.transferred_at else '—' }} |