<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$zroot = $_SESSION["zdir"];
$zcomp = $_SESSION["comp_" . $dbname];

$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);
$zyear = $myyear;

$vouch = $_GET['vouchno'];

$cond = '';
$lcond = '';
$formname = "Tax Invoice";

$maindb = 'rawmain';
$trandb = 'rawtran';

$getqry = mysqli_query($conn, "SELECT *, DATE_FORMAT(`vouchdt`, '%d-%m-%Y')as vouchdt   FROM `$maindb` WHERE vouchno='$vouch' ORDER BY `vouchno`") or die(mysqli_error($conn));
$getdata = mysqli_fetch_array($getqry);

$cmpname = mysqli_query($conn, "SELECT * From $zroot.`company` where `code`='$zcomp'") or die(mysqli_error($conn));
$getcmpname = mysqli_fetch_array($cmpname);

$getparty = mysqli_query($conn, "SELECT * From accmast WHERE `accode` = '$getdata[party]'") or die(mysqli_error($conn));
$showparty = mysqli_fetch_array($getparty);

$getbroker = mysqli_query($conn, "SELECT * From accmast WHERE `accode` = '$getdata[broker]'") or die(mysqli_error($conn));
$showbroker = mysqli_fetch_array($getbroker);

$gettran2 = mysqli_query($conn, "SELECT irno,qrcode FROM `gsteinvoice` WHERE invno='$getdata[invno]' AND frm = 'R' ") or die(mysqli_error($conn));
$fettran2 = mysqli_fetch_array($gettran2);

$gettrans = mysqli_query($conn, "SELECT `code`,`name` FROM `transport` WHERE `code` = '$getdata[transporter]'") or die(mysqli_error($conn));
$ltrans = mysqli_fetch_array($gettrans);

$oms = $getdata['oms'];

if ($getdata['mirnno'] != ""){
    $irno = $getdata['mirnno'];
}else{
    $irno = $fettran2['irno'];
}

?>

<!DOCTYPE HTML>
<html lang="en-US">


<?php
//        include("includes/files.php");
//        include("includes/tabsuf.php");
?>
<style>
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        /*background-color: #FAFAFA;*/
        font: 10pt "Verdana";
    }

    @media print {
        .noprint {
            display: none;
        }
    }

    * {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
    }

    .page {
        width: 210mm;
        min-height: 297mm;
        padding: 4mm;
        margin: 10mm auto;
        border: 1px #D3D3D3 solid;
        border-radius: 5px;
        /*background: white;*/

    }

    .subpage {
        padding: 0cm;
        /*        border: 1px solid;*/
        height: 288mm;
        outline: 2cm #ffffff solid;
    }

    @page {
        size: A4;
        margin: 0;
    }

    @media print {

        html,
        body {
            width: 210mm;
            height: 297mm;
        }

        .page {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: always;
        }
    }

    .numeric {
        text-align: right;
    }

    .rnone {
        border-right: none;
    }

    .lnone {
        border-left: none;
    }

    .f12 {
        font-size: 12px;
    }
    .sktable td,
    .sktable th {
        border: 1px solid black;
    }
</style>
</head>

<!--<link href="MyStyle/rep_format.css" rel="stylesheet">-->

<body id="main_container">
    <!-- <body id="main_container" onload="window.print();"> -->
    <div class="book">
        <button class="btn btn-primary goBack noprint" onclick="window.close()" style="float: right;width: 150px;height:35px;background-color: white;color:#A0B1BA;">Go Back</button>
        <div class="page">
            <!--<div class="subpage">-->
            <!--   ************Header************  -->
            <div style="border:solid 1px;" class="col-md-12">

                <?php if ($irno != "") { ?>
                    <table>
                        <tr>
                            <td style="width:20%">
                                <table>
                                    <tr>
                                        <td style="text-align:center">
                                            <img src="<?= $getcmpname['logo']; ?>" style="width:15%;margin-right:50px:height:120px;width:120px">
                                            <!-- <b style="font-size: 2.4em;">
                                                <?= $getcmpname['pname']; ?>
                                            </b> -->
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="width:60%">
                                <table>
                                    <tr>
                                        <td style="text-align:center">
                                            <!-- <img src="<?= $getcmpname['logo']; ?>" style="width:15%;margin-right:50px"> -->
                                            <b style="font-size: 2.4em;">
                                                <?= $getcmpname['pname']; ?>
                                            </b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <p style="text-align: center;font-family: Arial, Helvetica, sans-serif;font-weight: bolder;margin:0px;font-size: 12px;">
                                                <?php
                                                echo $getcmpname['add1'] . $getcmpname['add2'] . $getcmpname['add3']
                                                    . $getcmpname['city'] . "&nbsp;&nbsp;" . $getcmpname['pin'];
                                                ?>
                                            </p>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <p style="text-align: center;font-family: Arial, Helvetica, sans-serif;font-weight: bolder;margin:0px;font-size: 12px;">
                                                <?php echo "Email :" . $getcmpname['email'] . " &nbsp " . "  Mobile :" . $getcmpname['mobile']; ?>
                                            </p>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <center><b style="font-size: 1.2em;margin: 0px">GST No.<?= $getcmpname['gst'] ?></b></center>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <center>
                                                <b style="font-size: 14px;margin: 0px"><?= $formname ?></b>
                                            </center>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <center>
                                                <?php if ($irno != "") { ?>
                                                    <b style="font-size: 10px;margin: 0px">IRN No. <?= $irno ?></b>
                                                <?php } ?>
                                            </center>

                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="width:20%">
                                <table>
                                    <tr>
                                        <td style="">
                                            <?php if ($irno != "") { ?>
                                                <img src="https://apps2ai.com/msg/qrbarcode.php?qrcode=<?= $fettran2['qrcode'] ?>&choe=UTF-8" title="ref" style="width:100%" />
                                            <?php } ?>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                <?php } else { ?>
                    <table>
                        <tr>
                            <td style="width:20%">
                                <table>
                                    <tr>
                                        <td style="text-align:center">
                                            <center>
                                                <img src="<?= $getcmpname['logo']; ?>" style="width:70%;">
                                            </center>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="width:80%">
                                <table>
                                    <tr>
                                        <td style="text-align:center">
                                        <b style="font-size: 2.4em;">
                                                    <?= $getcmpname['pname']; ?>
                                                </b> <br>
                                            <center><?php echo $getcmpname['add1'] . " " . $getcmpname['add2'] . " " . $getcmpname['add3']; ?><?php echo $getcmpname['state'] . " " . $getcmpname['city'] . " " . $getcmpname['pin']; ?></center>
                                            <center><?php echo "Email :" . $getcmpname['email'] . " &nbsp " . "  Tel :" . $getcmpname['tel'] . "  Mobile :" . $getcmpname['mobile']; ?></center>
                                            <center><b style="font-size: 1.2em;margin: 0px">GST No.<?= $getcmpname['gst'] ?></b></center>
                                            <center><b><?php echo $formname; ?></b></center>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>

                <?php } ?>

            </div>

            <div style="border:solid 1px;border-collapse: collapse" class="col-md-12">

                <table class="table table-border table-hover" style="width:100%">
                    <tr>
                        <td style="text-align: center; width:50%;border:1px solid black"><b>Bill To Party</b></td>
                        <td style="text-align: center; width:50%;border:1px solid black"><b>Ship To Party</b></td>

                    </tr>
                    <tr>
                        <td style="text-align: center; width:50%;">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%;border:1px solid black">
                                    <tr>
                                        <?php
                                        if ($getdata["nameprint"] != '') {
                                            $printname = $getdata["nameprint"];
                                            $printmobile = $getdata["printmobile"];
                                        } else {
                                            $printname = $showparty['name'];
                                            $printmobile = $showparty['mobile'];
                                        }
                                        ?>
                                        <td style="text-align: left; width:5%"><b>M/s.</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%;" class="f12"><?php echo $showparty['name']; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Address</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$showparty[add1]  "; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$showparty[add2] $showparty[add3]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$showparty[city] $showparty[pin]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Mobile</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:40%" class="f12"><?php echo "$showparty[mobile]"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:17%">GST No.</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:38%" class="f12"><?php echo "$showparty[gstno]"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:10%">State & Code</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:30%" class="f12"><?php echo "$showparty[state]" . " " . "$showparty[statecode]"; ?></td>
                                    </tr>
                                </table>
                            </div>


                        </td>
                        <td style="text-align: center; width:50%">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%;border:1px solid black">
                                    <tr>
                                        <td style="text-align: left; width:5%"><b>M/s.</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[deladd1]"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Address</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[deladd2]"; ?></td>

                                    </tr>
                                    
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[deladd3] $getdata[deladd4]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[delcity] $getdata[delpin]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Mobile</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:40%" class="f12"><?php echo "$printmobile"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:17%">GST No.</td>
                                        <td style="width:1%">:</td>
                                        <?php
                                        if ($getdata['delgstno'] != '') { ?>
                                            <td style="text-align: left; width:38%" class="f12"><?php echo "$getdata[delgstno]"; ?></td>
                                        <?php } else { ?>
                                            <td style="text-align: left; width:38%" class="f12"><?php echo "$showparty[gstno]"; ?></td>
                                        <?php } ?>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:10%">State & Code</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:30%" class="f12"><?php echo "$getdata[delstate] $getdata[delstatecode]"; ?></td>

                                    </tr>


                                </table>
                            </div>


                        </td>

                    </tr>
                    <tr style="">
                        <td style="text-align: center; width:50%;border:1px solid black;border-right: 1px solid black ">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%">
                                    <tr>
                                        <td style="text-align: left; width:25%;"><b>Invoice No</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:74%"><b><?php echo "" . "$getdata[invno]/" . "$zyear"; ?></b></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:25%;"><b>Date</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:74%"><b><?php echo "$getdata[vouchdt]"; ?></b></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:25%;"><b>LR No.</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:74%"><b><?php echo "$getdata[lrno]"; ?>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                LR Date : <?php echo "$getdata[lrdate]"; ?> </b></td>

                                    </tr>

                                </table>
                            </div>
                        </td>
                        <td style="text-align: center; width:50%;border:1px solid black">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%">
                                    <tr>
                                        <td style="text-align: left; width:30%;"><b>Destination :</b></td>
                                        <td style="text-align: left; width:70%;font-size:10px"><?php echo "$getdata[destination]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:30%;"><b>Transporter :</b></td>
                                        <td style="text-align: left; width:70%;font-size:10px"><?php echo "$ltrans[name]"; ?></td>
                                    </tr>

                                    <tr>
                                        <td style="text-align: left; width:35%;"><b>No. of Cartons :</b></td>
                                        <td style="text-align: left; width:75%"><?php echo "$getdata[ncontainer]"; ?></td>
                                    </tr>

                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>

            <div>
                <table class="sktable" style="border-collapse: collapse; width:100%">
                    <tr>
                        <th style="width:3%; color:black;"><label>Sr.</label></th>
                        <th style="width:30%; color:black;"><label>Item</label></th>
                        <th style="width:7%; color:black;"><label>Color</label></th>
                        <th style="width:7%; color:black;"><label>HSN Code</label></th>
                        <th style="width:5%; color:black; text-align: right;"><label>GST %</label></th>
                        <th style="width:8%; color:black; text-align: right;"><label>Qty.</label></th>
                        <!-- <th style="width:6%; color:black;"><label>Unit</label></th> -->
                        <th style="width:8%; color:black; text-align: right;"><label>Rate</label></th>
                        <th style="width:10%; color:black; text-align: right;"><label>Amount</label></th>

                    </tr>

                    <?php
                    $ctr = 0;
                    $ctab = 0;
                    $totqty = 0;
                    $gettran = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `vouchno`='$vouch' order by srno") or die(mysqli_error($conn));
                    while ($showtran = mysqli_fetch_array($gettran)) {
                        $getitem = mysqli_query($conn, "SELECT `name`,`code` From `rawmat` WHERE `code` = $showtran[item] ") or die(mysqli_error($conn));
                        $showitem = mysqli_fetch_array($getitem);

                        $getcolor = mysqli_query($conn, "SELECT `name`,`code`  From `color` WHERE `code` = '$showtran[color]' ") or die(mysqli_error($conn));
                        $showcolor = mysqli_fetch_array($getcolor);

                        if ($oms == '') {
                            $gstperc = $showtran['cgstrate'] * 2;
                            $gstamt = $showtran['cgstamt'] * 2;
                        } else {
                            $gstperc = $showtran['igstrate'];
                            $gstamt = $showtran['igstamt'];
                        }

                        $name = $showitem["name"];

                        echo "<tr style='height:24px'>";
                        echo "<td style=''>$showtran[srno]</td>";
                        echo "<td style=''>$name</td>";
                        echo "<td style=''>$showcolor[name]</td>";
                        echo "<td style=''>$showtran[hsncode]</td>";
                        echo "<td style='text-align: right;'>$gstperc</td>";
                        echo "<td style='text-align: right;'>$showtran[qty]</td>";
                        echo "<td style=' text-align:right;'>$showtran[rate]</td>";
                        echo "<td style=' text-align:right;'>$showtran[amount]</td>";
                        echo "</tr>";

                        $totqty = $totqty + $showtran['qty'];

                        ++$ctr;
                        $ctab = $ctab + 1;

                        if ($ctab > 14) {
                            $pgctr++;
                    ?>
                </table>
            </div>
        </div>
        <div class="page">
            <div style="border:solid 1px;" class="col-md-12">
                <center>
                    <p style="margin-top:2px;margin-bottom: 2px;font-size:11px; "><u>Subject To Mumbai Jurisdiction</u></p>
                </center>

                <?php include("includes/head_print.php"); ?>

                <!--            <div style="border:solid 1px;" class="col-md-12" >
                                <h1 style="margin-top:2px;margin-bottom: 11px;"><center><? echo $getcmpname['name']; ?></center></h1>
                                <center><?php echo $getcmpname['add1'] . " " . $getcmpname['add2'] . " " . $getcmpname['add3']; ?></center>
                                <center><?php echo "Email :" . $getcmpname['email'] . " &nbsp " . "Contact No :" . $getcmpname['tel'] . " " . $getcmpname['mobile']; ?></center>
                                <h5 style="margin-top:2px;margin-bottom: 2px;"><center><b><?php echo $formname; ?></b></center></h5>
                
                            </div>-->
            </div>

            <div style="border:solid 1px;border-collapse: collapse" class="col-md-12">

                <table class="table table-border table-hover" style="width:100%">
                    <tr>
                        <td style="text-align: center; width:50%;border:1px solid black"><b>Bill To Party</b></td>
                        <td style="text-align: center; width:50%;border:1px solid black"><b>Ship To Party</b></td>

                    </tr>
                    <tr>
                        <td style="text-align: center; width:50%;">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%;border:1px solid black">
                                    <tr>
                                        <?php
                                        if ($getdata["nameprint"] != '') {
                                            $printname = $getdata["nameprint"];
                                            $printmobile = $getdata["printmobile"];
                                        } else {
                                            $printname = $showparty['name'];
                                            $printmobile = $showparty['mobile'];
                                        }
                                        ?>
                                        <td style="text-align: left; width:5%"><b>M/s.</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%;" class="f12"><?php echo $showbroker['name']; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Address</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$showbroker[add1]  "; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$showbroker[add2] $showbroker[add3]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$showbroker[city] $showbroker[pin]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Mobile</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:40%" class="f12"><?php echo "$showbroker[mobile]"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:17%">GST No.</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:38%" class="f12"><?php echo "$showbroker[gstno]"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:10%">State & Code</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:30%" class="f12"><?php echo "$showbroker[state]" . " " . "$showbroker[statecode]"; ?></td>
                                    </tr>
                                </table>
                            </div>


                        </td>
                        <td style="text-align: center; width:50%">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%;border:1px solid black">
                                    <tr>
                                        <td style="text-align: left; width:5%"><b>M/s.</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$printname"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Address</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[deladd1]"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[deladd2]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                        <td style="width:1%"></td>
                                        <td style="text-align: left; width:90%" class="f12"><?php echo "$getdata[deladd3]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:7%">Mobile</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:40%" class="f12"><?php echo "$printmobile"; ?></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:17%">GST No.</td>
                                        <td style="width:1%">:</td>
                                        <?php
                                        if ($getdata['delgstno'] != '') { ?>
                                            <td style="text-align: left; width:38%" class="f12"><?php echo "$getdata[delgstno]"; ?></td>
                                        <?php } else { ?>
                                            <td style="text-align: left; width:38%" class="f12"><?php echo "$showparty[gstno]"; ?></td>
                                        <?php } ?>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:10%">State & Code</td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:30%" class="f12"><?php echo "$getdata[deladd4]"; ?></td>

                                    </tr>


                                </table>
                            </div>


                        </td>

                    </tr>
                    <tr style="">
                        <td style="text-align: center; width:50%;border:1px solid black;border-right: 1px solid black ">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%">
                                    <tr>
                                        <td style="text-align: left; width:25%;"><b>Invoice No</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:74%"><b><?php echo "$getdata[invno]/" . "$zyear" . ""; ?></b></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:25%;"><b>Date</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:74%"><b><?php echo "$getdata[vouchdt]"; ?></b></td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:25%;"><b>LR No.</b></td>
                                        <td style="width:1%">:</td>
                                        <td style="text-align: left; width:74%"><b><?php echo "$getdata[lrno]"; ?>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                LR Date : <?php echo "$getdata[lrdate]"; ?> </b></td>

                                    </tr>

                                </table>
                            </div>
                        </td>
                        <td style="text-align: center; width:50%;border:1px solid black">
                            <div style="border-collapse: collapse" class="col-md-12">

                                <table class="table table-bordered table-hover" style="width:100%">
                                    <tr>
                                        <td style="text-align: left; width:30%;"><b>Destination :</b></td>
                                        <td style="text-align: left; width:70%;font-size:10px"><?php echo "$getdata[destination]"; ?></td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: left; width:30%;"><b>Transporter :</b></td>
                                        <td style="text-align: left; width:70%;font-size:10px"><?php echo "$ltrans[name]"; ?></td>
                                    </tr>

                                    <tr>
                                        <td style="text-align: left; width:35%;"><b>No. of Cartons :</b></td>
                                        <td style="text-align: left; width:75%"><?php echo "$getdata[ncontainer]"; ?></td>
                                    </tr>

                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div>
                <table border="solid 1px" style="border-collapse: collapse; width:100%">
                    <tr>
                        <th style="width:3%; color:black;"><label>Sr.</label></th>
                        <th style="width:30%; color:black;"><label>Item</label></th>
                        <th style="width:7%; color:black;"><label>Color</label></th>
                        <th style="width:7%; color:black;"><label>HSN Code</label></th>
                        <th style="width:5%; color:black; text-align: right;"><label>GST %</label></th>
                        <th style="width:8%; color:black; text-align: right;"><label>Qty.</label></th>
                        <!-- <th style="width:6%; color:black;"><label>Unit</label></th> -->
                        <th style="width:8%; color:black; text-align: right;"><label>Rate</label></th>
                        <th style="width:10%; color:black; text-align: right;"><label>Amount</label></th>

                    </tr>
                <?php
                            $ctab = 0;
                        }
                    }
                    if ($pgctr > 1) {
                        $cntrw = 11;
                    } else {
                        $cntrw = 14;
                    }
                    if ($ctab < $cntrw) {
                        for ($i = $ctab; $i <= $cntrw; $i++) {
                            $ctab = $ctab + 1;
                ?>
                    <tr style="height:24px;">
                        <td class="border"></td>
                        <td class="border"></td>
                        <td class="border"></td>
                        <td class="border"></td>
                        <td class="border"></td>
                        <td class="border"></td>
                        <td class="border"></td>
                        <td class="border"></td>
                    </tr>
            <?php
                        }
                    }
            ?>

            <tr style="">
                <td colspan="4" style="border:none"><? echo "$getdata[remark1]" . " &nbsp;" . "$getdata[remark2]"; ?></td>
                <td style="text-align: right; ">Total </td>
                <td style="text-align: right; "><? echo $totqty; ?> </td>
                <td style="text-align: right;"> Subtotal </td>
                <td style="text-align: right;border-left: none;"> <? echo $getdata['subtotal']; ?> </td>
            </tr>

            <?php
            if ($getdata['litemdisc'] > 0) {
            ?>
                <tr>
                    <td colspan="6" 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="6" 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="6" 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="6" 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['tottaxamt'] > 0) {
            ?>
                <tr>
                    <td colspan="6" style="text-align: right;" class="rnone"> Taxable Value </td>
                    <td style="text-align: right; " class="lnone rnone"> </td>
                    <td style="text-align: right;" class="lnone "> <? echo $getdata['tottaxamt']; ?> </td>
                </tr>
            <?php
            }
            ?>
            <tr>
                <td colspan="5">
                    <table border="solid 1px" style="border-collapse: collapse; width:100%">
                        <tbody style="border-collapse: collapse;">
                            <tr>
                                <td style="width:25%;">Bank Name</td>
                                <td style="width:75%;"><?= $getcmpname['bankname'] ?></td>
                            </tr>
                            <tr>
                                <td style="width:25%;">A/c. Name</td>
                                <td style="width:75%;"><?= $getcmpname['acname'] ?></td>
                            </tr>
                            <tr>
                                <td style="width:25%;">Branch</td>
                                <td style="width:75%;"><?= $getcmpname['branchname'] ?></td>
                            </tr>
                            <tr>
                                <td style="width:25%;">Account No.</td>
                                <td style="width:75%;"><?= $getcmpname['acno'] ?></td>
                            </tr>
                            <tr>
                                <td style="width:25%;">IFSC Code</td>
                                <td style="width:75%;"><?= $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:32px;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="4" style="text-align:  " class=" rnone">GST No:<?php echo $getcmpname['gst']; ?></td>
                    <td colspan="2" 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="12">
                    Amount In Words:
                    <?php echo rsword(round($getdata['netamt'])); ?>
                </td>

            </tr>
                </table>
            </div>

            <div>
                <table class="border">
                    <tr>
                        <td class="border" style="width: 541px; font-size: 14px;">
                            <p style="font-size:10px"><b>Terms & Conditions:</b> Goods Return without previous consent
                                will not be accepted.No Liability accepted any breakage or shortage in transit which is entirely at
                                your risk.All claims to be settled to Mumbai. Interest at 18% per annum will be charged if payment is
                                not made within 8 days.Our responsibility cases when good leave our godown<br><b>Subject to Mumbai Jurisdiction.</b>
                                <br>You are required to provide GSTIN No.ones & ledger accounts periodically for enabling statuary compliance payment will be
                                accepted by Payee's by Payee's a/c cheque only.
                            </p>
                            <!--<img src="images/taximg.png">-->
                        </td>
                        <td class="border" style="width: 216px">
                            <?php
                            require("includes/dbconnect.php");
                            ?>
                            <div style=" text-align:right; font-size: 14px; font-weight: 900"><? echo "For $getcmpname[pname]"; ?></div>
                            <br>
                            <br>
                            <br>
                            <div style=" margin-left: 75px; font-size: 10px">AUTHORISED SIGNATORY</div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <!--</div>-->
    </div>
    <?php
    include("includes/linksfoot.php");
    ?>
    <script>
        $(function() {
            formGeneral();
        });
    </script>
</body>

</html>