364 lines
22 KiB
Plaintext
364 lines
22 KiB
Plaintext
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ModificarPresupuesto.aspx.vb" Inherits="Contratos_ModificarPresupuesto" %>
|
||
|
||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||
Modificaciones a Presupuestos
|
||
</asp:Content>
|
||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
|
||
|
||
<ContentTemplate>
|
||
|
||
<li>
|
||
<asp:LinkButton runat="server" ID="LnkAccionesAgregarClasificacion" data-toggle="tooltip" Visible ="false" OnClick="LnkAccionesAgregarClasificacion_Click"
|
||
data-placement="left" title="Agregar Clasificación" Text="<i class='fa fa-plus'></i> Agregar Clasificación"></asp:LinkButton>
|
||
</li>
|
||
|
||
</ContentTemplate>
|
||
</asp:UpdatePanel>
|
||
</asp:Content>
|
||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||
<div class="row">
|
||
<div class="col-md-6">
|
||
<div class="portlet light smmallpadding bordered">
|
||
<div class="portlet-title">
|
||
<div class="caption">
|
||
<i class="fa fa-info-circle"></i>Datos Generales
|
||
</div>
|
||
<div class="tools">
|
||
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||
</div>
|
||
</div>
|
||
<div class="portlet-body">
|
||
<asp:UpdatePanel ID="UpDatosG" runat="server" UpdateMode="Conditional">
|
||
<ContentTemplate>
|
||
<div class="rowpadding">
|
||
<div class="row">
|
||
<label class="col-md-2 truncate">Presupuesto:</label>
|
||
<div class="col-md-10">
|
||
<asp:DropDownList ID="DdlPresupuesto" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" DataTextField="Nombre" DataValueField="CvePresupuesto"></asp:DropDownList>
|
||
<asp:CompareValidator ID="CVPresupuesto" runat="server" ControlToValidate="DdlPresupuesto" ValueToCompare="0" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Debe seleccionar un <b>''Presupuesto''</b>, por favor seleccione uno." Operator="GreaterThan" Type="Integer" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||
<ajax:ValidatorCalloutExtender ID="VCEPresupuesto" runat="server" HighlightCssClass="vco" TargetControlID="CVPresupuesto"></ajax:ValidatorCalloutExtender>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<label class="col-md-2 truncate">Tipo:</label>
|
||
<div class="col-md-10">
|
||
<asp:DropDownList ID="DdlTipo" OnSelectedIndexChanged="DdlTipo_SelectedIndexChanged" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me">
|
||
<asp:ListItem Text="Ampliación" Value="1"></asp:ListItem>
|
||
<asp:ListItem Text="Reducción" Value="2"></asp:ListItem>
|
||
<asp:ListItem Text="Transferencia" Value="1,2"></asp:ListItem>
|
||
</asp:DropDownList>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<label class="col-md-2 truncate">Justificación:</label>
|
||
<div class="col-md-10">
|
||
<asp:TextBox ID="TxtJustificion" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>
|
||
<asp:RequiredFieldValidator ID="RFVObservacion" runat="server" ControlToValidate="TxtJustificion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Justificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||
<ajax:ValidatorCalloutExtender ID="VCEObs" runat="server" HighlightCssClass="vco" TargetControlID="RFVObservacion"></ajax:ValidatorCalloutExtender>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="col-md-6">
|
||
<div class="row">
|
||
<label class="col-md-4 truncate">Fecha:</label>
|
||
<div class="col-md-8">
|
||
<div style="display: inline-block; vertical-align: text-bottom;">
|
||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
|
||
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
|
||
<span class="input-group-btn ">
|
||
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||
</span>
|
||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" Format="dd/MM/yyyy" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</ContentTemplate>
|
||
</asp:UpdatePanel>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<br />
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<div class="portlet light smmallpadding bordered">
|
||
<div class="portlet-title">
|
||
<div class="caption" style="align-items: center">
|
||
<i class="fa fa-info-circle"></i>Presupuestos
|
||
</div>
|
||
<div class="tools">
|
||
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||
</div>
|
||
</div>
|
||
<div class="portlet-body">
|
||
<div class="rowpadding" id="content" >
|
||
<asp:UpdatePanel ID="UpGvClasificaciones" runat="server" UpdateMode="Conditional">
|
||
<ContentTemplate>
|
||
<asp:GridView ID="GvPresupuestos" runat="server" ShowFooter="true" GridLines="None" EmptyDataText="No se encontraron presupuestos" CssClass="table table-hover table-striped Widthall ScrollAD" AutoGenerateColumns="False" data-heighterror="600"
|
||
DataKeyNames="CvePresupuestoDetalle,CveClasificacion" data-footer="1">
|
||
<Columns>
|
||
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" />
|
||
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
|
||
<ItemTemplate>
|
||
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Autorizado", "{0:C}")%>'></asp:Label>
|
||
</ItemTemplate>
|
||
<FooterTemplate>
|
||
<asp:Label ID="LblTotalImporte" runat="server"></asp:Label>
|
||
</FooterTemplate>
|
||
</asp:TemplateField>
|
||
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
|
||
<ItemTemplate>
|
||
<asp:Label ID="LtlSaldo" runat="server" Text='<%# Eval("PorEjercer", "{0:C}")%>'></asp:Label>
|
||
</ItemTemplate>
|
||
<FooterTemplate>
|
||
<asp:Label ID="LblTotalSaldo" runat="server"></asp:Label>
|
||
</FooterTemplate>
|
||
</asp:TemplateField>
|
||
<asp:TemplateField HeaderText="Ampliación" HeaderStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Right" Visible="false">
|
||
<ItemTemplate>
|
||
<asp:TextBox ID="TxtAmpliacion" runat="server" CssClass="form-control input-sm sumaGVAmpliacion"></asp:TextBox>
|
||
<ajax:FilteredTextBoxExtender ID="FTEAmpliacion" runat="server" TargetControlID="TxtAmpliacion" FilterType="Custom, Numbers" ValidChars=".," />
|
||
</ItemTemplate>
|
||
<FooterTemplate>
|
||
<asp:Label ID="LblTotalAmpliacion" runat="server"></asp:Label>
|
||
</FooterTemplate>
|
||
</asp:TemplateField>
|
||
<asp:TemplateField HeaderText="Reducción" HeaderStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Right" Visible="false">
|
||
<ItemTemplate>
|
||
<asp:TextBox ID="TxtReduccion" runat="server" CssClass="form-control input-sm sumaGVReduccion"></asp:TextBox>
|
||
<ajax:FilteredTextBoxExtender ID="FTERecuccion" runat="server" TargetControlID="TxtReduccion" FilterType="Custom, Numbers" ValidChars=".," />
|
||
</ItemTemplate>
|
||
<FooterTemplate>
|
||
<asp:Label ID="LblTotalReduccion" runat="server"></asp:Label>
|
||
</FooterTemplate>
|
||
</asp:TemplateField>
|
||
<asp:TemplateField HeaderText="Saldo Final" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
|
||
<ItemTemplate>
|
||
<asp:Label ID="LtlSaldoFinal" CssClass="sumaSaldoFinalGV" runat="server"></asp:Label>
|
||
</ItemTemplate>
|
||
<FooterTemplate>
|
||
<asp:Label ID="LblTotalSaldoFinal" runat="server"></asp:Label>
|
||
</FooterTemplate>
|
||
</asp:TemplateField>
|
||
</Columns>
|
||
<FooterStyle BackColor="#DDDDDD" />
|
||
</asp:GridView>
|
||
</ContentTemplate>
|
||
</asp:UpdatePanel>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<asp:UpdatePanel ID="UpGuardar" runat="server">
|
||
<ContentTemplate>
|
||
<div class="row">
|
||
<div class="col-md-5"></div>
|
||
<div class="col-md-2">
|
||
<asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" />
|
||
</div>
|
||
<div class="col-md-5"></div>
|
||
</div>
|
||
</ContentTemplate>
|
||
</asp:UpdatePanel>
|
||
|
||
|
||
|
||
<div id="DVModalAgregarClasificacion" class="modal ADS fade" role="dialog">
|
||
<div class="modal-dialog" style="width: 450px;">
|
||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalAgregarClasicicacion" UpdateMode="Conditional">
|
||
<ContentTemplate>
|
||
|
||
<div class="modal-header ">
|
||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||
<h4 class="modal-title">
|
||
<asp:Literal ID="LtlTituloModalAgregarClasificacion" runat="server">Agregar Clasificación</asp:Literal></h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="form-group form-md-line-input input-iconright">
|
||
<asp:DropDownList ID="DdlModalClasificacion" CssClass="form-control select2me" runat="server" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" >
|
||
<asp:ListItem Value="-1">Seleccione Una</asp:ListItem>
|
||
</asp:DropDownList>
|
||
<asp:RequiredFieldValidator ID="RfvDdlModalClasificacion" InitialValue="-1" runat="server" ControlToValidate="DdlModalClasificacion" CssClass="help-block errorimput"
|
||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo."
|
||
ValidationGroup="GrpGuardarMedico"></asp:RequiredFieldValidator>
|
||
<label for="<%= DdlModalClasificacion.ClientID.ToString()%>">Clasificación:</label>
|
||
<i></i>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="modal-footer">
|
||
<asp:Button ID="LnkModalAgregarClasificacion" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpAgregarClasificacion" OnClick="LnkModalAgregarClasificacion_Click" />
|
||
<button id="BtnModalCancelarAgregarClasificacion" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||
</div>
|
||
|
||
</ContentTemplate>
|
||
</asp:UpdatePanel>
|
||
</div>
|
||
</div>
|
||
|
||
</asp:Content>
|
||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||
<script type="text/javascript">
|
||
|
||
function Ampliacion(i) {
|
||
calculaTotalAmpliacion();
|
||
var ampliacion = ToDouble($("#C_GvPresupuestos_TxtAmpliacion_" + i).val().replace("$", "").replace(",", ""));
|
||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||
|
||
var SaldoFinal = saldo + ampliacion;
|
||
|
||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$"+formato_numero(SaldoFinal, 2, '.', ','));
|
||
|
||
var SaldoTotal = ToDouble(C_GvPresupuestos_LblTotalSaldo.innerText.replace("$", "").replace(",", ""));
|
||
var ampliacionTotal = ToDouble(C_GvPresupuestos_LblTotalAmpliacion.innerText.replace("$", "").replace(",", ""));
|
||
|
||
var SaldoFinalTotal = SaldoTotal + ampliacionTotal;
|
||
|
||
C_GvPresupuestos_LblTotalSaldoFinal.innerText = '$ ' + FormatoNumero(SaldoFinalTotal);
|
||
|
||
}
|
||
function Reduccion(i) {
|
||
|
||
var reduccion = ToDouble($("#C_GvPresupuestos_TxtReduccion_" + i).val().replace("$", "").replace(",", ""));
|
||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||
|
||
var SaldoFinal = saldo - reduccion;
|
||
|
||
if (reduccion <= saldo) {
|
||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$"+formato_numero(SaldoFinal, 2, '.', ','));
|
||
}
|
||
calculaTotalReduccion();
|
||
var SaldoTotal = ToDouble(C_GvPresupuestos_LblTotalSaldo.innerText.replace("$", "").replace(",", ""));
|
||
var reduccionTotal = ToDouble(C_GvPresupuestos_LblTotalReduccion.innerText.replace("$", "").replace(",", ""));
|
||
|
||
var SaldoFinalTotal = SaldoTotal - reduccionTotal;
|
||
|
||
C_GvPresupuestos_LblTotalSaldoFinal.innerText = '$ ' + FormatoNumero(SaldoFinalTotal);
|
||
|
||
}
|
||
function Transferencia(i, Opc) {
|
||
|
||
var SaldoFinalTotal = 0;
|
||
|
||
switch (Opc) {
|
||
case "A":
|
||
$("#C_GvPresupuestos_TxtReduccion_" + i).val('');
|
||
|
||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||
var ampliacion = ToDouble($("#C_GvPresupuestos_TxtAmpliacion_" + i).val().replace("$", "").replace(",", ""));
|
||
|
||
var SaldoFinal = saldo + ampliacion;
|
||
|
||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$" +formato_numero(SaldoFinal, 2, '.', ','));
|
||
break;
|
||
case "R":
|
||
$("#C_GvPresupuestos_TxtAmpliacion_" + i).val('');
|
||
|
||
var saldo = ToDouble($("#C_GvPresupuestos_LtlSaldo_" + i).text().replace("$", "").replace(",", ""));
|
||
var reduccion = ToDouble($("#C_GvPresupuestos_TxtReduccion_" + i).val().replace("$", "").replace(",", ""));
|
||
|
||
var SaldoFinal = saldo - reduccion;
|
||
|
||
$("#C_GvPresupuestos_LtlSaldoFinal_" + i).text("$" +formato_numero(SaldoFinal, 2, '.', ','));
|
||
break;
|
||
}
|
||
calculaTotalAmpliacion();
|
||
calculaTotalReduccion();
|
||
|
||
var SaldoTotal = ToDouble(C_GvPresupuestos_LblTotalSaldo.innerText.replace("$", "").replace(",", ""));
|
||
var reduccionTotal = ToDouble(C_GvPresupuestos_LblTotalReduccion.innerText.replace("$", "").replace(",", ""));
|
||
var ampliacionTotal = ToDouble(C_GvPresupuestos_LblTotalAmpliacion.innerText.replace("$", "").replace(",", ""));
|
||
|
||
SaldoFinalTotal = SaldoTotal + ampliacionTotal - reduccionTotal;
|
||
|
||
C_GvPresupuestos_LblTotalSaldoFinal.innerText = '$ ' + FormatoNumero(SaldoFinalTotal);
|
||
|
||
}
|
||
|
||
function calculaTotalReduccion() {
|
||
var total = 0;
|
||
$(".sumaGVReduccion").each(function () {
|
||
total += ToDouble(this.value);
|
||
});
|
||
C_GvPresupuestos_LblTotalReduccion.innerText = '$ ' + FormatoNumero(total);
|
||
}
|
||
function calculaTotalAmpliacion() {
|
||
var total = 0;
|
||
$(".sumaGVAmpliacion").each(function () {
|
||
total += ToDouble(this.value);
|
||
});
|
||
C_GvPresupuestos_LblTotalAmpliacion.innerText = '$ ' + FormatoNumero(total);
|
||
}
|
||
function minmax(value, min, max) {
|
||
if (parseInt(value) < min || isNaN(parseInt(value)))
|
||
return "";
|
||
else if (parseInt(value) > max)
|
||
return max;
|
||
else return value;
|
||
}
|
||
function formato_numero(numero, decimales, separador_decimal, separador_miles) {
|
||
numero = parseFloat(numero);
|
||
if (isNaN(numero)) {
|
||
return "";
|
||
}
|
||
|
||
if (decimales !== undefined) {
|
||
// Redondeamos
|
||
numero = numero.toFixed(decimales);
|
||
}
|
||
|
||
// Convertimos el punto en separador_decimal
|
||
numero = numero.toString().replace(".", separador_decimal !== undefined ? separador_decimal : ",");
|
||
|
||
if (separador_miles) {
|
||
// Añadimos los separadores de miles
|
||
var miles = new RegExp("(-?[0-9]+)([0-9]{3})");
|
||
while (miles.test(numero)) {
|
||
numero = numero.replace(miles, "$1" + separador_miles + "$2");
|
||
}
|
||
}
|
||
|
||
return numero;
|
||
}
|
||
|
||
|
||
//function scrollToTableCell(text) {
|
||
// const table = document.getElementById('ADSH-C_GvPresupuestos');
|
||
// const rows = table.getElementsByTagName('tr');
|
||
// for (let row of rows) {
|
||
// const cells = row.getElementsByTagName('td');
|
||
// for (let cell of cells) {
|
||
// if (cell.textContent.includes(text)) {
|
||
// cell.scrollIntoView({ behavior: 'smooth' });
|
||
// cell.classList.add('highlight');
|
||
// return;
|
||
// }
|
||
// }
|
||
// }
|
||
//}
|
||
|
||
</script>
|
||
</asp:Content>
|
||
|