<html>
<head>
  <?php
  $invoice_no = '';
  if($invoice->invoice_type=='proforma'){
    $invoice_no .= $this->config->item('client_invoice_proforma_prefix');
  }else{
    if($invoice->tax_invoice==1){
      if($invoice->business_type=='B2B'){
        $invoice_no .= $this->config->item('client_invoice_tax_b2b_prefix');
      }else{
        $invoice_no .= $this->config->item('client_invoice_tax_b2c_prefix');
      }
    }else{
      $invoice_no .= $this->config->item('client_invoice_prefix');
    }
  }
  $invoice_no .= sprintf('%03u', $invoice->invoice_no);
  $invoice_no .= $invoice->invoice_suffix;
  ?>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>
    <?php
    if($invoice->invoice_type=='proforma'){
      echo "PROFORMA INVOICE";
    }else{
      echo "CLIENT INVOICE";
    } ?>
    - <?php echo $invoice_no.' ['.$invoice->client_name.'] ['.$invoice->work_name.']'?></title>

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous" media="all">
    <!--end::Web font -->
    <!--begin::Base Styles -->
    <link href="<?php  echo $this->config->item('Template_template_file_url'); ?>template/assets/vendors/base/vendors.bundle.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo $this->config->item('Template_template_file_url'); ?>template/assets/demo/default/base/style.bundle.css" rel="stylesheet" type="text/css" />
    <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js"></script>
    <script>
    WebFont.load({
      google: {"families":["Poppins:300,400,500,600,700","Roboto:300,400,500,600,700"]},
      active: function() {
        sessionStorage.fonts = true;
      }
    });
    </script>
  </head>
  <style>
  .m-invoice-2 .m-invoice__wrapper .m-invoice__body table thead tr th {
    color: #000000;
  }
  .m-invoice-2 .m-invoice__wrapper .m-invoice__body table tbody tr td {
    color: #000000;
  }
  .item_table td{
    padding: .75rem !important;
  }
  .item_table th{
    white-space: nowrap;
    padding: .75rem !important;
  }
  .table thead th {
    border-top: 1px solid #b7b7b7 !important;
  }
  .table thead th {
    border: 1px solid #b7b7b7 !important;
  }
  .table tbody td {
    border: 1px solid #b7b7b7 !important;
  }
  .payment-table tbody td{
    border-top: 1px solid #b7b7b7 !important;
  }
  .m-invoice-2 .m-invoice__wrapper .m-invoice__head .m-invoice__container.m-invoice__container--centered {
    width: 90%;
  }
  .m-invoice-2 .m-invoice__wrapper .m-invoice__body.m-invoice__body--centered {
    width: 95%;
    padding: 1rem 1rem 1rem 1rem;
  }
  .m-invoice-2 .m-invoice__wrapper .m-invoice__body table thead tr th {
    padding: 0.2rem 0.5rem 0.3rem 0.5rem !important
  }
  .m-invoice-2 .m-invoice__wrapper .m-invoice__body table tbody tr td {
    padding: 0.2rem 0.5rem 0.3rem 0.5rem !important
  }
  .m-invoice-2{
    line-height: 20px !important;
  }

  @media print
  {
    body * {
      visibility: hidden;
    }
    .m-portlet__body * {
      visibility: visible;
      overflow: visible !important;
    }
    .table-bordered td{
      padding: .75rem !important;
    }
    .table-bordered th{
      white-space: nowrap;
      padding: .75rem !important;
    }
    .table-bordered .table thead th {
      border-top: 1px solid #b7b7b7 !important;
    }
    .table thead th {
      border-top: 1px solid #b7b7b7 !important;
    }
    .table tbody td {
      border: 1px solid #b7b7b7 !important;
    }
    .m-invoice-2 .m-invoice__wrapper .m-invoice__head .m-invoice__container.m-invoice__container--centered {
      width: 100%;
    }
    .m-invoice-2 .m-invoice__wrapper .m-invoice__body.m-invoice__body--centered {
      width: 100%;
      padding: 0rem !important;
    }
    .m-invoice__container{
      width: 100%;
    }
    .m-content{
      padding: 0px !important;
    }
    body{
      background-color: white !important;
    }
    .m-body .m-content {
      min-height: 200px !important;
    }
    #print, .print_hide_div
    {
      display: none !important;
      height: 0px !important;
      padding: 0px !important;
      margin: 0px !important;
    }
    .m-portlet .m-portlet__head {
      display: none !important;
      height: 0px !important;
    }
    .m-subheader  {
      display: none !important;
      height: 0px !important;
    }
    .m-header--fixed .m-body {
      padding-top: 0px !important;
      padding-bottom: 0px !important;
    }
    .m-header {
      height: 0px !important;
    }
    .m-portlet {
      margin-bottom: 0px !important;
    }
    .m-footer--push.m-aside-left--enabled:not(.m-footer--fixed) .m-aside-right, .m-footer--push.m-aside-left--enabled:not(.m-footer--fixed) .m-wrapper {
      margin-bottom: 0px !important;
    }
  }
  @media print {
    /* html, body, div, span, applet, object, iframe, td, tr, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
    font-size: 15pt !important;  }
    h1.entry-title {
    font-size: 15pt !important;
    }*/
  }

  @media print { tr.bg_S { background-color: rgb(224, 224, 224) !important; -webkit-print-color-adjust: exact; } } @media print { .bg_S th { background-color: rgb(224, 224, 224) !important; } }
  @media print { tr.bg_H { background-color: rgb(224, 224, 224) !important; -webkit-print-color-adjust: exact; } } @media print { .bg_H th { background-color: rgb(224, 224, 224) !important; } }
  @media print { tr.bg_L { background-color: #7f7f7f !important; -webkit-print-color-adjust: exact; } } @media print { .bg_L th { background-color: #7f7f7f !important; } }
  @media print { tr.bg_N { background-color: rgba(94, 94, 94, 0.52) !important; -webkit-print-color-adjust: exact; } } @media print { .bg_N th { background-color: rgba(94, 94, 94, 0.52) !important; } }

  .no-border thead th {
    border: none !important;
    border-top: none !important;
  }
  @page {
    size: auto;
    margin: 0;
  }
</style>

<body class="">
  <div class="m-grid__item m-grid__item--fluid m-wrapper" id="content">
    <div class="m-content" style="height:auto; float:left; width:100% !important;">
      <div class="page-header" style="text-align: left;padding-left: 0px;">
        <h4 style="text-align:right;margin-right:10px"></h4>
        <div class="m-invoice-2" style="padding-bottom: 0px">
          <div class="m-invoice__wrapper">
            <div class="m-portlet__body m-portlet__body--no-padding" id="print_view">
              <?php $this->view("modules/invoices/include_invoice_print");?>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script src="<?php echo $this->config->item('Template_template_file_url'); ?>template/assets/vendors/base/vendors.bundle.js" type="text/javascript"></script>
    <script src="<?php echo $this->config->item('Template_template_file_url'); ?>template/assets/demo/default/base/scripts.bundle.js" type="text/javascript"></script>

    <script>
    jQuery(document).ready(function() {
      window.print();
    });
    </script>
  </body>
  </html>
