{% extends "site_base.html" %} {% load staticfiles %} {% 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 agent %} {% trans "Change" %} {% if logger %} {% if process.finished %} {% trans "Unfinish" %} {% else %} {% trans "Finish" %} {% endif %} {% endif %} {% endif %} {% if not agent %}

If you were logged in and working on this process, you would log your work on this page.

{% endif %}

{% trans "Outputs" %} {% if logger %} {% trans "Add an output requirement" %} {% endif %} {% if agent %} {% trans "Log an unplanned output" %} {% endif %}

{% trans "Scheduled" %}:

{% for item in process.outgoing_commitments %}
{{ item.resource_type.name }} {% if item.stage %} @{{ item.stage.name }} {% endif %} {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }} {% if logger %} {% if changeable_requirement %}
{{ to_be_changed_requirement.resource_type.name }}@{{ to_be_changed_requirement.stage }} change to: @{{ changeable_requirement.stage }} {% if to_be_changed_requirement.resources_ready_to_be_changed %} {% for resource in to_be_changed_requirement.resources_ready_to_be_changed %}
{% trans "Resource" %}: {{ resource }}
{% csrf_token %}
{% trans "or Log details" %}
{% endfor %} {% endif %}
{% else %} {% if add_output_form %} {% if not item.stage %}
{% csrf_token %}
{% endif %} {% trans "Log process output" %} {% if item.addable_resources %} {% trans "Add to Resource" %} {% endif %} {% endif %} {% endif %} {% endif %}
{% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %} {% for event in item.fulfilling_events %}
{% trans "Completed" %}: {{ event.event_type.label }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% if logger %} {% comment %} {% endcomment %}
{% csrf_token %}
{% endif %} {% if event.resource %}
  {% trans "Resource" %}: {{ event.resource }} {{ event.resource.quantity }} {{ event.resource.resource_type.unit }} {% endif %}
{% endfor %}
{% endfor %} {% if process.uncommitted_production_events %}

{% trans "Unplanned Production" %}:

{% for event in process.uncommitted_production_events %}
{% trans "Created" %}: {% if event.resource %} {{ event.resource }} {% else %} {{ event.resource_type }} {% endif %} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% if logger %} {% comment %} {% endcomment %}
{% csrf_token %}
{% endif %}
{% endfor %} {% endif %}
{% if work_reqs or process.uncommitted_work_events or "work" in slots %}

{% trans "Work" %} {% if logger %} {% if worker %} {% trans "Invite a collaborator" %} {% else %} {% trans "Add a work requirement" %} {% endif %} {% endif %} {% if agent %} {% trans "Log unplanned work" %} {% endif %}

{% trans "Planned Work" %}: {% trans "(Requirements are ordered by due date)" %}

{% for item in work_reqs %}
{{ item.resource_type.name }}: {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }} {% with item.fulfilling_events as work_events %} {% if agent %} {% if super_logger or agent == item.from_agent %} {% if not work_events %}
{% csrf_token %}
{% endif %} {% endif %} {% endif %} {% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %}
{% if item.from_agent %} {% trans "Taken by" %} {{ item.from_agent.nick }} {% if agent == item.from_agent %} {% if not work_events %}
{% csrf_token %}
{% endif %} {% trans "Invite a collaborator" %} {% else %} {% if agent %} {% trans "Join this task" %} {% endif %} {% endif %} {% else %} {% trans "Unassigned" %} {% if agent %} {% trans "I'll work on this later" %} {% endif %} {% endif %} {% if agent %} {% if work_now and item.unit_of_quantity.unit_type == "time" %} {% trans "I'll start working now" %} {% endif %} {% trans "I did some work on this" %} {% endif %}
{% if work_events %}
{% trans "Work events" %}:
{% for event in work_events %}
{{ event.event_date }} {{ event.quantity }} {{ event.unit_of_quantity.name }} {% trans "Done by" %} {{ event.from_agent.nick }} {% if agent %} {% if agent == event.from_agent or user == event.created_by %}
{% csrf_token %}
{% endif %} {% endif %} {% if event.description %}
{{ event.description|urlize|linebreaks }}
{% endif %}
{% endfor %}
{% endif %} {% endwith %}
{% endfor %} {% if unplanned_work %}

{% trans "Unplanned Work" %}:

{% for event in unplanned_work %}
{% trans "Work event" %}: {{ event.resource_type.name }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% trans "Done by" %} {{ event.from_agent.nick }} {% if agent == event.from_agent or user == event.created_by %}
{% csrf_token %}
{% endif %} {% if event.description %}
{{ event.description|urlize|linebreaks }}
{% endif %}
{% endfor %} {% endif %}
{% endif %} {% if process.citation_requirements or process.uncommitted_citation_events or "cite" in slots %}

{% trans "Citations" %} {% if logger %} {% trans "Add a citation requirement" %} {% endif %} {% if agent %} {% trans "Log unplanned citation" %} {% endif %}

{% if agent %} {% endif %} {% for item in citation_requirements %}
{{ item.resource_type }} {% if logger %} {% if not item.fulfilling_events %}
{% csrf_token %}
{% endif %} {% endif %} {% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %}
{% if item.resources %} {% for resource in item.resources %}
{% trans "Onhand" %}: {{ resource.label }} {% with resource.event as event %}
{% trans "Cited" %}: {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% if logger %}
{% csrf_token %}
{% endif %}
{% endwith %}
{% endfor %} {% endif %} {% if item.onhand %} {% for resource in item.onhand %} {% comment %}todo: consider stage and state here{% endcomment %} {% if resource.id not in output_resource_ids %} {% if resource.id not in cited_ids %}
{% trans "Onhand" %}: {{ resource.label }} {% if logger %} {% trans "Log citation" %} {% endif %}
{% endif %} {% endif %} {% endfor %} {% endif %}
{% endfor %} {% if process.uncommitted_citation_events %}

{% trans "Unplanned Citations" %}:

{% for event in process.uncommitted_citation_events %}
{% trans "Cited" %}: {{ event.resource.label }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% if logger %}
{% csrf_token %}
{% endif %}
{% endfor %} {% endif %}
{% endif %} {% if consume_reqs or uncommitted_consumption or "consume" in slots %}

{% trans "Consumable Inputs" %} {% if logger %} {% trans "Add a consumable input requirement" %} {% endif %} {% if agent %} {% trans "Log unplanned consumption" %} {% endif %}

{% if agent %} {% endif %} {% for item in consume_reqs %}
{{ item.resource_type.name }}{% if item.stage %}@{{ item.stage }}{% endif %}: {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }} {% if logger %}
{% csrf_token %}
{% endif %}
{% if item.description %}
{{ item.description|urlize|linebreaks }}
{% endif %} {% if item.consumable_resources %} {% for resource in item.consumable_resources %}
{% trans "Onhand" %}: {{ resource.label }} {% if resource.stage %} ~ Stage: {{ resource.stage }} {% endif %} ~ {{ resource.quantity }} {{ resource.unit_of_quantity }} {% if resource.current_location %} ~ Location: {{ resource.current_location }} {% endif %} {% if resource.agent_resource_roles.all %} {% for item in resource.agent_resource_roles.all %} ~ {{ item.role.name }}: {{ item.agent.nick }} {% endfor %} {% endif %} {% if resource.quantity and logger %} {% trans "Log consumption" %} {% endif %} {% for event in resource.consuming_events %} {% if event.commitment == item %}
{% trans "Consumed" %}: {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% trans "by" %} {{ event.from_agent }} {% if logger %} {% comment %} {% endcomment %}
{% csrf_token %}
{% endif %}
{% endif %} {% endfor %}
{% endfor %} {% elif item.scheduled_receipts %} {% for ct in item.scheduled_receipts %}

{% trans "Scheduled" %}: {% if ct.stage %}@{{ ct.stage }}{% endif %} {{ ct.quantity }} {{ ct.unit_of_quantity }} {{ ct.due_date }}

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

{% trans "Possible 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" %}   {% if super_logger %} {% endif %}
{% else %} {% trans "Purchase by:" %}{{ source.order_release_date }} {% endif %} {% endcomment %}

{% endfor %} {% endif %}
{% endfor %} {% if uncommitted_consumption %}

{% trans "Unplanned Consumption" %}:

{% for event in uncommitted_consumption %}
{% trans "Consumed" %}: {{ event.resource.label }} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% if logger %} {% comment %} {% endcomment %}
{% csrf_token %}
{% endif %}
{% endfor %} {% endif %}
{% endif %} {% if use_reqs or uncommitted_use or "use" in slots %}

{% trans "Usable Inputs" %} {% if logger %} {% trans "Add a usable input requirement" %} {% endif %} {% if agent %} {% trans "Log unplanned use" %} {% endif %}

{% if agent %} {% endif %} {% for item in use_reqs %}
{{ item.resource_type.name }}: {{ item.quantity }} {{ item.unit_of_quantity }} {% trans "due" %} {{ item.due_date }} {% if logger %}
{% csrf_token %}
{% endif %}
{% 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 }} {% if logger %} {% trans "Log use" %} {% endif %} {% for event in resource.using_events %} {% if event.commitment == item %}
{% trans "Used" %}: {{ event.resource.identifier }} {{ event.quantity }} {{ item.resource_type.unit_for_use }} {{ event.event_date }} {% trans "by" %} {{ event.from_agent }} {% if logger %} {% comment %} {% endcomment %}
{% csrf_token %}
{% endif %}
{% 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.scheduled_receipts %} {% for ct in item.scheduled_receipts %}

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

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

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

{% endfor %} {% endif %}
{% endfor %} {% if uncommitted_use %}

{% trans "Unplanned Use" %}:

{% for event in uncommitted_use %}
{% trans "Used" %}: {% if event.resource %} {{ event.resource }} {% else %} {{ event.resource_type }} {% endif %} {{ event.quantity }} {{ event.unit_of_quantity }} {{ event.event_date }} {% if logger %} {% comment %} {% endcomment %}
{% csrf_token %}
{% endif %}
{% endfor %} {% endif %}
{% endif %}
{% if labnotes %}

{% trans "Notes for this process" %}

{% endif %}

{% trans "Process context" %}:

{% if process.process_pattern %} {% trans "Pattern" %}: {{ process.process_pattern }} {% else %} {% if agent %} No process pattern. See help. {% else %} None {% endif %} {% endif %}
{% trans "Context" %}: {{ process.context_agent }} {% if process.independent_demand %}
{% trans "Order" %}: {{ process.independent_demand }} {% endif %}

{% trans "Previous processes" %}:

{% for proc in process.previous_processes %}

{{ proc }}

{% endfor %}

{% trans "Next processes" %}:

{% for proc in process.next_processes %}

{{ proc }}

{% endfor %}
{% if process.notes %}

{% trans "Process notes" %}:

{{ process.notes|urlize|linebreaks }}
{% endif %}
{% if logger %} {% endif %} {% if agent %} {% endif %} {% endblock %} {% block extra_script %} {% endblock %} {% block extra_body %} {{ block.super }} {% endblock %}