<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmAsientosDetalleAjax.aspx.cs" Inherits="frmAsientosDetalleAjax" Culture="es-PE" UICulture="es-PE"%>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!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 href="estilos/StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="estilos/UpdateProgress.css" rel="stylesheet" type="text/css" />
    
    <script type="text/javascript">
        function callserver() {
            $get("btnFecha").click();
        }
        function window_onunload() {
            $get("btnSalir").click();
        }

        function callDebe(Control) {
            //$get("btnDebe").click();
            var caja = Control.id
            if (caja == "txtDebe") {
                if (Control.value.length != "0.00" ) {
                    document.forms[0].txtDebe.disabled = false;
                    document.forms[0].txtHaber.disabled = true;
                } else {
                    document.forms[0].txtDebe.value = "0.00";
                    document.forms[0].txtDebe.disabled = false;
                    document.forms[0].txtHaber.disabled = false;
                }
               //alert(Control.value);
            }
            else {
                if (Control.value.length != "0.00") {
                    document.forms[0].txtHaber.disabled = false;
                    document.forms[0].txtDebe.disabled = true;
                } else {
                    document.forms[0].txtHaber.value = "0.00";
                    document.forms[0].txtHaber.disabled = false;
                    document.forms[0].txtDebe.disabled = false;
                }
            }
        }

//    function pageLoad()
//    {
//        var map = new VEMap('PanelPlanCuenta');
//        map.LoadMap();
//    }
    </script>


<style>

#baseAdmin{
	width:1140px;
	margin:auto;
	height:585px;
	/*border:#CCCCCC 1px solid;*/
	
}

#PanelIngreso{
	height:165px;
	z-index:1;
	/*border:#adadad 1px solid;*/
	
}
#AdminTools {
	position:absolute;
	width:296px;
	height:160px;
	z-index:2;
	/*border:#CCCCCC 1px solid;*/
}
#AdminContent {
	position:absolute;
	margin-left:300px;
	width:840px;
	height:160px;
	color:#000000;
	z-index:3;
	/*border:#DDDEE2 1px solid;*/
}

#divBotones {
	height:22px;
	z-index:1;
	text-align:center;
	/*border:#DDDEE2 1px solid;*/
}

#divDetalleAsiento 
{
	margin-top:5px;
	z-index:1;
	text-align:center;
	border:#688CAF 1px solid;
}

#DetalleUno {
	position:absolute;
	width:565px;
	z-index:4;
	/*border:#DDDEE2 1px solid;*/
	background-color:#D7E6F7;
	padding-top:5px;
	padding-bottom:5px;
}
#DetalleDos {
	margin-left:572px;
	color:#000000;
	height:120px;
	z-index:5;
	/*border:#DDDEE2 1px solid;*/
	padding-top:5px;
	padding-bottom:5px;
	background-color:#D7E6F7;
}


#ContCabecera
{
	color:#000000;
	height:120px;
	z-index:5;
	/*border:#DDDEE2 1px solid;*/
	padding-top:5px;
	padding-bottom:5px;
	background-color:#D7E6F7;
}

#tabla
{
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
    text-align:right;	
}
.CajasTexto
{
    width:140px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
	
}
.CajasTextoAUN
{
    width:140px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
	text-align:right;
}
.TextoAUN
{
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	text-transform:lowercase;
}

.CajasTextoEnabled
{
    width:140px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
	background-color:#D9DCE3;
}
.CajasComboEnabled
{
    width:145px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
	background-color:#D9DCE3;
    
}
.CajasCombo
{
    width:145px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
}

.CajasComboObligatorio
{
    width:145px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
	background-color:#4FFF7B;
}

.CajasTextoObligatorio
{
    width:140px;	
    font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border: 1px solid #9EB6CE;
	margin:1px 1px 1px 1px;
	background-color:#4FFF7B;

}


.ClsButton
{
    border: 1px solid #688CAF;
    WIDTH: 140px;
    CURSOR: hand;
    Font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    BACKGROUND-COLOR: #C6D8EE;
    background-image: url('images/botones/btnLinea2.png');
    color:#00156E;
}
/* Inicio Estilos GridView */
.Grid
{
	border:#3C7FB1 1px solid;
	color: #D0D7E5;
}
.Grid tr td
{	
	
	font-family:Arial, Helvetica, sans-serif;
	font-size: 10px;
	color:#333333;
	padding-left:2px;
	padding-right:2px;

	border-right: #ADD1FF  1px solid;
	border-top: #ADD1FF 1px solid; 
	border-left: #ADD1FF 1px solid; 
	border-bottom: #ADD1FF 1px solid;
	vertical-align: middle;
}

.Grid tr
{	
	height:18px;
	background-color:#F4F4F4;
}

.Grid th
{
	background-image:url('images/lineaTitulos.gif');
	/*background-color: #CADBF0;*/
	color: #00156E;
	font-size:12px;
	height:20px;
	text-align: center;
	text-transform:capitalize;
	font-weight:bold;

	border-right: #ADD1FF  1px solid;
	border-top: #ADD1FF 1px solid; 
	border-left: #ADD1FF 1px solid; 
	border-bottom: #ADD1FF 1px solid;
	vertical-align: middle;

}
/* Fin Estilo GridView */

.LineaExportar
{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	background-image: url(images/lineaExportar.gif);
	background-repeat:repeat-x;
	height:21px;
	padding-bottom:0px;
	text-transform:uppercase;
	padding-top:4px;
	width:100%;
	color:#00156E;

}

.EstTablaFiltroDatos 
{
	font-family: Arial, Helvetica, sans-serif; 
	font-size: 12px;	
	font-weight: bold;
	color: #666F6C;
	border-right: #3C7FB1  1px solid;
	border-top: #3C7FB1 1px solid; 
	border-left: #3C7FB1 1px solid; 
	border-bottom: #3C7FB1 1px solid;
	vertical-align: middle;
	text-align: left;
}

 .TextLabel
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 11px;
            font-weight: bold;
            text-align: left;
            width: 104px;
        }

</style>    
</head>
<body onunload="return window_onunload()">
    <form id="form1" runat="server">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
    <div id="baseAdmin">
    
      
      
      <asp:UpdatePanel ID="PanelAsiento" runat="server">
        <ContentTemplate>

        <div id="PanelIngreso">
           <div id="AdminTools" >
                <fieldset id="fieldCabecera">
         <legend>Asiento Cabecera</legend>
            <div id="ContCabecera">
                <table id="tabla" width="98%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                <td style="width:100px" >Glosa:&nbsp;</td>
                <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" 
                  runat="server" ControlToValidate="txtGlosa" ErrorMessage="Ingrese la Glosa." 
                  ValidationGroup="Grupo1" SetFocusOnError="True">!</asp:RequiredFieldValidator>
                                        
                <asp:TextBox ID="txtGlosa" runat="server" TabIndex="1" ValidationGroup="Grupo1"
                        CssClass="CajasTextoObligatorio"></asp:TextBox></td>
                </tr>
                <tr>
                <td>Dia:&nbsp; </td>
                <td>
                <cc1:MaskedEditExtender 
                    ID="MEE_Dia" 
                    runat="server" Mask="99/99/9999" 
                    MaskType="Date" 
                    TargetControlID="txtDia" 
                    PromptCharacter="_"> 
                    </cc1:MaskedEditExtender>

                    <cc1:MaskedEditValidator 
                    ID="MEV_Dia" 
                    runat="server" 
                    ControlExtender="MEE_Dia" 
                    ControlToValidate="txtDia" 
                    EmptyValueMessage="!" 
                    InvalidValueMessage="!" 
                    IsValidEmpty="False" 
                    TooltipMessage="!"
                    Text="!">
                    </cc1:MaskedEditValidator>                 
                      
                    <asp:RequiredFieldValidator runat="server" 
                    ID="RequiredFieldValidator6" ControlToValidate="txtDia"
                    ErrorMessage="Seleccione el Dia." 
                    CssClass="validator" Text="!" 
                    ValidationGroup="Grupo1" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                                          
                <asp:TextBox ID="txtDia" runat="server" TabIndex="2" 
                        CssClass="CajasTextoObligatorio"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox2_CalendarExtender" 
                    runat="server" TargetControlID="txtDia" Format="dd/MM/yyyy"
                    onclientdateselectionchanged="callserver">
                </cc1:CalendarExtender>
                <asp:Button ID="btnFecha" runat="server" style="display:none" onclick="Button1_Click" Text="Button" />
                
                </td>
                </tr>
                <tr>
                <td>Moneda:&nbsp; </td>
                <td>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ValidationGroup="Grupo1"
                        ControlToValidate="cbxMoneda" ErrorMessage="Seleccione la Moneda." 
                        Operator="NotEqual" ValueToCompare="0">!</asp:CompareValidator>
                        
                <asp:DropDownList ID="cbxMoneda" runat="server" CssClass="CajasComboObligatorio" 
                        TabIndex="3" AutoPostBack="True" 
                        onselectedindexchanged="cbxMoneda_SelectedIndexChanged" ></asp:DropDownList></td>
                </tr>
                <tr>
                <td>T. de Conversion:&nbsp; </td>
                <td>
                
                <asp:CompareValidator ID="CompareValidator2" runat="server" ValidationGroup="Grupo1"
                        ControlToValidate="cbxTipoConversion" ErrorMessage="Seleccione el Tipo Conversión." 
                        Operator="NotEqual" ValueToCompare="0">!</asp:CompareValidator>
                        
                <asp:DropDownList ID="cbxTipoConversion" runat="server" CssClass="CajasComboObligatorio"
                        TabIndex="4" AutoPostBack="True" 
                        onselectedindexchanged="cbxTipoConversion_SelectedIndexChanged" ></asp:DropDownList></td>

                </tr>
                <tr>
                <td>T. de Cambio:&nbsp; </td>
                <td>

               

                <cc1:FilteredTextBoxExtender ID="FTE_TipoCambio" runat="server"
                            TargetControlID="txtTipoCambio" FilterType="Custom, Numbers" ValidChars="." >
                            </cc1:FilteredTextBoxExtender>
                
                <asp:TextBox ID="txtTipoCambio" MaxLength="14" runat="server" TabIndex="5" 
                        CssClass="CajasTextoObligatorio" Text="0.00"
                            onfocus="if(this.value=='0.00') this.value='';" 
                            onblur="if(this.value=='') this.value='0.00';" 
                        ></asp:TextBox>
                 
                 
                        
                        </td>
                </tr>
                <tr>
                <td>Comprobante:&nbsp; </td>
                <td><asp:TextBox ID="txtComprobante" runat="server" TabIndex="6" CssClass="CajasTextoEnabled" Enabled="false"></asp:TextBox></td>
                </tr>
                
                </table>
             </div>
        </fieldset>
           </div>
           <div id="AdminContent">
                <fieldset id="fieldDetalle" >
                 <legend>Asiento Detalle</legend>
                        <div id="DetalleUno">
                            <table id="tabla" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td style="width:110px" >Plan Cuentas:&nbsp;</td>
                        <td style="width:155px">
                            
                            <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server"
                            TargetControlID="txtPlanCuenta" FilterType="Custom, Numbers" ValidChars="" >
                            </cc1:FilteredTextBoxExtender>


                            
                            <asp:TextBox ID="txtPlanCuenta" runat="server" TabIndex="7" 
                                CssClass="CajasTexto" AutoPostBack="True" 
                                ontextchanged="txtPlanCuenta_TextChanged"></asp:TextBox></td>
                        <td style="width:25px" align="left">
                            <asp:ImageButton ID="btnPlanCuenta" runat="server" ToolTip="Agregar Plan de Cuentas." 
                                ImageUrl="~/images/botones/tick_circle.png" CausesValidation="False" 
                                onclick="btnPlanCuenta_Click" />
                                
                        </td>
                        
                        <td style="width:110px">
                            Flujo Caja:&nbsp;</td>
                        <td style="width:160px">
                            <asp:DropDownList ID="cbxFlujoCaja" runat="server" CssClass="CajasCombo" 
                                TabIndex="13">
                            </asp:DropDownList>
                        </td>
                        <td style="width:25px">
                            &nbsp;</td>
                    </tr>
                    <tr>
                    <td>Canal Contable:&nbsp;</td>
                    <td>
                   
                    <asp:Button ID="Button1" runat="server" style="display:none" onclick="Button1_Click" Text="Button" />
                        <asp:DropDownList ID="cbxCanalContable" runat="server" CssClass="CajasCombo" 
                            TabIndex="8">
                        </asp:DropDownList>
                    </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            T. Documento:&nbsp;</td>
                        <td>
                            <asp:DropDownList ID="cbxTDocumento" runat="server" CssClass="CajasCombo" 
                                TabIndex="14">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                    <td>Referencia:&nbsp;</td>
                    <td>
                        <asp:TextBox ID="txtReferencia" runat="server" TabIndex="9" 
                            CssClass="CajasTexto"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            F. Emision:&nbsp;</td>
                        <td>
                        
                        <cc1:MaskedEditExtender 
                        ID="MEE_FEmision" 
                        runat="server" Mask="99/99/9999" 
                        MaskType="Date" 
                        TargetControlID="txtFEmision" 
                        PromptCharacter="_"> 
                        </cc1:MaskedEditExtender>

                        <cc1:MaskedEditValidator 
                        ID="MEV_FEmision" 
                        runat="server" 
                        ControlExtender="MEE_FEmision" 
                        ControlToValidate="txtFEmision" 
                        EmptyValueMessage="*" 
                        InvalidValueMessage="*" 
                        IsValidEmpty="False" 
                        TooltipMessage="*"
                        Text="*"
                        >
                        </cc1:MaskedEditValidator>                            
                        
                            <asp:TextBox ID="txtFEmision" runat="server" TabIndex="15" 
                                CssClass="CajasTexto"></asp:TextBox>
                                
                           <cc1:CalendarExtender ID="ce_FEmision" 
                                runat="server" TargetControlID="txtFEmision" Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                                
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                    <td>Debe:&nbsp;</td>
                    <td>
                     <cc1:FilteredTextBoxExtender ID="FTE_txtDebe" runat="server"
                            TargetControlID="txtDebe" FilterType="Custom, Numbers" ValidChars="." >
                            </cc1:FilteredTextBoxExtender>
                            
                        <asp:TextBox ID="txtDebe" MaxLength="14" runat="server" TabIndex="10" CssClass="CajasTextoObligatorio"
                         Text="0.00" onblur="callDebe(this);" 
                            onfocus="if(this.value=='0.00') this.value='';" 
                            ontextchanged="txtDebe_TextChanged" AutoPostBack="True"
                        ></asp:TextBox>
                        
                        <%--<asp:Button ID="btnDebe" runat="server" style="display:none" onclick="Debe" />--%>
                        </td>

                        <td>&nbsp;</td>
                        <td>
                            Documento:&nbsp;</td>
                        <td><asp:TextBox ID="txtDocumento" runat="server" TabIndex="16"  MaxLength="20"
                                CssClass="CajasTexto"></asp:TextBox></td>

                        <td>
                            &nbsp;</td>

                    </tr>
                    <tr>
                    <td>Haber:&nbsp;</td>
                    <td>
                     <cc1:FilteredTextBoxExtender ID="FTE_txtHaber" runat="server"
                            TargetControlID="txtHaber" FilterType="Custom, Numbers" ValidChars="." >
                            </cc1:FilteredTextBoxExtender>
                    
                    <asp:TextBox ID="txtHaber" MaxLength="14" runat="server" TabIndex="11"
                    Text="0.00" onblur="if(this.value=='') this.value='0.00';"  onfocus="if(this.value=='0.00') this.value='';"
                     CssClass="CajasTextoObligatorio" 
                            ontextchanged="txtHaber_TextChanged" AutoPostBack="True"></asp:TextBox></td>
                        <td>&nbsp;</td>
                        <td>
                            Ruc Empresa:&nbsp;</td>
                        <td><asp:TextBox ID="txtRucEmpresa" runat="server" TabIndex="17" 
                                CssClass="CajasTexto" ontextchanged="txtRucEmpresa_TextChanged"></asp:TextBox></td>
                        <td align="left">
                            <asp:ImageButton ID="btnRucEmpresa" runat="server" 
                                ImageUrl="~/images/botones/tick_circle.png" CausesValidation="False" 
                                onclick="btnRucEmpresa_Click" />
                        </td>
                    </tr>
                    <tr>
                    <td>Proyecto:&nbsp;</td>
                    <td>
                        <asp:DropDownList ID="cbxProyecto" runat="server" CssClass="CajasCombo" 
                            TabIndex="12">
                        </asp:DropDownList>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            F. Vencimiento:&nbsp;</td>
                        <td>
                        <cc1:MaskedEditExtender 
                        ID="MEE_FVencimiento" 
                        runat="server" Mask="99/99/9999" 
                        MaskType="Date" 
                        TargetControlID="txtFVencimiento" 
                        PromptCharacter="_"> 
                        </cc1:MaskedEditExtender>

                        <cc1:MaskedEditValidator 
                        ID="MEV_FVencimiento" 
                        runat="server" 
                        ControlExtender="MEE_FVencimiento" 
                        ControlToValidate="txtFVencimiento" 
                        EmptyValueMessage="*" 
                        InvalidValueMessage="*" 
                        IsValidEmpty="False" 
                        TooltipMessage="*"
                        Text="*"
                        >
                        </cc1:MaskedEditValidator>                            
                        <asp:TextBox ID="txtFVencimiento" runat="server" TabIndex="18" Width="140px"
                                CssClass="CajasTexto"></asp:TextBox>
                                <cc1:CalendarExtender ID="ce_FVencimiento" 
                                runat="server" TargetControlID="txtFVencimiento" Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                            </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    
                    </table>
                        </div>
                        <div id="DetalleDos">
                            <table id="tabla" width="95%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                <td style="width:50px" >Area:&nbsp;</td>
                                <td>
                                    <asp:DropDownList ID="cbxArea" runat="server" TabIndex="19" 
                                        CssClass="CajasCombo" 
                                        onselectedindexchanged="cbxArea_SelectedIndexChanged" AutoPostBack="True">
                                    </asp:DropDownList>
                                    </td>
                                    <td align="left">
                            <asp:ImageButton ID="btnArea" runat="server" 
                                ImageUrl="~/images/botones/tick_circle.png" />
                        </td>
                                </tr>
                                <tr>
                                <td></td>
                                    <td align="right" >
                                        <asp:GridView ID="GridDistribucionAreas" runat="server" TabIndex="20" AutoGenerateColumns="False"
                                        ShowHeader="False" Width="90%"
                                            BorderStyle="None" BorderWidth="1px" CellPadding="1" GridLines="Horizontal"
                                        >
                                            
                                            <Columns>
                                                
                                                <asp:TemplateField>
                                                    <ItemTemplate >&nbsp; 
                                                        <asp:Label ID="txtNomUnidadNego" runat="server" CssClass="TextoAUN" Text='<%# Eval("BEUnidadesDeNegocio.NombreUnidadNegocio")%>' />
                                                        <asp:Label Visible="false" ID="lblParticipacion" runat="server" Text='<%# Eval("BEUnidadesDeNegocio_Areas.Participacion")%>'></asp:Label>
                                                        <asp:Label Visible="false" ID="lblUnidadNegocioID" runat="server" Text='<%# Eval("UnidadNegocioID")%>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                
                                                <asp:TemplateField>
                                                   <ItemTemplate>

                                                     <cc1:FilteredTextBoxExtender ID="FTE_txtImporte" runat="server"
                                                            TargetControlID="txtImporte" FilterType="Custom, Numbers" ValidChars="." >
                                                            </cc1:FilteredTextBoxExtender>
                                                   
                                                        <asp:TextBox id="txtImporte" CssClass="CajasTextoAUN" Width="70" MaxLength="14" runat="server"
                                                        Text='<%# Eval("ImporteSoles") %>'
                                                        onfocus="if(this.value=='0.00') this.value='';" 
                                                        onblur="if(this.value=='') this.value='0.00';" 
                                                        ></asp:TextBox>
                                                   </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                         </asp:GridView>
                                     </td>
                                    <td align="right">
                                        &nbsp;</td>
                                </tr>
                            </table>
                    </div>
                </fieldset>
           </div>

        </div>
            <div id="divBotones">
            
            <asp:Button ID="btnAgregar" runat="server" Text="Agregar" CssClass="ClsButton"
            CausesValidation="true" onclick="btnAgregar_Click" ValidationGroup="Grupo1" 
                    TabIndex="21"/> 

            <asp:Button ID="btnNuevo" runat="server"  Text="Cancelar" CssClass="ClsButton" 
            CausesValidation="false" onclick="btnNuevo_Click" 
            ValidationGroup="Grupo1" TabIndex="22"   />


            <asp:Button ID="btnGuardarRegresar" runat="server"  Text="Finalizar y Agregar" CssClass="ClsButton" 
            OnClick="btnGuardarRegresar_Click" ValidationGroup="Grupo2"  TabIndex="23" 
            /> 
            <asp:Button ID="btnGuardar" runat="server"  Text="Finalizar Asiento" CssClass="ClsButton" 
            OnClick="btnGuardar_Click" ValidationGroup="Grupo2"  TabIndex="24" /> 
            
      </div>
 
        <div id="divDetalleAsiento">
        
          <div class="LineaExportar EstTablaFiltroDatos"  >
                <table  style="width:100%" cellpadding="0" cellspacing="0" border="0" >
                <tr>
                <td style="width:50%;" class="TextLabel">
                              &nbsp; Diferencia Soles:
                              <b>
                              <asp:Label ID="lblDiferenciaSoles" runat="server" style="color: Red; font-weight:bold " Text="0.00"></asp:Label>
                              </b>
                              &nbsp;&nbsp; Diferencia Dolares: 
                              <b>
                              <asp:Label ID="lblDiferenciaDolares" runat="server" style="color: Red; font-weight:bold " Text="0.00"></asp:Label>
                              </b>
                          
                </td>
                <td style="width:50%;" align="right">
                    <asp:ImageButton runat="server" ID="ExcelExport" ImageUrl="~/images/page_excel.png" CommandName="ExportExcel" AlternateText="Excel" ToolTip="Excel" /> 
                    <asp:ImageButton runat="server" ID="PDFExport" ImageUrl="~/images/page_acrobat.png" CommandName="ExportPDF" AlternateText="Pdf" ToolTip="Pdf"  />
                    <asp:ImageButton runat="server" ID="WordExport" ImageUrl="~/images/page_word.png" CommandName="ExportWord" AlternateText="Word" ToolTip="Word" />
                    <asp:ImageButton runat="server" ID="CSVExport" ImageUrl="~/images/page_csv.png" CommandName="ExportCSV" AlternateText="CSV" ToolTip="CSV" />
                    <asp:ImageButton runat="server" ID="Print" ImageUrl="~/images/printer.png" CommandName="Print" AlternateText="Print" ToolTip="Imprimir" />
                    &nbsp;
                </td>
                </tr>
                </table>
              
              </div>
              
            <asp:Panel ID="panGrid" runat="server" Width="100%" Height="330px" ScrollBars="Vertical" CssClass="EstTablaFiltroDatos">
                     <asp:GridView ID="gvAsientoDetalle" runat="server" AutoGenerateColumns="false" CssClass="Grid" 
                     Width="1500px"
                     AllowSorting="True" DataKeyNames="AsientoContableDetalleIDTemp"
                     EmptyDataText="No hay Registros." onrowcommand="gvAsientoDetalle_RowCommand" onrowdatabound="gvAsientoDetalle_RowDataBound" 
                     >
                         <Columns>
                            <asp:TemplateField>
                             <HeaderStyle Width="20px" HorizontalAlign="Center" />                                           
                             <ItemStyle Width="20px" HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton Text='Editar' ToolTip="Editar" CausesValidation="false" CommandArgument='<%# Eval("AsientoContableDetalleIDTemp") %>' CommandName="Detalle" ID="Detalle1" ImageUrl="~/images/botones/editar.png" runat="server" />
                                    <asp:Label ID="lblTransferencia" runat="server" Text='<%# Eval("Transferencia") %>' ></asp:Label>
                                </ItemTemplate>          
                            </asp:TemplateField>
                            
                            <asp:BoundField DataField="PlanCuentaIDNombre" HeaderText="Plan Cuenta" HeaderStyle-Width="70px" />
                            <asp:BoundField DataField="CanalContableIDNombre" HeaderText="Canal. Cont." HeaderStyle-Width="70px"/>
                            <asp:BoundField DataField="Referencia" HeaderText="Referencia" HeaderStyle-Width="100px"/>
                            <asp:BoundField DataField="MontoDebe" DataFormatString="{0:N2}" HeaderText="Debe Soles" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="75px"/>
                            <asp:BoundField DataField="MontoHaber" DataFormatString="{0:N2}" HeaderText="Haber Soles" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="75px"/>
                            <asp:BoundField DataField="MontoDebeDolares" DataFormatString="{0:N2}" HeaderText="Debe Dolares" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="75px"/>
                            <asp:BoundField DataField="MontoHaberDolares" DataFormatString="{0:N2}" HeaderText="Haber Dolares" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="75px"/>
                            <asp:BoundField DataField="AreaIDNombre" HeaderText="Area" HeaderStyle-Width="80px"/>
                            
                            <asp:BoundField DataField="NombreUnidadNegocio_1" HeaderText="Uni. Negocio" HeaderStyle-Width="80px"/>
                            <asp:BoundField DataField="ProyectoIDNombre" HeaderText="Proyecto" HeaderStyle-Width="80px"/>
                            <asp:BoundField DataField="FlujoCajaIDNombre" HeaderText="Flujo Caja" HeaderStyle-Width="80px"/>
                            <asp:BoundField DataField="TipoDocumentoIDNombre" HeaderText="Tipo. Doc" HeaderStyle-Width="100px"/>
                            <asp:BoundField DataField="FechaEmision" HeaderText="Fecha Emision" DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="80px"/>
                            <asp:BoundField DataField="NumeroDocumento" HeaderText="Nro. Doc." HeaderStyle-Width="80px"/>
                            <asp:BoundField DataField="EmpresaIDRuc" HeaderText="RUC Empresa" HeaderStyle-Width="80px"/>
                            

                            <asp:TemplateField>
                             <HeaderStyle Width="20px" HorizontalAlign="Center" />                                           
                             <ItemStyle Width="20px" HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton Text='Editar' ToolTip="Editar" CausesValidation="false" CommandArgument='<%# Eval("AsientoContableDetalleIDTemp") %>' CommandName="Detalle" ID="Detalle" ImageUrl="~/images/botones/editar.png" runat="server" />
                                </ItemTemplate>          
                            </asp:TemplateField>
                            <asp:TemplateField>
                             <HeaderStyle Width="20px" HorizontalAlign="Center" />                                           
                             <ItemStyle Width="20px" HorizontalAlign="Center" />
                                
                                <ItemTemplate>
                                    <asp:ImageButton Text='Elimnar' ToolTip="Eliminar" CausesValidation="false" CommandArgument='<%# Eval("AsientoContableDetalleIDTemp") %>' CommandName="Eliminar" ID="Eliminar" ImageUrl="~/images/botones/delete.png" runat="server" />
                                </ItemTemplate>          
                            </asp:TemplateField>
                            <asp:TemplateField>
                             <HeaderStyle Width="20px" HorizontalAlign="Center" />                                           
                             <ItemStyle Width="20px" HorizontalAlign="Center" />
                                
                                <ItemTemplate>
                                    <asp:ImageButton Text='Ajustar' ToolTip="Ajustar" CausesValidation="false" CommandArgument='<%# Eval("AsientoContableDetalleIDTemp") %>' CommandName="Ajustar" ID="Ajustar" ImageUrl="~/images/botones/adjustcol.png" runat="server" />
                                </ItemTemplate>          
                            </asp:TemplateField>
                            
                         </Columns>
                     </asp:GridView>
             </asp:Panel>
        </div>
       <div class="TextLabel" style="width:100%">
            Row:&nbsp; <asp:Label ID="Cant" runat="server" Text="0" style="color: Red; font-weight:bold "></asp:Label>
            
            &nbsp;&nbsp;&nbsp;&nbsp; 
            Total Debe Soles:
              <b>
              <asp:Label ID="lblDebeSoles" runat="server" style="color: Red; font-weight:bold " Text="0.00"></asp:Label>
              </b>
              &nbsp;&nbsp; Total Haber Soles: 
              <b>
              <asp:Label ID="lblHaberSoles" runat="server" style="color: Red; font-weight:bold " Text="0.00"></asp:Label>
              </b>
             &nbsp;&nbsp;                 
            
            &nbsp;&nbsp; Total Debe Dolares:
              <b>
              <asp:Label ID="lblDebeDolares" runat="server" style="color: Red; font-weight:bold " Text="0.00"></asp:Label>
              </b>
              &nbsp;&nbsp; Total Haber Dolares: 
              <b>
              <asp:Label ID="lblHaberDolares" runat="server" style="color: Red; font-weight:bold " Text="0.00"></asp:Label>
              </b>
             &nbsp;&nbsp;                 
        </div>
        
        <asp:Button ID="btnSalir" runat="server" Text="Salir de la Pagina" style="display:none" onclick="btnSalir_Click" />
        </ContentTemplate>
      </asp:UpdatePanel>

      
    
    </div>
    
   
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="Grupo1" />

    
    
   <asp:Panel ID="PanelPlanCuenta" runat="server" CssClass="modalPopup"  Style="display:none">
           
           <div style="height:380px">
             <asp:UpdatePanel ID="PopupCuentas" runat="server">
                <ContentTemplate>
                 
                    <div style="padding-bottom:10px;">
                  <table cellpadding="0" cellspacing="0" border="0" width="100%"   class="EstTablaFiltroDatos">
                    <tr>
                        <td  style="height:10px; text-align:center; padding-bottom:3px;">
                        <div class="LineaExportar">Busqueda : Plan de Cuenta </div>   
                         
                         </td>
                    </tr>

                    <tr>
                        <td style="height:10px; text-align:center">
				        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td valign="top">
					        
                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablacontenido" >
                              <tr>
                                <td width="20%"></td>
                                <td width="80%"></td>
                              </tr>
                              <tr>
                                <td width="27%" class="tablapaginLeft">Codigo Plan Cuenta :</td>
                                <td width="73%" style="height:30px" align="left" class="tablapaginLeft" >
                                    <asp:TextBox ID="txtCodigo" runat="server" CssClass="EstControles" Width="28%" MaxLength="10"
                                        TabIndex="1" validationgroup="GrupoActivos"></asp:TextBox>
                                    &nbsp;
                                    <asp:Button ID="btnBuscar" runat="server" CssClass="ClsButton"
                                        onclick="btnBuscar_Click" Text="Buscar" CausesValidation="False" 
                                        Width="65px"  />
                                        
                                        
                                                            
                                  </td>
                              </tr>
                              

                            
                            </table>
                            
        					
					        </td>

                          </tr>
                          
                        </table>
				        </td>
                    </tr>
                </table>
                
             </div>
           
           
                    <asp:GridView ID="grvPDC" 
                                runat="server" 
                                AllowPaging="true" 
                                AllowSorting="True"  
                                AutoGenerateColumns="false" 
                                CssClass="Grid" 
                                EmptyDataText="No hay Registros con este creterio de Busqueda." 
                                GridLines="Both" 
                               onpageindexchanged="grvPDC_PageIndexChanged" 
                                onpageindexchanging="grvPDC_PageIndexChanging" 
                                onrowcommand="grvPDC_RowCommand" 
                                PageSize="13" Width="100%">
                                
                                <Columns>
                                    <asp:BoundField DataField="PlanCuentaID" HeaderText="PlanCuentaID"  Visible="false" />
                                     <asp:TemplateField HeaderText="Codigo">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lblCodigoPlancuentapdc" CommandName="enviar" CommandArgument='<%# Eval("CodigoPlanCuenta")%>' CausesValidation="false" CssClass="links" runat="server" Text='<%# Eval("CodigoPlanCuenta") %>' />
                                            <asp:Label ID="lblPlancuentaIDpdc" Text='<%# Eval("PlanCuentaID") %>' runat="server" Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:BoundField DataField="NombrePlanCuenta" HeaderStyle-Width="80%" HeaderText="Nombre Plan Cuenta" Visible="true" />
                               </Columns>
                            </asp:GridView>
           
                           
                </ContentTemplate>
         </asp:UpdatePanel>  
         
         <asp:Button ID="btnSalirCuenta" runat="server" CssClass="ClsButton" Text="Salir"  
                                        TabIndex="12" ToolTip="Salir" CausesValidation="False"  Width="65px"
                                        />
           </div>        
   </asp:Panel> 

   <asp:Panel ID="Panel_RucEmpresa" runat="server" CssClass="modalPopup"  Style="display:none">
        <div style="height:380px; text-align:center">
             <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                 
                    <div style="padding-bottom:10px;">
                  <table cellpadding="0" cellspacing="0" border="1" width="100%"   class="EstTablaFiltroDatos">
                    <tr>
                        <td  style="height:10px; text-align:center; padding-bottom:3px;">
                        <div class="LineaExportar">Busqueda : RUC Empresa </div>   
                         
                         </td>
                    </tr>

                    <tr>
                        <td style="height:10px;">
					        
                               <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablacontenido" >
                              <tr>
                                <td width="20%"></td>
                                <td width="80%"></td>
                              </tr>
                              <tr>
                                <td width="35%" class="tablapaginLeft">RUC Empresa :</td>
                                <td style="height:40px" align="left" class="tablapaginLeft" >
                                    <asp:TextBox ID="txtRucEmpresaBusq" runat="server" CssClass="EstControles" Width="48%" MaxLength="15"
                                        TabIndex="1" validationgroup="GrupoActivos"></asp:TextBox>
                                    &nbsp;
                                    <asp:Button ID="btnRucEmpresaBusq" runat="server" CssClass="ClsButton"
                                        Text="Buscar" CausesValidation="False" 
                                        Width="55px" onclick="btnRucEmpresaBusq_Click"  />
                                  </td>
                              </tr>
                              

                            
                            </table>
        					
					     
				        </td>
                    </tr>
                    <tr>
                    <td>
                
                <asp:GridView ID="gvRucEmpresa" 
                                runat="server" 
                                AllowPaging="true" 
                                AllowSorting="True"  
                                AutoGenerateColumns="false" 
                                CssClass="Grid" 
                                EmptyDataText="No hay Registros con este creterio de Busqueda." 
                                GridLines="Both" 
                               onpageindexchanged="gvRucEmpresa_PageIndexChanged" 
                                onpageindexchanging="gvRucEmpresa_PageIndexChanging" 
                                onrowcommand="gvRucEmpresa_RowCommand" 
                                PageSize="13" Width="100%">
                                
                                <Columns>
                                    <asp:BoundField DataField="EmpresaID" HeaderText="EmpresaID"  Visible="false" />
                                     <asp:TemplateField HeaderText="RUC Empresa">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lblRucEmpresa" CommandName="enviar" CommandArgument='<%# Eval("Ruc")%>' CausesValidation="false" CssClass="links" runat="server" Text='<%# Eval("Ruc") %>' />
                                            <asp:Label ID="lblEmpresaID" Text='<%# Eval("EmpresaID") %>' runat="server" Visible="false"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:BoundField DataField="Razonsocial" HeaderStyle-Width="60%" HeaderText="Nombre Empresa" Visible="true" />
                               </Columns>
                            </asp:GridView>
                 </td>
                 </tr>
                </table>
                
             </div>
             
              </ContentTemplate>
         </asp:UpdatePanel>  
           </div>        
             
           <asp:Button ID="btnRucEmpresaSalir" runat="server" CssClass="ClsButton" Text="Salir"  
           TabIndex="12" ToolTip="Salir" CausesValidation="False"  Width="55px"/>
        </div>
   </asp:Panel>
    
        <asp:HiddenField ID="h1" runat="server" />
        <cc1:modalpopupextender ID="ModalPopupExtender1" runat="server" TargetControlID="h1" 
            PopupControlID="PanelPlanCuenta" BackgroundCssClass="modalBackground" 
            CancelControlID="btnSalirCuenta">
        </cc1:modalpopupextender>        
        
        <asp:HiddenField ID="HFREmpresa" runat="server" />
          <cc1:modalpopupextender ID="MPE_RucEmpresa" runat="server" TargetControlID="HFREmpresa" 
            PopupControlID="Panel_RucEmpresa" BackgroundCssClass="modalBackground" 
            CancelControlID="btnRucEmpresaSalir">
        </cc1:modalpopupextender>     
        

  <%--  <asp:UpdateProgress ID="upTemplate" runat="server">

    <ProgressTemplate>
        <div class="fondoEmergente">&nbsp;</div>     
            <table border="0" cellpadding="0" cellspacing="0" class="msjEmergente">
                <tr>                   
                    <td bgcolor="#C1C2C4" width="280">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td align="center">
                                    <asp:Image ID="imgLoad" runat="server" ImageUrl="~/images/ajax-loader.gif" SkinID="ImgLoad" AlternateText="Procesando... Espere por favor" /></td>
                            </tr>
                            <tr>
                                <td align="center" class="txt_blank">
                                    Procesando... Espere por favor
                                </td>
                            </tr>
                           
                        </table>
                    </td>                    
                </tr>
            </table>
    </ProgressTemplate>

    </asp:UpdateProgress>
 --%>
            
    </form>
</body>
</html>
