{% extends 'base.html' %} {% load static %} {% block title %}Delete Location - {{ location.name }}{% endblock %} {% block content %}
Confirm Location Deletion
Location to be deleted:
Location Code: {{ location.location_code }}
Name: {{ location.name }}
Type: {{ location.get_location_type_display }}
Building: {{ location.building|default:"-" }}
Manager: {{ location.location_manager.get_full_name|default:"Not assigned" }}
Status: {% if location.is_active %} Active {% else %} Inactive {% endif %}
Created: {{ location.created_at|date:"M d, Y" }}
Full Address: {{ location.full_address|default:"Not specified" }}
Impact Analysis:
{{ stock_count|default:0 }}

Stock Items

{% if stock_count > 0 %} Will be affected {% else %} No impact {% endif %}
{{ child_locations_count|default:0 }}

Child Locations

{% if child_locations_count > 0 %} Will be orphaned {% else %} No impact {% endif %}
${{ total_value|default:0|floatformat:2 }}

Total Value

{% if total_value > 0 %} Inventory value {% else %} No value {% endif %}
{{ transaction_count|default:0 }}

Transactions

{% if transaction_count > 0 %} Historical data {% else %} No transactions {% endif %}
{% if blocking_conditions %}
Cannot Delete Location

This location cannot be deleted due to the following conditions:

    {% for condition in blocking_conditions %}
  • {{ condition }}
  • {% endfor %}
{% else %} {% if stock_count > 0 or child_locations_count > 0 %}
Required Actions Before Deletion:
    {% if stock_count > 0 %}
  • Move or remove {{ stock_count }} stock item{{ stock_count|pluralize }}
    All inventory must be transferred to other locations or removed from the system.
  • {% endif %} {% if child_locations_count > 0 %}
  • Reassign {{ child_locations_count }} child location{{ child_locations_count|pluralize }}
    Child locations will become orphaned and need new parent locations.
  • {% endif %}
{% if stock_count > 0 %} {% endif %} {% if child_locations_count > 0 %} {% endif %}
{% endif %}
Deletion Confirmation:
{% csrf_token %} {% if stock_count > 0 or child_locations_count > 0 %}
{% endif %}
Cancel
{% endif %}
{% endblock %}