Contratos
This commit is contained in:
@@ -6960,8 +6960,31 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim DTDistinct = DT.Copy
|
||||
If UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
|
||||
|
||||
For Each drowdis As DataRow In DTDistinct.Rows
|
||||
If drowdis("CveTipoGasto").ToString = "" Then
|
||||
drowdis("CveTipoGasto") = 0
|
||||
End If
|
||||
If drowdis("TipoGasto").ToString.Trim = "" Then
|
||||
drowdis("TipoGasto") = "ND"
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF, 0) <> 2", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
|
||||
Else
|
||||
|
||||
For Each drowdis As DataRow In DTDistinct.Rows
|
||||
If drowdis("CveTipoGasto").ToString = "" Then
|
||||
drowdis("CveTipoGasto") = 0
|
||||
End If
|
||||
If drowdis("TipoGasto").ToString.Trim = "" Then
|
||||
drowdis("TipoGasto") = "ND"
|
||||
|
||||
End If
|
||||
Next
|
||||
DTDistinct.AcceptChanges()
|
||||
|
||||
DTDistinct = DTDistinct.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1", "", {"CveClasificacion", "Clasificacion", "SubProyecto", "CveSubProyecto", "CveTipoGasto", "TipoGasto"})
|
||||
End If
|
||||
'RMF, si es concepto relacionado a flete o importacion, no debe de afectar al gasto
|
||||
@@ -17816,6 +17839,8 @@ Partial Class Compras_Compras
|
||||
|
||||
If UsuarioActual.Empresa.Tipo_CentroCosto <> 1 And UsuarioActual.Empresa.Tipo_CentroCosto <> 2 Then
|
||||
DdlProyecto.SelectedValueExist(GvRow.DataKey("CveProyecto"))
|
||||
Else
|
||||
DdlProyecto.SelectedValueExist("-1")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
width:100%;
|
||||
}
|
||||
.txtimporte{
|
||||
background: transparent;
|
||||
border: none;
|
||||
/*background: transparent;*/
|
||||
/*border: none;*/
|
||||
}
|
||||
|
||||
.txtcant,.txtimporte,
|
||||
@@ -183,14 +183,22 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
|
||||
<asp:TextBox ID="TxtImporte" Text="" CssClass="txtimporte" data-cve='<%# Eval("CveContratoDetalle") %>' type="number" step="any" Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Procentaje">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPorcentaje" Text="" CssClass="txtporcentaje" data-cve='<%# Eval("CveContratoDetalle") %>' type="number" step="any" Width="90" runat="server"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText=" ">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -254,115 +262,6 @@
|
||||
|
||||
|
||||
|
||||
<%-- <ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
|
||||
|
||||
<ajax:TabPanel ID="TabAvance" runat="server" HeaderText="Avance">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabEstimación" runat="server" HeaderText="Estimación" visible ="false">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpEstimaciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultarEstimaciones" runat="server" Text="Consultar" class="btn btn-default" />
|
||||
</div>
|
||||
|
||||
<div class="titlefiltros caption" style="position: relative;">
|
||||
<asp:UpdatePanel class="row" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<label class="col-md-1 truncate">Contrato:</label>
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="ddls">
|
||||
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" AutoPostBack="true" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
|
||||
DataKeyNames="CveContratoAvance,CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
|
||||
CssClass="table GVEstimacion table-advance table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false" ></asp:LinkButton>
|
||||
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Cantidad", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Importe", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="text-center">
|
||||
|
||||
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
|
||||
<asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnDescargarGenerado" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>--%>
|
||||
|
||||
|
||||
|
||||
@@ -473,6 +372,7 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function showmodalFile(obj) {
|
||||
$('#' + obj).data("append", 'my-dropzone');<% Dim url = Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, "")%>
|
||||
$('#' + obj).data("urlup", '<%= url%>/Ashx/SIGWeb.ashx?Metodo=Uploadfile');
|
||||
@@ -481,38 +381,92 @@
|
||||
ADDropzone(obj);
|
||||
$('#dropmodal').modal();
|
||||
}
|
||||
function ValidateCant(variable) {
|
||||
function ValidateCant(opcion, cve) {
|
||||
|
||||
var txt = $(variable);
|
||||
var max = txt.data('cantidad');
|
||||
var value = parseInt(txt.val());
|
||||
if (value > max) {
|
||||
txt.val(max);
|
||||
var txtimporte = $('.txtimporte[data-cve="' + cve + '"]');
|
||||
var txtPorcentaje = $('.txtporcentaje[data-cve="' + cve + '"]');
|
||||
var txtCantidad = $('.txtcant[data-cve="' + cve + '"]');
|
||||
|
||||
var max = parseFloat(txtCantidad.data('cantidad'));
|
||||
var pu = parseFloat(txtCantidad.data('pu'));
|
||||
var cantidad = parseFloat(txtCantidad.val());
|
||||
|
||||
|
||||
|
||||
|
||||
if (!Math.round10) {
|
||||
Math.round10 = function (value, exp) {
|
||||
return decimalAdjust('round', value, exp);
|
||||
};
|
||||
}
|
||||
|
||||
if (opcion == 2) {
|
||||
|
||||
if (txtimporte.val().toString().length > 0) {
|
||||
|
||||
var importe = parseFloat(txtimporte.val());
|
||||
cantidad = parseFloat(importe / pu);
|
||||
txtCantidad.val(cantidad);
|
||||
|
||||
}else{
|
||||
cantidad = 0.0
|
||||
txtCantidad.val('');
|
||||
|
||||
}
|
||||
}
|
||||
if (value < 0) {
|
||||
txt.val(0);
|
||||
|
||||
if (opcion == 3) {
|
||||
|
||||
if (txtPorcentaje.val().toString().length > 0) {
|
||||
var porcentaje = parseFloat(txtPorcentaje.val());
|
||||
cantidad = (porcentaje * max / 100);
|
||||
txtCantidad.val(cantidad);
|
||||
} else {
|
||||
cantidad = 0;
|
||||
txtCantidad.val('');
|
||||
}
|
||||
}
|
||||
var importe = $('.txtimporte[data-cve="' + txt.data('cve') + '"]');
|
||||
|
||||
importe.val(parseFloat(txt.val()) * parseFloat(txt.data('pu')));
|
||||
|
||||
//FormatoMoneda2(importe);
|
||||
if (cantidad > max) {
|
||||
txtCantidad.val(max);
|
||||
cantidad = max;
|
||||
}
|
||||
if (cantidad < 0) {
|
||||
txtCantidad.val(0);
|
||||
}
|
||||
|
||||
//if (parseInt(txt.val()) > 0) {
|
||||
|
||||
// $($(txt.parent()).parent()).find(".linkfile").removeClass("hidden");
|
||||
|
||||
//} else {
|
||||
|
||||
// var ocultar = $($(txt.parent()).parent()).find(".linkfile");
|
||||
|
||||
// if (!ocultar.hasClass("hidden")) {
|
||||
// ocultar.addClass("hidden");
|
||||
// }
|
||||
//}
|
||||
|
||||
if (cantidad > 0) {
|
||||
txtimporte.val(cantidad * pu);
|
||||
txtPorcentaje.val(Math.round10(cantidad * 100 / max, -2));
|
||||
} else {
|
||||
txtimporte.val('');
|
||||
txtPorcentaje.val('');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//);
|
||||
|
||||
function decimalAdjust(type, value, exp) {
|
||||
// Si el exp no está definido o es cero...
|
||||
if (typeof exp === 'undefined' || +exp === 0) {
|
||||
return Math[type](value);
|
||||
}
|
||||
value = +value;
|
||||
exp = +exp;
|
||||
// Si el valor no es un número o el exp no es un entero...
|
||||
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
|
||||
return NaN;
|
||||
}
|
||||
// Shift
|
||||
value = value.toString().split('e');
|
||||
value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));
|
||||
// Shift back
|
||||
value = value.toString().split('e');
|
||||
return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -136,10 +136,8 @@ Partial Class Contratos_ContratoAvance
|
||||
|
||||
Private Sub CargaContrato()
|
||||
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||
DdlContratos.DataBind()
|
||||
|
||||
'DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
|
||||
'DDlContratosEstimaciones.DataBind()
|
||||
DdlContratos.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -189,8 +187,16 @@ Partial Class Contratos_ContratoAvance
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = (fecha = "")
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = Not (fecha = "")
|
||||
|
||||
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
|
||||
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
|
||||
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = False
|
||||
e.Row.FCTextBox("TxtImporte").Visible = False
|
||||
e.Row.FCTextBox("TxtPorcentaje").Visible = False
|
||||
|
||||
|
||||
|
||||
|
||||
'txtimporte
|
||||
e.Row.FCLinkButton("LnkAnexo").Visible = False
|
||||
|
||||
If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then
|
||||
@@ -221,9 +227,17 @@ Partial Class Contratos_ContratoAvance
|
||||
LnkGuardarAvance.Visible = True
|
||||
|
||||
|
||||
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"ValidateCant(1,{e.Row.DataKey("CveContratoDetalle")})")
|
||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"ValidateCant(2,{e.Row.DataKey("CveContratoDetalle")})")
|
||||
e.Row.FCTextBox("TxtPorcentaje").Attributes.Add("onkeyup", $"ValidateCant(3,{e.Row.DataKey("CveContratoDetalle")})")
|
||||
|
||||
|
||||
If e.Row.DataKey("CantidadMax").ToDouble = 0 Then
|
||||
LnkAnexo.Visible = False
|
||||
e.Row.FCTextBox("TxtCantidad").Visible = False
|
||||
e.Row.FCTextBox("TxtImporte").Visible = False
|
||||
e.Row.FCTextBox("TxtPorcentaje").Visible = False
|
||||
|
||||
LnkGuardarAvance.Visible = False
|
||||
|
||||
End If
|
||||
|
||||
@@ -740,7 +740,7 @@
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="Concepto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
@@ -962,7 +962,7 @@
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Producto/Servicio" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="Concepto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtPS" Text='<%# Eval("CodigoPS")%>' runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -953,6 +953,13 @@ Partial Class Contratos_ContratoObra
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TxtPorAmortizacionAnticipo.Text.ToDecimal < TxtPorAnticipo.Text.ToDecimal Then
|
||||
Alert("El porcentaje de amortización no debe de ser menor al porcentaje de anticipo.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim TieneError = False
|
||||
Dim Modificado = False
|
||||
' Dim Extension = Session("FileExtension").ToString
|
||||
|
||||
Reference in New Issue
Block a user