<%@ Page Title="" Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true"
    CodeBehind="ReturnStockTransfer.aspx.cs" Inherits="SUNWEB.ReturnStockTransfer" %>

<%@ Register Assembly="AjaxControlToolkit" TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.min.css">
    <link href="../assets/vendor/fonts/circular-std/style.css" rel="stylesheet">
    <link rel="stylesheet" href="../assets/libs/css/style.css">
    <link rel="stylesheet" href="../assets/vendor/fonts/fontawesome/css/fontawesome-all.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/dataTables.bootstrap4.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/buttons.bootstrap4.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/select.bootstrap4.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/fixedHeader.bootstrap4.css">
    <link type="text/css" rel="Stylesheet" href="css/style.css" />

    <%--<script type="text/javascript">
    function showProgress() 
    {
        var updateProgress = $get("<%= UpdateProgress.ClientID %>");
        updateProgress.style.display = "block";
    }
    </script>--%>
    <script type="text/javascript">
        $("[src*=plus]").live("click", function () {
            $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>")
            $(this).attr("src", "IMG/minus.gif");
        });
        $("[src*=minus]").live("click", function () {
            $(this).attr("src", "IMG/plus.gif");
            $(this).closest("tr").next().remove();
        });
    </script>
    <style type="text/css">
        body {
            font-family: Arial;
            font-size: 10pt;
        }

        .divReportCss {
            max-height: 100%;
            overflow-y: auto;
        }

        .modalBackground {
            background-color: #F7F7F7;
            filter: alpha(opacity=90);
            opacity: 0.8;
        }

        .modalPopup {
            background-color: white;
            border: 3px solid #ccc;
            padding: 10px;
            width: 40%;
            height: 55%;
        }

        .tableReportHeader {
            /*border: 1px solid black;*/
            width: 100%;
            font-size: medium;
            margin-bottom: 20px;
            margin-top: 50px;
        }

            .tableReportHeader tr td {
                width: 50%;
            }

        .tableReportDetail {
            border: 1px solid black;
            width: 100%;
            font-size: medium;
        }

            .tableReportDetail tr th {
                padding: 10px;
            }

            .tableReportDetail tr td {
                padding: 10px;
            }


        .tableheaderCss {
            margin-bottom: 20px
        }

        .trHeaderTh {
            width: 50vw;
        }

        .tabledetailCss {
            width: 100%;
            margin-bottom: 20px;
            border: thin solid black;
            margin-top: 70px;
        }

        .tabledetailtrthCss {
            /* width: 100%;*/
            margin-bottom: 20px;
            /* border: thin solid black;*/
            height: 50px;
            padding: 10px;
        }

        .tabledetaildatatrCss {
            width: 100%;
            margin-bottom: 20px;
            border: thin solid black;
            height: 50px
        }

        .tabledetaildatatdCss {
            border: thin solid black;
            padding: 10px;
            color: black;
        }


        /* The Modal (background) */
        .modal {
            display: none; /* Hidden by default */
            position: fixed; /* Stay in place */
            z-index: 1; /* Sit on top */
            left: 0;
            top: 0;
            width: 100%; /* Full width */
            height: 100%; /* Full height */
            overflow: auto; /* Enable scroll if needed */
            background-color: rgb(0,0,0); /* Fallback color */
            background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
        }

        /* Modal Content/Box */
        .modal-content {
            background-color: #fefefe;
            /*  margin: 15% auto;*/ /* 15% from the top and centered */
            padding: 20px;
            border: 1px solid #888;
            width: 80%; /* Could be more or less, depending on screen size */
            height: 100%;
        }

        /* The Close Button */
        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            text-align: right;
        }

            .close:hover,
            .close:focus {
                color: black;
                text-decoration: none;
                cursor: pointer;
            }


        .column {
            float: left;
            width: 40%;
            padding: 16px;
            height: 48px; /* Should be removed. Only for demonstration */
        }

        /* Clear floats after the columns */
        .row:after {
            content: "";
            display: table;
            clear: both;
        }
    </style>
    <script type="text/javascript">
        // for check all checkbox  
        //        function CheckAll(Checkbox) {
        //            var GridVwHeaderCheckbox = document.getElementById("<%=GrdReturnItems.ClientID %>");
        //            for (i = 1; i < GridVwHeaderCheckbox.rows.length; i++) {
        //                GridVwHeaderCheckbox.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = Checkbox.checked;
        //            }
        //        }

        function GetConfirmation() {
            var retVal = confirm("Are you sure you want to save items?");
            if (retVal == true) {

                return true;
            } else {

                return false;
            }


        }

        var btn = document.getElementById("myBtn");
        var span = document.getElementsByClassName("close")[0];

        function ShowModal() {

            var modal = document.getElementById("myModal");
            modal.style.display = "block";
        }

        function Close() {
            modal.style.display = "none";
        }

        function printDiv(divID) {
            //Get the HTML of div
            var divElements = document.getElementById(divID).innerHTML;
            //Get the HTML of whole page
            var oldPage = document.body.innerHTML;

            //Reset the page's HTML with div's HTML only
            document.body.innerHTML =
                "<html><head><title></title></head><body>" +
                divElements + "</body>";

            //Print Page
            window.print();

            //Restore orignal HTML
            document.body.innerHTML = oldPage;
        }

        function ViewModalReport() {
            //var sDB = "da1";
            //var sReturnID = "2"
            var sDB = '<%=Session["FromDB"] %>';
            var sReturnID = '<%=Session["ReturnID"] %>';
            $.ajax({
                type: "POST",
                url: "ReturnStockTransfer.aspx/GetReturnHeader",
                data: "{'DB':'" + sDB + "','ReturnID': '" + sReturnID + "'}",
                async: false,
                contentType: 'application/json;charset:utf8',
                dataType: 'json',
                error: function () {
                    alert("error")
                },
                success: function (result) {
                    var jsonItem = JSON.parse(result.d);
                    var itemCount = jsonItem.length;
                    for (var x = 0; x < itemCount; x++) {
                        //table 1
                        var ReturnNo = jsonItem[x].ReturnNo;
                        var FromBranchID = jsonItem[x].FromBranchID;
                        //table 2
                        var TransferNo = jsonItem[x].TransferNo;
                        var ReturnDate = jsonItem[x].ReturnDate;
                        //table 3
                        var ConfrimNo = jsonItem[x].ConfirmNo;
                        var ReturnStatus = jsonItem[x].ReturnFlag;
                        //table 4
                        var Notes = jsonItem[x].TNotes;
                        var EmployeeName = jsonItem[x].EmployeeName;

                        if (ReturnStatus == "1") {
                            ReturnStatus = "CONFIRMED"
                        } else {
                            ReturnStatus = "PENDING"
                        }
                        if (Notes == "") {
                            Notes = "N/A";
                        }


                        //table 1
                        var table1 = document.createElement("table");
                        table1.id = "table1a";
                        table1.className = "tableheaderCss";
                        document.getElementById("divReport").appendChild(table1);

                        var table1trheader = document.createElement("tr");
                        table1trheader.id = "table1trheader";
                        document.getElementById("table1a").appendChild(table1trheader);

                        var table1trth1 = document.createElement("th");
                        table1trth1.id = "table1trth1";
                        table1trth1.innerHTML = "Return No"
                        table1trth1.className = "trHeaderTh";
                        document.getElementById("table1trheader").appendChild(table1trth1);

                        var table1trth2 = document.createElement("th");
                        table1trth2.id = "table1trth2";
                        table1trth2.innerHTML = "From Branch"
                        table1trth2.className = "trHeaderTh";
                        document.getElementById("table1trheader").appendChild(table1trth2);

                        var table1trRow1 = document.createElement("tr");
                        table1trRow1.id = "table1trRow1";
                        document.getElementById("table1a").appendChild(table1trRow1)

                        var table1trCol1 = document.createElement("td");
                        table1trCol1.id = "tabletrCol1";
                        table1trCol1.innerHTML = ReturnNo;
                        table1trCol1.className = "trHeaderTh";
                        document.getElementById("table1trRow1").appendChild(table1trCol1);

                        var tabletrCol2 = document.createElement("td");
                        tabletrCol2.id = "tabletrCol2";
                        tabletrCol2.innerHTML = GetBranchNamebyID(sDB, FromBranchID);
                        tabletrCol2.className = "trHeaderTh";
                        document.getElementById("table1trRow1").appendChild(tabletrCol2);

                        //table 2
                        var table2 = document.createElement("table");
                        table2.id = "table2a";
                        table2.className = "tableheaderCss";
                        document.getElementById("divReport").appendChild(table2);

                        var table2trheader = document.createElement("tr");
                        table2trheader.id = "table2trheader";
                        document.getElementById("table2a").appendChild(table2trheader);

                        var table2trth1 = document.createElement("th");
                        table2trth1.id = "table2trth1";
                        table2trth1.innerHTML = "Transfer No"
                        table2trth1.className = "trHeaderTh";
                        document.getElementById("table2trheader").appendChild(table2trth1);

                        var table2trth2 = document.createElement("th");
                        table2trth2.id = "table2trth2";
                        table2trth2.innerHTML = "Return Date"
                        table2trth2.className = "trHeaderTh";
                        document.getElementById("table2trheader").appendChild(table2trth2);

                        var table2trRow1 = document.createElement("tr");
                        table2trRow1.id = "table2trRow1";
                        document.getElementById("table2a").appendChild(table2trRow1)

                        var table2trCol1 = document.createElement("td");
                        table2trCol1.id = "table2trCol1";
                        table2trCol1.innerHTML = TransferNo;
                        table2trCol1.className = "trHeaderTh";
                        document.getElementById("table2trRow1").appendChild(table2trCol1);

                        var table2trCol2 = document.createElement("td");
                        table2trCol2.id = "table2trCol2";
                        table2trCol2.innerHTML = ReturnDate.replace("T", " ");
                        table2trCol2.className = "trHeaderTh";
                        document.getElementById("table2trRow1").appendChild(table2trCol2);

                        //table 3
                        var table3 = document.createElement("table");
                        table3.id = "table3a";
                        table3.className = "tableheaderCss";
                        document.getElementById("divReport").appendChild(table3);

                        var table3trheader = document.createElement("tr");
                        table3trheader.id = "table3trheader";
                        document.getElementById("table3a").appendChild(table3trheader);

                        var table3trth1 = document.createElement("th");
                        table3trth1.id = "table3trth1";
                        table3trth1.innerHTML = "Receive No"
                        table3trth1.className = "trHeaderTh";
                        document.getElementById("table3trheader").appendChild(table3trth1);

                        var table3trth2 = document.createElement("th");
                        table3trth2.id = "table3trth2";
                        table3trth2.innerHTML = "Return Status"
                        table3trth2.className = "trHeaderTh";
                        document.getElementById("table3trheader").appendChild(table3trth2);

                        var table3trRow1 = document.createElement("tr");
                        table3trRow1.id = "table3trRow1";
                        document.getElementById("table3a").appendChild(table3trRow1)

                        var table3trCol1 = document.createElement("td");
                        table3trCol1.id = "table3trCol1";
                        table3trCol1.innerHTML = TransferNo;
                        table3trCol1.className = "trHeaderTh";
                        document.getElementById("table3trRow1").appendChild(table3trCol1);

                        var table3trCol2 = document.createElement("td");
                        table3trCol2.id = "table3trCol2";
                        table3trCol2.innerHTML = ReturnStatus;
                        table3trCol2.className = "trHeaderTh";
                        document.getElementById("table3trRow1").appendChild(table3trCol2);

                        //table 4
                        var table4 = document.createElement("table");
                        table4.id = "table4a";
                        table4.className = "tableheaderCss";
                        document.getElementById("divReport").appendChild(table4);

                        var table4trheader = document.createElement("tr");
                        table4trheader.id = "table4trheader";
                        document.getElementById("table4a").appendChild(table4trheader);

                        var table4trth1 = document.createElement("th");
                        table4trth1.id = "table4trth1";
                        table4trth1.innerHTML = "Notes"
                        table4trth1.className = "trHeaderTh";
                        document.getElementById("table4trheader").appendChild(table4trth1);

                        var table4trth2 = document.createElement("th");
                        table4trth2.id = "table3trth2";
                        table4trth2.innerHTML = "User"
                        table4trth2.className = "trHeaderTh";
                        document.getElementById("table4trheader").appendChild(table4trth2);

                        var table4trRow1 = document.createElement("tr");
                        table4trRow1.id = "table4trRow1";
                        document.getElementById("table4a").appendChild(table4trRow1)

                        var table4trCol1 = document.createElement("td");
                        table4trCol1.id = "table3trCol1";
                        table4trCol1.innerHTML = Notes;
                        table4trCol1.className = "trHeaderTh";
                        document.getElementById("table4trRow1").appendChild(table4trCol1);

                        var table4trCol2 = document.createElement("td");
                        table4trCol2.id = "table4trCol2";
                        table4trCol2.innerHTML = EmployeeName;
                        table4trCol2.className = "trHeaderTh";
                        document.getElementById("table4trRow1").appendChild(table4trCol2);

                        //table Date
                        var tableDetail = document.createElement("table");
                        tableDetail.id = "tableDetail";
                        tableDetail.className = "tabledetailCss";
                        document.getElementById("divReport").appendChild(tableDetail)

                        var tabledetailtrHeader = document.createElement("tr");
                        tabledetailtrHeader.id = "tabledetailtrHeader";
                        //tabledetailtrHeader.className = "tabledetailtrthCss";
                        document.getElementById("tableDetail").appendChild(tabledetailtrHeader);

                        var tabledetailtrth1 = document.createElement("th");
                        tabledetailtrth1.id = "tabledetailtrth1";
                        tabledetailtrth1.innerHTML = "Barcode";
                        tabledetailtrth1.className = "tabledetailtrthCss";
                        document.getElementById("tabledetailtrHeader").appendChild(tabledetailtrth1);

                        var tabledetailtrth2 = document.createElement("th");
                        tabledetailtrth2.id = "tabledetailtrth2";
                        tabledetailtrth2.innerHTML = "InventoryName";
                        tabledetailtrth2.className = "tabledetailtrthCss";
                        document.getElementById("tabledetailtrHeader").appendChild(tabledetailtrth2);

                        var tabledetailtrth3 = document.createElement("th");
                        tabledetailtrth3.id = "tabledetailtrth3";
                        tabledetailtrth3.innerHTML = "Description";
                        tabledetailtrth3.className = "tabledetailtrthCss";
                        document.getElementById("tabledetailtrHeader").appendChild(tabledetailtrth3);

                        var tabledetailtrth4 = document.createElement("th");
                        tabledetailtrth4.id = "tabledetailtrth4";
                        tabledetailtrth4.innerHTML = "Unit";
                        tabledetailtrth4.className = "tabledetailtrthCss";
                        document.getElementById("tabledetailtrHeader").appendChild(tabledetailtrth4);

                        var tabledetailtrth5 = document.createElement("th")
                        tabledetailtrth5.id = "tabledetailtrth5";
                        tabledetailtrth5.innerHTML = "Return QTY";
                        tabledetailtrth5.className = "tabledetailtrthCss";
                        document.getElementById("tabledetailtrHeader").appendChild(tabledetailtrth5);

                        $.ajax({
                            type: "POST",
                            url: "ReturnStockTransfer.aspx/GetReturnDetail",
                            data: "{'DB':'" + sDB + "','ReturnID':'" + sReturnID + "'}",
                            async: false,
                            contentType: "application/json;charset:utf8",
                            dataType: 'json',
                            error: function () {
                                alert("error");
                            },
                            success: function (result) {
                                var jsonItem = JSON.parse(result.d);
                                var itemCount = jsonItem.length;
                                for (var x = 0; x < itemCount; x++) {
                                    var Barcode = jsonItem[x].Barcode;
                                    var InventoryName = jsonItem[x].Inventoryname;
                                    var Description = jsonItem[x].Description;
                                    var Unit = jsonItem[x].Unit;
                                    var ReturnQuantity = jsonItem[x].ReturnQuantity;

                                    var tabledetaildatatr = document.createElement("tr");
                                    tabledetaildatatr.id = "tabledetaildatatr" + x;
                                    tabledetaildatatr.className = "tabledetaildatatrCss";
                                    document.getElementById("tableDetail").appendChild(tabledetaildatatr);

                                    var tabledetaildatatd1 = document.createElement("td");
                                    tabledetaildatatd1.id = "tabledetaildatatd1" + x;
                                    tabledetaildatatd1.innerHTML = Barcode;
                                    tabledetaildatatd1.className = "tabledetaildatatdCss";
                                    document.getElementById("tabledetaildatatr" + x).appendChild(tabledetaildatatd1);

                                    var tabledetaildatatd2 = document.createElement("td");
                                    tabledetaildatatd2.id = "tabledetaildatatd2" + x;
                                    tabledetaildatatd2.innerHTML = InventoryName;
                                    tabledetaildatatd2.className = "tabledetaildatatdCss";
                                    document.getElementById("tabledetaildatatr" + x).appendChild(tabledetaildatatd2);

                                    var tabledetaildatatd3 = document.createElement("td");
                                    tabledetaildatatd3.id = "tabledetaildatatd3" + x;
                                    tabledetaildatatd3.innerHTML = Description;
                                    tabledetaildatatd3.className = "tabledetaildatatdCss";
                                    document.getElementById("tabledetaildatatr" + x).appendChild(tabledetaildatatd3);

                                    var tabledetaildatatd4 = document.createElement("td");
                                    tabledetaildatatd4.id = "tabledetaildatatd4" + x;
                                    tabledetaildatatd4.innerHTML = Unit;
                                    tabledetaildatatd4.className = "tabledetaildatatdCss";
                                    document.getElementById("tabledetaildatatr" + x).appendChild(tabledetaildatatd4);

                                    var tabledetaildatatd5 = document.createElement("td");
                                    tabledetaildatatd5.id = "tabledetaildatatd5" + x;
                                    tabledetaildatatd5.innerHTML = ReturnQuantity;
                                    tabledetaildatatd5.className = "tabledetaildatatdCss";
                                    document.getElementById("tabledetaildatatr" + x).appendChild(tabledetaildatatd5);
                                }
                            }
                        });

                    }
                }

            });

            ShowModal();
        }

        function CheckBoxValidation() {
            var valid = false;
            //Varibale to hold the checked checkbox count
            var chkselectcount = 0;
            //Get the gridview object
            var gridview = document.getElementById('<%= GrdReturnItems.ClientID %>');
            //Loop thorugh items
            for (var i = 0; i < gridview.getElementsByTagName("input").length; i++) {
                //Get the object of input type
                var node = gridview.getElementsByTagName("input")[i];
                //check if object is of type checkbox and checked or not
                if (node != null && node.type == "checkbox" && node.checked) {
                    valid = true;
                    //Increase the count of check box
                    chkselectcount = chkselectcount + 1;
                }
            }

            //Checking the count is zero , this means no checkbox is selected
            if (chkselectcount == 0) {
                alert("Please select atleast one checkbox");
                return false;
            }
            else {
                GetConfirmation();
            }
        }

        function GetBranchNamebyID(DB, BranchID) {
            var RetValue;
            $.ajax({
                type: "POST",
                url: "AddTransferStock.aspx/GetBranchFullName",
                data: "{'DB':'" + DB + "','BranchID':'" + BranchID + "'}",
                async: false,
                contentType: 'application/json;charset=utf8',
                dataType: 'json',
                error: function (XMLHttpRequest, textStatus, errorThrown) {

                },
                success: function (result) {

                    var jsonItem = JSON.parse(result.d);
                    var itemCount = jsonItem.length;
                    for (var x = 0; x < itemCount; x++) {
                        var BranchFullName = jsonItem[x].BranchFullName;
                        RetValue = BranchFullName;
                    }
                }

            });

            return RetValue;
        }
    </script>
    <script type="text/javascript">

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate>

            <div class="section-block">
                <h5 class="section-title"></h5>
            </div>
            <div align="right" style="display: none;">
                Branch Name
                    <%--                    <asp:DropDownList ID="cmbBranches" CssClass="custom-select" Width="250px" runat="server"
                        AutoPostBack="true" Visible="false">
                    </asp:DropDownList>--%>
                <%--                      <asp:Label ID="cmbBranches" CssClass="custom-select" Width="250px" runat="server"
                        AutoPostBack="true" Visible="false">
                    </asp:Label>--%>
                <asp:Label ID="cmbBranches" CssClass="custom-select" Width="250px" runat="server"
                    autopostback="true">
                </asp:Label>
                <asp:Label ID="lblBranchAliasName" CssClass="custom-select" Width="250px" runat="server"
                    autopostback="true" Visible="false">
                </asp:Label>
                <asp:Label ID="Label2" ForeColor="Blue" runat="server"></asp:Label>
            </div>
            <div class="tab-pane fade show active d-none" id="profile-simple" role="tabpanel" aria-labelledby="profile-tab-simple">
                <div class="card">
                    <h5 class="card-header">RETRURN TRANSFER</h5>
                    <div class="card-body">
                        <div class="form-row">
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustom03">
                                    Retrun No.</label>
                                <asp:TextBox ID="txtReturnNo" runat="server" placeholder="" Enabled="False" class="form-control"></asp:TextBox>
                                <div class="invalid-feedback">
                                </div>
                            </div>
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustomer03">
                                    From Branch</label>
                                <asp:TextBox ID="txtFBranch" runat="server" placeholder="" Enabled="False" class="form-control"></asp:TextBox>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustom03">
                                    Transfer No</label>
                                <asp:TextBox ID="txtRefNo" runat="server" placeholder="" Enabled="False" class="form-control"></asp:TextBox>
                                <div class="invalid-feedback">
                                </div>
                            </div>
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustomer03">
                                    Return Date</label>
                                <asp:TextBox ID="txtRetrunDate" runat="server" placeholder="" Enabled="False" class="form-control"></asp:TextBox>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustom03">
                                    Receive No</label>
                                <asp:TextBox ID="txtConfirm" runat="server" placeholder="" Enabled="False" class="form-control"></asp:TextBox>
                                <div class="invalid-feedback">
                                </div>
                            </div>
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustomer03">
                                    Return Status</label>
                                <asp:TextBox ID="txtReturnStatus" runat="server" placeholder="" Enabled="False" class="form-control"></asp:TextBox>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                <label for="validationCustomer03">
                                    NOTES</label>
                                <asp:TextBox ID="txtNotes" runat="server" placeholder="" Enabled="False" class="form-control"
                                    TextMode="MultiLine"></asp:TextBox>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <div>
                                <asp:GridView ID="GrdReturnItems" EmptyDataText="No Record found" runat="server"
                                    CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" Height="68px"
                                    Width="100%" ShowHeaderWhenEmpty="true">
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Barcode">
                                            <ItemTemplate>
                                                <asp:Label ID="lblBarcode" runat="server" Text='<%#Eval("Barcode") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Inventory Name">
                                            <ItemTemplate>
                                                <asp:Label ID="lblInvName" runat="server" Text='<%#Eval("InventoryName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Description">
                                            <ItemTemplate>
                                                <asp:Label ID="lblDesc" runat="server" Text='<%#Eval("Description") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Unit">
                                            <ItemTemplate>
                                                <asp:Label ID="lblUnit" runat="server" Text='<%#Eval("Unit") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Pack Price">
                                            <ItemTemplate>
                                                <asp:Label ID="lblPackPrice" runat="server" Text='0.00'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Return Quantity">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtReturnQTY" runat="server" CssClass="textbox" MaxLength="4" Enabled="false"
                                                    Width="80px" Text='<%#Eval("ReturnQuantity") %>'></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--  <asp:TemplateField HeaderText="Accept QTY">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtAcceptQTY" runat="server" CssClass="textbox" MaxLength="4" Width="80px"
                                                    Text='<%#Eval("Accept") %>'></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Rejected QTY">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtRejectedQTY" runat="server" CssClass="textbox" MaxLength="4"
                                                    Width="80px" Text='<%#Eval("Rejected") %>'></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>--%>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                        <br />
                        <%--   <div class="form-row" align="right">--%>
                        <%--<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">--%>
                        <div class="row" align="right" style="width: 100%">
                            <div class="column" align="left" style="width: 50%; padding: 4px; padding-left: 16px;">
                                <asp:Button ID="btnConfirmReturn" runat="server" Width="150px" Height="40px" Text="Confirm"
                                    CssClass="btn btn-primary" OnClick="btnConfirmReturn_Click" Visible="false" />
                                <button type="button" class="btn btn-space btn-primary" style="background-color: black; color: white;" onclick="ViewModalReport();">Preview Report</button>
                            </div>
                            <div class="column" align="right" style="width: 50%; padding: 4px;">
                            </div>
                        </div>
                        <%-- </div>--%>
                        <%--</div>--%>
                    </div>
                </div>
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>
    <%--    <div class="form-group">--%>
    <div class="card d-none">
        <div class="card-body">
            <div class="table-responsive">
                <div id="myModal" class="modal">
                    <div class="modal-content">
                        <button id="btnClose" class="close" onclick="Close()">&times;</button>
                        <div id="divReport" class="divReportCss">
                            <div style="text-align: center; font-size: 32px; margin-bottom: 20px;">
                                RETURN STOCK
                            </div>
                        </div>
                        <input type="button" style="height: 100px; margin-top: 20px; font-size: 18px" value="Print" onclick="printDiv('divReport')" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <%--</div>--%>

    <div class="container-fluid bg-white p-2">
        <div class="pt-2">
            <h3>Return Stock</h3>
        </div>
        <hr>
        <div>
            <div class="row pb-2">
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">Return no.</label>
                    <input type="text" id="input-returnnumber" class="form-control" placeholder="" readonly="">
                </div>
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">Transfer no</label>
                    <input type="text" id="input-transfernumber" class="form-control" placeholder="" readonly="">
                </div>
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">Confirm no.</label>
                    <input type="text" id="input-confirmnumber" class="form-control" placeholder="N/A" readonly="">
                </div>
            </div>

            <div class="row pb-2">
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">Branch from</label>
                    <input type="text" id="input-branchfrom" class="form-control text-capitalize" placeholder="" readonly="">
                </div>
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">Return date</label>
                    <input type="text" id="input-returndate" class="form-control" placeholder="N/A" readonly="">
                </div>
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">Return status</label>
                    <input type="text" id="input-returnstatus" class="form-control" placeholder="N/A" readonly="">
                </div>
            </div>

            <div class="row pb-2">
                <div class="col-sm-5 col-md-4">
                    
                        <label class="form-label">Branch to</label>
                        <input type="text" id="input-branchto" class="form-control text-capitalize" placeholder="" readonly="">
                  
                    
                </div>
                <div class="col-sm-5 col-md-4 d-none">
                    <label class="form-label">Send Status</label>
                    <input type="text" id="input-send-status" class="form-control" placeholder="N/A" readonly="">
                </div>
                <div class="col-sm-5 col-md-4">
                    <label class="form-label">User</label>
                    <input type="text" id="input-user" class="form-control" placeholder="N/A" readonly="">
                </div>
            </div>         
        </div>
        <hr>
        <div class="container-fluid p-0" style="overflow-x: auto">
            <table id="tbl-items" class="table table table-bordered">
                <thead>
                    <tr>
                        <th scope="col" class="text-nowrap">#</th>
                        <th scope="col" class="text-nowrap">ID</th>
                        <th scope="col" class="text-nowrap">Barcode</th>
                        <th scope="col" class="text-nowrap">Name</th>
                        <th scope="col" class="text-nowrap">Description</th>
                        <th scope="col" class="text-nowrap">Unit</th>
                        <th scope="col" class="text-nowrap">Batch #</th>
                        <th scope="col" class="text-nowrap">Cost</th>                       
                        <th scope="col" class="text-nowrap">Return qty</th>
                    </tr>
                </thead>
                <tbody id="table-body-return-item"><tr style="pointer-events: none;">
                    
                    </tbody>
            </table>
        </div>
      <%--  <div class="pt-2 text-right">            
            <button type="button" id="btn-confirm" class="btn btn-success btn-sm" disabled="disabled">Confirm</button>            
        </div>--%>
    </div>
    <script src="sunScript/returnstocktransfer.js"></script>
</asp:Content>
