{% extends 'core/base.html' %} {% load currency_filters %} {% load static %} {% block title %}{{ product.name }} - SwiftPOS{% endblock %} {% block topbar_title %} Product Detail {% endblock %} {% block content %}
{% if messages %} {% for message in messages %}
{% if message.tags == 'success' %} {% elif message.tags == 'error' or message.tags == 'danger' %} {% elif message.tags == 'warning' %} {% else %} {% endif %}
{{ message }}
{% endfor %} {% endif %}
Product: {{ product.name }}
SKU: {{ product.sku }}{% if product.barcode %} · Barcode: {{ product.barcode }}{% endif %}
Products Reduce stock Restock {% if request.company.plan.feature_product_variants %} Variants {% endif %} Edit
{% if product.image %}
{{ product.name }}
{% else %}
{% endif %}
Image preview (optional). You can update it from "Edit" above.
Stock {% if has_variants %} Variant-managed {% endif %}
Current stock {% if has_variants %} {{ variant_stock_total }} {% else %} {{ product.stock_quantity }} {% endif %}
{% if has_variants %}
Stock is managed per variant. Total above = sum of all variant stocks.
{% endif %}
Minimum stock {{ product.minimum_stock }}
Status {% if has_variants %} {% if variant_stock_total > product.minimum_stock %} In Stock {% elif variant_stock_total > 0 %} Low Stock {% else %} Out of Stock {% endif %} {% elif product.stock_status == 'in_stock' %} {{ product.get_stock_status_display }} {% elif product.stock_status == 'low_stock' %} {{ product.get_stock_status_display }} {% else %} {{ product.get_stock_status_display }} {% endif %}
Store Allocations {% if has_variants %} By variant stock {% endif %}
{% if has_variants %} {# Show per-branch variant stock totals #} {% if variant_branch_stocks %} {% for vbs in variant_branch_stocks %} {% endfor %} {% else %} {% endif %} {# Also show combined total from variant global stocks #} {% elif branch_stocks %} {% for bs in branch_stocks %} {% endfor %} {% else %} {% endif %}
Branch Quantity
{{ vbs.branch.name }} {{ vbs.quantity }}
No branch-level variant stock yet. Use Manage Variants → Restock to add branch stock.
Global (all variants) {{ variant_stock_total }}
{{ bs.branch.name|default:"Main Branch" }} {{ bs.quantity }}
No branch allocations set yet.
Product Information
Selling price
{% money product.price %}
Cost price
{% money product.cost_price %}
Category
{{ product.category.name|default:"Uncategorized" }}

Supplier
{{ product.supplier|default:"Not specified" }}
Created
{{ product.created_at|date:"Y-m-d" }} {{ product.created_at|time:"H:i" }}
{% if product.description %}
Description

{{ product.description }}

{% endif %}
{% if request.company.plan.feature_product_variants %}
Product Variants
Manage Variants
{% for variant in product.variants.all %} {% empty %} {% endfor %}
Attributes SKU Price Stock
{% for attr in variant.attributes.all %} {{ attr.attribute_name|title }}: {{ attr.attribute_value }} {% empty %} Standard {% endfor %}
{{ variant.sku }} {% money variant.price %} {# Show branch stock total for this variant if available #} {% with stock=variant.stock_quantity %} {% if stock <= 0 %} Out {% else %} {{ stock }} {% endif %} {% endwith %}
No variants configured for this product.
Add First Variant
{% endif %} {# --- Product Barcode card --- #}
Product Barcode
{% if product.barcode %} {{ product.barcode }} {% else %} No barcode set {% endif %}
{% if product.barcode %}
Print Label

The image includes the barcode and product name for easy recognition.

{% else %}

This product does not have a barcode yet. Set a barcode on the edit page to generate an image.

{% endif %}
{% block extra_js %} {{ block.super|default:"" }} {% endblock %} {% endblock %}