<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    // Insert page code here
    //

</script>
<html xmlns:XForm="xmlns:xform">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <title>BPM Form</title>
    <style>
    BODY {FONT-SIZE: 12px; FONT-FAMILY: verdana}
    TABLE {border-collapse: collapse; FONT-SIZE: 12px; FONT-FAMILY: verdana}
    P {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; FONT-SIZE: 12px; FONT-FAMILY: verdana}
    TD {padding:1px}
    TD.NoPadding {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}
    /*INPUT {height: 15px}*/
    INPUT.UL {BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: #33ff33 1px solid}
    TEXTAREA {FONT-SIZE:12px}
    input {vertical-align:middle;/*margin-right:-3px*/}
    </style>
    <script>
        Ext.onReady(function () {
            XFormOnChange(agent.Eles[document.getElementById('TaskID').getAttribute("xform_xele_index")]);

        })

        //付款计划总金额(不包含删除行)
        function getPayTotalAmount(PayAmount, IsDelete) {
            var tableObj = document.getElementById("table_fkjh");
            var amount = 0;
            for (var i = 0; i < tableObj.rows.length - 2; i++) {//遍历Table的所有Row //遍历Row中的每一列

                //删除是否选中
                var aDivNewPurchaseDetailXck = document.getElementsByClassName("IsDelete");//是否选中
                var div = aDivNewPurchaseDetailXck[i];
                var id = div.getElementsByTagName('input')[0].id;
                var v = document.getElementById(id).checked;

                //付款金额
                var aDiv_PayAmount = document.getElementsByClassName("PaymentPlanPayAmount");
                var div_PayAmount = aDiv_PayAmount[i];
                var id_PayAmount = div_PayAmount.getElementsByTagName('input')[0].id;
                var v_PayAmount = document.getElementById(id_PayAmount).value;

                if (v == false)
                    amount += Number(moneyDelete(v_PayAmount));
            }

            return amount;

        }

        //去除金额分位符
        function moneyDelete(num) {
            if (num && num != undefined && num != null) {
                let _num = num;
                _num = _num.toString();
                _num = _num.replace(/,/gi, '');
                return _num
            } else {
                return num
            }
        }

    </script>
</head>
<body>
    <form runat="server">
        <!-- Insert content here -->
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td class="tds1">
                        本次申请可支付金额：<aspxform:XTextBox id="PayableAmount" runat="server" XDataBind="DF_Purchase_APReconciliation.PayableAmount" BorderWidth="1px" TextAlign="Right" BorderColor="#D4E4FE" Height="25px" Format="type:currency;.2" Max="0" Min="0" BackColor="#E6F1F8" ReadOnly="True" Text="0.00" width="100px" HiddenInput="False"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <table width="1200" align="center" class="table" id="table_fkjh" style="BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none" border="0" cellspacing="0" cellpadding="0" menudock="Left" dynamicarea="1,1" emptygrid="KeepEmpty">
            <tbody>
                <tr>
                    <td width="50" align="center" class="tds">
                        序号</td>
                    <td width="68" align="center" class="tds">
                        删除</td>
                    <td width="158" align="center" class="tds">
                        可按期自动提交</td>
                    <td width="158" align="center" class="tds">
                        <asp:Label id="Label13" runat="server" forecolor="Red" text="*"></asp:Label>&nbsp;计划提交财务日期</td>
                    <td width="167" align="center" class="tds">
                        <asp:Label id="Label14" runat="server" forecolor="Red" text="*"></asp:Label>&nbsp;付款金额</td>
                    <td width="158" align="center" class="tds">
                        <asp:Label id="Label15" runat="server" forecolor="Red" text="*"></asp:Label>&nbsp;期望财务付款日期</td>
                    <td width="155" align="center" class="tds">
                        银行付款摘要</td>
                    <td width="166" align="center" class="tds">
                        付款备注</td>
                    <%-- <td width="200" align="center" class="tds">
                        后付处理单号</td>--%>
                </tr>
                <tr>
                    <td class="tds1">
                        <aspxform:XGridLineNo id="XGridLineNo2" runat="server" XDataBind="DF_Purchase_PaymentPlan.LineNumber" BorderWidth="1" TextAlign="Center" BorderStyle="None" Width="100%">1</aspxform:XGridLineNo>
                    </td>
                    <td align="center" class="tds1">
                        <aspxform:XCheckBox id="IsDelete" runat="server" XDataBind="DF_Purchase_PaymentPlan.IsDelete" Width="48px" CssClass="IsDelete" name="IsDelete" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1"></aspxform:XCheckBox>
                        <aspxform:XLabel id="XLabel19" runat="server" XDataBind="DF_Purchase_PaymentPlan.IsPay" HiddenExpress="1"></aspxform:XLabel>
                        <aspxform:XLabel id="XLabel1" runat="server" XDataBind="DF_Purchase_PaymentPlan.TaskID" HiddenExpress="1" Express="if(DF_Purchase_PaymentPlan.TaskID==-1,DF_Purchase_APReconciliation.TaskID,DF_Purchase_PaymentPlan.TaskID)"></aspxform:XLabel>
                        <%--<aspxform:XLabel id="XLabel11" runat="server" XDataBind="DF_Purchase_PaymentPlan.ItemID" HiddenExpress="1"></aspxform:XLabel>--%></td>
                    <td align="center" class="tds1">
                        <aspxform:XCheckBox id="XCheckBox1" runat="server" XDataBind="DF_Purchase_PaymentPlan.IsConfirm" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1 || DF_Purchase_PaymentPlan.IsDelete==1" Express="if(DF_Purchase_PaymentPlan.IsDelete=='1',0,DF_Purchase_PaymentPlan.IsConfirm)"></aspxform:XCheckBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XDateTimePicker id="PlanSubdDate" runat="server" XDataBind="DF_Purchase_PaymentPlan.PlanSubdDate" BorderWidth="1" BorderColor="#DCDCDC" Height="25px" Width="100%" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1 || DF_Purchase_PaymentPlan.IsDelete==1"></aspxform:XDateTimePicker>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="PaymentPlanPayAmount" runat="server" XDataBind="DF_Purchase_PaymentPlan.PayAmount" BorderWidth="1" TextAlign="Right" BorderColor="#DCDCDC" Height="25px" Format="type:currency;.2" Width="100%" CssClass="PaymentPlanPayAmount" name="PaymentPlanPayAmount" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1 || DF_Purchase_PaymentPlan.IsDelete==1"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XDateTimePicker id="ExpectedPaymentDate" runat="server" XDataBind="DF_Purchase_PaymentPlan.ExpectedPaymentDate" BorderWidth="1" BorderColor="#DCDCDC" Height="25px" Width="100%" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1 || DF_Purchase_PaymentPlan.IsDelete==1"></aspxform:XDateTimePicker>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox12" runat="server" XDataBind="DF_Purchase_PaymentPlan.PayAbstract" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1 || DF_Purchase_PaymentPlan.IsDelete==1" TextMode="MultiLine"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox13" runat="server" XDataBind="DF_Purchase_PaymentPlan.PayRemark" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" DisableExpress="DF_Purchase_PaymentPlan.IsPay==1 || DF_Purchase_PaymentPlan.IsDelete==1" TextMode="MultiLine"></aspxform:XTextBox>
                    </td>
                    <%-- <td align="center" class="tds1">
                       <aspxform:XHistoryFormLink id="XHistoryFormLink1" runat="server" XDataBind="hfcldh" EmptyText="尚未关联" BackColor="#E9F1F4">#SerialNum</aspxform:XHistoryFormLink>
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" HiddenExpress="1" XDataSource="TableName:DF_Purchase_Payment;Filter:PlanItemID->DF_Purchase_PaymentPlan.ItemID" DataMap="TaskID->hfcldh"></aspxform:XDropDownList>
                   </td>--%>
                </tr>
                <tr>
                    <td align="right" colspan="4">
                        <%--<aspxform:XLabel id="XLabel2" runat="server"  BackColor="#E6F1F8">合计:</aspxform:XLabel>--%>
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="DF_Purchase_APReconciliation.DifferenceAmount" BorderWidth="1" TextAlign="Right" BorderColor="#DCDCDC" Height="25px" Format="type:currency;.2" BackColor="#E6F1F8" ReadOnly="True" width="100px" HiddenInput="True"></aspxform:XTextBox>
                        合计: 
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="PayToatlAmount" runat="server" XDataBind="DF_Purchase_APReconciliation.PayToatlAmount" BorderWidth="1" TextAlign="Right" BorderColor="#DCDCDC" Height="25px" Format="type:currency;.2" BackColor="#E6F1F8" ReadOnly="true" Width="100%" name="PayToatlAmount" Express="javascript('getPayTotalAmount',DF_Purchase_PaymentPlan.PayAmount,DF_Purchase_PaymentPlan.IsDelete)"></aspxform:XTextBox>
                    </td>
                    <td colspan="3">
                        <aspxform:XLabel id="TaskID" runat="server" XDataBind="DF_Purchase_APReconciliation.TaskID" HiddenExpress="1"></aspxform:XLabel>
                        <aspxform:XTextBox id="ceAmount" runat="server" XDataBind="ceAmount" BorderWidth="1" TextAlign="Right" BorderColor="#DCDCDC" Height="25px" Format="type:currency;.2" BackColor="#E6F1F8" HiddenInput="True" Width="100px" Express="DF_Purchase_APReconciliation.PayableAmount+10"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="24" align="left" class="tsbottomlabel" style="WIDTH: 200px">
                        差异金额(+/-)</td>
                    <td width="530" class="tsbottomtext" style="WIDTH: 1000px">
                        <aspxform:XTextBox id="XTextBox3" runat="server" XDataBind="DF_Purchase_APReconciliation.DifferencePayAmount" BorderWidth="1" TextAlign="Right" BorderColor="#DCDCDC" Height="25px" Format="type:currency;.2" BackColor="#E6F1F8" ReadOnly="True" width="100px" Express="DF_Purchase_APReconciliation.PayToatlAmount-DF_Purchase_APReconciliation.PayableAmount"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left" class="tsbottomlabel">
                        有差异原因</td>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox16" runat="server" XDataBind="DF_Purchase_APReconciliation.DifferenceReason" BorderWidth="1" BorderColor="#DCDCDC" Height="25px" width="100%"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <%--  <div style="text-align:center">
                        <input type="button" value="关闭" onclick="window.close()" style="width:100px;height:25px"/>
        </div>--%>&nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator10" runat="server" DisableExpress="DF_Purchase_PaymentPlan.IsDelete==1" Display="None" ErrorMessage="请选择计划提交财务日期" ControlToValidate="PlanSubdDate" ForeColor="Red">请选择计划提交财务日期</aspxform:XRequiredFieldValidator>
        &nbsp;&nbsp;&nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator11" runat="server" DisableExpress="DF_Purchase_PaymentPlan.IsDelete==1" Display="None" ErrorMessage="请填写付款金额" ControlToValidate="PaymentPlanPayAmount" ForeColor="Red">请填写付款金额</aspxform:XRequiredFieldValidator>
        &nbsp;&nbsp; 
        <aspxform:XCompareValidator id="XCompareValidator2" runat="server" Type="Double" Display="None" ErrorMessage="系统控制：付款计划里付款金额∑ - 本次申请可支付金额＜10元，请修改付款金额" ControlToValidate="PayToatlAmount" ForeColor="Red" Operator="LessThan" ControlToCompare="ceAmount">系统控制：付款计划里付款金额∑ - 本次申请可支付金额＜10元，请修改付款金额</aspxform:XCompareValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator9" runat="server" DisableExpress="DF_Purchase_APReconciliation.DifferencePayAmount==0 &amp;&amp; DF_Purchase_APReconciliation.DifferenceAmount==0" Display="None" ErrorMessage="请填写有差异原因" ControlToValidate="XTextBox16" ForeColor="Red">请填写有差异原因</aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator12" runat="server" DisableExpress="DF_Purchase_PaymentPlan.IsDelete==1" Display="None" ErrorMessage="请选择期望财务付款日期" ControlToValidate="ExpectedPaymentDate" ForeColor="Red">请选择期望财务付款日期</aspxform:XRequiredFieldValidator>
        &nbsp; 
        <aspxform:XCompareValidator id="XCompareValidator1" runat="server" DisableExpress="DF_Purchase_PaymentPlan.IsDelete==1" Display="None" ErrorMessage="期望财务付款日期不能早于计划提交财务日期" ControlToValidate="ExpectedPaymentDate" ForeColor="Red" Operator="GreaterThanEqual" ControlToCompare="PlanSubdDate">期望财务付款日期不能早于计划提交财务日期</aspxform:XCompareValidator>
    </form>
</body>
</html>
