{% extends 'layouts/invoice.twig' %}

{% block content %}

    <h2 style="text-align: center; text-decoration: underline;">Private Prescription</h2>

    <table cellspacing="0" cellpadding="5" border="0" width="100%">
        <tr>
            <td width="70%"><span style="color:#ccc">Patient</span><br/>
                <strong>{{ line_item.patient_details.name }}</strong><br/>
                {{ line_item.patient_details.address.address1 }}<br/>
                {% if line_item.patient_details.address.address2 is not empty %}
                    {{ line_item.patient_details.address.address2 | default('-') }}<br/>
                {% endif %}
                {{ line_item.patient_details.address.city }}<br/>
                {{ line_item.patient_details.address.postcode }}<br/>
                <br/>
                DOB: {{ line_item.patient_details.dob | date('d M Y') }}<br />
                Age: {{ line_item.patient_details.age }}<br />
            </td>
            <td width="30%"></td>
        </tr>

        <tr>
            <td width="70%"><span style="color:#ccc">Pharmacy</span><br/>
                {{ config('site.address.location') | raw }}<br />
                {{ config('site.address.address_1') | raw }}<br />
                {{ config('site.address.address_2') | raw }}<br />
                {{ config('site.address.city') | raw }}<br />
                {{ config('site.address.postcode') | raw }}<br />
                GPhc Number: {{ config('site.address.gphc_no') | raw }}<br />
                <br/><br/>
            </td>
            <td width="30%"><span style="color:#ccc">Date of dispensing</span><br/>
                {{ "now" | date("d/m/Y") }}
            </td>
        </tr>
    </table>


    <br />
    <br />

    <table cellspacing="0" cellpadding="5" border="0" width="100%">
        <tr>
            <td width="35%"><strong>Item</strong></td>
            <td width="55%"><strong>Dose</strong></td>
            <td width="10%" align="right"><strong>Qty</strong></td>
        </tr>

        <tr>
            <td>{{ line_item.item_name }} - {{ line_item.size.strength }}</td>
            <td>{{ line_item.dosage | default('-') }}</td>
            <td align="right">{{ line_item.quantity | default('-') }}</td>
        </tr>
    </table>

    <br />
    <br />
    <br />
    <br />

    <table cellspacing="0" cellpadding="5" border="0" width="100%">
        {% if line_item.approval.doctor.signature is not empty %}
            <tr>
                <td colspan="5">
                    <img src="{{ settings.SITE_URL }}/uploads/images/signature/originals/{{ line_item.approval.doctor.signature }}" width="150"/>
                </td>
            </tr>
        {% endif %}

        <tr>
            <td colspan="5">
                <br/>
                {{ line_item.approval.doctor.credentials|nl2br }}
            </td>
        </tr>
        <tr>
            <td colspan="5">Prescription reference: {{ line_item.order_id }}-{{ line_item.id }}</td>
        </tr>
        {% if line_item.approval.ip_address %}
            <tr>
                <td colspan="5">Prescriber IP address: {{ line_item.approval.ip_address }}</td>
            </tr>
        {% endif %}
        {% if line_item.approval.browser %}
            <tr>
                <td colspan="5">Prescriber Browser: {{ line_item.approval.browser }}</td>
            </tr>
        {% endif %}
    </table>

    <br />
    <br />

    <table cellspacing="0" cellpadding="5" border="0" width="100%">
        <tr>
            <td>Prescription approval date: {{ line_item.approval.created_at }}</td>
        </tr>
    </table>

{% endblock %}
