Files
SIG/Bancos/DepositosCaja.aspx

836 lines
45 KiB
Plaintext

<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DepositosCaja.aspx.vb" Inherits="Bancos_DepositosCaja" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.checkbox label {
padding-left: 15px;
}
.checkbox {
width: 100%;
height: 100%;
}
.rowcheck {
margin-left: -5px;
padding-top: 10px;
}
.rowcheckCampos {
padding-left: 0px;
}
#DivComisioncheck {
border-top: 1px solid #e5e5e5;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Depósitos de Caja"></asp:Literal>&nbsp;<asp:Literal ID="LtlDepositoCaja" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:HyperLink ID="HplImprimirPDF" runat="server" Target="_blank" Visible="true"><i class="fa fa-file-pdf-o" style="color:#686868;"></i> Imprimir Poliza</asp:HyperLink>
</li>
<%-- <li>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate" style="width: 70px;">Cuenta:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCajaChica" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 200px">
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="width: 40px;">F.I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding-top: 0px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate" style="width: 40px;">F.F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding-top: 0px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate" style="width: 80px;">Tipo Pago:</label>
<div class="col-md-2">
<div class="row">
<asp:DropDownList ID="DdlTipoPago" runat="server" Width="75px" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" AutoPostBack="true" DataValueField="CveCuenta" OnSelectedIndexChanged="DdlTipoPago_SelectedIndexChanged" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
<asp:ListItem Value="8" Text="Transferencias"></asp:ListItem>
<asp:ListItem Value="11" Text="Tarjeta de Debito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
<asp:ListItem Value="-2" Text="Tarjetas"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DDlMesesSinIntereses" runat="server" Visible="false" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="40px">
<asp:ListItem Value="-1">MSI</asp:ListItem>
<asp:ListItem Value="3">3M</asp:ListItem>
<asp:ListItem Value="6">6M</asp:ListItem>
<asp:ListItem Value="9">9M</asp:ListItem>
<asp:ListItem Value="12">12M</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 truncate" style="width: 100px;">
<asp:Label ID="LblSub" runat="server" Text="SubProyecto"></asp:Label>:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyectos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Usuario:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlUsuario" runat="server" AppendDataBoundItems="true" DataTextField="Usuario" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpParametros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-bottom: 5px">
<div class="col-md-1" runat="server">
<label style="">Cuenta:</label>
</div>
<div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlCuentaDeposito_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" InitialValue="-1" CssClass="help-block errorimput" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida">
</asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRfvDdlCuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlCuentaDeposito" Width="350px"></ajax:ValidatorCalloutExtender>
<div id="divtcdeposito" runat="server" visible="False">
TC:
<asp:TextBox ID="TxtTCDeposito" Width="60px" runat="server"></asp:TextBox>
</div>
</div>
<div class="col-md-1">
<label style="width: 50px;">Fecha:</label>
</div>
<div class="col-md-2" runat="server" style="text-align: left;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding-top: 0; width: 140px !important;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFecha" PopupButtonID="ImgCalendarioFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-1" runat="server" id="divTipoPago1">
<label style="width: 100px;">Forma de Pago:</label>
</div>
<div class="col-md-1" runat="server" id="divTipoPago">
<asp:DropDownList ID="DdlTipoDeposito" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Value="-1" Text="Seleccione" Selected="True"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
<asp:ListItem Value="11" Text="Tarjeta de Débito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
<asp:ListItem Value="8" Text="Transferencia"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlTipoDeposito" runat="server" ControlToValidate="DdlTipoDeposito" InitialValue="-1" CssClass="help-block errorimput" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Forma de Pgo''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida">
</asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRfvDdlTipoDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoDeposito" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1" runat="server" id="divFolio" visible="false">
<div class="row">
<label style="width: 70px;">Folio:</label><asp:TextBox ID="TxtFolio" Width="60px" runat="server"></asp:TextBox>
</div>
</div>
<div class="col-md-1">
<label style="width: 70px;">Observaciones:</label>
</div>
<div class="col-md-2" runat="server" style="text-align: left;">
<asp:TextBox ID="TxtObservaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
</div>
<div class="col-md-2" style="text-align: right; font-size: 1.2em;" runat="server" id="divLabelTotal" visible="true">
<asp:Label runat="server">Seleccionado: $</asp:Label>
<asp:Label runat="server" ID="lblValorTotal">0.00</asp:Label>
<asp:Label runat="server" ID="lblValorTotalSeleccionado" Visible="false"></asp:Label>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpComisiones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row rowcheck truncate " id="DivComisioncheck" style="padding: 0px!important; margin: 0px!important">
<div class="col-md-1 truncate" runat="server" id="DivFaltante" style="width: 155px;">
<asp:CheckBox ID="ChkFaltante" runat="server" Text="Faltante/Sobrante" CssClass="checkbox" />
</div>
<div class="col-md-1 DivComision" style="display: none">
<div class="form-group form-md-line-input input-iconright" style="width: 100px">
<asp:TextBox runat="server" ID="TxtComision"
Width="100px" onkeypress="return numericOnly(this);"
ondrop="return false;" onpaste="return false;" CssClass="form-control Numeros"></asp:TextBox>
<label for="<%= TxtComision.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-2 DivComision" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoDeposito" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="form-control select2me" Width="100%">
</asp:DropDownList>
<label for="<%= DdlSubProyectoDeposito.ClientID.ToString()%>">SubProyecto:</label>
</div>
</div>
<div class="col-md-2 DivComision" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacion" AutoPostBack="false" Class="form-control select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%">
</asp:DropDownList>
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificación:</label>
</div>
</div>
</div>
<div class="row rowcheck truncate" id="DivDescuentocheck" runat="server" style="padding: 0px!important; margin: 0px!important">
<div class="col-md-1" runat="server" id="Div1" style="width: 155px">
<asp:CheckBox ID="ChkDescuento" runat="server" Text="Descuento" CssClass="checkbox" />
</div>
<div class="col-md-1 DivDescuento" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtDescuento" Width="100px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass="form-control Numeros"></asp:TextBox>
<label for="<%= TxtDescuento.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-1 DivDescuento" style="display: none" id="divdescuento2" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoDescuento" Width="100px" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control select2me">
</asp:DropDownList>
<label for="<%= DdlSubProyectoDescuento.ClientID.ToString()%>">SubProyecto:</label>
</div>
</div>
<div class="col-md-2 DivDescuento" style="display: none" id="divdescuento3" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacionDescuento" Width="100%" AutoPostBack="false" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control select2me">
</asp:DropDownList>
<label for="<%= DdlClasificacionDescuento.ClientID.ToString()%>">Clasificación:</label>
</div>
</div>
<div class="col-md-2 DivDescuento" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPersonal" AutoPostBack="false" Width="100%" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control select2me">
</asp:DropDownList>
<label for="<%= DdlPersonal.ClientID.ToString()%>">Empleado:</label>
</div>
</div>
</div>
<div class="row rowcheck truncate" id="DivIntercheck" runat="server" style="padding: 0px!important; margin: 0px!important">
<div class="col-md-1" runat="server" id="Div2" style="width: 155px">
<asp:CheckBox ID="ChkIntermediario" runat="server" Text="Intermediario" CssClass="checkbox" />
</div>
<div class="col-md-10 rowcheckCampos xspadding" id="DivInter" style="display: none">
<div class="col-md-1" id="dd">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlProveedorIntermediario" CssClass="form-control select2me" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" runat="server"></asp:DropDownList>
<label for="<%= DdlProveedorIntermediario.ClientID.ToString()%>">Intermediario:</label>
</div>
</div>
<div class="col-md-1" id="DivinterImporte">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtComisionIntermediario" Width="75px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass=" form-control Numeros"></asp:TextBox>
<label for="<%= TxtComisionIntermediario.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-1" id="DivIVA">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtIVA" Width="75px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass="form-control Numeros"></asp:TextBox>
<label for="<%= TxtIVA.ClientID.ToString()%>">IVA:</label>
</div>
</div>
<div class="col-md-1" id="dd2" style="margin-right: 100px;">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacionIntermediario" AutoPostBack="false" Class=" form-control select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
</asp:DropDownList>
<label for="<%= DdlClasificacionIntermediario.ClientID.ToString()%>">
<label id="LblClasificacion3">Gasto:</label></label>
</div>
</div>
<div class="col-md-2" id="divSubProyectoIntermediario">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoIntermediario" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control select2me">
</asp:DropDownList>
<label for="<%= DdlSubProyectoIntermediario.ClientID.ToString()%>">
<label id="LblSubproyectoIntermediario">SubProyecto:</label></label>
</div>
</div>
</div>
</div>
<div class="row rowcheck truncate" id="DivRowCuenta" style="padding: 0px!important; margin: 0px!important" runat="server" visible="false">
<div class="col-md-1" runat="server" id="Div3" style="width: 155px">
<asp:CheckBox ID="ChkCuentaRetorno" runat="server" Text="Caja" CssClass="checkbox" />
</div>
<div class="col-md-1 DivRowCuenta2" id="DivCuentaImporte" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtCuentaRetorno" Width="100px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass=" form-control Numeros"></asp:TextBox>
<label for="<%= TxtCuentaRetorno.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-6 DivRowCuenta2" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtCuentaRetornoObs" Width="100%" CssClass=" form-control"></asp:TextBox>
<label for="<%= TxtCuentaRetornoObs.ClientID.ToString()%>">Obs:</label>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpGvFacturas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<br />
<div style="height: 250px; overflow-x: scroll">
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, Importe, SerieFolio,CveCuenta,CveSubProyecto" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" class="form-check-input" id="ChkSelector" onclick="SelectorNotas(this)" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkFactura" CssClass="CssSelector" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Factura">
<ItemTemplate>
<asp:HyperLink ID="LtSerieFolio" runat="server" ClientIDMode="Static" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveVenta", "/Ventas/Ventas.aspx?CveVenta={0}") %>'>></asp:HyperLink>
</ItemTemplate>
<ItemStyle></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtFecha" runat="server" ClientIDMode="Static" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente">
<ItemTemplate>
<asp:Literal ID="LtCliente" runat="server" ClientIDMode="Static" Text='<%# Eval("Cliente")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo Pago">
<ItemTemplate>
<asp:Literal ID="LtTipoPago" runat="server" ClientIDMode="Static" Text='<%# Eval("TipoPago")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sob/Fal" ItemStyle-Width="20px">
<ItemTemplate>
<asp:Literal ID="LtlSobranteFaltante" runat="server" ClientIDMode="Static" Text='<%# Eval("SobranteFaltante", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Literal ID="LtImporte" runat="server" ClientIDMode="Static" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDepositar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="width: 100%; text-align: center;">
<div style="display: inline-block">
<br />
<br />
<asp:Button ID="BtnDepositar" runat="server" Text="Depósitar" CssClass="btn btn-primary" ValidationGroup="Valida" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Scripts/PrintJS/print.min.js"></script>
<script type="text/javascript" language="javascript">
function impresionBase64(pdfBase64) {
printJS({ printable: pdfBase64, type: 'pdf', showModal: true, base64: true });
}
var specialKeys = new Array();
specialKeys.push(9); //Backspace
function numericOnly(elementRef) {
var keyCodeEntered = (event.which) ? event.which : (window.event.keyCode) ? window.event.keyCode : -1;
if ((keyCodeEntered >= 48) && (keyCodeEntered <= 57)) {
return true;
}
else if (keyCodeEntered == 46) {
if ((elementRef.value) && (elementRef.value.indexOf('.') >= 0)) {
return false;
}
else {
return true;
}
}
else if (keyCodeEntered == 45) {
var tamaño = elementRef.value.length;
if (tamaño == 0) {
if ((elementRef.value) && (elementRef.value.indexOf('-') >= 0)) {
return false;
}
else {
debugger;
return true;
}
}
}
return false;
}
var ValorTotalSeleccionado = 0
var comision = 0;
var descuento = 0;
var saldo = 0;
var IVA = 0;
var ComisionIntermediario = 0;
var CuentaRetorno = 0;
function FnSuma(chk, cantidad) {
var saldoInicial = ToDouble($('#C_lblValorTotal').text());
var ValorTotalSeleccionado2 = 0;
$('#C_GvFacturas input[type=checkbox]').each(
function () {
if (this.checked) {
ValorTotalSeleccionado2 = ValorTotalSeleccionado2 + ToDouble(FormatoNumero($(this).val(), 2));
}
}
);
ValorTotalSeleccionado = ValorTotalSeleccionado2;
if (chk.checked == false) {
cantidad = cantidad * -1;
}
saldoInicial = saldoInicial + cantidad;
$('#C_lblValorTotal').text(FormatoNumero(saldoInicial, 2));
$('#C_lblValorTotalSeleccionado').text(FormatoNumero(ValorTotalSeleccionado, 2));
if ($('#C_ChkFaltante').attr('checked')) {
var txtcomision = ToDouble($('#C_TxtComision').val());
if (txtcomision != 0) {
var comisionNegativa = 0;
if (txtcomision < 0) {
comisionNegativa = txtcomision * -1;
}
if (comisionNegativa > saldo) {
//var opcion = confirm("El importe especificado es superior a lo seleccionado, está seguro?");
//if (opcion != true) {
// debugger;
// $('#C_TxtComision').val(0);
// comision = 0;
// descuento = 0;
// txtcomision = 0;
// //alert("No es posible poner un importe Faltante/Sobrante superior a lo seleccionado");
// saldo = 0;
// $('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
//}
} else {
//debugger;
}
}
}
if ($('#C_ChkDescuento').attr('checked')) {
var txtdescuento = ToDouble($('#C_TxtDescuento').val());
if (txtdescuento != 0) {
var DescuentoNegativa = 0;
if (txtdescuento > 0) {
DescuentoNegativa = txtdescuento * -1;
}
if (DescuentoNegativa > saldo) {
$('#C_TxtDescuento').val(0);
comision = 0;
descuento = 0;
txtdescuento = 0;
alert("No es posible poner un descuento superior a lo seleccionado");
saldo = 0;
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
} else {
//saldo = ValorTotalSeleccionado + txtdescuento + comision;
//$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
//descuento = ToDouble($('#C_TxtDescuento').val())
//debugger;
}
}
}
if ($('#C_ChkIntermediario').attr('checked')) {
var txtimporte = ToDouble($('#C_TxtComisionIntermediario').val());
if (txtimporte != 0) {
var DescuentoNegativa = 0;
if (txtimporte > 0) {
DescuentoNegativa = txtimporte * -1;
}
if (DescuentoNegativa > saldo) {
$('#C_TxtDescuento').val(0);
comision = 0;
descuento = 0;
IVA = 0;
txtimporte = 0;
alert("No es posible poner un descuento superior a lo seleccionado");
saldo = 0;
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
} else {
//saldo = ValorTotalSeleccionado + txtdescuento + comision;
//$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
//descuento = ToDouble($('#C_TxtDescuento').val())
//debugger;
}
}
var txtcomision = ToDouble($('#C_TxtIVA').val());
if (txtcomision != 0) {
var comisionNegativa = 0;
if (txtcomision < 0) {
comisionNegativa = txtcomision * -1;
}
if (comisionNegativa > saldo) {
$('#C_TxtIVA').val(0);
comision = 0;
descuento = 0;
IVA = 0;
ComisionIntermediario = 0;
txtcomision = 0;
alert("No es posible poner un importe IVA superior a lo seleccionado");
saldo = 0;
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
} else {
//debugger;
}
}
}
if ($('#C_ChkCuentaRetorno').attr('checked')) {
var txtcuentaretorno = ToDouble($('#C_TxtCuentaRetorno').val());
if (txtcuentaretorno != 0) {
var DescuentoNegativa = 0;
if (txtcuentaretorno > 0) {
DescuentoNegativa = txtcuentaretorno * -1;
}
if (DescuentoNegativa > saldo) {
$('#C_TxtCuentaRetorno').val(0);
comision = 0;
descuento = 0;
txtdescuento = 0;
alert("No es posible poner un descuento superior a lo seleccionado");
saldo = 0;
$('#C_lblValorTotal').text(FormatoNumero(ValorTotalSeleccionado, 2));
} else {
//saldo = ValorTotalSeleccionado + txtdescuento + comision;
//$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
//descuento = ToDouble($('#C_TxtDescuento').val())
//debugger;
}
}
}
}
function txtSuma(txt) {
var comision2 = ToDouble($('#C_TxtComision').val());
var comisionNegativa = 0;
if (comision2 < 0) {
comisionNegativa = comision2 * -1;
}
//if (comisionNegativa > ValorTotalSeleccionado) {
// var opcion = confirm("El importe especificado es superior a lo seleccionado, está seguro?");
// if (opcion != true) {
// debugger;
// $('#C_TxtComision').val(0)
// // alert("No es posible poner una comision superior a lo seleccionado")
// }
//} else {
saldo = ValorTotalSeleccionado + comision2 + descuento - IVA - ComisionIntermediario;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
comision = ToDouble($('#C_TxtComision').val())
//}
}
function txtSumaDescuento(txt) {
var comision2 = ToDouble($('#C_TxtDescuento').val());
if (comision2 > ValorTotalSeleccionado) {
$('#C_TxtDescuento').val(descuento)
alert("No es posible poner un valor superior a lo seleccionado")
} else {
saldo = ValorTotalSeleccionado - comision2 + comision - IVA - ComisionIntermediario - CuentaRetorno;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
descuento = ToDouble($('#C_TxtDescuento').val())
}
}
function txtSumaCuentaRetorno(txt) {
var comision2 = ToDouble($('#C_TxtCuentaRetorno').val());
saldo = ValorTotalSeleccionado + comision2 + comision - IVA - ComisionIntermediario;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
}
function txtSumaIVA(txt) {
var comision2 = ToDouble($('#C_TxtIVA').val());
if (comision2 > ValorTotalSeleccionado) {
$('#C_TxtIVA').val(IVA);
alert("No es posible poner un IVA superior a lo seleccionado");
} else {
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - ComisionIntermediario - CuentaRetorno;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
IVA = ToDouble($('#C_TxtIVA').val());
}
}
function txtSumaTntermediario(txt) {
var comision2 = ToDouble($('#C_TxtComisionIntermediario').val());
if (comision2 > ValorTotalSeleccionado) {
//$('#C_TxtComisionIntermediario').val(ComisionIntermediario);
//alert("No es posible poner un importe superior a lo seleccionado");
} else {
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - IVA - CuentaRetorno;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
ComisionIntermediario = ToDouble($('#C_TxtComisionIntermediario').val());
}
}
function CheckFaltante(chk) {
if (chk.checked == true) {
$('.DivComision').css("display", "block");
$('#DivComisioncheck').removeClass("truncate");
$("#DivDescuentocheck").css("margin-top", 0);
} else {
$('#C_TxtComision').val(0);
Recalcular();
$('.DivComision').css("display", "none");
$('#DivComisioncheck').addClass("truncate");
$("#DivDescuentocheck").css("margin-top", -25);
}
}
function CheckDescuento(chk) {
if (chk.checked == true) {
$('.DivDescuento').css("display", "block");
$('#DivDescuentocheck').removeClass("truncate");
$("#DivIntercheck").css("margin-top", 0);
} else {
$('#C_TxtDescuento').val(0);
Recalcular();
$('.DivDescuento').css("display", "none");
$('#DivDescuentocheck').addClass("truncate");
$("#DivIntercheck").css("margin-top", -25);
}
}
function CheckIntermediario(chk) {
if (chk.checked == true) {
$('#DivInter').css("display", "block");
$('#DivIntercheck').removeClass("truncate");
} else {
$('#C_TxtIVA').val(0);
$('#C_TxtComisionIntermediario').val(0);
Recalcular();
$('#DivInter').css("display", "none");
$('#DivIntercheck').addClass("truncate");
}
}
function CheckRowCuenta(chk) {
if (chk.checked == true) {
$('.DivRowCuenta2').css("display", "block");
$('#DivRowCuenta').removeClass("truncate");
} else {
$('#C_TxtCuentaRetorno').val(0);
Recalcular();
$('.DivRowCuenta2').css("display", "none");
$('#DivRowCuenta').addClass("truncate");
}
}
function Recalcular() {
let Comision = ToDouble($('#C_TxtComision').val());
let Descuento = 0;
let ImporteInter = 0;
let IVA = 0;
if ('<%= If(UsuarioActual.CveEmpresa = 189, "0", "1") %>' == '1') {
Descuento = ToDouble($('#C_TxtDescuento').val());
ImporteInter = ToDouble($('#C_TxtComisionIntermediario').val());
IVA = ToDouble($('#C_TxtIVA').val());
}
let ImporteCuentaRetorno = ToDouble($('#C_TxtCuentaRetorno').val());
let total = ValorTotalSeleccionado + Comision - Descuento - IVA - ImporteInter + ImporteCuentaRetorno;
$('#C_lblValorTotal').text(FormatoNumero(total, 2));
}
function Depositar() {
LimppiarVariables();
}
function Consultar() {
LimppiarVariables();
}
function LimppiarVariables() {
ValorTotalSeleccionado = 0;
comision = 0;
descuento = 0;
saldo = 0;
IVA = 0;
ComisionIntermediario = 0;
}
function SelectorNotas(Chk) {
$(`.CssSelector input[type=checkbox]`).each(function () {
if (Chk.checked) {
if (!$(this).prop('checked')) {
$(this).click();
}
} else {
if ($(this).prop('checked')) {
$(this).click();
}
}
});
}
</script>
</asp:Content>