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 f3c4f4b4a..6cd4de4c4 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 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..a2f021adc 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 @@ -3798,6 +3798,18 @@ 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 + End If + End If Return OcurrioError @@ -4059,6 +4071,129 @@ 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 + 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 + + '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 +5921,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/Usuario.vb b/App_Code/Usuario.vb index 3a6066805..6ae6e14d1 100644 --- a/App_Code/Usuario.vb +++ b/App_Code/Usuario.vb @@ -60,7 +60,9 @@ 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 ReadOnly Property FechaActualCliente As DateTime Get 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 bff44fe3a..40a1431b5 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6711,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 @@ -20287,7 +20287,7 @@ Partial Class Compras_Compras - If DiferenciaInvOC.RoundSQL() <> 0 Then + If DiferenciaInvOC.RoundAD() <> 0 Then @@ -20301,8 +20301,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/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/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/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/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc index d2db328a8..e6d4abd83 100644 --- a/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc +++ b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc @@ -1,1016 +1,5 @@  - - - - - - - - 3.57404cm - - - 2.36927cm - - - 2.15604cm - - - 13.71833cm - - - 2.02375cm - - - 1.8105cm - - - - - 0.4148cm - - - - - true - true - - - - - Disponible - - - - - - - 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/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 4b1283c3a..3a0aabf9f 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -7981,7 +7981,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()} diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index b54300575..6f6ec5d8b 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -585,6 +585,14 @@ + + + +
    + +
    +
    +
    @@ -833,7 +841,7 @@ - + @@ -1917,6 +1925,46 @@ + + <%-- ******************************************** Bloqueo de Caja *************************************************************************************************************************************** --%> + +
    @@ -3008,11 +3076,11 @@
    - + - +
    @@ -3046,6 +3114,20 @@