<%@ Page Title="" Language="C#" MasterPageFile="~/CTWOrder/Site1.Master" AutoEventWireup="true" CodeBehind="AbroadReceiveList.aspx.cs" Inherits="GxHub.Wms.Abroad.Web.CTWOrder.AbroadReceiveList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>收货列表</title>

    <script language="javascript">
        //使用checkbox当做全选反选
        function check_all_not() {
            var check = document.getElementById("checkboxAll").checked;
            //alert(check);
            if (check == true) {
                checkAll();
            }
            else {
                checkReverse();
            }
            CheckCount();
        }

        //选择
        function checkAll() {
            $(".cb ").each(function () {
                $(this).attr("checked", true);
            });
        }
        //反选
        function checkReverse() {
            $(".cb ").each(function () {
                $(this).attr("checked", !($(this).attr("checked")));
            });
        }
        function checkRemove() {
            $(".cb ").each(function () {
                $(this).attr("checked", false);
            });
        }
        function CheckCount() {

            var num = 0;
            $(".cb").each(function () {
                if ($(this).is(":checked") == true) {
                    num = num + 1;
                }

            })
            $("#litSureCount").text(num);

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <yee:MessageBox ID="msg" runat="server">
    </yee:MessageBox>

    <yee:PageTitle ID="pgTitle" runat="server">
        <ShortCuts>
            <a href="AbroadBatchConfirmReceive.aspx">扫描集包流水确认收货</a>
            <a href="AbroadConfirmReceived.aspx">确认收货</a>
            <a href="../Box/StockOutCollectDetailList.aspx">集包箱子确认</a>
        </ShortCuts>
    </yee:PageTitle>

    <div class="query">
        <table cellpadding="0" cellspacing="0" border="0">

            <tr>

                <td>
                    <%=GetText("收货日期") %>
                </td>
                <td>
                    <yee:DatePicker ID="dpFrom" runat="server" IsRequired="false" />
                    -
                    <yee:DatePicker ID="dpTo" runat="server" IsRequired="false" />
                </td>

                <td>
                    <%=GetText("运输方式") %>
                </td>
                <td colspan="3">
                    <asp:RadioButtonList ID="rblFreightType" runat="server" RepeatDirection="Horizontal"></asp:RadioButtonList>
                </td>
                <td>
                    <%=GetText("国际单号") %>
                </td>
                <td>
                    <asp:TextBox ID="txtOrderNo" runat="server" ClientIDMode="Static" Width="80px"></asp:TextBox>
                </td>
                <td>
                    <%=GetText("集包流水") %>
                </td>
                <td>
                    <asp:TextBox ID="txtCollectSerialNo" runat="server" ClientIDMode="Static" Width="80px"></asp:TextBox>
                </td>

                <td>
                    <asp:Button ID="btnSearch" runat="server" CssClass="button" OnClick="btnSearch_Click" />
                     
                </td>
            </tr>
            <tr>
                <td>
                    <%=GetText("支付日期") %>
                </td>
                <td>
                    <yee:DatePicker ID="dtPayFrom" runat="server" IsRequired="false" />
                    -
                    <yee:DatePicker ID="dtPayTo" runat="server" IsRequired="false" />
                </td>
                <td>
                    <%=GetText("仓储中心") %>
                </td>
                <td>
                    <yee:UserWarehousesDropDownList ID="ddlWarehouse" runat="server" WarehouseType="海外总仓"></yee:UserWarehousesDropDownList>
                </td>
                <td>
                    <%=GetText("分页") %>
                </td>
                <td>
                    <asp:TextBox ID="txtPage" runat="server"></asp:TextBox>
                </td>
                <td>
                    <%=GetText("是否付款") %>
                </td>
                <td>
                    <asp:RadioButtonList ID="rblIsPay" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblIsPay_SelectedIndexChanged" AutoPostBack="true">
                        <asp:ListItem Text="全部" Value="0" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="已付款" Value="1"></asp:ListItem>
                        <asp:ListItem Text="未付款" Value="2"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
             <td colspan="2">
                
                 <asp:Button ID="btnUnPayRecord" runat="server" CssClass="button" OnClick="btnUnPayRecord_Click"  TEXT="未付款收货记录" />
             </td>
            </tr>
            <tr>
                <td>
                    <%=GetText("公司") %>
                </td>
                <td colspan="8">
                    <asp:RadioButtonList ID="rblCompany" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblCompany_SelectedIndexChanged" AutoPostBack="true"></asp:RadioButtonList>
                </td>
            </tr>
        </table>
    </div>
    <div id="div_2">
        <asp:Button runat="server" ID="btnMerge" OnClick="btnMerge_Click" Text="合并记录" CssClass="button" />
        当前选中笔数：<asp:Label ID="litSureCount" runat="server" ClientIDMode="Static" Font-Size="XX-Large"></asp:Label>
        <asp:Button runat="server" ID="btnPay" OnClick="btnPay_Click" Text="合并付款" CssClass="button" Visible="false" />
        <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand" OnItemDataBound="rptList_ItemDataBound">
            <HeaderTemplate>
                <table cellpadding="0" cellspacing="0" border="0" class="table" id="r ">
                    <tr>
                        <td class="tbheader" width="30px" 
                            <input type="checkbox" id="checkboxAll" class="checkboxAll" onclick="check_all_not()" /></td>
                        <td class="tbheader" width="30px" >
                            <%=GetText("序号") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("签收日期") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("重量")%>(KG)
                        </td>
                        <td class="tbheader">
                            <%=GetText("体积") %>(m³)
                        </td>
                        <td class="tbheader" >
                            <%=GetText("集包数") %>
                        </td>
                        <td class="tbheader"  style="width:80px">
                            <%=GetText("单据")%>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("计费重量")%>
                        </td>
                        <td class="tbheader">
                            <%=GetText("应付款")%>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("物流公司") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("国际单号") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("国际运费") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("单价") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("币种") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("付款时间") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("费用录入人") %>
                        </td>
                        <td class="tbheader" >
                            <%=GetText("操作") %>
                        </td> 
                     
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tbrow" style="text-align: center">
                    <td class="tbpost">
                        <input type="checkbox" runat="server" id="cb" value='<%#Eval("RecordId")%>' class="cb" onclick="CheckCount()" />
                    </td>
                    <td class="tbpost">
                        <%# Eval("RowSeqNo")%>
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litSignInOn" runat="server"></asp:Literal>
                    </td>

                    <td class="tbpost">
                        <%# Eval("TotalWeight")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("TotalVoume")%>
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litCollectCount" runat="server"></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%# Eval("ComTotalWeight")%> KG <br />
                    
                        <%# Eval("ComTotalVolume")%> m³
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litCalWeight" runat="server" Text='<%# Eval("CalWeight")%>'></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litCalAmount" runat="server" Text='<%# Eval("CalAmount")%>'></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Company")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("AbroadOrderNo")%>
                    </td>
                    <td class="tbpost">

                        <asp:Literal ID="litTotalAmount" runat="server" Text='<%# Eval("TotalAmount")%>'></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Price")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("CurrencyCode")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("PayFreightOn","{0:d}")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("PayFreightByName")%>
                    </td>
                    <td class="tbpost">
                        <asp:LinkButton ID="lbnTotal" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="收货统计"
                            CommandName="total"></asp:LinkButton>
                        <asp:LinkButton ID="lbnDetail" runat="server" CommandArgument='<%#Eval("RecordId")%>' CommandName="detail"></asp:LinkButton>
                        <asp:LinkButton ID="lbnSet" runat="server" CommandArgument='<%#Eval("RecordId")%>'
                            CommandName="set"></asp:LinkButton>
                        <br />
                        <asp:LinkButton ID="lbnRelease" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="释放重新确认"
                            CommandName="release"></asp:LinkButton>
            <%--            <a href="AbroadReceiveAgentCollectDetails.aspx?uniqueId=<%#Eval("RecordId")%>" style="color: green"><%=GetText("代理中转集包")%></a>--%>
                        <asp:LinkButton ID="lbnUnSign" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="未签收箱子"
                            CommandName="unSign"></asp:LinkButton>
                        <asp:LinkButton ID="lbnDetailsSort" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="收货明细分类统计"
                            CommandName="detailsSort"></asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="tbrowalter" style="text-align: center">
                    <td class="tbpost">
                        <input type="checkbox" runat="server" id="cb" value='<%#Eval("RecordId")%>' class="cb" onclick="CheckCount()" />
                    </td>
                    <td class="tbpost">
                        <%# Eval("RowSeqNo")%>
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litSignInOn" runat="server"></asp:Literal>
                    </td>

                    <td class="tbpost">
                        <%# Eval("TotalWeight")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("TotalVoume")%>
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litCollectCount" runat="server"></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%# Eval("ComTotalWeight")%> KG <br />
                    
                        <%# Eval("ComTotalVolume")%> m³
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litCalWeight" runat="server" Text='<%# Eval("CalWeight")%>'></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <asp:Literal ID="litCalAmount" runat="server" Text='<%# Eval("CalAmount")%>'></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Company")%>
                    </td>
                   <td class="tbpost">
                        <%# Eval("AbroadOrderNo")%>
                    </td>
                    <td class="tbpost">

                        <asp:Literal ID="litTotalAmount" runat="server" Text='<%# Eval("TotalAmount")%>'></asp:Literal>
                    </td>
                    <td class="tbpost">
                        <%# Eval("Price")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("CurrencyCode")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("PayFreightOn","{0:d}")%>
                    </td>
                    <td class="tbpost">
                        <%# Eval("PayFreightByName")%>
                    </td>
                    <td class="tbpost">
                        <asp:LinkButton ID="lbnTotal" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="收货统计"
                            CommandName="total"></asp:LinkButton>
                        <asp:LinkButton ID="lbnDetail" runat="server" CommandArgument='<%#Eval("RecordId")%>' CommandName="detail"></asp:LinkButton>
                        <asp:LinkButton ID="lbnSet" runat="server" CommandArgument='<%#Eval("RecordId")%>'
                            CommandName="set"></asp:LinkButton> <br />
                        <asp:LinkButton ID="lbnRelease" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="释放重新确认"
                            CommandName="release"></asp:LinkButton>
                     <%--   <a href="AbroadReceiveAgentCollectDetails.aspx?uniqueId=<%#Eval("RecordId")%>" style="color: green"><%=GetText("代理中转集包")%></a>--%>
                        <asp:LinkButton ID="lbnUnSign" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="未签收箱子"
                            CommandName="unSign"></asp:LinkButton>
                        <asp:LinkButton ID="lbnDetailsSort" runat="server" CommandArgument='<%#Eval("RecordId")%>' Text="收货明细分类统计"
                            CommandName="detailsSort"></asp:LinkButton>
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <FooterTemplate>
            </FooterTemplate>
        </asp:Repeater>
        <table>
            <tr class="tbrow" align="right">
                <td align="right" colspan="9"></td>

                <td class="tbpost" align="right">
                    <%=GetText("国际运费") %>
                </td>

                <td class="tbpost" colspan="4"></td>
            </tr>
            <tr class="tbrow" align="right">
                <td align="right" colspan="9">
                    <%=GetText("当前页总额") %>:
                </td>

                <td class="tbpost" align="right">
                    <asp:Literal ID="ltTotalCredit" Text="0.00" runat="server"></asp:Literal>
                </td>

                <td class="tbpost" colspan="4"></td>
            </tr>

            <tr class="tbrow" align="right">
                <td align="right" colspan="9">
                    <%=GetText("全部总额") %>:
                </td>

                <td class="tbpost" align="right">
                    <asp:Literal ID="litHJCredit" Text="0.00" runat="server"></asp:Literal>
                </td>

                <td class="tbpost" colspan="4"></td>
            </tr>
        </table>
    </div>

    <yee:Pager ID="Pager1" runat="server" PageSize="20" PagerType="1" OnPageIndex_Changed="Pager1_PageIndex_Changed"
        PageIndex="0" />
</asp:Content>