<?php
$zroot = $_SESSION["zdir"];
$zcomp = $_SESSION["comp_" . $dbname];
$getcomp = mysqli_query($conn, "SELECT * FROM $zroot.`company` where code='$zcomp'")or die(mysqli_error($conn));
$comp = mysqli_fetch_array($getcomp);
?>
<style>
    @media print {
        .noPrint {
            display:none;
        }
    }
</style>
    <table  border="solid 1px" style="border-collapse: collapse; width:100%">
                   
                    <tr style="">
                        <td colspan="5" style="border:none" ><? echo "$getdata[remark1]" . " &nbsp;" . "$getdata[remark2]"; ?></td>
                        <td style="text-align: right;border:none ">Total <? echo $totqty; ?>  </td>
                        <td colspan="4" style="text-align: right;border:none" > Subtotal  </td>
                        <!--<td style="border-right: 1px;border-left: 1px; "></td>-->
                        <td style="text-align: right;border-left: none;"> <? echo $getdata[subtotal]; ?>  </td>

                    </tr>

                    <?php
                    if ($getdata[litemdisc] > 0) {
                        ?> 
                        <tr>

                            <td colspan="10" style="text-align: right; " class="lnone rnone"> Less Item Discount  </td>
                            <td style="text-align: right; " class="lnone rnone">   </td>
                            <!--<td class="lnone rnone"></td>-->
                            <td style="text-align: right; " class="lnone "> <? echo $getdata[litemdisc]; ?>  </td>
                        </tr>
                        <?php
                    }
                    if ($getdata[cdiscamt] > 0) {
                        ?> 
                        <tr>
                            <td colspan="10" style="text-align: right;" class=" rnone" > Less Cash Discount  </td>
                            <td style="text-align: right;" class="lnone rnone"> <? Echo $getdata[cdiscperc]; ?>  </td>
                            <td class="lnone rnone">%</td>
                            <td style="text-align: right; " class="lnone "> <? Echo $getdata[cdiscamt]; ?>  </td>
                        </tr>
                        <?php
                    }

                    if ($getdata[taxdisc] > 0) {
                        ?> 
                        <tr>
                            <td colspan="10" style="text-align: right;" class="rnone"> Less Discount  </td>
                            <td style="text-align: right; " class="lnone rnone">   </td>
                            <td class="lnone rnone"></td>
                            <td style="text-align: right;" class="lnone "> <? echo $getdata[taxdisc]; ?>  </td>
                        </tr>
                        <?php
                    }
                    if ($getdata[lesother] > 0) {
                        ?> 
                        <tr>
                            <td colspan="10" style="text-align: right;" class="rnone"> Less Other</td>
                            <td style="text-align: right; " class="lnone rnone">   </td>
                            <td class="lnone rnone"></td>
                            <td style="text-align: right;" class="lnone "> <? echo $getdata[lesother]; ?>  </td>
                        </tr>
                        <?php
                    }
                    if ($getdata[couamt] > 0) {
                        ?> 
                        <tr>
                            <td colspan="10" style="text-align: right; "class=" rnone">Add Courier <? Echo $getdata[coukg]; ?> /Kg.</td>
                            <td style="text-align: right; "class="lnone rnone"><? Echo $getdata[courate]; ?></td>
                            <td style="text-align: center;"class="lnone rnone ">Rate</td>
                            <td style="text-align: right; "class="lnone "><? Echo $getdata[couamt]; ?></td>
                        </tr>
                        <?php
                    }
                    if ($getdata[tottaxamt] > 0) {
                        ?> 
                        <tr>
                            <td colspan="10" style="text-align: right;" class="rnone"> Taxable Value  </td>

                            <!--<td style="text-align: right; " class="lnone rnone">   </td>-->
                            <!--<td class="lnone rnone"></td>-->
                            <td style="text-align: right;" class="lnone "> <? echo $getdata[tottaxamt]; ?>  </td>
                        </tr>
                        <?php
                    }
                    ?> 
                    <tr>
                        <td colspan="8">
                            <table  border="solid 1px" style="border-collapse: collapse; width:100%">
                                <tbody style="border-collapse: collapse;">

                                    <tr>

                                        <td style="width:30%;">Bank Name</td>
                                        <td style="width:70%;"><?= $getcmpname[bankname] ?></td>
                                    </tr>

                                    <tr>

                                        <td style="width:30%;">A/c. Name</td>
                                        <td style="width:70%;"><?= $getcmpname[acname] ?></td>
                                    </tr>
                                    <tr>

                                        <td style="width:30%;">Branch</td>
                                        <td style="width:70%;"><?= $getcmpname[branchname] ?></td>
                                    </tr>
                                    <tr>

                                        <td style="width:30%;">Account No.</td>
                                        <td style="width:70%;"><?= $getcmpname[acno] ?></td>
                                    </tr>
                                    <tr>

                                        <td style="width:25%;">IFSC Code</td>
                                        <td style="width:70%;"><?= $getcmpname[bankcode] ?></td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                        <td colspan="3" style="border:none;border-collapse: collapse; ">
                            <table  border="solid 1px" style="border-collapse: collapse; width:100%">
                                <tbody style="border-collapse: collapse;">

                                    <tr>

                                        <!--<td style="width:57px;">&nbsp;</td>-->
                                        <td style="width:10px;text-align: right">%</td>
                                        <td style="width:89px;text-align: right" >CGST</td>
                                        <td style="width:89px;text-align: right">SGST</td>
                                        <td style="width:89px;text-align: right">IGST</td>
                                        <td style="width:99px;">&nbsp;</td>
                                    </tr>
                                    <?php
                                    Echo "<tr style='height: 21px'>";
//                                    Echo "<td class='text-right' style='text-align: right;'><b>&nbsp;</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'><b>5%</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[cgst5]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[sgst5]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[igst5]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[totgst5]</td>";
                                    Echo "</tr>";
                                    Echo "<tr style='height: 21px'>";
//                                    Echo "<td class='text-right'><b>&nbsp;</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'><b>12%</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[cgst12]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[sgst12]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[igst12]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[totgst12]</td>";
                                    Echo "</tr>";
                                    Echo "<tr style='height: 21px'>";
//                                    Echo "<td class='text-right'><b>&nbsp;</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'><b>18%</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[cgst18]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[sgst18]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[igst18]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[totgst18]</td>";
                                    Echo "</tr>";
                                    Echo "<tr style='height: 21px'>";
//                                    Echo "<td class='text-right'><b>&nbsp;</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'><b>28%</b></td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[cgst28]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[sgst28]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[igst28]</td>";
                                    Echo "<td class='text-right' style='text-align: right;'>$getdata[totgst28]</td>";
                                    Echo "</tr>";
                                    ?>
                                </tbody>
                            </table>
                        </td>
                    </tr>





                    <?php
                    if ($getdata[netamt] > 0) {
                        ?> 
                        <tr>
                            <td colspan="8" style="text-align:  " class=" rnone">GST No:<?php Echo $getcmpname['gst']; ?></td>
                            <td colspan="1" style="text-align: right; "class=" rnone"><b>Total Amount</b></td>
                            <td style="text-align: right; "class="lnone rnone"><b></b></td>
                            <td style="text-align: right; "class="lnone "><b><? Echo $getdata[netamt]; ?></b></td>
                        </tr>
                        <?php
                    }
                    ?>
                    <tr>
                        <td colspan="8">
                            Amount In Words: 
                            <?php echo rsword(round($getdata[netamt])); ?>
                        </td>
                        <td colspan="4" style="text-align: right; "class=" rnone"><b></b</td>
                    </tr>
                </table>



