<table width="100%" class="">
    <tr style="height:15px;">
        <!--<td class="border" colspan="2"></td>-->        
        <td class="text-right" colspan="3">Qty. <?php echo number_format($grqty, 2) ?></td>        
        <!--<td class="border text-right f12 bold"></td>-->        
        <td class="text-right ">Total</td>
        <td class="text-right "><?php echo number_format($totamt, 2) ?></td>
    </tr> 
    <?php if ($getmdata['totdisc'] > 0) { ?>
        <tr style="height:15px;">
            <!--<td class="border" colspan="2"></td>-->        
            <td class="text-right  " colspan="3">Less Discount</td>
            <td class="text-right f11 "><?php echo number_format($getmdata['ldiscperc'], 2) . '% ' ?></td>
            <td class="text-right f11 "><?php echo number_format($getmdata['totdisc'], 2) ?></td>
        </tr>    

    <?php } ?>
    <?php if ($getmdata['addpack'] > 0) { ?>
        <tr style="height:15px;">
            <!--<td class="border" colspan="2"></td>-->        
            <td class="text-right " colspan="3">Add Packing</td>
            <td class="text-right f11 "></td>
            <td class="text-right f11 "><?php echo number_format($getmdata['addpack'], 2) ?></td>
        </tr>    

        <?php
    }
    if ($getmdata['addgst'] > 0) {
        ?>
        <tr style="height:15px;">
            <!--<td class="border" colspan="2"></td>-->        
            <td class="text-right  " colspan="3">Add GT</td>
            <td class="text-right f11 "></td>
            <td class="text-right f11 "><?php echo number_format($getmdata['addgst'], 2) ?></td>
        </tr>    

    <?php } ?>
    <tr style="height:15px;">
        <td class="" colspan="3">Narration : <?= $getmdata['rem1'] . ' ' . $getmdata['rem2']; ?></td>        

        <td class="text-right f10 bold" >Bill Amount</td>
        <td class="text-right f10 bold"><?php echo rajnumformat($getmdata['billamt']) ?></td>
    </tr> 


    <tr style="height:15px;">
        <td class="bold" style="font-size: 10px" colspan="3">Rupees <?php echo rsword($getmdata['billamt']); ?> Only</td>        
        <?php 
//        browse(123);
//        browse($actprev);
        if ($actprev != 0) {
            ?>
            <td class="text-right " >Previous Bal. &nbsp;</td>
            <td class="text-right f10 "><?php echo number_format($actprev, 2) ?></td>
        <?php } ?>

    </tr> 

    <tr style="height:20px;">
        <td class="" colspan="3">Packed By : <?php echo $getmdata['packby']; ?></td>        
        <?php
        $billamt = $getmdata['billamt'];
        if ($paytype == "C") {
            $actprev = 0;
        }
        $totbal = $billamt - $advance + $actprev;

        if ($paytype != "C") {
            if ($getmdata['totadv'] > 0) {
                ?>
                <td class="text-right  ">Advance</td>
                <td class="text-right f11"><?php echo number_format($getmdata['totadv'], 2) ?></td>
            <?php } else {
                ?>
                <td class="" colspan="2"></td>        
             <?php } ?>

        <tr>
            <td class="" colspan="3"></td>        
            <td class="text-right  ">Balance &nbsp;</td>
            <td class="text-right f10 bold"><?php echo number_format($totbal, 2) ?></td>
        </tr> 

        <td class="" colspan="2"></td>        
<?php } ?>

</tr>

</table>
                <table  style="width:100% ;page-break-after: always;">

 <tr style='height:45px'></tr>
 <tr style=''>
     <td style='width:45%'></td>
     <td  style='width:30%'></td>
     <td style='width:35%;padding-right:3px' class='text-right'>Authorized Signatory</td>
 </tr>
 
</table>
