<html lang="en">

<head>
    <title>Receipt</title>

  <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">

    <meta name="author" content="">

<style type="text/css">
@media print {
  *{

    box-sizing: border-box;

  }

  body{
font-family: 'Arial';
    margin: 0;

    padding: 15px;
    font-size: 12px;

  }

  .container{

    max-width: 1020px;

    margin: 0 auto;

  }

  .heading{

    width: 100%;

    float: left;

    text-align: left;

  }

  .heading-img{

    float: right;

    max-width: 200px;

  }

  .heading h4{

    margin: 8px 0;

    float: left;

    font-size: 16px;

  }

  .heading small{

    float: left;

    clear: both;

    font-size: 12px;

    font-weight: 300;

  }

  .tittle{

    width: 100%;

    margin:5px 0;

    float: left;

    text-align: center;



  }

  .tittle h6{

border: 1px solid #2196F3;
background-color: #BBDEFB;
padding: 10px;
border-radius: 5px;

    width: 170px;

    max-width: 350px;

    font-size: 18px;

    margin: 10px auto;
  }

  .date{

    width: 40%;

    margin-left: 70%;

    float: left;



  }

  .date span{

    width: 150px;

    display: inline-block;


  }

  .details{

    width: 100%;

    float: left;

  }

  table{

    border-collapse: collapse;

    border-width: 1px;

    float: left;

    width: 100%;

    margin-top:10px; 

  }

  td,th{

    padding: 5px 5px;

    border: 1px solid #0D47A1;

  }

  th{
    background: #BBDEFB;
  }

  .txt-right{

    text-align: right !important;

  }
  .cell-left{
      text-align: left !important;
    }
    .cell-right{
      text-align: right !important;
    }
    .cell-center{
      text-align: center !important;
    }
  .ul-top{

    border-top: 2px solid #000 !important;

  }

  .col-4{
    width: 20%;
    float:left;
    text-align: center;
    margin: 0px 10%;
  }

  .col-3{
    width: 25%;
    float:left;
    text-align: center;
  }

  .space{
    margin: 15px 0;
    width: 100%;
    float: left;
  }
  .col{
    padding: 0 5px;
    border-top: 2px solid #000;
    font-weight: 600;
    font-size: 12px;
  }

  .dot-ul{

    width: 100%;

    height: 1px !important;

    border-top: 1px dotted #000;
    margin: 10px 0;

  }

  .tbl-2{

    width: 100%;

  }

  .tbl-2 td{

    border-left: none;
    border-right: none;
    border-bottom:none;
  }
  .bdr-tn{
    border-top: none;
  }

  .tbl-2 th{

    border-left: none;

    border-right: none;

  }
  .tittle,.details{
    line-height: 105%;
  }
  .clear{

    clear: both;

  }
  .spacer{
    height: 85px;
    width: 100%;
  }
  .footer {
      width:100%;
      float:left;
      font-size:11px;
      position:absolute;
      bottom:0px;
      left:0px;
      text-align:center !important;
      line-height:18px;
      border-top: 1px dotted #000;
      padding: 5px;
    }
    .span1{
        width: 100px !important;
        display: inline-block;
        float: left;
        border: 1px solid #0D47A1;

    }
    .span2{
        width: 100px !important;
        display: inline-block;
        float: left;
    }
    .span3{
        width: auto !important;
        display: inline-block;
        float: left;
    }
    .span4{
        width: 100px !important;
        display: inline-block;
        float: left;
    }
    .span1,.span2,.span3,.span4{
      padding-bottom: 3px;
    }
    table .span1,table .span2,table .span3,table .span4{
      font-size: 10px;
      padding-bottom: 5px;
    }

}

.spacer{
    height: 85px;
    width: 100%;
  }
  .space{
    margin: 15px 0;
    width: 100%;
    float: left;
    border: 1px solid #0D47A1;
    border-radius: 5px;
    padding-bottom: 10px;
  }


.left-col {
    float: left;
    width:25%;
}
.center-col {
    float: left;
    width: 40%;
}
.right-col {
    float: left;
    width: 35%;
}


</style>

</head>

<body>

  <div class="container">

    <div class="heading">

      <!--<img src="http://s17.postimg.org/5l3amn2ob/IMG_01122015_202628.png"/>-->

                    <?php echo CHtml::image(Yii::app()->baseUrl . '/images/logo/'.Yii::app()->user->pdf_company_logo,'',array('class'=>'heading-img')); ?>

      <div style="width:70%; float:left"><h4><?php echo Yii::app()->user->master_company_name;?><small></br><br><?php // echo MasCompany::getBillingAddress();?></small></h4></div>

    </div>
            <br>
    <div class="tittle"><h6><?php echo $title; ?></h6></div>
                <br>



<div class="left-col">&nbsp;</div>
<div class="center-col">&nbsp;</div>
<div class="right-col">
<table class="mytable">
  <tr>
    <td width="50%">Voucher</td>
    <td width="50%"><?php echo $model->voucher_type.'/'.$model->voucher_no; ?></td>
  </tr>
  <tr>
    <td width="50%">Date</td>
    <td width="50%"><?php echo date("d-m-Y", strtotime($model->voucher_date)); ?></td>
  </tr>
  <tr>
    <td colspan="2">
      <b><?php $vo_no=FinGeneralLedgerHead::model()->findByPk($form_ref_no); $use=User::model()->findByPk($vo_no->user_id); ?><b>

                                                 <b> <?php if($use!='') { echo 'Created by: '.$use->first_name.' '.$use->last_name; } ?> </b>

    </td>
  </tr>
</table>

                                                  <!-- 
                                                  <div class=""><b><?php $vo_no=FinGeneralLedgerHead::model()->findByPk($form_ref_no); $use=User::model()->findByPk($vo_no->user_id); ?><b></div> <br>
                                                 <b> <?php if($use!='') { echo 'Created by '.$use->first_name.' '.$use->last_name; } ?> </b><br/> -->

</div>




    </div>
                <br>
    <div class="details">

                    <?php 
                    $model1 = FinGeneralLedger::model()->find(array('condition'=>'voucher_no="'.$model->voucher_type.'/'.$model->voucher_no.'" AND credit>0')); 
                     
                    ?>
                    
      <div class="span2">Description :</div>
            <div class="span3" style="font-size: 15px;"><b> <?php echo $model1->sub->description ?></b></div>
            <div style="width:100%;padding:4px;"></div>
            <div class="span2"></div>
<!--            <div class="span3" style="font-size: 10px;"><?php //echo $model1->account->account_no.' '.$model1->account->description; ?></div>
            <div style="width:100%;padding:4px;"></div>
            <div class="span1"></div>
            <div class="span3" style="font-size: 10px;"><?php //echo $model1->subledger->id.' '.$model1->subledger->description; ?></div>-->

    </div>
    <div class="clear"></div>
                <br>
    <table class="">
    <thead>
    <tr class="bg-blue">
      <th width="15%">A/c #</th>
      <th width="20%">A/c Name</th>
      <th width="20%">SubLedger</th>
      <th width="25%">Reference</th>
      <th class="txt-right" width="10%">Debit</th>
      <th class="txt-right" width="10%">Credit</th>
    </tr>
    </thead>

    
    <?php 
                            $debit_tot=0;
                            $credit_tot=0;
                            foreach ($modelVouchers as $row)
                                {
                            ?>
    <tr>
        <td class="cell-center"><?php echo $row->account->account_no; ?></td>
        <td class="cell-center"><?php echo $row->account->description; ?></td>
        <td class="cell-center"><?php echo $row->sub->description; ?></td>
              <td class="cell-center"><?php echo $row->item_description; ?></td>
            <td class="cell-right"><?php echo Yii::app()->numberFormatter->formatCurrency($row->db_entered, ""); ?></td>
            <td class="cell-right"><?php echo Yii::app()->numberFormatter->formatCurrency($row->cr_entered, ""); ?></td>
       
     
     
      
    </tr>
    <?php
                                $debit_tot+=$row->db_entered;
                                $credit_tot+=$row->cr_entered;
                                } ?>
    <tr>  
        <td class="cell-center br-top" colspan="4"></td> 
        <td class="cell-right br-top"><b><?php echo Yii::app()->numberFormatter->formatCurrency($debit_tot, ""); ?></b></td>
        <td class="cell-right br-top"><b><?php echo Yii::app()->numberFormatter->formatCurrency($credit_tot, ""); ?></b></td>
    </tr>
  </table>

      <div class="space">
    <div class="spacer"></div>
    <div class="col-3"><span>___________________</span> <br> <label>Created By</label></div>
    <div class="col-3"><span>___________________</span> <br> <label>Prepared By</label></div>
    <div class="col-3"><span>___________________</span> <br><label>Approved By</label></div>
    <div class="col-3"><span>___________________</span> <br><label>Received By</label></div>
    </div>
    <div class="clear"></div><br>
<!--    Note : Payment by Cheques accounted only after the realisation of the Cheques.
    <div class="dot-ul"></div> -->
    <div class="clear"></div>

                
<!--    <div class="spacer"></div>
                <div class="col-4"><div class="col" style="width:90px;float:left;" ><label><b>Prepared By</b></label></div></div>
                <div class="col-4" style="width:21%;margin:0 11%"><div class="col" style="width:90px;float:none;" ><label><b>Approved By</b></label></div></div>
                <div class="col-4"><div class="col" style="width:90px;float:right;" ><label><b>Received By</b></label></div></div>

    <div class="clear"></div> -->

  

  </div>
        <!--mpdf
    <htmlpagefooter name="myfooter" class="newfoot">

            <!-- <div style="text-align:center;width:100%;font-size:10px;"><?= Yii::app()->user->footer_autogenerated; ?>
        <?php
                  date_default_timezone_set("Asia/Dubai");
                 echo date('d/m/Y')." ".date("h:i:sa"); ?>
    </div> -->

    
        <div style="border-top: 1px dotted #000000; font-size: 12px; text-align: center; padding-top: 10px; background-color: #d7faeb;">
            <div style="text-align:center;width:100%">
                <b><?= Yii::app()->user->footer_line_1 ?></b><br>
                <?= Yii::app()->user->footer_line_2 ?>
            </div>
            <div style="text-align:center;width:100%">Page {PAGENO} of {nb} </div>
        </div>
    </htmlpagefooter>
        <sethtmlpagefooter name="myfooter" page="all" value="on" />
        mpdf-->
</body>

