<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="master_dayreport.aspx.cs" Inherits="VA.Modules.JDingMember.consume.master_dayreport" %>

<!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>
    <title></title>
    <!--#include virtual="/include/css/edit.aspx"-->
    <link href="/uicontrols/jtongui/themes/<% = webSiteConfig.ThemeName %>/tabs.css" type="text/css" rel="Stylesheet" />
    <link href="/uicontrols/amcharts_v3.18.3/plugins/export/export.css" rel="stylesheet" type="text/css" />

    <!--#include virtual="/include/js/edit.aspx"-->
    <script type="text/javascript" src="/scripts/utils/dateutil.js"></script>    
    <script type="text/javascript" src="/uicontrols/jtongui/plugins/jtong.tabs.js"></script>
    <script type="text/javascript" src="/scripts/utils/dateutil.js"></script>        
    <script src="/uicontrols/amcharts_v3.18.3/amcharts.js" type="text/javascript"></script>
    <script src="/uicontrols/amcharts_v3.18.3/serial.js" type="text/javascript"></script>    
    <script src="/uicontrols/amcharts_v3.18.3/pie.js" type="text/javascript"></script>    
    <script src="/uicontrols/amcharts_v3.18.3/themes/light.js" type="text/javascript"></script>
    <script src="/uicontrols/amcharts_v3.18.3/plugins/export/export.js" type="text/javascript"></script> 
  
    <script type="text/javascript">
        function stat() {

            var shopCode = $("#hfShopCode").val();;
            var beginDate = $("#txtBeginDate").val();
            var endDate = $("#txtEndDate").val();

            if ($.trim(beginDate) == "") {
                JTongAlert("提示", "起始日期不能为空！", "warning");
                return;
            }

            openDivWindow("", 300, 100, 220, 180, "divProgressNote");

            $.ajax({
                type: "GET",
                url: "master_dayreport_getstatdata.aspx",
                dataType: "html",
                data: { "shopcode" : shopCode, "begindate":beginDate, "enddate" : endDate },
                success: function (data, textStatus) {
                    if (data != "error") {

                        closeWindow("divProgressNote");

                        var dayAccountInfo = JSON.parse(data);
                        
                        $("#span_hyzhye_total").html(dayAccountInfo.hyzhyehj);

                        $("#span_blhysl").html(dayAccountInfo.blhysl);
                        
                        $("#span_cztotal").html(dayAccountInfo.czhj);
                        $("#span_xftotal").html(dayAccountInfo.xfhj);
                        $("#span_jcktotal").html(dayAccountInfo.jckhj);
                        $("#span_txtotal").html(dayAccountInfo.txhj);

                        $("#span_czzstotal").html(dayAccountInfo.czzshj);
                        $("#span_xfyhtotal").html(dayAccountInfo.xfyhhj);

                        //收款明细====================================================

                        //充值
                        $("#span_cz_cash").html(dayAccountInfo.cz_cash);
                        $("#span_cz_mastercard").html(dayAccountInfo.cz_mastercard);
                        $("#span_cz_debitcard").html(dayAccountInfo.cz_debitcard);
                        $("#span_cz_zhifubao").html(dayAccountInfo.cz_zhifubao);
                        $("#span_cz_weixin").html(dayAccountInfo.cz_weixin);
                        $("#span_cz_qiafeijizhang").html(dayAccountInfo.cz_qianfeijizhang);
                        $("#span_cz_wallet").html(dayAccountInfo.cz_wallet);
                        $("#span_cz_jck").html(dayAccountInfo.cz_jck);
                        $("#span_cz_voucher").html(dayAccountInfo.cz_voucher);

                        $("#hf_cz_cash").val(dayAccountInfo.cz_cash);
                        $("#hf_cz_mastercard").val(dayAccountInfo.cz_mastercard);
                        $("#hf_cz_debitcard").val(dayAccountInfo.cz_debitcard);
                        $("#hf_cz_zhifubao").val(dayAccountInfo.cz_zhifubao);
                        $("#hf_cz_weixin").val(dayAccountInfo.cz_weixin);
                        $("#hf_cz_qiafeijizhang").val(dayAccountInfo.cz_qianfeijizhang);
                        $("#hf_cz_wallet").val(dayAccountInfo.cz_wallet);
                        $("#hf_cz_jck").html(dayAccountInfo.cz_jck);
                        $("#hf_cz_voucher").html(dayAccountInfo.cz_voucher);

                        //消费
                        $("#span_xf_cash").html(dayAccountInfo.xf_cash);
                        $("#span_xf_mastercard").html(dayAccountInfo.xf_mastercard);
                        $("#span_xf_debitcard").html(dayAccountInfo.xf_debitcard);
                        $("#span_xf_zhifubao").html(dayAccountInfo.xf_zhifubao);
                        $("#span_xf_weixin").html(dayAccountInfo.xf_weixin);
                        $("#span_xf_qiafeijizhang").html(dayAccountInfo.xf_qianfeijizhang);
                        $("#span_xf_wallet").html(dayAccountInfo.xf_wallet);
                        $("#span_xf_jck").html(dayAccountInfo.xf_jck);
                        $("#span_xf_voucher").html(dayAccountInfo.xf_voucher);

                        $("#hf_xf_cash").val(dayAccountInfo.xf_cash);
                        $("#hf_xf_mastercard").val(dayAccountInfo.xf_mastercard);
                        $("#hf_xf_debitcard").val(dayAccountInfo.xf_debitcard);
                        $("#hf_xf_zhifubao").val(dayAccountInfo.xf_zhifubao);
                        $("#hf_xf_weixin").val(dayAccountInfo.xf_weixin);
                        $("#hf_xf_qiafeijizhang").val(dayAccountInfo.xf_qianfeijizhang);
                        $("#hf_xf_wallet").val(dayAccountInfo.xf_wallet);
                        $("#hf_xf_jck").html(dayAccountInfo.xf_jck);
                        $("#hf_xf_voucher").html(dayAccountInfo.xf_voucher);

                        //计次卡
                        $("#span_jck_cash").html(dayAccountInfo.jck_cash);
                        $("#span_jck_mastercard").html(dayAccountInfo.jck_mastercard);
                        $("#span_jck_debitcard").html(dayAccountInfo.jck_debitcard);
                        $("#span_jck_zhifubao").html(dayAccountInfo.jck_zhifubao);
                        $("#span_jck_weixin").html(dayAccountInfo.jck_weixin);
                        $("#span_jck_qiafeijizhang").html(dayAccountInfo.jck_qianfeijizhang);
                        $("#span_jck_wallet").html(dayAccountInfo.jck_wallet);
                        $("#span_jck_jck").html(dayAccountInfo.jck_jck);
                        $("#span_jck_voucher").html(dayAccountInfo.jck_voucher);

                        $("#hf_jck_cash").val(dayAccountInfo.jck_cash);
                        $("#hf_jck_mastercard").val(dayAccountInfo.jck_mastercard);
                        $("#hf_jck_debitcard").val(dayAccountInfo.jck_debitcard);
                        $("#hf_jck_zhifubao").val(dayAccountInfo.jck_zhifubao);
                        $("#hf_jck_weixin").val(dayAccountInfo.jck_weixin);
                        $("#hf_jck_qiafeijizhang").val(dayAccountInfo.jck_qianfeijizhang);
                        $("#hf_jck_wallet").val(dayAccountInfo.jck_wallet);
                        $("#hf_jck_jck").html(dayAccountInfo.jck_jck);
                        $("#hf_jck_voucher").html(dayAccountInfo.jck_voucher);

                        //提现
                        $("#span_tx_cash").html(dayAccountInfo.tx_cash);
                        $("#span_tx_mastercard").html(dayAccountInfo.tx_mastercard);
                        $("#span_tx_debitcard").html(dayAccountInfo.tx_debitcard);
                        $("#span_tx_zhifubao").html(dayAccountInfo.tx_zhifubao);
                        $("#span_tx_weixin").html(dayAccountInfo.tx_weixin);
                        $("#span_tx_qiafeijizhang").html(dayAccountInfo.tx_qianfeijizhang);
                        $("#span_tx_wallet").html(dayAccountInfo.tx_wallet);
                        $("#span_tx_jck").html(dayAccountInfo.tx_jck);
                        $("#span_tx_voucher").html(dayAccountInfo.tx_voucher);

                        $("#hf_tx_cash").val(dayAccountInfo.tx_cash);
                        $("#hf_tx_mastercard").val(dayAccountInfo.tx_mastercard);
                        $("#hf_tx_debitcard").val(dayAccountInfo.tx_debitcard);
                        $("#hf_tx_zhifubao").val(dayAccountInfo.tx_zhifubao);
                        $("#hf_tx_weixin").val(dayAccountInfo.tx_weixin);
                        $("#hf_tx_qiafeijizhang").val(dayAccountInfo.tx_qianfeijizhang);
                        $("#hf_tx_wallet").val(dayAccountInfo.tx_wallet);
                        $("#hf_tx_jck").html(dayAccountInfo.tx_jck);
                        $("#hf_tx_voucher").html(dayAccountInfo.tx_voucher);

                        //收款合计====================================================
                        var hj_cash = dayAccountInfo.hj_cash;
                        var hj_mastercard = dayAccountInfo.hj_mastercard;
                        var hj_debitcard = dayAccountInfo.hj_debitcard;
                        var hj_zhifubao = dayAccountInfo.hj_zhifubao;
                        var hj_weixin = dayAccountInfo.hj_weixin;
                        var hj_wallet = dayAccountInfo.hj_wallet;
                        var hj_qianfeijizhang = dayAccountInfo.hj_qianfeijizhang;
                        var hj_jck = dayAccountInfo.hj_jck;
                        var hj_voucher = dayAccountInfo.hj_voucher;
                        
                        $("#span_skhj_cash").html(hj_cash);
                        $("#hf_skhj_cash").val(hj_cash);

                        $("#span_skhj_mastercard").html(hj_mastercard);
                        $("#hf_skhj_mastercard").val(hj_mastercard);

                        $("#span_skhj_debitcard").html(hj_debitcard);
                        $("#hf_skhj_debitcard").val(hj_debitcard);

                        $("#span_skhj_zhifubao").html(hj_zhifubao);
                        $("#hf_skhj_zhifubao").val(hj_zhifubao);

                        $("#span_skhj_weixin").html(hj_weixin);
                        $("#hf_skhj_weixin").val(hj_weixin);

                        $("#span_skhj_wallet").html(hj_wallet);
                        $("#hf_skhj_wallet").val(hj_wallet);

                        $("#span_skhj_qianfeijizhang").html(hj_qianfeijizhang);
                        $("#hf_skhj_qianfeijizhang").val(hj_qianfeijizhang);

                        $("#span_skhj_jck").html(hj_jck);
                        $("#hf_skhj_jck").val(hj_jck);

                        $("#span_skhj_voucher").html(hj_voucher);
                        $("#hf_skhj_voucher").val(hj_voucher);

                        $("#span_yjxxdx").html(dayAccountInfo.hj_cash_dx);

                        //备注====================================================

                        //充值
                        $("#span_czhj").html(dayAccountInfo.czhj);                        
                        $("#span_czsk").html(dayAccountInfo.czsk);
                        $("#span_czskbs").html(dayAccountInfo.czskbs);
                        $("#span_cztk").html(dayAccountInfo.cztk);
                        $("#span_cztkbs").html(dayAccountInfo.cztkbs);

                        //消费
                        $("#span_xfhj").html(dayAccountInfo.xfhj);
                        $("#span_xfsk").html(dayAccountInfo.xfsk);
                        $("#span_xfskbs").html(dayAccountInfo.xfskbs);
                        $("#span_xftk").html(dayAccountInfo.xftk);
                        $("#span_xftkbs").html(dayAccountInfo.xftkbs);

                        //计次卡
                        $("#span_jckhj").html(dayAccountInfo.jckhj);
                        $("#span_jcksk").html(dayAccountInfo.jcksk);
                        $("#span_jckskbs").html(dayAccountInfo.jckskbs);
                        $("#span_jcktk").html(dayAccountInfo.jcktk);
                        $("#span_jcktkbs").html(dayAccountInfo.jcktkbs);

                        //提现                        
                        $("#span_txbs").html(dayAccountInfo.txbs);
                        $("#span_txhj").html(dayAccountInfo.txhj);

                        //积分
                        $("#span_hj_point").html(dayAccountInfo.hj_point);
                        $("#span_cost_points").html(dayAccountInfo.cost_points);

                        $("#btnSettle").removeAttr("disabled");

                        //分项收入====================================================
                        if (dayAccountInfo.categoryCharges.length > 0) {
                            var s1 = "";
                            var totalAmount = 0.0;
                            for (var i = 0; i < dayAccountInfo.categoryCharges.length; i++) {
                                var categoryName = dayAccountInfo.categoryCharges[i].categoryName;
                                var value = dayAccountInfo.categoryCharges[i].value;
                                s1 += "，" + categoryName + ":" + value;
                                totalAmount += parseFloat(value);
                            }
                            if (s1.length > 0) {
                                s1 = s1.substr(1, s1.length);
                                s1 = "<b>合计：" + totalAmount.toFixed(2).toString() + "</b><br />" + s1;
                            }
                            $("#divCategoryCharges").html(s1);

                            var chartData = [
                                                {
                                                    "categoryName": "USA",
                                                    "value": 4025
                                                },
                                                {
                                                    "categoryName": "China",
                                                    "value": 1882
                                                },
                                                {
                                                    "categoryName": "Japan",
                                                    "value": 1809
                                                },
                                                {
                                                    "categoryName": "Germany",
                                                    "value": 1322,
                                                }
                            ];
                            chartData = dayAccountInfo.categoryCharges;
                            showChart(chartData);
                        } else {
                            $("#divCategoryCharges").html("暂无数据.");
                            showChart(null);
                        }
                    }
                    else {
                        closeWindow("divProgressNote");
                        showActResult("获取统计信息失败！", false);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    closeWindow("divProgressNote");
                    showActResult("请求失败！textStatus :" + textStatus, false);
                }
            });
        }

        //设置日期检索条件控件的行为；
        function setDateControlBehavior() {
            var $ddlDate = $("#ddlDateRule");
            if ($ddlDate.length == 0) {
                return;
            }

            if ($ddlDate.val() != "10") {
                $("#txtBeginDate").attr("disabled", "disabled");
                $("#txtEndDate").attr("disabled", "disabled");
            }
            $ddlDate.change(function () {
                var $txtBeginDate = $("#txtBeginDate");
                var $txtEndDate = $("#txtEndDate");

                $txtBeginDate.attr("disabled", "disabled");
                $txtEndDate.attr("disabled", "disabled");

                var beginDate = null;
                var endDate = null;
                var sBeginDate = null;
                var sEndDate = null;

                var myDate = new Date();
               
                var dateRule = $ddlDate.val();
                if (dateRule == "1") { //今天                    
                    beginDate = myDate;
                    endDate = myDate;
                }
                else if (dateRule == "2") { //昨天
                    beginDate = myDate.dateAdd("d", -1);
                    endDate = beginDate;
                }
                else if (dateRule == "3") { //前天
                    beginDate = myDate.dateAdd("d", -2);
                    endDate = beginDate;
                }
                else if (dateRule == "4") { //近两天
                    beginDate = myDate.dateAdd("d", -1);
                    endDate = myDate;
                }
                else if (dateRule == "5") { //近3天
                    beginDate = myDate.dateAdd("d", -2);
                    endDate = myDate;
                }
                else if (dateRule == "6") { //近1周
                    beginDate = myDate.dateAdd("w", -1);
                    endDate = myDate;
                }
                else if (dateRule == "7") { //近1月
                    beginDate = myDate.dateAdd("m", -1);
                    endDate = myDate;
                }
                else if (dateRule == "8") { //上月
                    var year = myDate.getFullYear(); //2015
                    var month = myDate.getMonth(); //
                    var day = 1;
                    var thisMonth_BeginDate = new Date(year, month, day);
                    var lastMonth_BeginDate = thisMonth_BeginDate.dateAdd("m", -1);
                    var lastMonth_EndDate = thisMonth_BeginDate.dateAdd("d", -1);

                    var date1 = new Date(2015, -1, 1);

                    beginDate = lastMonth_BeginDate;
                    endDate = lastMonth_EndDate;
                }
                else if (dateRule == "9") { //本月
                    var year = myDate.getFullYear(); //2015
                    var month = myDate.getMonth(); //
                    var day = 1;

                    beginDate = new Date(year, month, day);
                    endDate = myDate;
                }
                else if (dateRule == "10") { //自定义
                    beginDate = myDate;
                    endDate = myDate;
                    $("#txtBeginDate").removeAttr("disabled");
                    $("#txtEndDate").removeAttr("disabled");
                }

                sBeginDate = beginDate.format("yyyy-MM-dd");
                sEndDate = endDate.format("yyyy-MM-dd");
                
                $txtBeginDate.val(sBeginDate);
                $txtEndDate.val(sEndDate);

                //切换日期后，自动开始统计
                stat();
            });
        }

        $(function () {
            setDateControlBehavior();
        });

    </script>
    <style type="text/css">
        .editTable .th {
            width:100px;
        }
        .editTable td.amount {
            text-align:right;
        }
    </style>

</head>
<body>
<form id="Form1" method="post" runat="server">

<div id="wrapper" style="height:1%;overflow:hidden;">

<div class="editPageWrapper" style="width:670px;float:left;">

<%
    if (VA.Modules.JDingMember.Core.SystemInfo.SoftInfo.SoftLevel == VA.Modules.JDingMember.Core.Enums.SoftLevel.Free)
    {
        base.ShowSoftFunctionLimitNote(VA.Modules.JDingMember.Core.SystemInfo.SoftInfo.SoftLevelName);
    }
    else
    {
        Response.Write("<script type='text/javascript'>");
        Response.Write("$(function(){stat();})");
        Response.Write("</script>");        
    }
%>

<div class="centerFormTitle">
   <h1>店长日报</h1>
</div>

<table cellspacing="0" cellpadding="3" class="editTable" style="margin-bottom:-1px;">
<tr>
<td style="text-align:right;">

    <div style="height:1%;overflow:hidden;min-width:600px;">
        <div style="float:left">&nbsp;<span>门店：<% = base.ShopName %></span></div>
        <div style="float:right">
            
            <asp:DropDownList ID="ddlDateRule" runat="server" EnableViewState="false">
            <asp:ListItem Value="" Selected="True">统计期间</asp:ListItem>
            <asp:ListItem Value="1">今天</asp:ListItem>
            <asp:ListItem Value="2">昨天</asp:ListItem>
            <asp:ListItem Value="3">前天</asp:ListItem>
            <asp:ListItem Value="4">近两天</asp:ListItem>
            <asp:ListItem Value="5">近三天</asp:ListItem>
            <asp:ListItem Value="6">近一周</asp:ListItem>
            <asp:ListItem Value="7">近一月</asp:ListItem>
            <asp:ListItem Value="8">上月</asp:ListItem>
            <asp:ListItem Value="9">本月</asp:ListItem>
            <asp:ListItem Value="10">自定义</asp:ListItem>
            </asp:DropDownList>  

            <VACTL:TextBox ID="txtBeginDate" Runat="server"
                EnableViewState="False"
                CssClass="input"
                Width="80px"            
                onfocus="laydate()"
                MaxLength="20" />  
            -      
            <VACTL:TextBox ID="txtEndDate" Runat="server"
                EnableViewState="False"
                CssClass="input"
                Width="80px"            
                onfocus="laydate()"
                MaxLength="20" />   

            <input type="button" id="btnStat" class="simpleBtn" style="width:80px" onclick="stat()" value="统计" />
        </div>
    </div>
</td>
</tr>
</table>

<table id="Table1" cellspacing="0" cellpadding="3" class="editTable" style="margin-top:-1px;">
<tr>
<td class="th">会员账户余额：</td>
<td colspan="3"><span id="span_hyzhye_total"></span> &nbsp;&nbsp;&nbsp;&nbsp;<span class="note">注：该项为实时数据，与统计日期无关;</span></td>
</tr>

<tr>
<td class="th">办理会员数量：</td>
<td colspan="3"><span id="span_blhysl"></span></td>
</tr>

<tr>
<td class="th">充值收款金额：</td>
<td><span id="span_cztotal"></span></td>
<td class="th">充值赠送金额：</td>
<td><span id="span_czzstotal" runat="server"></span></td>
</tr>

<tr>
<td class="th">消费收款金额：</td>
<td><span id="span_xftotal"></span></td>
<td class="th">消费优惠金额：</td>
<td><span id="span_xfyhtotal" runat="server"></span></td>
</tr>

<tr>
<td class="th">充次收款金额：</td>
<td colspan="3"><span id="span_jcktotal"></span></td>
</tr>

<tr>
<td class="th">会员提现金额：</td>
<td colspan="3"><span id="span_txtotal"></span></td>
</tr>
</table>

<table id="Table2" cellspacing="0" cellpadding="3" class="editTable" style="margin-top:-1px;">
<tr>
<td class="th"></td>
<td style="text-align:center;width:60px;">现金</td>
<td style="text-align:center;width:60px;">信用卡</td>
<td style="text-align:center;width:55px;">借记卡</td>
<td style="text-align:center;width:50px;">支付宝</td>
<td style="text-align:center;width:50px;">微信</td>
<td style="text-align:center;width:50px;">记账</td>
<td style="text-align:center;width:60px;">会员卡</td>
<td style="text-align:center;">计次卡</td>
<td style="text-align:center;width:55px;">代金券</td>
</tr>
<tr>
<td class="th">充值收款明细：</td>
<td class="amount"><span id="span_cz_cash"></span><input type="hidden" id="hf_cz_cash" name="hf_cz_cash" /></td>
<td class="amount"><span id="span_cz_mastercard"></span><input type="hidden" id="hf_cz_mastercard" name="hf_cz_mastercard" /></td>
<td class="amount"><span id="span_cz_debitcard"></span><input type="hidden" id="hf_cz_debitcard" name="hf_cz_debitcard" /></td>
<td class="amount"><span id="span_cz_zhifubao"></span><input type="hidden" id="hf_cz_zhifubao" name="hf_cz_zhifubao" /></td>
<td class="amount"><span id="span_cz_weixin"></span><input type="hidden" id="hf_cz_weixin" name="hf_cz_weixin" /></td>
<td class="amount"><span id="span_cz_qiafeijizhang"></span><input type="hidden" id="hf_cz_qianfeijizhang" name="hf_cz_qianfeijizhang" /></td>
<td class="amount"><span id="span_cz_wallet"></span><input type="hidden" id="hf_cz_wallet" name="hf_cz_wallet" /></td>
<td class="amount"><span id="span_cz_jck"></span><input type="hidden" id="hf_cz_jck" name="hf_cz_jck" /></td>
<td class="amount"><span id="span_cz_voucher"></span><input type="hidden" id="hf_cz_voucher" name="hf_cz_voucher" /></td>
</tr>
<tr>
<td class="th">消费收款明细：</td>
<td class="amount"><span id="span_xf_cash"></span><input type="hidden" id="hf_xf_cash" name="hf_xf_cash" /></td>
<td class="amount"><span id="span_xf_mastercard"></span><input type="hidden" id="hf_xf_mastercard" name="hf_xf_mastercard" /></td>
<td class="amount"><span id="span_xf_debitcard"></span><input type="hidden" id="hf_xf_debitcard" name="hf_xf_debitcard" /></td>
<td class="amount"><span id="span_xf_zhifubao"></span><input type="hidden" id="hf_xf_zhifubao" name="hf_xf_zhifubao" /></td>
<td class="amount"><span id="span_xf_weixin"></span><input type="hidden" id="hf_xf_weixin" name="hf_xf_weixin" /></td>
<td class="amount"><span id="span_xf_qiafeijizhang"></span><input type="hidden" id="hf_xf_qianfeijizhang" name="hf_xf_qianfeijizhang" /></td>
<td class="amount"><span id="span_xf_wallet"></span><input type="hidden" id="hf_xf_wallet" name="hf_xf_wallet" /></td>
<td class="amount"><span id="span_xf_jck"></span><input type="hidden" id="hf_xf_jck" name="hf_xf_jck" /></td>
<td class="amount"><span id="span_xf_voucher"></span><input type="hidden" id="hf_xf_voucher" name="hf_xf_voucher" /></td>
</tr>
<tr>
<td class="th">充次收款明细：</td>
<td class="amount"><span id="span_jck_cash"></span><input type="hidden" id="hf_jck_cash" name="hf_jck_cash" /></td>
<td class="amount"><span id="span_jck_mastercard"></span><input type="hidden" id="hf_jck_mastercard" name="hf_jck_mastercard" /></td>
<td class="amount"><span id="span_jck_debitcard"></span><input type="hidden" id="hf_jck_debitcard" name="hf_jck_debitcard" /></td>
<td class="amount"><span id="span_jck_zhifubao"></span><input type="hidden" id="hf_jck_zhifubao" name="hf_jck_zhifubao" /></td>
<td class="amount"><span id="span_jck_weixin"></span><input type="hidden" id="hf_jck_weixin" name="hf_jck_weixin" /></td>
<td class="amount"><span id="span_jck_qiafeijizhang"></span><input type="hidden" id="hf_jck_qianfeijizhang" name="hf_jck_qianfeijizhang" /></td>
<td class="amount"><span id="span_jck_wallet"></span><input type="hidden" id="hf_jck_wallet" name="hf_jck_wallet" /></td>
<td class="amount"><span id="span_jck_jck"></span><input type="hidden" id="hf_jck_jck" name="hf_jck_jck" /></td>
<td class="amount"><span id="span_jck_voucher"></span><input type="hidden" id="hf_jck_voucher" name="hf_jck_voucher" /></td>
</tr>
<tr>
<td class="th">会员提现明细：</td>
<td class="amount"><span id="span_tx_cash"></span><input type="hidden" id="hf_tx_cash" name="hf_tx_cash" /></td>
<td class="amount"><span id="span_tx_mastercard"></span><input type="hidden" id="hf_tx_mastercard" name="hf_tx_mastercard" /></td>
<td class="amount"><span id="span_tx_debitcard"></span><input type="hidden" id="hf_tx_debitcard" name="hf_tx_debitcard" /></td>
<td class="amount"><span id="span_tx_zhifubao"></span><input type="hidden" id="hf_tx_zhifubao" name="hf_tx_zhifubao" /></td>
<td class="amount"><span id="span_tx_weixin"></span><input type="hidden" id="hf_tx_weixin" name="hf_tx_weixin" /></td>
<td class="amount"><span id="span_tx_qiafeijizhang"></span><input type="hidden" id="hf_tx_qianfeijizhang" name="hf_tx_qianfeijizhang" /></td>
<td class="amount"><span id="span_tx_wallet"></span><input type="hidden" id="hf_tx_wallet" name="hf_tx_wallet" /></td>
<td class="amount"><span id="span_tx_jck"></span><input type="hidden" id="hf_tx_jck" name="hf_tx_jck" /></td>
<td class="amount"><span id="span_tx_voucher"></span><input type="hidden" id="hf_tx_voucher" name="hf_tx_voucher" /></td>
</tr>
<tr>
<td class="th">应交合计：</td>
<td class="amount"><span id="span_skhj_cash"></span><input type="hidden" id="hf_skhj_cash" name="hf_skhj_cash" /></td>
<td class="amount"><span id="span_skhj_mastercard"></span><input type="hidden" id="hf_skhj_mastercard" name="hf_skhj_mastercard" /></td>
<td class="amount"><span id="span_skhj_debitcard"></span><input type="hidden" id="hf_skhj_debitcard" name="hf_skhj_debitcard" /></td>
<td class="amount"><span id="span_skhj_zhifubao"></span><input type="hidden" id="hf_skhj_zhifubao" name="hf_skhj_zhifubao" /></td>
<td class="amount"><span id="span_skhj_weixin"></span><input type="hidden" id="hf_skhj_weixin" name="hf_skhj_weixin" /></td>
<td class="amount"><span id="span_skhj_qianfeijizhang"></span><input type="hidden" id="hf_skhj_qianfeijizhang" name="hf_skhj_qianfeijizhang" /></td>
<td class="amount"><span id="span_skhj_wallet"></span><input type="hidden" id="hf_skhj_wallet" name="hf_skhj_wallet" /></td>
<td class="amount"><span id="span_skhj_jck"></span><input type="hidden" id="hf_skhj_jck" name="hf_skhj_jck" /></td>
<td class="amount"><span id="span_skhj_voucher"></span><input type="hidden" id="hf_skhj_voucher" name="hf_skhj_voucher" /></td>
</tr>
</table>

<table id="Table3" cellspacing="0" cellpadding="3" class="editTable" style="margin-top:-1px;">
<tr>
<td class="th">应交现金大写：</td>
<td><span id="span_yjxxdx"></span></td>
</tr>
<tr>
<td class="th">备注：</td>
<td>
    充值收款：<span id="span_czskbs"></span><input type="hidden" id="hf_czskbs" name="hf_czskbs" />笔(<span id="span_czsk"></span><input type="hidden" id="hf_czsk" name="hf_czsk" />元)，
             撤单：<span id="span_cztkbs"></span><input type="hidden" id="hf_cztkbs" name="hf_cztkbs" />笔(<span id="span_cztk"></span><input type="hidden" id="hf_cztk" name="hf_cztk" />元)，
             结余：<span id="span_czhj"></span><input type="hidden" id="hf_czhj" name="hf_czhj" />元
    <br />        
    消费收款：<span id="span_xfskbs"></span><input type="hidden" id="hf_xfskbs" name="hf_xfskbs" />笔(<span id="span_xfsk"></span><input type="hidden" id="hf_xfsk" name="hf_xfsk" />元)，
             撤单：<span id="span_xftkbs"></span><input type="hidden" id="hf_xftkbs" name="hf_xftkbs" />笔(<span id="span_xftk"></span><input type="hidden" id="hf_xftk" name="hf_xftk" />元)，
             结余：<span id="span_xfhj"></span><input type="hidden" id="hf_xfhj" name="hf_xfhj" />元
    <br />
    充次收款：<span id="span_jckskbs"></span><input type="hidden" id="hf_jckskbs" name="hf_jckskbs" />笔(<span id="span_jcksk"></span><input type="hidden" id="hf_jcksk" name="hf_jcksk" />元)，
             撤单：<span id="span_jcktkbs"></span>笔(<span id="span_jcktk"></span><input type="hidden" id="hf_jcktk" name="hf_jcktk" />元)，
             结余：<span id="span_jckhj"></span><input type="hidden" id="hf_jckhj" name="hf_jckhj" />元
    <br />
    会员提现：<span id="span_txbs"></span><input type="hidden" id="hf_txbs" name="hf_txbs" />笔，合计 <span id="span_txhj"></span><input type="hidden" id="hf_txhj" name="hf_txhj" />元             
        
    <br />
    -------------------------------------------------------------------------
    
    <br />
    消费收款金额中含积分抵扣：<span id="span_hj_point"></span><input type="hidden" id="hf_hj_point" name="hf_hj_point" /> 元，回收积分：<span id="span_cost_points"></span><input type="hidden" id="hf_cost_points" name="hf_cost_points" /> 分

    <br />
    -------------------------------------------------------------------------
    <br />
    注：消费收款金额 = 普通消费收款金额 + 快速收款金额 + 计次卡划次收款金额。

</td>
</tr>
<tr>
<td class="th" colspan="2" style="text-align:left;">项目销售收入：</td>
</tr>
<tr>
<td colspan="2">
    <div id="divCategoryCharges" style="border-bottom:1px solid #dddddd;"></div>
    <div id="chartdiv_column" style="width: 100%; height: 400px;display:none;"></div>
    <div id="chartdiv_pie" style="width: 100%; height: 400px;display:none;"></div>
</td>
</tr>
<%--</table>

<table id="Table4" cellspacing="0" cellpadding="3" class="editTable" style="margin-top:-1px;">--%>
<tr>
<td class="footer" colspan="2">
    
    <asp:HiddenField ID="hfShopCode" runat="server" />
    <input type="button" id="btnPrint" class="btn" style="width:80px" onclick="print()" value="打印" />    
    <%--<input type="button" id="btnExport" class="btn" style="width:80px" onclick="dataExport()" value="导出" />    --%>

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

</div><!--editPageWrapper.END-->

</div><!--"wrapper.END"-->

<div id="divProgressNote" style="display:none;line-height:80px;text-align:center;">
    <span style="font-weight:bold;font-size:14px;">正在统计，请稍后……</span>
</div>

<script type="text/javascript">
    var chart;
    var legend;

    AmCharts.ready(function () {
        //showChart(chartData);
    });

    function showChart(chartData) {
        showChart1(chartData);
        showChart2(chartData);
    }

    //柱状图；
    function showChart1(chartData) {

        if (chartData == null) {
            $("#chartdiv_column").hide();
            return;
        } else {
            $("#chartdiv_column").show();
        }

        // SERIAL CHART
        chart = new AmCharts.AmSerialChart();
        chart.dataProvider = chartData;
        chart.categoryField = "categoryName";
        // the following two lines makes chart 3D
        chart.depth3D = 1;
        chart.angle = 30;
        chart.theme = "light";
        chart.startDuration = 1; //动画

        // AXES
        // category
        var categoryAxis = chart.categoryAxis;
        //categoryAxis.labelRotation = 90;
        categoryAxis.dashLength = 5;
        categoryAxis.gridPosition = "start";

        // value
        var valueAxis = new AmCharts.ValueAxis();
        valueAxis.title = "营业额(元)";
        valueAxis.dashLength = 5;
        chart.addValueAxis(valueAxis);

        // GRAPH
        var graph = new AmCharts.AmGraph();
        graph.valueField = "value";
        graph.colorField = "color";
        graph.balloonText = "<span style='font-size:14px'>[[category]]: <b>[[value]]</b> 元</span>";
        graph.labelText = "[[value]] 元";
        graph.type = "column";
        graph.lineAlpha = 0;
        graph.fillAlphas = 1;
        graph.lineColor = "#3D96C9";
        chart.addGraph(graph);

        // CURSOR
        var chartCursor = new AmCharts.ChartCursor();
        chartCursor.cursorAlpha = 0;
        chartCursor.zoomable = false;
        chartCursor.categoryBalloonEnabled = false;
        chart.addChartCursor(chartCursor);

        chart.creditsPosition = "top-right";
        chart.export = {
            "enabled": true
        };

        // WRITE
        chart.write("chartdiv_column");
    }

    //饼状图；
    function showChart2(chartData) {

        if (chartData == null) {
            $("#chartdiv_pie").hide();
            return;
        } else {
            $("#chartdiv_pie").show();
        }

        // PIE CHART
        chart = new AmCharts.AmPieChart();

        //// title of the chart
        //chart.addTitle("分类收入", 16);

        chart.dataProvider = chartData;
        chart.titleField = "categoryName";
        chart.valueField = "value";
        chart.outlineColor = "#FFFFFF";
        chart.outlineAlpha = 0.8;
        chart.outlineThickness = 2;
        chart.balloonText = "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> 元 ([[percents]]%)</span>";
        // this makes the chart 3D
        chart.depth3D = 5;
        chart.angle = 20;
        chart.startDuration = 1;  //动画
        chart.creditsPosition = "top-right";
        chart.export = {
            "enabled": true
        };

        // WRITE
        chart.write("chartdiv_pie");
    }

    </script>

</form>
</body>
</html>


