
<div class="col-lg-12">
    <div class="card single-quote-format" id="print-area">
        <div class="card-body">
            <div class="row justify-content-between">
                <div class="col">
                    <img src="<?php echo base_url().'assets/images/logo.png'?>" alt="" class="w-25"">
                    <p class="info-header mb-1">VAT:0012000203000</p>
                </div>
                <div class="col text-end">
                    <h3>Quotation</h3>
                </div>
            </div>
          
            <div class="row justify-content-between mt-3">
                <div class="col bill-to mt-0">
                    <h6>To,</h6>
                    <p><b><?= esc($customer['c_cname'])?></b></p>
                    <address><i><?= esc($customer['c_cna'])?></i></address>
                    <div class="contact">
                        <p><?= esc($customer['c_mobile'])?></p>
                        <p>VAT: <?= esc($customer['c_cvat'])?></p>
                    </div>
                </div>
                
                <div class="col ship-to mt-0 text-end">
                    <p class="info-header mb-1"><b>Quotation Number:</b> <i><?= esc($quote['quotation_no'])?></i></p>
                    <p class="info-header mb-1"><b>Issue Date:</b> <?= esc($quote['quotation_date'])?></p>
                    <p class="info-header mb-1"><b>Validity Date:</b> <?= esc($quote['validity_date'])?></p>
                    <p class="info-header mb-1"><b>P.O Number: </b><?= esc($quote['po_number'])?></p>
                </div>
            </div>
            <div class="row q-item-detail mt-2">
                <table>
                    <thead>
                        <tr class="bg-success">
                            <th class="border-1 border-dark-subtle p-2 text-center">S.No</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Item Description</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Unit</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Qty</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Rate</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Amount</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Vat</th>
                            <th class="border-1 border-dark-subtle p-2 text-center">Total</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($quoteItems as $index=>$qItem)  :?>
                        <tr class="item-list">
                            <td class="border-start border-dark-subtle p-2 text-center"><?=esc(++$index)?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-Start"><?=esc($qItem['product'].' '.$qItem['description'])?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-center"><?=esc($qItem['unit'])?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-center"><?=esc($qItem['qty'])?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-center"><?=esc($qItem['unit_price'])?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-center"><?=esc($qItem['amount'])?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-center"><?=esc($qItem['vat_amount'])?></td>
                            <td class="border-start border-end border-dark-subtle p-2 text-center"><?=esc($qItem['vat_amount']+$qItem['amount'])?></td>
                        </tr>
                        <?php endforeach;?>
                        
                        <tr class="q-total">
                            <td colspan="5" class="border-dark-subtle border-top"></td>
                            <td colspan="2" class="border-1 border-dark-subtle">Sub-Total-1</td>
                            <td class="border-1 border-dark-subtle text-end"><?= esc($quote['subtotal'])?></td>
                        </tr>
                        <tr class="q-total">
                            <td colspan="5"></td>
                            <td colspan="2"class="border-1 border-dark-subtle">Discount</td>
                            <td class="border-1 border-dark-subtle text-end"><?= esc($quote['discount'])?></td>
                        </tr>
                        <tr class="q-total">
                            <td colspan="5"></td>
                            <td colspan="2"class="border-1 border-dark-subtle">Sub-Total-2</td>
                            <td class="border-1 border-dark-subtle text-end"><?= esc($quote['amount_after_discount'])?></td>
                        </tr>
                        <tr class="q-total">
                            <td colspan="5"></td>
                            <td colspan="2"class="border-1 border-dark-subtle">VAT:</td>
                            <td class="border-1 border-dark-subtle text-end"><?= esc($quote['vat_amount'])?></td>
                        </tr>
                        <tr class="q-total">
                            <td colspan="5"></td>
                            <td colspan="2"class="border-1 border-dark-subtle">Total</td>
                            <td class="border-1 border-dark-subtle text-end"><?= esc($quote['net_amount'])?></td>
                        </tr>
                        
                    </tbody>
                </table>
            </div>
            <div class="row mt-3 inv-bank-detail">
                <div class="col">
                    <?php if (!empty($quote['payment_terms'])):?>
                    <h5>Terms & Conditions</h5>
                            
                    <p><b>Payment Terms :&nbsp;</b><?= esc($quote['payment_terms'])?></p>
                    <?php echo !empty($quote['delivery_terms'])? "<p><b>Delivery Terms: </b>{$quote['delivery_terms']}</p>" : "" ; ?>
                    <?php endif;?>
                    <p>This electronical generated quotation doesn't need signature</p>
                </div>
            </div>
            <div class="row inv-footer justify-content-between border-top mt-4 py-2">
                <div class="col">
                 &nbsp;  
                </div>
                <div class="col text-end align-content-end">
                    <div>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</div>
                    <div>email: info@companydomain.com</div>
                    <div>contact: +966 12345678</div>
                </div>

            </div>
        </div>
    </div>
    <div class="row mt-3">
        <div class="col text-end">
            <button type="button" class="btn btn-info"  onclick="window.print()"><i class="mdi mdi-printer"></i>&nbsp;Print</button>
        </div>
    </div>
</div>
<style>
  
  </style>