{% extends "report/inventree_report_base.html" %}
{% load i18n report barcode %}
{#
Magazine register — the standing record of what explosive is held in a
magazine, and how that compares to its licence.
Model: StockLocation
Install: Admin Center > Reports > Report Templates > new template, model
"Stock Location", and upload this file.
All values come from the explosives plugin via ReportMixin (see core.py).
`explosives` is the plugin's single namespaced context key.
#}
{% block style %}
body { font-family: sans-serif; font-size: 10pt; }
h1 { font-size: 16pt; margin-bottom: 2mm; }
.meta { color: #555; margin-bottom: 6mm; }
table { width: 100%; border-collapse: collapse; margin-top: 4mm; }
th, td { border: 1px solid #999; padding: 2mm; text-align: left; }
th { background: #eee; }
td.num, th.num { text-align: right; }
.breach { color: #b00; font-weight: bold; }
.summary td { border: none; padding: 1mm 4mm 1mm 0; }
.summary { width: auto; margin-bottom: 4mm; }
{% endblock style %}
{% block page_content %}
{% trans "Magazine Register" %}
{{ location.name }}
{% if location.description %} — {{ location.description }}{% endif %}
{% trans "Generated" %}: {% now "Y-m-d H:i" %}
| {% trans "Net explosive quantity held" %} |
{{ explosives.neq_kg|floatformat:3 }} kg |
| {% trans "Licensed maximum" %} |
{% if explosives.limit_kg %}
{{ explosives.limit_kg|floatformat:3 }} kg
{% else %}
{% trans "Not licensed" %}
{% endif %}
|
{% if explosives.limit_kg %}
| {% trans "Utilisation" %} |
{{ explosives.utilisation|floatformat:3 }}
{% if explosives.over_limit %} — {% trans "OVER LIMIT" %}{% endif %}
|
{% endif %}
| {% trans "Gross mass held" %} |
{{ explosives.gross_mass_kg|floatformat:3 }} kg |
{% if explosives.by_division %}
{% trans "By hazard division" %}
| {% trans "Division" %} |
{% trans "NEQ (kg)" %} |
{% for division, mass in explosives.by_division.items %}
| {{ division }} |
{{ mass|floatformat:3 }} |
{% endfor %}
{% endif %}
{% trans "Contents" %}
| {% trans "Part" %} |
{% trans "Location" %} |
{% trans "Class" %} |
{% trans "UN No." %} |
{% trans "Quantity" %} |
{% trans "NEQ/unit (kg)" %} |
{% trans "NEQ (kg)" %} |
{% for item in explosives.items %}
| {{ item.part_name }} |
{{ item.location_name|default:"-" }} |
{{ item.classification_code|default:"-" }} |
{{ item.un_number|default:"-" }} |
{{ item.quantity }} |
{{ item.neq_per_unit_kg|floatformat:4 }} |
{{ item.neq_total_kg|floatformat:3 }} |
{% empty %}
| {% trans "No explosive stock held in this location." %} |
{% endfor %}
| {% trans "Total" %} |
{{ explosives.neq_kg|floatformat:3 }} |
{% if explosives.config_errors %}
{% trans "Configuration warnings" %}
{% for error in explosives.config_errors %}
- {{ error }}
{% endfor %}
{% endif %}
{% endblock page_content %}