 <!DOCTYPE html>
<html>
<head>
<title>INVOICE FOR {{ Client.client_code }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
         <link rel="stylesheet" type="text/css" href="/static/dashboard/css/style.css">
     <!-- DataTables -->
        <link href="/static/dashboard/assets/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />

        <link href="/static/dashboard/assets/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
        <link href="/static/dashboard/assets/plugins/datatables/buttons.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="/static/dashboard/assets/plugins/datatables/fixedHeader.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="/static/dashboard/assets/plugins/datatables/responsive.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="/static/dashboard/assets/plugins/datatables/scroller.bootstrap.min.css" rel="stylesheet" type="text/css" />

</head>
<body>
<div class="wrapper">

    <div class="header-top">
        <div class="hd-left">
            <div class="logo">
                <img src="/static/dashboard/images/logo.png">
            </div>
        </div>
        <div class="hd-right">
            <h2>INVOICE : {{ Client.client_code }}</h2>
        </div>
    </div>
    <div class="slider-mind">
        <div class="slider-left">
            <div class="Laboratories">
                 <address>
                  <h2><strong>{{ Lab.lab_name }}</strong></h2><br>
                  {{ Lab.lab_address }} {% if Lab.lab_address2 %}{{ Lab.lab_address2 }} {% endif %}<br>
                  {{ Lab.lab_city }}, {{ Lab.lab_state }} {{ Lab.lab_zipcode }}<br>
                  <abbr title="Phone">P:</abbr> {{ Lab.lab_phone }}
                </address>
            </div>
        </div>
        <div class="slider-right">
            <h1>{{ Client.business_legal_name |upper}}</h1>
            <ul>
                <li><span>Month:</span>{% if month == 1 %} January{% elif month == 2 %} February{% elif month == 3 %} March{% elif  month == 4 %} April{% elif month == 5 %} May{% elif month == 6 %} June{% elif month == 7 %} July{% elif month == 8 %} Agost{% elif month == 9 %} September{% elif month == 10 %} October{% elif month == 11 %} November{% elif month == 12 %} December{% endif %}</li>
                <li><span>Status:</span>Pending</li>
                <li><span>From</span>{{ start_date |date:"m/d/Y"}}</li>
                <li><span>To:</span>{{ end_date |date:"m/d/Y" }}</li>
            </ul>
        </div>
    </div>



    <div class="mid-section">

        <h1>DETAILED INFORMATION</h1>
        <ul>
            <li><span>{{ Entry.SP_clinical_info }}</span></li>
        </ul>
        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table m-t-30" style="width:100%">
                        <thead>
                            <tr style="text-align: left">
                                <th>Patient ID</th>
                                <th>Patient</th>
                                <th>Accession #</th>
                                <th>Exam</th>
                                <th>Exam Type</th>
                                <th>Price</th>

                            </tr>
                        </thead>

                        <tbody>
                        {% if Entries %}
                            {% for Entry in Entries %}

                                   {% if Entry.accession_number.all %}
                                       {% for accession in Entry.accession_number.all %}
                                           {% if accession.exam_in.exam_casetype.case_type_id == 1 and accession.GYN_completed == 1 %}
                                               <tr>
                                                    <td>{{ Entry.patient.ext_id }}</td>
                                                    <td>{{ Entry.patient.full_name }}</td>
                                                    <td>{{ accession.exam_in.exam_name }}</td>
                                                    <td>{{ accession.accession_number }}</td>
                                                    <td>{{ accession.exam_in.exam_casetype.case_type_name }}</td>
                                                    <td>{% for price in accession.exam_in.clienexamprice_set.all %}
                                                           {% if price.created_for_client.client_id == Client.client_id and accession.exam_in.exam_id == price.client_exam_id.exam_id%}
                                                              {{ price.price }}
                                                           {% endif %}
                                                        {% endfor %}
                                                    </td>

                                                </tr>
                                           {% elif accession.exam_in.exam_casetype.case_type_id == 2 and accession.Non_gyn_completed == 1 %}
                                               <tr>
                                                    <td>{{ Entry.patient.ext_id }}</td>
                                                    <td>{{ Entry.patient.full_name }}</td>
                                                    <td>{{ accession.exam_in.exam_name }}</td>
                                                    <td>{{ accession.accession_number }}</td>
                                                    <td>{{ accession.exam_in.exam_casetype.case_type_name }}</td>

                                                    <td>{% for price in accession.exam_in.clienexamprice_set.all %}
                                                           {% if price.created_for_client.client_id == Client.client_id and accession.exam_in.exam_id == price.client_exam_id.exam_id%}
                                                              {{ price.price }}
                                                           {% endif %}
                                                        {% endfor %}
                                                    </td>

                                                </tr>
                                           {% elif accession.exam_in.exam_casetype.case_type_id == 3 and accession.MP_completed == 1 %}
                                               <tr>
                                                    <td>{{ Entry.patient.ext_id }}</td>
                                                    <td>{{ Entry.patient.full_name }}</td>
                                                    <td>{{ accession.exam_in.exam_name }}</td>
                                                    <td>{{ accession.accession_number }}</td>
                                                    <td>{{ accession.exam_in.exam_casetype.case_type_name }}</td>

                                                    <td>{% for price in accession.exam_in.clienexamprice_set.all %}
                                                           {% if price.created_for_client.client_id == Client.client_id and accession.exam_in.exam_id == price.client_exam_id.exam_id%}
                                                              {{ price.price }}
                                                           {% endif %}
                                                        {% endfor %}
                                                    </td>

                                                </tr>
                                           {% elif accession.exam_in.exam_casetype.case_type_id == 4 and accession.SP_completed == 1 %}
                                               <tr>
                                                    <td>{{ Entry.patient.ext_id }}</td>
                                                    <td>{{ Entry.patient.full_name }}</td>
                                                    <td>{{ accession.exam_in.exam_name }}</td>
                                                    <td>{{ accession.accession_number }}</td>
                                                    <td>{{ accession.exam_in.exam_casetype.case_type_name }}</td>

                                                    <td>{% for price in accession.exam_in.clienexamprice_set.all %}
                                                           {% if price.created_for_client.client_id == Client.client_id and accession.exam_in.exam_id == price.client_exam_id.exam_id%}
                                                              {{ price.price }}
                                                           {% endif %}
                                                        {% endfor %}
                                                    </td>

                                                </tr>

                                           {% endif %}

                                       {% endfor %}
                                   {% endif %}

                            {% endfor %}

                        {% endif %}








                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="row" style="border-radius: 0px;">
            <div class="col-md-3 col-md-offset-9" style="float: right">
                <hr>
                <h3 class="text-right">Total: USD {{ Total }}</h3>
            </div>
        </div>
        <hr>




    </div>




<!-- <div class="footer" style="float: left">
         <p>{{ Lab.lab_name }} | CLIA ID:{{ Lab.lab_clia_id }} | {{ Lab.lab_address }} {% if Lab.lab_address2 %}{{ Lab.lab_address2 }} {% endif %} {{ Lab.lab_city }}, {{ Lab.lab_state }} {{ Lab.lab_zipcode }} | PHONE: {{ Lab.lab_phone }} | FAX: {{ Lab.lab_fax }}</p>
 </div>-->

</div>

</body>
</html> 