<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frm_NuevoDeposito.aspx.vb" Inherits="SGHweb.frm_NuevoDeposito" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
  <!-- noty -->
  <script type="text/javascript" src="../Scripts/noty/jquery.noty.js"></script>
  <!-- themes -->
  <script type="text/javascript" src="../Scripts/noty/themes/default.js"></script>
  <script type="text/javascript" src="../Scripts/noty/layouts/center.js"></script>
  <link rel="stylesheet" type="text/css" href="../Scripts/noty/buttons.css" />

<style type="text/css">
div.RadToolBar .rtbUL
{
    width: 95%;
    height: 90%;
    white-space: normal;
}
div.RadToolBar .rightButton
{
    float: right;
}
.divResponsables {
	border:1px solid #8db2e3;
	margin-left:0.2em;
	/*margin-bottom:0.5em;*/
	padding:0.1em;
	font-size:1em;
	overflow:hidden;
	width:90%;
	text-align:center;
}
.divFiltros
{
	border:1px solid #8db2e3;
	padding:0.2em;
	font-size:1em;
	overflow:hidden;
	width:100%;
	text-align:center;
}
.divBoton
{
	border:1px solid #8db2e3;
	padding:0.28em;
	font-size:1em;
	overflow:hidden;
	width:100%;
}
.small.button, .small.button:visited {
font-size: 15px ;
}
/* botones extra grandes */
.super.button, .super.button:visited {
font-size: 34px;
}

.blue.button, .blue.button:visited { background-color: #3c7fb1;
top: 0px;
left: 0px;
width: 176px;
height: 37px;
}

.divtableInterior {
	/*border:1px solid #8db2e3;*/
	font-size:1em;
	overflow:hidden;
	width:100%;
	text-align:center;
}
</style>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script>
    // Abrir Ventana Empresas //
    function abrir_ventana_empresas() {
        var oWnd = $find("<%= RadWindow1.ClientID %>");
    var texto_digitado = document.getElementById('<%= txt_empresa.ClientId %>').value;
    var ruta_ventana_empresas = "../Ctrl_Grillas_Emergentes.aspx?accion=Empresas_sin_inicio&texto_digitado=" + texto_digitado
    oWnd.setUrl(ruta_ventana_empresas);
    oWnd.add_close(Ventana_buscarEmpresas_Cerrar);
    oWnd.show();
    return false;
}
function Ventana_buscarEmpresas_Cerrar(oWnd, args) {
    var arg = args.get_argument();
    var oWnd = $find("<%= RadWindow1.ClientID %>");
    oWnd.remove_close(Ventana_buscarEmpresas_Cerrar);
    if (arg) {
        var empresaid = arg.cell_id.trim();
        var razonsocial = arg.cell_valor.trim();
        //var txt_empresaid = $find('<%= txt_empresaid.ClientID %>');
        document.getElementById('<%= txt_empresa.ClientId %>').value = razonsocial;
        document.getElementById('<%= txt_empresaID.ClientID%>').value = empresaid;
        //txt_empresaid.set_value(empresaid);
    }
    document.getElementById('<%= txt_empresa.ClientId %>').focus();

}
// FIN Abrir Ventana Empresas //
function abrirReservasGrilla() {
    var oWnd = $find("<%= RadWindow1.ClientID %>");
    oWnd.setSize(1000, 400);
    
    var EmpresaID = document.getElementById('<%= txt_empresaID.ClientID%>').value;
    var Empresa = document.getElementById('<%= txt_empresa.ClientID%>').value;
    var Moneda = "<%= Request.QueryString("Moneda").ToString %>";
    //var Reserva = document.getElementById('TB_Reserva');
    var Reserva = "<%= Request.QueryString("Reservas").ToString()%>";
    var VoucherID = "<%= Request.QueryString("VoucherID").ToString()%>";
    

    if (Moneda == "Soles") {
        var MonedaID = 1;
    } else {
        var MonedaID = 2;
    }

    if (EmpresaID.value == 0) {
        EmpresaID.value = '';
    }
    
    if (VoucherID == 0 || Reserva == 0) {
        var tipo = 1
    } else {
        var tipo = 2
    }
    var ruta_ventana_reservas = "frm_GrillaReservas.aspx?VoucherID=" + VoucherID + "&Tipo=" + tipo + "&EmpresaID=" + EmpresaID + "&Empresa=" + Empresa + "&MonedaID=" + MonedaID;
    oWnd.setUrl(ruta_ventana_reservas);
    oWnd.add_close(cerrarReservasGRilla);
    oWnd.show();
    return false;
}
function cerrarReservasGRilla(oWnd, args) {
    var Reservas = document.getElementById('<%= txt_reservas.ClientID%>');
    var arg = args.get_argument();
    var oWnd = $find("<%= RadWindow1.ClientID %>");
    oWnd.remove_close(cerrarReservasGRilla);

    var mensaje = 'Reservas Asiganadas';

    GenerarAlerta('confirmation', mensaje);
    Reservas.value = mensaje;
    //alert('<%= Session("ReservasSeleccionadas") %>');
}

function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow)
        oWindow = window.radWindow;
    else if (window.frameElement.radWindow)
        oWindow = window.frameElement.radWindow;
    return oWindow;
}

function Close() {
    var oWindow = GetRadWindow();
    oWindow.argument = null;
    oWindow.close();
    return false;
}

function GenerarAlerta(type, texto) {
    var n = noty({
        text: texto,
        type: type,
        dismissQueue: true,
        layout: 'center',
        modal: true,
        theme: 'defaultTheme'
    });
    console.log(type + ' - ' + n.options.id);
    return n;
    enableToolBar();
}
</script>

<script>
    function disableToolBar() {
        
        var toolBar = $find("<%=RadToolBar1.ClientID %>");
        var button = toolBar.findItemByText("Guardar");
        button.set_enabled(false);
        if (button.enabled = true)
        {
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
            ajaxManager.ajaxRequest("Guardar");
            //Close();
            button.set_enabled(false);
        }
        }
        
        
    function enableToolBar() {
        var toolBar = $find("<%=RadToolBar1.ClientID %>");
        var button = toolBar.findItemByText("Guardar");
        button.set_enabled(true);
    }

    function OcultarTC() {
        //alert('Ocultar');
        document.getElementById('trTarjetaCredito').style.display = 'none';
    }

    function MostrarTC() {
        //alert('Mostrar');
        document.getElementById('trTarjetaCredito').style.display = 'table-row';
    }
</script>
</telerik:RadCodeBlock>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="WebBlue" Width="100%">
            <Items>
                <telerik:RadToolBarButton runat="server" Font-Names="Arial" Font-Size="9pt" ForeColor="White"
                    ImageUrl="~/SIG/Resources/Cancel_PopUp.png" Text="Cancelar" CausesValidation="False" 
                    onclick="Close();" OuterCssClass="rightButton" >
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton runat="server" Font-Names="Arial" Font-Size="9pt" ForeColor="White"
                    ImageUrl="~/SIG/Resources/Update_Popup.png" Text="Guardar" OuterCssClass="rightButton" onclick="disableToolBar();"  >
                </telerik:RadToolBarButton>
            </Items>
        </telerik:RadToolBar>
        <dt class="divResponsables" style="width: 99%;">
    

    <table width="100%" border="0px" 
                style="font-family: 'Times New Roman', Times, serif; font-size: small; color: #333333">
        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                            <td style=" text-align:right; width:13%; font-weight: bold;" >
                                Fecha:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadDatePicker ID="dp_fecha" runat="server" Width="30%">
                                    
                                </telerik:RadDatePicker>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                            <td style=" text-align:right; width:13%; font-weight: bold;">
                                Importe:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadNumericTextBox ID="txtImporte" runat="server" Font-Bold="True" 
                                    style="text-align:right" Width="30%" MinValue="0" Value="0" Culture="es-PE" DbValueFactor="1" LabelWidth="40%" MaxValue="999999999999999">
                                    <NumberFormat ZeroPattern="n"  GroupSeparator="" DecimalSeparator="."></NumberFormat> 
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                            <td style=" text-align:right; width:13%; font-weight: bold;" >
                                C.Banco Ext.:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadNumericTextBox ID="txtBExt" runat="server" Font-Bold="True" 
                                    style="text-align:right" Width="30%" MinValue="0" Value="0" Culture="es-PE" DbValueFactor="1" LabelWidth="40%" MaxValue="999999999999999">
<NegativeStyle Resize="None"></NegativeStyle>

                                    <NumberFormat ZeroPattern="n" GroupSeparator="" DecimalSeparator="." AllowRounding="False"></NumberFormat> 

<EmptyMessageStyle Resize="None"></EmptyMessageStyle>

<ReadOnlyStyle Resize="None"></ReadOnlyStyle>

<FocusedStyle Resize="None"></FocusedStyle>

<DisabledStyle Resize="None"></DisabledStyle>

<InvalidStyle Resize="None"></InvalidStyle>

<HoveredStyle Resize="None"></HoveredStyle>

<EnabledStyle Resize="None"></EnabledStyle>
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                            <td style=" text-align:right; width:13%; font-weight: bold;">
                                C.Banco N.:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadNumericTextBox ID="txtBN" runat="server" Font-Bold="True" 
                                    style="text-align:right" Width="30%" MinValue="0" Value="0" Culture="es-PE" DbValueFactor="1" LabelWidth="40%" MaxValue="999999999999999">
<NegativeStyle Resize="None"></NegativeStyle>

                                    <NumberFormat ZeroPattern="n" GroupSeparator="" DecimalSeparator="." AllowRounding="False"></NumberFormat> 

<EmptyMessageStyle Resize="None"></EmptyMessageStyle>

<ReadOnlyStyle Resize="None"></ReadOnlyStyle>

<FocusedStyle Resize="None"></FocusedStyle>

<DisabledStyle Resize="None"></DisabledStyle>

<InvalidStyle Resize="None"></InvalidStyle>

<HoveredStyle Resize="None"></HoveredStyle>

<EnabledStyle Resize="None"></EnabledStyle>
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                             <td style=" text-align:right; width:13%; font-weight: bold;">
                                Operacion:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadTextBox ID="txt_operacion" runat="server" Width="30%">
                                </telerik:RadTextBox>
                            </td> 
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                             <td style=" text-align:right; width:13%; font-weight: bold;">
                                Referencia:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadTextBox ID="txt_referencia" runat="server" TextMode="MultiLine" Width="100%" Rows="3">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                             <td style=" text-align:right; width:13%; font-weight: bold;">
                                Empresa:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadTextBox ID="txt_empresa" runat="server" Text="" OnClick="abrir_ventana_empresas();" Width="95%">
                                </telerik:RadTextBox>
                                <telerik:RadTextBox ID="txt_empresaID" runat="server" text="0" Width="1%" style="display:none">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                             <td style=" text-align:right; width:13%; font-weight: bold;">
                                Reservas:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadTextBox ID="txt_reservas" runat="server" OnClick="abrirReservasGrilla();" Width="40%">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>
        <tr id="trTarjetaCredito" runat="server" style="display:none">
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                                <td style=" text-align:right; width:13%; font-weight: bold;">
                                Tipo Tarjeta:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <telerik:RadComboBox ID="cbxTarjetaCredito" runat="server" AppendDataBoundItems="True" DataSourceID="SDS_TarjetaCredito" DataTextField="NombreTarjetaCredito" DataValueField="TarjetaCreditoId">
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Text="-Seleccione-" Value="0" />
                                    </Items>
                                </telerik:RadComboBox>
                                <asp:SqlDataSource ID="SDS_TarjetaCredito" runat="server" SelectCommand="SELECT [TarjetaCreditoId], [NombreTarjetaCredito] FROM [TarjetaCreditos]"></asp:SqlDataSource>
                            </td>
                        </tr>
                    </table>
                </dt>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <dt class="divtableInterior">
                    <table width="100%" border=0>
                        <tr>
                            <td style=" text-align:right; width:30%; font-weight: bold;" >
                                Tipo Deposito:  
                            </td>
                            <td style=" text-align:left; width:30%">
                                <asp:RadioButton ID="RadioButton1" onClick="OcultarTC();" GroupName="Tipo" runat="server" Checked="true" Text="Deposito" /><br />
                                <asp:RadioButton ID="RadioButton2" onClick="OcultarTC();" GroupName="Tipo" runat="server" Text="Venta Directa" /><br />
                                <asp:RadioButton ID="RadioButton3" onClick="OcultarTC();" GroupName="Tipo" runat="server" Text="Detracion" /><br />
                                <asp:RadioButton ID="RadioButton4" onClick="OcultarTC();" GroupName="Tipo" runat="server" Text="Tarjeta de credito" /><br />
                                <asp:RadioButton ID="RadioButton5" onClick="OcultarTC();" GroupName="Tipo" runat="server" Text="Cobranza en efectivo" />
                            </td>
                            <td style=" text-align:right; width:10%; font-weight: bold;" >
                                
                            </td>
                            <td style=" text-align:left; width:15%">
                                
                            </td>
                            <td style=" text-align:right; width:10%; font-weight: bold;" >
                            </td>
                            <td style=" text-align:left; width:15%">
                            </td>
                        </tr>
                        
                    </table>
                </dt>
            </td>
        </tr>
    </table>

</dt>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
         <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" style="display:none;" VisibleStatusbar="False" 
                        ShowContentDuringLoad="False" Width="700px" Skin="Windows7" AutoSize="true">
                </telerik:RadWindow>
                <telerik:RadWindow ID="RadWindow2" runat="server" style="display:none;" VisibleStatusbar="False" 
                        ShowContentDuringLoad="False"  Skin="Windows7">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
    </div>
    </form>
</body>
</html>
