{% extends 'ops/base_ops.html' %} {% block title %}{{ batch.batch_reference }} - IXG Operations{% endblock %} {% block content %}
Status{{ batch.get_status_display }}
Grade{{ batch.grade|default:'Not graded' }}
Weight{{ batch.weight_kg|default:'-' }} kg
Origin Facility{{ batch.origin_facility }}
Harvest Date{{ batch.harvest_date|date:'d/m/Y'|default:'-' }}
Created By{% if batch.created_by %}{{ batch.created_by.full_name|default:batch.created_by.email }}{% else %}-{% endif %}
Created At{{ batch.created_at|date:'d/m/Y H:i' }}
Notes

{{ batch.notes|linebreaks|default:'No notes' }}

Intake Lineage ({{ lineage|length }})
Edit lineage
{% if lineage %} {% for row in lineage %} {% endfor %}
Intake Date Received (kg) Allocated (kg) Origin Zone Collector Group
{{ row.harvest_intake.intake_reference }} {{ row.harvest_intake.intake_date|date:'d/m/Y'|default:'-' }} {{ row.harvest_intake.weight_kg|default:'-' }} {{ row.weight_allocated_kg|default:'-' }} {% if row.harvest_intake.origin_zone %} {{ row.harvest_intake.origin_zone.zone_code }} {% if row.harvest_intake.origin_zone.verification_status != 'verified' %} {{ row.harvest_intake.origin_zone.get_verification_status_display }} {% endif %} {% else %}-{% endif %} {{ row.harvest_intake.collector_group.name|default:'-' }}
Total allocated {{ lineage_allocated }} batch weight {{ batch.weight_kg|default:'-' }} kg
{% if lineage_difference > 0 %}

{{ lineage_difference }} kg of this batch is not traced back to a harvest intake. The platform shows the two figures side by side; it does not reconcile them.

{% elif lineage_difference < 0 %}

The allocated weights are above the batch weight — the usual direction, since processing loses weight. The platform shows the two figures side by side; it does not reconcile them.

{% endif %} {% else %}

No harvest intakes are linked to this batch. Until at least one is, this batch cannot be traced back to a collector group and an origin zone, and the due-diligence case for it will fail its lineage check.

{% endif %}
QC Results ({{ qc_results|length }})
{% if qc_results %} {% for r in qc_results %} {% endfor %}
ResultFFA%Moisture%PeroxideDate
{% if r.overall_pass %}Pass{% else %}Fail{% endif %} {{ r.ffa_percentage }} {{ r.moisture_percentage }} {{ r.peroxide_value }} {{ r.tested_at|date:'d/m/Y' }}
{% else %}

No QC results

{% endif %}
Shipments ({{ shipments|length }})
{% if shipments %} {% for s in shipments %} {% endfor %}
StatusVesselETDETA
{{ s.get_status_display }} {{ s.vessel_name|default:'-' }} {{ s.etd_nigeria|date:'d/m/Y'|default:'-' }} {{ s.eta_uk|date:'d/m/Y'|default:'-' }}
{% else %}

No shipments

{% endif %}
CAPA Records ({{ capa_records|length }})
{% if capa_records %} {% for c in capa_records %} {% endfor %}
IssueStatusDue Date
{{ c.issue_description|truncatewords:10 }} {{ c.get_status_display }} {{ c.due_date|date:'d/m/Y'|default:'-' }}
{% else %}

No CAPA records

{% endif %}
Documents ({{ documents|length }})
{% if documents %} {% else %}

No documents

{% endif %}
{% endblock %}