{% extends "ishtar/sheet.html" %} {% load i18n l10n ishtar_helpers window_header window_field window_tables %} {% block head_title %}{% trans "Warehouse" %} - {{item.name}} ({{item.warehouse_type}}){% endblock %} {% block toolbar %} {% window_nav item window_id 'show-warehouse' 'warehouse_modify' 'show-historized-warehouse' 'revert-warehouse' previous next 1 %} {% endblock %} {% block content %} {% with can_view_documents=permission_view_own_document|or_:permission_view_document %} {% with has_documents=item.documents.count %} {% with display_documents=can_view_documents|and_:has_documents %} {% with permission_change_own_geovectordata=permission_change_own_geovectordata %} {% with permission_change_geovectordata=permission_change_geovectordata %} {% with permission_change_geo=permission_change_own_geovectordata|or_:permission_change_geovectordata %} {% if output != "ODT" and output != "PDF"%} {% endif %}
{% include "ishtar/blocks/window_image.html" %}

{{ item.name|default:"" }}

{% if item.complete_identifier and item.name != item.complete_identifier %}

{{ item.complete_identifier }}

{% endif %}

{{ item.warehouse_type|default:"" }}

{% include "ishtar/blocks/sheet_external_id.html" %}
{% trans "Number of containers" %}
{{item.number_containers}}
{% trans "Number of divisions" %}
{{item.number_divisions}}
{% trans "Number of finds" %}
{{item.number_of_finds_hosted}}
{% trans "Number of owned finds" %}
{{item.number_of_finds}}
{% field_flex_detail "Person in charge" item.person_in_charge %} {% field_flex_detail "Organization" item.organization %} {% trans "Default divisions (imports)" as def_div_label %} {% field_flex def_div_label item.default_location_types|join:", " %} {% field_flex_full "Comment" item.comment "
" "
" %}
{% include "ishtar/blocks/sheet_json.html" %} {% if item.get_address or item.get_address_complement or item.get_postal_code or item.get_town or item.phone or item.mobile_phone %}

{% trans "Geographic localisation/contact details" %}

{% if PROFILE.locate_warehouses and SHOW_GEO %}
{% with geo_item=item %} {% include "ishtar/blocks/sheet_map.html"%} {% endwith %}
{% endif %}
{% with full=True %}{% include "ishtar/blocks/sheet_address_section.html" %}{% endwith %} {% field_flex _("Phone") item.phone %} {% field_flex _("Mobile phone") item.mobile_phone %}
{% endif %} {% if not is_external %} {% if item.history_creator or item.last_edition_date or item.created %}

{% trans "Sheet"%}

{% include "ishtar/blocks/sheet_creation_section.html" %}
{% endif %} {% endif %}
{% if item.containers.count %}

{% trans "Divisions" %}

{% dynamic_table_document '' 'divisions' 'location_id' item.pk 'TABLE_COLS' output %}

{% trans "Containers" %}

{% dynamic_table_document '' 'non-divisions' 'location_id' item.pk 'TABLE_COLS' output %} {% else %}
{% trans "No container inside this warehouse" %}
{% endif %} {% if item.number_of_finds_hosted %}

{% trans "Finds (hosted)" %}

{% dynamic_table_document '' 'finds' 'container__location' item.pk 'TABLE_COLS' output %} {% else %}
{% trans "No find inside this warehouse" %}
{% endif %} {% if item.number_of_finds %}

{% trans "Finds (owned)" %}

{% dynamic_table_document '' 'finds' 'container_ref__location' item.pk 'TABLE_COLS' output %} {% else %}
{% trans "No find owned by this warehouse" %}
{% endif %}

{% trans "Statistics" %}

{% if item.number_containers > 1000 or item.number_divisions > 200 %}
 {% trans "Statistics disabled when too many containers are attached to a warehouse. In a future version, statistics will be optimized." %}
{% else %}
{% with item.last_stats_update as last_stats_update%} {% if last_stats_update %} {% trans "Last update:" %} {{last_stats_update}} {% endif %}{% endwith %}
{% if not item.number_containers and not item.number_divisions %}
 {% trans "No container/division inside this container" %}
{% else %}

{% trans "Finds" %}

{% trans "Finds by location in the warehouse" %}

{% for items in item.number_of_finds_by_place %} {% if items %} {% for location_type in item.division_labels %} {% endfor %} {% for item in items %} {% for local in item.0 %}{% endfor %} {% endfor %}
{{location_type|title}}{% trans "Total" %}
{{local|safe}}{{item.1}}
{% endif %} {% endfor %}

{% trans "Containers" %}

{% trans "Containers by location in the warehouse" %}

{% for items in item.number_of_containers_by_place %} {% if items %} {% for location_type in item.division_labels %} {% endfor %} {% for item in items %} {% for local in item.0 %}{% endfor %} {% endfor %}
{{location_type|title}}{% trans "Total" %}
{{local|safe}}{{item.1}}
{% endif %} {% endfor %} {% endif %} {% endif %}
{% if display_documents %}
{% trans "Document for this warehouse" as w_docs %} {% if permission_view_own_document or permission_view_document %} {% if item.documents.count %} {% dynamic_table_document w_docs 'documents' 'warehouses' item.pk '' output %} {% endif %} {% endif %}
{% endif %} {% if not is_external and PROFILE.locate_warehouses %}
{% with geo_item=item %}{% include "ishtar/blocks/sheet_geographic.html" %}{% endwith %}
{% endif %}
{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endblock %}