Files
SIG/Bancos/PolizaCheque.aspx
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

558 lines
31 KiB
Plaintext

<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PolizaCheque.aspx.vb" Inherits="Bancos_PolizaCheque" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<link href="/Metronic/assets/global/plugins/dropzone/css/dropzone.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblEncabezado" runat="server" Text="Otros Egresos"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPPDocumento" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="chequesie">
<div class="chequesie1">
<div class="row">
<label class="col-md-2">Tipo Mov:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" Width="156px" ValidationGroup="GrpGuardar">
</asp:DropDownList>
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
</div>
</div>
<div class="row">
<label class="col-md-2">Cuenta:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlCuenta" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="250px" ValidationGroup="GrpGuardar">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuenta" runat="server" ControlToValidate="DdlCuenta" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2">Movimiento:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlPlantilla" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PlantillaPoliza" DataValueField="CvePlantillaPoliza" Width="250px" ValidationGroup="GrpGuardar">
</asp:DropDownList>
</div>
</div>
</div>
<div class="chequesie2">
<div class="row">
<div class="col-md-6">
</div>
<label class="col-md-1 control-label text-right">Fecha:</label>
<div class="col-md-3">
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default"><i class="fa fa-calendar"></i></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''FechaDocumento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''FechaDocumento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 control-label">
<asp:Label ID="LblFolio" runat="server" Text="Número:"></asp:Label></label>
<div class="col-md-2">
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="14" class="form-control input-sm"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
<div class="col-md-2"></div>
<label class="col-md-1 control-label text-right">Importe:</label>
<asp:UpdatePanel ID="UPPImporte" class="col-md-2 input-icon" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporte" runat="server" CssClass="form-control input-sm" MaxLength="16" Width="110px" ClientIDMode="Static" Style="text-align: right;" onkeyup="FncImporteCuenta(this)"></asp:TextBox>
<asp:HiddenField ID="HdnImporte" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCuentaImporte" runat="server" ClientIDMode="Static" />
<%--<ajax:FilteredTextBoxExtender ID="ftbe" runat="server"
TargetControlID="TxtImporte"
FilterType="Custom, Numbers"
ValidChars="+-.," />--%>
<asp:RangeValidator ID="RVImporte" runat="server" Enabled="false" Type="Currency" MinimumValue="0" MaximumValue="0" ErrorMessage="Importe Excedido" ControlToValidate="TxtImporte" Display="Dynamic" ValidationGroup="GrpGuardar"></asp:RangeValidator>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row" id="TrPaguese" runat="server">
<label class="col-md-2">
<asp:Label ID="LblPagueseA" runat="server" Text="Páguese a:"></asp:Label></label>
<div class="col-md-8">
<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" />
<asp:Button ID="BtnBuscarProveedor" runat="server" ClientIDMode="Static" Text="Buscar Proveedor" Style="display: none;" class="btn btn-primary" />
<asp:TextBox ID="TxtPagueseA" CssClass="form-control input-sm" runat="server" MaxLength="70" Width="394px"></asp:TextBox>
<a ID="HplBuscar" class="btn btn-primary" runat="server" onclick="javascript:AbrirVentana('/Compras/PopUpBuscarProveedor.aspx?Opt=Poliza', 800, 547, 'N', 'PopUpBuscar')" ><i class="fa fa-search"></i> Buscar</a>
</div>
<div class="col-md-2">
<asp:UpdatePanel ID="UPPPlantilla" runat="server">
<ContentTemplate>
<asp:CheckBox ID="ChkAbonoCuenta" ClientIDMode="Static" runat="server" Text="Abono en Cuenta"></asp:CheckBox>
<asp:CheckBox ID="ChkContabilizar" runat="server" Text="Contabilizar"></asp:CheckBox>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<label class="col-md-2">Observaciones:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="400px" Rows="3" TextMode="MultiLine"></asp:TextBox>
</div>
</div>
<div class="row" id="trNotificar" runat="server" visible="False">
<label class="col-md-2">Notificar:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtNotificarA" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="400px" Rows="2" TextMode="MultiLine" ClientIDMode="Static"></asp:TextBox>
</div>
</div>
<div class="row" id="trCuentaDeposito" runat="server" visible="False">
<label class="col-md-2">Cuenta Depósito:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" DataTextField="CuentaDeposito" DataValueField="CveCuentaDeposito" Width="400px" AppendDataBoundItems="True"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta de Depósito''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuentaDeposito" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="trAjuste" runat="server" visible="False">
<label class="col-md-2">Ajuste:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtAjuste" CssClass="form-control input-sm" runat="server" MaxLength="12" Width="100px" onkeyup="fnAjuste(this);" ClientIDMode="Static"></asp:TextBox>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-md-6">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel ID="UPMovs" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<input id="HdnCveCuenta" runat="server" type="hidden" value="-1" clientidmode="Static" />
<%-- <table style="width: 100%;" class="table table-striped table-advance table-hover">
<tr class="Titulos">
<th style="width: 310px">Cuenta</th>
<th style="width: 150px; display: none;">Proyecto</th>
<th style="width: 150px; display: none;">SubProyecto</th>
<th style="width: 120px">Referencia</th>
<th style="width: 300px">Descripción</th>
<th style="width: 70px">Cargo</th>
<th style="width: 70px">Abono</th>
<th style="display: none;"></th>
</tr>
<tr>
<td>
<ajax:ListSearchExtender ID="LSECtaContProveedores" runat="server" TargetControlID="DdlCuentaContable" PromptCssClass="Titulos" PromptText="Escriba el Nombre o código del proveedor" QueryPattern="Contains" PromptPosition="Top" IsSorted="false" QueryTimeout="0"></ajax:ListSearchExtender>
<asp:DropDownList ID="DdlCuentaContable" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="286px">
<asp:ListItem Selected="True" Text="Seleccione" Value="0"></asp:ListItem>
</asp:DropDownList>
<td style="display: none;">
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="150px">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList></td>
<td style="display: none;">
<asp:DropDownList ID="DdlSubProyecto" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="150px">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList></td>
<td>
<asp:TextBox ID="TxtReferencia" runat="server" Width="120px"></asp:TextBox></td>
<td>
<asp:TextBox ID="TxtConceptoContable" runat="server" Width="300px"></asp:TextBox></td>
<td>
<asp:TextBox ID="TxtCargoImporte" runat="server" Width="70px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTECargo" runat="server"
TargetControlID="TxtCargoImporte"
FilterType="Custom, Numbers"
ValidChars="+-.," />
</td>
<td>
<asp:TextBox ID="TxtAbonoImporte" runat="server" Width="70px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTEAbono" runat="server"
TargetControlID="TxtAbonoImporte"
FilterType="Custom, Numbers"
ValidChars="+-.," />
</td>
<td>
<asp:LinkButton ID="LnkAgregar" runat="server">Agregar</asp:LinkButton></td>
</tr>
</table>--%>
<br />
<div style="width: 100%; min-height: 200px; overflow-scrolling: auto;">
<asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" DataKeyNames="IdMov,IDCuenta,Cargo,Abono,TipoMovto,CveConcepto,CveProveedor,CveSubProyecto,CvePersonal" ShowHeaderWhenEmpty="true" Width="100%" CssClass="table table-striped table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Código</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LtlCodigo" Font-Italic="true" Font-Size="7pt" runat="server" Text='<%# Eval("CodigoCuenta")%>'></asp:Label>&nbsp;
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Cuenta</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCuenta" runat="server" Text='<%# Eval("Cuenta") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>SubProyecto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSP" runat="server" Text='<%#String.Format("{0} - {1}", Eval("Proyecto"), Eval("SubProyecto")) %>'></asp:Literal>
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Visible="false" Width="150px" CssClass="select2me">
</asp:DropDownList>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Referencia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlReferencia" runat="server" Text='<%# Eval("RazonSocial")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Concepto</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtConcepto" runat="server" Width="275px" Text='<%# Eval("Concepto")%>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Cargo</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtCargo" CssClass="txtcargo" Text='<%# Eval("Cargo")%>' runat="server" Width="65px" Visible="False"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBTxtCargo" runat="server"
TargetControlID="TxtCargo"
FilterType="Custom, Numbers"
ValidChars="+-." />
<asp:Literal ID="LtlCargo" runat="server" Text='<%# Eval("Cargo", "{0:###,###,###.##}")%>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Abono</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtAbono" CssClass="txtabono" Text='<%# Eval("Abono")%>' runat="server" Width="65px" Visible="False"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBTxtAbono" runat="server"
TargetControlID="TxtAbono"
FilterType="Custom, Numbers"
ValidChars="+-." />
<asp:Literal ID="LtlAbono" runat="server" Text='<%# Eval("Abono", "{0:###,###,###.##}")%>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" Visible="False">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<table style="width: 100%;" class="table table-striped table-advance table-hover">
<tr>
<td style="width: 730px">&nbsp;</td>
<th style="width: 70px;">
<asp:TextBox ID="TxtTotalCargos" runat="server" Width="70px"></asp:TextBox></th>
<th style="width: 70px;">
<asp:TextBox ID="TxtTotalAbonos" runat="server" Width="70px"></asp:TextBox></th>
</tr>
<tr>
<td colspan="3" style="text-align: center;">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnIEGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
<script type="text/javascript" language="javascript">
function CargaProveedor(CveProveedor) {
$get("HdnCveProveedor").value = CveProveedor;
$('#BtnBuscarProveedor').click();
return true;
}
function FnSuma(t, txt, importe) {
if (t.checked) {
txt.value = FormatNumber(importe, 2, true, true, true);
} else {
txt.value = "";
}
$get('TxtImporte').value = FormatNumber(SumaValores(), 2, true, true, true);
//alert(txt.value);
}
function fnAjuste(t) {
debugger;
var imp = ToDouble($get('HdnImporte').value)
$get('TxtImporte').value = FormatNumber(imp - ToDouble(t.value), 2, true, true, true);
}
//function FncImporte(t) {
// $get('TxtImporte').value = FormatNumber(t.value, 2, true, true, true);
// $get('HdnImporte').value = FormatNumber(t.value, 2, true, true, true);
//}
function FncImporte(txt, rowtxt, opcion) {
// opcion = 1, se registro desde el txtimporte
if (opcion == 1) {
$get(rowtxt).value = $get(txt).value == '' ? '' : FormatNumber(ToDouble($get(txt).value), 2, true, true, true);
debugger;
if ($get('ChkAbonoCuenta')) {
$get('ChkAbonoCuenta').checked = ($get(txt).value > 2000);
}
FormatoMoneda($get(txt));
} else {
$get(txt).value = $get(rowtxt).value == '' ? '' : FormatNumber(ToDouble($get(rowtxt).value), 2, true, true, true);
}
}
function FncImporteCuenta(txt) {
if ($get('ChkAbonoCuenta')) {
$get('ChkAbonoCuenta').checked = (parseFloat(txt.value.replace(/,/g, '')) > 2000);
}
FormatoMoneda(txt);
}
function SumaValores() {
var Importe = 0;
var topLevelElem = document.getElementById("form1");
var textBoxes = topLevelElem.getElementsByTagName("input");
for (var i = 0; i < textBoxes.length; i++) {
if (textBoxes[i].type == "text") {
if (textBoxes[i].id.indexOf('C_GvCxP_TxtAbonar') >= 0) {
if (textBoxes[i].value != '') {
Importe = parseFloat(Importe) + parseFloat(textBoxes[i].value.split(',').join(''));
}
}
}
}
return Importe;
}
function FnCambia(chk, txt) {
if (txt.value != '') {
chk.checked = true;
} else {
chk.checked = false;
}
$get('TxtImporte').value = FormatNumber(SumaValores(), 2, true, true, true);
}
function getCuenta(pId) {
$get('HdnCveCuenta').value = pId;
PageMethods.wsGetNombreCuenta(pId, OnSucceeded);
}
function OnSucceeded(result, userContext, methodName) {
if (methodName == 'wsGetNombreCuenta') {
$get('TxtCuentaContable').value = result;
}
}
function myItemSelectedHandler(source, eventArgs) {
//debugger;
var CC = $get('HdnCveCuenta');
CC.value = eventArgs.get_value();
// var b = $get('C_Tabs_TabConyuge_BtnTruco');
// b.Click;
var aTargetElement = 'BtnSelCuenta';
__doPostBack(aTargetElement, eventArgs.get_value());
//alert(" Key : " + eventArgs.get_text() + " Value : " + eventArgs.get_value());
}
function LimpiaImporte(t, txt) {
if (t.value != '' && $get(txt)) {
$get(txt).value = '';
}
}
$(document).ready(
function () {
//iterate through each textboxes and add keyup
//handler to trigger sum event
CargaTxtFunciones();
Sys.Application.add_load(function (s, e) {
CargaTxtFunciones();
});
}
);
function CargaTxtFunciones() {
$(".txtcargo").each(function () {
$(this).keyup(function () {
calculateCargo();
comparar();
});
});
$(".txtabono").each(function () {
$(this).keyup(function () {
calculateAbono();
comparar();
});
});
}
function comparar() {
var TextoCargos = document.getElementById('<%= TxtTotalCargos.ClientID %>');
var TextoAbonos = document.getElementById('<%= TxtTotalAbonos.ClientID %>');
if (TextoCargos.value == TextoAbonos.value) {
document.getElementById('<%= TxtTotalCargos.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtTotalAbonos.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtTotalCargos.ClientID %>').style.color = "";
document.getElementById('<%= TxtTotalAbonos.ClientID %>').style.color = "";
}
else {
document.getElementById('<%= TxtTotalCargos.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtTotalAbonos.ClientID %>').style.border = "2px solid #ff0000";
document.getElementById('<%= TxtTotalCargos.ClientID %>').style.color = "#ff0000";
document.getElementById('<%= TxtTotalAbonos.ClientID %>').style.color = "#ff0000";
}
}
function calculateCargo() {
var sum = 0;
//iterate through each textboxes and add the values
$(".txtcargo").each(function () {
//add only if the value is number
if (!isNaN(this.value) && this.value.length != 0) {
sum += parseFloat(this.value);
}
});
//.toFixed() method will roundoff the final sum to 2 decimal places
$('#<%= TxtTotalCargos.ClientID %>').val(sum.toFixed(2));
}
function calculateAbono() {
var sum = 0;
$(".txtabono").each(function () {
if (!isNaN(this.value) && this.value.length != 0) {
sum += parseFloat(this.value);
}
});
$('#<%= TxtTotalAbonos.ClientID %>').val(sum.toFixed(2));
}
</script>
<style type="text/css">
.AutoExtender {
font-family: Verdana, Helvetica, sans-serif;
font-size: .9em;
font-weight: normal;
border: solid 1px #006699;
line-height: 20px;
padding: 2px;
background-color: White;
margin-left: 2px;
overflow: auto;
list-style-type: none;
}
.AutoExtenderList {
cursor: pointer;
color: darkgray;
text-align: left;
}
.AutoExtenderHighlight {
color: White;
background-color: #084784;
cursor: pointer;
}
#divwidth {
width: 150px !important;
}
#divwidth div {
width: 150px !important;
}
</style>
</asp:Content>