{% extends 'django_ledger/layouts/content_layout_1.html' %}
{% load i18n %}
{% load static %}
{% load django_ledger %}

{% block view_content %}
    <div class="columns is-multiline is-centered">
        <div class="column is-6-desktop">
            <div class="card">
                <div class="card-header">
                    <h2 class="card-header-title has-text-weight-light is-size-4 is-centered">{% trans 'Create Bill' %}</h2>
                </div>
                <form action="{{ form_action_url }}" method="post" id="djl-bill-model-create-form-id">
                    <div class="card-content">

                        {% csrf_token %}
                        {% if po_model %}
                            <div class="column is-12 has-text-centered">
                                <h2 class="title">{% trans 'Bill for' %} {{ po_model.po_number }}</h2>
                                <h3 class="subtitle has-text-weight-light">{% trans 'Bill for' %} {{ po_model.po_title }}</h3>
                                {% for itemtxs in po_itemtxs_qs %}
                                    <p>{{ itemtxs }}</p>
                                {% endfor %}
                            </div>
                        {% endif %}
                        {{ form }}
                    </div>
                
                    <div class="card-content">
                        <div class="buttons">
                            <button type="submit"
                                    id="djl-bill-create-button"
                                    class="button is-primary is-outlined is-fullwidth my-2">{% trans 'Create' %}
                            </button>
                            <a href="{% url 'django_ledger:bill-list' entity_slug=view.kwargs.entity_slug %}"
                               id="djl-bill-create-back-button"
                               class="button is-small is-dark is-fullwidth">{% trans 'Cancel' %}</a>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>
    </div>
{% endblock %}




