<table cellpadding="0" cellspacing="0" width="100%" id="oTable" class="editable">
                	<thead>
                    <tr>
                    	<td colspan="7"><?php $this->load->view('layouts/report/header2'); ?></td>
                    </tr>
                    <?php
						if($ID <> ''){
							echo"<tr>";
                    		echo"<th colspan='7' class='tal'>".substr($accountHead->acctCode,0, 4).'-'.substr($accountHead->acctCode,4, 3).'-'.substr($accountHead->acctCode,7, 2) ?>&nbsp;&nbsp;&nbsp;&nbsp;
							<?php echo $accountHead->acctName."</th>";
                    		echo"</tr>";
						}
					?>
                    <tr class="sep">
            			<th class="tac" width="5">#</th>
            			<th width="12%">&nbsp;&nbsp;<?php echo $this->lang->line('date')?></th>
            			<th width="12%">&nbsp;&nbsp;<?php echo $this->lang->line('journalNo')?></th>
                        <th><?php echo $this->lang->line('referenceNo')?></th>
            			<th><?php echo $this->lang->line('description')?></th>
            			<th class="tar" width="15%"><?php echo $this->lang->line('amount_dr')?></th>
                        <th width="1%"></th>
            			<th class="tar" width="15%"><?php echo $this->lang->line('amount_cr')?></th>
            			<th class="tar" width="15%"><?php echo $this->lang->line('balance')?></th>
            		</tr>
        			</thead>
       				<tbody>
            		<tr>
                		<td class="tac">1</td>
                		<td class="tac">&nbsp;</td>
                        <td class="tac">&nbsp;</td>
                        <td class="tac">&nbsp;</td>
                		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->lang->line('openbalance')?></td>
                        <td class="tac">&nbsp;</td>
                        <td width="1%"></td>
                        <td class="tac">&nbsp;</td>
                		<td class="tar"><?php echo ($accountHead->acctTypeID != '3' && $accountHead->acctTypeID != '4' )?number_format($openingBalance,2):number_format(0,2); ?></td>
                	</tr>
			<?php $bil = 1; 
				//$balanceAmount = $accountdetails->total;
				$balanceAmount = 0;
				$totalDebit=0;
				$totalCredit=0;
				if($datatbls){
					foreach($datatbls as $datatbl):
					if($bil == 1){
					$balanceAmount = $datatbl->amount_dr - $datatbl->amount_cr;
					$totalDebit = $datatbl->amount_dr + $totalDebit;
					$totalCredit = $datatbl->amount_cr + $totalCredit;
					$bil++?>
            		<tr>
                		<td class="tac"><?php echo $bil; ?></td>
                		<td class="tac">&nbsp;&nbsp;<?php echo date("d-m-Y",strtotime($datatbl->effective_date)); ?></td>
                		<td class="tac">&nbsp;&nbsp;<?php echo $datatbl->journalID?></td>
                        <td class="tac">&nbsp;&nbsp;<?php echo $datatbl->refNo; ?></td>
                		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo substr($datatbl->description, 0, 30)?></td>
                		<td class="tar"><?php echo number_format($datatbl->amount_dr,2); ?></td>
                        <td width="1%"></td>
                		<td class="tar"><?php echo number_format($datatbl->amount_cr,2); ?></td>
                		<td class="tar"><?php echo number_format($balanceAmount,2); ?></td>
                	</tr>
            <?php
					}
					else{
					$balanceAmount = $balanceAmount + $datatbl->amount_dr - $datatbl->amount_cr;
					$totalDebit = $datatbl->amount_dr + $totalDebit;
					$totalCredit = $datatbl->amount_cr + $totalCredit;
					$bil++?>
            		<tr>
                		<td class="tac"><?php echo $bil; ?></td>
                		<td class="tac">&nbsp;&nbsp;<?php echo date("d-m-Y",strtotime($datatbl->effective_date)); ?></td>
                		<td class="tac">&nbsp;&nbsp;<?php echo $datatbl->journalID?></td>
                        <td class="tac">&nbsp;&nbsp;<?php echo $datatbl->refNo; ?></td>
                		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo  substr($datatbl->description, 0, 30)?></td>
                		<td class="tar"><?php echo number_format($datatbl->amount_dr,2); ?></td>
                        <td width="1%"></td>
                		<td class="tar"><?php echo number_format($datatbl->amount_cr,2); ?></td>
                		<td class="tar"><?php echo number_format($balanceAmount,2); ?></td>
                	</tr>
            <?php
					}
			endforeach; 
				}?>
                	<tr>
                		<td></td>
                		<td></td>
                		<td></td>
                		<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->lang->line('total')?></td>
                		<td class="tar sep"><?php echo number_format($totalDebit,2); ?></td>
                        <td width="1%"></td>
                		<td class="tar sep"><?php echo number_format($totalCredit,2); ?></td>
                		<td></td>
                	</tr>
					</tbody>
			</table>