<style type="text/css">
#dynamic-content-container{background: #fff;}
    .navbar-default.navbar-static-side{display: none !important;}
    #page-wrapper{margin: 0px !important; padding: 0 !important;}
    .row.border-bottom{display: none !important;}
    .footer.fixed{display: none;}
    .ibox-content{padding: 0 !important;}
    body {
    -webkit-print-color-adjust:exact;
    background: #fff;
    }

</style>

<table style="width: 100%; background: #fff;">
    <tr>
        <td><img style="width: 100%; height: 200px;" src="<?= get_branch_image('banner'); ?>"></td>
    </tr>
</table>

<?php
$date = date_create($invoice_data['created_at']);
$date = date_format($date,"Y-m-d h:i:s");
$currency_symbol = array_key_exists($invoice_data['currency'], $currencies) ? $currencies[$invoice_data['currency']]['symbol'] : NULL;
$supplier_name = array_key_exists($invoice_data['supplier'], $suppliers) ? $suppliers[$invoice_data['supplier']]['name'] : NULL;
$item_name = array_key_exists($invoice_data['item'], $items) ? $items[$invoice_data['item']]['name'] : NULL;
$item_unit = array_key_exists($invoice_data['item'], $items) ? $items[$invoice_data['item']]['unit'] : NULL;
?>

<table style="width: 100%; margin: 10px 0px; background: #fff;">
    <tr style="margin: 10px 0px;">
        <td style="width: 25%;"><span style="color: #bb0d0d !important; padding: 4px;"><strong style="color: #bb0d0d !important;"><?= print_lang($app_lang,'cons_purchase_invoice_top_date'); ?>:</strong></span> <?= display_true_date($date); ?></td>
        <td style="width: 25%;"><span style="color: #bb0d0d !important; padding: 4px;"><strong style="color: #bb0d0d !important;"><?= print_lang($app_lang,'cons_purchase_invoice_top_user'); ?>:</strong></span> <?= get_logged_user_data('name'); ?></td>
        <td style="width: 25%;"><span style="color: #bb0d0d !important; padding: 4px;"><strong style="color: #bb0d0d !important;"><?= print_lang($app_lang,'cons_purchase_invoice_top_supplier'); ?>:</strong></span> <?= $supplier_name; ?></td>
        <td style="width: 16%; background: #bb0d0d !important; color: #fff!important; border-radius: 0px 15px 0px 15px !important; padding: 7px 0px; text-align: center;"><strong><span style="color: #fff !important; font-size: 15px;"><?= print_lang($app_lang,'cons_purchase_invoice_top_bill'); ?>:</span><span style="color: #fff !important;"> <?= $invoice_data['invoice']; ?></span></strong></td>
    </tr>
</table>

<table style="width: 100%; background: #fff;">
    
    <!-- Table Heead with red backgorund -->
    <tr style="border: 1px solid black;" class="text-center">
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 5%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_serial')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 15%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_item_name')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 15%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_unit')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 10%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_qty')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 15%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_rate')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 15%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_total')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 15%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_paid')); ?></th>
        <th style="font-size: 19px; border: 1px solid black; background: #bb0d0d !important; color: #fff !important; padding: 5px; text-align: center; width: 15%;"><?= strtoupper(print_lang($app_lang,'cons_purchase_invoice_thead_pending')); ?></th>
    </tr>
    <!-- Table Heead with red backgorund -->
    <tr>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;">1</td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $item_name; ?></td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $item_unit; ?></td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $invoice_data['qty']; ?></td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $currency_symbol." ".$invoice_data['rate']; ?></td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $currency_symbol." ".$invoice_data['total']; ?></td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $currency_symbol." ".$invoice_data['cash_paid']; ?></td>
        <td style="color: black !important; border: 1px solid black; padding: 5px; text-align: center; width: 5%;"><?php echo $currency_symbol." ".$invoice_data['pending']; ?></td>
    </tr>


    <!-- Total Tr -->
    <tr>
        <td colspan="9" style=" border: 1px solid black;padding-bottom: 10px; border-bottom: none; border-left: none;">
            <span style="border: 2px dotted; padding: 6px; width: 100%; margin-left: 4px; margin-top: 20px; background: #f3f3f3 !important; border-radius: 0px 12px 0px 12px; display: block; height: 60px;" ></span><br>
            <span style="margin-left: 4px; margin-top: 50px;"><?= print_lang($app_lang,'signature_stamp'); ?>_______________________________</span>
        </td>
        <!-- <td colspan="4" style=" border: 1px solid black;padding: 4px; background: #f3f3f3 !important">            
            <strong style="color: #bb0d0d !important; font-size: 16px;"><?= strtoupper(print_lang($app_lang,'total_balance')); ?>: <span style="<?php if($app_direction == 'rtl'){echo 'float: left;';}else{echo 'float: right;';}?> color: #bb0d0d !important;"><?= $currency_symbol; ?> <?= amount_number_format( $invoice_data['total'] ); ?></span></strong>
        </td> -->
    </tr>
    <tr>
        <td colspan="9" style="<?php if($app_direction == 'rtl'){echo 'text-align: left;';}else{echo 'text-align: right;';}?> font-size: 10px; color: #928e8e; padding-top: 10px;">FASTBOOKS SOFTWARE | 0707009795 | www.fastbooks.com</td>
    </tr>
</table>