<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostSellBill.aspx.cs" Inherits="MTCUN.Mobile.Finance.PostSellBill"
    Title="增加消费单-财务" %>

<%@ Register Src="../../UserCol/Remark.ascx" TagName="Remark" TagPrefix="uc1" %>
<%@ Register Src="../../UserCol/SimpleCode.ascx" TagName="SimpleCode" TagPrefix="uc1" %>
<%@ Register Src="../../UserCol/Ann.ascx" TagName="Ann" TagPrefix="uc2" %>
<%@ Register Src="../User_Col/col_Header.ascx" TagName="col_Header" TagPrefix="uc3" %>
<%@ Register Src="../User_Col/col_StuControlPanel.ascx" TagName="col_StuControlPanel" TagPrefix="uc4" %>
<%@ Register src="../../UserCol/ReportServer.ascx" tagname="ReportServer" tagprefix="uc5" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link id="mobileCss" runat="server" href="../themes/mobile.css" rel="stylesheet"
        type="text/css" />

    <script type="text/javascript"> 
<!--

    function Focus() {
        if (!document.getElementById("tbxBarcode").disabled) {
            document.getElementById("tbxBarcode").focus();
        }
    }

    //--> 
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <uc3:col_Header ID="col_Header1" runat="server" />
        <uc5:ReportServer ID="ReportServer1" runat="server" />
        <div id="web_page_contents">
            <div class="search biao_zhun_suo_jin">
                
                <uc4:col_StuControlPanel ID="col_StuControlPanel1" runat="server" />
                <uc2:Ann ID="Ann1" runat="server" />

                <div class="kuai_show">
                    <table class="table_simple_kuan">
                        <tr>
                            <th colspan="2">
                                <h1>收费明细单</h1>
                            </th>
                        </tr>
                        <tr>
                            <td style="width: 70px">学号：
                            </td>
                            <td>
                                <asp:Label ID="labStudentID" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>姓名：
                            </td>
                            <td>
                                <asp:Label ID="labStudentName" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr class="required">
                            <td>单号：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxBillID" runat="server" Width="184px" Enabled="False"></asp:TextBox>
                            </td>
                        </tr>
                        <tr class="required">
                            <td>日期：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxDateAndTime" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>收费明细：
                            </td>
                            <td>
                                <div class="striking">
                                    <table class="table_simple_kuan">
                                        <tr style="display:none">
                                            <td style="width: 60px">条形码：</td>
                                            <td>
                                                <asp:TextBox ID="tbxBarcode" runat="server" Width="90px"></asp:TextBox></td>
                                        </tr>
                                        <tr>
                                            <td style="width: 60px">分类：</td>
                                            <td>
                                                <div class="inline_block">
                                                    <asp:DropDownList ID="ddlProductType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProductType_SelectedIndexChanged">
                                                        <asp:ListItem Value="0$0">请选择</asp:ListItem>
                                                        <asp:ListItem Value="1$0">课程</asp:ListItem>
                                                        <asp:ListItem Value="2$0">收费项</asp:ListItem>
                                                        <asp:ListItem Value="8$0">商品</asp:ListItem>
                                                    </asp:DropDownList>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>项目：</td>
                                            <td>

                                                <div class="inline_block">
                                                    <asp:DropDownList ID="ddlProduct" runat="server" DataTextField="ProductName" DataValueField="ProductID"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ddlProduct_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                                <div class="inline_block">
                                                    <uc1:SimpleCode ID="SimpleCode1" runat="server" UsersControlID="ddlProduct" CodeType="Course"
                                                        Visible="False" />
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>数量：</td>
                                            <td>
                                                <div class="inline_block">
                                                    <asp:TextBox ID="tbxAmount" runat="server" Width="51px" AutoPostBack="True" OnTextChanged="tbxAmount_TextChanged"></asp:TextBox>
                                                    <asp:Label ID="labUnitName" runat="server"></asp:Label>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>单价：</td>
                                            <td>
                                                <asp:TextBox ID="tbxUnitPrice" runat="server" Width="65px"></asp:TextBox></td>
                                        </tr>
                                        <tr runat="server" id="trSto">
                                            <td>仓库：</td>
                                            <td>
                                                <asp:DropDownList ID="ddlStoreroom" runat="server"
                                                    DataTextField="StoreroomName" DataValueField="StoreroomID">
                                                </asp:DropDownList></td>
                                        </tr>
                                    </table>
                                    <label class="lab_button btn_width">
                                        <asp:Button ID="btnAddItem" runat="server" Text="增加项目" OnClick="btnAddItem_Click" />
                                    </label>
                                    <br />
                                    <asp:Repeater ID="repBlock" runat="server" OnItemCommand="repBlock_ItemCommand"
                                        OnItemDataBound="repBlock_ItemDataBound">
                                        <ItemTemplate>

                                            <asp:Panel ID="plItem" runat="server" CssClass="kuai">

                                                <h1>
                                                    <%# Eval("ProductName") %></h1>
                                                单价:<%# Eval("UnitPrice","{0:c2}") %>
                                                <br />
                                                数量:<%# Eval("Amount") %><%# Eval("UnitName") %>
                                                <br />
                                                优惠:<%# Eval("Favorable","{0:c2}") %>
                                                <br />
                                                小计:<%# Eval("TotalPrice","{0:c2}") %>
                                                <br />
                                                仓库:<%# Eval("StoreroomName") %>

                                                <table class="table_simple_kuan">
                                                    <tr>
                                                        <td>
                                                            <div class="lab_button">
                                                                <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete"></asp:LinkButton>
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div class="lab_button">
                                                                <asp:LinkButton ID="lbnEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="编辑"></asp:LinkButton>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>

                                            </asp:Panel>
                                            <asp:Panel ID="plEdit" runat="server" CssClass="kuai edit_kuai">
                                                <h1>
                                                    <%# Eval("ProductName") %></h1>
                                                <br />
                                                单价:<asp:TextBox ID="tbxUnitPrice" runat="server" Text='<%# Eval("UnitPrice","{0:f2}") %>'
                                                    Width="60"></asp:TextBox><br />
                                                数量:<asp:TextBox ID="tbxAmount" runat="server" Text='<%# Eval("Amount") %>' Width="60"></asp:TextBox><asp:Label ID="Label2" runat="server" Text='<%# Eval("UnitName") %>'></asp:Label><br />
                                                优惠:<asp:TextBox ID="tbxFavorable" runat="server" Text='<%# Eval("Favorable","{0:f2}") %>'
                                                    Width="60"></asp:TextBox><br />
                                                小计:<%# Eval("TotalPrice","{0:c2}") %><br />
                                                仓库:<%# Eval("StoreroomName") %>

                                                <table class="table_simple_kuan">
                                                    <tr>
                                                        <td>
                                                            <div class="lab_button">
                                                                <asp:LinkButton ID="lbnUpdate" runat="server" CausesValidation="True" CommandName="Update" Text="更新"></asp:LinkButton>
                                                            </div>
                                                        </td>
                                                        <td>
                                                            <div class="lab_button">
                                                                <asp:LinkButton ID="lbnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消"></asp:LinkButton>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>

                                            </asp:Panel>

                                        </ItemTemplate>
                                    </asp:Repeater>

                                </div>

                            </td>
                        </tr>

                        <tr>
                            <td>总价：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxTotalPay" runat="server" Enabled="False"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">优惠：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxFavourable" runat="server" OnTextChanged="tbxFavourable_TextChanged"
                                    AutoPostBack="True">0</asp:TextBox>
                                <br />
                                <div class="inline_block">折扣：</div>
                                <div class="inline_block" style="width: 80px">
                                    <asp:DropDownList ID="ddlDiscount" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDiscount_SelectedIndexChanged">
                                        <asp:ListItem Value="10" Text=""></asp:ListItem>
                                        <asp:ListItem>9</asp:ListItem>
                                        <asp:ListItem>8</asp:ListItem>
                                        <asp:ListItem>7</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>0</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="inline_block">.</div>
                                <div class="inline_block" style="width: 80px">
                                    <asp:DropDownList ID="ddlDiscountDecimal" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlDiscount_SelectedIndexChanged">
                                        <asp:ListItem Value="0"> </asp:ListItem>
                                        <asp:ListItem Text="">1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                        <asp:ListItem>7</asp:ListItem>
                                        <asp:ListItem>8</asp:ListItem>
                                        <asp:ListItem>9</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">金额：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxPayed" runat="server" ReadOnly="True" Enabled="False"></asp:TextBox>
                                <span runat="server" id="spanAcc" visible="false"><span style="color: Red">*</span>
                                    帐户金额不足：需充入<asp:Label ID="labMissing" runat="server" ForeColor="Red" Text=""></asp:Label>元
                        您想即充即扣？<asp:CheckBox ID="cbxInstant" runat="server" Text="是" />
                                    &nbsp;<div class="inline_block">支付方式：</div>
                                    <div class="inline_block">
                                        <asp:DropDownList ID="ddlPayMethod" runat="server" DataTextField="PayMethodName" DataValueField="PayMethodName">
                                        </asp:DropDownList>
                                    </div>
                                </span>
                                <asp:Label ID="labArrearsTip" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>备注：
                            </td>
                            <td>
                                <asp:TextBox ID="tbxRemark" runat="server" Height="53px" TextMode="MultiLine"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>短信通知：
                            </td>
                            <td>
                                <asp:CheckBox ID="cbxSMS" runat="server" Checked="True" />
                            </td>
                        </tr>
                        <tr class="required">
                            <td>办理点：
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlPostSchool" runat="server" DataTextField="SchoolName" DataValueField="SchoolID">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr class="required">
                            <td>录入员：
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlUser" runat="server" DataTextField="TrueName" DataValueField="UserID">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;
                            </td>
                            <td>

                                <asp:HyperLink ID="hlkPayment" runat="server" NavigateUrl="StuPayment.aspx" Target="_blank">账户充值</asp:HyperLink>
                            </td>
                        </tr>
                    </table>


                </div>


                <label class="lab_button_kuan">
                    <asp:Button ID="btnPost" runat="server" Text="确定结账" OnClick="btnPost_Click" />
                </label>
                <label class="lab_button_kuan" id="__mt_labBack" runat="server">
                    <input causesvalidation="false" type="button" runat="server" onclick="back(this)" value="返回" />
                </label>

                <div class="divremark">
                    <b>注意事项：</b><br />
                    1、“即充即扣”，即不用人工去充值，直接在这里收费，系统自动在充值面板增加一条记录。使用“即充即扣”时按需充入金额收费。欠费学员不能使用此功能。<br />
                    2、优惠请使用负数。
                </div>
            </div>
        </div>
    </form>
</body>
</html>
