<p>
            <b>Quotation Items</b>
        </p>
<table class="table table-hover table-bordered personal-task">
                    <thead>
                        <tr>
                            <th>No</th>
                            <th>Part No</th>
                            <th>Description</th>                            
                            <th>Qty</th>
                            <th>Unit</th>
                            <th>Rate</th>
                            <th>VAT</th>
                            <th>Net Amount</th>
                        </tr>
                    </thead>
                    <tbody>
                <?php
    
                $m=1;
                $condition .= '1=1';
                $condition .= ' AND t.quotes_id ="'.$quotesid.'"';
                $total=0;
                $model_Quotes = QuotesItem::model()->findAll(array('condition'=>$condition));
                foreach ( $model_Quotes as $i =>  $model_Quotes) {
                ?>
                <tr>
                        <td><?php echo $m;?></td>
                        <td><?php echo $model_Quotes->product->part_number;?></td>
                        <td><?php echo $model_Quotes->description;?></td>
                        <td class="text-right"><?php echo Yii::app()->numberFormatter->formatCurrency($model_Quotes->quantity," ");?></td>
                        <td><?php echo $model_Quotes->quoteunit->name;?></td>
                        <?php $rate=$model_Quotes->net_amount/$model_Quotes->quantity;?>
                        <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($rate," ");?>
                        </td>
                        <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($model_Quotes->tax_vat_amount," ");?>
                        </td>
                        <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($model_Quotes->net_amount+$model_Quotes->tax_vat_amount," ");?>
                        </td>
                </tr>
                <?php
                    $m++;
                    $total+=$model_Quotes->net_amount+$model_Quotes->tax_vat_amount;
                }
                ?>
                <tr>
                    <td class="text-right" colspan="7"><b>Net Total  </b></td>
                    <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($total," ");?></b></td>
                </tr>
                <?php
                    $Addition=QuotesAddition::model()->findAll(array('condition'=>'quotes_id='.$quotesid.' AND calculated_value>0'));
                    $Dedution=QuotesDeduction::model()->findAll(array('condition'=>'quotes_id='.$quotesid.' AND calculated_value>0'));
                    if(!empty($Addition))
                    {
                        foreach ($Addition as $eachAddition)
                        {
                ?>
                    <tr>
                        <?php
                        $total+=$eachAddition->calculated_value;
                        ?>
                            <td class="text-right" colspan="7">
                                <?php echo $eachAddition->particular; ?>
                            </td>
                            <td class="text-right">+
                                <?php echo Yii::app()->numberFormatter->formatCurrency($eachAddition->calculated_value," ");?>
                            </td>
                    </tr>
                    <?php
                    }
                    }
                    if(!empty($Dedution))
                    {
                        foreach ($Dedution as $eachDed)
                        {
                      ?>
                        <tr>
                            <?php
                                $total-=$eachDed->calculated_value;
                            ?>
                                <td class="text-right" colspan="7">
                                    <?php echo $eachDed->particular; ?>
                                </td>
                                <td class="text-right">-
                                    <?php echo Yii::app()->numberFormatter->formatCurrency($eachDed->calculated_value," ");?>
                                </td>
                        </tr>
                        <?php
                    }
                    }
                    ?>
                            <tr>
                                <td class="text-right total bc-bl"  colspan="7"><b>Grand Total  </b></td>
                                <td class="text-right total bc-br"><b><?php echo Yii::app()->numberFormatter->formatCurrency($total," ");?></b></td>
                            </tr>
                
                </tbody>
        </table>