<!DOCTYPE html>
<html>
<?php 
        $crm_login_company_id       = Yii::app()->user->master_user_company_id;
        $privillage_modal           = new MasCompanySettings();
        $privillage_condition       = 'crm_company_id='.$crm_login_company_id;
        $privillage_count           = $privillage_modal->count(array('condition'=>$privillage_condition));
        $privillage_settings_module = $privillage_modal->find();
        $master_permission        = $privillage_settings_module->permissions;
        $master_permission_array  = json_decode($master_permission, true);
    ?>
<head>
    <title>Service Stock List</title>
</head>

<body>
    <div class="">
        <div class="col-6">
            <br>
            <?php
                         $model_dam = ServiceStore::model()->findByPk($id);
?>
                <div class="h3" style="margin-top: 0;margin-bottom: 0;">
                    <?php echo "Service Stock"; ?>
                </div>
                <div class="input-block">
                    <b><?php echo $id;?></b>
                </div>
                
                
        </div>
        <div class="col-5 offset-1" style="color:#101010;">
            <div class="text-right">
                <!--img src="<?php //echo Yii::app()->baseUrl . '/images/logo/'.Yii::app()->user->pdf_company_logo; ?>" class="logo"-->
                <img src="<?php echo 'images/logo/'.Yii::app()->user->pdf_company_logo; ?>" class="logo">
            </div>
            <br>
            <table class="table" style="width:100%">
           
                        
                <tr>
                    <td>Transfer Date</td>
                    <td>
                        <?php echo date('d/m/Y',STRTOTIME($model_dam->transfer_date));?>
                    </td>
                </tr>                
                <tr>
                    <td>Referance</td>
                    <td>
                        <?php echo $model_dam->reference;?>
                    </td>
                </tr>
                   
            </table>
        </div>
    </div>
    <br>
    <div class="col-md-12">
        <table id="" class="table">
            <thead>
                <tr>
                    <th class="text-center" style="width:4%">No</th>
                    <th class="text-center">Part No</th>
                    <th class="text-center" style="width:55%">Description</th>                    
                    <th class="text-center" style="width:4%">Qty</th>
                    <th class="text-center">Unit</th>
                    
                </tr>
            </thead>
            <tbody>
                
                    <?php
                $m=1;
                $total=0;
                $items = ServiceStoreDetails::model()->findAll(array('condition'=>'t.service_store_id='.$id,'order' => 'id ASC'));
                foreach ( $items as $i =>  $mod_item) {                  
                                                            
                ?>
                    <tr>
                        <td>
                            <?php echo $m;?>
                        </td>
                        <td class="nw">
                            <?php echo $mod_item->part_number;?>
                        </td>
                        <td>
                            <?php echo nl2br($mod_item->product->description);?>
                        </td>
                        
                        <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($mod_item->quantity," ");?>
                        </td>
                        <td>
                            <?php echo $mod_item->unitdetails->name;?>
                        </td>
                        
                    </tr>
               
                    <?php 
                        $m=$m+1;
                        
                } ?>   
            </tbody>
        </table>
 
    </div>
          
   


    <htmlpagefooter name="myfooter">



    
        <div style="border-top: 1px dotted #000000; font-size: 12px; text-align: center; margin-top: 100px;  background-color: #d7faeb;">

                       <div class="footer_new" 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>

<br>

            <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>



</body>

</html>
