{% extends "base.html" %} {% block title %}Rework Ticket - {{ ticket.ticket_no }}{% endblock %} {% block header %}Rework Ticket{% endblock %} {% block content %} {% set jobcard = ticket.jobcard %} {% set quote = ticket.jobcard.quote if ticket.jobcard and ticket.jobcard.quote else none %} {% set client_name = ticket.jobcard.client.company_name if ticket.jobcard and ticket.jobcard.client else (quote.opportunity.company if quote and quote.opportunity else '—') %} {% set service_name = ticket.jobcard_service.service_name if ticket.jobcard_service else '—' %} {% set quote_item_name = ticket.quote_item.item_name if ticket.quote_item else (ticket.jobcard_service.quote_item.item_name if ticket.jobcard_service and ticket.jobcard_service.quote_item else '—') %} {% set status_class = 'success' if ticket.status in ['Resolved', 'Closed'] else ('danger' if ticket.status in ['Rejected', 'Approval Pending'] else '') %}
Ticketing System

{{ ticket.ticket_no }}

Jobcard: {{ jobcard.jobcard_code if jobcard else '-' }} {% if quote %} Quote: {{ quote.quote_code }} {% endif %} {{ ticket.feedback_type or 'Rework' }} {{ ticket.status }}
Client
{{ client_name }}
PM: {{ ticket.assigned_pm.name if ticket.assigned_pm else '—' }}
Track customer feedback, rework assignment, approval, attachments, and closure from one place.
{% if jobcard %} Open Jobcard {% endif %} Back to Tickets
Rework Ticket

Ticket Snapshot

Review affected line item, feedback details, reassignment rounds, and required approvals.
{{ ticket.status }}
Line Item
{{ service_name }}
{{ quote_item_name }}
Priority
{% if ticket.priority == "Critical" %} Critical {% elif ticket.priority == "High" %} High {% elif ticket.priority == "Low" %} Low {% else %} {{ ticket.priority }} {% endif %}
Response urgency
Rework Count
{{ service_rework_count }} / 2
{% if service_rework_count >= 2 and not ticket.approved_by_operations_head_id %} Approval required {% elif ticket.approved_by_operations_head_id %} Head approved {% else %} Within allowed limit {% endif %}
Raised By
{{ ticket.raised_by.name if ticket.raised_by else '—' }}
{{ ticket.created_at.strftime('%d-%m-%Y %I:%M %p') if ticket.created_at else '—' }}
{% if service_rework_count >= 2 and not ticket.approved_by_operations_head_id %}
Operations Head approval required
This line item already has two rework assignments. The next reassignment can be created only after Operations Head approval.
{% endif %} {% if has_pi_or_invoice %}
PI or Invoice already exists
Please verify commercial impact before assigning rework because billing activity already exists for this jobcard quote.
{% endif %}
Ticket Details
Customer Feedback
{{ ticket.feedback_type or 'Rework' }}
{% if ticket.internal_remark %}
Internal Remark
{{ ticket.internal_remark }}
{% endif %}
Assignment History
Rework Rounds
{{ rework_assignments|length }} Assignment(s)
{% if rework_assignments|length > 0 %}
{% for r in rework_assignments %} {% endfor %}
Round Assigned To Qty Status Deadline Assigned By
{{ r.rework_round }} {% if r.reassigned_to_type == 'VENDOR' %}
Vendor
{{ r.vendor.name if r.vendor else '-' }}
{% else %}
Internal
{{ r.internal_user.name if r.internal_user else '-' }}
{% endif %} {% if r.instruction %}
{{ r.instruction }}
{% endif %}
{{ "%.2f"|format(r.assigned_qty or 0) }} {% if r.status == "Completed" %} Completed {% elif r.status == "Cancelled" %} Cancelled {% elif r.status == "In Progress" %} In Progress {% else %} {{ r.status }} {% endif %} {{ r.deadline.strftime('%d-%m-%Y %I:%M %p') if r.deadline else '-' }} {{ r.assigned_by.name if r.assigned_by else '-' }}
{% else %}
No rework assignments created yet.
{% endif %}
{% if can_assign_rework and current_user.has_perm('ticketing.assign') %}
Create Assignment
Assign Rework
Create a fresh production assignment for this rework round.
Round {{ service_rework_count + 1 }}
{% endif %}
Workflow Actions
Actions
{% if ticket.status == 'Pending PM Review' and current_user.has_perm('ticketing.manage') %}
{% endif %} {% if current_user.has_perm('ticketing.assign') and service_rework_count >= 2 and ticket.status != 'Approval Pending' and not ticket.approved_by_operations_head_id %}
{% endif %} {% if ticket.status == 'Approval Pending' and current_user.has_perm('ticketing.approve') %}
Approval Decision
{% endif %} {% if ticket.status not in ['Closed', 'Rejected'] and current_user.has_perm('ticketing.manage') %}
{% endif %} {% if ticket.status != 'Closed' and current_user.has_perm('ticketing.close') %}
{% endif %} {% if ticket.status not in ['Closed', 'Rejected'] and current_user.has_perm('ticketing.manage') %}
{% endif %} {% if ticket.status in ['Closed', 'Rejected'] %}
No active workflow actions available.
{% endif %}
Files
Attachments
{{ ticket.attachments|length if ticket.attachments else 0 }}
{% for a in ticket.attachments %}
{{ a.file_title or 'Attachment' }}
View / Download
{{ a.uploaded_by.name if a.uploaded_by else '-' }} | {{ a.uploaded_at.strftime('%d-%m-%Y') if a.uploaded_at else '-' }}
{% else %}
No attachments uploaded.
{% endfor %} {% if current_user.has_perm('ticketing.manage') %}
{% endif %}
{% endblock %}