diff --git a/AF/CatSubTipos.aspx.vb b/AF/CatSubTipos.aspx.vb index b5c9d5f6f..cc023e732 100644 --- a/AF/CatSubTipos.aspx.vb +++ b/AF/CatSubTipos.aspx.vb @@ -23,11 +23,12 @@ Partial Class AF_CatSubTipos End Sub Private Sub CargaGlobal() - Dim ObjSubTipos As New ClsAF - If ObjSubTipos.GetSubTiposActivosFijos(-1) Then - GlobalDTSubTipoActivoFijo(-1) = ObjSubTipos.DtResultados - End If - ObjSubTipos.Dispose() + 'Dim ObjSubTipos As New ClsAF + 'If ObjSubTipos.GetSubTiposActivosFijos(-1) Then + ' GlobalDTSubTipoActivoFijo(-1) = ObjSubTipos.DtResultados + 'End If + 'ObjSubTipos.Dispose() + GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa, -1) = Nothing End Sub Public Sub CargaDatos() diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 45f22427f..da84ed30d 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2048,7 +2048,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer) As Boolean + Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ProductosServiciosInventario") @@ -2059,6 +2059,7 @@ Public Class ClsInventarios .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@AplicaParaVenta", SqlDbType.Int).Value = AplicaParaVenta .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With Try @@ -4047,7 +4048,7 @@ Public Class ClsInventarios End Function Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String, - CveContratoDetalle As Integer, Optional Serie As String = "-1") As Boolean + CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean Dim Retorno As Boolean = False Dim CveTraspasoSolicitud As Integer = 0 DataAdapter("PA_Inv_TraspasoSolicitudDetalleAdd") @@ -4061,6 +4062,9 @@ Public Class ClsInventarios .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle .Add("@Serie", SqlDbType.NVarChar).Value = Serie + .Add("@Lote", SqlDbType.NVarChar).Value = Lote + .Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad + End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 148b96b30..990a3e2f5 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -2184,19 +2184,43 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer) As DataTable + Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer, Optional CveTipoActivoFijo As Integer = -1) As DataTable + Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTSubTipoActivoFijo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable) + Dim AppNombre As String = String.Format("GlobalDTSubTipoActivoFijo-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjSubTipos As New ClsAF + If ObjSubTipos.GetSubTiposActivosFijos(CveEmpresa) Then Application(AppNombre) = ObjSubTipos.DtResultados + ObjSubTipos.Dispose() End If + + Dim Str As New StringBuilder + + If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa) + If CveTipoActivoFijo > 0 Then Str.AppendFormat("AND CveTipoActivoFijo = {0}", CveTipoActivoFijo) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTSubTipoActivoFijo = Dv.ToTable + Dv.Dispose() + End Get Set(value As DataTable) - Application("GlobalDTSubTipoActivoFijo") = value + Dim AppNombre As String = String.Format("GlobalDTSubTipoActivoFijo-{0}", CveEmpresa) + Application(AppNombre) = value End Set + + 'Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTSubTipoActivoFijo = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable) + ' End If + 'End Get + 'Set(value As DataTable) + ' Application("GlobalDTSubTipoActivoFijo") = value + 'End Set End Property Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable Get @@ -5033,7 +5057,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatCobranzaEstatus.aspx".ToUpper(), 7003) PaginaDict.Add("/Ventas/CatCobranzaEstatusTurno.aspx".ToUpper(), 7004) PaginaDict.Add("/Ventas/RepVentasMensuales.aspx".ToUpper(), 720) - PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721) + PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 720) PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722) PaginaDict.Add("/Ventas/CatMetasVendedores.aspx".ToUpper(), 723) PaginaDict.Add("/Ventas/RepAuxiliarFacturas.aspx".ToUpper(), 567) @@ -5177,6 +5201,8 @@ Public Class ClsPaginas PaginaDict.Add("/Acumuladores/EntradasUsadosResumenRep.aspx".ToUpper(), 1032) + + 'Antes de aquí. Application("GlobalSIGAppPaginas") = PaginaDict @@ -7144,7 +7170,7 @@ Public Class ClsPaginas Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = If(Vta.DtNCVinculadas IsNot Nothing, Vta.DtNCVinculadas, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte lrds.Add(rds5) - If UsuarioActual.CveEmpresa.Contiene(141, 152) AndAlso (RutaFormato.Contains("Factura") Or RutaFormato.Contains("Cotizacion")) Then + If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) AndAlso (RutaFormato.Contains("Factura") Or RutaFormato.Contains("Cotizacion")) Then params.Add(New ReportParameter("Kilometraje", Vta.Kilometraje.ToString)) End If 'Imprime los parametros diff --git a/App_Code/ClsSisUsuarios.vb b/App_Code/ClsSisUsuarios.vb index d1ff35a2d..ed02a6324 100644 --- a/App_Code/ClsSisUsuarios.vb +++ b/App_Code/ClsSisUsuarios.vb @@ -416,7 +416,29 @@ Public Class ClsSisUsuarios Return Retorno End Function - + Public Function ValidaUsuarioCodigoAcceso(CodigoAcceso As String, CveEmpresa As Integer) As Integer + Dim Retorno As Integer = Nothing + + DataAdapter("PA_Sis_UsuariosCodigoAccesoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + If Data.Rows.Count > 0 Then + Retorno = Data.Rows(0)("CveUsuario").ToString.ToEntero + End If + + Catch ex As SqlException + OnError("Ocurrió un error al obtener el usuario.", ex) + Retorno = Nothing + End Try + + Return Retorno + End Function Public Function ValidaUsuarioPortalCliente(CveCliente As Integer, Usuario As String, Password As String) As Usuario Dim Retorno As Usuario = Nothing @@ -799,7 +821,7 @@ Public Class ClsSisUsuarios Public Function AddUsuario(Usuario As String, Contraseña As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean, CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False, - Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0) As Integer + Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Integer Dim Retorno = -1 DataAdapter("PA_Sis_UsuarioAdd") With SqlAdapter.SelectCommand.Parameters @@ -819,6 +841,7 @@ Public Class ClsSisUsuarios .Add("@CveCliente", SqlDbType.Int).Value = CveClientePlataforma .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedorPlataforma .Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado + .Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso .Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -917,7 +940,7 @@ Public Class ClsSisUsuarios End Function Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False, - Optional DescuentoAutorizado As Double = 0) As Boolean + Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Sis_UsuarioUpdate") @@ -938,6 +961,7 @@ Public Class ClsSisUsuarios .Add("@AsignarSubProyecto", SqlDbType.Bit).Value = AsignarSubProyecto .Add("@AsignarOC", SqlDbType.Bit).Value = AsignarOC .Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado + .Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index d9dd46a07..0f3579548 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2203,8 +2203,8 @@ Namespace Modelos CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString.ToEntero End If - Dim UsaComplementariaClientes As Boolean = False - If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True + Dim UsaComplementariaClientes As Boolean = True + 'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then Dim dtt As DataTable = ObjConta.DtResultados @@ -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 @@ -3798,6 +3799,24 @@ Namespace Modelos End If End If + 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 Return OcurrioError @@ -4059,6 +4078,143 @@ Namespace Modelos 'Return Not OcurrioError End Function + + Private Function GenerarMovimientoAlmacenServicioDomicilio(ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura, DtInventario As DataTable, CveAlmacen As Integer, CveConcepto As Integer, CveMoneda As Integer, CveVenta As Integer, Modulo As String, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1) As Integer + Dim OcurrioError As Boolean = False + + Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConcepto, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:=Modulo, CveMovimientoRelacionado:=CveMovimientoRelacionado) + + If CveMovimientoInventario <= 0 Then + 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 + If CveMovimientoRelacionado > 0 Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then + + 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 + + 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() + + 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("Se deben especificar las Series de los productos de almacén") + Exit For + End If + + 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 + + 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 + + + i = i + 1 + Next + End If + + 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN + If MovimientoPrePoliza AndAlso Not OcurrioError Then + Dim DtCostos As DataTable = Nothing + Dim ValorInventario As Decimal = 0 + Dim TotalCosto As Decimal = 0 + If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then + DtCostos = ObjInventario.DtResultados + TotalCosto = DtCostos.SUMD("Total").RoundSQL() + Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) + Dim IdCtaContable As Integer = 0 + Dim CveCuenta As Integer = 0 + If tmpCostos.Rows.Count > 0 Then + Dim TotalCostoAcumulado As Decimal = 0 + Dim cont As Integer = 1 + 'Se agrega movimiento separado por la cuenta de ventas (ER) + For Each RowInv As DataRow In tmpCostos.Rows + ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL() + TotalCostoAcumulado += ValorInventario + + 'cuando es el último movimiento y hay diferencias en los importes + If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then + ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado) + End If + + 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString) + IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + If ValorInventario <> 0 Then + + If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, False, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then + OcurrioError = True + End If + End If + cont += 1 + Next + End If + IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero + + If TotalCosto <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, True, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then + OcurrioError = True + End If + End If + + factura.Inv_CveMovimiento = CveMovimientoInventario + factura.Inv_ValorInventario = ValorInventario + + End If + End If + End If + + Return CveMovimientoInventario + End Function Private Sub GuardarVentaEstimaciones(ByRef factura As Modelos.Factura, ObjContr As ClsContratos) 'debe de ser por contrato el movimiento If factura.CveContratoSecciones.Length > 0 Then @@ -5786,6 +5942,7 @@ Namespace Modelos Public Property CvePedido2 As Integer = -1 Public Property CveAlmacenTraspasoOrigen As Integer = -1 Public Property CveAlmacenTraspasoDestino As Integer = -1 + Public Property CveAlmacenServicioDomicilio As Integer = -1 Public Property EsDevolucionVenta As Integer = -1 Public Property EsInterno As Integer = -1 Public Property CveEmpresaCRM As Integer = -1 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 3a6066805..9dc49a3c8 100644 --- a/App_Code/Usuario.vb +++ b/App_Code/Usuario.vb @@ -60,7 +60,11 @@ Public Class Usuario Public Property UTCOffset As Integer - Public Property isLoginseted As Boolean = False + Public Property isLoginseted 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/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 5b1f83c44..80ab83c67 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -693,21 +693,17 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero - Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "-1").ToString.ToEntero + Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "1").ToString.ToEntero + Dim CveMarca = IfNull(context.Request("cvemarca"), "-1").ToString.ToEntero Dim UsaGlobal As Boolean = True - 'verifica existencias If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then UsaGlobal = False - - If CveEmpresa.Contiene(140, 141) And Pagina.Contiene("ventas/ventas") Then - AplicaParaVenta = 1 - End If - + Dim objInv As New ClsInventarios - If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa) Then + If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca) Then ' limpio los almacenes donde no tiene ningun producto existencia diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 7324ffd30..bed72e577 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -767,12 +767,12 @@ Partial Class Bancos_IE - If TabCancelacion.Visible Then - LnkCancelar.Visible = False - LnkCancelarComplemento.Visible = False - LnkEliminar.Visible = False - LnkCancelarComplementoImporte.Visible = False - End If + 'If TabCancelacion.Visible Then + ' LnkCancelar.Visible = False + ' LnkCancelarComplemento.Visible = False + ' 'LnkEliminar.Visible = False + ' LnkCancelarComplementoImporte.Visible = False + 'End If UppEliminarIE.Update() @@ -4382,183 +4382,185 @@ Partial Class Bancos_IE Exit Sub End If - Dim Banc As New ClsBancos - Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL()) - - Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - ObjAC = New ClsContPAQi(UsuarioActual.Empresa) - ObjAC.IniciaTransacSQL() - End If - - Dim ErrorCancelar = False Dim MensajeError = "" Dim IdPolizaNueva = -1 Dim FolioPolizaNueva = -1 - If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then + Dim Banc As New ClsBancos + Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL()) - If ObjAC Is Nothing Then + Dim ObjAC As ClsContPAQi = Nothing + If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + Try + ObjAC = New ClsContPAQi(UsuarioActual.Empresa) + ObjAC.IniciaTransacSQL() + Catch ex As Exception + OnError("Ocurrió un error al iniciar la contabilización", ex) ErrorCancelar = True - End If + End Try - If Not ErrorCancelar Then - Dim dt As DataTable - If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then - dt = ObjAC.DtResultados + End If - ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS) - If dt.Rows(0)("FechaPol").ToString.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then - IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaCancelacion.Text.ToDate) - If IdPolizaNueva > 0 Then - FolioPolizaNueva = ObjAC.Folio + Try + If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then - 'CREA POLIZA NEGATIVA - For Each dr As DataRow In dt.Rows - If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaCancelacion.Text.ToDate, "") Then - ErrorCancelar = True - MensajeError = "Error al crear poliza negativa" - Exit For + If ObjAC Is Nothing Then + ErrorCancelar = True + End If + + If Not ErrorCancelar Then + Dim dt As DataTable + If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then + dt = ObjAC.DtResultados + + ' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS) + If dt.Rows(0)("FechaPol").ToString.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then + IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaCancelacion.Text.ToDate) + If IdPolizaNueva > 0 Then + FolioPolizaNueva = ObjAC.Folio + + 'CREA POLIZA NEGATIVA + For Each dr As DataRow In dt.Rows + If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaCancelacion.Text.ToDate, "") Then + ErrorCancelar = True + MensajeError = "Error al crear poliza negativa" + Exit For + End If + Next + + 'AJUSTA POLIZA + If Not ErrorCancelar Then + If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then + ErrorCancelar = True + MensajeError = "Error al ajustar poliza negativa" + End If End If - Next - 'AJUSTA POLIZA - If Not ErrorCancelar Then - If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then + 'CANCELA IE + If Not ErrorCancelar Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then + ErrorCancelar = True + MensajeError = "Error al cancelar IE" + End If + End If + + Else + ErrorCancelar = True + End If + + Else + + If ObjAC.RemovePoliza(IDPoliza) Then + If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then ErrorCancelar = True - MensajeError = "Error al ajustar poliza negativa" + MensajeError = "Error al desvincular poliza." + End If + Else + ErrorCancelar = True + MensajeError = "Error al eliminar poliza." + End If + + If Not ErrorCancelar Then + If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + ErrorCancelar = True + MensajeError = "Error al desbloquear prepoliza." End If End If 'CANCELA IE If Not ErrorCancelar Then - If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE" End If End If - Else - ErrorCancelar = True - End If + If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then + ErrorCancelar = True + MensajeError = "Error al contabilizar poliza" + End If + End If Else + ErrorCancelar = True + MensajeError = "Error al obtener la poliza" + End If + End If - If ObjAC.RemovePoliza(IDPoliza) Then - If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then - ErrorCancelar = True - MensajeError = "Error al desvincular poliza." - End If - Else - ErrorCancelar = True - MensajeError = "Error al eliminar poliza." - End If + Else - If Not ErrorCancelar Then - If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then - ErrorCancelar = True - MensajeError = "Error al desbloquear prepoliza." - End If - End If + ' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then + Dim GeneraCancelacionEnCero As Boolean = False + If TxtFechaCancelacion.Text.ToDate <= TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero + GeneraCancelacionEnCero = True + End If - 'CANCELA IE - If Not ErrorCancelar Then - If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then - ErrorCancelar = True - MensajeError = "Error al cancelar IE" - End If - End If + Dim TipoMovimiento As Integer = 1 - If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then - ErrorCancelar = True - MensajeError = "Error al contabilizar poliza" - End If + If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then + GeneraCancelacionEnCero = False + TipoMovimiento = 2 + End If + Dim CvePrePolizaCancelacion As Integer = 0 + If Not GeneraCancelacionEnCero Then + 'CANCELA IE MES ANTERIOR + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) + If CvePrePolizaCancelacion <= 0 Then + ErrorCancelar = True + MensajeError = "Error al cancelar IE MES ANTERIOR" + Else + 'DEBE GENERAR UNA NUEVA POLIZA + IDPoliza = -1 End If Else - ErrorCancelar = True - MensajeError = "Error al obtener la poliza" + 'CANCELA IE MES ACTUAL + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) + If CvePrePolizaCancelacion <= 0 Then + ErrorCancelar = True + MensajeError = "Error al cancelar IE MES ACTUAL" + End If End If - End If - Else + If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - ' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then - Dim GeneraCancelacionEnCero As Boolean = False - If TxtFechaCancelacion.Text.ToDate <= TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero - GeneraCancelacionEnCero = True - End If - - If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then - GeneraCancelacionEnCero = False - End If - Dim CvePrePolizaCancelacion As Integer = 0 - - If Not GeneraCancelacionEnCero Then - 'CANCELA IE MES ANTERIOR - CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) - If CvePrePolizaCancelacion <= 0 Then - ErrorCancelar = True - MensajeError = "Error al cancelar IE MES ANTERIOR" - End If - Else - 'CANCELA IE MES ACTUAL - CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) - If CvePrePolizaCancelacion <= 0 Then - ErrorCancelar = True - MensajeError = "Error al cancelar IE MES ACTUAL" + If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then + ErrorCancelar = True + MensajeError = "Error al contabilizar poliza" + End If End If + End If - If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - - If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then - ErrorCancelar = True - MensajeError = "Error al contabilizar poliza" - End If - End If - - End If - If Not ErrorCancelar Then - If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then - If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then - If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then - ErrorCancelar = True - MensajeError = "Error al cancelar complemento de pago" - Else - Dim FolioCancelado = $"{TxtFolio.Text}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}" - If Not Banc.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then + If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then + If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then + If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then ErrorCancelar = True - MensajeError = "Error al actualizar complemento de pago" + MensajeError = "Error al cancelar complemento de pago" + Else + Dim FolioCancelado = $"{TxtFolio.Text}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}" + If Not Banc.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then + ErrorCancelar = True + MensajeError = "Error al actualizar complemento de pago" + End If End If End If End If End If - End If - If Not ErrorCancelar Then + If Not ErrorCancelar Then - Dim ErrorCancelarComplemento As Boolean = True + Dim ErrorCancelarComplemento As Boolean = True - If CancelarComplemento Then - Dim ObjCancelacion As New Timbrado - 'Dim ObjBanco As New ClsBancos + If CancelarComplemento Then + Dim ObjCancelacion As New Timbrado + 'Dim ObjBanco As New ClsBancos - If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then + If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then - If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then - CargaComplementosPago() - RegistraScript("$('#ModalCancelarComplemetno').modal('hide');") - ErrorCancelarComplemento = False - Alert("El complemento se cancelo correctamente.") - End If - - Else - If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then - - If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then + If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then CargaComplementosPago() RegistraScript("$('#ModalCancelarComplemetno').modal('hide');") ErrorCancelarComplemento = False @@ -4566,49 +4568,62 @@ Partial Class Bancos_IE End If Else - Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia) + If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then + + If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then + CargaComplementosPago() + RegistraScript("$('#ModalCancelarComplemetno').modal('hide');") + ErrorCancelarComplemento = False + Alert("El complemento se cancelo correctamente.") + End If + + Else + Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia) + End If + End If - End If - - Else - ErrorCancelarComplemento = False - End If - - - If Not ErrorCancelarComplemento Then - - If ObjAC IsNot Nothing Then ObjAC.Commit() - Banc.Commit() - Dim Msg As New StringBuilder - - If CancelarComplemento Then - Msg.Append("El movimiento bancario y su complemento quedaron cancelados exitosamente.") Else - Msg.Append("El movimiento bancario quedó cancelado exitosamente.") + ErrorCancelarComplemento = False End If - If IdPolizaNueva > 0 Then Msg.AppendFormat("

Ver Póliza de cancelación", IdPolizaNueva) - Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""") + If Not ErrorCancelarComplemento Then + + If ObjAC IsNot Nothing Then ObjAC.Commit() + Banc.Commit() + Dim Msg As New StringBuilder + + If CancelarComplemento Then + Msg.Append("El movimiento bancario y su complemento quedaron cancelados exitosamente.") + Else + Msg.Append("El movimiento bancario quedó cancelado exitosamente.") + End If + + + If IdPolizaNueva > 0 Then Msg.AppendFormat("

Ver Póliza de cancelación", IdPolizaNueva) + Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""") + + Else + + If ObjAC IsNot Nothing Then ObjAC.RollBack() + Banc.RollBack() + Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError) + GuardaLog(MensajeError + " | CANCELAR IE") + + End If + Else - If ObjAC IsNot Nothing Then ObjAC.RollBack() Banc.RollBack() Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError) GuardaLog(MensajeError + " | CANCELAR IE") - End If - - - Else - If ObjAC IsNot Nothing Then ObjAC.RollBack() - Banc.RollBack() - Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError) - GuardaLog(MensajeError + " | CANCELAR IE") - End If + Catch ex As Exception + OnError("Ocurrio un error al cancelar", ex) + End Try If ObjAC IsNot Nothing Then ObjAC.Dispose() Banc.Dispose() @@ -6646,7 +6661,7 @@ Partial Class Bancos_IE GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") DdlTipoTransaccionCancelacion.Items.Clear() - DdlTipoTransaccionCancelacion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo ='{TipoMovto}'") + DdlTipoTransaccionCancelacion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo ='{TipoMovto}' AND Estatus = 1") DdlTipoTransaccionCancelacion.DataBind() DdlTipoTransaccionCancelacion.Items.Insert(0, New ListItem("Seleccione una", "-1")) diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index 1f64d8e96..3e8c7d744 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -72,8 +72,8 @@
-<%-- - --%> + + <%----%>
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 20fd13d7f..7a06ef3a6 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3988,9 +3988,11 @@ Partial Class Compras_Compras Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click - AjustaCombustibles() + 'If Not AjustaCombustibles() Then + ' Exit Sub + 'End If - '------------------INICIA VALIDACIONES------------------ + '------------------ INICIA VALIDACIONES ------------------ Dim EstatusCredito As Integer = 0 Dim CveSubProyecto As Integer = 0 'Credito Multiple @@ -4303,7 +4305,7 @@ Partial Class Compras_Compras Next If ErrorValidacion Then Exit Sub - '------------------TERMINA VALIDACIONES------------------ + 'RECORRO LOS PRODUCTOS O SERVICIOS PARA REGISTRARLOS LOS QUE NO EXISTEN EN EL CATÁLOGO Dim tCve As Integer @@ -4374,6 +4376,17 @@ Partial Class Compras_Compras UM.Dispose() PSS.Dispose() + 'VALIDA IMPORTES + If Not ValidaTotalesGuardar() Then + Exit Sub + End If + + If Not AjustaCombustibles() Then + Exit Sub + End If + + '------------------TERMINA VALIDACIONES------------------ + 'si hay necesidad de actualizar el globaldtps If RegeneraPS Then 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) @@ -4423,10 +4436,7 @@ Partial Class Compras_Compras TmpDT.AcceptChanges() If Correcto Then - 'VALIDA IMPORTES - If Not ValidaTotalesGuardar() Then - Exit Sub - End If + Dim ObjCompras As New ClsCompras() @@ -4650,6 +4660,8 @@ Partial Class Compras_Compras End If Next + + 'Compra If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble, LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble, @@ -6699,7 +6711,7 @@ Partial Class Compras_Compras Dim TCO As Decimal = 1 For Each Dr As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").Rows If ObjOC.OrdenesCompraDetalleCostoPP(Dr("CveOrdenCompraDetalle").ToString.ToEntero) AndAlso ObjOC.DtResultados.Rows.Count >= 1 Then - Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text} OC {ObjOC.DtResultados.FiltroPrimeroValor("Folio").ToString} Inv{ObjOC.DtResultados.FiltroPrimeroValor("FolioAlmacen").ToString}" + Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text} OC {ObjOC.DtResultados.FiltroPrimeroValor("Folio").ToString} Inv:{ObjOC.DtResultados.FiltroPrimeroValor("FolioAlmacen").ToString}" Importe176 = ObjOC.DtResultados.FiltroPrimeroValor("Importe176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN176").ToDecimal * Dr("Cantidad").ToString.ToDecimal Importe228 = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN228").ToDecimal * Dr("Cantidad").ToString.ToDecimal Importe229 = ObjOC.DtResultados.FiltroPrimeroValor("Importe229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN229").ToDecimal * Dr("Cantidad").ToString.ToDecimal @@ -6948,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 @@ -8493,8 +8528,12 @@ Partial Class Compras_Compras Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError) End If + BtnGuardar.Enabled = False + UpFacturar.Update() + Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar) + End If Else @@ -8538,7 +8577,12 @@ Partial Class Compras_Compras End Sub - Private Sub AjustaCombustibles() + Private Function AjustaCombustibles() As Boolean + + Dim Respuesta As Boolean = False + + Dim IVADetalles As Decimal = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal + Dim DiferenciaIVas As Decimal = TxtIVA.Text.ToDecimal - IVADetalles If Not TmpDT.Columns.Contains("AplicaIEPS") Then @@ -8569,18 +8613,14 @@ Partial Class Compras_Compras Dim IndiceUltimo As Integer = 0 For Each dRow As DataRow In TmpDT.Rows - If Boolean.Parse(dRow("AplicaIEPS").ToString) And Boolean.Parse(dRow("IEPSGrabaIVA").ToString) = False And dRow("IVA").ToString.ToDecimal > 0 Then IndiceUltimo = IndiceContador End If - IndiceContador = IndiceContador + 1 - Next - - Dim IVADetalles As Decimal = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal - Dim DiferenciaIVas As Decimal = TxtIVA.Text.ToDecimal - IVADetalles + IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal + DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles If Math.Abs(DiferenciaIVas) > 0.01D Then TmpDT.Rows(IndiceUltimo)("IVA") = TmpDT.Rows(IndiceUltimo)("IVA").ToString.ToDecimal + DiferenciaIVas @@ -8590,7 +8630,36 @@ Partial Class Compras_Compras End If - End Sub + 'Revalidacion de ajuste + IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal + DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles + + + + If Math.Abs(DiferenciaIVas) > 0.01D Then + + If IVADetalles > 0 Then + + For Each dRow As DataRow In TmpDT.Rows + If dRow("IVA").ToString.ToDecimal > 0 Then + dRow("IVA") = dRow("IVA").ToString.ToDecimal + DiferenciaIVas + TmpDT.AcceptChanges() + Respuesta = True + Exit For + End If + Next + + Else + Alert("Los productos especificados en el lisado no tienen asigando impuesto IVA, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia) + Respuesta = False + End If + Else + Respuesta = True + End If + + Return Respuesta + + End Function Protected Sub TxtCodigo_TextChanged(sender As Object, e As System.EventArgs) Handles TxtCodigo.TextChanged Dim ObjProveedores As New ClsCompProveedores() @@ -9756,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 @@ -12658,6 +12727,7 @@ Partial Class Compras_Compras TmpDT.Rows(Indice)("PU") = TmpDT.Rows(Indice)("PU").ToString.ToDouble + tPU TmpDT.Rows(Indice)("Total") = TmpDT.Rows(Indice)("Total").ToString.ToDouble + ImporteAjuste TmpDT.Rows(Indice)("IEPSPS") = (TmpDT.Rows(Indice)("Total").ToString.ToDouble() * TmpDT.Rows(Indice)("IEPSPSPorcentaje").ToString.ToDouble()).RoundAD(2) + TmpDT.Rows(Indice)("IVA") = TmpDT.Rows(Indice)("PU").ToString.ToDecimal * TmpDT.Rows(Indice)("Cantidad").ToString.ToDecimal * TmpDT.Rows(Indice)("IVAPorcentaje").ToString.ToDecimal 'Row("IEPSPS") = Math.Round(IEPSPS, DecimalesPermitidos) 'Row("IEPSPSPorcentaje") = PorcentajeIEPS TmpDT.AcceptChanges() @@ -13163,7 +13233,7 @@ Partial Class Compras_Compras End If 'CONTADO - Select Case RBLContado.SelectedValue + Select Case RBLContado.SelectedValue Case "1" ' Bancos PnlContadoBancos.Visible = True TxtDocumentoImporte.Text = (TxtTotal.Text.ToDecimal - LblAmortizacion.Text.ToDecimal).FormatoNumero @@ -13212,7 +13282,7 @@ Partial Class Compras_Compras End Sub Protected Sub BtnContado_Click(sender As Object, e As EventArgs) - TxtRembolsoNumero.Text = TxtNumeroReembolso.Text + TxtRembolsoNumero.Text = TxtNumeroReembolso.Text RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) End Sub @@ -14449,7 +14519,7 @@ Partial Class Compras_Compras Dim IEPSCompra As Decimal = TxtIEPS.Text.ToDecimal() Dim RetIVACompra As Decimal = TxtRetIVA.Text.ToDecimal() Dim RetISRCompra As Decimal = TxtRetISR.Text.ToDecimal() - Dim Acumulado As Decimal = 0 + Dim Acumulado As Decimal = 0 'Dim TotalCalculable As Decimal = TotalCompra - IEPSCompra + RetIVACompra + RetISRCompra @@ -17769,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 @@ -19213,7 +19285,7 @@ Partial Class Compras_Compras GuardaAnticipos(Nothing, Nothing) End Sub - Protected Sub BtnNCInvAlmacen_Click(sender As Object, e As EventArgs) + Protected Sub BtnNCInvAlmacen_Click(sender As Object, e As EventArgs) 'Dim ObjCompras As New ClsCompras 'Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL) @@ -20240,7 +20312,7 @@ Partial Class Compras_Compras - If DiferenciaInvOC.RoundSQL() <> 0 Then + If DiferenciaInvOC.RoundAD() <> 0 Then @@ -20254,8 +20326,8 @@ Partial Class Compras_Compras If CvePrePoliza > 0 Then If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then - ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL() - ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundSQL() + ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD() + ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD() Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp) 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/Proveedores.aspx b/Compras/Proveedores.aspx index 5673f5984..3aaf2a0d7 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -2254,7 +2254,7 @@ - + <%--
@@ -2296,7 +2296,7 @@
-
+
--%> 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/Compras/RepComprasAF.aspx b/Compras/RepComprasAF.aspx index 646011efb..015394096 100644 --- a/Compras/RepComprasAF.aspx +++ b/Compras/RepComprasAF.aspx @@ -105,7 +105,7 @@ -
SubTipo Activo Fijo:
+
SubTipo Fijo:
@@ -153,7 +153,7 @@
-
Producto Servicio:
+
diff --git a/Contabilidad/CatPeriodosBloqueo.aspx b/Contabilidad/CatPeriodosBloqueo.aspx index 80fa6e358..2ff3e254f 100644 --- a/Contabilidad/CatPeriodosBloqueo.aspx +++ b/Contabilidad/CatPeriodosBloqueo.aspx @@ -214,7 +214,7 @@ - + diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx index 56e6c5379..0ef7196ce 100644 --- a/Contabilidad/RegPrePoliza.aspx +++ b/Contabilidad/RegPrePoliza.aspx @@ -67,9 +67,16 @@ -
  • - Crear Complemento de Pago -
  • + + +
  • + Cargar Excel +
  • +
  • + Crear Complemento de Pago +
  • +
    +
    @@ -304,7 +311,7 @@
    EneroFeberoFebrero Marzo Abril Mayo
    - + Cuenta @@ -728,7 +735,54 @@
    - + diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 6e2809470..c5225c895 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -4,6 +4,7 @@ Imports System.Data Imports Extensiones Imports System.Linq Imports System.Web.Services +Imports GemBox.Spreadsheet Partial Class ContabilidadC_RegPrePoliza Inherits ClsPaginas @@ -171,6 +172,8 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + + If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS")) End If @@ -223,8 +226,9 @@ Partial Class ContabilidadC_RegPrePoliza Contabilizar() End If Exit Sub + LnkExcel.Visible = False Else - + LnkExcel.Visible = True CreaDT() BtnEliminar.Visible = False @@ -527,13 +531,20 @@ Partial Class ContabilidadC_RegPrePoliza If UsuarioActual.CveEmpresa.Contiene(120) Then DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) + DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1) + Else DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) + End If DdlPlantilla.DataBind() DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) + + DdlPlantilla2.DataBind() + DdlPlantilla2.Items.Insert(0, New ListItem("Plantilla Personalizada", "53")) End Sub Private Sub CargaConceptos() @@ -801,6 +812,8 @@ Partial Class ContabilidadC_RegPrePoliza dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto") dr("CveCuenta") = drt("CveCuenta") DtMovimientos.Rows.Add(dr) + + Next @@ -1754,5 +1767,252 @@ Partial Class ContabilidadC_RegPrePoliza End If ObjGral.Dispose() End Sub + + Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivCargaExcel")) + + End Sub + + Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click + Dim NombreArchivo As String + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + Dim workbook As New ExcelFile() + Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString) + + Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero + Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden") + + Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows + Select New With + { + .ConceptoAdministrativo = row.Item("ConceptoContable"), + .Cuenta = "", + .NombreCuenta = "", + .Cargo = "", + .Abono = "", + .Referencia = "", + .Concepto = "", + .SubProyecto = row.Item("SubProyecto"), + .CveConceptoContable = row.Item("CveConcepto"), + .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), + .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1) + }).QueryToDataTable(True) + + worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .StartColumn = 0 + }) + + Dim columnCount = worksheet.CalculateMaxUsedColumns() + For i = 0 To columnCount + worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) + Next + worksheet.Columns("I").Hidden = True + worksheet.Columns("J").Hidden = True + worksheet.Columns("K").Hidden = True + + + NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString + workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault) + + + End Sub + + Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click + If TxtExcel.getfiles().Archivos.Count > 0 Then + Dim file As Archivo = TxtExcel.getfiles().Archivos(0) + + Dim Directorio As String = Server.MapPath("~") & file.patch + + Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + CargarArchivo(Directorio, file.filename, Tipo) + Else + Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) + End If + End Sub + Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) + Dim dt As New DataTable + ' Conexion As Odbc.OdbcConnection = Nothing + Dim ErrorArchivo = False + Dim ErrorExcel = False + + dt = ReadExcelFile(Ruta + FileName, True) + + + If Not ErrorArchivo Then + + If Not dt.Columns(0).ColumnName = "ConceptoAdministrativo" Then + Alert("El nombre de la primera columna debe ser 'ConceptoAdmin'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(1).ColumnName = "Cuenta" Then + Alert("El nombre de la segunda columna debe ser 'Cuenta'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(2).ColumnName = "NombreCuenta" Then + Alert("El nombre de la tercera columna debe ser 'NombreCuenta'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(3).ColumnName = "Cargo" Then + Alert("El nombre de la cuarta columna debe ser 'Cargo'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(4).ColumnName = "Abono" Then + Alert("El nombre de la quinta columna debe ser 'Abono' .Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(5).ColumnName = "Referencia" Then + Alert("El nombre de la sexta columna debe ser 'Referencia'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(6).ColumnName = "Concepto" Then + Alert("El nombre de la séptima columna debe ser 'Concepto'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not dt.Columns(7).ColumnName = "SubProyecto" Then + Alert("El nombre de la octava columna debe ser 'SubProyecto'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + End If + + If Not ErrorArchivo Then + + + Dim ObjConta As New ClsContabilidad() + ObjConta.IniciaTransacSQL() + Try + Dim TieneError As Boolean = False + Dim ContadorUpdate As Integer = 0 + Dim ContadorError As Integer = 0 + Dim NombreCuenta As String = "" + Dim CvePrePoliza As Integer = 0 + Dim Cuenta As String = "" + Dim Reporte As New StringBuilder + Dim TotalCargos As Integer = 0 + Dim TotalAbonos As Integer = 0 + + + CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero) + + + For Each Row As DataRow In dt.Rows + NombreCuenta = Row("NombreCuenta").ToString + Cuenta = Row("Cuenta").ToString + + Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal) + Dim Concepto As String = Row("Concepto").ToString + Dim Referencia As String = Row("Referencia").ToString + Dim IdCuenta As Integer = -1 + Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero + Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) + Dim YaExiste As Boolean = False + Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero + Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + + If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then + If ObjConta.DtResultados.Rows.Count > 0 Then + IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero + 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") + Else + Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
    ") + TieneError = True + YaExiste = True + End If + Else + TieneError = True + Exit For + End If + + + 'If TipoCuenta.Contiene("A", "C", "E") Then + ' CargoAbono = False + 'End If + + If YaExiste = False Then + If IdCuenta > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then + TieneError = True + Exit For + End If + Else + IdCuenta = -2 + End If + End If + + + Next + If Not TieneError Then + ObjConta.Commit() + Alert(String.Format("

    Prepóliza: {1}", CvePrePoliza, ObjConta.ContaFolio)) + + Alert($"Se agregó la póliza {ObjConta.ContaFolio}") + + Else + Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError) + ObjConta.RollBack() + End If + + + Catch ex As Exception + ObjConta.RollBack() + End Try + + ObjConta.Dispose() + End If + End Sub + + Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) + + Dim unnamed As Integer = 0 + Dim cols As Integer + Dim columns As String() + Dim curRow As Integer = 0 + Dim curCol As Integer = 0 + Dim dataTable As DataTable = New DataTable() + Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) + + For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 + + If firstRowHasHeaders Then + + If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then + dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim) + Else + dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) + End If + + curRow = 1 + Else + dataTable.Columns.Add("Column " & (cols + 1)) + End If + + Next + + While curRow < worksheet.Rows.Count + + columns = New String(cols - 1) {} + + For curCol = 0 To cols - 1 + + If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then + columns(curCol) = "" + Else + columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() + End If + + Next + + dataTable.Rows.Add(columns) + curRow += 1 + + End While + + Return dataTable + + End Function End Class 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/Contabilidad2/CatCuentas.aspx.vb b/Contabilidad2/CatCuentas.aspx.vb index c863ad3d2..720b93107 100644 --- a/Contabilidad2/CatCuentas.aspx.vb +++ b/Contabilidad2/CatCuentas.aspx.vb @@ -316,7 +316,7 @@ Partial Class Contabilidad2_CatCuentas Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") - If UsuarioActual.Empresa.TipoContabilidad <> 1 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 Then Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa) @@ -372,6 +372,10 @@ Partial Class Contabilidad2_CatCuentas 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContabilidad +<<<<<<< HEAD + Dim ObjConta2 As ClsContPAQi +======= +>>>>>>> ee1135d888f76469fa6e3e68f0b6393f8450045a Dim CuentaEfectivo As Integer = 0 Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable @@ -386,7 +390,7 @@ Partial Class Contabilidad2_CatCuentas End If If idnew > 0 Then - If UsuarioActual.Empresa.TipoContabilidad <> 1 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 Then Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa) Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text If ObjConta2.GetCuentas(-1, "-1", -1) Then @@ -397,58 +401,71 @@ Partial Class Contabilidad2_CatCuentas IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero End If - If IdPadre > 0 Then - Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador) - If idnew2 > 0 Then - If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then + Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + ObjConta2 = New ClsContPAQi(UsuarioActual.Empresa) + + If ObjConta2.GetCuentas(-1, "-1", -1) Then + Dim IdPadre As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigoPadre}'").ToEntero + Dim IdAgrupador As Integer + + If ObjConta2.GetAgrupadoresSAT() Then + IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero + End If + + If IdPadre > 0 Then + Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador) + + If idnew2 > 0 Then + If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then + End If + End If + End If End If - + ObjConta2.Dispose() End If + + Dim dr As DataRow = DtDatos.NewRow + dr("CveCuenta") = idnew + dr("CuentaFormato") = TxtCuenta.Text + 'dr("CuentaFormato") = Tcuenta.Text + dr("Nombre") = Tnombre.Text + dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text) + 'dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text) + dr("Tipo") = DTcuenta.SelectedValue.ToString + dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString + dr("CvePadre") = IDSelected + dr("Codigo") = Tnombre.Text + dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero + dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero + dr("NomIdioma") = TxtNomIngles.Text.Trim + DtDatos.Rows.Add(dr) + ArbolCuentas.DataSource = DtDatos + '.Attributes.Add("data-hijos","0"); + Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem) + item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1 + Dim objul As ADServerControl.DragableUL = DirectCast(ArbolCuentas.FindControl(String.Format("ul{0}", IDSelected)), ADServerControl.DragableUL) + If (IsNothing(objul)) Then + objul = New ADServerControl.DragableUL + objul.ID = String.Format("ul{0}", item.Cve) + item.Controls.Add(objul) + End If + ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)) + + LimpiarCampos() + updatos.Update() + CargaDatos() + + Alert("La cuenta se guardo correctamente") End If - ObjConta2.Dispose() - End If + + ObjConta.Dispose() + + If ObjConta2 IsNot Nothing Then ObjConta2.Dispose() - 'Dim dr As DataRow = DtDatos.NewRow - 'dr("CveCuenta") = idnew - 'dr("CuentaFormato") = TxtCuenta.Text - ''dr("CuentaFormato") = Tcuenta.Text - 'dr("Nombre") = Tnombre.Text - 'dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text) - ''dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text) - 'dr("Tipo") = DTcuenta.SelectedValue.ToString - 'dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString - 'dr("CvePadre") = IDSelected - 'dr("Codigo") = Tnombre.Text - 'dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero - 'dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero - 'dr("NomIdioma") = TxtNomIngles.Text.Trim - 'DtDatos.Rows.Add(dr) - 'ArbolCuentas.DataSource = DtDatos - ''.Attributes.Add("data-hijos","0"); - 'Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem) - 'item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1 - 'Dim objul As ADServerControl.DragableUL = DirectCast(ArbolCuentas.FindControl(String.Format("ul{0}", IDSelected)), ADServerControl.DragableUL) - 'If (IsNothing(objul)) Then - ' objul = New ADServerControl.DragableUL - ' objul.ID = String.Format("ul{0}", item.Cve) - ' item.Controls.Add(objul) - 'End If - 'ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)) - ''ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text)) - - ''updatos.Visible = False - ''nuevacuenta.Visible = False - LimpiarCampos() - updatos.Update() - CargaDatos() - - Alert("La cuenta se guardo correctamente") - End If - - ObjConta.Dispose() End Sub Private Sub LimpiarCampos() TxtCuenta.Text = "" @@ -496,7 +513,7 @@ Partial Class Contabilidad2_CatCuentas Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") - If UsuarioActual.Empresa.TipoContabilidad <> 1 Then + If UsuarioActual.Empresa.TipoContabilidad = 2 Then Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa) If ObjConta2.GetCuentas(-1, "-1", -1) Then Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero 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/152/Formatos/Factura.rdlc b/Empresas/152/Formatos/Factura.rdlc index d4341c6b7..0597018c8 100644 --- a/Empresas/152/Formatos/Factura.rdlc +++ b/Empresas/152/Formatos/Factura.rdlc @@ -1,5 +1,5 @@ - + 0 @@ -1334,7 +1334,7 @@ - =iif(Parameters!Kilometraje.Value = "-1", "","Kilometraje: "& Parameters!Kilometraje.Value) + =iif(CDbl(Parameters!Kilometraje.Value) < 0, "","Kilometraje: "& Parameters!Kilometraje.Value) - 8.4664cm + 7.77848cm true true @@ -1573,51 +1573,6 @@ 2pt - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - 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 - - - - - - Textbox3 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Unidad - - - - - - - Textbox5 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Código - - - - - - - Textbox16 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Producto - - - - - - - Textbox12 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - SerieLote - - - - - - - Textbox4 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Valor - - - - - - - Textbox6 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Silver - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.49417cm - - - - - true - true - - - - - =IIf(Fields!PS.Value = "", IIf(Fields!FolioSalida.Value > 0,"Folio: " & Fields!FolioSalida.Value,"Total General"), Fields!Cantidad.Value) - - - - - - =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =IIf(Fields!PS.Value = "", Fields!FechaMovto.Value, Fields!UnidadMedida.Value) - - - - - - - UnidadMedida - - - =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - =IIf(Fields!PS.Value = "", IIf(Fields!FolioSalida.Value > 0,"Almacén Origen: " & Fields!Almacen.Value & " Almacén Destino: " & Fields!AlmacenDestino.Value & " Responsable: " & Fields!Recibio.Value,""), Fields!PS.Value) - - - - - - =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!SerieLote.Value - - - - - - - SerieLote - - - =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Valor.Value - - - - - - - Valor - - - =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - true - true - true - true - DataSet1 - 0.17639cm - 0.24474cm - 0.90897cm - 25.65193cm - - - - - - 0.67394in - - - - - - - Textbox1 - 0.47625cm - 6.54965cm - 0.6cm - 12.60299cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - REPORTE DE TRASPASO DE ALMACÉN - - - - - - - - - - - - - - - - Textbox2 - 1.07625cm - 6.54965cm - 0.52945cm - 12.60299cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!LogoPath.Value - FitProportional - 0.11458in - 0.28839cm - 2.09585cm - 5.89966cm - 2 - - - - - - true - true - - - - - =Parameters!Filtros.Value - HTML - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 3.30439cm - 0.24474cm - 0cm - 25.72823cm - 4 - - - - - - - - - - - 1.84855cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 0.27341cm - 22.76211cm - 0.38981cm - 3.13456cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Usuario: - - - - - - - Textbox8 - 0.27341cm - 0.28839cm - 0.38981cm - 1.60042cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!UsuarioImprimio.Value - - - - - - - Textbox9 - 0.27341cm - 1.83272cm - 0.38981cm - 7.13374cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 0.15875cm - 0.24474cm - 0cm - 25.72823cm - 4 - - - - - - true - true - - - - - =Globals!ExecutionTime - - - - - - - Textbox11 - 0.27341cm - 12.77526cm - 0.38981cm - 4.99273cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - IMPRESO EN SIG, Rep. Traspaso Almacén - - - - - - - Textbox13 - 0.63378cm - 0.28839cm - 0.46771cm - 6.69369cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 21.59cm - 27.94cm - 0.5cm - 0.5cm - 0cm - 0cm - 0.13cm - + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Unidad + + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Código + + + + + + + Textbox16 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Producto + + + + + + + Textbox12 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + SerieLote + + + + + + + Textbox4 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Valor + + + + + + + Textbox6 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.49417cm + + + + + true + true + + + + + =IIf(Fields!PS.Value = "", IIf(Fields!FolioSalida.Value > 0,"Folio: " & Fields!FolioSalida.Value,"Total General"), Fields!Cantidad.Value) + + + + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!PS.Value = "", Fields!FechaMovto.Value, Fields!UnidadMedida.Value) + + + + + + + UnidadMedida + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =IIf(Fields!PS.Value = "", IIf(Fields!FolioSalida.Value > 0,"Almacén Origen: " & Fields!Almacen.Value & " Almacén Destino: " & Fields!AlmacenDestino.Value & " Responsable: " & Fields!Recibio.Value,""), Fields!PS.Value) + + + + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SerieLote.Value + + + + + + + SerieLote + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Valor.Value + + + + + + + Valor + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + true + true + true + true + DataSet1 + 0.17639cm + 0.24474cm + 0.90897cm + 25.65193cm + + + + + + 0.67394in + + + + + + + Textbox1 + 0.47625cm + 0.6cm + 25.89667cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE TRASPASO DE ALMACÉN + + + + + + + + + + + + + + + + Textbox2 + 1.07625cm + 0.52945cm + 25.89667cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.11458in + 0.24474cm + 2.09585cm + 25.65193cm + 2 + + + + + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 3.30439cm + 0.24474cm + 0cm + 25.72823cm + 4 + + + + + + + + + + + 1.84855cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.27341cm + 22.76211cm + 0.38981cm + 3.13456cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + + Textbox8 + 0.27341cm + 0.28839cm + 0.38981cm + 1.60042cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox9 + 0.27341cm + 1.83272cm + 0.38981cm + 7.13374cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.15875cm + 0.24474cm + 0cm + 25.72823cm + 4 + + + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox11 + 0.27341cm + 12.77526cm + 0.38981cm + 4.99273cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Rep. Traspaso Almacén + + + + + + + Textbox13 + 0.63378cm + 0.28839cm + 0.46771cm + 6.69369cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 21.59cm + 27.94cm + 0.5cm + 0.5cm + 0cm + 0cm + 0.13cm + - - - - - - - - - - - - - - - - - - - - - - - - Textbox4 - 0.05159in - 0.29332cm - 0.96167in - 8.30729in - - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - 3.8335cm - - - 5.14583cm - - - 7.47417cm - - - 4.36267cm - - - - - 0.6cm - - - - - true - true - - - - - Unidad - - - - - - - Textbox2 - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Fecha - - - - - - - Textbox4 - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Dirección - - - - - - - Textbox6 - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Velocidad - - - - - - - Textbox10 - - - LightGrey - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - =Fields!Unidad.Value - - - =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Fecha.Value - - - =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Direccion.Value - - - =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Velocidad.Value - - - - Velocidad - - - =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - - DsOC - 5.11387cm - 0.29332cm - 1.2cm - 20.81617cm - 1 - - - - - - Embedded - LogoSinFondo - FitProportional - 0.13104cm - 1.07649cm - 2.44264cm - 2.74883cm - 2 - - - - - - true - true - - - - - Fecha Inicio: - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Fin: - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 15.1387cm - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0cm - 0cm - 0.5cm - 0.5cm - 1.27cm - + + + + + + + + + + + + + + + + + + + + + + + + Textbox4 + 0.05159in + 0.29332cm + 0.96167in + 8.30729in + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 3.8335cm + + + 5.14583cm + + + 7.47417cm + + + 4.36267cm + + + + + 0.6cm + + + + + true + true + + + + + Unidad + + + + + + + Textbox2 + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox4 + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Dirección + + + + + + + Textbox6 + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Velocidad + + + + + + + Textbox10 + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Unidad.Value + + + =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Direccion.Value + + + =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Velocidad.Value + + + + Velocidad + + + =iif(RowNumber("DsOC") Mod 2 = 0,"WhiteSmoke","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + DsOC + 5.11387cm + 0.29332cm + 1.2cm + 20.81617cm + 1 + + + + + + true + true + + + + + Fecha Inicio: + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Fin: + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.05159in + 0.29332cm + 2.09585cm + 21.10052cm + 4 + + + + + + true + true + + + + + =Parameters!NombreEmpresa.Value + + + + + + + Textbox1 + 1.97368cm + 0.29332cm + 0.6cm + 21.10052cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + 15.1387cm + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Parameters!FechaImpresion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Globals!PageNumber + + + + de + + + + =Globals!TotalPages + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0cm + 0cm + 0.5cm + 0.5cm + 1.27cm + - - - - - - -
  • - - <%--Clonar Usuario --%> - - Clonar Usuario - -
  • -
  • - Actualizar Gestor Cobranza -
  • -
    -
    - -
    - -   - - - - - - - - - - - - - -
    -
    - - -
    -
    -
    - - Datos del Usuario -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - --%> + + + + + + + + + + + + + + + + + +
    Usuario: - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="UsuarioDetalle.aspx.vb" Inherits="Sistemas_UsuarioDetalle" %> + +<%@ PreviousPageType VirtualPath="Usuarios.aspx" %> + + + + + + + + + + + +
  • + + <%--Clonar Usuario --%> + + Clonar Usuario + +
  • +
  • + Actualizar Gestor Cobranza +
  • +
    +
    + +
    + +   + + + + + + + + + + + + + +
    +
    + + +
    +
    +
    + + Datos del Usuario +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + <%-- - --%> - - - - - - - - - - - - -
    Usuario: + + +   + vpn_lock - + lock - + email - + <%----%> -
    Contraseña: - - - -
    Nombre: - - - -
    Rol: - - - - - -
    Correo: - - - -
    Contraseña: + + + +
    Nombre: + + + +
    Rol: + + + + + +
    Correo: + + + +
    Supervisa: @@ -182,2324 +183,2343 @@
    Empresa: - - - - - - - - - -
    Sessión por equipo
    Autorizar equipo
    -
    -
    -
    -
    -
    -
    - -
    -
    - - - - - -
    -
    -
    -
    -
    - - General -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Empresa: - - - -
    Personal - -
    Documento Venta - -
    Vendedor - -
    Sucursal: - - - <%----%> - - - -
    Almacén: - - - - - -
    Descuento Autorizado: - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Almacen -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - -
    AlmacénComandos
    - - - - - -
    -
    - - - - - - - - - - - - - - - +
    Empresa: + + + + + + + + + +
    Sessión por equipo
    Autorizar equipo
    Código Acceso: + + + + lock + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + + + + +
    +
    +
    +
    +
    + + General +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Empresa: + + + +
    Personal + +
    Documento Venta + +
    Vendedor + +
    Sucursal: + + + <%----%> + + + +
    Almacén: + + + + + +
    Descuento Autorizado: + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Almacen +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + +
    AlmacénComandos
    + + + + + +
    +
    + + + + + + + + + + + + + + +   - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - SubProyectos -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - -
    Proyecto - Comandos
    - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + SubProyectos +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + +
    Proyecto + Comandos
    + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +   - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - Estatus de Órdenes de Compra -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - -
    - - - - - - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    - - - - - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - Cuentas Bancarias -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - -
    No. Cuenta/ Resp. Caja ChicaComandos
    - - - - - -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - Estatus de Órdenes de Servicio -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - Clasificaciones -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - -
    ClasificaciónComandos
    - - - - - -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    - - Asignación de Permisos -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - - - - - - - - - - - - - - - - - - <%----%> - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - -
    -
    - -
    -
    -
    - - Asignar Procesos -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - - - - -
    -
    -
    -
    -
    - - Listado de Empresas -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    -
    - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - -
    -
    - -
    -
    -
    - - Restricciones -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    -
    -
    + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + Estatus de Órdenes de Compra +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + +
    + + + + + + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    + + + + + + + + + + +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + Cuentas Bancarias +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + +
    No. Cuenta/ Resp. Caja ChicaComandos
    + + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + Estatus de Órdenes de Servicio +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + + + + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + Clasificaciones +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + +
    ClasificaciónComandos
    + + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + + Asignación de Permisos +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + + + <%----%> + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + Asignar Procesos +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    + + Listado de Empresas +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + + Restricciones +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    Empresa: -
    -
    - - - -
    -
    -
    - -
    -
    -
    -
    - -
    - <%--EMPRESAS--%> -
    -
    -
    -
    - - Empresas -
    -
    -
    -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - -
    -
    -
    - - -
    - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - - <%--ROLES--%> -
    -
    -
    -
    - - ROLES -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    RolComandos
    - - - - - -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    - - <%--INDICADORES--%> -
    -
    -
    -
    - - Indicadores -
    -
    -
    -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - -
    -
    -
    - - -
    - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    - -
    - - <%--ALMACENES--%> -
    -
    -
    -
    - - Almacen -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    AlmacénComandos
    - - - - - -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - - <%--SUBPROYECTOS--%> -
    -
    -
    -
    - - SubProyectos -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    ProyectoComandos
    - - - -
    - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - - <%--CUENTAS BANCARIAS--%> -
    -
    -
    -
    - - Cuentas Bancarias -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    No. Cuenta/ Resp. Caja ChicaComandos
    - - - - - -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    - - -
    -
    -
    -
    -
    - - ESTATUS DE ÓRDENES DE COMPRA -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - -
    Tipo - Comandos
    - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - - - - - -
    -
    -
    -
    -
    - -
    -
    - -
    - - <%--MODULOS--%> -
    -
    -
    -
    - - Módulos -
    -
    -
    -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    - - <%--PERMISOS--%> -
    -
    -
    -
    - - Permisos -
    -
    -
    -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    - -
    -
    - - - - - -
    -
    -
    -
    -
    - - Indicadores -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    - - Sistema -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    Fecha último acceso: -
    Fecha último cambio de contraseña: -
    Política de cambio de contraseña -
    Fecha de captura: -
    Usuario capturó: -
    Estado: -
    -
    -
    -
    -
    -
    -
    -
    - - Bitácora de registro -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    -
    - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - -
    - - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    - - Bitacora -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - - - - + +
    + +
    - - + <%--EMPRESAS--%> +
    +
    +
    +
    + + Empresas +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + +
    +
    +
    + + +
    + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + <%--ROLES--%> +
    +
    +
    +
    + + ROLES +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + +
    RolComandos
    + + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    +
    + + <%--INDICADORES--%> +
    +
    +
    +
    + + Indicadores +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + +
    +
    +
    + + +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    + +
    + + <%--ALMACENES--%> +
    +
    +
    +
    + + Almacen +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + +
    AlmacénComandos
    + + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + <%--SUBPROYECTOS--%> +
    +
    +
    +
    + + SubProyectos +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + +
    ProyectoComandos
    + + + +
    + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + <%--CUENTAS BANCARIAS--%> +
    +
    +
    +
    + + Cuentas Bancarias +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + +
    No. Cuenta/ Resp. Caja ChicaComandos
    + + + + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    + + ESTATUS DE ÓRDENES DE COMPRA +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + +
    Tipo + Comandos
    + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + + + + + + + +
    +
    +
    +
    +
    + +
    +
    + +
    + + <%--MODULOS--%> +
    +
    +
    +
    + + Módulos +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    + + <%--PERMISOS--%> +
    +
    +
    +
    + + Permisos +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + + +
    + + + + + +
    +
    +
    +
    +
    + + Indicadores +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + + Sistema +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Fecha último acceso: +
    Fecha último cambio de contraseña: +
    Política de cambio de contraseña +
    Fecha de captura: +
    Usuario capturó: +
    Estado: +
    +
    +
    +
    +
    +
    +
    +
    + + Bitácora de registro +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    + + + + +
    + + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    + + Bitacora +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + - - - + + + + + + + - - - - - - + + +
    + + +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Día de la SemanaHora InicioHora Fin
    + + Todos +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Lunes +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Martes +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Miercoles +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Jueves +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Viernes +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Sabado +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    + + Domingo +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + Hora + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + +
    + + + - + + diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 3c125be18..89a9b347e 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -6,8 +6,8 @@ Imports System.Data Imports System.Threading Partial Class Sistemas_UsuarioDetalle - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "P R O P I E D A D E S" Private Property DTEstatusSubProyectos As DataTable Get @@ -84,6 +84,11 @@ Partial Class Sistemas_UsuarioDetalle Get Return ViewState("Password").ToString End Get + End Property + Private ReadOnly Property CodigoAcceso As String + Get + Return ViewState("CodigoAcceso").ToString + End Get End Property Private Property DtClasificaciones As DataTable Get @@ -390,10 +395,10 @@ Partial Class Sistemas_UsuarioDetalle Set(value As Integer) ViewState("CveEmpresaAnterior") = value End Set - End Property + End Property #End Region - - + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -444,27 +449,30 @@ Partial Class Sistemas_UsuarioDetalle TrDescuentoAutorizado.Visible = True End If - - CargaDatos() - InicializaClonarUsuario() - InicializaRestricciones() - CargaGvBitacora() - CargaEmpresasAsignaciones() - CreaDtAsignacionesMultiEmpresa() - CveEmpresaAnterior = DdlEmpresaAsignaciones.SelectedValue.ToEntero - + If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then + TrCodigoAcceso.Visible = True End If - End Sub - - 'DOCUMENTACION - 'LOS CAMPOS DE DATATABLE "ACCION" SE REFIERE AL ESTATUS DE LOS CAMBIOS QUE OCURRIERON ANTES DE DARLE GUARDAR - ' 0/NULL/VACIO = ORIGINAL (SIN CAMBIO) - ' 1 = AGREGADO - ' 2 = ELIMINADO - ' 3 = NADA (AGREGADO Y ELIMINADO): CUANDO AGREGA UN REGISTRO Y LO ELIMINA, ES DECIR, NO SE GUARDA NADA - ' 4 = UPDATE - + CargaDatos() + InicializaClonarUsuario() + InicializaRestricciones() + CargaGvBitacora() + CargaEmpresasAsignaciones() + CreaDtAsignacionesMultiEmpresa() + CveEmpresaAnterior = DdlEmpresaAsignaciones.SelectedValue.ToEntero + + End If + End Sub + + 'DOCUMENTACION + 'LOS CAMPOS DE DATATABLE "ACCION" SE REFIERE AL ESTATUS DE LOS CAMBIOS QUE OCURRIERON ANTES DE DARLE GUARDAR + ' 0/NULL/VACIO = ORIGINAL (SIN CAMBIO) + ' 1 = AGREGADO + ' 2 = ELIMINADO + ' 3 = NADA (AGREGADO Y ELIMINADO): CUANDO AGREGA UN REGISTRO Y LO ELIMINA, ES DECIR, NO SE GUARDA NADA + ' 4 = UPDATE + + #Region " C A R G A R - D A T O S " Private Sub CargaDatos() @@ -518,10 +526,10 @@ Partial Class Sistemas_UsuarioDetalle CargarRol() CargaAsignaciones() - CargaUsuarioResponsable - - ' ValidaAccesoEstatusOC() - + CargaUsuarioResponsable() + + ' ValidaAccesoEstatusOC() + End Sub Public Sub CargaUsuarioResponsable() @@ -545,7 +553,7 @@ Partial Class Sistemas_UsuarioDetalle ViewState("CveRol") = ObjUsuario.CveRol.ToString DdlRol.SelectedValue = ObjUsuario.CveRol.ToString TxtCorreo.Text = ObjUsuario.Correo - + TxtCodigoAcceso.Text = ObjUsuario.DtResultados.Rows(0)("CodigoAcceso").ToString() Dim autoip As String = ObjUsuario.DtResultados.Rows(0)("AutorizadoxIP").ToString().ToUpper() 'chkSessionxEquipo.Checked = (autoip = "1" OrElse autoip = "TRUE") @@ -553,6 +561,7 @@ Partial Class Sistemas_UsuarioDetalle 'DdlAutoriza.SelectedValue = ObjUsuario.CveAutoriza.ToString ViewState("Password") = ObjUsuario.Contraseña + ViewState("CodigoAcceso") = ObjUsuario.DtResultados.Rows(0)("CodigoAcceso").ToString() ViewState("CveEmpresa") = ObjUsuario.CveEmpresaPredeterminada DdlEmpresa.SelectedValue = CveEmpresa.ToString @@ -749,23 +758,23 @@ Partial Class Sistemas_UsuarioDetalle If CveTipoDocumentoAsignado <> "-1" Then DdlTipoDocumento.SelectedValueExist(CveTipoDocumentoAsignado) UpFiltrosAsignarPermiso.Update() - End Sub + End Sub #End Region - - 'Private Sub CargaSucursal() - ' DtSubProyectos2 = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto =" & DdlSubProyectos.SelectedValue.ToEntero) - ' If DtSubProyectos2.Rows.Count > 0 Then - ' Dim dr As DataRow - ' dr = DtSubProyectos2(0) - ' CveSucursal = dr("CveSucursal").ToString.ToEntero - ' Else - ' CveSucursal = -1 - ' End If - - 'End Sub - + + 'Private Sub CargaSucursal() + ' DtSubProyectos2 = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto =" & DdlSubProyectos.SelectedValue.ToEntero) + ' If DtSubProyectos2.Rows.Count > 0 Then + ' Dim dr As DataRow + ' dr = DtSubProyectos2(0) + ' CveSucursal = dr("CveSucursal").ToString.ToEntero + ' Else + ' CveSucursal = -1 + ' End If + + 'End Sub + #Region " G U A R D A R - U P D A T E " - + Private Function ValidaUsername(Username As String, Correo As String) As Boolean Dim Retorno As Boolean = True 'If CveUsuario = -1 Then @@ -818,10 +827,11 @@ Partial Class Sistemas_UsuarioDetalle DtAsignacionesMultiEmpresa.Rows.Add(Row) End If + Dim CodigoAcceso As String = If(String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim), "-1", TxtCodigoAcceso.Text.Trim) 'REGISTRA O ACTUALIZA LOS DATOS GENERALES DEL USUARIO If CveUsuario = -1 Then - CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble) + CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso) EsNuevoUsuario = True If CveUsuario = -1 Then TieneError = True @@ -833,7 +843,7 @@ Partial Class Sistemas_UsuarioDetalle End If Next Else - If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble) Then + If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso) Then TieneError = True End If @@ -1398,10 +1408,10 @@ Partial Class Sistemas_UsuarioDetalle Catch ex As Exception OnError("Ocurrió error al mandar MAIL", ex) End Try - End Sub + End Sub #End Region - - + + #Region " E L I M I N A R - U S U A R I O " Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click ''DENTRO DEL PROCEDIMIENTO ELIMINA TODO LO RELACIONADO CON EL USUARIO (ALMACENES, SUBPROYECTOS, ACCESO A EMPRESAS...) @@ -1413,10 +1423,10 @@ Partial Class Sistemas_UsuarioDetalle Alert("Ocurrió un error al eliminar el usuario. Por favor vuelva a intentar", TipoMensaje.MsgError) End If ObjUsuario.Dispose() - End Sub + End Sub #End Region - - + + #Region " CONTRASEÑA " Protected Sub LnkRestablecer_Click(sender As Object, e As EventArgs) Handles LnkRestablecer.Click Dim Usuario As New ClsSisUsuarios @@ -1430,11 +1440,15 @@ Partial Class Sistemas_UsuarioDetalle Protected Sub LnkVerPass_Click(sender As Object, e As EventArgs) Handles LnkVerPass.Click Alert(Extensiones.Decripta(Password)) - End Sub - + End Sub + Protected Sub LnkVerCodigoAcceso_Click(sender As Object, e As EventArgs) Handles LnkVerCodigoAcceso.Click + Alert(CodigoAcceso) + End Sub + + #End Region - - + + #Region "TAB - ASIGNACIONES" Protected Sub DdlEmpresaAsignaciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaAsignaciones.SelectedIndexChanged @@ -1496,8 +1510,8 @@ Partial Class Sistemas_UsuarioDetalle DtAsignacionesMultiEmpresa.Columns.Add("CveSucursal", GetType(Integer)) DtAsignacionesMultiEmpresa.Columns.Add("CveAlmacen", GetType(Integer)) DtAsignacionesMultiEmpresa.Columns.Add("CveTipoDocumento", GetType(String)) - End Sub - + End Sub + #Region " PROYECTOS-SUBPROYECTOS " Private Sub CargaProyectos() DdlProyecto.Items.Clear() @@ -1879,8 +1893,8 @@ Partial Class Sistemas_UsuarioDetalle End If End If ChkAsignarAllProyectos.Checked = False - End Sub - + End Sub + #Region "GV SUBPROYECTOS" Protected Sub GvSubProyectos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvSubProyectos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -1982,14 +1996,14 @@ Partial Class Sistemas_UsuarioDetalle GvSubProyectos.EditIndex = -1 CargaGvSubProyectos() - End Sub - + End Sub + #End Region - + #End Region - + #Region " ALMACENES " - + Private Function GetAlmacenesSinGV() As String Dim SB As New StringBuilder Dim prefix As String = "" @@ -2098,8 +2112,8 @@ Partial Class Sistemas_UsuarioDetalle Private Sub CargaGVAlmacen() GvAlmacenes.DataSource = DtAlmacenes.FiltraParametros(String.Format("CveEmpresa = {0} And (isnull(Accion,0) < 2 Or Accion = 4)", DdlEmpresaAsignaciones.SelectedValue.ToEntero)) GvAlmacenes.DataBind() - End Sub - + End Sub + #Region "GV ALMACENES" Protected Sub GvAlmacenes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAlmacenes.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -2186,11 +2200,11 @@ Partial Class Sistemas_UsuarioDetalle GvAlmacenes.EditIndex = -1 CargaGVAlmacen() - End Sub + End Sub #End Region - + #End Region - + #Region " CUENTAS BANCARIAS " Private Sub CargaCuentasBancarias() DdlCuentasBancarias.Items.Clear() @@ -2253,9 +2267,9 @@ Partial Class Sistemas_UsuarioDetalle DtCuentasBancarias.AcceptChanges() CargaGvCuentasBancarias() - End Sub + End Sub #End Region - + #Region " ESTATUS DE ÓRDENES DE COMPRA" Private Sub CargaEstatusOrdenesCompra() ' Exit Sub @@ -2449,9 +2463,9 @@ Partial Class Sistemas_UsuarioDetalle Else CargaGridEstatusUsuarioOC("OC") End If - End Sub + End Sub #Region "GRIDVIEW" - + Protected Sub GvEstatusUsuariosREQ_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosREQ.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim tmpT As DataTable = DTEstatusSubProyectos.FiltraParametros(String.Format("CveSubProyecto = {0}", e.Row.DBCampo("CveSubProyecto").ToString)) @@ -2706,13 +2720,13 @@ Partial Class Sistemas_UsuarioDetalle End If Next End If - End Sub - - + End Sub + + #End Region - + #End Region - + #Region "ESTATUS DE ORDENES DE SERVICIO" Private Sub CargaEstatusOS() CreaGridEstatusOS() @@ -2865,9 +2879,9 @@ Partial Class Sistemas_UsuarioDetalle End If Next Next - End Sub + End Sub #End Region - + #Region " ESTATUS ORDENES DE COMPRA - CLASIFICACIONES USUARIO OC " Private Sub InicializaEstasClasificacionesOC() @@ -2929,15 +2943,15 @@ Partial Class Sistemas_UsuarioDetalle ObjOC.Dispose() CargaGVOCClasificaciones() - End Sub - - - + End Sub + + + #End Region - + #End Region - - + + #Region "TAB - ACCESO MODULOS" Public Sub CargaModulosAcceso() Dim ObjPermisos As New ClsSisUsuarios @@ -3023,10 +3037,10 @@ Partial Class Sistemas_UsuarioDetalle Alert("Los Permisos se eliminaron correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/Sistemas/Usuarios.aspx""") End If ObjUsuario.Dispose() - End Sub + End Sub #End Region - - + + #Region "TAB - PERMISO MODULOS" Public Sub CargaModulosPermisos() Dim ObjProcesos As New ClsSisUsuarios @@ -3126,10 +3140,10 @@ Partial Class Sistemas_UsuarioDetalle Alert("Los Procesos se eliminaron correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/Sistemas/Usuarios.aspx""") End If ObjUsuario.Dispose() - End Sub + End Sub #End Region - - + + #Region "TAB - ACCESO EMPRESAS" Private Sub CargaEmpresas() Dim ClsUsuarios As New ClsSisUsuarios @@ -3319,10 +3333,10 @@ Partial Class Sistemas_UsuarioDetalle Private Sub LnkRenviaCorreo_Click(sender As Object, e As EventArgs) Handles LnkRenviaCorreo.Click EnviaCorreo() Alert("Correo enviado con exito.", TipoMensaje.MsgInformacion) - End Sub + End Sub #End Region - - + + #Region "TAB - RESTRICCIONES ACCESO " Private Sub InicializaRestricciones() CargaDtRestricciones() @@ -3535,8 +3549,8 @@ Partial Class Sistemas_UsuarioDetalle CargaGvRestricciones() RegistraScript("$('#DivAgregarRestricción').modal('hide')") - End Sub - + End Sub + #Region " GV " Private Sub GvRestricciones_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvRestricciones.RowCommand @@ -3626,13 +3640,13 @@ Partial Class Sistemas_UsuarioDetalle End If CargaGvRestricciones() - End Sub + End Sub #End Region - - + + #End Region - - + + #Region "TAB - INDICADORES" Public Sub CargaGridIndicadores() Dim Objeto As New ClsIndicadores @@ -3649,11 +3663,11 @@ Partial Class Sistemas_UsuarioDetalle e.Row.FCCheckBox("chkIndicador").Checked = True End If End If - End Sub - + End Sub + #End Region - - + + #Region " CLONAR USUARIO " Private Sub InicializaClonarUsuario() DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) @@ -3739,12 +3753,12 @@ Partial Class Sistemas_UsuarioDetalle 'CargaDatos() Return Retorno - End Function - - + End Function + + #End Region - - + + #Region " MANDA CORREO " Private Sub MandaCorreo(Asunto As String, Para As String, Body As String) Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) @@ -3752,13 +3766,13 @@ Partial Class Sistemas_UsuarioDetalle Dim Mail As New ClsSisMail() 'Mail.MandaCorreo(ClsPaginas.EmpresaNotificaciones, Para, Asunto, "", "", Nothing, Body) Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body) - End Sub - - - + End Sub + + + #End Region - - + + #Region " ASIGNACIONES DE PERMISOS " Protected Sub DdlEmpresaAsignarPermiso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaAsignarPermiso.SelectedIndexChanged CargaAsignaciones() @@ -3782,8 +3796,8 @@ Partial Class Sistemas_UsuarioDetalle CargaDtEstatusOC() CargaGvEstatusOC() - End Sub - + End Sub + #Region " EMPRESAS " Public Sub CargaDTEmpresasAsignar() Dim ObjPermisos As New ClsSisUsuarios @@ -3842,10 +3856,10 @@ Partial Class Sistemas_UsuarioDetalle CargaAsignaciones() - End Sub - + End Sub + #End Region - + #Region " ROLES " Private Sub CargaDtRolesAsignar() Dim ClsUsuarios As New ClsSisUsuarios @@ -3934,9 +3948,9 @@ Partial Class Sistemas_UsuarioDetalle DTRolesAsignar.AcceptChanges() CargaGVRolesAsignar() - End Sub + End Sub #End Region - + #Region " ALMACENES " Private Sub CargaDtAlmacenAsignar() Dim ClsUsuarios As New ClsSisUsuarios @@ -4027,11 +4041,11 @@ Partial Class Sistemas_UsuarioDetalle DtAlmacenesAsignar.AcceptChanges() CargaGVAlmacenAsignar() - End Sub - - + End Sub + + #End Region - + #Region " PROYECTOS-SUBPROYECTOS " Private Sub CargaDtSubProyectosAsignar() Dim ClsUsuarios As New ClsSisUsuarios @@ -4142,10 +4156,10 @@ Partial Class Sistemas_UsuarioDetalle DtSubProyectosAsignar.AcceptChanges() CargarGvSubProyectosAsignar() - End Sub - + End Sub + #End Region - + #Region " CUENTAS BANCARIAS " Private Sub CargaCuentasBancariasAsignar() DdlCuentasBancariasAsignar.Items.Clear() @@ -4230,9 +4244,9 @@ Partial Class Sistemas_UsuarioDetalle DtCuentasBancariasAsignar.AcceptChanges() CargaGvCuentasBancariasAsignar() - End Sub + End Sub #End Region - + #Region " MODULOS " Public Sub CargaDTModulosAsignar() Dim ObjPermisos As New ClsSisUsuarios @@ -4267,10 +4281,10 @@ Partial Class Sistemas_UsuarioDetalle End If End If - End Sub - + End Sub + #End Region - + #Region " PERMISOS " Public Sub CargaDTPermisosAsignar() Dim ObjPermisos As New ClsSisUsuarios @@ -4305,9 +4319,9 @@ Partial Class Sistemas_UsuarioDetalle End If End If - End Sub + End Sub #End Region - + #Region " INDICADORES " Public Sub CargaDTIndicadoresAsignar() Dim ObjIndicadores As New ClsSisUsuarios @@ -4335,13 +4349,13 @@ Partial Class Sistemas_UsuarioDetalle End If End If - End Sub + End Sub #End Region - - + + #End Region - - + + #Region " USUARIO CONTROLADO " Private Sub InicializaUsuarioControlado() Dim ClsUsuarios As New ClsSisUsuarios @@ -4391,12 +4405,12 @@ Partial Class Sistemas_UsuarioDetalle End If ClsUsuarios.Dispose() - End Sub + End Sub #End Region - - + + #Region "C O N T O L E S DE U S U A R I O S" - + #Region "ESTATUS DE ÓRDENES DE COMPRA" Private Sub CargaDtEstatusOCPermisos() Dim ClsUsuarios As New ClsSisUsuarios @@ -4517,10 +4531,10 @@ Partial Class Sistemas_UsuarioDetalle DTEstatusOC = dt DTEstatusOCAsignar = dt - End Sub + End Sub #End Region - - + + #Region "GV ESTATUS DE OC" Protected Sub GvEstatusOC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusOC.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -4631,11 +4645,11 @@ Partial Class Sistemas_UsuarioDetalle GvEstatusUsuariosOC.Columns(i).Visible = (dtValida IsNot Nothing AndAlso dtValida.Rows.Count = 1) End If Next - End Sub - + End Sub + #End Region #End Region - + Protected Sub LnkAgregarClasificacion_Click(sender As Object, e As EventArgs) If DtClasificaciones IsNot Nothing Then Dim CveClasificacion As Integer = DdlClasificacion.SelectedValue.ToEntero @@ -4762,10 +4776,10 @@ Partial Class Sistemas_UsuarioDetalle - End Sub - + End Sub + #Region "USUARIO RESPONSABLE" - + Protected Sub BtnUpdateUsuarioResponsable_Click(sender As Object, e As EventArgs) Dim ObjUsuarios As New ClsSisUsuarios If ObjUsuarios.UpdateUsuarioResponsableMasivo(CveUsuario, DdlUsuarioResponsable.SelectedValue.ToEntero) Then @@ -4773,10 +4787,10 @@ Partial Class Sistemas_UsuarioDetalle RegistraScript("$('#DivUpdateUsuarioResponsable').modal('hide')") End If ObjUsuarios.Dispose() - End Sub - + End Sub + #End Region - + Protected Sub LnkAutorizarEquipo_Click(sender As Object, e As EventArgs) 'CveUsuario Dim AdsCodex As String = Encripta(String.Format("{0}_{1}_{2}", CveUsuario, DateTime.Now.Ticks, UsuarioActual.CveUsuario)) diff --git a/Ventas/CatPromociones.aspx b/Ventas/CatPromociones.aspx index c3290c099..572b86184 100644 --- a/Ventas/CatPromociones.aspx +++ b/Ventas/CatPromociones.aspx @@ -39,8 +39,8 @@
    - - + +
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 4b1283c3a..13ea2fad2 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1405,6 +1405,7 @@ Partial Class Clientes Dim RetSC As Boolean = CargaSucursalesCliente() Dim RetCC As Boolean = CargaCotizaciones() CargaHistorial() + CargaResumenHistorial() Dim RetCxC As Boolean = CargaCxC() CargaAnticipos() CargaPersonalAsignado() @@ -1799,14 +1800,9 @@ Partial Class Clientes Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) Dim ObjClientes As New ClsClientes() If ObjClientes.GetHistorialVentas(CveCliente, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then - If ObjClientes.DtResultados.Rows.Count > 0 Then - 'Carga Generales - LtlCantidad.Text = ObjClientes.DtResultados.Rows(0)("CountTotal").ToString().FormatoNumero()(0) - LtlTotalVendido.Text = ObjClientes.DtResultados.Rows(0)("Total").ToString().FormatoNumero()(2) - LtlMinima.Text = ObjClientes.DtResultados.Rows(0)("MIN_Total").ToString().FormatoNumero()(2) - LtlPromedio.Text = ObjClientes.DtResultados.Rows(0)("AVG_Total").ToString().FormatoNumero()(2) - LtlMaxima.Text = ObjClientes.DtResultados.Rows(0)("MAX_Total").ToString().FormatoNumero()(2) - 'Carga Grid + If ObjClientes.DtResultados.Rows.Count > 0 Then + + 'Carga Grid DTHistorialVentas = ObjClientes.DtResultados GVHistorial.DataSource = ObjClientes.DtResultados Else @@ -7981,7 +7977,11 @@ Partial Class Clientes Dim Row2 As DataRow = Nothing Row2 = Dt2.NewRow() LtlLimiteCreditoModal.Text = LimiteCredito.FormatoNumero() - Row2("limite") = LimiteCredito - Saldo + If LimiteCredito > 0 Then + Row2("limite") = LimiteCredito - Saldo + Else + Row2("limite") = 0 + End If Row2("saldo") = Saldo Dt2.Rows.Add(Row2) Dim query2 = From s In Dt2.AsEnumerable() Select New With {.year = "", .limite = s("limite").ToString(), .saldo = s("saldo").ToString()} @@ -10309,5 +10309,44 @@ Partial Class Clientes UpDatos.Update() End Sub + + Private Sub CargaResumenHistorial() + Dim ObjClientes As New ClsClientes() + If ObjClientes.GetHistorialVentas(CveCliente, -1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then + If ObjClientes.DtResultados.Rows.Count > 0 Then + + Dim Cantidad As Double + Dim Max As Double + Dim Min As Double = 1000000000000 + Dim Total As Double + Dim Promedio As Double + + For Each row As DataRow In ObjClientes.DtResultados.Rows + If row.Item("Folio").ToString <> "" Then + If row.Item("Total").ToString.ToDouble > Max Then + Max = row.Item("Total").ToString.ToDouble + End If + If row.Item("Total").ToString.ToDouble < Min And row.Item("Total").ToString.ToDouble > 0 Then + Min = row.Item("Total").ToString.ToDouble + End If + + + Total += row.Item("Total").ToString.ToDouble + Cantidad += 1 + End If + Next + + Promedio = Total / Cantidad + + 'Carga Generales + LtlCantidad.Text = Cantidad.ToString.FormatoNumero(0) + LtlTotalVendido.Text = Total.ToString.FormatoNumero() + LtlMinima.Text = Min.ToString.FormatoNumero() + LtlPromedio.Text = Promedio.ToString.FormatoNumero() + LtlMaxima.Text = Max.ToString.FormatoNumero() + End If + End If + ObjClientes.Dispose() + End Sub End Class diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index b54300575..43a22ccc5 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -585,6 +585,14 @@ + + + +
    + +
    +
    +
    @@ -829,11 +837,11 @@ - Total: + Total: - + @@ -1917,6 +1925,46 @@ + + <%-- ******************************************** Bloqueo de Caja *************************************************************************************************************************************** --%> + +