{% extends 'core/base.html' %}
{% load static %}

{% block title %}Receive Purchase Order #{{ order.id }} - SwiftPOS{% endblock %}
{% block topbar_title %}Receive Purchase Order{% endblock %}

{% block content %}
<div class="container-fluid px-0">
    <div class="row justify-content-center">
        <div class="col-lg-6 col-xl-5">
            <div class="card shadow-sm">
                <div class="card-body">
                    <h5 class="mb-2">Confirm Receipt</h5>
                    <p class="small text-muted mb-3">
                        You are about to mark <strong>Purchase Order #{{ order.id }}</strong> from
                        <strong>{{ order.supplier.name }}</strong> as <strong>received</strong>.
                        This will:
                    </p>
                    <ul class="small text-muted mb-3">
                        <li>Increase stock quantities for all items in this order.</li>
                        <li>Update each product's <strong>cost price</strong> to the latest purchase cost.</li>
                        <li>Create inventory transaction records for audit.</li>
                    </ul>

                    <div class="mb-3">
                        <div class="small text-muted mb-1">Total Cost</div>
                        <div class="h5 mb-0">{{ currency_symbol }}{{ order.total_cost|floatformat:2 }}</div>
                    </div>

                    <form method="post">
                        {% csrf_token %}
                        <div class="d-flex justify-content-between align-items-center">
                            <a href="{% url 'inventory:purchase_order_detail' order.id %}"
                               class="btn btn-outline-secondary btn-sm">
                                Cancel
                            </a>
                            <button type="submit" class="btn btn-success btn-sm">
                                <i class="fas fa-check-circle me-1"></i> Yes, mark as received
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
