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

$maindb = 'purgstmain';
$trandb = 'purgsttran';
$accdb = 'actran';
$stkdb = 'transacn';
$printfile = "";
$file = 'purchasegst.php';
$trandbexist = 1;
$source = "PUTX";
$keyfld = "vouchno";
$myyear = $_SESSION["tit_" . $dbname];
$salelock = $_SESSION["salelock"];
date_default_timezone_set('Asia/Kolkata');
$time = date('H:i:s');

$usertype = $_SESSION["usertype"];
$username = $_SESSION["username_" . $dbname];

//browse($username);
$formname = 'Purchase GST';
$zroot = $_SESSION["zdbroot"];


$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);
$zStartDate = getzdates($zyear, 'S');
$zEndDate = getzdates($zyear, 'E');
mysqli_select_db($conn, $zdb);

include("includes/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["cancbtn"])) {
    $mcancvouch = $_POST['cancvouch'];
    $mcashvouch2 = $_POST['cashvouch2'];
    $cancdate = $_POST['cancdate'];

    //    browse($cancdate);
    //    if ($cancdate != '' || $cancdate != '0000-00-00') {
    //    browse($mcancvouch);
    //    browse($mcashvouch2);
    mysqli_query($conn, "DELETE FROM `$accdb` WHERE `vouchno` = '$mcancvouch' AND `source` = '$source' ") or die(mysqli_error($conn));
    mysqli_query($conn, "DELETE FROM `cashrecp` WHERE `$keyfld`='$mcashvouch2' ") or die(mysqli_error($conn));
    mysqli_query($conn, "DELETE FROM `$accdb` WHERE `$keyfld`='$mcashvouch2' and `source` = 'CR' $keycond") or die(mysqli_error($conn));
    mysqli_query($conn, "DELETE FROM `$stkdb` WHERE vouchno='$mcancvouch'  AND `source`='$source'") or die(mysqli_error($conn));

    mysqli_query($conn, "Update `$maindb` set `cancdate`='$cancdate', cancuser='$username', canc_flag='C' where vouchno = '$mcancvouch'") or die(mysqli_error($conn));
    mysqli_query($conn, "Update `$trandb` set canc='C' where vouchno = '$mcancvouch'") or die(mysqli_error($conn));
    browse('Bill Cancelled');
    //    }
    header("refresh: 1; $file?mode=edit&$keyfld=$mcancvouch&form=$form");
}
if (isset($_POST["submit"])) {

    $a = 1;

    $vouchdt = $_POST["vouchdt"];
    $voucher = trim($_POST["voucher"]);
    $qvouch = $_POST["vouchno"];

    $mono = $_POST["monno"];
    $lrno = $_POST["lrno"];
    $lrdate = $_POST["lrdate"];
    $area = $_POST["area"];
    $transporter = $_POST["transporter"];
    $godown = trim($_POST["godown"]);
    $rem1 = trim($_POST["remark1"]);
    $rem2 = trim($_POST["remark2"]);
    $gstno = $_POST["gstno"];
    $mobile = $_POST["mobile"];
    $staff = trim($_POST["staff"]);
    $paidby = trim($_POST["paidby"]);
    $grossamt = trim($_POST["grossamt"]);
    $totdiscamt = trim($_POST["totdiscamt"]);
    $totcgst = trim($_POST["totcgst"]);
    $totsgst = trim($_POST["totsgst"]);
    $taxableamt = trim($_POST["taxableamt"]);
    $postperc = trim($_POST["postperc"]);
    $postamt = trim($_POST["postamt"]);
    //    $totbillamt = trim($_POST["totbillamt"]);
    $freeflag = trim($_POST["freeflag"]);
    $freeamount = trim($_POST["freeamount"]);
    $deemexp = trim($_POST["deemexp"]);

    $cgst1 = $_POST['cgst1'];
    $sgst1 = $_POST['sgst1'];
    $igst1 = $_POST['igst1'];
    $tottaxble1 = $_POST['tottaxble1'];
    $tottaxable0 = $_POST['tottaxable0'];

    $cgst5 = $_POST['cgst5'];
    $sgst5 = $_POST['sgst5'];
    $igst5 = $_POST['igst5'];
    $tottaxble5 = $_POST['tottaxble5'];

    $cgst12 = $_POST['cgst12'];
    $sgst12 = $_POST['sgst12'];
    $igst12 = $_POST['igst12'];
    $tottaxble12 = $_POST['tottaxble12'];

    $cgst18 = $_POST['cgst18'];
    $sgst18 = $_POST['sgst18'];
    $igst18 = $_POST['igst18'];
    $tottaxble18 = $_POST['tottaxble18'];

    $cgst28 = $_POST['cgst28'];
    $sgst28 = $_POST['sgst28'];
    $igst28 = $_POST['igst28'];
    $tottaxble28 = $_POST['tottaxble28'];

    $totgst1 = $_POST['totgst1'];
    $totgst5 = $_POST['totgst5'];
    $totgst12 = $_POST['totgst12'];
    $totgst18 = $_POST['totgst18'];
    $totgst28 = $_POST['totgst28'];
    //    $roundoff = $_POST['roundoff'];
    $pretcs = $_POST['pretcs'];

    $party = $_POST["party"];

    $distance = $_POST["distance"];
    $vehno = $_POST["vehno"];
    $transmode = $_POST["transmode"];
    $haltinv = $_POST["haltinv"];
    $transgstno = $_POST["transgstno"];

    $totbillamt1 = $pretcs + $tcsamt;
    $roundoff = round($totbillamt1, 0) - $totbillamt1;

    $totbillamt = round($totbillamt1);
    //    $taxableamt = $grossamt - $totdiscamt + $postamt;
    //    $totbillamt1 = $taxableamt + $totgst5 + $totgst12 + $totgst18 + $totgst28 + $tcsamt;
    $gstamount = $pretcs - $taxableamt;
    //
    //    $totbillamt = round($totbillamt1);
    //    if ($totgst1 > 0) {
    //        $oms = 1;
    //    } else {
    $oms = $_POST['oms'];
    //    }

    $count = $_POST["items"];
    $mvouch = $qvouch;


    if ($paidby == "R") {
        $purcode = '30';
    } else {
        $purcode = '29';
    }

    $accode = $party;
    $grpcode = '010';

    if ($totbillamt <= 0) {
        browse("Bill Amount Cannot Be Zero");
        $a = 0;
    }

    if ($vouchdt == '0000-00-00') {
        browse("Voucher Date Cannot Be Empty");
        $a = 0;
    }

    if ($vouchdt == '') {
        browse("Voucher Date Cannot Be Empty");
        $a = 0;
    }

    if ($godown == "") {
        browse("Godown Cannot Be Empty");
        $a = 0;
    }

    if ($accode == "") {
        browse("Party Cannot Be Empty");
        $a = 0;
    }

    if ($taxableamt <= 0) {
        browse("Detail Part Cannot Be Empty");
        $a = 0;
    }

    if ($a == 1) {
        mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE, `product` WRITE, `$stkdb` WRITE, `$accdb` WRITE, `cashrecp` WRITE, `accmast` WRITE,company WRITE ");

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX(vouchno+0) AS maxcode FROM `$maindb` where vouchno != '' $keycond LIMIT 0,1 ") or die(mysqli_error($conn));
            if (mysqli_num_rows($gen1) > 0) {
                $vvouch = mysqli_fetch_assoc($gen1);
                $qvouch = $vvouch["maxcode"] + 1;
            } else {
                $qvouch = '1';
            }
            $mvouch = $qvouch;

            $time = strtotime($vouchdt);
            $month = date("m", $time);
            $intmonth = intval($month);
            if ($intmonth < 10) {
                $intmonth = '0' . $intmonth;
            }
            $voucher = $intmonth . $mvouch;
        }


        ///////////////////           tcs part             ///////   start

        $getprtc = mysqli_query($conn, "SELECT `apptcs` FROM `accmast` WHERE `accode`= '$party'") or die(mysqli_error($conn));
        $lprtc = mysqli_fetch_array($getprtc);
        $apptcs = $lprtc['apptcs'];

        $tcsperc = 0;
        $tcsamt = 0;
        if ($apptcs == 1) {
            // $getcom = mysqli_query($conn, "SELECT tcsperc,tcsmin FROM $zroot.company");
            $getcom1 = mysqli_query($conn, "SELECT tcsperc FROM $zroot.company") or die(mysqli_error($conn));
            $fetcom1 = mysqli_fetch_array($getcom1);
            $tcsperc = $fetcom1['tcsperc'];
            $tcsmin = $fetcom['tcsmin'];

            if ($tcsperc == '' || $tcsperc == 0) {
                $tcsperc = 0.1;
            }

            // browse($pretcs);
            browse($tcsperc);
            $tcsamt = ($pretcs * $tcsperc) / 100;
            // browse($tcsamt);
        } else {
            $getbal = mysqli_query($conn, "SELECT SUM(amount) as amt FROM `$accdb` WHERE accode = '$party' AND vouchno != '$qvouch' and
                                                  `date` <= '$vouchdt' and `retdate` = '0000-00-00'
                                                   AND (source = 'SL' or source = 'SLDE' or source = 'SLO' or source = 'SR') ") or die(mysqli_error($conn));
            $getamt = mysqli_fetch_array($getbal);
            $amt = $getamt['amt'];

            $mobal = abs($amt);

            $finbal = $mobal + $pretcs;

            $getcom = mysqli_query($conn, "SELECT tcsperc,tcsmin FROM $zroot.company ") or die(mysqli_error($conn));
            $fetcom = mysqli_fetch_array($getcom);
            $tcsmin = $fetcom['tcsmin'];

            if ($tcsmin == '' || $tcsmin == 0) {
                $tcsmin = 5000000;
            }

            if ($finbal >= $tcsmin) {
                $tcsperc = $fetcom['tcsperc'];

                if ($tcsperc == '' || $tcsperc == 0) {
                    $tcsperc = 0.1;
                }
                $tcsamt = ($pretcs * $tcsperc) / 100;
                mysqli_query($conn, "UPDATE accmast set `apptcs` = 1 where accode = '$party'");
            }
        }

        $totbillamt1 = $pretcs + $tcsamt;
        $roundoff = round($totbillamt1, 0) - $totbillamt1;

        $totbillamt = round($totbillamt1);
        $gstamount = $pretcs - $taxableamt;


        mysqli_query($conn, "DELETE FROM `$trandb` WHERE vouchno='$mvouch' ") or die(mysqli_error($conn));

        mysqli_query($conn, "DELETE FROM `$stkdb` WHERE vouchno='$mvouch'  AND `source`='$source'") or die(mysqli_error($conn));

        $cnt = 0;
        $cntamt = 0;

        for ($i = 0; $i <= $count; $i++) {
            $cnt++;
            $msrno = $_POST["srno_$i"];
            $mbarcode = $_POST["barcode_$i"];
            $mitemcode = $_POST["itemcode_$i"];
            $gram = $_POST["gram_$i"];
            $hsncode = $_POST["hsncode_$i"];
            $unit = $_POST["unit_$i"];
            $mrp = $_POST["mrp_$i"];
            $batch = $_POST["batch_$i"];
            $qty = $_POST["qty_$i"];
            $rate = $_POST["rate_$i"];
            $amt = $_POST["amount_$i"];
            $discperc = $_POST["discperc_$i"];
            $discamt = $_POST["discamt_$i"];
            $gstrate = $_POST["gstrate_$i"];
            $gstamt = $_POST["gstamt_$i"];
            $cgstrate = $_POST["cgstrate_$i"];
            $cgstamt = $_POST["cgstamt_$i"];
            $sgstrate = $_POST["sgstrate_$i"];
            $sgstamt = $_POST["sgstamt_$i"];
            $igstrate = $_POST["igstrate_$i"];
            $igstamt = $_POST["igstamt_$i"];
            $total = $_POST["total_$i"];
            $subtot = $_POST["subtot_$i"];
            $mqty = $qty;

            $group = $source . $mvouch;

            $gstperc = $cgstrate + $sgstrate + $igstrate;

            if (!empty($mbarcode) && $qty > 0) {

                mysqli_query($conn, "INSERT INTO `$trandb`(`srno`,vouchno, vouchdt, itemcode, `barcode`, `gram`, hsncode, mrp,
                                                   unit, batch, qty, rate, amount, `discperc`, `discamt`, `cgstrate` , `cgstamt`, `sgstrate`,
                                                   `sgstamt`, `igstrate`, `igstamt`,`total`, `subtot`, `gstrate`, `gstamt`)
                                    VALUES('$cnt', '$mvouch', '$vouchdt', '$mitemcode', '$mbarcode', '$gram', '$hsncode','$mrp',
                                           '$unit', '$batch', '$qty', '$rate', '$amt', '$discperc', '$discamt', '$cgstrate', '$cgstamt', '$sgstrate',
                                          '$sgstamt', '$igstrate', '$igstamt', '$total', '$subtot', '$gstrate', '$gstamt')") or die(mysqli_error($conn));

                $gitemgrp = mysqli_query($conn, "SELECT `barcode`,`prodgrp` FROM `product` WHERE `barcode`= '$mbarcode'") or die(mysqli_error($conn));
                $fitemgrp = mysqli_fetch_array($gitemgrp);
                $itemgrp = $fitemgrp['prodgrp'];

                mysqli_query($conn, "INSERT INTO `$stkdb`(`srno`, `yearno`, `godown`, `series`,`vouchno`, `vouchdt`,
                                                  `itemcode`, `barcode`, `gram`, `unit`, `qty`, `source`, 
                                                  `batch`, amount, accode, `group` , `rate`, `mrp`, `itemgrp`,
                                                  `ordno`, `monno`, `netamt`)
                                           VALUES('$cnt', '$myyear', '$godown', 'LO','$mvouch', '$vouchdt', 
                                                  '$mitemcode', '$mbarcode', '$gram', '$unit', '$mqty', '$source',
                                                  '$batch', '$amt', '$party', '$group', '$rate', '$mrp', '$itemgrp',
                                                  '5', '$mono', $total)") or die(mysqli_error($conn));
            }
        }

        ############################### Accounts Part ######################################################
        //        IF ($chkledg == 1) {

        mysqli_query($conn, "DELETE FROM `$accdb` WHERE `vouchno` = '$mvouch' AND `source` = '$source' ") or die(mysqli_error($conn));
        if ($totbillamt > 0) {
            $minus_amt = ($totbillamt * -1);
            $minustaxable_amt = ($taxableamt * -1);
            $minusgst_amt = ($gstamount * -1);
            $minustcs_amt = ($tcsamt * -1);


            // sale part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '001', '$purcode','005', '$minustaxable_amt','$mono')") or die(mysqli_error($conn));

            //            gst part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '003', '5','020', '$minusgst_amt','$mono')") or die(mysqli_error($conn));
            //            tcs part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '005', '32','020', '$minustcs_amt','$mono')") or die(mysqli_error($conn));

            //            round off part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno,`godown`, source, trnno, accode, grpcode, amount, monno)
                            VALUES ('$vouchdt','$mvouch','$godown', '$source', '004', '25','012', '$roundoff','$mono')") or die(mysqli_error($conn));

            // party part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, `godown`, source, trnno, accode, grpcode, amount, monno)
                                VALUES ('$vouchdt','$mvouch','$godown', '$source', '002', '$accode','010', '$totbillamt','$mono')") or die(mysqli_error($conn));
        }

        if ($addflag == 1) {
            mysqli_query($conn, "INSERT INTO `$maindb`(`username`, vouchno, `vouchdt`, `voucher`, `invno`, `monno`, `party`, `mobile`, `oms`, `paidby`, `lrno`, `lrdate`,
                                               `transporter`, `area`, `staff`, `rem1`, `rem2`,  `cashvouch`, `gstno`, `discamt`,`grossamt`, `godown`,roundoff,
                                               `taxableamt`,`cgst1`,`sgst1`,`igst1`,`cgst5`,`sgst5`,`igst5`,`cgst12`,`sgst12`,`igst12`,`cgst18`,`sgst18`,
                                               `igst18`,`cgst28`,`sgst28`,`igst28`,`totgst1`,`totgst5`,`totgst12`,`totgst18`,`totgst28`, `purcode`,`billamt`,
                                               `postperc`,`postamt`,`freeflag`,`freeamount`,`deemexp`,`tottaxble5`, `tottaxble12`, `tottaxble18`,`tottaxble28`,`tottaxable0`,
                                               pretcs, tcsperc, tcsamt, distance, vehno, transmode, haltinv, transgstno)
                                      VALUES('$username', '$mvouch', '$vouchdt', '$voucher', '$mvouch', '$mono', '$party', '$mobile', '$oms', '$paidby','$lrno', '$lrdate',
                                             '$transporter', '$area', '$staff','$rem1', '$rem2', '$mcashvouch', '$gstno', '$totdiscamt','$grossamt', '$godown','$roundoff',
                                             '$taxableamt','$cgst1','$sgst1','$igst1','$cgst5','$sgst5','$igst5', '$cgst12','$sgst12','$igst12', '$cgst18', '$sgst18',
                                             '$igst18','$cgst28','$sgst28','$igst28','$totgst1','$totgst5','$totgst12','$totgst18','$totgst28', '$purcode','$totbillamt',
                                             '$postperc','$postamt','$freeflag','$freeamount','$deemexp', '$tottaxble5', '$tottaxble12', '$tottaxble18', '$tottaxble28','$tottaxable0',
                                             '$pretcs', '$tcsperc', '$tcsamt', '$distance', '$vehno', '$transmode', '$haltinv', '$transgstno')") or die(mysqli_error($conn));
        } else {
            mysqli_query($conn, "UPDATE `$maindb` SET  `vouchdt`='$vouchdt', `voucher`='$voucher', `invno`='$mvouch', `monno`='$mono', `party`='$party',
                                               `mobile`='$mobile', `paidby`='$paidby', `lrno`='$lrno', `lrdate`='$lrdate', 
                                               `transporter`='$transporter', `area`='$area', `staff`='$staff', `gstno`='$gstno', `cashvouch`='$mcashvouch',
                                                `rem1`='$rem1', `rem2`='$rem2', `discamt`='$totdiscamt',`grossamt`='$grossamt',`godown`='$godown',`oms`='$oms',
                                                `taxableamt`='$taxableamt',`cgst1`='$cgst1',`sgst1`='$sgst1',`igst1`='$igst1',`cgst5`='$cgst5',`sgst5`='$sgst5',
                                                `igst5`='$igst5',`cgst12`='$cgst12',`sgst12`='$sgst12',`igst12`='$igst12',roundoff='$roundoff',
                                                `cgst18`='$cgst18', `sgst18`='$sgst18',`igst18`='$igst18',
                                                `cgst28`='$cgst28', `sgst28`='$sgst28',`igst28`='$igst28', `totgst1`='$totgst1',
                                                `totgst5`='$totgst5',`totgst12`='$totgst12', `totgst18`='$totgst18',`totgst28`='$totgst28',
                                                `billamt`='$totbillamt',`postperc`='$postperc',`postamt`='$postamt',`freeflag`='$freeflag', `username`='$username',
                                                `freeamount`='$freeamount',`deemexp`='$deemexp', `tottaxable0`='$tottaxable0', `tottaxble5`='$tottaxble5', `tottaxble12`='$tottaxble12', `tottaxble18`='$tottaxble18',
                                                `tottaxble28`='$tottaxble28',pretcs='$pretcs', tcsperc='$tcsperc', tcsamt='$tcsamt', distance='$distance', vehno='$vehno', `transmode`='$transmode', `haltinv`='$haltinv', `transgstno`='$transgstno'  WHERE `vouchno` = '$mvouch' ") or die(mysqli_error($conn));
        }

        if (!empty($mobile)) {
            mysqli_query($conn, "UPDATE `accmast` SET  `mobile`='$mobile'   WHERE `accode` = '$party' ") or die(mysqli_error($conn));
        }

        mysqli_query($conn, "UNLOCK TABLES");
        if ($addflag == 1) {
            insmess();
            header("refresh: 1; $file?mode=edit&$keyfld=$mvouch&form=$form");
        } else {
            updmess();
        }
    }
}

if ($addflag != 1) {

    $getvouch = '';
    if ($addflag == 0) {
        $getvouch = $_GET[$keyfld];
    } else {
        $getvouch = $qvouch;
    }

    $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld='$getvouch'  ") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);

    $getstaff = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `accode`= '$get[staff]'") or die(mysqli_error($conn));
    $lstaff = mysqli_fetch_array($getstaff);

    $getparty = mysqli_query($conn, "SELECT `accode`,`name`,gstno FROM `accmast` WHERE `accode`= '$get[party]'") or die(mysqli_error($conn));
    $lparty = mysqli_fetch_array($getparty);

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

    $getgodown = mysqli_query($conn, "SELECT * FROM `godown` WHERE `code`= '$get[godown]'") or die(mysqli_error($conn));
    $getgd = mysqli_fetch_array($getgodown);

    // $gimage = mysqli_query($conn, "SELECT imgpath FROM `lrimage` WHERE `vouchno` = '$getvouch' and source = '$source' ") or die(mysqli_error($conn));
    // $fimage = mysqli_fetch_array($gimage);

    $delcsh = $get['cashvouch'];

    if ($get['irn'] != "") {
        $tno = 1;
    } else {
        $tno = 0;
    }
}

if (isset($_GET["delete"])) {
    mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE, `$stkdb` WRITE, `$accdb` WRITE, `cashrecp` WRITE") or die(mysqli_error($conn));

    $delcond = " source = '$source' and vouchno = '$_GET[vouchno]'";
    $delcond1 = " source = 'CR' and vouchno = '$delcsh'";
    $delcond3 = " vouchno = '$delcsh'  ";
    $delcond2 = " vouchno = '$_GET[vouchno]'";

    delnew($zdb, "$maindb", "$delcond2", "$file?mode=last");
    delnew($zdb, "$trandb", "$delcond2", "$file?mode=last");
    delnew($zdb, "$stkdb", "$delcond", "$file?mode=last");
    delnew($zdb, "$accdb", "$delcond", "$file?mode=last");
    delnew($zdb, "$accdb", "$delcond1", "$file?mode=last");
    delnew($zdb, "cashrecp", "$delcond3", "$file?mode=last");

    mysqli_query($conn, "UNLOCK TABLES");
}

include("includes/linkshead.php");
?>
<script src="MyScript/purchasegst.js?A=<?= mt_rand(); ?>" type="text/javascript"></script>
<script src="MyScript/search_item.js?A=<?= mt_rand(); ?>" type="text/javascript"></script>
<script src="MyScript/sale_ti_search.js" type="text/javascript"></script>
<script src="MyScript/checkdate.js" type="text/javascript"></script>

</head>

<body>
    <form action='' method='POST'>
        <div class="col-lg-3 pad text-center" id="overlay_form" style="display:none;z-index:999;">
            <button type="button" id="close_form" style="float: right;font-weight: bold;font-size: 18px;color:red;"><i class="fa fa-close"></i></button>
            <div style='width:100%;' id='browdata'>
            </div>
        </div>
        <!-- Default box -->
        <div>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12  pad">
                <div class="panel panel-default">
                    <div class="panel-heading" style="height:40px">
                        <div class="col-lg-10 col-md-10 col-sm-10  col-xs-10">
                            <h3 class="panel-title" style="color:#78909C"><a class="myPrint"><?php echo $formname; ?></a></h3>
                        </div>
                        <div class="col-lg-2 col-md-2 col-sm-2  col-xs-2">
                            <input type="date" value="<?= $zStartDate ?>" style="width: 1px;border: none" class="zstdate">
                            <input type="date" value="<?= $zEndDate ?>" style="width: 1px;border: none" class="zenddate">
                            <input type="date" value="<?= $salelock ?>" style="width: 1px;border: none" class="salelock">
                            <h4 class="panel-title" style="float:right"><b><?php echo $get['username'] ?></b></h4>
                        </div>

                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Voucher</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text" name="voucher" class="form-control form voucher" value="<?php echo ($addflag != 1) ? $get['voucher'] : '' ?>" tabindex="-1" readonly required>
                                <input type="hidden" name="monno" class="form-control form monno" value="<?php echo ($addflag != 1) ? $get['monno'] : '' ?>">
                                <input type="hidden" class="form-control addflag" value="<?php echo $addflag ?>">
                                <input type="hidden" name="source" class="form-control form source" value="<?= $source; ?>" id="source">
                                <input type="hidden" name="vouchno" class="form-control vouchno" id="vouchno" value="<?php echo ($addflag != 1) ? $get['vouchno'] : $qvouch ?>">
                                <input type="hidden" class="form-control form" name="cashvouch" value="<?php echo ($addflag != 1) ? $get["cashvouch"] : ""; ?>">
                                <input type="hidden" class="form-control form canc_flag" name="" value="<?php echo ($addflag != 1) ? $get["canc_flag"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-1 col-xs-8 pad" style="width:10%">
                                <input type="date" class="form-control form vouchdt focusfield" name="vouchdt" value="<?php echo ($addflag != 1) ? $get["vouchdt"] : date("Y-m-d"); ?>" autofocus required>
                            </div>
                            <!--                            <div class="col-lg-1 pad text-right">
                                                            &nbsp;
                                                        </div>-->
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Invoice</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text" name="invno" class="form-control form invno" value="<?php echo ($addflag != 1) ? $get['invno'] : $qvouch; ?>">
                            </div>
                            <!--                            <div class="col-lg-1 pad text-right">
                                                            &nbsp;
                                                        </div>-->
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Godown</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad ">
                                <select name="godown" class="form-control form  select2 godown" required>
                                    <option value="<?php echo ($addflag != 1) ? $getgd['code'] : ""; ?>"><?php echo ($addflag != 1) ? $getgd['name'] : ""; ?></option>
                                    <?php
                                    // if ($addflag == 1) {
                                        $getgdown = mysqli_query($conn, "SELECT * FROM `godown`") or die(mysqli_error($conn));
                                        while ($fetgdown = mysqli_fetch_array($getgdown)) {
                                            echo "<option value=$fetgdown[code]>$fetgdown[name]</option>";
                                        }
                                    // }
                                    ?>
                                </select>
                            </div>

                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad"></div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 pad text-right">
                                <label class="label-control marg">Party</label>
                            </div>
                            <div class="col-lg-3 pad" style="width:26.50%">
                                <select class="form-control form cmbparty party select2" id="party" name="party" style="width: 100%" required>
                                    <option value="<?php echo ($addflag != 1) ? $lparty["accode"] : ""; ?>"><?php echo ($addflag != 1) ? $lparty["name"] : ""; ?></option>
                                    <?php
                                    //                                    do not remove this condition.Talk to Fairoz Sir first.
                                    if ($addflag != 1) {
                                        $omscond = " and `oms`='$get[oms]'";
                                    }
                                    $gparty = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `grpcode`='009' $omscond order by name") or die(mysqli_error($conn));
                                    while ($party = mysqli_fetch_array($gparty)) {
                                        echo "<option value='$party[accode]'>$party[name]</option>";
                                    }
                                    //                                    }
                                    ?>
                                </select>
                            </div>
                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Oms</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <?php
                                $soms = '';
                                if ($get['oms'] == 1) {
                                    $soms = 'Yes';
                                } else {
                                    $soms = 'No';
                                }
                                ?>
                                <input type="hidden" class="form-control form oms" id="editoms" tabindex="-1" readonly value="<?= $get['oms'] ?>" name="oms">
                                <input type="text" class="form-control form  oms2" tabindex="-1" readonly value="<? echo ($addflag != 1) ? $soms : '' ?>">
                               
                            </div>
                            <div class="col-lg-1 pad text-right">
                                <label class="label-control marg">Mobile</label>
                            </div>
                            <div class="col-lg-2 pad">
                                <input type="text" name="mobile" class="form-control form mobile" value="<?php echo ($addflag != 1) ? $get['mobile'] : ''; ?>" tabindex="">
                            </div>
                            <div class="col-lg-1 pad text-right">
                                <label class="label-control marg">Paid By</label>
                            </div>
                            <div class="col-lg-1 pad">
                                <select id="paidby" name="paidby" class="form-control form select2 paidby" required>
                                    <option <?php
                                            if ($get['paidby'] == 'R') {
                                                echo "selected='selected'";
                                            }
                                            ?> value="R">Credit</option>
                                    <option <?php
                                            if ($get['paidby'] == 'C') {
                                                echo "selected='selected'";
                                            }
                                            ?> value="C">Cash</option>

                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-3 text-right pad">
                                <label class="label-control marg">Free Sample</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="checkbox" class="form-control form freeflag" <?php
                                                                                            if ($get['freeflag'] == "1") {
                                                                                                echo "checked";
                                                                                            }
                                                                                            ?> value="1" name="freeflag">
                            </div>

                            <div class='col-lg-2 col-md-2 col-sm-2 col-xs-2'>

                            </div>
                            <div class='col-lg-1 col-md-1 col-sm-1 col-xs-1'>
                                <button type='button' class='btn btn-primary lrtab  btn-square' style="color: white">
                                    LR. Detail
                                </button>

                            </div>
                            <?php if ($get['irn'] != "") { ?>
                                <div class='col-lg-1 col-md-1 col-sm-1 col-xs-1'>
                                    <button type='button' class='btn btn-success lredit btn-round' style="color: white;background-color: orange">
                                        LR. Edit
                                    </button>
                                </div>
                            <?php } ?>
                            <div class='col-lg-1 col-md-1 col-sm-1 col-xs-1'>
                                <button type='button' class='btn btn-success lrsave btn-round' style="color: white;background-color: green">
                                    LR. Save
                                </button>
                                <button id='cancel' type="button" class="btn btn-pad btn-square lrcanc" style="background-color:#39CCCC; " onClick="window.location.href = '<?= $file . "?mode=last" . $para; ?>'">
                                    <i class="fa fa-times" style="color:#ffffff"></i>
                                </button>
                            </div>
                            <div class='col-lg-12 col-md-8 col-sm-8 col-xs-8 lrdet'>
                                <div class='row'>
                                    <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg">LR No.</label>
                                    </div>
                                    <div class="col-lg-2 col-md-1 col-sm-1 col-xs-1 pad">
                                        <input type="text" class="form-control form lrno lrdetail" name="lrno" value="<?php echo ($addflag != 1) ? $get["lrno"] : ""; ?>">
                                    </div>
                                    <!--                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                                                            &nbsp;
                                                                        </div>-->
                                    <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg">LR Date</label>
                                    </div>
                                    <div class="col-lg-1 col-md-2 col-sm-1 col-xs-1 pad">
                                        <input type="date" class="form-control form lrdate lrdetail" name="lrdate" value="<?php echo ($addflag != 1) ? $get["lrdate"] : ""; ?>">
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg">Distance</label>
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                        <input type="text" class="form-control form distance lrdetail" name="distance" value="<?php echo ($addflag != 1) ? $get["distance"] : ""; ?>">
                                    </div>
                                    <div class="col-lg-1 pad" style="width:10px">
                                        <label class="label-control marg">kms</label>
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                        <label class="label-control marg">Trans Mode</label>
                                    </div>
                                    <div class="col-lg-1 col-md-2 col-sm-1 col-xs-1 pad">
                                        <select name="transmode" class="form-control form transmode lrdetail select2">
                                            <!--<option value="<?php // echo ($addflag != 1) ? $get['transmode'] : "";                       
                                                                ?>"><?php // echo ($addflag != 1) ? $get['transmode'] : "";                       
                                                                                                                                                    ?></option>-->
                                            <option value=''></option>
                                            <option <?php
                                                    if ($get['transmode'] == '1') {
                                                        echo "selected=selected";
                                                    }
                                                    ?> value='1'>Road</option>
                                            <option <?php
                                                    if ($get['transmode'] == '2') {
                                                        echo "selected=selected";
                                                    }
                                                    ?> value='2'>Rail</option>
                                            <option <?php
                                                    if ($get['transmode'] == '3') {
                                                        echo "selected=selected";
                                                    }
                                                    ?> value='3'>Air</option>
                                            <option <?php
                                                    if ($get['transmode'] == '4') {
                                                        echo "selected=selected";
                                                    }
                                                    ?> value='4'>Ship</option>
                                        </select>
                                    </div>
                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                        &nbsp;
                                    </div>
                                    
                                </div>
                                <div class='row'>
                                    <div class="col-lg-1 pad text-right">
                                        <label class="label-control marg">Transporter</label>
                                    </div>
                                    <div class="col-lg-2 col-md-3 col-sm-1 col-xs-1 pad">
                                        <select class="form-control form transporter select2 lrdetail" name="transporter" style="width: 100%">
                                            <option value="<?php echo ($addflag != 1) ? $ltrans["code"] : ""; ?>"><?php echo ($addflag != 1) ? $ltrans["name"] : ""; ?></option>
                                            <option value=""></option>
                                            <?php
                                            $gtrans = mysqli_query($conn, "SELECT `code`,`name` FROM `transport` order by name") or die(mysqli_error($conn));
                                            while ($ftrans = mysqli_fetch_array($gtrans)) {
                                                echo "<option value='$ftrans[code]'>$ftrans[name]</option>";
                                            }
                                            ?>
                                        </select>
                                    </div>
                                    <div class="col-lg-1 pad text-right">
                                        <label class="label-control marg">Area</label>
                                    </div>
                                    <div class="col-lg-1 pad">
                                        <input type="text" name="area" class="form-control form area lrdetail" value="<?php echo ($addflag != 1) ? $get['area'] : ''; ?>" tabindex="">
                                    </div>
                                    <div class="col-lg-1 pad text-right">
                                        <label class="label-control marg">Vehicle No.</label>
                                    </div>
                                    <div class="col-lg-1 pad">
                                        <input type="text" name="vehno" class="form-control form vehno lrdetail" value="<?php echo ($addflag != 1) ? $get['vehno'] : ''; ?>" tabindex="">
                                    </div>
                                    <div class="col-lg-1 pad text-right">
                                        <label class="label-control marg">Transporter GST No.</label>
                                    </div>
                                    <div class="col-lg-1 pad">
                                        <input type="text" name="transgstno" class="form-control form transgstno lrdetail" value="<?php echo ($addflag != 1) ? $get['transgstno'] : ''; ?>" tabindex="">
                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="onldata">
                            <div class="table-responsive">
                                <table class="table-striped table-condensed table-bordered" style="width: 150%">
                                    <thead class="mySearchTr">
                                        <tr>
                                            <th style="width: 1%"></th>
                                            <th style="width: 1%">Sr.</th>
                                            <th style="width: 3%;">Barcode</th>
                                            <th style="width: 4%;display: none">Item code</th>
                                            <th style="width: 8%;">Product Name</th>
                                            <th style='width: 3%'>Hsncode</th>
                                            <th style='width: 2%'>Unit</th>
                                            <th style='width: 3%' class="text-right">Qty.</th>
                                            <th style='width: 3%' class="text-right">Rate</th>
                                            <th style='width: 3%' class="text-right">Amount</th>
                                            <th style='width: 3%' class="text-right">Disc. %</th>
                                            <th style='width: 4%' class="text-right">Disc. Amt.</th>
                                            <th style='width: 4%' class="text-right">Taxable value</th>
                                            <th style='width: 4%' class="text-right">GST %</th>
                                            <th style='width: 3%' class="text-right">CGST%</th>
                                            <th style='width: 3%' class="text-right">CGST Amt.</th>
                                            <th style='width: 3%' class="text-right">SGST%</th>
                                            <th style='width: 3%' class="text-right">SGST Amt.</th>
                                            <th style='width: 3%' class="text-right">IGST%</th>
                                            <th style='width: 3%' class="text-right">IGST Amt.</th>
                                            <th style='width: 5%' class="text-right">Total</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tbody">
                                        <?php
                                        if ($addflag != 1) {
                                            $qry = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE vouchno='$getvouch' ORDER BY srno") or die(mysqli_error($conn));
                                            $ctr = 0;
                                            while ($row = mysqli_fetch_array($qry)) {

                                                $gitemname = mysqli_query($conn, "SELECT `code`,`name` FROM `product` WHERE `prodcode`='$row[itemcode]'") or die(mysqli_error($conn));
                                                $fitemname = mysqli_fetch_array($gitemname);

                                                echo "<tr>";
                                                echo "<input type='hidden' name='itemcode_$ctr' class='itemcode form-control form' value='$geti[code]'>";
                                                echo "<td><i class='fa fa-close remove' style='display:none;'></i></td>";
                                                echo "<td><input type='text' name='srno_$ctr' class='srno form-control  form'  value='$row[srno]'></td>";
                                                echo "<td>";
                                                echo "<input type='text' name='barcode_$ctr' class='barcode form-control form' value='$row[barcode]' required>";
                                                echo "</td>";
                                                echo "<td  style='display:none' >";
                                                echo "<input type='text' name='itemcode_$ctr' required='true' class='itemcode form-control  form' value='$row[itemcode]' readonly required>";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='itemname_$ctr' required='true' class='itemname form-control  form' value='$fitemname[name]' readonly required>";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='hsncode_$ctr' required='true' class='hsncode form-control  form' value='$row[hsncode]' readonly required>";
                                                echo "</td>";
                                                echo "<td><input type='text' name='unit_$ctr' class='unit form-control  form' value='$row[unit]' readonly></td>";
                                                echo "<td><input type='number' name='qty_$ctr' class='qty form-control  text-right form' step='any' value='$row[qty]' ></td>";
                                                echo "<td><input type='number' step='any' name='rate_$ctr' class='rate form-control text-right  form'  value='$row[rate]' ></td>";
                                                echo "<td><input type='number' step='any' name='amount_$ctr' class='amount form-control text-right  form' tabindex='-1' value='$row[amount]' readonly></td>";
                                                echo "<td><input type='text' name='discperc_$ctr' class='discperc form-control text-right  form'  value='$row[discperc]' ></td>";
                                                echo "<td><input type='text' name='discamt_$ctr' class='discamt form-control text-right  form'  value='$row[discamt]' ></td>";
                                                echo "<td><input type='text' name='subtot_$ctr' class='subtot form-control text-right  form' tabindex='-1' value='$row[subtot]' readonly></td>";
                                                echo "<td><input type='number' step='any' name='gstrate_$ctr' class='gstrate form-control text-right  form' value='$row[gstrate]'>
                                                        <input type='hidden' name='gstamt_$ctr' class='gstamt form-control text-right  form' value='$row[gstamt]'></td>";
                                                echo "<td><input type='text' name='cgstrate_$ctr' class='cgstrate form-control text-right  form' tabindex='-1' value='$row[cgstrate]' readonly></td>";
                                                echo "<td><input type='text' name='cgstamt_$ctr' class='cgstamt form-control text-right  form' tabindex='-1' value='$row[cgstamt]' readonly></td>";
                                                echo "<td><input type='text' name='sgstrate_$ctr' class='sgstrate form-control text-right  form' tabindex='-1' value='$row[sgstrate]' readonly></td>";
                                                echo "<td><input type='text' name='sgstamt_$ctr' class='sgstamt form-control text-right  form' tabindex='-1' value='$row[sgstamt]' readonly></td>";
                                                echo "<td><input type='text' name='igstrate_$ctr' class='igstrate form-control text-right  form' tabindex='-1' value='$row[igstrate]' readonly></td>";
                                                echo "<td><input type='text' name='igstamt_$ctr' class='igstamt form-control text-right  form' tabindex='-1' value='$row[igstamt]' readonly></td>";
                                                echo "<td><input type='text' name='total_$ctr' class='total form-control text-right  form' tabindex='-1' value='$row[total]' readonly></td>";
                                                echo "</tr>";
                                                $ctr++;
                                            }
                                        } else {
                                        ?>
                                            <tr>
                                                <td><i class='fa fa-close remove'></i></td>
                                                <td><input type='text' name='srno_0' class='srno form-control form' value='1'></td>
                                                <td><input type='text' name='barcode_0' class='barcode  form-control form' value='' required></td>
                                                <td style="display:none">
                                                    <input type='text' name='itemcode_0' required='true' class='itemcode form-control  form' value='' readonly required>
                                                </td>
                                                <td>
                                                    <input type='text' name='itemname_0' required='true' class='itemname form-control  form' value='' readonly required>
                                                </td>
                                                <td>
                                                    <input type='text' name='hsncode_0' required='true' class='hsncode form-control  form' value='' readonly required>
                                                </td>
                                                <td><input type='text' name='unit_0' class='unit form-control  form' value='' readonly></td>
                                                <td><input type='number' name='qty_0' class='qty form-control  text-right form' step="any" value='0.00'></td>
                                                <td><input type="number" step="any" name='rate_0' class='rate form-control text-right form zero' value='0'></td>
                                                <td><input type="number" step="any" name='amount_0' class='amount text-right form-control form zero' value='0' tabindex='-1' readonly></td>
                                                <td><input type='text' name='discperc_0' class='discperc text-right form-control form ' value='0.00'></td>
                                                <td><input type='text' name='discamt_0' class='discamt text-right form-control form  ' value='0.00'></td>
                                                <td><input type='text' name='subtot_0' class='subtot text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='number' step='any' name='gstrate_0' class='gstrate text-right form-control form  ' value='0.00'>
                                                    <input type='hidden' name='gstamt_0' class='gstamt text-right form-control form  ' value='0.00'></td>
                                                <td><input type='text' name='cgstrate_0' class='cgstrate text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='text' name='cgstamt_0' class='cgstamt text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='text' name='sgstrate_0' class='sgstrate text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='text' name='sgstamt_0' class='sgstamt text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='text' name='igstrate_0' class='igstrate text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='text' name='igstamt_0' class='igstamt text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                                <td><input type='text' name='total_0' class='total text-right form-control form  ' value='0.00' tabindex='-1' readonly></td>
                                            </tr>
                                        <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                            <div class="col-lg-12 pad">
                                <button type="button" class="btn btn-primary btn-square form" id="addnew">
                                    <i class="fa fa-plus" data-toggle='tooltip' title='Add Row'></i>
                                </button>
                                <input type="hidden" id="items" name="items" value="<?php echo ($addflag != 1) ? $ctr : 1; ?>">
                                <!--<input type="hidden" class="mandatoryId" name="manId" value="">-->
                            </div>
                            <div class="col-lg-12 col-xs-12 pad">
                                <div class="col-lg-6 col-xs-12 pad">

                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">G.S.T NO.</label>
                                        </div>
                                        <div class="col-lg-4 pad">
                                            <input type="text" name="gstno" class="form-control form gstno" value="<? echo ($addflag != 1) ? $get["gstno"] : ""; ?>" tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Remarks</label>
                                        </div>
                                        <div class="col-lg-9 pad">
                                            <input type="text" name="remark1" class="form-control form " value="<? echo ($addflag != 1) ? $get["rem1"] : ""; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad text-right"></div>
                                        <div class="col-lg-9 pad">
                                            <input type="text" name="remark2" class="form-control form " value="<? echo ($addflag != 1) ? $get["rem2"] : ""; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-9 pad">

                                            <?php
                                            //                                        browse($get['canc_flag']);
                                            if ($get['canc_flag'] != '') {
                                            ?>
                                                <img src="images/cancel.jpg" alt="Cancelled Bill" style="width:100%;height:100%">
                                            <?php } ?>

                                        </div>
                                    </div>
                                </div>

                                <div class="col-lg-6 col-xs-12 pad">
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Subtotal</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="grossamt" class="form-control form text-right grossamt" value="<?php echo ($addflag != 1) ? $get['grossamt'] : "0"; ?>" readonly tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Disc. Amount</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="totdiscamt" class="form-control form text-right totdiscamt" value="<?php echo ($addflag != 1) ? $get['discamt'] : "0"; ?>" readonly tabindex="-1">
                                        </div>
                                    </div>

                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Postage</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="postamt" class="form-control form text-right postamt" value="<?php echo ($addflag != 1) ? $get['postamt'] : "0.00"; ?>">
                                            <input type="hidden" class="form-control form text-right postperc" value="0">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Taxable Amount</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="taxableamt" class="form-control form text-right taxableamt" value="<?php echo ($addflag != 1) ? $get['taxableamt'] : "0"; ?>" readonly tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="row">
                                            <div class="col-lg-3 pad">

                                            </div>
                                            <div class="col-lg-9 pad">
                                                <div class="table-responsive">
                                                    <table class="table table-striped table-condensed table-bordered" width="100%">
                                                        <thead style="background: #7F6FA6;color: white">
                                                            <tr>
                                                                <th width="20%">Taxable Amt.</th>
                                                                <th width="10%"></th>
                                                                <th width="18%" class='text-right'>CGST</th>
                                                                <th width="18%" class='text-right'>SGST</th>
                                                                <th width="18%" class='text-right'>IGST</th>
                                                                <th width="35%"></th>
                                                            </tr>
                                                        </thead>
                                                        <tbody class="">
                                                            <?php
                                                            if ($addflag != 1) {

                                                                echo "<tr>";
                                                                echo "<td class='text-right'><b><input type='number' class='form-control form text-right tottaxble0' style='color:red' name='tottaxable0' value='$get[tottaxable0]' readonly></b></td>";
                                                                echo "<td class='text-right'><b>0%</b></td>";
                                                                echo "<td><input type='number' class='form-control form text-right cgst0'     name='cgst0'       value='$get[cgst0]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right sgst0'     name='sgst0'       value='$get[sgst0]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right igst0'     name='igst0'       value='$get[igst0]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right totgst0'     name='totgst0'       value='$get[totgst0]' readonly tabindex='-1'></td>";
                                                                echo "</tr>";
                                                                echo "<tr>";
                                                                echo "<td class='text-right'><b><input type='number' class='form-control form text-right tottaxble1' style='color:red' name='tottaxble1' value='$get[tottaxble1]' readonly tabindex='-1'></b></td>";
                                                                echo "<td class='text-right'><b>0.1%</b></td>";
                                                                echo "<td><input type='number' class='form-control form text-right cgst1'     name='cgst1'       value='$get[cgst1]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right sgst1'     name='sgst1'       value='$get[sgst1]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right igst1'     name='igst1'       value='$get[igst1]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right totgst1'     name='totgst1'       value='$get[totgst1]' readonly tabindex='-1'></td>";
                                                                echo "</tr>";
                                                                echo "<tr>";
                                                                echo "<tr>";
                                                                echo "<td class='text-right'><b><input type='number' class='form-control form text-right tottaxble5' style='color:red' name='tottaxble5' value='$get[tottaxble5]' readonly tabindex='-1'></b></td>";
                                                                echo "<td class='text-right'><b>5%</b></td>";
                                                                echo "<td><input type='number' class='form-control form text-right cgst5' name='cgst5' value='$get[cgst5]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right sgst5' name='sgst5' value='$get[sgst5]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right igst5' name='igst5' value='$get[igst5]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right totgst5' name='totgst5' value='$get[totgst5]' readonly tabindex='-1'></td>";
                                                                echo "</tr>";
                                                                echo "<tr>";
                                                                echo "<td class='text-right'><b><input type='number' class='form-control form text-right tottaxble12'  style='color:red'   name='tottaxble12'       value='$get[tottaxble12]' readonly tabindex='-1'></b></td>";
                                                                echo "<td class='text-right'><b>12%</b></td>";
                                                                echo "<td><input type='number' class='form-control form text-right cgst12'     name='cgst12'       value='$get[cgst12]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right sgst12'     name='sgst12'       value='$get[sgst12]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right igst12'     name='igst12'       value='$get[igst12]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right totgst12'     name='totgst12'       value='$get[totgst12]' readonly tabindex='-1'></td>";
                                                                echo "</tr>";
                                                                echo "<tr>";
                                                                echo "<td class='text-right'><b><input type='number' class='form-control form text-right tottaxble18' style='color:red'    name='tottaxble18' value='$get[tottaxble18]' readonly tabindex='-1'></b></td>";
                                                                echo "<td class='text-right'><b>18%</b></td>";
                                                                echo "<td><input type='number' class='form-control form text-right cgst18'     name='cgst18'       value='$get[cgst18]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right sgst18'     name='sgst18'       value='$get[sgst18]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right igst18'     name='igst18'       value='$get[igst18]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right totgst18'     name='totgst18'       value='$get[totgst18]' readonly tabindex='-1'></td>";

                                                                echo "</tr>";
                                                                echo "<tr>";
                                                                echo "<td class='text-right'><b><input type='number' class='form-control form text-right tottaxble28'  style='color:red'   name='tottaxble28' value='$get[tottaxble28]' readonly tabindex='-1'></b></td>";
                                                                echo "<td class='text-right'><b>28%</b></td>";
                                                                echo "<td><input type='number' class='form-control form text-right cgst28'     name='cgst28'       value='$get[cgst28]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right sgst28'     name='sgst28'       value='$get[sgst28]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right igst28'     name='igst28'       value='$get[igst28]' readonly tabindex='-1'></td>";
                                                                echo "<td><input type='number' class='form-control form text-right totgst28'     name='totgst28'       value='$get[totgst28]' readonly tabindex='-1'></td>";
                                                                echo "</tr>";
                                                            } else {
                                                            ?>
                                                                <tr>
                                                                    <td><input type='number' class='form-control form text-right tottaxble0' name='tottaxable0' value='0' readonly tabindex='-1'></td>
                                                                    <td class='text-right'><b>0%</b></td>
                                                                    <td><input type='number' class='form-control form text-right cgst0' name='cgst0' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right sgst0' name='sgst0' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right igst0' name='igst0' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right totgst0' name='totgst0' value='0' readonly tabindex='-1'></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><input type='number' class='form-control form text-right tottaxble1' name='tottaxble1' value='0' readonly tabindex='-1'></td>
                                                                    <td class='text-right'><b>0.1%</b></td>
                                                                    <td><input type='number' class='form-control form text-right cgst1' name='cgst1' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right sgst1' name='sgst1' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right igst1' name='igst1' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right totgst1' name='totgst1' value='0' readonly tabindex='-1'></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><input type='number' class='form-control form text-right tottaxble5' name='tottaxble5' value='0' readonly tabindex='-1'></td>
                                                                    <td class='text-right'><b>5%</b></td>
                                                                    <td><input type='number' class='form-control form text-right cgst5' name='cgst5' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right sgst5' name='sgst5' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right igst5' name='igst5' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right totgst5' name='totgst5' value='0' readonly tabindex='-1'></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><input type='number' class='form-control form text-right tottaxble12' name='tottaxble12' value='0' readonly tabindex='-1'></td>
                                                                    <td class='text-right'><b>12%</b></td>
                                                                    <td><input type='number' class='form-control form text-right cgst12' name='cgst12' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right sgst12' name='sgst12' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right igst12' name='igst12' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right totgst12' name='totgst12' value='0' readonly tabindex='-1'></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><input type='number' class='form-control form text-right tottaxble18' name='tottaxble18' value='0' readonly tabindex='-1'></td>
                                                                    <td class='text-right'><b>18%</b></td>
                                                                    <td><input type='number' class='form-control form text-right cgst18' name='cgst18' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right sgst18' name='sgst18' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right igst18' name='igst18' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right totgst18' name='totgst18' value='0' readonly tabindex='-1'></td>
                                                                </tr>
                                                                <tr>
                                                                    <td><input type='number' class='form-control form text-right tottaxble28' name='tottaxble28' value='0' readonly tabindex='-1'></td>
                                                                    <td class='text-right'><b>28%</b></td>
                                                                    <td><input type='number' class='form-control form text-right cgst28' name='cgst28' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right sgst28' name='sgst28' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right igst28' name='igst28' value='0' readonly tabindex='-1'></td>
                                                                    <td><input type='number' class='form-control form text-right totgst28' name='totgst28' value='0' readonly tabindex='-1'></td>
                                                                </tr>
                                                            <?
                                                            }
                                                            ?>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg hflag" style='color:red'>Free Adjusted Amount</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="freeamount" class="form-control form text-right hflag freeamount" value="<?php echo ($addflag != 1) ? $get['freeamount'] : "0"; ?>" style='color:red' readonly tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg" style=''>Pre TCS</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="pretcs" class="form-control form text-right pretcs" value="<?php echo ($addflag != 1) ? $get['pretcs'] : "0"; ?>" style='color:red' readonly tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-2 pad"></div>
                                        <div class="col-lg-2 pad text-right">
                                            <label class="label-control marg">TCS</label>
                                        </div>
                                        <div class="col-lg-1 pad">
                                            <input type="number" step="any" name="tcsperc" class="form-control form text-right tcsperc" value="<?php echo ($addflag != 1) ? $get['tcsperc'] : "0"; ?>" style='color:red' readonly tabindex="-1">
                                        </div>
                                        <div class="col-lg-1 pad">
                                            <label class="label-control marg">%</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="tcsamt" class="form-control form text-right tcsamt" value="<?php echo ($addflag != 1) ? $get['tcsamt'] : "0"; ?>" style='color:red' readonly tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Round Off</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="roundoff" class="form-control form text-right roundoff" value="<?php echo ($addflag != 1) ? $get['roundoff'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Net Amount</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="totbillamt" required="true" class="form-control form text-right totbillamt" value="<?php echo ($addflag != 1) ? $get['billamt'] : "0"; ?>" readonly tabindex="-1">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="row">


                            <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 text-center pad">

                                <?php include("includes/buttsale.php"); ?>
                            </div>
                            <!--<div class="col-lg-2 col-md-1 col-sm-1 col-xs-1 text-left pad">-->
                            <input type="hidden" class="tno" value="<?= $tno ?>" />

                            <?php if ($get['ewaybillno'] == "" && $get['billamt'] > 50000) { ?>
                                <div class="col-lg-2  col-md-2 col-sm-3 col-xs-3 text-center pad">
                                    <a id='ewaygen' class="btn btn-pad btn-square " style="background-color:#5BC0DE;" href="ewaybillgenerate.php?invno=<?= $get['invno']; ?>&series=LO" target="_blank">
                                        <i class="fa fa-truck" style="color:#ffffff"> E-way Generate</i>
                                    </a>
                                </div>
                            <?php } ?>

                            <?php
                            //                                if ($addflag != 1) {
                            //                                    if ($lparty['gstno'] != "") {
                            //                                        if ($get['irn'] == "") {
                            //                                            
                            ?>
                            <!--                                            <button id='einv' type="button" class="btn btn-pad btn-square " target="_blank" style="background-color:#39CCCC;color:black "  onClick="window.open('einvoice-generate.php?&invno=//<?= $get['invno'] ?>&frmsrs=LO')">
                                                E-Invoice
                                            </button>-->
                            <?php
                            //                                        }
                            //                                    }
                            //                                }
                            ?>
                            <!--</div>-->
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </form>

    <div class="modal fade" id="cancmodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="col-lg-11">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">Cancel Bill</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-lg-12 upload">
                                <form id="upload_form" method="post">

                                    <div class="row pad">
                                        <input type="hidden" name="cancvouch" id="cancvouch" value='<?php echo ($addflag != 1) ? $get['vouchno'] : "$qvouch"; ?>'>
                                        <input type="hidden" name="cashvouch2" id="cashvouch2" value='<?php echo ($addflag != 1) ? $get['cashvouch'] : ""; ?>'>
                                        <div class="col-lg-4 col-md-4 col-sm-4 col-xs-5 text-right">
                                            <label class="label-control marg">Cancel Date</label>
                                        </div>
                                        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-7">

                                            <input type="date" name="cancdate" value="<?php echo ($addflag != 1) ? $get['cancdate'] : ""; ?>" class="form-control cancdate">
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-lg-6 col-md-6 col-sm-7 col-xs-8 text-right">
                                            <input type="submit" value="Cancel" name="cancbtn" class="btn btn-square" style="background-color: #C0CA33; color: white">
                                        </div>
                                    </div>

                                </form>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="imageUpload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="col-lg-11">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">Article Image Upload</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-lg-12 upload">
                                <form id="upload_form" enctype="multipart/form-data" method="post">

                                    <div class="col-lg-3 pad">
                                        <span class="btn btn-default btn-file btn-square btn-warning">
                                            Choose File <input type="file" name="file1" id="file1">
                                        </span>
                                        <input type="hidden" name="code" id="vouchno" value='<?php echo ($addflag != 1) ? $get['vouchno'] : "$qvouch"; ?>'>
                                        <input type="button" value="Upload File" id="uploadbtn" class="btn btn-square" style="background-color: #C0CA33; color: white">
                                    </div>
                                    <div class="col-lg-6">
                                        <div class="progress">
                                            <progress id="progressBar" class="progress-bar" role="progressbar" value="0" max="100" style="width:100%;color: red;"></progress>
                                        </div>
                                        <h3 id="status"></h3>
                                        <p id="loaded_n_total"></p>
                                    </div>
                                </form>
                            </div>
                            <div class="col-lg-10 upload">
                                <img id="preview" src="" alt="your image" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- <div class="modal fade itemModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search <? echo $formname; ?></h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" value="<?php // Echo $fseries                                                                                                  
                                                ?>" class="form-control series">
                    <input type="hidden" value="<?php echo $get['vouchno']; ?>" class="form-control vouchno">
                    <input type="hidden" value="<?php echo $file ?>" class="form-control file">
                    <input type="hidden" value="<?php echo $para ?>" class="form-control para">
                    <div class="row">
                        <div class="col-lg-3">
                            <select class="form-control ifield">
                                <option value="1">Voucher No.</option>
                                <option value="2">Invoice No.</option>
                                <option value="3">Date</option>
                                <option value="4">Party</option>
                                <option value="5">Amount</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control ioperator">
                                <option value=""></option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>
                        <div class="col-lg-4">
                            <input type="text" value="" class="form-control isearch">
                        </div>
                        <div class="col-lg-3">
                            <input type="button" class="btn btn-primary iload" value="Search">
                        </div>
                    </div>

                    <div class="col-lg-12 iloader text-center">
                        <img src="images/search.gif" alt="loading">
                    </div>
                    <div class="col-lg-12 inoRecord text-center">
                        <h3>NO RECORDS FOUND</h3>
                    </div>
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th width="8%">Itemcode</th>
                                    <th width="49%">Name</th>
                                    <th width="17%">Barcode</th>
                                    <th width="8%">Gram</th>
                                    <th width="8%">Unit</th>
                                    <th width="8%">Rate</th>
                                </tr>
                            </thead>
                            <tbody class="iTbody">
                            </tbody>
                        </table>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 text-right search-action-bar">
                            <input type="button" class="btn btn-primary iprevious" value="Previous">
                            <input type="button" class="btn btn-primary inext" value="Next">
                        </div>
                    </div>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div> -->
    <div class="modal fade searchModal bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" style="margin-top: 15%">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search <? echo $formname; ?></h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" value="<?php echo $fseries ?>" class="form-control series">
                    <input type="hidden" value="<?php echo $get['vouchno']; ?>" class="form-control vouchno">
                    <input type="hidden" value="<?php echo $file ?>" class="form-control file">
                    <input type="hidden" value="<?php echo $para ?>" class="form-control para">
                    <div class="row">
                        <div class="col-lg-2">
                            <select class="form-control sfield">
                             <option value="1">Voucher No.</option>
                                <option value="2">Invoice No.</option>
                                <option value="3">Date</option>
                                <option value="4">Party</option>
                                <option value="5">Amount</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control soperator">
                                <option value="">Type of Search</option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control sortBy">
                                <option value="">Sort By</option>
                                <option value="1">Voucher No.</option>
                                <option value="2">Invoice No.</option>
                                <option value="3">Date</option>
                                <option value="4">Party</option>
                                <option value="5">Amount</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control orderAs">
                                <option value="desc">Desc</option>
                                <option value="asc">Asc</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <input type="text" value="" class="form-control ssearch" placeholder="Search Here">
                        </div>
                        <div class="col-lg-2">
                            <input type="button" class="btn btn-primary sload" value="Search">
                        </div>
                    </div>

                    <div class="col-lg-12 sloader text-center">
                        <img src="images/search.gif" alt="loading">
                    </div>
                    <div class="col-lg-12 snoRecord text-center">
                        <h3>NO RECORDS FOUND</h3>
                    </div>
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th width="5%">Voucher No.</th>
                                    <th width="10%">Invoice No.</th>
                                    <th width="15%">Date</th>
                                    <th width="20%">Party Name</th>
                                    <th width="10%">Mobile</th>
                                    <th width="15%">Amount</th>
                                </tr>
                            </thead>
                            <tbody class="sTbody">
                            </tbody>
                        </table>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 text-right search-action-bar">
                            <input type="button" class="btn btn-primary sprev" value="Previous">
                            <input type="button" class="btn btn-primary snext" value="Next">
                        </div>
                    </div>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>