{% extends "site_base.html" %} {% load i18n %} {% load bootstrap_tags %} {% block head_title %}{% trans "Process" %}: {{ process }}{% endblock %} {% block extra_head %} {% endblock %} {% block body_class %}work{% endblock %} {% block body_base %}
{% include "_messages.html" %}
{% trans "Process" %}: {{ process }} {% if process.started %} - {% trans "Started" %} {{ process.started }}{% endif %} {% if agent %}  {% trans "Change Process Plan" %} {% if process.finished %} {% trans "Unfinish" %} {% else %} {% trans "Finish" %} {% endif %} {% endif %} {% if labnotes %}

{% trans "Labnotes for this process" %}

{% endif %}
{% if process.independent_demand %}

{% trans "for" %}: {{ process.independent_demand }}

{% endif %} {% if process.notes %}

{% trans "Process Notes" %}:

{{ process.notes|urlize|linebreaks }}

{% endif %}

{% trans "Previous processes" %}

{% for proc in process.previous_processes %}

{{ proc }}

{% endfor %}

{% trans "Next processes" %}

{% for proc in process.next_processes %}

{{ proc }}

{% endfor %}

{% trans "Outputs" %}:

{% for item in process.outgoing_commitments %}

{% trans "Scheduled" %}: {{ item.resource_type.name }} {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }} {% if agent %}    {% trans "Log Resource" %}

{% endif %}

{% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %} {% for event in item.fulfilling_events %}

{% trans "Completed" %}: {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% trans "Resource" %}: {{ event.resource }}

{% endfor %} {% endfor %} {% for event in process.uncommitted_production_events %}

{% trans "Created" %}: {{ event.resource_type.name }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }}

{% endfor %} {% if process.citation_requirements or process.uncommitted_citation_events %}

{% trans "Citations" %}:

{% for item in process.citation_requirements %} {% endfor %} {% for event in process.uncommitted_citation_events %}

{% trans "Cited" %}: {{ event.resource_type.name }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }}

{% endfor %} {% endif %} {% if process.consumed_input_requirements or process.uncommitted_consumption_events %}

{% trans "Consumable Inputs" %}:

{% for item in process.consumed_input_requirements %}

{{ item.resource_type.name }}: {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }}

{% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %} {% if item.resource_type.onhand %} {% for resource in item.resource_type.onhand %}

{% trans "Onhand" %}: {{ resource.label }} {{ resource.quantity }} {{ resource.unit_ofFtake_quantity }} {% for event in resource.consuming_events %} {% if event.commitment == item %}

{% trans "Consumed" %}: {{ event.quantity }} {{ event.event_date }}

{% endif %} {% endfor %}

{% endfor %} {% elif item.fulfilled_quantity %}

{% trans "Onhand" %}: 0 {{ item.unit_of_quantity }}

{% trans "Consumed" %}: {{ item.fulfilled_quantity }}

{% elif item.associated_producing_commitments %} {% for ct in item.associated_producing_commitments %}

{% trans "Scheduled" %}: {{ ct.quantity }} {{ ct.unit_of_quantity }} {{ ct.due_date }}

{% endfor %} {% else %} {% for source in item.sources %}

{% trans "Source" %}: {{ source.agent.name }} {% trans "Lead time" %}: {{ source.lead_time }} {% trans "days" %}
{% comment %} {% if source.too_late %}

{% csrf_token %} {% trans "Should have purchased" %} {{ source.order_release_date|timesince }} {% trans "ago" %}  
{% else %} {% trans "Purchase by:" %}{{ source.order_release_date }} {% endif %} {% endcomment %}

{% endfor %} {% endif %} {% endfor %} {% for event in process.uncommitted_consumption_events %}

{% trans "Consumed" %}: {{ event.resource_type.name }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }}

{% endfor %} {% endif %} {% if process.used_input_requirements or process.uncommitted_use_events %}

{% trans "Usable Inputs" %}:

{% for item in process.used_input_requirements %}

{{ item.resource_type.name }}: {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }}

{% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %} {% if item.resource_type.onhand %} {% for resource in item.resource_type.onhand %}

{% trans "Onhand" %}: {{ resource.label }} {{ resource.quantity }} {{ resource.unit_of_quantity }} {% for event in resource.using_events %} {% if event.commitment == item %}

{% trans "Used" %}: {{ event.quantity }} {{ item.resource_type.unit_of_use }} {{ event.event_date }}

{% endif %} {% endfor %}

{% endfor %} {% elif item.fulfilled_quantity %}

{% trans "Onhand" %}: 0 {{ item.unit_of_quantity }}

{% trans "Used" %}: {{ item.fulfilled_quantity }} {{ item.resource_type.unit_of_use }}

{% elif item.associated_producing_commitments %} {% for ct in item.associated_producing_commitments %}

{% trans "Scheduled" %}: {{ ct.quantity }} {{ ct.unit_of_quantity }} {{ ct.due_date }}

{% endfor %} {% else %} {% for source in item.resource_type.producing_agent_relationships %}

{% trans "Source" %}: {{ source.agent.name }} {% trans "Lead time" %}: {{ source.lead_time }} {% trans "days" %}

{% endfor %} {% endif %} {% endfor %} {% for event in process.uncommitted_use_events %}

{% trans "Used" %}: {{ event.resource_type.name }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }}

{% endfor %} {% endif %} {% if process.work_requirements or process.uncommitted_work_events %}

{% trans "Work" %}:

{% for item in process.work_requirements %}

{{ item.resource_type.name }}: {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }} {% if item.from_agent %} {% trans "Taken by" %} {{ item.from_agent.nick }}

{% else %} {% trans "Unassigned" %} {% if agent %}    {% trans "Take this task" %} {% endif %}

{% if item.description and not item.fulfilling_events %}
{{ item.description|urlize|linebreaks }}
{% endif %} {% for source in item.resource_type.producing_agent_relationships %}

{% trans "Source" %}: {{ source.agent.name }}

{% endfor %} {% endif %} {% endfor %} {% for event in process.uncommitted_work_events %}

{% trans "Done by" %}: {{ event.from_agent.nick }} {{ event.resource_type.name }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }}

{% endfor %} {% endif %}
{% endblock %} {% block extra_script %} {% endblock %} {% block extra_body %} {{ block.super }} {% endblock %}