689 lines
35 KiB
Plaintext
689 lines
35 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> <asp:Literal ID="LtlDepositoCaja" runat="server"></asp:Literal>
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
|
<%-- <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="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;">SubProyecto:</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>
|
|
|
|
</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-6" runat="server" >
|
|
<label style=" ">Cuenta Depósito:</label>
|
|
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" style="width: 300px;"></asp:DropDownList>
|
|
</div>
|
|
<div class="col-md-3" runat="server" style="text-align: left;">
|
|
<div class="col-md-1" >
|
|
<label style="width:70px;">Fecha:</label>
|
|
</div>
|
|
<div class="col-md-1" >
|
|
<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="Valida2"></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="Valida2"></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>
|
|
|
|
|
|
<div class="col-md-3" 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" >
|
|
<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-10 rowcheckCampos" id="DivComision" style="display: none;">
|
|
<div class="col-md-1" style="padding-right: 130px;">
|
|
<label>Importe:</label>
|
|
<asp:TextBox runat="server" ID="TxtComision" Class=" input-sm " Width="100px" onkeypress = "return numericOnly(this);" ondrop = "return false;" onpaste = "return false;" CssClass="Numeros"></asp:TextBox>
|
|
</div>
|
|
|
|
<div class="col-md-1" style="padding-right: 190px;">
|
|
<label>SubProyecto:</label>
|
|
<asp:DropDownList ID="DdlSubProyectoDeposito" 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>
|
|
|
|
<div class="col-md-1">
|
|
<label>Clasificación:</label>
|
|
<asp:DropDownList ID="DdlClasificacion" AutoPostBack="false" Class="table-group-action-input form-control input-inline input-small input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<div class="row rowcheck truncate" id="DivDescuentocheck" style="margin-top: -25px;">
|
|
<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-10 rowcheckCampos" id="DivDescuento" style="display: none">
|
|
|
|
<div class="col-md-1" style="padding-right: 130px;">
|
|
<label for="TxtDescuento">Importe:</label>
|
|
<asp:TextBox runat="server" ID="TxtDescuento" Class=" input-sm " Width="100px" onkeypress = "return numericOnly(this);" ondrop = "return false;" onpaste = "return false;" CssClass="Numeros"></asp:TextBox>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1" style="padding-right: 190px;">
|
|
<label>SubProyecto:</label>
|
|
<asp:DropDownList ID="DdlSubProyectoDescuento" 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>
|
|
|
|
<div class="col-md-2">
|
|
<label>Clasificación:</label>
|
|
<asp:DropDownList ID="DdlClasificacionDescuento" AutoPostBack="false" Class="table-group-action-input form-control input-inline input-small input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
|
</asp:DropDownList>
|
|
</div>
|
|
<div class="col-md-1">
|
|
<label>Emp:</label>
|
|
<asp:DropDownList ID="DdlPersonal" AutoPostBack="false" Class="table-group-action-input form-control input-inline input-small input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompleto" DataValueField="CvePersonal">
|
|
</asp:DropDownList>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row rowcheck truncate" id="DivIntercheck" style="margin-top: -25px;">
|
|
|
|
<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" id="DivInter" style="display: none">
|
|
<div class="col-md-1" id="dd" style="padding-right: 130px;">
|
|
<label>Intermediario:</label>
|
|
<asp:Dropdownlist ID="DdlProveedorIntermediario" CssClassDdl="select2me" Width="100px" CssStyle="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" runat="server"></asp:Dropdownlist>
|
|
</div>
|
|
<div class="col-md-2" style=" width: 205px;">
|
|
<div class="col-md-6" id="DivinterImporte" style="padding-left: 0px; padding-right: 0px;" >
|
|
<label>Importe:</label>
|
|
<asp:TextBox runat="server" ID="TxtComisionIntermediario" Class=" input-sm " Width="75px" onkeypress = "return numericOnly(this);" ondrop = "return false;" onpaste = "return false;" CssClass="Numeros"></asp:TextBox>
|
|
</div>
|
|
<div class="col-md-6" id="DivIVA" >
|
|
<label>IVA:</label>
|
|
<asp:TextBox runat="server" ID="TxtIVA" Class=" input-sm " Width="75px" onkeypress = "return numericOnly(this);" ondrop = "return false;" onpaste = "return false;" CssClass="Numeros"></asp:TextBox>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-1" id="dd2" style="margin-right: 100px;">
|
|
<label id="LblClasificacion3">Gasto:</label>
|
|
<asp:DropDownList ID="DdlClasificacionIntermediario" AutoPostBack="false" Class="table-group-action-input form-control input-inline input-small input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
|
|
</asp:DropDownList>
|
|
</div>
|
|
<div class="col-md-1" id="divSubProyectoIntermediario">
|
|
<label id="LblSubproyectoIntermediario">SubProyecto:</label>
|
|
|
|
<asp:DropDownList ID="DdlSubProyectoIntermediario" 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>
|
|
</div>
|
|
</div>
|
|
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
|
|
<asp:UpdatePanel ID="UpGvFacturas" runat="server" UpdateMode="Conditional">
|
|
<ContentTemplate>
|
|
<br />
|
|
<div style="height:450px;overflow-x:scroll">
|
|
<asp:GridView ID="GvFacturas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveVenta, CvePrePoliza, CveIE, TipoCambio, CveMoneda, CveCliente, IdCtaContableBancos, IdCtaContClientes, Importe, SerieFolio" 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)">
|
|
</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="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" />
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</asp:UpdatePanel>
|
|
|
|
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
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;
|
|
|
|
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
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 IVA superior a lo seleccionado")
|
|
} else {
|
|
saldo = ValorTotalSeleccionado - comision2 + comision - IVA - ComisionIntermediario;
|
|
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
|
|
descuento = ToDouble($('#C_TxtDescuento').val())
|
|
}
|
|
|
|
}
|
|
|
|
|
|
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;
|
|
$('#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;
|
|
$('#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 Recalcular() {
|
|
debugger;
|
|
var Comision = ToDouble($('#C_TxtComision').val());
|
|
var Descuento = ToDouble($('#C_TxtDescuento').val());
|
|
var IVA = ToDouble($('#C_TxtIVA').val());
|
|
var ImporteInter = ToDouble($('#C_TxtComisionIntermediario').val());
|
|
|
|
var total = ValorTotalSeleccionado + Comision - Descuento - IVA - ImporteInter
|
|
$('#C_lblValorTotal').text(FormatoNumero(total, 2));
|
|
debugger;
|
|
|
|
}
|
|
|
|
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>
|
|
|