{# @var craft \craft\web\twig\variables\CraftVariable #}
{% import "_includes/forms" as forms %}
{% if order.lineItems | length or order.totalPrice > 0 %}
{% for lineItem in order.lineItems %}
{# First of all check if we should actually be showing this line item #}
{% if printShopSettings.showAllLineItemsOnOrderTab or (lineItem.options['printShop'] is defined and lineItem.options['printShop']) %}
{# Get the customer file #}
{% set file = craft.printShop.getFile(lineItem.id) %}
{% set proofStatus = 'no customer file' %}
{% if file %}
{# If we need to run proofing, then get that stuff #}
{% if printShopSettings.enableProofs %}
{% set proof = file.getLatestProof() %}
{% if proof %}
{% set proofStatus = proof.status %}
{% else %}
{% set proofStatus = 'no proof' %}
{% endif %}
{% else %}
{% set proofStatus = 'artwork supplied' %}
{% endif %}
{% endif %}