{% extends "base.html" %} {% load static %} {% block title %}Delete Inventory - Pharmacy{% endblock %} {% block content %}

Delete Inventory Record {{ object.medication.name }} - {{ object.location.name }}

Confirm Inventory Deletion

Inventory Record to be Deleted
Medication: {{ object.medication.generic_name }}
Brand Name: {{ object.medication.brand_name|default:"Not specified" }}
Strength: {{ object.medication.strength }}
Location: {{ object.location.name }}
Bin/Shelf: {{ object.bin_location|default:"Not specified" }}
Current Stock: {{ object.current_stock }}
Total Value: ${{ object.total_value|floatformat:2 }}
Lot Number: {{ object.lot_number|default:"Not specified" }}
Expiration: {% if object.expiration_date %} {{ object.expiration_date|date:"M d, Y" }} {% if object.is_expired %}(Expired){% elif object.expires_soon %}(Expires Soon){% endif %} {% else %} Not specified {% endif %}
{% if object.medication.is_controlled %} Controlled Substance {% endif %} {% if object.medication.is_high_alert %} High Alert {% endif %}
Impact Assessment
Potential Issues:
    {% if object.current_stock > 0 %}
  • {{ object.current_stock }} units in stock (value: ${{ object.total_value|floatformat:2 }})
  • {% endif %} {% if object.pending_orders.exists %}
  • {{ object.pending_orders.count }} pending order(s)
  • {% endif %} {% if object.recent_transactions.exists %}
  • {{ object.recent_transactions.count }} recent transaction(s)
  • {% endif %} {% if object.medication.is_controlled %}
  • Controlled substance requires special handling
  • {% endif %} {% if object.medication.is_high_alert %}
  • High alert medication
  • {% endif %} {% if object.is_expired %}
  • Expired medication
  • {% elif object.expires_soon %}
  • Expires soon
  • {% endif %}
Related Records:
  • Transactions: {{ object.transactions.count }}
  • Purchase orders: {{ object.purchase_orders.count }}
  • Dispensing records: {{ object.dispensing_records.count }}
  • Stock counts: {{ object.stock_counts.count }}
{% if object.current_stock > 0 %}
Stock on Hand Warning

This inventory record shows {{ object.current_stock }} units in stock with a total value of ${{ object.total_value|floatformat:2 }}. Deleting this record may:

  • Result in loss of inventory tracking for existing stock
  • Affect financial reporting and asset valuation
  • Disrupt dispensing and prescription fulfillment
  • Impact reorder calculations and stock management
  • Remove important audit trail information

Consider adjusting stock to zero or marking as inactive instead of deleting.

{% endif %} {% if object.medication.is_controlled %}
Controlled Substance Warning

This inventory contains a controlled substance. Deletion must be properly documented for DEA compliance and audit purposes. All stock movements should be accounted for before deletion.

{% endif %} {% if object.medication.is_high_alert %}
High Alert Medication Warning

This is a high alert medication that requires special safety protocols. Deletion may affect safety procedures and clinical guidelines.

{% endif %} {% if object.is_expired %}
Expired Medication Notice

This medication is expired and should be properly disposed of according to pharmacy protocols before deleting the inventory record.

{% endif %} {% if object.transactions.exists %}
Transaction History Warning

This inventory record has {{ object.transactions.count }} transaction(s). Deleting it will remove the transaction history and may affect audit trails and financial reporting.

{% endif %}
Alternative Actions

Instead of deleting this inventory record, consider these alternatives:

{% csrf_token %}
{% if object.current_stock > 0 %}
{% endif %}
These notes will be recorded in the audit log.
{% if object.medication.is_controlled %}
{% endif %} {% if object.current_stock > 0 %}
{% endif %} {% if object.transactions.exists %}
{% endif %}

Deletion Guidelines

Important Guidelines
  • Inventory deletions are permanent and cannot be undone
  • All deletions are logged for audit purposes
  • Stock on hand must be properly accounted for
  • Controlled substances require special documentation
  • Transaction history will be lost
  • Consider alternatives before deletion
Audit Information
User: {{ request.user.get_full_name }}
Date: {{ "now"|date:"M d, Y H:i" }}
IP Address: {{ request.META.REMOTE_ADDR }}
Session: {{ request.session.session_key|slice:":8" }}...

Inventory Summary

{{ object.current_stock }}
Current Stock
${{ object.total_value|floatformat:2 }}
Total Value
{{ object.transactions.count }}
Transactions
{{ object.days_since_last_count|default:"-" }}
Days Since Count

Medication Properties

{% if object.medication.is_controlled %} Controlled Substance {% endif %} {% if object.medication.is_high_alert %} High Alert {% endif %} {% if object.medication.requires_refrigeration %} Refrigeration Required {% endif %} {% if object.is_expired %} Expired {% elif object.expires_soon %} Expires Soon {% endif %}
{% endblock %} {% block js %} {% endblock %}