diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index a2f021adc..0f3579548 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2225,6 +2225,7 @@ Namespace Modelos Select Case ConceptoContable Case 1 'Cliente If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then + If ObjFactura.CveMoneda > 1 Then ConceptoContable = 291 importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador importeMX = importeMovimiento * tipoCambio * Multiplicador FechaMovimiento = ObjFactura.FechaPago @@ -3801,13 +3802,19 @@ Namespace Modelos If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1") If CveMovimientoSalida > 0 Then - If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then OcurrioError = True End If Else OcurrioError = True End If + + If Not OcurrioError Then + If Not ObjInventario.ActualizarEsDevolucionVenta(factura.CveVenta, 2) Then + OcurrioError = True + End If + End If + End If End If @@ -4081,65 +4088,79 @@ Namespace Modelos OcurrioError = True ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else - Dim Mensaje As String = "" - Dim i As Integer = 0 - Dim Cantidad As Double - Dim CveUnidad As Integer - Dim CveProducto As Integer - Dim Existencia As Double - 'Dim Pu As Double - 'DtInv.Clone() + If CveMovimientoRelacionado > 0 Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then - Dim DtEquivalencias As DataTable - For Each Dr As DataRow In DtInventario.Rows - CveProducto = Dr("CvePS").ToString.ToEntero - CveUnidad = Dr("CveUM").ToString.ToEntero - Cantidad = Dr("Cantidad").ToString.ToDouble + For Each Dr As DataRow In ObjInventario.DtResultados.Rows + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then + OcurrioError = True + ErrorList.Add("Ocurrió un Error al guardar los movimientos de entrada") + Exit For + End If + Next - If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then - OcurrioError = True - ErrorList.Add("Se deben especificar las Series de los productos de almacén") - Exit For End If + Else + Dim Mensaje As String = "" + Dim i As Integer = 0 + Dim Cantidad As Double + Dim CveUnidad As Integer + Dim CveProducto As Integer + Dim Existencia As Double + 'Dim Pu As Double + 'DtInv.Clone() - If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then - Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) - If Existencia < Cantidad Then + Dim DtEquivalencias As DataTable + For Each Dr As DataRow In DtInventario.Rows + CveProducto = Dr("CvePS").ToString.ToEntero + CveUnidad = Dr("CveUM").ToString.ToEntero + Cantidad = Dr("Cantidad").ToString.ToDouble + + If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then OcurrioError = True - ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.") + ErrorList.Add("Se deben especificar las Series de los productos de almacén") Exit For End If - End If - If UsuarioActual.CveEmpresa = 1 Then - DtEquivalencias = New DataTable - DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa) - Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero - Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'") - - 'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE) - If CveUnidadBase <> CveUnidad Then - ' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA - Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble - CveUnidad = CveUnidadBase + If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then + Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) + If Existencia < Cantidad Then + OcurrioError = True + ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.") + Exit For + End If End If - End If - If CveProducto > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then + If UsuarioActual.CveEmpresa = 1 Then + DtEquivalencias = New DataTable + DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa) + Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero + Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'") + + 'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE) + If CveUnidadBase <> CveUnidad Then + ' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA + Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble + CveUnidad = CveUnidadBase + End If + End If + + If CveProducto > 0 Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then + OcurrioError = True + ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.
") + Exit For + End If + Else OcurrioError = True ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.
") Exit For End If - Else - OcurrioError = True - ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.
") - Exit For - End If - i = i + 1 - Next + i = i + 1 + Next + End If 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN If MovimientoPrePoliza AndAlso Not OcurrioError Then diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 9a5f4a0c9..da8df25b1 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2935,8 +2935,10 @@ Public Class Timbrado comprobante.SubTotal = ObjCFDITimbre.Comprobante.Subtotal If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then - comprobante.DescuentoSpecified = True - comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos + If ObjCFDITimbre.Comprobante.Descuentos > 0 Then + comprobante.DescuentoSpecified = True + comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos + End If End If comprobante.Moneda = ObjCFDITimbre.Comprobante.Moneda comprobante.TipoCambio = ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal @@ -3876,23 +3878,21 @@ Public Class Timbrado Else - Dim Resultados = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle) - - If Resultados.Count > 0 Then - - If resultadoTimbre.Descripcion.Contains("RFC del receptor no existe") Then - - Retorno = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente" - MensajeErrorCFDI = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente" + If String.IsNullOrEmpty(resultadoTimbre.Detalle) Then + Dim Resultados = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle) + If Resultados.Count > 0 Then + If resultadoTimbre.Descripcion.Contains("RFC del receptor no existe") Then + Retorno = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente" + MensajeErrorCFDI = $"El RFC { Resultados(0)("Value").ToString() } no existe en las bases de datos publicadas por el SAT, corrobore este dato con su cliente" + Else + Retorno = Resultados(0)("Value").ToString() + MensajeErrorCFDI = Resultados(0)("Value").ToString() + End If Else - - Retorno = Resultados(0)("Value").ToString() - MensajeErrorCFDI = Resultados(0)("Value").ToString() - + Retorno = resultadoTimbre.Detalle + MensajeErrorCFDI = resultadoTimbre.Detalle End If - - Else Retorno = resultadoTimbre.Detalle MensajeErrorCFDI = resultadoTimbre.Detalle diff --git a/App_Code/Usuario.vb b/App_Code/Usuario.vb index 6ae6e14d1..9dc49a3c8 100644 --- a/App_Code/Usuario.vb +++ b/App_Code/Usuario.vb @@ -62,7 +62,9 @@ Public Class Usuario Public Property isLoginseted As Boolean = False - Public Property SesionBloqueada As Boolean = False + Public Property SesionBloqueada As Boolean = False + Public Property ErrorDesbloqueo As Boolean = False + Public Property MsgErrorDesbloqueo As String = "" Public ReadOnly Property FechaActualCliente As DateTime Get diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index cf37bb840..a47aae2e8 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -409,7 +409,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState 'VALIDA PROMOCIONES Y EXISTENCIAS Dim ObjVentas As New ClsVentas - If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, UsuarioActual.CveEmpresa) Then + If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then ObjFactura.DtPromociones = ObjVentas.DtResultados.Copy() End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 40a1431b5..7a06ef3a6 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -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 @@ -9802,7 +9825,7 @@ Partial Class Compras_Compras Dim ObjInventario As New ClsInventarios(ObjCompra.IniciaTransacSQL) Dim ObjContabilidad As New ClsContabilidad(ObjCompra.IniciaTransacSQL) Dim ObjAF As New ClsAF(ObjCompra.IniciaTransacSQL) - Dim ObjContaAC As ClsContPAQi = New ClsContPAQi(UsuarioActual.Empresa) + Dim ObjContaAC As ClsContPAQi '= New ClsContPAQi(UsuarioActual.Empresa) Dim Retorno As Boolean = True Dim CveEstatusFactura As Integer = HdnCveEstatusFactura.Value.ToEntero @@ -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 diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 74a48f0ea..6bae061c3 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -4575,6 +4575,7 @@ Partial Class PopUpVerFactura Dim ModeloAuto As String = RowAjuste("ModeloAuto").ToString Dim MarcaAuto As String = RowAjuste("MarcaAuto").ToString + Dim CodigoTD As String = RowAjuste("CodigoTD").ToString Dim MarcaPS As String = "" Dim CveMarca As Integer = -1 @@ -4687,6 +4688,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Anio", Año)) params.Add(New ReportParameter("Comprobante", Comprobante)) + params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 8e2fedf24..f43caaa7a 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -712,7 +712,7 @@ Partial Class Compras_ReembolsosComprobaciones If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119)) Then 'Si es caja chica metemos el concepto 30, si es funcionario metemos 29 - If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, DDlCheques.SelectedValue.ToEntero, -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then MsgError = "Detalle" End If End If diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index a358c4250..617ce1010 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -197,7 +197,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If - TipoPlantilla = 0 + TipoPlantilla = -1 If IfNull(Request("Tipo"), "").ToString = "Ing" Then TipoPlantilla = 1 LblEncabezado.Text = "Otros Ingresos" diff --git a/Contratos/ContratoAvance.aspx b/Contratos/ContratoAvance.aspx index fdccdf370..2a42ad29a 100644 --- a/Contratos/ContratoAvance.aspx +++ b/Contratos/ContratoAvance.aspx @@ -8,8 +8,8 @@ width:100%; } .txtimporte{ - background: transparent; - border: none; + /*background: transparent;*/ + /*border: none;*/ } .txtcant,.txtimporte, @@ -183,14 +183,22 @@ - + - + + + + + + + + + @@ -254,115 +262,6 @@ -<%-- - - - - - - - - - - - - - - - - -
-
- -
- -
- -
- - - -
-
- - -
-
- -
-
-
-
-
- - -
-
- - - - - - - - - - - - <%# Eval("Cantidad", "{0:N2}")%> - - - - - <%# Eval("Importe", "{0:N2}")%> - - - - - <%# Eval("Cantidad_Ultima", "{0:N2}")%> - - - - - <%# Eval("Importe_Ultima", "{0:N2}")%> - - - - - - - - - -
-
- - -
-
-
- - - - -
-
-
- -
- - - -
- - -
-
- - -
--%> @@ -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)); + } + diff --git a/Contratos/ContratoAvance.aspx.vb b/Contratos/ContratoAvance.aspx.vb index 15d5ccce3..a2271dff1 100644 --- a/Contratos/ContratoAvance.aspx.vb +++ b/Contratos/ContratoAvance.aspx.vb @@ -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 diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index 6efbb60f6..d004923ae 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -740,7 +740,7 @@
- + @@ -962,7 +962,7 @@ - + diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 43ff3f4ee..7f2e52877 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -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 diff --git a/Empresas/Grales/Formatos/Ajuste.rdlc b/Empresas/Grales/Formatos/Ajuste.rdlc index a2f9750f7..bc19d8a58 100644 --- a/Empresas/Grales/Formatos/Ajuste.rdlc +++ b/Empresas/Grales/Formatos/Ajuste.rdlc @@ -902,7 +902,7 @@ Textbox2 - 1.78486in + 1.98486in 0.38625in 0.17014in 3.4167in @@ -941,7 +941,7 @@ Textbox3 - 1.955in + 2.155in 0.38622in 0.16389in 1.00005in @@ -989,7 +989,7 @@ Textbox3 - 1.955in + 2.155in 2.56338in 0.16389in 1.23952in @@ -1037,7 +1037,7 @@ Textbox3 - 1.955in + 2.155in 1.37238in 0.16389in 1.19096in @@ -1074,7 +1074,7 @@ Textbox3 - 2.28139in + 2.48139in 0.38623in 0.19445in 1.00004in @@ -1113,7 +1113,7 @@ Textbox3 - 2.28139in + 2.48139in 2.56332in 0.19445in 1.23961in @@ -1152,7 +1152,7 @@ Textbox3 - 2.28139in + 2.48139in 1.38627in 0.18056in 1.17707in @@ -1186,7 +1186,7 @@ Textbox3 - 2.46611in + 2.66611in 0.38623in 0.16667in 1.39934in @@ -1226,7 +1226,7 @@ Textbox3 - 2.46611in + 2.66611in 2.76123in 0.16667in 1.04174in @@ -1270,7 +1270,7 @@ Textbox3 - 2.46611in + 2.66611in 1.78557in 0.16667in 0.97566in @@ -1310,7 +1310,7 @@ Textbox2 - 2.63278in + 2.83278in 0.38627in 0.17014in 3.41668in @@ -1345,7 +1345,7 @@ Textbox2 - 2.80292in + 3.00292in 0.38627in 0.17014in 3.41668in @@ -1384,7 +1384,7 @@ Textbox3 - 2.97306in + 3.17306in 0.38623in 0.16389in 1.00004in @@ -1432,7 +1432,7 @@ Textbox3 - 2.97306in + 3.17306in 2.56334in 0.16389in 1.23959in @@ -1480,7 +1480,7 @@ Textbox3 - 2.97306in + 3.17306in 1.37238in 0.16389in 1.19096in @@ -1520,7 +1520,7 @@ Textbox2 - 3.12445in + 3.32445in 0.3862in 0.17014in 3.4167in @@ -1559,7 +1559,7 @@ Textbox3 - 3.29598in + 3.49598in 0.3862in 0.16389in 3.41668in @@ -1606,7 +1606,7 @@ Textbox3 - 3.45987in + 3.65987in 0.38618in 0.16389in 3.41668in @@ -1653,7 +1653,7 @@ Textbox3 - 3.62376in + 3.82376in 0.38616in 0.16389in 2.17718in @@ -1701,7 +1701,7 @@ Textbox3 - 3.62376in + 3.82376in 2.56338in 0.16389in 1.23948in @@ -1742,7 +1742,7 @@ Textbox43 - 3.78765in + 3.98765in 0.38627in 1.11934in 3.4167in @@ -1784,7 +1784,7 @@ Textbox45 - 3.84321in + 4.04321in 0.79462in 0.38542in 2.70151in @@ -1800,7 +1800,7 @@ - 4.64324in + 4.84324in 0.65712in 0in 1.26042in @@ -1812,7 +1812,7 @@ - 4.64324in + 4.84324in 2.24046in 0in 1.25567in @@ -1840,7 +1840,7 @@ Textbox46 - 4.65851in + 4.85851in 1.11409in 0.16667in 0.34028in @@ -1872,7 +1872,7 @@ Textbox46 - 4.67102in + 4.87102in 2.34254in 0.16667in 1.03692in @@ -1907,7 +1907,7 @@ Textbox46 - 4.47171in + 4.67171in 0.65712in 0.15625in 1.26042in @@ -1944,7 +1944,7 @@ Textbox3 - 2.12028in + 2.32028in 0.38616in 0.16389in 3.4167in @@ -1975,8 +1975,52 @@ 2pt + + true + + + + + Código Defecto: + + + + =Parameters!CodigoTD.Value + + + + + + + + + + + + Middle + 2pt + 2pt + 2pt + 2pt + + - 5.0181in + 5.21602in