diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index b5225cd7b..03d47a895 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -710,7 +710,8 @@ Public Class ClsBancos Public Function GetBancosIE(CveIE As Integer, CveBanco As Integer, CveCuenta As Integer, TipoMovimiento As String, CveTipoTransaccion As Integer, Folio As String, PagueseA As String, Importe As Double, CveMoneda As Integer, EsAbonoEnCuenta As Integer, FueConciliado As Integer, CveEstatusIE As Integer, FechaInicio As Date, FechaFin As Date, FechaAplicacionInicio As Date, FechaAplicacionFin As Date, - FechaConciliadoInicio As Date, FechaConciliadoFin As Date, CveUsuarioConcilio As Integer, TImporte As Double, CveEmpresa As Integer, Optional CveEstatusNotificacion As Integer = -1, Optional CveCuentaTarjeta As Integer = -1) As Boolean + FechaConciliadoInicio As Date, FechaConciliadoFin As Date, CveUsuarioConcilio As Integer, TImporte As Double, CveEmpresa As Integer, + Optional CveEstatusNotificacion As Integer = -1, Optional CveCuentaTarjeta As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_IEGet") @@ -739,6 +740,7 @@ Public Class ClsBancos .Add("@CveEstatusNotificacion", SqlDbType.Int).Value = CveEstatusNotificacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveCuentaTarjeta", SqlDbType.Int).Value = CveCuentaTarjeta + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With diff --git a/App_Code/ClsCGame.vb b/App_Code/ClsCGame.vb index 417d972e9..50d497b46 100644 --- a/App_Code/ClsCGame.vb +++ b/App_Code/ClsCGame.vb @@ -492,7 +492,8 @@ Public Class ClsCGame #End Region #Region "ORDEN DE PRODUCCION" - Public Function GetOrdenProduccion(CveOrdenProduccion As Integer, CveEmpresa As Integer, CveEstatus As Integer, Folio As String, FEntregaI As Date, FEntregaF As Date, CveCliente As Integer) As Boolean + Public Function GetOrdenProduccion(CveOrdenProduccion As Integer, CveEmpresa As Integer, CveEstatus As Integer, Folio As String, FEntregaI As Date, FEntregaF As Date, + CveCliente As Integer, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CGame_OrdenProduccionGet") With SqlAdapter.SelectCommand.Parameters @@ -503,6 +504,7 @@ Public Class ClsCGame .Add("@FEntregaI", SqlDbType.Date).Value = FEntregaI .Add("@FEntregaF", SqlDbType.Date).Value = FEntregaF .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try SqlAdapter.Fill(Data) @@ -1039,7 +1041,9 @@ Public Class ClsCGame #End Region #Region "PRODUCCION" - Public Function GetProduccion(CveEmpresa As Integer, Optional Folio As String = "-1", Optional CveProduccion As Integer = -1, Optional CveHuerta As Integer = -1, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha, Optional Opcion As Integer = -1, Optional Modalidad As Integer = -1) As Boolean + Public Function GetProduccion(CveEmpresa As Integer, Optional Folio As String = "-1", Optional CveProduccion As Integer = -1, Optional CveHuerta As Integer = -1, + Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha, Optional Opcion As Integer = -1, Optional Modalidad As Integer = -1, + Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CGame_ProduccionGet") With SqlAdapter.SelectCommand.Parameters @@ -1051,6 +1055,7 @@ Public Class ClsCGame .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Modalidad", SqlDbType.Int).Value = Modalidad + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index b4a4f540e..a07d2a7d3 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -651,7 +651,7 @@ Public Class ClsCRM Public Function GetAcercamiento(CveEmpresa As Integer, Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamiento As Integer = -1, Optional CveTipoProceso As Integer = -1, Optional CveVendedor As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional NombreAcercamiento As String = "-1", Optional CveMedioCaptacion As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional CveProbabilidad As Integer = -1, - Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1") As Boolean + Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoGet") With SqlAdapter.SelectCommand.Parameters @@ -673,6 +673,8 @@ Public Class ClsCRM .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin .Add("@FechaApertura", SqlDbType.VarChar).Value = FechaApertura .Add("@FechaCierre", SqlDbType.VarChar).Value = FechaCierre + + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 0904a892b..4ed4b5dd5 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -23,11 +23,13 @@ Public Class ClsClientes 'Atributos de la clase Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIÓN - Private CveConexion As Integer = 0 + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False + #End Region - + #Region "Propiedades" - + Public Property CveCliente As Integer Public Property Nombre As String Public Property NombreComercial As String @@ -186,7 +188,8 @@ Public Class ClsClientes End Try Else SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -201,11 +204,11 @@ Public Class ClsClientes End With If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc Data = New DataTable - End Sub + End Sub #Region "Conexiones" - + Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters @@ -261,7 +264,7 @@ Public Class ClsClientes End Sub Public Function GetClientes(CveCliente As Integer, Nombre As String, Codigo As String, NombreCorto As String, RFC As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional Notificar As String = "-1", Optional CvePrecioLista As Integer = -1, Optional CveClienteClasificacion As Integer = -1, - Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1) As Boolean + Optional TipoCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PermiteCreditoFiltro As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesGet") @@ -282,6 +285,7 @@ Public Class ClsClientes .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@PermiteCredito", SqlDbType.Int).Value = PermiteCreditoFiltro + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 813a15016..7532b38b7 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -297,7 +297,7 @@ Public Class ClsCompProveedores Public Function GetProveedores(tipoConsulta As TipoConsulta, CveProveedor As Integer, Codigo As String, RazonSocial As String, NombreComercial As String, NombreCorto As String, RFC As String, ContactoNombre As String, Telefono As String, Estatus As Integer, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1, Optional CveUsuarioResponsable As Integer = -1, - Optional CveMonedaPreferente As Integer = -1, Optional CveProveedorClasificacion As Integer = -1) As Boolean + Optional CveMonedaPreferente As Integer = -1, Optional CveProveedorClasificacion As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ProveedoresGet") @@ -318,6 +318,7 @@ Public Class ClsCompProveedores .Add("@CveUsuarioResponsable", SqlDbType.Int).Value = CveUsuarioResponsable .Add("@CveProveedorClasificacion", SqlDbType.Int).Value = CveProveedorClasificacion .Add("@CveMonedaPreferente", SqlDbType.Int).Value = CveMonedaPreferente + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 7f1873b42..88fb94258 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -143,7 +143,8 @@ Public Class ClsCompras Return Retorno End Function - Public Function GetCompras(CveEmpresa As Integer, TipoDocto As String, Folio As String, FolioFiscal As String, Codigo As String, Proveedor As String, FechaI As String, FechaF As String, Descripcion As String, Observaciones As String, Optional CveProveedor As Integer = -1) As Boolean + Public Function GetCompras(CveEmpresa As Integer, TipoDocto As String, Folio As String, FolioFiscal As String, Codigo As String, Proveedor As String, FechaI As String, + FechaF As String, Descripcion As String, Observaciones As String, Optional CveProveedor As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasGetBuscar") @@ -160,6 +161,7 @@ Public Class ClsCompras .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 8d0ca08f7..3da032b9a 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1880,7 +1880,8 @@ Public Class ClsContratos #Region " REPORTE BUSQUEDA" Public Function GetContratosBusquedaRep(TipoVenta As Integer, CveContratoTipo As Integer, NumeroContrato As String, DescripcionContrato As String, Ubicacion As String, Responsable As String, - EstatusContrato As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveCliente As Integer, CveProveedor As Integer) As Boolean + EstatusContrato As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveCliente As Integer, CveProveedor As Integer, + Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Con_ContratosBusquedaRepGet") @@ -1898,6 +1899,7 @@ Public Class ClsContratos .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index b9cc28b9d..4e2ca49e7 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -732,7 +732,8 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetMovimientosRep(CveAlmacen As Integer, CveTipoMovimiento As Integer, Folio As Integer, FechaIngI As Date, FechaIngF As Date, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function GetMovimientosRep(CveAlmacen As Integer, CveTipoMovimiento As Integer, Folio As Integer, FechaIngI As Date, FechaIngF As Date, FechaInicio As Date, + FechaFin As Date, CveUsuario As Integer, CveEmpresa As Integer, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_MovimientosRep") @@ -746,6 +747,7 @@ Public Class ClsInventarios .Add("@FechaFin ", SqlDbType.DateTime).Value = FechaFin .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try SqlAdapter.Fill(Data) @@ -1147,12 +1149,6 @@ Public Class ClsInventarios End With Try SqlAdapter.Fill(Data) - - If Data IsNot Nothing AndAlso Data.Rows.Count >= 1 Then - Dim dr As DataRow = Data.Rows(0) - CveSeccion = dr("CveSeccionAlmacen").ToString.ToEntero - End If - Retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) @@ -1824,7 +1820,7 @@ Public Class ClsInventarios Optional FechaMovto As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional Caducidad As Date = MinFecha, Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, - Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ExistenciasGet") @@ -1845,6 +1841,7 @@ Public Class ClsInventarios .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output End With @@ -2904,28 +2901,28 @@ Public Class ClsInventarios Return Retorno End Function - Public Function LoteBatchFechaCaducidadGet(CvePS As Integer, Lote As String, Batch As String, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean - Dim Retorno As Boolean = False + 'Public Function LoteBatchFechaCaducidadGet(CvePS As Integer, Lote As String, Batch As String, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean + ' Dim Retorno As Boolean = False - DataAdapter("PA_Inv_LoteBatchFechaCaducidadGet") + ' DataAdapter("PA_Inv_LoteBatchFechaCaducidadGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@Lote", SqlDbType.VarChar).Value = Lote - .Add("@Batch", SqlDbType.VarChar).Value = Batch - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen - End With + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CvePS", SqlDbType.Int).Value = CvePS + ' .Add("@Lote", SqlDbType.VarChar).Value = Lote + ' .Add("@Batch", SqlDbType.VarChar).Value = Batch + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + ' End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la Fecha Caducidad del Lote-Batch.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener la Fecha Caducidad del Lote-Batch.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function Public Function ActualizarEsDevolucionVenta(CveVenta As Integer, Valor As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("Vta_UpdateDevolucionVenta") @@ -2949,7 +2946,7 @@ Public Class ClsInventarios DataAdapter("Vta_UpdateDevolucionVentaDetalle") With SqlAdapter.SelectCommand.Parameters - .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta + .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle .Add("@Valor", SqlDbType.Int).Value = Valor End With @@ -4752,13 +4749,17 @@ Public Class ClsInventarios #Region "MOVIMIENTOS SALIDA" - Public Function GetRepMovimientosSalida(FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean + Public Function GetRepMovimientosSalida(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveCliente As Integer, CveClasificacion As Integer, Grupo As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_RepMovimientosSalidaGet") With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Grupo", SqlDbType.Int).Value = Grupo End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 586bd8874..54ee9c7b4 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -522,10 +522,28 @@ Public Class ClsNominas Return Retorno End Function + Public Function AutorizaNom_Nominas(CvePersonal As Integer, CvePeriodo As Integer, Optional Autorizado As Boolean = True) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Nom_Nominas_Autoriza") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al autorizar la nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function AddNom_Nominas(FolioNom As Integer, CveNominaTipo As Integer, CvePersonal As Integer, CvePeriodo As Integer, SubTotal As Double, Descuento As Double, RetISR As Double, Total As Double, CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, Fecha As Date, MotivoDescuento As String, Observaciones As String, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, - Fech1 As Date, Fech2 As Date, Fech3 As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Fech1 As Date, Fech2 As Date, Fech3 As Date, CveUsuario As Integer, CveEmpresa As Integer, Optional Autorizado As Boolean = True) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_NominasAdd") @@ -555,6 +573,7 @@ Public Class ClsNominas .Add("@Fech3", SqlDbType.VarChar).Value = IIf(Fech3.ToString = "01/01/0001 12:00:00 a.m.", "-1", Fech3.ToString) .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Autorizado", SqlDbType.Bit).Value = Autorizado .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With 'SqlTypes.SqlDateTime.Null diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index cf460fdab..2aa435c09 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1728,7 +1728,7 @@ Public Class ClsOC Public Function GetOrdenesCompraRep(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveEstatus As Integer, FechaInicio As Date, FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", Optional CveActivoFijo As Integer = -1, - Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1) As Boolean + Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraRep") @@ -1754,6 +1754,7 @@ Public Class ClsOC .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@SoloSubProyectosConPermiso", SqlDbType.Bit).Value = SoloSubProyectosConPermiso .Add("@CveUsuarioAutorizo", SqlDbType.Int).Value = CveUsuarioAutorizo + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 565017490..431ef2037 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -470,7 +470,8 @@ Public Class ClsOS Return Retorno End Function - Public Function GetOrdenesServicios(CveOS As Integer, CveCliente As Integer, Folio As Integer, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean + Public Function GetOrdenesServicios(CveOS As Integer, CveCliente As Integer, Folio As Integer, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, + CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosGet") @@ -482,6 +483,7 @@ Public Class ClsOS .Add("@CveUsuarioRecibio", SqlDbType.Int).Value = CveUsuarioRecibio .Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatusOrdenServicio .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 6c1eaf2e6..a7b7a4a24 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -851,14 +851,7 @@ Public Class ClsPaginas Application("GlobalDTLeyendasFiscales") = value End Set End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTFolios") = value - End Set - End Property + Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(Application("GlobalDTEstatusFactura"), DataTable) @@ -4269,13 +4262,14 @@ Public Class ClsPaginas PaginaDict.Add("/General/CatDiasInhabiles.aspx".ToUpper(), 429) PaginaDict.Add("/General/CatTipoCambio.aspx".ToUpper(), 642) PaginaDict.Add("/General/PopUpPaqueteriasGuias.aspx".ToUpper(), 659) + PaginaDict.Add("/General/PopUpPaqueteriasGuiasInternas.aspx".ToUpper(), 659) PaginaDict.Add("/General/CatPaqueterias.aspx".ToUpper(), 665) PaginaDict.Add("/General/CatDocumentacionTipo.aspx".ToUpper(), -1) PaginaDict.Add("/General/CatModelos.aspx".ToUpper(), 710) PaginaDict.Add("/General/CatRinTamanios.aspx".ToUpper(), 711) PaginaDict.Add("/General/CatMedidas.aspx".ToUpper(), 712) PaginaDict.Add("/General/CatSatListado69B.aspx".ToUpper, 1038) - PaginaDict.Add("/General/PopUpPaqueteriasGuiasInternas.aspx".ToUpper(), 727) + #End Region #Region "GPS" @@ -5051,8 +5045,8 @@ Public Class ClsPaginas Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object) 'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks) - 'Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache - Session.Add(VSKey, pviewState) 'Store the ViewState on Cache + Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache + 'Session.Add(VSKey, pviewState) 'Store the ViewState on Cache ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", VSKey) End Sub @@ -5062,11 +5056,11 @@ Public Class ClsPaginas If Not VSKey.StartsWith("VIEWSTATE_") Then 'Request the Key from the page and validade it. Throw New Exception(String.Format("Invalid VIEWSTATE Key: {0}", VSKey)) End If - If Session(VSKey) Is Nothing Then 'si por algún motivo, el caché expiró, le dice a la página que se recargue y obtenga los datos de nuevo, y así evitar errores al obtener el viewstate vacío + If Cache(VSKey) Is Nothing Then 'si por algún motivo, el caché expiró, le dice a la página que se recargue y obtenga los datos de nuevo, y así evitar errores al obtener el viewstate vacío Response.Redirect(Request.RawUrl) Return Nothing Else - Return Session(VSKey) + Return Cache(VSKey) End If End Function @@ -5274,6 +5268,8 @@ Public Class ClsPaginas params.Add(param) Next Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + wsreport = Nothing + params = Nothing Else If IsNothing(MR) Then MR = New ReportViewer Try @@ -5346,6 +5342,7 @@ Public Class ClsPaginas End If sw.Stop() + If sw.Elapsed.TotalSeconds > 5 Then GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") End If @@ -5598,7 +5595,7 @@ Public Class ClsPaginas HttpContext.Current.Response.SuppressContent = True HttpContext.Current.ApplicationInstance.CompleteRequest() HttpContext.Current.Response.End() - + bytes = Nothing Catch ex As Exception If UsuarioActual.CveRol = 1 Then @@ -7253,6 +7250,20 @@ Public Class ClsPaginas params.Add(New ReportParameter("Comprador", ObjOC.UsuarioAsignado)) End If + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then + Dim ObjCuentasBancos As New ClsGenerales() + If ObjCuentasBancos.GetCuentasDepositos(ObjOC.CveProveedor) Then + Dim CuentasActivas As DataTable = ObjCuentasBancos.DtResultados.FiltraParametros("EstatusTexto = 'Activo'") + Dim CuentasStr As New StringBuilder("") + For Each CuentasBancarios As DataRow In CuentasActivas.Rows + Dim CuentaClabe As String = If(CuentasBancarios.Item("BancoNombre").ToString.Contains("BBVA") Or CuentasBancarios.Item("BancoNombre").ToString.Contains("BANCOMER"), CuentasBancarios.Item("Cuenta").ToString, CuentasBancarios.Item("CLABE").ToString) + Dim infoCuenta As String = String.Format("
{0} {1}: {2}", CuentasBancarios.Item("BancoNombre").ToString, CuentasBancarios.Item("Abreviatura").ToString, CuentaClabe) + CuentasStr.AppendFormat(infoCuenta) + Next + params.Add(New ReportParameter("Cuentas", CuentasStr.ToString)) + End If + ObjCuentasBancos.Dispose() + End If 'params.Add(New ReportParameter("FechaOC", ObjOC.Fecha.ToShortDateString)) Dim RutaFisicaSol As String = String.Format("Empresas\{0}\Firmas\{1}.png", EmpresaActual.CveEmpresa, CveUsuarioSol) Dim RutaVirtuaSol As String = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={0}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(RutaFisicaSol)) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 02e26a446..055d4bf36 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -204,9 +204,12 @@ Public Class ClsProductosServicios CveConexion = 0 End If - End Sub + End Sub #End Region - Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1", Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1, Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1") As Boolean + Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1", + Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1, + Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1", Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ProductosServiciosGet") @@ -227,6 +230,7 @@ Public Class ClsProductosServicios .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto .Add("@SATClavePS", SqlDbType.VarChar).Value = SATClavePS + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try @@ -1838,9 +1842,47 @@ Public Class ClsProductosServicios End Try Return Retorno - End Function -#End Region + End Function + Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, + CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, + Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1", + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ProductosExistenciasWSGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista + .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing) + .Add("@Serie", SqlDbType.VarChar).Value = Serie + .Add("@Lote", SqlDbType.VarChar).Value = Lote + .Add("@Batch", SqlDbType.VarChar).Value = Batch + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado + .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir + .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + #Region "Porcentaje Productos" Public Function GetPorcentajeProductos(CveCliente As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 358cc7495..998375e3e 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1546,10 +1546,11 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Public Function GetPersonal2(CvePersonal As Integer, Codigo As String, Nombre As String, NSS As String, RFC As String, CveTurno As Integer, CvePuesto As Integer, - CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, - CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer, - CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, - FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer, CveEmpresa As Integer) As Boolean + CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer, + CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer, + CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer, + FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer, + CveEmpresa As Integer, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_RH_Personal2Get") @@ -1584,6 +1585,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo .Add("@SqlStr ", SqlDbType.VarChar).Value = SqlStr .Add("@NCaracteristicas", SqlDbType.Int).Value = NCaracteristicas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try @@ -2298,10 +2300,36 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno - End Function + End Function + + Public Function AddAsistenciaMasiva2(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + Data = New DataTable + SqlDataAdapter("PA_RH_PersonalAsistenciasMasivaAddUpd2") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya se registró la Asistencia para el empleado.", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function #End Region - + #Region "Asistencias Detalles" Public Function GetAsistenciasDetalle() As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index 79b05c132..b63c12e88 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -209,24 +209,25 @@ Public Class ClsSisNotificaciones #Region "C O R R E O" Private Sub EnviarCorreos(DTNotificacionesCorreo As DataTable) - For Each notificacion As DataRow In DTNotificacionesCorreo.Rows - MandaMail(notificacion("CveNotificacionBitacora").ToString.ToEntero, notificacion("Encabezado").ToString, notificacion("Cuerpo").ToString, notificacion("Correo").ToString, "") + For Each notificacion As DataRow In DTNotificacionesCorreo.Rows + Dim Hilo As New System.Threading.Thread(Sub() MandaMail(notificacion("CveNotificacionBitacora").ToString.ToEntero, notificacion("Encabezado").ToString, notificacion("Cuerpo").ToString, notificacion("Correo").ToString, "")) + Hilo.Start() Next End Sub Private Sub MandaMail(CveNotificacionBitacora As Integer, Asunto As String, Cuerpo As String, Mail As String, MailCC As String) Dim ObjMail As New ClsSisMail() - + Dim ObjNotificacion As New ClsSisNotificaciones Try Dim ResultadoMail As Integer = 0 Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Mail, Asunto, Cuerpo, MailCC, LSRutasMail) Then - UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1) + ObjNotificacion.UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1) End If - Catch ex As Exception OnError("Ocurrió error al mandar el Mail", ex) End Try + ObjNotificacion.Dispose() End Sub #End Region @@ -1328,10 +1329,6 @@ Public Class ClsSisNotificaciones Next End If - If DTNotificacionesCorreo IsNot Nothing AndAlso DTNotificacionesCorreo.Rows.Count > 0 Then - EnviarCorreos(DTNotificacionesCorreo) - End If - If DTNotificacionesApp IsNot Nothing AndAlso DTNotificacionesApp.Rows.Count > 0 Then Dim DtTokens As DataTable = Nothing @@ -1389,6 +1386,10 @@ Public Class ClsSisNotificaciones DtTokens.Dispose() End If End If + End If + + If DTNotificacionesCorreo IsNot Nothing AndAlso DTNotificacionesCorreo.Rows.Count > 0 Then + EnviarCorreos(DTNotificacionesCorreo) End If If Not DTNotificacionesApp Is Nothing Then DTNotificacionesApp.Dispose() diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 109597599..f78d1e3bf 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -204,7 +204,7 @@ Public Class ClsVentas Public Function GetVentas(CveEmpresa As Integer, TipoDocto As String, Serie As String, Folio As Integer, Codigo As String, CveCliente As Integer, CveSubProyecto As Integer, CveEstatus As Integer, CveUsuario As Integer, FechaI As String, FechaF As String, FolioFiscal As String, Optional CveClienteSucursal As Integer = -1, Optional CvePS As Integer = -1, Optional PedidoContrato As String = "-1", Optional OrdenCompra As String = "-1", Optional CveUsuarioConsulta As Integer = -1, Optional ClienteRFC As String = "-1", - Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1) As Boolean + Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetBuscar") @@ -229,6 +229,7 @@ Public Class ClsVentas .Add("@ClienteRFC", SqlDbType.VarChar).Value = ClienteRFC .Add("@CveEmpresaCRM", SqlDbType.Int).Value = CveEmpresaCRM .Add("@CveAcercamientoCRM", SqlDbType.Int).Value = CveAcercamientoCRM + .Add("@TopSelect", SqlDbType.Int).Value = TopSelect End With Try @@ -339,7 +340,8 @@ Public Class ClsVentas Optional ObservacionesAlmacen As String = "", Optional CveSubProyecto As Integer = -1, Optional CveSubProyectoEjecucion As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1, Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, - Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0) As Boolean + Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, + Optional CorreoNotificacion As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -428,6 +430,7 @@ Public Class ClsVentas .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje .Add("@EsAmortizacion", SqlDbType.Bit).Value = EsAmortizacion .Add("@CveTipoRetencion", SqlDbType.TinyInt).Value = CveTipoRetencion + .Add("@CorreoNotificacion", SqlDbType.VarChar).Value = CorreoNotificacion .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 4fae8a392..07f8fecbf 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6684,14 +6684,6 @@ Namespace Modelos HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value End Set End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(HttpContext.Current.Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFolios") = value - End Set - End Property Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) diff --git a/App_Code/MyHub.vb b/App_Code/MyHub.vb index 133da54e7..6a34d2eb9 100644 --- a/App_Code/MyHub.vb +++ b/App_Code/MyHub.vb @@ -69,13 +69,4 @@ Public Class MyHub Public Sub send(name As String, mensaje As String) Clients.All.broadcastMessage(name, mensaje) End Sub -End Class -Public Class MyhubUserIdProvider - Implements IUserIdProvider - - - Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId - Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name) - Return userId.ToString() - End Function End Class \ No newline at end of file diff --git a/App_Code/Notificaciones.vb b/App_Code/Notificaciones.vb index 8efed087d..6c5d7902a 100644 --- a/App_Code/Notificaciones.vb +++ b/App_Code/Notificaciones.vb @@ -44,3 +44,12 @@ Public Class Notificaciones ' Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds) 'End Sub End Class +Public Class MyhubUserIdProvider + Implements IUserIdProvider + + + Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId + Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name) + Return userId.ToString() + End Function +End Class diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 1b799cb7d..0c2141fd0 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -192,10 +192,10 @@ Namespace Extensiones Public Sub GuardaLogAD(Mensaje As String, Optional Archivo As String = "Log") Dim ArchivoW As StreamWriter - Dim MensajeFormato = $"{Chr(13)}{Chr(10)}Log: {Mensaje} | Fecha:{Now.ToString("dd/MM/yyyy HH:mm")}" + Dim MensajeFormato = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, Now.ToString("dd/MM/yyyy HH:mm")) Try - ArchivoW = New StreamWriter($"{AppDomain.CurrentDomain.BaseDirectory}\Log\{Archivo}.txt", True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\{1}.txt", AppDomain.CurrentDomain.BaseDirectory, Archivo), True, System.Text.Encoding.UTF8) Catch ex As UnauthorizedAccessException 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) Exit Sub @@ -544,6 +544,8 @@ Namespace Extensiones Alert("", String.Format("{0} code[FilesMove]", ex.Message), TipoMensaje.MsgAdvertencia) retorno = False End Try + directorioOld.Clear() + directorioNew.Clear() Return retorno End Function @@ -2044,6 +2046,8 @@ Namespace Extensiones HttpContext.Current.Response.Write(style.ToString) HttpContext.Current.Response.Write(sb.ToString()) HttpContext.Current.Response.End() + sb.Clear() + style.Clear() End If End Sub @@ -2076,6 +2080,8 @@ Namespace Extensiones HttpContext.Current.Response.Write(style.ToString) HttpContext.Current.Response.Write(sb.ToString()) HttpContext.Current.Response.End() + sb.Clear() + style.Clear() End Sub Public Sub ExportToExcel(datatable As DataTable, NombreArchivoXLSX As String) @@ -2284,6 +2290,7 @@ Namespace Extensiones HttpContext.Current.Response.Write(style.ToString) HttpContext.Current.Response.Write(pdfDoc) HttpContext.Current.Response.[End]() + style.Clear() End Using End Using End Sub diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index fa0c9409b..c1e46ead0 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -1,5 +1,5 @@ -<%@ WebHandler Language="VB" Class="SIGFacturacion" %> - +<%@ WebHandler Language="VB" Class="SIGFacturacion" %> + Imports System Imports System.Web Imports System.Net.Http @@ -212,8 +212,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState json.Add(New JProperty("Almacen", ObsInv.ToString())) Return json - End Function - + End Function + #Region "V A L I D A - D A T O S" Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario Dim UsuarioActual As Usuario = Nothing @@ -247,8 +247,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState UsuarioActual.Empresa = ObjEmpresa.Empresa End If ObjEmpresa.Dispose() - End Sub - + End Sub + #End Region #Region "D E F I N I R - O B J E T O S" Private Function CreaFactura(Resp As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DTRemisionesPS As DataTable, CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer, DatosRemisiones As JObject, FechaI As DateTime, FechaF As DateTime) As Modelos.Factura @@ -750,7 +750,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState 'RECARGAR GV Return Row - End Function + End Function #End Region #Region "E N V I O - C O R R E O" Private Sub EnviarCorreo(Objfactura As Modelos.Factura, UsuarioActual As Usuario) @@ -894,9 +894,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState End If End Try End If - End Sub + End Sub #End Region - + Public Sub GuardaLogFacturacion(Str As String) Dim ArchivoW As StreamWriter Dim strLineaTMP As String @@ -919,8 +919,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ArchivoW.Close() ArchivoW.Dispose() - End Sub - + End Sub + #Region "G L O B A L - D T" Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double Get @@ -1105,10 +1105,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTPSATPS") = value End Set - End Property - + End Property + #Region "GLOBALES DE SAT COMERCIO EXTERIOR" - + Property GlobalDTClavePedimento() As DataTable Get GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application("GlobalDTClavePedimento"), DataTable) @@ -1218,10 +1218,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTColonia") = value End Set - End Property - + End Property + #End Region - + Property GlobalDTPSATUM() As DataTable Get GlobalDTPSATUM = DirectCast(HttpContext.Current.Application("GlobalDTPSATUM"), DataTable) @@ -1605,15 +1605,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTLeyendasFiscales") = value End Set - End Property - Property GlobalDTFolios() As DataTable - Get - GlobalDTFolios = DirectCast(HttpContext.Current.Application("GlobalDTFolios"), DataTable) - End Get - Set(value As DataTable) - HttpContext.Current.Application("GlobalDTFolios") = value - End Set - End Property + End Property + Property GlobalDTEstatusFactura() As DataTable Get GlobalDTEstatusFactura = DirectCast(HttpContext.Current.Application("GlobalDTEstatusFactura"), DataTable) @@ -2354,9 +2347,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTVtaCobranzaEstatus") = value End Set - End Property - - + End Property + + #Region "***********************************************************************DT EVENTOS****************************************************************************************" Property GlobalDTTiposEventos() As DataTable Get @@ -2392,9 +2385,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOIEstatusEventos") = value End Set - End Property + End Property #End Region - + #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable Get @@ -2435,9 +2428,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosCaracteristicasOpciones") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************" Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable Get @@ -2530,10 +2523,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoActivoFijo") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT GENERALES**************************************************************************************" Property GlobalDTGralPaises() As DataTable Get @@ -2621,10 +2614,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTGralColectivas") = value End Set - End Property - + End Property + #End Region - + #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get @@ -2833,8 +2826,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosTipos") = value End Set - End Property - + End Property + #Region " DT PROSPECTOS SOLICITUDES" Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable Get @@ -2901,15 +2894,15 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTProspectosSolicitudesApoyos") = value End Set - End Property - + End Property + #End Region #End Region - + #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" - + #Region "***********************************************************************DT AMORTIZACIÓN CONTABLE*********************************************************************************************" - + Property GlobalDTAC_RubrosIngreso() As DataTable Get GlobalDTAC_RubrosIngreso = DirectCast(HttpContext.Current.Application("GlobalDTAC_RubrosIngreso"), DataTable) @@ -3165,11 +3158,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_MatrizEgresos") = value End Set - End Property - - + End Property + + #End Region - + Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3248,9 +3241,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTAC_PD_Metas") = value End Set - End Property + End Property #End Region - + #Region "***********************************************************************GLOBAL DT ORDENES DE COMPRA***********************************************************************" Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable Get @@ -3287,11 +3280,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTOCEstatusUsuarios") = value End Set - End Property - - + End Property + + #End Region - + #Region "F I N A N Z A S " Property GlobalDTFinan_RazonesFinancieras() As DataTable Get @@ -3300,10 +3293,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTFinan_RazonesFinancieras") = value End Set - End Property + End Property #End Region - - + + #Region "***********************************************************************GLOBAL DT CONTABILIDAD****************************************************************************" Property GlobalDTContaPlantillasPolizas(CveEmpresa As Integer, Optional TipoPlantilla As Integer = -1) As DataTable Get @@ -3357,9 +3350,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTContaConceptosContables") = value End Set - End Property + End Property #End Region - + #Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************" Property GlobalDTAsistenciaDetalle() As DataTable Get @@ -3511,13 +3504,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTipoBuzon") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - C O M B U S T I B L E S ***********" - - - + + + Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3556,11 +3549,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(ByVal value As DataTable) HttpContext.Current.Application("GlobalDTCombustiblesTipos") = value End Set - End Property + End Property #End Region - + #Region "*********** D T - M A N T E N I M I E N T O S ***********" - + Property GlobalDTMantenimientosTipos() As DataTable Get GlobalDTMantenimientosTipos = DirectCast(HttpContext.Current.Application("GlobalDTMantenimientosTipos"), DataTable) @@ -3599,13 +3592,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState HttpContext.Current.Application("GlobalDTMantenimientosTipos") = value End Set - End Property - + End Property + #End Region - - + + #Region "*********** D T - T A L L E R E S ***********" - + Property GlobalDTTalleresTipos() As DataTable Get GlobalDTTalleresTipos = DirectCast(HttpContext.Current.Application("GlobalDTTalleresTipos"), DataTable) @@ -3622,12 +3615,12 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTTalleres") = value End Set - End Property - + End Property + #End Region - + #Region "*********** D T - D I S T R I B U I D O R E S ***********" - + Property GlobalDTDistribuidoresTipos() As DataTable Get GlobalDTDistribuidoresTipos = DirectCast(HttpContext.Current.Application("GlobalDTDistribuidoresTipos"), DataTable) @@ -3644,11 +3637,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTDistribuidores") = value End Set - End Property - + End Property + #End Region - - + + Property GlobalDTOIRevision(CveEmpresa As Integer) As DataTable Get If CveEmpresa <> -1 Then @@ -3739,8 +3732,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Set(value As DataTable) HttpContext.Current.Application("GlobalDTPaqueterias") = value End Set - End Property - + End Property + #End Region - + End Class \ No newline at end of file diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 832d3c44e..17e401ead 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -43,7 +43,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState ActualizaPrePoliza(context) Case "getpersonal" getpersonal(context) - + Case "GettingCURP" + context.Response.Write(GettingCURP(context.Request("Curp").ToString(), context.Request("year").ToString().ToEntero())) + Case "ValidaCURP" + context.Response.Write(ValidaCURP(context.Request("Curp").ToString())) End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -181,6 +184,225 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End Sub #End Region + + Private Shared Function sendURL(ByVal URL As String, Optional Methodo As String = "POST", Optional Cookie As String = "", Optional maxTimeMilliseconds As Integer = 120000) As String + Dim resultado As String = "" + + Try + Dim request As Net.HttpWebRequest = CType(Net.HttpWebRequest.Create(URL), Net.HttpWebRequest) + request.Timeout = maxTimeMilliseconds + request.Method = Methodo + request.ContentType = "text/html; charset=utf-8" '"text/xml; charset=utf-8" + + If Not String.IsNullOrEmpty(Cookie) Then + request.Headers.Add("Cookie", Cookie) + End If + + 'Using stream As IO.Stream = request.GetRequestStream() + + ' Using stmw As IO.StreamWriter = New IO.StreamWriter(stream) + ' stmw.Write("") + ' End Using + 'End Using + + Dim response As Net.WebResponse = CType(request.GetResponse(), Net.WebResponse) + Dim sr As IO.StreamReader = New IO.StreamReader(response.GetResponseStream()) + resultado = sr.ReadToEnd() + sr.Close() + Catch ex As Exception + ex.ToString().GuardaLog() + 'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}") + End Try + + Return resultado + End Function + + Public Shared Function GettingCURP(ByVal Curp As String, year As Integer) As String + Dim abc As String() = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} + Dim numeric01 As String() = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} + Dim rule1 As String() = If(year < 2000, numeric01, abc) + Dim curpresult As String = "" + Dim i As Integer = 0 + While curpresult.Length = 0 AndAlso i < rule1.Length + Dim z As Integer = 0 + While curpresult.Length = 0 AndAlso z < numeric01.Length + curpresult = String.Format("{0}{1}{2}", Curp, rule1(i), numeric01(z)) + Dim respuesta As String = sendURL(String.Format("http://www.renapo.sep.gob.mx/wsrenapo/MainControllerParam?curp={0}", curpresult), "GET") + + Dim trlines As New List(Of String) + Dim keydict As New System.Collections.Concurrent.ConcurrentDictionary(Of String, String) + + Dim indexttr As Integer = 0 + Dim indexttrB As Integer = 0 + Dim indexttd As Integer = 0 + Dim indextdiv As Integer = 0 + Dim indexinittext As Integer = 0 + While Not IsNothing(respuesta) AndAlso respuesta.Length > 0 + indexttr = respuesta.IndexOf("= 0 Then + indexttrB = respuesta.Substring(indexttr + 3).IndexOf("= 0 Then + trlines.Add(respuesta.Substring(indexttr, indexttrB)) + Else + trlines.Add(respuesta.Substring(indexttr)) + + End If + respuesta = respuesta.Substring(indexttr + 3) + Else + respuesta = "" + End If + + End While + + Dim key As String = "" + Dim keyvalue As String = "" + For Each item As String In trlines + key = "" + keyvalue = "" + indexttd = item.IndexOf("= 0 Then + indexttr = indextdiv + indexttrB = item.IndexOf("= 0 Then + indexinittext = item.Substring(indexttr + 3).IndexOf(">") + key = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4))) + + item = item.Substring(indexttrB + 3) + Else + item = "" + End If + + If item.Length > 0 Then + + indexttd = item.IndexOf("= 0 Then + indexttr = indextdiv + indexttrB = item.IndexOf("= 0 Then + indexinittext = item.Substring(indexttr + 3).IndexOf(">") + keyvalue = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4))) + + item = item.Substring(indexttr + 3) + Else + item = "" + End If + + End If + If key.Length > 0 Then + keydict.TryAdd(key.Replace(":", "").Trim(), keyvalue.Trim().ToLower()) + End If + Next + Dim Apellido1 As String = "" : keydict.TryGetValue("Apellido1", Apellido1) + Dim Apellido2 As String = "" : keydict.TryGetValue("Apellido1", Apellido1) + Dim Nombres As String = "" : keydict.TryGetValue("Nombres", Nombres) + If Nombres Is Nothing OrElse Nombres.Length = 0 Then + curpresult = "" + End If + System.Threading.Thread.Sleep(100) + z = z + 1 + End While + i = i + 1 + End While + Return curpresult + End Function + + + Public Shared Function ValidaCURP(ByVal Curp As String) As String + + Dim respuesta As String = sendURL(String.Format("http://www.renapo.sep.gob.mx/wsrenapo/MainControllerParam?curp={0}", Curp), "GET") + + Dim trlines As New List(Of String) + Dim keydict As New System.Collections.Concurrent.ConcurrentDictionary(Of String, String) + + Dim indexttr As Integer = 0 + Dim indexttrB As Integer = 0 + Dim indexttd As Integer = 0 + Dim indextdiv As Integer = 0 + Dim indexinittext As Integer = 0 + While Not IsNothing(respuesta) AndAlso respuesta.Length > 0 + indexttr = respuesta.IndexOf("= 0 Then + indexttrB = respuesta.Substring(indexttr + 3).IndexOf("= 0 Then + trlines.Add(respuesta.Substring(indexttr, indexttrB)) + Else + trlines.Add(respuesta.Substring(indexttr)) + + End If + respuesta = respuesta.Substring(indexttr + 3) + Else + respuesta = "" + End If + + End While + + Dim key As String = "" + Dim keyvalue As String = "" + For Each item As String In trlines + key = "" + keyvalue = "" + indexttd = item.IndexOf("= 0 Then + indexttr = indextdiv + indexttrB = item.IndexOf("= 0 Then + indexinittext = item.Substring(indexttr + 3).IndexOf(">") + key = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4))) + + item = item.Substring(indexttrB + 3) + Else + item = "" + End If + + If item.Length > 0 Then + + indexttd = item.IndexOf("= 0 Then + indexttr = indextdiv + indexttrB = item.IndexOf("= 0 Then + indexinittext = item.Substring(indexttr + 3).IndexOf(">") + keyvalue = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4))) + + item = item.Substring(indexttr + 3) + Else + item = "" + End If + + End If + If key.Length > 0 Then + keydict.TryAdd(key.Replace(":", "").Trim(), keyvalue.Trim().ToLower()) + End If + Next + Dim Apellido1 As String = "" : keydict.TryGetValue("Apellido1", Apellido1) + Dim Apellido2 As String = "" : keydict.TryGetValue("Apellido1", Apellido1) + Dim Nombres As String = "" : keydict.TryGetValue("Nombres", Nombres) + If Nombres Is Nothing OrElse Nombres.Length = 0 Then + Curp = "" + End If + + Return Curp + End Function #Region "Get Cliente" Private Function GetClientes(ByVal context As HttpContext) As String Dim retorno As String = "" diff --git a/Bancos/CargarConciliacionesBancarias.aspx.vb b/Bancos/CargarConciliacionesBancarias.aspx.vb index 662e7ca6c..27ab10ceb 100644 --- a/Bancos/CargarConciliacionesBancarias.aspx.vb +++ b/Bancos/CargarConciliacionesBancarias.aspx.vb @@ -77,7 +77,7 @@ Partial Class Bancos_CargarConciliacionesBancarias Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargaExcel(Directorio, file.filename, Tipo) Else diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index 6e71943d2..9175d0e91 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -644,9 +644,12 @@ Partial Class Bancos_ConciliacionesBancariasaspx ObjConta.Dispose() End If + Dim Filtros As String = String.Format("Cuenta: {0} Conciliado: {1} Fecha Inicial: {2} Fecha Final: {3}", DdlCuenta.SelectedItem.Text, DdlConciliado.SelectedItem.Text, txtFechaI.Text, txtFechaF.Text) + params.Add(New ReportParameter("SaldoFinalContabilidad", (SaldoFinalContabilidad.FormatoNumero))) params.Add(New ReportParameter("SaldoFinalContabilidadComplementaria", (SaldoFinalContabilidadComplementaria.FormatoNumero))) params.Add(New ReportParameter("Diferencia", (SaldoFinalLibros - SaldoFinalContabilidad).FormatoNumero)) + params.Add(New ReportParameter("Filtros", Filtros)) If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index c877371bc..25ce1b6b2 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -941,7 +941,8 @@ Partial Class Bancos_IE HplListaProveedores.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={StrEncript}" Else - HplListaProveedores.NavigateUrl = String.Format("/Bancos/Reportes.aspx?Opcion=ImprimeMov&CveIE={0}", ObjIE.CveIE) + Dim StrEncript As String = Encripta($"OP=ImprimeMov&CveIE={ObjIE.CveIE}") + HplListaProveedores.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", StrEncript) End If If CveIEDeposito2 > 0 Then divDepositado.Visible = True @@ -2492,7 +2493,7 @@ Partial Class Bancos_IE 'GUARDA COMPROBANTE If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa)) End If 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs diff --git a/Bancos/PopUpBuscarIE.aspx.vb b/Bancos/PopUpBuscarIE.aspx.vb index 494a38e23..d46b4d027 100644 --- a/Bancos/PopUpBuscarIE.aspx.vb +++ b/Bancos/PopUpBuscarIE.aspx.vb @@ -67,23 +67,29 @@ Partial Class Bancos_PopUpBuscarIE Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjBancosIE As New ClsBancos Dim Folio As String = "-1" If TxtFolio.Text <> "" Then Folio = String.Format("%{0}%", TxtFolio.Text.Trim) - If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then - DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados) + If ValidarFiltrosSeleccionado() Then + + Dim ObjBancosIE As New ClsBancos + If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, + MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa, TopSelect:=100) Then + DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados) + Else + Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError) + DtDatos = Nothing + End If + + ObjBancosIE.Dispose() + + If DtDatos IsNot Nothing Then + GvDatos.DataSource = DtDatos + GvDatos.DataBind() + UpDatos.Update() + End If Else - Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError) - DtDatos = Nothing - End If - - ObjBancosIE.Dispose() - - If DtDatos IsNot Nothing Then - GvDatos.DataSource = DtDatos - GvDatos.DataBind() - UpDatos.Update() + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If End Sub @@ -103,4 +109,11 @@ Partial Class Bancos_PopUpBuscarIE End If End Sub + Private Function ValidarFiltrosSeleccionado() As Boolean + If DdlBanco.SelectedValue.ToEntero > 0 Then Return True + If DdlCuenta.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Length > 0 Then Return True + Return False + End Function + End Class diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 1cc586d2c..67a28c29a 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -2292,7 +2292,7 @@ Partial Class Bancos_ProveedoresAbonar 'If Archivo.Exists Then Msg.AppendFormat("
  • Imprimir movimiento
  • ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE))) 'End If - Msg.AppendFormat("
  • Listado
  • ", CveIE) + Msg.AppendFormat("
  • Listado
  • ", Encripta(String.Format("Opcion=ImprimeMov&CveIE={0}", CveIE))) If IDPoliza > 0 Then Msg.AppendFormat("
  • Póliza
  • ", IDPoliza) Dim Mensaje As String = String.Format("
    El Documento se generó correctamente.


    Descargas:
      {0}
    ", Msg.ToString) diff --git a/CGame/PopUpBuscarEmpaque.aspx.cs b/CGame/PopUpBuscarEmpaque.aspx.cs index 72d8e2765..e6e304158 100644 --- a/CGame/PopUpBuscarEmpaque.aspx.cs +++ b/CGame/PopUpBuscarEmpaque.aspx.cs @@ -26,27 +26,32 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas } protected void Consultar_Click(object sender, EventArgs e) { - String Folio; - if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; } - ClsCGame ObjCGame = new ClsCGame(); - if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate())) + if (ValidarFiltrosSeleccionados()) { - GvDatos.DataSource = ObjCGame.DtResultados; - GvDatos.DataBind(); - LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString(); - if (ObjCGame.DtResultados.Rows.Count < 1) + String Folio; + if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; } + ClsCGame ObjCGame = new ClsCGame(); + if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate(),TopSelect:100)) { - Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia); - } - else - { - TblBusqueda.Visible = true; + GvDatos.DataSource = ObjCGame.DtResultados; + GvDatos.DataBind(); + LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString(); + if (ObjCGame.DtResultados.Rows.Count < 1) + { + Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia); + } + else + { + TblBusqueda.Visible = true; + } } + ObjCGame.Dispose(); + UPDatos.Update(); + }else + { + Alert("Seleccione un criterio de busqueda",TipoMensaje.MsgAdvertencia); } - ObjCGame.Dispose(); - UPDatos.Update(); - } #region GridView @@ -60,4 +65,12 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas } #endregion + private bool ValidarFiltrosSeleccionados() + { + if(TxtFolio.Text.Length > 0) return true; + if(DdlHuerta.SelectedValue.ToEntero() > 0) return true; + if(TxtFechaEntregaI.Text.Length > 0) return true; + if(TxtFechaEntregaF.Text.Length > 0) return true; + return false; + } } \ No newline at end of file diff --git a/CGame/PopUpBuscarOrdenProduccion.aspx.vb b/CGame/PopUpBuscarOrdenProduccion.aspx.vb index 484e1a0fa..ce1cd631e 100644 --- a/CGame/PopUpBuscarOrdenProduccion.aspx.vb +++ b/CGame/PopUpBuscarOrdenProduccion.aspx.vb @@ -37,19 +37,24 @@ Partial Class CGame_PopUpBuscarOrdenProduccion Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click Dim Folio As String If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1" - Dim ObjOP As New ClsCGame - If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then - GvOP.DataSource = ObjOP.DtResultados - GvOP.DataBind() - LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString - If Not ObjOP.DtResultados.Rows.Count > 0 Then - Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia) - Else - TblBusqueda.Visible = True + If ValidarFiltrosSeleccionado() Then + Dim ObjOP As New ClsCGame + If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, + DdlCliente.SelectedValue.ToEntero, TopSelect:=100) Then + GvOP.DataSource = ObjOP.DtResultados + GvOP.DataBind() + LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString + If Not ObjOP.DtResultados.Rows.Count > 0 Then + Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia) + Else + TblBusqueda.Visible = True + End If End If + ObjOP.Dispose() + UPDatos.Update() + Else + Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia) End If - ObjOP.Dispose() - UPDatos.Update() End Sub Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound @@ -57,4 +62,13 @@ Partial Class CGame_PopUpBuscarOrdenProduccion e.Row.FCLabel("LblFolio").Text = String.Format("
    {0}{1}
    ", "", e.Row.DBCampo("Folio")) End If End Sub + + Private Function ValidarFiltrosSeleccionado() As Boolean + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Length > 0 Then Return True + If TxtFechaEntregaI.Text.Length > 0 Then Return True + If TxtFechaEntregaF.Text.Length > 0 Then Return True + If DdlCliente.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class diff --git a/CRM/PopUpBuscarAcercamiento.aspx.cs b/CRM/PopUpBuscarAcercamiento.aspx.cs index 982fd1a6c..ecb41ae96 100644 --- a/CRM/PopUpBuscarAcercamiento.aspx.cs +++ b/CRM/PopUpBuscarAcercamiento.aspx.cs @@ -164,21 +164,42 @@ public partial class CRM_PopUpBuscarAcercamiento : ClsPaginas string FechaCierre = TxtFechaCierre.Text == "" ? "-1" : TxtFechaCierre.Text; string NombreAcercamiento = TxtAcercamiento.Text == "" ? "-1" : TxtAcercamiento.Text; - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidad, FechaApertura, FechaCierre)) + if (ValidarFiltrosSeleccionados()) { - GVDatos.DataSource = ObjCRM.DtResultados; - GVDatos.DataBind(); + ClsCRM ObjCRM = new ClsCRM(); + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, CveTipoProceso, CveVendedor, "-1", "-1", NombreAcercamiento, CveMedioCaptacion, CveRechazoMotivo, + CveProbabilidad, FechaApertura, FechaCierre, TopSelect:100)) + { + GVDatos.DataSource = ObjCRM.DtResultados; + GVDatos.DataBind(); - LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString(); - if (ObjCRM.DtResultados.Rows.Count > 0) - DivBusqueda.Visible = true; - else - DivBusqueda.Visible = false; + LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString(); + if (ObjCRM.DtResultados.Rows.Count > 0) + DivBusqueda.Visible = true; + else + DivBusqueda.Visible = false; + } + + ObjCRM.Dispose(); + UPDatos.Update(); + }else + { + Alert("Seleccione un criterio de busqueda",ModExtensiones.TipoMensaje.MsgAdvertencia); } + } - ObjCRM.Dispose(); - UPDatos.Update(); + private bool ValidarFiltrosSeleccionados() + { + if (DdlTipoProceso.SelectedValue.ToEntero() > 0) return true; + if (DdlEmpresaCRM.SelectedValue.ToEntero() > 0) return true; + if (DdlVendedor.SelectedValue.ToEntero() > 0) return true; + if (DdlMedioCaptacion.SelectedValue.ToEntero() > 0) return true; + if (DdlRechazoMotivo.SelectedValue.ToEntero() > 0) return true; + if (DdlProbabilidad.SelectedValue.ToEntero() > 0) return true; + if (TxtFechaApertura.Text != "") return true; + if (TxtFechaCierre.Text != "") return true; + if (TxtAcercamiento.Text != "") return true; + return false; } #endregion } \ No newline at end of file diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 7c5b5214e..ecbbb6b28 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -2364,10 +2364,8 @@ - @@ -281,6 +287,8 @@   + + Sucursal: @@ -810,6 +818,96 @@ +
    Rembolso: - - - + Reembolso: + Personal/Empleado Caja Chica @@ -2554,10 +2552,11 @@ - +

    +

    @@ -3920,8 +3919,8 @@
    - - + <%-- + --%>
    diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index be19367d4..9d0ee04ad 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6596,7 +6596,7 @@ Partial Class Compras_Compras Next 'calcula la diferencia entre lo recibido por la OC, considerando costos indirectos y lo que se ingresaria en la compra - SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * 1).RoundSQL 'sumatoria de la factura + SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * TCO).RoundSQL 'sumatoria de la factura If SumatoriaOCINV.RoundSQL <> 0 Then ' se abona el costo, cambiamos su naturaleza 'SumatoriaOCINV = -SumatoriaOCINV @@ -10703,7 +10703,6 @@ Partial Class Compras_Compras 'VALIDA UNIDAD DE MEDIDA If e.Row.DBCampo("CvePS").ToString.ToEntero > 0 Then - Dim DtEquivalencias = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) 'SI UM NO ESTA REGISTRADA If e.Row.DBCampo("CveUM").ToString.ToEntero <= 0 Then @@ -10715,6 +10714,8 @@ Partial Class Compras_Compras 'EQUIVALENCIA If e.Row.DBCampo("CveUM").ToString.ToEntero > 0 And e.Row.DBCampo("CveTipoPS").ToString.ToEntero = 2 Then + Dim DtEquivalencias As DataTable = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToString.ToEntero, e.Row.DBCampo("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa) + If DtEquivalencias.FiltraParametros($"CveUM = {e.Row.DBCampo("CveUM").ToString.ToEntero}").Rows.Count > 0 Then If Not DtEquivalencias.FiltraParametros($"CveUM = {e.Row.DBCampo("CveUM").ToString.ToEntero} AND UnidadBase = 1").Rows.Count > 0 Then 'UM NO BASE @@ -10732,6 +10733,7 @@ Partial Class Compras_Compras e.Row.FCLabel("LtlUnidadMedida").Attributes.Add("data-toggle", "tooltip") e.Row.FCLabel("LtlUnidadMedida").Attributes.Add("title", "Unidad de medida SIN equivalencia") End If + DtEquivalencias.Dispose() End If End If diff --git a/Compras/PopUpBuscarFolioC.aspx.vb b/Compras/PopUpBuscarFolioC.aspx.vb index 78a011566..de4e0e45b 100644 --- a/Compras/PopUpBuscarFolioC.aspx.vb +++ b/Compras/PopUpBuscarFolioC.aspx.vb @@ -38,7 +38,6 @@ Partial Class Compras_PopUpBuscarFolioC Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjCompras As New ClsCompras() Dim Folio As String = "-1" Dim FolioFiscal As String = "-1" @@ -55,23 +54,29 @@ Partial Class Compras_PopUpBuscarFolioC Descripcion = If(TxtDescripcion.Text.Trim = "", "-1", TxtDescripcion.Text.Trim) Obs = If(TxtObservaciones.Text.Trim = "", "-1", TxtObservaciones.Text.Trim) - If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Folio, FolioFiscal, Codigo, Proveedor, FechaI, FechaF, Descripcion, Obs, CveProveedor:=DdlProveedor.SelectedValue.ToEntero) Then - If ObjCompras.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjCompras.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjCompras.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + Dim ObjCompras As New ClsCompras() + If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Folio, FolioFiscal, Codigo, Proveedor, FechaI, FechaF, Descripcion, Obs, + CveProveedor:=DdlProveedor.SelectedValue.ToEntero, TopSelect:=100) Then + If ObjCompras.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjCompras.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjCompras.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + + ObjCompras.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjCompras.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -100,5 +105,15 @@ Partial Class Compras_PopUpBuscarFolioC End If End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtFolio.Text.Trim.Length > 0 Then Return True + If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True + If TxtDescripcion.Text.Trim.Length > 0 Then Return True + If TxtObservaciones.Text.Trim.Length > 0 Then Return True + If DdlTipoDocto.SelectedValue <> "-1" Then Return True + If DdlProveedor.SelectedValue.ToEntero <> 0 Then Return True + Return False + End Function End Class diff --git a/Compras/PopUpBuscarProveedor.aspx.vb b/Compras/PopUpBuscarProveedor.aspx.vb index 3480e09ea..cef681977 100644 --- a/Compras/PopUpBuscarProveedor.aspx.vb +++ b/Compras/PopUpBuscarProveedor.aspx.vb @@ -60,15 +60,20 @@ Partial Class Compras_PopUpBuscarProveedor If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero - If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor) Then - If ObjProveedor.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjProveedor.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, Codigo, RazonSocial, NombreComercial, NombreCorto, RFC, Contacto, Telefono, -1, + UsuarioActual.CveEmpresa, CveTipoProveedor:=CveTipoProveedor, TopSelect:=100) Then + If ObjProveedor.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjProveedor.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjProveedor.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + Else + Alert("Seleccione un criterio de búsqueda", TipoMensaje.MsgAdvertencia) End If ObjProveedor.Dispose() @@ -106,7 +111,7 @@ Partial Class Compras_PopUpBuscarProveedor Case Else Liga = String.Format("", e.Row.DBCampo("CveProveedor")) End Select - + e.Row.FCLiteral("LtlCodigo").Text = String.Format("", Liga, e.Row.DBCampo("Codigo")) e.Row.FCLiteral("LtlRazonSocial").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("RazonSocial")) e.Row.FCLiteral("LtlNombreComercial").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("NombreComercial")) @@ -115,4 +120,16 @@ Partial Class Compras_PopUpBuscarProveedor e.Row.FCLiteral("LtlContacto").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("ContactoNombre")) End If End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtRazonSocial.Text.Trim <> String.Empty Then Return True + If TxtNombreComercial.Text.Trim <> String.Empty Then Return True + If TxtNombreCorto.Text.Trim <> String.Empty Then Return True + If TxtRFC.Text.Trim <> String.Empty Then Return True + If TxtContacto.Text.Trim <> String.Empty Then Return True + If TxtTelefono.Text.Trim <> String.Empty Then Return True + If DdlTipoProveedor.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 4ac3f5c5b..0ae95cb69 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -382,6 +382,13 @@ Partial Class PopUpVerFactura End If End If + 'Imprime Movimiento de IE + If UrlParametros("OP").ToString = "ImprimeMov" Then + If UrlParametros("CVEIE") IsNot Nothing AndAlso UrlParametros("CVEIE").ToString.ToEntero > 0 Then + ImprimeMov(UrlParametros("CVEIE").ToString.ToEntero) + End If + End If + 'IMPRIME DEPOSITOS CAJA If UrlParametros("OP").ToString = "DC" Then If UrlParametros("CVEIE") IsNot Nothing AndAlso UrlParametros("CVEIE").ToString.ToEntero > 0 Then @@ -3101,7 +3108,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Sucursal", "Sucursal")) params.Add(New ReportParameter("Cliente", NombreCliente)) - ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepUsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios") + ImprimirPDF(String.Format("Empresas/{0}/Formatos/UsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios") Case 7 Dim params As New List(Of ReportParameter) Dim CiudadSucursal As String = "" @@ -3922,10 +3929,171 @@ Partial Class PopUpVerFactura ObjIE.Dispose() - End Sub - + End Sub + + Private Sub ImprimeMov(CveIE As Integer) + Dim ObjIE As New ClsBancos() + Dim DtGvRH As New DataTable + Dim DtComprobacion As New DataTable + Dim ParamComprobacion As New DataTable + + 'Movimientos Relacionados de Comprobacion - Hijo + If ObjIE.GetBancosIEMovimientosHijo(CveIE, UsuarioActual.CveEmpresa) Then + DtGvRH = ObjIE.DtResultados + End If + + If DtGvRH IsNot Nothing AndAlso DtGvRH.Rows.Count > 0 Then + + If ObjIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then + ParamComprobacion = ObjIE.DtResultados + End If + + Dim ObjMov As New ClsMovimientos + For Each dr As DataRow In DtGvRH.Rows + If ObjMov.GetPersonalCajaChica(UsuarioActual.CveEmpresa, dr("CveCompra").ToString.ToEntero) Then + DtComprobacion.Merge(ObjMov.DtResultados.FiltraParametros("CveCompra =" + dr("CveCompra").ToString)) + End If + Next + ObjMov.Dispose() + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta)) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim params As New List(Of ReportParameter) + + If Archivo.Exists Then + + If UsuarioActual.CveEmpresa = 72 Then + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) + params.Add(New ReportParameter("CveCajaChica", DtComprobacion.Rows(0)("CveCajaChica").ToString)) + params.Add(New ReportParameter("CveFyE", "0")) ' + + params.Add(New ReportParameter("cuentaRetiro", "Cuenta retiro: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString)) + params.Add(New ReportParameter("CajaChica", "Caja chica: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString)) + params.Add(New ReportParameter("observaciones", "Observaciones: " & ParamComprobacion.Rows(0)("Observaciones").ToString)) + params.Add(New ReportParameter("folio", ParamComprobacion.Rows(0)("Folio").ToString)) + params.Add(New ReportParameter("fecha", ParamComprobacion.Rows(0)("FechaDocumento").ToString)) + params.Add(New ReportParameter("importe", ParamComprobacion.Rows(0)("Importe").ToString)) + params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString)) + + ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtComprobacion, params, String.Format("IE{0}", CveIE), Formato:="PDF") + Else + params.Add(New ReportParameter("Numero", "")) ' + params.Add(New ReportParameter("Anio", DtComprobacion.FiltraParametros("CveCompra > 0").MAX("Fecha").ToDate.Year.ToString)) + params.Add(New ReportParameter("Nombre", DtComprobacion.MAX("SubProyecto"))) + params.Add(New ReportParameter("Fecha", Now.Date.ToString)) + params.Add(New ReportParameter("Elaboro", "")) + params.Add(New ReportParameter("Autorizo", "")) + params.Add(New ReportParameter("ElaboroPuesto", "")) + params.Add(New ReportParameter("AutorizoPuesto", "")) + ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtComprobacion.FiltraParametros("CveCompra > 0"), params, String.Format("IE{0}", CveIE), RDSName:="DsCompras") + End If + Else + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) + + params.Add(New ReportParameter("cuentaRetiro", "Cuenta retiro: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString)) + params.Add(New ReportParameter("CajaChica", "Caja chica: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString)) + params.Add(New ReportParameter("observaciones", "Observaciones: " & ParamComprobacion.Rows(0)("Observaciones").ToString)) + params.Add(New ReportParameter("folio", ParamComprobacion.Rows(0)("Folio").ToString)) + params.Add(New ReportParameter("fecha", ParamComprobacion.Rows(0)("FechaDocumento").ToString)) + params.Add(New ReportParameter("importe", ParamComprobacion.Rows(0)("Importe").ToString)) + params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString)) + + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + + ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtComprobacion, params, String.Format("IE{0}", CveIE), Formato:="PDF") + End If + Else + If ObjIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then + If ObjIE.DtResultados.Rows.Count > 0 Then + + Dim reportDataSetsList As New List(Of ReportDataSource) + + Dim dtMovs As New DataTable + Dim Mov As New ClsContabilidad + If Mov.GetPrePolizasDetalle(-1, CveIE) Then + + dtMovs = Mov.DtResultados.FiltraParametros("CveConceptoContable IN (17,2,312)") + + If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then + 'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES + For Each Dr As DataRow In dtMovs.Rows + Dr("Importe") = Dr("ImporteMN").ToString.ToDecimal + Dr("ImporteNC") = Dr("ImporteNC").ToString.ToDecimal * Dr("TC").ToString.ToDecimal + Dr("Total") = Dr("Total").ToString.ToDecimal * Dr("TC").ToString.ToDecimal + Dr("Saldo") = Dr("Saldo").ToString.ToDecimal * Dr("TC").ToString.ToDecimal + Next + End If + + End If + Mov.Dispose() + Dim rds = New ReportDataSource("DataSet1", dtMovs) + reportDataSetsList.Add(rds) + + Dim dtnc As New DataTable + Dim ObjCompra As New ClsCompras() + If ObjCompra.GetComprasNotasCredito(-1, -1, CveIE) Then + dtnc = ObjCompra.DtResultados + End If + ObjCompra.Dispose() + Dim rds2 = New ReportDataSource("DataSet2", dtnc) + reportDataSetsList.Add(rds2) + dtnc.Dispose() + + Dim paramList As New List(Of ReportParameter) + With paramList + 'Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim LogoRutaFisica As String = String.Format("Empresas\{0}\Logo.png", UsuarioActual.CveEmpresa) + Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica)) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta)) + .Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + .Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + .Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + .Add(New ReportParameter("Cuenta", ObjIE.NumCuenta, True)) + .Add(New ReportParameter("Fecha", ObjIE.FechaDocumento.ToString("dd/MM/yyyy"), True)) + .Add(New ReportParameter("Paguese", ObjIE.PagueseA.Trim, True)) + .Add(New ReportParameter("Importe", ObjIE.Importe.ToString, True)) + .Add(New ReportParameter("Observaciones", ObjIE.Observaciones, True)) + .Add(New ReportParameter("Folio", ObjIE.Folio, True)) + .Add(New ReportParameter("MonedaAbreviatura", ObjIE.MonedaAbreviatura, True)) + + + If Imagen.Exists Then + .Add(New ReportParameter("LogoPath", logouri)) + Else + .Add(New ReportParameter("LogoPath", "")) + End If + + End With + dtMovs.Dispose() + + ImprimirPDF("Empresas\Grales\Formatos\rptChequeMovimientos.rdlc", reportDataSetsList, paramList, ObjIE.Folio, "PDF") + + End If + + End If + End If + + DtGvRH.Dispose() + DtComprobacion.Dispose() + ParamComprobacion.Dispose() + + ObjIE.Dispose() + End Sub + #End Region - + #Region "OP = RECIBO DE PAGOS" Private Sub ImprimirReciboDePagos(CveIE As Integer, CveVenta As Integer) diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index 6b3f13f29..87e301517 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -1432,11 +1432,11 @@ Partial Class Compras_ReembolsosComprobaciones Dim Mensaje As New StringBuilder If CvePrePolizaExcedente > 0 Then - Mensaje.AppendFormat("Abono Registrado Correctamente.

    Cheque: {1}

    Imprimir", CveIEExcedente, TxtFolio.Text) + Mensaje.AppendFormat("Abono Registrado Correctamente.

    Cheque: {1}

    Imprimir", CveIEExcedente, TxtFolio.Text, Encripta(String.Format("Opcion=ImprimeMov&CveIE={0}", CveIEExcedente))) Mensaje.AppendFormat("

    Póliza: {1}
    ", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) Else - Mensaje.AppendFormat("Abono Registrado Correctamente.

    Imprimir", CveIERegistrado) + Mensaje.AppendFormat("Abono Registrado Correctamente.

    Imprimir", Encripta(String.Format("Opcion=ImprimeMov&CveIE={0}", CveIERegistrado))) If CvePrePolizaIERegistrado > 0 Then Mensaje.AppendFormat("

    Póliza: {1}
    ", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) End If diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb index 20803e964..cbf7068ce 100644 --- a/Compras/RepRembolsoComprobaciones.aspx.vb +++ b/Compras/RepRembolsoComprobaciones.aspx.vb @@ -340,6 +340,21 @@ Partial Class Compras_RepRembolsoComprobaciones params.Add(New ReportParameter("Autorizo", "")) params.Add(New ReportParameter("ElaboroPuesto", "")) params.Add(New ReportParameter("AutorizoPuesto", "")) + + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) + params.Add(New ReportParameter("CveCajaChica", DtDatos.Rows(0)("CveCajaChica").ToString)) + params.Add(New ReportParameter("CveFyE", "0")) ' + + params.Add(New ReportParameter("cuentaRetiro", "Cuenta retiro: " & "")) + params.Add(New ReportParameter("CajaChica", "Caja chica: " & "")) + params.Add(New ReportParameter("observaciones", "Observaciones: " & "")) + params.Add(New ReportParameter("folio", DtDatos.Rows(0)("Folio").ToString)) + params.Add(New ReportParameter("fecha", "")) + params.Add(New ReportParameter("importe", "")) + params.Add(New ReportParameter("TotAbono", DtDatos.SUM("Abonado").ToString)) + ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras") Else params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index afeb6b527..9b2e4f077 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -1759,19 +1759,20 @@ Partial Class RegPoliza End Sub Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) Dim dt As New DataTable - Dim Conexion As Odbc.OdbcConnection = Nothing + 'Dim Conexion As Odbc.OdbcConnection = Nothing Dim ErrorArchivo = False Dim n As Integer = 0 Try Select Case Tipo Case "EXCEL" - Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";") - Conexion.Open() - Dim cmd = Conexion.CreateCommand() - cmd.CommandType = CommandType.Text - cmd.CommandText = "Select * FROM [Hoja1$]" - Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd) - DataAdapter.Fill(dt) + 'Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";") + 'Conexion.Open() + 'Dim cmd = Conexion.CreateCommand() + 'cmd.CommandType = CommandType.Text + 'cmd.CommandText = "Select * FROM [Hoja1$]" + 'Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd) + 'DataAdapter.Fill(dt) + dt = Extensiones.ModExtensiones.ReadExcelFile(String.Format("{1}", Ruta, FileName), True) Case Else Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError) Exit Sub @@ -1780,7 +1781,7 @@ Partial Class RegPoliza ErrorArchivo = True OnError("Ocurrio un Error al leer el archivo
    " & ex.Message, ex) End Try - Conexion.Close() + 'Conexion.Close() If Not ErrorArchivo Then If Not dt.Columns(0).ColumnName = "Referencia" Then Alert("El nombre de la primera columna debe ser 'Referencia'.Favor de corregirlo", TipoMensaje.MsgError) @@ -1880,7 +1881,7 @@ Partial Class RegPoliza Dim file As Archivo = TxtExcel.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV") - CargarArchivo(Directorio, file.filename, Tipo) + CargarArchivo(Directorio, file.FileUrl, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) End If diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index 7155797ae..b005a874d 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -19,6 +19,15 @@ Partial Class Contratos_FacturacionMasiva ViewState("DTCicloComercial") = value End Set End Property + Private Property FolioVigentes As Boolean + Get + Return CType(ViewState("FolioVigentes"), Boolean) + End Get + Set(value As Boolean) + ViewState("FolioVigentes") = value + End Set + End Property + Private Property Mensaje As String Get Return CType(ViewState("Mensaje"), String) @@ -100,6 +109,7 @@ Partial Class Contratos_FacturacionMasiva Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + FolioVigentes = False CargaCombos() txtFechaI.Text = DateTime.Today.ToString("d") txtFechaF.Text = DateTime.Today.ToString("d") @@ -118,6 +128,8 @@ Partial Class Contratos_FacturacionMasiva DdlSucursal.DataBind() End Sub Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer) + ValidaFolio() + Dim ObjContratos As New ClsContratos If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0") @@ -127,9 +139,21 @@ Partial Class Contratos_FacturacionMasiva GvCiclosComerciales.DataBind() UpGv.Update() End Sub + + Private Sub ValidaFolio() + Dim ObjFolios As New ClsGralFolios + If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then + If ObjFolios.DtResultados.Rows.Count > 0 Then + FolioVigentes = True + End If + End If + + ObjFolios.Dispose() + End Sub Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then + '' Pendiente de aplicar validacion + If Not FolioVigentes Then e.Row.FCCheckBox("chkDis").Enabled = False e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios" End If diff --git a/Contratos/PopUpBuscarContrato.aspx.vb b/Contratos/PopUpBuscarContrato.aspx.vb index 75ff476e4..b4daf97d0 100644 --- a/Contratos/PopUpBuscarContrato.aspx.vb +++ b/Contratos/PopUpBuscarContrato.aspx.vb @@ -125,7 +125,7 @@ Partial Class Contratos_PopUpBuscarContrato End Sub Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) Handles BtnBuscar.Click - Dim objContratos As New ClsContratos + Dim NumeroContrato As String = "-1" Dim Estatus As Integer = 1 @@ -141,20 +141,27 @@ Partial Class Contratos_PopUpBuscarContrato If TxtResponsable.Text.Trim.Length > 0 Then Responsable = TxtResponsable.Text If TxtNumeroContrato.Text.Trim.Length > 0 Then NumeroContrato = TxtNumeroContrato.Text - If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion, - Ubicacion, Responsable, Estatus, DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero)) Then - GV.DataSource = objContratos.DtResultados - LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString + If ValidarUnFiltroSeleccionado() Then + Dim objContratos As New ClsContratos + If (objContratos.GetContratosBusquedaRep(DdlTipo.SelectedValue.ToEntero, DdlTipoContrato.SelectedValue.ToEntero, NumeroContrato, Descripcion, Ubicacion, Responsable, Estatus, + DdlProyecto.SelectedValue.ToEntero, DdlSubProtecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, DdlCliente.SelectedValue.ToEntero, + DdlProveedor.SelectedValue.ToEntero, TopSelect:=100)) Then + GV.DataSource = objContratos.DtResultados + LtlTotalRegistros.Text = objContratos.DtResultados.Rows.Count.ToString + Else + GV.DataSource = Nothing + LtlTotalRegistros.Text = "0" + End If + + + + objContratos.Dispose() + GV.DataBind() + UPDatos.Update() Else - GV.DataSource = Nothing - LtlTotalRegistros.Text = "0" + Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia) End If - - - objContratos.Dispose() - GV.DataBind() - UPDatos.Update() End Sub Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound @@ -173,6 +180,19 @@ Partial Class Contratos_PopUpBuscarContrato End If - End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtDescripcion.Text.Trim.Length > 0 Then Return True + If TxtUbicacion.Text.Trim.Length > 0 Then Return True + If TxtResponsable.Text.Trim.Length > 0 Then Return True + If TxtNumeroContrato.Text.Trim.Length > 0 Then Return True + 'If DdlTipo.SelectedValue.ToEntero > 0 Then Return True + If DdlTipoContrato.SelectedValue.ToEntero > 0 Then Return True + If DdlProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlSubProtecto.SelectedValue.ToEntero > 0 Then Return True + If DdlCliente.SelectedValue.ToEntero > 0 Then Return True + If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function End Class \ No newline at end of file diff --git a/Contratos/RepContratosCostos.aspx b/Contratos/RepContratosCostos.aspx index 0711f2a7b..bf7c217b9 100644 --- a/Contratos/RepContratosCostos.aspx +++ b/Contratos/RepContratosCostos.aspx @@ -134,7 +134,7 @@ - + diff --git a/Default2.aspx b/Default2.aspx new file mode 100644 index 000000000..622c9e37e --- /dev/null +++ b/Default2.aspx @@ -0,0 +1,20 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> + + + + + + + + + + + + + + + + + + + diff --git a/Default2.aspx.cs b/Default2.aspx.cs new file mode 100644 index 000000000..030cb567b --- /dev/null +++ b/Default2.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class Default2 : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/Empresas/13/Formatos/OC.rdlc b/Empresas/13/Formatos/OC.rdlc index 281ecf1a6..d4506917f 100644 --- a/Empresas/13/Formatos/OC.rdlc +++ b/Empresas/13/Formatos/OC.rdlc @@ -3089,6 +3089,46 @@ 2pt + + true + true + + + + + Cuentas Bancarias: + + + + =Parameters!Cuentas.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + 5.19589in + + + + + + Textbox8 + + + + + + + + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Folio + + + + + + + Textbox1 + + + + + + + + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Fecha + + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Nombre + + + + + + + + + + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + Contacto + + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + #bbd915 + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.4095cm + + + + + true + true + + + + + =Fields!Num.Value + + + + + + + Num + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!serieFolio.Value + + + + + + + serieFolio + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!fecha.Value + + + + + + + fecha + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!nombre.Value + + + + + + + nombre + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + true + + + + + =Fields!contacto.Value + + + + + + + contacto + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DsInventarios + 0.07056cm + 0.03488cm + 0.92264cm + 20.29479cm + + + + + + true + true + + + + + Recibido por: + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 1.22221in + + + + + + + Textbox2 + 0.19477cm + 2.55499cm + 1.1027cm + 15.46868cm + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + Logo1 + FitProportional + 0.07668in + 0cm + 0.86392in + 1.0059in + 1 + + + + + + true + true + + + + + ENTREGAS POR REALIZAR + + + + + + + Textbox4 + 1.40331cm + 7.12631cm + 0.98582cm + 6.32604cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha: + + + + + + + + =Parameters!Fecha.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Asignado a: + + + + + + + + =Parameters!AsignadoA.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 0.87489cm + true + true + + + true + true + + + + + Usuario: + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + =Now + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox35 + 0.24341cm + 17.71971cm + 0.41981cm + 2.5cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.06702cm + 0.05952cm + 0cm + 20.27015cm + 3 + + + + + + + + + + 25cm + 21.59cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 0.13cm + + + true + true + + + + + Cuentas Bancarias: + + + + =Parameters!Cuentas.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + 5.1933in - - - CP Benjamin Carrillo Cota - HTML - - CP Sara Eduwiges Ruíz Félix HTML @@ -1969,9 +1945,10 @@ AgrupadoPor - 16.31254cm + 16.94754cm + 14.51918cm 0.6cm - 561.96737pt + 139.98364pt 15 + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CP. Daniel Hernández Tapia + HTML + + + + Textbox47 + 16.94754cm + 0.47837cm + 0.6cm + 5.38396cm + 22 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + CP Benjamin Carrillo Cota + HTML + + + + Textbox48 + 16.94754cm + 7.96078cm + 0.6cm + 4.88125cm + 23 + + + 2pt + 2pt + 2pt + 2pt + + - 6.6828in + 6.95328in + + + Textbox3 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -47,16 +82,16 @@ - 3.5579cm + 2.36727cm - 7.63463cm + 7.23964cm - 2.64509cm + 2.57894cm - 2.86998cm + 2.34081cm @@ -172,7 +207,10 @@ - =Switch(Fields!FueValidado.Value = "1","Validado", Fields!FueValidado.Value = "2","Cancelada", Fields!FueValidado.Value = "3","Omitida") + =Switch(Fields!FueValidado.Value = "1","Validado", +Fields!FueValidado.Value = "2","Cancelada", +Fields!FueValidado.Value = "3","Omitida", +1=1,"No validado") @@ -378,7 +419,7 @@ @@ -389,16 +430,51 @@ 2pt - true + + + + 2.33715cm + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + DataSet1 0.06614cm 1.2cm - 19.04475cm + 19.0265cm @@ -805,6 +881,10 @@ /* Local Query */ + + TipoComprobante + System.String + SerieFolio System.String diff --git a/GPS/FacturacionMasiva.aspx.vb b/GPS/FacturacionMasiva.aspx.vb index 5db90c87c..79ee47c03 100644 --- a/GPS/FacturacionMasiva.aspx.vb +++ b/GPS/FacturacionMasiva.aspx.vb @@ -27,6 +27,14 @@ Partial Class Contratos_FacturacionMasiva ViewState("Mensaje") = value End Set End Property + Private Property FolioVigentes As Boolean + Get + Return CType(ViewState("FolioVigentes"), Boolean) + End Get + Set(value As Boolean) + ViewState("FolioVigentes") = value + End Set + End Property Private Property ErrorList As List(Of String) Get Return CType(ViewState("ErrorList"), List(Of String)) @@ -79,6 +87,7 @@ Partial Class Contratos_FacturacionMasiva Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + FolioVigentes = False CargaCombos() txtFechaI.Text = DateTime.Today.ToString("d") txtFechaF.Text = DateTime.Today.ToString("d") @@ -97,6 +106,7 @@ Partial Class Contratos_FacturacionMasiva DdlSucursal.DataBind() End Sub Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer) + ValidaFolio() Dim ObjContratos As New ClsContratos If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0") @@ -106,9 +116,20 @@ Partial Class Contratos_FacturacionMasiva GvCiclosComerciales.DataBind() UpGv.Update() End Sub + + Private Sub ValidaFolio() + Dim ObjFolios As New ClsGralFolios + If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then + If ObjFolios.DtResultados.Rows.Count > 0 Then + FolioVigentes = True + End If + End If + + ObjFolios.Dispose() + End Sub Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then + If Not FolioVigentes Then e.Row.FCCheckBox("chkDis").Enabled = False e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios" End If diff --git a/General/PopUpPaqueteriasGuiasInternas.aspx.cs b/General/PopUpPaqueteriasGuiasInternas.aspx.cs index da9c3af0c..4de98d7c1 100644 --- a/General/PopUpPaqueteriasGuiasInternas.aspx.cs +++ b/General/PopUpPaqueteriasGuiasInternas.aspx.cs @@ -92,14 +92,14 @@ public partial class General_PopUpPaqueteriasGuiasInternas : ClsPaginas String Observaciones = TxtObservaciones.Text; - int CvePaqueteriaGuia = ObjGeneral.AddPaqueteriasGuias(-1, -1, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, + int CvePaqueteriaGuia = ObjGeneral.AddPaqueteriasGuias(-1, 9, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:true); if (CvePaqueteriaGuia > 0) { if (CveVenta > 0 || CveSubProyecto > 0 ) { - TieneError = !ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVenta, -1, CveSubProyecto, -1); + TieneError = !ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVenta, -1, -1, -1); } } else diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index ba858b386..75a951155 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -235,7 +235,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa); DdlUsuarios.DataBind(); - DdlUsuarios.Items.Insert(0, new ListItem("Seleccione ", "-1")); + DdlUsuarios.Items.Insert(0, new ListItem("Todos ", "-1")); } protected void InicializaFechas() diff --git a/Global.asax b/Global.asax index 11fea0e3e..d2a87c94f 100644 --- a/Global.asax +++ b/Global.asax @@ -356,18 +356,13 @@ Dim ObjLeyendasFiscales As New ClsLeyendasFiscales() If ObjLeyendasFiscales.GetLeyendasFiscales() Then Application("GlobalDTLeyendasFiscales") = ObjLeyendasFiscales.DtResultados Else Application("GlobalDTLeyendasFiscales") = Nothing - ObjLeyendasFiscales.Dispose() - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C A R G A - F O L I O S - - Dim ObjFolios As New ClsGralFolios() - If ObjFolios.GetFolios() Then Application("GlobalDTFolios") = ObjFolios.DtResultados Else Application("GlobalDTFolios") = Nothing - ObjFolios.Dispose() - - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'F A C T U R A S - + ObjLeyendasFiscales.Dispose() + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'F A C T U R A S + Dim ObjEstatusFactura As New ClsEstatusFactura() If ObjEstatusFactura.GetEstatusFactura() Then Application("GlobalDTEstatusFactura") = ObjEstatusFactura.DtResultados Else Application("GlobalDTEstatusFactura") = Nothing ObjEstatusFactura.Dispose() diff --git a/Inicio.aspx b/Inicio.aspx index b45294990..bc2192868 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -1144,7 +1144,7 @@
    - + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx index c54c8728c..ac203fa05 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -54,7 +54,7 @@
    - + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index ec0aeb1f9..e00c268dd 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -1,6 +1,7 @@  Imports System.Data Imports Extensiones +Imports GemBox.Spreadsheet Partial Class Inventarios_AjustesSeccionAlmacen Inherits ClsPaginas @@ -145,21 +146,69 @@ Partial Class Inventarios_AjustesSeccionAlmacen End Sub Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click, BtnDescargar.Click - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoAjusteSecCad.xlsx" - Dim Archivo As New IO.FileInfo(Directorio) - If Archivo.Exists Then - Response.Clear() - Response.ClearHeaders() - Response.ClearContent() - Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name) - Response.AddHeader("Content-Length", Archivo.Length.ToString()) - Response.ContentType = "text/plain" - Response.Flush() - Response.TransmitFile(Archivo.FullName) - Response.End() + If GvD.Rows.Count > 0 Then + DescargarExcel() + Else + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoAjusteSecCad.xlsx" + Dim Archivo As New IO.FileInfo(Directorio) + If Archivo.Exists Then + Response.Clear() + Response.ClearHeaders() + Response.ClearContent() + Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name) + Response.AddHeader("Content-Length", Archivo.Length.ToString()) + Response.ContentType = "text/plain" + Response.Flush() + Response.TransmitFile(Archivo.FullName) + Response.End() + End If End If End Sub + Private Sub DescargarExcel() + Dim DtExcel As DataTable = (From row As GridViewRow In GvD.Rows + Where row.RowType = DataControlRowType.DataRow + Select New With + { + .Cantidad = row.DataKey("Existencia"), + .Codigo = row.DataKey("Codigo"), + .PS = row.DataKey("PS"), + .SeccionAlmacen = row.DataKey("SeccionAlmacen"), + .Serie = row.DataKey("Serie"), + .Lote = row.DataKey("Lote"), + .FechaCaducidad = row.DataKey("FechaCaducidad") + }).QueryToDataTable(True) + If DtExcel.Rows.Count < 1 Then + Alert("No hay resutados en la busqueda.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + DtExcel.TableName = "Ajustes" + DtExcel.Columns("Codigo").ColumnName = "Código" + DtExcel.Columns("PS").ColumnName = "Producto/Servicio" + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + + Dim FileExcel As New ExcelFile() + + Dim worksheet = FileExcel.Worksheets.Add(DtExcel.TableName) + worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .StartColumn = 0 + }) + worksheet.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255)) + worksheet.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255) + + Dim columnCount = worksheet.CalculateMaxUsedColumns() + For i = 0 To columnCount + worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1)) + Next + + FileExcel.Save(Response, "FormatoAjusteSecCad.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) @@ -257,7 +306,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim CveUM As Integer = DrPS("CveUM").ToString().ToEntero() Dim SeccionAlmacen As String = RowExcel("SeccionAlmacen").ToString.Trim - Dim CveSeccionAlmacen As Integer = dtSecciones.FiltroPrimeroValor("CveSeccion", $"SeccionAlmacen='{SeccionAlmacen}'") + Dim CveSeccionAlmacen As Integer = -1 + + Dim DrSeccion As DataRow = dtSecciones.FiltroPrimero($"SeccionAlmacen='{SeccionAlmacen}'") + If DrSeccion IsNot Nothing Then + CveSeccionAlmacen = DrSeccion("CveSeccion").ToString().ToEntero() + End If Dim Serie As String = RowExcel("Serie").ToString() Dim Lote As String = RowExcel("Lote").ToString() diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx index 57bf1f423..36a17a7c0 100644 --- a/Inventarios/Apartados.aspx +++ b/Inventarios/Apartados.aspx @@ -86,7 +86,7 @@
    - +
    @@ -203,7 +203,7 @@
    - +
    @@ -310,7 +310,7 @@
    Cliente
    - + <%-- diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb index db73531dd..f10ca6247 100644 --- a/Inventarios/Apartados.aspx.vb +++ b/Inventarios/Apartados.aspx.vb @@ -466,7 +466,8 @@ Partial Class Inventarios_Apartados Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, "-1")) If Valido Then - AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Text <> "", TxtnSerie.Text, ""), Limpia:=FuncionalidadSinSerie) + Dim StrSeccion As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedItem.Text, "") + AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=StrSeccion, Serie:=If(TxtnSerie.Text <> "", TxtnSerie.Text, ""), Limpia:=FuncionalidadSinSerie) End If End If diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 7cd2b7882..996067e98 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -255,9 +255,9 @@
    - +
    - +
    @@ -1325,7 +1325,7 @@ - +
    @@ -1342,6 +1342,7 @@
    +
    @@ -1350,7 +1351,7 @@
    diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b7acf9b87..977f91881 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -463,10 +463,6 @@ Partial Class Inventarios_EntradasSalidas End If DdlClasificacion.DataBind() - DdlSeccion.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) - DdlSeccion.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlSeccion.DataBind() - DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1) DdlSeccionAlmacen.DataBind() @@ -825,7 +821,7 @@ Partial Class Inventarios_EntradasSalidas 'cargar también los movimentos detalle If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DdlSeccion.SelectedValueExist(Mov.CveSeccion.ToString) + DtMovimientos = Mov.DtResultados.FiltraParametros("", "CveMovimientoDetalle") DtMovimientos.Columns("No").AutoIncrement = True @@ -929,7 +925,6 @@ Partial Class Inventarios_EntradasSalidas TxtObservaciones.Enabled = True DdlMoneda.Enabled = True TxtGuia.Enabled = True - DdlSeccion.Enabled = True If CveMovimiento > 0 Then DdlAlmacen.Enabled = False @@ -940,7 +935,7 @@ Partial Class Inventarios_EntradasSalidas TxtObservaciones.Enabled = False DdlMoneda.Enabled = False TxtGuia.Enabled = False - DdlSeccion.Enabled = False + End If UppGrid.Update() End Sub @@ -2170,6 +2165,10 @@ Partial Class Inventarios_EntradasSalidas 'TrLote2.Visible = True End If + If CBool(dr("AplicaSeccion")) Then + divSeccionAlmacen.Visible = True + + End If End If End If @@ -2233,10 +2232,10 @@ Partial Class Inventarios_EntradasSalidas End If If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then - GvM.Columns(9).Visible = DtTemp.MAX("Serie").ToString <> "" - GvM.Columns(10).Visible = DtTemp.MAX("Lote").ToString <> "" - GvM.Columns(11).Visible = DtTemp.MAX("FechaCaducidad").ToString <> "" - GvM.Columns(12).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString <> "" + GvM.Columns(9).Visible = DtTemp.MAX("Serie") <> "" + GvM.Columns(10).Visible = DtTemp.MAX("Lote") <> "" + GvM.Columns(11).Visible = DtTemp.MAX("FechaCaducidad").ToDate > MinFecha + GvM.Columns(12).Visible = DtTemp.MAX("CveSeccionAlmacen").ToEntero > 0 End If @@ -2375,6 +2374,9 @@ Partial Class Inventarios_EntradasSalidas TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones") DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen")) LkAgregarDetalle.Text = "Actualizar" + Dim Origen As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue)).ToEntero + divPrecio.Visible = Origen = 1 + txtPrecio.Visible = Origen = 1 UpAgregar.Update() RegistraScript("$('#ModalAgregar').modal()") CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' ")) @@ -2397,6 +2399,9 @@ Partial Class Inventarios_EntradasSalidas TxtnSerie.Text = GvRow.DataKey("Serie") TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones") DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen")) + Dim Origen As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue)).ToEntero + divPrecio.Visible = Origen = 1 + txtPrecio.Visible = Origen = 1 LkAgregarDetalle.Text = "Actualizar" UpAgregar.Update() RegistraScript("$('#ModalAgregar').modal()") @@ -4042,7 +4047,6 @@ Partial Class Inventarios_EntradasSalidas If TxtRemision.Visible Then TxtRemision.Enabled = True If DdlMoneda.Visible Then DdlMoneda.Enabled = True If TxtGuia.Visible Then TxtGuia.Enabled = True - If DdlSeccion.Visible Then DdlSeccion.Enabled = True If BtnEliminar.Visible Then BtnEliminar.Visible = False @@ -4204,7 +4208,9 @@ Partial Class Inventarios_EntradasSalidas Else VisualizaPUExtranjero(False) End If - + Dim Origen As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue)).ToEntero + divPrecio.Visible = Origen = 1 + txtPrecio.Visible = Origen = 1 UpAgregar.Update() End Sub diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index 70313db73..0b3268214 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -65,11 +65,15 @@
    • Cliente: + + <%----%>
    • Serie-Folio: + + @@ -238,11 +242,13 @@
    -
    - - - -
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Estatus: + + <%-- --%> + + + + + + <%-- + --%> +
    Fecha: +
    + + + + + + + + + +
    +
    Fecha Estimada: +
    + + + + + + + +
    +
    # Cajas: + +
    Observaciones: + +
    + + + + + + + diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 4777d29aa..d68c26807 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2,16 +2,14 @@ Option Explicit On Imports System.Data -Imports System.IO -Imports System.Linq -Imports CrystalDecisions.[Shared].Json +Imports System.IO Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Inventarios_EntregaAlmacen - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "PROPIEDADES" Private Property CveVentaAD As Integer Get @@ -245,10 +243,10 @@ Partial Class Inventarios_EntregaAlmacen Set(value As Boolean) ViewState("EsDevolucionDirecta") = 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 @@ -256,9 +254,9 @@ Partial Class Inventarios_EntregaAlmacen CargaParametrosAD() If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True End If - End Sub - - + End Sub + + #Region " INICIALIZA VALORES " Private Sub InicializaValores() TipoEstatus = -1 @@ -318,18 +316,19 @@ Partial Class Inventarios_EntregaAlmacen DdlSubProyectos.SelectedValueExist(UsuarioActual.CveSubProyecto.ToString) If UsuarioActual.TienePermisoProceso(152) Then DdlSubProyectos.Enabled = False + If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then PnlEntrega.Visible = True CreaDtDetalle() CreaDtDetalleLote() CargaPendientes() - - End Sub - + LimpiaCampos() + End Sub + #End Region - - + + #Region " CARGA PARAMETROS - EXCLUSIVO USO AD " Private Sub CargaParametrosAD() @@ -347,9 +346,9 @@ Partial Class Inventarios_EntregaAlmacen BtnGuardar.Visible = False End If - End Sub + End Sub #End Region - + #Region " CARGA PENDIENTES POR SURTIR " Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs) CargaFolios() @@ -467,11 +466,11 @@ Partial Class Inventarios_EntregaAlmacen End Select UpPendientes.Update() End If - End Sub - + End Sub + #End Region - - + + #Region " CARGA VENTA POR SURTIR " Protected Sub BtnSurtir_Click(sender As Object, e As EventArgs) @@ -596,7 +595,9 @@ Partial Class Inventarios_EntregaAlmacen DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen) End If - + If Not DtDatos.Columns.Contains("Serie") Then + DtDatos.Columns.Add("Serie", GetType(String)) + End If If Not DtDatos.Columns.Contains("Lote") Then DtDatos.Columns.Add("Lote", GetType(String)) End If @@ -658,8 +659,9 @@ Partial Class Inventarios_EntregaAlmacen Alert("Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If End If - - CargaDocumentos(CveVenta) + If UsuarioActual.Empresa.FacturaProduccion Then + CargaDocumentos(CveVenta) + End If Else Alert("No se encontraron productos pendientes por surtir. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) End If @@ -744,6 +746,20 @@ Partial Class Inventarios_EntregaAlmacen DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen) End If + If Not DtDatos.Columns.Contains("CveSeccion") Then + DtDatos.Columns.Add("CveSeccion", GetType(Integer)) + End If + + If Not DtDatos.Columns.Contains("FechaCaducidad") Then + DtDatos.Columns.Add("FechaCaducidad", GetType(Date)) + End If + If Not DtDatos.Columns.Contains("Seleccionado") Then + DtDatos.Columns.Add("Seleccionado", GetType(Boolean)) + End If + If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then + DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double)) + End If + If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then DivCodigoSeriePS.Visible = True Else @@ -812,7 +828,8 @@ Partial Class Inventarios_EntregaAlmacen If e.Row.DBCampo("Consec") <> "" AndAlso DtDatosDetalle IsNot Nothing Then Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString - 'e.Row.FCTextBox("TbCantidadF").Text = "0" + Else + e.Row.FCTextBox("TbCantidadF").Text = "0" End If @@ -867,6 +884,7 @@ Partial Class Inventarios_EntregaAlmacen 'FUNCIONALIDAD PISTOLA DE CODIGOS If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then + e.Row.FCTextBox("TbCantidadF").Text = "0" 'NO BLOQUEA PARA ROL AD If UsuarioActual.CveRol = 1 Then If e.Row.DBCampo("Inv_CveMetodoInventario").Contiene("5", "6") Then @@ -898,14 +916,14 @@ Partial Class Inventarios_EntregaAlmacen End If objInv.Dispose() GvDocs.DataBind() - End Sub - - + End Sub + + #End Region - - + + #Region " AGREGAR " - + Protected Sub BtnSerie_Click(sender As Object, e As EventArgs) Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c) @@ -932,10 +950,10 @@ Partial Class Inventarios_EntregaAlmacen UpLoteBatch.Update() End If - End Sub - + End Sub + #Region " AGREGA POR SERIE/LOTE " - + Private Sub CreaDtDetalle() If DtDatosDetalle Is Nothing Then DtDatosDetalle = New DataTable @@ -1140,11 +1158,11 @@ Partial Class Inventarios_EntregaAlmacen DtDatosDetalle.AcceptChanges() CargaSerie() - End Sub + End Sub #End Region - + #Region " AGREGA CON LOTE BATCH " - + Private Sub CreaDtDetalleLote() If DtDatosDetalleLote Is Nothing Then DtDatosDetalleLote = New DataTable @@ -1332,9 +1350,9 @@ Partial Class Inventarios_EntregaAlmacen End Try DtDatosDetalleLote.AcceptChanges() CargaLote() - End Sub + End Sub #End Region - + #Region " AGREGA CON TXT | CODIGO - SERIE " Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs) @@ -1468,12 +1486,12 @@ Partial Class Inventarios_EntregaAlmacen End If TxtCantidadEspecialDiv.Text = "1" - End Sub + End Sub #End Region - + #End Region - - + + #Region " GUARDAR " Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) @@ -1575,6 +1593,7 @@ Partial Class Inventarios_EntregaAlmacen Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL()) Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL()) Dim ObjAcumuladores As New ClsAcumuladores(ObjInventario.IniciaTransacSQL()) + Dim ObjGeneral As New ClsGenerales(ObjInventario.IniciaTransacSQL()) Dim CveMovimiento As Integer Dim Folio As Integer Dim ErrorMovInv As Boolean @@ -2395,8 +2414,40 @@ Partial Class Inventarios_EntregaAlmacen OnError("Ocurrió un error al guardar", ex) End Try + 'Paqueterias guias + If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then + Dim CveEstatus As Integer = DdlEstatus.SelectedValue.ToEntero() + Dim Fecha As String = TxtFechaPaqInterna.Text + Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text) + Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero() + Dim Observaciones As String = TxtObservacionesPaqInterna.Text + Dim CvePaqueteria As Integer = GlobalDTPaqueterias().FiltroPrimeroValor("CvePaqueteria", String.Format("CveEmpresa={0} AND TipoPaqueteria = 0", UsuarioActual.CveEmpresa)).ToEntero + + Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(CvePaqueteria, 9, CveEstatus, CveSubProyecto, Fecha, "", "", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True) + + If CvePaqueteriaGuia > 0 Then + + If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then + If ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1) Then + ''manda correo + MandaCorreoEntrega(CveVentaSurtir) + Else + ErrorMovInv = True + End If + End If + If ErrorMovInv Then + Alert("Error en el paqueteria guia detalle", TipoMensaje.MsgError) + End If + Else + ErrorMovInv = True + Alert("Error en el paqueteria guia", TipoMensaje.MsgError) + End If + End If + If Not ErrorMovInv Then + ObjInventario.Commit() + ObjGeneral.Dispose() RegistraScript("playsonidito('beep-07.wav')") Dim Msg As New StringBuilder @@ -2426,10 +2477,15 @@ Partial Class Inventarios_EntregaAlmacen Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtual))) End If + If RbEntregaInterna.Checked Then + Msg.AppendFormat("

    Se agregó una guía de paquetería interna") + End If + Alert(Msg.ToString, TipoMensaje.MsgInformacion) Limpia() CargaPendientes() + LimpiaCampos() Else ObjInventario.RollBack() Alert(TextoError.ToString, TipoMensaje.MsgError) @@ -2473,6 +2529,7 @@ Partial Class Inventarios_EntregaAlmacen End If Dim ObjInventario As New ClsInventarios : ObjInventario.IniciaTransacSQL() + Dim ObjGeneral As New ClsGenerales(ObjInventario.IniciaTransacSQL()) Dim CveMovimientoSalida As Integer Dim ConceptoMovimiento = 0 Dim FolioSalida As Integer @@ -2540,10 +2597,10 @@ Partial Class Inventarios_EntregaAlmacen If CBool(Dr("AplicaSerie")) Then DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) For Each Dr1 As DataRow In DtDetalle.Rows - StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("YYYY/MM/DD")) + StrXML.AppendFormat("", Dr1("CvePS"), Dr1("CveUM"), 1, IfNull(Dr("CveSeccion"), -1), Dr1("Serie"), Lote, FechaCaducidad.ToString("yyyy/MM/dd")) Next Else - StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("YYYY/MM/DD")) + StrXML.AppendFormat("", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), IfNull(Dr("CveSeccion"), -1), "-1", Lote, FechaCaducidad.ToString("yyyy/MM/dd")) End If End If Next @@ -2649,9 +2706,32 @@ Partial Class Inventarios_EntregaAlmacen End If End If + 'Paqueterias Guias + If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then + Dim CveEstatus As Integer = DdlEstatus.SelectedValue.ToEntero() + Dim Fecha As String = TxtFechaPaqInterna.Text + Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text) + Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero() + Dim Observaciones As String = TxtObservacionesPaqInterna.Text + Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(-1, -1, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True) + + If CvePaqueteriaGuia > 0 Then + + If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then + ErrorMovInv = Not ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1) + End If + If ErrorMovInv Then + Alert("Error en el paqueteria guia detalle", TipoMensaje.MsgError) + End If + Else + ErrorMovInv = True + Alert("Error en el paqueteria guia", TipoMensaje.MsgError) + End If + End If If Not ErrorMovInv Then ObjInventario.Commit() + ObjGeneral.Dispose() RegistraScript("playsonidito('beep-07.wav')") Dim Msg As New StringBuilder @@ -2661,9 +2741,14 @@ Partial Class Inventarios_EntregaAlmacen Msg.AppendFormat("

    Movimiento Entrada (Traspaso): {1}", CveMovimientoEntrada, FolioEntrada) Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) + If RbEntregaInterna.Checked Then + Msg.AppendFormat("

    Se agregó una guía de paquetería interna") + End If + Alert(Msg.ToString, TipoMensaje.MsgInformacion) Limpia() + LimpiaCampos() CargaPendientes() Else Alert(TextoError, TipoMensaje.MsgError) @@ -2675,6 +2760,53 @@ Partial Class Inventarios_EntregaAlmacen End Sub + + Private Sub MandaCorreoEntrega(tCveVenta As Integer) + Dim Correo As New ClsSisMail() + Dim SerieFolio As String = "" + Dim Asunto As String = String.Format("{0} Envio de pedido: {1}", UsuarioActual.Empresa.NombreCorto, SerieFolio) + Dim Cuerpo As New StringBuilder() + Dim Destinatario As String = "" + Dim MensajeEnviado = False + Dim tCvecliente As Integer + + + Dim ObjVentas As New ClsVentas() + + If (ObjVentas.GetVenta(tCveVenta, UsuarioActual.CveEmpresa)) Then + Dim dr As DataRow = ObjVentas.DtResultados.FiltroPrimero("") + Destinatario = String.Format("{0};{1}", dr("CorreoNotificacion"), dr("CorreoVendedorVenta")) + + tCvecliente = dr("CveCliente").ToString.ToEntero + + Dim drC As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=tCvecliente).FiltroPrimero("") + Destinatario += String.Format("{0};{1}", drC("CorreoEntregaCompras"), drC("CorreoEntregaAlmacen")) + + Cuerpo.AppendLine(String.Format("Estimado {0} le informamos que los productos de la factura {1} han sido enviados a entrega.

    ", dr("ClienteNombre"), dr("SerieFolio"))) + Cuerpo.AppendLine("

    Dudas y aclaraciones con su coordinador empresarial.") + + End If + ObjVentas.Dispose() + + + ' Dim ArchivoAdjunto As New ClsSisMail.ArchivoMail() + + 'Dim ListaAdjuntos As New List(ClsSisMail.ArchivoMail) + + + 'If (File.Exists(RutaArchivoAdjunto))Then + ' { + ' ArchivoAdjunto.ArchivoBinario = File.ReadAllBytes(RutaArchivoAdjunto); + ' ArchivoAdjunto.Ruta = RutaArchivoAdjunto; + ' ArchivoAdjunto.NombreArchivo = new FileInfo(RutaArchivoAdjunto).Name; + ' ListaAdjuntos.Add(ArchivoAdjunto); + ' } + + + MensajeEnviado = Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString()) + + + End Sub Private Sub Limpia() 'DATOS DE LA VENTA @@ -2971,7 +3103,7 @@ Partial Class Inventarios_EntregaAlmacen If fi.Exists() Then linkDescarga = $"/Empresas/{UsuarioActual.CveEmpresa}/Documentacion/ventas/{fi.Name}" ImgDownLoad.Visible = True - ImgDownLoad.Text = String.Format(" ", linkDescarga) + ImgDownLoad.Text = String.Format(" ", linkDescarga) End If @@ -3094,11 +3226,22 @@ Partial Class Inventarios_EntregaAlmacen If RbEntregaExterna.Checked Then RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')") ElseIf RbEntregaInterna.Checked Then - RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuiasInternas.aspx?CveVenta={CveVentaSurtir}&CveSubProyecto={CveSubProyecto}',800,547,'N')") + RegistraScript("$('#ModalPaqueteriaInterna').modal('show')") + 'RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuiasInternas.aspx?CveVenta={CveVentaSurtir}&CveSubProyecto={CveSubProyecto}',800,547,'N')") 'CveVentaSurtir + ElseIf RbSinEntrega.Checked Then + LimpiaCampos() End If End Sub + Protected Sub LimpiaCampos() + DdlEstatus.SelectedValue = "1" + TxtFechaPaqInterna.Text = "" + TxtFechaEstimada.Text = "" + TxtNoCajas.Text = "" + TxtObservacionesPaqInterna.Text = "" + UpPaqInterna.Update() + End Sub #End Region diff --git a/Inventarios/EntregasPorRealizar.aspx b/Inventarios/EntregasPorRealizar.aspx index 9b5943b7e..98b35e26b 100644 --- a/Inventarios/EntregasPorRealizar.aspx +++ b/Inventarios/EntregasPorRealizar.aspx @@ -15,11 +15,23 @@ - <%--Paqueterías Guías--%>Entrega Interna + Entregas por Realizar + + + + +
  • + +
  • +
    + + + +
    @@ -70,9 +82,10 @@   + -   +   diff --git a/Inventarios/EntregasPorRealizar.aspx.cs b/Inventarios/EntregasPorRealizar.aspx.cs index bf831e4e3..47ab0e863 100644 --- a/Inventarios/EntregasPorRealizar.aspx.cs +++ b/Inventarios/EntregasPorRealizar.aspx.cs @@ -6,9 +6,22 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using Extensiones; +using Microsoft.Reporting.WebForms; public partial class Inventarios_EntregasPorRealizar : ClsPaginas { + private DataTable DtPaqueteriasGuias + { + get + { + return (ViewState["DtPaqueteriasGuias"] == null) ? null : (DataTable)ViewState["DtPaqueteriasGuias"]; + } + set + { + ViewState["DtPaqueteriasGuias"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -65,6 +78,7 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas if (ObjGeneral.GetEntregasPorRealizar(UsuarioActual.CveEmpresa)) { GvPaqueteriasGuias.DataSource = ObjGeneral.DtResultados; + DtPaqueteriasGuias = ObjGeneral.DtResultados; GvPaqueteriasGuias.DataBind(); } ObjGeneral.Dispose(); @@ -76,4 +90,15 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas DdlUsuario.DataBind(); DdlUsuario.Items.Insert(0, new ListItem("Seleccione", "-1")); } + + protected void LnkImprimir_Click(object sender, EventArgs e) + { + List RepParams = new List(); + string Usuario = DdlUsuario.SelectedValue.ToEntero() > 0 ? DdlUsuario.SelectedItem.Text : "Todos"; + RepParams.Add(new ReportParameter("Fecha", DateTime.Today.ToString())); + RepParams.Add(new ReportParameter("AsignadoA", Usuario)); + RepParams.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); + + ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF",RDSName:"DsInventarios"); + } } \ No newline at end of file diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 54ec0779b..ba212c0e1 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -713,8 +713,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then - e.Row.FCButton("BtnSerieLote").Visible = True - e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°1", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) + e.Row.FCButton("BtnSerie").Visible = True + e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°1", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) e.Row.FCLinkButton("BtnSeriePaquete").CommandArgument = e.Row.DBCampo("Consec") 'Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count 'e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString @@ -727,7 +727,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosArmado.Columns(4).Visible = True Else - e.Row.FCButton("BtnSerieLote").Visible = False + e.Row.FCButton("BtnSerie").Visible = False End If ''FUNCIONALIDAD PISTOLA DE CODIGOS @@ -744,10 +744,10 @@ Partial Class Inventarios_PaquetesArmadoDesarmado If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then - e.Row.FCButton("BtnSerieLote").Visible = True - e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°2", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) + e.Row.FCButton("BtnSerie").Visible = True + e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°2", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("Cantidad"), e.Row.DBCampo("Consec")) Else - e.Row.FCButton("BtnSerieLote").Visible = False + e.Row.FCButton("BtnSerie").Visible = False End If @@ -770,7 +770,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado DtDatosDetalle.Columns.Add("SeriePaquete", GetType(String)) End If End Sub - Protected Sub BtnSerieLote_Click(sender As Object, e As EventArgs) + Protected Sub BtnSerie_Click(sender As Object, e As EventArgs) Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c) diff --git a/Inventarios/PopUpBuscarMovto.aspx.vb b/Inventarios/PopUpBuscarMovto.aspx.vb index 92994df68..3880f05ec 100644 --- a/Inventarios/PopUpBuscarMovto.aspx.vb +++ b/Inventarios/PopUpBuscarMovto.aspx.vb @@ -49,27 +49,38 @@ Partial Class PopUpBuscarFolio CargaDatos() End Sub Private Sub CargaDatos() - Dim Reporte As New ClsInventarios + If ValidarFiltrosSeleccionados() Then + Dim Reporte As New ClsInventarios - Dim FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDate, MinFecha) - Dim FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDate, MaxFecha) - Dim FechaIngI = If(TxtFechaIngInicio.Text.Trim <> "" AndAlso TxtFechaIngInicio.Text <> "__/__/____", TxtFechaIngInicio.Text.ToDate, MinFecha) - Dim FechaIngF = If(TxtFechaIngFin.Text.Trim <> "" AndAlso TxtFechaIngFin.Text <> "__/__/____", TxtFechaIngFin.Text.ToDate, MaxFecha) + Dim FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text.ToDate, MinFecha) + Dim FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text.ToDate, MaxFecha) + Dim FechaIngI = If(TxtFechaIngInicio.Text.Trim <> "" AndAlso TxtFechaIngInicio.Text <> "__/__/____", TxtFechaIngInicio.Text.ToDate, MinFecha) + Dim FechaIngF = If(TxtFechaIngFin.Text.Trim <> "" AndAlso TxtFechaIngFin.Text <> "__/__/____", TxtFechaIngFin.Text.ToDate, MaxFecha) - If Reporte.GetMovimientosRep(DdlAlmacen.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, If(TxtFolio.Text = "", "-1", TxtFolio.Text.Trim).ToEntero, FechaIngI, FechaIngF, FechaInicial, FechaFinal, -1, UsuarioActual.CveEmpresa) Then - GvM.DataSource = Reporte.DtResultados - LtlTotalRegistros.Text = Reporte.DtResultados.Rows.Count.ToString.FormatoNumero(0) + If Reporte.GetMovimientosRep(DdlAlmacen.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, If(TxtFolio.Text = "", "-1", TxtFolio.Text.Trim).ToEntero, + FechaIngI, FechaIngF, FechaInicial, FechaFinal, -1, UsuarioActual.CveEmpresa, TopSelect:=100) Then + GvM.DataSource = Reporte.DtResultados + LtlTotalRegistros.Text = Reporte.DtResultados.Rows.Count.ToString.FormatoNumero(0) + Else + GvM.DataSource = Nothing + End If + + GvM.DataBind() + + UPDatos.Update() + TblBusqueda.Visible = True + Reporte.Dispose() Else - GvM.DataSource = Nothing + Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia) End If - - GvM.DataBind() - - UPDatos.Update() - TblBusqueda.Visible = True - Reporte.Dispose() End Sub + + Private Function ValidarFiltrosSeleccionados() As Boolean + If DdlAlmacen.SelectedValue.ToEntero > 0 Then Return True + If DdlTipoMovimiento.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Length > 0 Then Return True + Return False + End Function #End Region - End Class diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index 4f988dc7f..a0b53ff50 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -94,72 +94,78 @@ Partial Class Inventarios_Default End If End Sub Private Sub CargaDatos(CvePS As Integer, Tipo As Integer) - Dim ObjInventarios As New ClsInventarios() - If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then - Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") - If dr IsNot Nothing Then - LtPs.Text = $"Producto: {dr("PSCodigo").ToString}" - Dim CvePrecioLista As Integer = -1 - If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista - CvePrecioLista = -2 - End If + If ValidarFiltrosSeleccionados() Then + Dim ObjInventarios As New ClsInventarios() + If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), + ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero, TopSelect:=100) Then + Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") - Dim ObjVta As New ClsVentas - Dim objPS As New ClsProductosServicios - If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then - If ObjVta.DtResultados.Rows.Count > 0 Then - If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero - If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then - If objPS.DtResultados.Rows.Count > 0 Then - LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}" + If dr IsNot Nothing Then + LtPs.Text = $"Producto: {dr("PSCodigo").ToString}" + Dim CvePrecioLista As Integer = -1 + If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista + CvePrecioLista = -2 + End If + + Dim ObjVta As New ClsVentas + Dim objPS As New ClsProductosServicios + If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then + If ObjVta.DtResultados.Rows.Count > 0 Then + If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero + If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then + If objPS.DtResultados.Rows.Count > 0 Then + LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}" + End If End If End If End If + ObjVta.Dispose() + objPS.Dispose() + If UsuarioActual.CveEmpresa = 119 Then + If CBool(dr("AplicaIEPS")) Then + LtlIEPS.Visible = True + LtlIEPSPorcentaje.Visible = True + LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}" + Else + LtlIEPS.Visible = False + LtlIEPSPorcentaje.Visible = False + End If + If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then + LtlIVA.Visible = True + LtlIVAPorcentaje.Visible = True + LtlIVAPorcentaje.Text = $"Si" + Else + LtlIVA.Visible = False + LtlIVAPorcentaje.Visible = False + End If + End If End If - ObjVta.Dispose() - objPS.Dispose() - If UsuarioActual.CveEmpresa = 119 Then - If CBool(dr("AplicaIEPS")) Then - LtlIEPS.Visible = True - LtlIEPSPorcentaje.Visible = True - LtlIEPSPorcentaje.Text = $"% {(dr("IEPSPorcentaje").ToString.ToDouble * 100).FormatoNumero}" - Else - LtlIEPS.Visible = False - LtlIEPSPorcentaje.Visible = False - End If - If dr("IVA").ToString = "-1" OrElse dr("IVA").ToString.ToDecimal > 0 Then - LtlIVA.Visible = True - LtlIVAPorcentaje.Visible = True - LtlIVAPorcentaje.Text = $"Si" - Else - LtlIVA.Visible = False - LtlIVAPorcentaje.Visible = False - End If + + If UsuarioActual.CveUsuario = 100 Then + HlPendiente.Visible = True + HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS) + End If + + If ObjInventarios.DtResultados.Rows.Count > 0 Then + GV.DataSource = ObjInventarios.DtResultados + Else + GV.DataSource = Nothing + Dim Js = If(Tipo = 1, "", "window.setTimeout(Focus,200);") + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If End If - If UsuarioActual.CveUsuario = 100 Then - HlPendiente.Visible = True - HlPendiente.NavigateUrl = String.Format("/Inventarios/RepVentasXSurtir.aspx?CvePS={0}", CvePS) - End If + ObjInventarios.Dispose() + GV.DataBind() - If ObjInventarios.DtResultados.Rows.Count > 0 Then - GV.DataSource = ObjInventarios.DtResultados - Else - GV.DataSource = Nothing - Dim Js = If(Tipo = 1, "", "window.setTimeout(Focus,200);") - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) - End If + + + UPDatos.Update() + TblBusqueda.Visible = True + Else + Alert("Seleccione un producto o servicio", TipoMensaje.MsgAdvertencia) End If - - ObjInventarios.Dispose() - GV.DataBind() - - - - UPDatos.Update() - TblBusqueda.Visible = True End Sub Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -227,6 +233,7 @@ Partial Class Inventarios_Default End Sub Private Sub CargarDatosMedRin() + Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetExistenciasMedRin(DDlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlRin.SelectedValue.ToEntero, DdlMedidas.SelectedValue.ToEntero) Then GvMedRin.DataSource = ObjInventarios.DtResultados @@ -236,4 +243,9 @@ Partial Class Inventarios_Default UPDatos.Update() End Sub + Private Function ValidarFiltrosSeleccionados() As Boolean + If DDlPS.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + End Class diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 893e3be4c..d63df0d6a 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -479,7 +479,8 @@ Partial Class Inventarios_RecepcionAlmacen Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged If DdlAlmacen.SelectedValue <> "-1" Then - CargaCompra(CveCompraSurtir, CveProveedor) + + CargaGVInv() 'For Each Gvr As GridViewRow In GvInv.Rows ' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then ' Dim Dr As DataRow = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("") @@ -1018,7 +1019,7 @@ Partial Class Inventarios_RecepcionAlmacen CveImportacionSurtir = pCveImportacion CveImportacionProveedor = ddlProveedor.SelectedValue.ToEntero CveImportacionCompra = DdlFactura.SelectedValue.ToEntero - LbProveedor.Text = ObjCompras.DtResultados.Rows(0)("Aduanal").ToString + LbProveedor.Text = ObjCompras.DtResultados.Rows(0)("ProveedorCompra").ToString HLFolio.Text = ObjCompras.DtResultados.Rows(0)("PedimentoDescripcion").ToString If UsuarioActual.TienePermisoProceso(201) Then HLFolio.NavigateUrl = $"/Compras/Importaciones.aspx?CveImportacion={CveImportacionSurtir}" @@ -1263,7 +1264,7 @@ Partial Class Inventarios_RecepcionAlmacen If CBool(e.Row.DBCampo("AplicaSeccion")) Then e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True If DdlAlmacen.SelectedValue.ToEntero > 0 Then - e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero) + e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero) e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind() e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) End If @@ -2192,7 +2193,7 @@ Partial Class Inventarios_RecepcionAlmacen 'ENTRADA ALMACÉN CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, If(TipoMovimiento > 1, 13, 2), 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G") + MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1") If CveMovimiento > 0 Then InvFolio = ObjInventario.Folio.ToString Dim DtDetalle As New DataTable @@ -2311,7 +2312,7 @@ Partial Class Inventarios_RecepcionAlmacen CveMovtoSalidaDirecta = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G") + MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimiento, Remision:=TxtRemision.Text, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:="RA/G2") FolioSalidaDirecta = ObjInventario.Folio If Not CveMovtoSalidaDirecta > 0 Then @@ -2365,7 +2366,7 @@ Partial Class Inventarios_RecepcionAlmacen If CveVendedorActual = -1 Or (Dr("CveVendedor").ToString.ToEntero <> CveVendedorActual Or Dr("CveCliente").ToString.ToEntero <> CveClienteActual) Then CveMovtoSalidaActual = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), CveAlmacenDestino:=CveAlmacenDestino, MovimientoFijo:=True, CveVendedor:=Dr("CveVendedor").ToString.ToEntero, - CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G") + CveCliente:=Dr("CveCliente").ToString.ToEntero, Remision:=TxtRemision.Text, Modulo:="RA/G3") MovtosSalida.Add(CveMovtoSalidaActual) FoliosSalida.Add(ObjInventario.Folio) @@ -2447,7 +2448,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacenFiltro).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -2590,7 +2591,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G5") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows @@ -3048,7 +3049,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjContaAC As ClsContPAQi = Nothing 'ENTRADA ALMACÉN - CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 2, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveImportacionCompra, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=-1, Remision:=TxtRemision.Text, Modulo:="RA/G") + CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 2, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveImportacionCompra, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=-1, Remision:=TxtRemision.Text, Modulo:="RA/G6") If CveMovimiento > 0 Then InvFolio = ObjInventario.Folio.ToString Dim DtDetalle As New DataTable @@ -3099,12 +3100,13 @@ Partial Class Inventarios_RecepcionAlmacen End If Dim CvePrePoliza As Integer = 0 Dim UsaComplementariaCostoIndirecto As Boolean = False + Dim ConceptoPrePoliza As String = LbProveedor.Text If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaCostoIndirecto = False Dim PorcentajeCompraImportacion As Decimal = 0 ' si hay mas de una factura de importación saber lo que se está recibiendo 'SE REGISTRAN LAS PREPOLIZAS If Not ErrorMovInv Then - CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen CostoInd", 74, 0, 0, 1, FechaMovto, TxtObservaciones.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen CostoInd", 74, 0, 0, 1, FechaMovto, ConceptoPrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim DtTempCompras As DataTable = Nothing PorcentajeCompraImportacion = 1 If CveFleteSurtir > 0 Then diff --git a/Inventarios/RepMovimientosSalida.aspx b/Inventarios/RepMovimientosSalida.aspx index 4a75260b7..5a5fe95da 100644 --- a/Inventarios/RepMovimientosSalida.aspx +++ b/Inventarios/RepMovimientosSalida.aspx @@ -63,21 +63,68 @@ + +
    + + + +
    + +
    + + + + + + + + + +
    + + + -
    + -
    + +
    +
    +
    +
    + + Información: + +
    +
    +
    + +
    " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
    - +
    @@ -94,6 +141,13 @@ + + + + + + + diff --git a/Inventarios/RepMovimientosSalida.aspx.cs b/Inventarios/RepMovimientosSalida.aspx.cs index 399526c7f..c845da4e0 100644 --- a/Inventarios/RepMovimientosSalida.aspx.cs +++ b/Inventarios/RepMovimientosSalida.aspx.cs @@ -16,18 +16,50 @@ public partial class Inventarios_RepMovimientosSalida : ClsPaginas { txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString(); txtFechaF.Text = DateTime.Now.ToShortDateString(); + DdlSubProyecto.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa); + DdlSubProyecto.DataBind(); + + //Cargo Clasificaciones + DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa); + DdlClasificacion.DataBind(); + + DdlClientes.setEsWebService(true); + } private void Consulta() { + int tCveCliente = -1; + int tCveGrupo = -1; + if (DdlClientes.SelectedValue.ToEntero() > 0) tCveCliente = DdlClientes.SelectedValue.ToEntero(); + if (DdlGrupo.SelectedValue.ToEntero() > 0) tCveGrupo = DdlGrupo.SelectedValue.ToEntero(); + ClsInventarios ObjInv = new ClsInventarios(); - if (ObjInv.GetRepMovimientosSalida(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa)) + if (ObjInv.GetRepMovimientosSalida(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlSubProyecto.SelectedValue.ToEntero(), tCveCliente, DdlClasificacion.SelectedValue.ToEntero(), DdlGrupo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)) { - GvDatos.DataSource = ObjInv.DtResultados; + if (tCveGrupo == 1) + GvDatos.DataSource = ObjInv.DtResultados; + else + GvGrupo.DataSource = ObjInv.DtResultados; } ObjInv.Dispose(); GvDatos.DataBind(); + GvGrupo.DataBind(); UpDatos.Update(); + + if (DdlGrupo.SelectedValue == "1") + { + TbDetalle.Visible = true; + GvDatos.Visible = true; + GvGrupo.Visible = false; + } + else + { + TbDetalle.Visible = false; + GvDatos.Visible = false; + GvGrupo.Visible = true; + } + } protected void BtnConsultar_Click(object sender, EventArgs e) @@ -48,6 +80,25 @@ public partial class Inventarios_RepMovimientosSalida : ClsPaginas } + protected void GvGrupo_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + if (e.Row.RowIndex == 0) + { + e.Row.Cells[0].Text = "Total"; + e.Row.CssClass = "Totales"; + } + else + { + if (e.Row.DBCampo("Grupo2") == "" && e.Row.DBCampo("Grupo1") != "") + { + e.Row.CssClass = "SubTotales"; + } + } + } + } + public override void VerifyRenderingInServerForm(Control control) { //base.VerifyRenderingInServerForm(control); @@ -55,6 +106,14 @@ public partial class Inventarios_RepMovimientosSalida : ClsPaginas protected void LnkExcel_Click(object sender, EventArgs e) { - GvDatos.ExportToExcelG("Movimientos de Salida", "Movimientos de Salida", UsuarioActual); + if (DdlGrupo.SelectedValue == "1") + { + GvDatos.ExportToExcelG("Movimientos de Salida", "Movimientos de Salida", UsuarioActual); + } + else + { + GvGrupo.ExportToExcelG("Movimientos de Salida", "Movimientos de Salida", UsuarioActual); + } + } } \ No newline at end of file diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index 05c36bef0..a543fe7b5 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -208,7 +208,7 @@ - + diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index aad0f3987..debb185dc 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -84,22 +84,6 @@ Partial Class Inventarios_ResguardoMaterial End Property - Private Property DtSeccionAlmacen As DataTable - Get - Return CType(ViewState("DtSeccionAlmacen"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtSeccionAlmacen") = value - End Set - End Property - Private Property IndexSeccionAlmacen As Integer - Get - Return CType(ViewState("IndexSeccionAlmacen"), Integer) - End Get - Set(value As Integer) - ViewState("IndexSeccionAlmacen") = value - End Set - End Property Private Property CantidadTotal As Decimal Get Return CType(ViewState("CantidadTotal"), Decimal) @@ -174,7 +158,6 @@ Partial Class Inventarios_ResguardoMaterial GvM.DataBind() CantidadTotal = 0 - IndexSeccionAlmacen = 0 CvePS = 0 TipoSeccionAlmacen = 0 @@ -379,7 +362,7 @@ Partial Class Inventarios_ResguardoMaterial #End Region -#Region " EISTENCIAS " +#Region " EXISTENCIAS " Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional Serie As String = "-1") As Double Dim Inv As New ClsInventarios Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie) @@ -481,10 +464,10 @@ Partial Class Inventarios_ResguardoMaterial Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then - If DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {e.Row.RowIndex}").SUMD("CantidadSeccionAlmacen") > 0 Then - e.Row.FCLinkButton("lnkRemove").Visible = False - e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen" - End If + 'If DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {e.Row.RowIndex}").SUMD("CantidadSeccionAlmacen") > 0 Then + ' e.Row.FCLinkButton("lnkRemove").Visible = False + ' e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen" + 'End If End If End Sub #End Region @@ -502,7 +485,6 @@ Partial Class Inventarios_ResguardoMaterial DdlAlmacen.SelectedValueExist("-1") DdlAlmacenDestino.SelectedValueExist("-1") - DtSeccionAlmacen.Rows.Clear() TxtObservaciones.Text = "" TxtFecha.Text = Now.ToShortDateString @@ -595,8 +577,6 @@ Partial Class Inventarios_ResguardoMaterial FechaLiberacion = TxtFechaLiberacion.Text BtnGuardarLiberacion.Visible = True - DtSeccionAlmacen.Rows.Clear() - UpGeneralesLibreacion.Update() Else Alert("Ocurrió un error al cargar los resguardos del personal. Por favor vuelva a intentar.", TipoMensaje.MsgError) @@ -608,7 +588,7 @@ Partial Class Inventarios_ResguardoMaterial Private Sub CargaGvMLiberacion() GvM.Columns(5).Visible = False For Each Dr As DataRow In DtMovimientosLiberacion.Rows - If Dr("SerieLote").ToString <> "" Then + If Dr("Serie").ToString <> "" Then GvM.Columns(5).Visible = True Exit For End If @@ -633,8 +613,6 @@ Partial Class Inventarios_ResguardoMaterial LbFechaLiberacion.Text = "" FechaLiberacion = "" BtnGuardarLiberacion.Visible = False - DtSeccionAlmacen.Rows.Clear() - DdlAlmacenDestinoLiberacion.SelectedValue = "-1" TxtObservacionesLiberacion.Text = "" @@ -685,14 +663,6 @@ Partial Class Inventarios_ResguardoMaterial Alert(TextoExistencia.ToString, TipoMensaje.MsgError) End If - Dim TotalCantidad As Double = DtMovimientos.SUMD("Cantidad") - If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then - If TotalCantidad <> DtSeccionAlmacen.FiltraParametros("TipoSeccionAlmacen = 1").SUMD("CantidadSeccionAlmacen") Then - Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - End If - Guardar(23) End Sub @@ -724,13 +694,6 @@ Partial Class Inventarios_ResguardoMaterial Exit Sub End If - If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then - If TotalCantidad <> DtSeccionAlmacen.FiltraParametros("TipoSeccionAlmacen = 2").SUMD("CantidadSeccionAlmacen") Then - Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - End If - Guardar(24) @@ -777,7 +740,7 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Dr As DataRow In DtMovimientos.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -796,7 +759,7 @@ Partial Class Inventarios_ResguardoMaterial Else If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For @@ -824,7 +787,7 @@ Partial Class Inventarios_ResguardoMaterial Dim Cont As Integer = 0 For Each Gvr As GridViewRow In GvMLiberacion.Rows If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("SerieLote").ToString, Gvr.DataKey("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Gvr.DataKey("Observaciones").ToString) Then MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar." TieneError = True Exit For @@ -846,7 +809,7 @@ Partial Class Inventarios_ResguardoMaterial If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Cont = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Dr("Observaciones").ToString) Then TieneError = True MensajeError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 55ee7d78a..752c30d04 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -855,7 +855,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim Cont As Integer = 0 For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacenDestino").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then ErrorMovInv = True TextoError = "Ocurrió un error al guardar los movimientos de entrada" Exit For diff --git a/Metronic/assets/admin/layout/css/custom.css b/Metronic/assets/admin/layout/css/custom.css index 992599c9a..42984d0c5 100644 --- a/Metronic/assets/admin/layout/css/custom.css +++ b/Metronic/assets/admin/layout/css/custom.css @@ -2656,7 +2656,14 @@ select.select2-offscreen, select.select2-offscreen:focus { content: "Arrastre el archivo"; color: #808080; font-size: 30px; - margin-top: 80px; + margin-top: 15px; +} +.addropzone.dz-clickable:after { + position: absolute; + content: "o presione doble click"; + color: #808080; + font-size: 30px; + margin-top: 45px; } .mypaste { diff --git a/Nomina/Nomina.aspx.vb b/Nomina/Nomina.aspx.vb index 86a6aea16..5fca491c5 100644 --- a/Nomina/Nomina.aspx.vb +++ b/Nomina/Nomina.aspx.vb @@ -229,7 +229,7 @@ Partial Class Nomina_Nomina Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - If UsuarioActual.CveEmpresa = 80 OrElse UsuarioActual.CveEmpresa = 72 Then + If UsuarioActual.CveEmpresa = 80 OrElse UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 119 Then Response.Redirect("/Nomina/Nomina2.aspx") End If CargaTiposPeriodo() diff --git a/Nomina/Nomina2.aspx b/Nomina/Nomina2.aspx index 56dc52083..e5b598ad1 100644 --- a/Nomina/Nomina2.aspx +++ b/Nomina/Nomina2.aspx @@ -4,9 +4,10 @@ @@ -145,21 +150,21 @@
  • - Agregar CheckList
  • + Agregar checkList
  • - Cambiar Estatus
  • + Cambiar estatus
  • Agregar bitácora
  • - Agregar Tema
  • + Agregar tema
  • - Agregar Archivo
  • + Agregar archivo
  • - Actualizar Miembros
  • + Actualizar miembros
  • Reasignar
  • - Agregar Vinculo
  • + Agregar vinculo
  • Eliminar
  • @@ -361,7 +366,10 @@ Estatus: - + +
    + % +
    Avance: @@ -371,7 +379,7 @@
    - +
    @@ -520,10 +528,10 @@ Bitácora
    - +
    -
    Ventas MovimientosClasificación
    Producto
    U.M.Serie - LoteSerie Observaciones
    +
    - -
      - + - - - - - - - - - - - - - - -
    Tipo: - + + + + N° + + + + + + Personal + + + + + + Asistencia + + + + + + % de Pago + + + + + + Hrs Dobles + + + + + + Hrs Triples + + + + + + Motivo H. Extras + + -
    Periodo: - - -
    - -
    -
    + + + + + Obs. + + + + + + + + + +
    +
    + - + - + - + - +
    # Notación Notación
    1  Sin registrar asistencia Sin registrar asistencia
    2  Se registró asistencia Se registró asistencia
    3  Se registró asistencia y fue modificada Se registró asistencia y fue modificada
    - - - - - - N° - - - - - - Personal - - - - - - Asistencia - - - - - - % de Pago - - - - - - Hrs Dobles - - - - - - Hrs Triples - - - - - - Motivo H. Extras - - + + - diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index ad953a315..a0ce17f20 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -8,6 +8,8 @@ Imports System.IO Imports System.Data Imports Microsoft.Reporting.WebForms Imports System.Globalization +Imports System.Xml +Imports System.Web.Script.Services Partial Class RH_Personal Inherits ClsPaginas @@ -615,6 +617,136 @@ Partial Class RH_Personal #End Region + Private Shared Function sendURL(ByVal URL As String, Optional Methodo As String = "POST", Optional Cookie As String = "", Optional maxTimeMilliseconds As Integer = 120000) As String + Dim resultado As String = "" + + Try + Dim request As Net.HttpWebRequest = CType(Net.HttpWebRequest.Create(URL), Net.HttpWebRequest) + request.Timeout = maxTimeMilliseconds + request.Method = Methodo + request.ContentType = "text/html; charset=utf-8" '"text/xml; charset=utf-8" + + If Not String.IsNullOrEmpty(Cookie) Then + request.Headers.Add("Cookie", Cookie) + End If + + 'Using stream As IO.Stream = request.GetRequestStream() + + ' Using stmw As IO.StreamWriter = New IO.StreamWriter(stream) + ' stmw.Write("") + ' End Using + 'End Using + + Dim response As Net.WebResponse = CType(request.GetResponse(), Net.WebResponse) + Dim sr As IO.StreamReader = New IO.StreamReader(response.GetResponseStream()) + resultado = sr.ReadToEnd() + sr.Close() + Catch ex As Exception + ex.ToString().GuardaLog() + 'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}") + End Try + + Return resultado + End Function + ' + + Public Shared Function gettingCURP(ByVal Curp As String, year As Integer) As String + Dim abc As String() = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} + Dim numeric01 As String() = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} + Dim rule1 As String() = If(year < 2000, numeric01, abc) + Dim curpresult As String = "" + Dim i As Integer = 0 + While Curp.Length = 0 AndAlso i < rule1.Length + Dim z As Integer = 0 + While Curp.Length = 0 AndAlso z < numeric01.Length + curpresult = String.Format("{0}{1}{2}", Curp, rule1(i), numeric01(z)) + Dim respuesta As String = sendURL(String.Format("http://www.renapo.sep.gob.mx/wsrenapo/MainControllerParam?curp={0}", curpresult), "GET") + + Dim trlines As New List(Of String) + Dim keydict As New System.Collections.Concurrent.ConcurrentDictionary(Of String, String) + + Dim indexttr As Integer = 0 + Dim indexttrB As Integer = 0 + Dim indexttd As Integer = 0 + Dim indextdiv As Integer = 0 + Dim indexinittext As Integer = 0 + While Not IsNothing(respuesta) AndAlso respuesta.Length > 0 + indexttr = respuesta.IndexOf("= 0 Then + indexttrB = respuesta.Substring(indexttr + 3).IndexOf("= 0 Then + trlines.Add(respuesta.Substring(indexttr, indexttrB)) + Else + trlines.Add(respuesta.Substring(indexttr)) + + End If + respuesta = respuesta.Substring(indexttr + 3) + Else + respuesta = "" + End If + + End While + + Dim key As String = "" + Dim keyvalue As String = "" + For Each item As String In trlines + key = "" + keyvalue = "" + indexttd = item.IndexOf("= 0 Then + indexttr = indextdiv + indexttrB = item.IndexOf("= 0 Then + indexinittext = item.Substring(indexttr + 3).IndexOf(">") + key = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4))) + + item = item.Substring(indexttrB + 3) + Else + item = "" + End If + + If item.Length > 0 Then + + indexttd = item.IndexOf("= 0 Then + indexttr = indextdiv + indexttrB = item.IndexOf("= 0 Then + indexinittext = item.Substring(indexttr + 3).IndexOf(">") + keyvalue = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4))) + + item = item.Substring(indexttr + 3) + Else + item = "" + End If + + End If + If key.Length > 0 Then + keydict.TryAdd(key.Replace(":", "").Trim(), keyvalue.Trim().ToLower()) + End If + Next + Dim Apellido1 As String = "" : keydict.TryGetValue("Apellido1", Apellido1) + Dim Apellido2 As String = "" : keydict.TryGetValue("Apellido1", Apellido1) + Dim Nombres As String = "" : keydict.TryGetValue("Nombres", Nombres) + If Nombres Is Nothing OrElse Nombres.Length = 0 Then + curpresult = "" + End If + z = z + 1 + End While + i = i + 1 + End While + Return curpresult + End Function Const wdPageBreak As Integer = 7 Const wdCharacter As Integer = 1 @@ -624,6 +756,8 @@ Partial Class RH_Personal If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then pnlSalarioIMSS.Visible = False End If + ' + ViewState("Orden") = "" ViewState("Orden1") = "" @@ -2151,7 +2285,7 @@ Partial Class RH_Personal Private Sub CarcaConceptosNomina() Dim ObjPersonal As New ClsRH If ObjPersonal.GetPersonalConceptos(CvePersonal, UsuarioActual.CveEmpresa) Then - GVConceptos.DataSource = ObjPersonal.DtResultados + GVConceptos.DataSource = ObjPersonal.DtResultados.FiltraParametros("(CveSistema <>3 AND CveSistema <>4) OR CveSistema IS NULL") Dim frow As DataRow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =3") If Not IsNothing(frow) Then TxtInfoValor.Text = String.Format("{0:###,###.##}", frow("Importe")) @@ -2163,6 +2297,24 @@ Partial Class RH_Personal TxtInfoFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion")) ChkInfo.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE") End If + + + frow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =4") + TxtFonValor.Text = "" + DdlFonTipoAplicacion.SelectedValueExist("-1") + TxtFonDescripcion.Text = "" + TxtFonNumCredito.Text = "" + TxtFonFechaInicio.Text = "" + ChkFonacot.Checked = False + If Not IsNothing(frow) Then + TxtFonValor.Text = String.Format("{0:###,###.##}", frow("Importe")) + DdlFonTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString()) + + TxtFonDescripcion.Text = String.Format("{0}", frow("Descripcion02")) + TxtFonNumCredito.Text = String.Format("{0}", frow("Descripcion01")) + TxtFonFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion")) + ChkFonacot.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE") + End If Else GVConceptos.DataSource = Nothing End If @@ -5930,4 +6082,30 @@ Partial Class RH_Personal gvrow.FCTextBox("TxtPorPago").Text = "87.5" End If End Sub + Protected Sub LnkGuardarFonacot_Click(sender As Object, e As EventArgs) + Dim importe As Double = TxtFonValor.Text.ToDouble() + Dim TipoAplicacion As Integer = DdlFonTipoAplicacion.SelectedValue.ToEntero() + Dim NoPagos As Integer = 0 + Dim SaldoIni As Double = 0 + Dim descripcion02 As String = TxtFonDescripcion.Text + Dim descripcion01 As String = TxtFonNumCredito.Text + Dim fecha As String = TxtFonFechaInicio.Text.Replace("_", "") + Dim estatus As Integer = If(ChkFonacot.Checked, 1, 0) + + If fecha.Length > 8 Then + fecha = fecha.ToDateTime().ToString("yyyy/MM/dd") + Else + fecha = "" + End If + + Dim continuar As Boolean = True + + Using ObjPersonal As ClsRH = New ClsRH() + If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 4, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then continuar = False + End Using + + If continuar Then + Alert("Se actualizo el calculo de fonacot") + End If + End Sub End Class diff --git a/RH/PopUpBuscarPersonal.aspx.vb b/RH/PopUpBuscarPersonal.aspx.vb index e9d5cab16..eec974cf1 100644 --- a/RH/PopUpBuscarPersonal.aspx.vb +++ b/RH/PopUpBuscarPersonal.aspx.vb @@ -142,7 +142,6 @@ Partial Class RH_PopUpBuscarPersonal End Sub Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjPersonal As New ClsRH() Dim Codigo As String = "-1" Dim Nombre As String = "-1" @@ -161,26 +160,32 @@ Partial Class RH_PopUpBuscarPersonal Dim StrFiltroCaracteristica As String = GeneraFiltroCaracteristicas() - If ObjPersonal.GetPersonal2(-1, Codigo, Nombre, NSS, RFC, DdlTurnos.SelectedValue.ToEntero, DdlPuestos.SelectedValue.ToEntero, DdlDepartamentos.SelectedValue.ToEntero, + If ValidarFiltrosSeleccionado() Then + + Dim ObjPersonal As New ClsRH() + If ObjPersonal.GetPersonal2(-1, Codigo, Nombre, NSS, RFC, DdlTurnos.SelectedValue.ToEntero, DdlPuestos.SelectedValue.ToEntero, DdlDepartamentos.SelectedValue.ToEntero, DdlRuta.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, DdlEstadoCivil.SelectedValue.ToEntero, DdlGenero.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlClienteAsignado.SelectedValue.ToEntero, Horario, CveSupervisor, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", StrFiltroCaracteristica, 1, UsuarioActual.CveEmpresa) Then - If ObjPersonal.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjPersonal.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjPersonal.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ObjPersonal.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjPersonal.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjPersonal.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + + ObjPersonal.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjPersonal.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Private Function GeneraFiltroCaracteristicas() As String @@ -383,4 +388,29 @@ Partial Class RH_PopUpBuscarPersonal End If End Sub + + Private Function ValidarFiltrosSeleccionado() As Boolean + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtNombre.Text.Trim <> String.Empty Then Return True + If TxtNSS.Text.Trim <> String.Empty Then Return True + If TxtRFC.Text.Trim <> String.Empty Then Return True + If TxtHorarioDe.Text.Trim <> String.Empty Then Return True + + If DdlTipoPeriodo.SelectedValue.ToEntero > 0 Then Return True + If DdlTipoContrato.SelectedValue.ToEntero > 0 Then Return True + If DdlDepartamentos.SelectedValue.ToEntero > 0 Then Return True + If DdlGenero.SelectedValue.ToEntero > 0 Then Return True + If DdlEstadoCivil.SelectedValue.ToEntero > 0 Then Return True + If DdlEscolaridad.SelectedValue.ToEntero > 0 Then Return True + If DdlTurnos.SelectedValue.ToEntero > 0 Then Return True + If DdlClienteAsignado.SelectedValue.ToEntero > 0 Then Return True + If DdlProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlPuestos.SelectedValue.ToEntero > 0 Then Return True + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlRuta.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + + Return False + End Function + End Class diff --git a/Sistemas/CatSesiones.aspx b/Sistemas/CatSesiones.aspx index a5e1ae906..0f9885da8 100644 --- a/Sistemas/CatSesiones.aspx +++ b/Sistemas/CatSesiones.aspx @@ -1,68 +1,70 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSesiones.aspx.vb" Inherits="Sistemas_CatSesiones" %> - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSesiones.aspx.vb" Inherits="Sistemas_CatSesiones" %> + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +    -    -
    -
    - - -
    - - \ No newline at end of file + +    +
    +
    + + +
    + + diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb index 046bd3751..0b2111830 100644 --- a/Sistemas/CatSesiones.aspx.vb +++ b/Sistemas/CatSesiones.aspx.vb @@ -24,8 +24,6 @@ Partial Class Sistemas_CatSesiones CargaSubProyectos() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSubProyectosUsuarios" Then CargaSubProyectos() - ElseIf DdlVariable.SelectedItem.Value = "GlobalDTFolios" Then - CargaFolios() 'ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSucursales" Then ' CargaSucursales() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTCompProveedores" Then @@ -61,7 +59,7 @@ Partial Class Sistemas_CatSesiones ElseIf DdlVariable.SelectedItem.Value = "ProductosServicios" Then CargaProductosServicios() ElseIf DdlVariable.SelectedItem.Value = "PSSimplificado" Then - CargaProductosServiciossimplificado() + CargaProductosServiciosSimplificado() ElseIf DdlVariable.SelectedItem.Value = "CONAC" Then CargaCONAC() @@ -90,14 +88,16 @@ Partial Class Sistemas_CatSesiones ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATMotivoTraslado" Then CargaSATMotivoTraslado() ElseIf DdlVariable.SelectedItem.Value = "GlobalDTConceptosContables" Then - CargaConceptosContables() - ElseIf DdlVariable.SelectedItem.Value = "GlobalDTClasificacionPorcentaje" Then - CargaDTClasificacionPorcentaje() - End If - - - - + CargaConceptosContables() + ElseIf DdlVariable.SelectedItem.Value = "GlobalDTClasificacionPorcentaje" Then + CargaDTClasificacionPorcentaje() + ElseIf DdlVariable.SelectedItem.Value = "GlobalDTInvPSSeccionesAlmacen" Then + CargaDTInvPSSeccionesAlmacen() + End If + + + + End Sub Private Sub CargaConceptosContables() Dim ObjContabilidad As New ClsContabilidad @@ -341,18 +341,6 @@ Partial Class Sistemas_CatSesiones 'Fin Carga Proyectos End Sub - Private Sub CargaFolios() - 'Carga Folios - Dim ObjFolios As New ClsGralFolios() - If ObjFolios.GetFolios() Then - Application("GlobalDTFolios") = ObjFolios.DtResultados - Else - Application("GlobalDTFolios") = Nothing - End If - ObjFolios.Dispose() - 'Fin Carga Folios - End Sub - 'Private Sub CargaSucursales() ' 'Carga Sucursales ' Dim ObjSucursales As New ClsSucursales() @@ -377,8 +365,8 @@ Partial Class Sistemas_CatSesiones Private Sub CargaPaises() Dim Gral As New ClsGenerales - If Gral.GetGralPaises Then Application("GlobalDTGralPaises") = Gral.DtResultados Else Application("GlobalDTGralPaises") = Nothing - If Gral.GetClasificacionPorcentaje(-1, -1, -1, -1, 1) Then Application("GlobalDTClasificacionPorcentaje") = Gral.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing + If Gral.GetGralPaises Then Application("GlobalDTGralPaises") = Gral.DtResultados Else Application("GlobalDTGralPaises") = Nothing + If Gral.GetClasificacionPorcentaje(-1, -1, -1, -1, 1) Then Application("GlobalDTClasificacionPorcentaje") = Gral.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing Gral.Dispose() End Sub @@ -566,14 +554,18 @@ Partial Class Sistemas_CatSesiones ' Response.Redirect(dominio) 'End If LblTotal.Text = dominio - End Sub - - Private Sub CargaDTClasificacionPorcentaje() - - Dim ObjGenerales As New ClsGenerales - If ObjGenerales.GetClasificacionPorcentaje(-1) Then Application("GlobalDTClasificacionPorcentaje") = ObjGenerales.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing - ObjGenerales.Dispose() - - End Sub - + End Sub + + Private Sub CargaDTClasificacionPorcentaje() + + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetClasificacionPorcentaje(-1) Then Application("GlobalDTClasificacionPorcentaje") = ObjGenerales.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing + ObjGenerales.Dispose() + + End Sub + + Private Sub CargaDTInvPSSeccionesAlmacen() + GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing + End Sub + End Class diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 61757410e..376ee22cf 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -605,12 +605,12 @@ -
    +
    -
    +
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 1e4424463..ff52d9a63 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1667,7 +1667,7 @@ Partial Class Clientes End If TxtCorreoEntregaCompras.Text = ObjClientes.DtResultados(0)("CorreoEntregaCompras").ToString - TxtCorreoEntregaAlmacen.Text = ObjClientes.DtResultados(0)("CorreoEntregaCompras").ToString + TxtCorreoEntregaAlmacen.Text = ObjClientes.DtResultados(0)("CorreoEntregaAlmacen").ToString Else Existe = False Alert("El Cliente Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) @@ -5622,6 +5622,11 @@ Partial Class Clientes CobranzaTelefono = "" CodigoCliente = "" + If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then + divCorreoEntregaCompras.Visible = True + divCorreoEntregaAlmacen.Visible = True + End If + End Sub Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click diff --git a/Ventas/PopUpBuscarClientes.aspx.vb b/Ventas/PopUpBuscarClientes.aspx.vb index b1d247a43..7a988792a 100644 --- a/Ventas/PopUpBuscarClientes.aspx.vb +++ b/Ventas/PopUpBuscarClientes.aspx.vb @@ -54,7 +54,6 @@ Partial Class PopUpBuscarClientes End Sub Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjClientes As New ClsClientes() Dim Nombre As String = "-1" Dim Codigo As String = "-1" @@ -70,30 +69,37 @@ Partial Class PopUpBuscarClientes If TxtTelefono.Text.Trim <> String.Empty Then Telefono = TxtTelefono.Text.Trim If TxtMail.Text.Trim <> String.Empty Then Mail = TxtMail.Text.Trim - If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente) Then - If ObjClientes.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjClientes.DtResultados - If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then - GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (10450, 10460, 10458)") - LtlTotalRegistros.Text = "0" - ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then - GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (27448)") + If ValidarUnFiltroSeleccionado() Then + + Dim ObjClientes As New ClsClientes() + If ObjClientes.GetClientes(-1, Nombre, Codigo, NombreCorto, RFC, Telefono, Mail, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, + DdlEstatus.SelectedValue.ToEntero, TipoCliente:=TipoCliente, TopSelect:=100) Then + If ObjClientes.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjClientes.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjClientes.DtResultados + If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 Then + GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (10450, 10460, 10458)") + LtlTotalRegistros.Text = "0" + ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 Then + GV.DataSource = ObjClientes.DtResultados.FiltraParametros("CveCliente IN (27448)") + LtlTotalRegistros.Text = "0" + End If + Else LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If + + ObjClientes.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjClientes.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound @@ -127,4 +133,17 @@ Partial Class PopUpBuscarClientes e.Row.FCLiteral("LtlMail").Text = String.Format("
    {0}{1}
    ", Liga, e.Row.DBCampo("Mail")) End If End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtNombre.Text.Trim <> String.Empty Then Return True + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtNombreCorto.Text.Trim <> String.Empty Then Return True + If TxtRFC.Text.Trim <> String.Empty Then Return True + If TxtTelefono.Text.Trim <> String.Empty Then Return True + If TxtMail.Text.Trim <> String.Empty Then Return True + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + End Class diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index f5dc1d44e..960074304 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -88,7 +88,6 @@ Partial Class PopUpBuscarFolio Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click - Dim ObjVentas As New ClsVentas() Dim Serie As String = "-1" Dim Folio As Integer = -1 @@ -123,23 +122,31 @@ Partial Class PopUpBuscarFolio PeidoContrato = If(TxtPedidoContrato.Text.Length = 0, "-1", TxtPedidoContrato.Text.Trim) OrdenCompra = If(TxtOrdenCompra.Text.Length = 0, "-1", TxtOrdenCompra.Text.Trim) - If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1), DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then - LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0) - GV.DataSource = ObjVentas.DtResultados - Else - LtlTotalRegistros.Text = "0" - GV.DataSource = Nothing - Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + If ValidarUnFiltroSeleccionado() Then + + Dim ObjVentas As New ClsVentas() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, DdlTipoDocto.SelectedValue, Serie, Folio, Codigo, Cliente.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, + DdlEstatusFactura.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, FolioFiscal, If(DdlSucursalCliente.Visible, DdlSucursalCliente.SelectedValue.ToEntero, -1), + DdlPS.SelectedValue.ToEntero, PedidoContrato:=PeidoContrato, OrdenCompra:=OrdenCompra, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TopSelect:=100) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + LtlTotalRegistros.Text = ObjVentas.DtResultados.Rows.Count.ToString.FormatoNumero(0) + GV.DataSource = ObjVentas.DtResultados + Else + LtlTotalRegistros.Text = "0" + GV.DataSource = Nothing + Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) + End If End If + + ObjVentas.Dispose() + GV.DataBind() + + UPDatos.Update() + + TblBusqueda.Visible = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) End If - - ObjVentas.Dispose() - GV.DataBind() - - UPDatos.Update() - - TblBusqueda.Visible = True End Sub Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound @@ -271,4 +278,21 @@ Partial Class PopUpBuscarFolio DdlEstatusFactura.Items.Add(New ListItem("Todos", "-1")) DdlEstatusFactura.DataBind() End Sub + + Private Function ValidarUnFiltroSeleccionado() As Boolean + If DdlClasificacion.SelectedValue.ToEntero > 0 Then Return True + If DdlTipoDocto.SelectedValue <> "-1" Then Return True + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then Return True + If DdlEstatusFactura.SelectedValue.ToEntero > 0 Then Return True + If DdlUsuario.SelectedValue.ToEntero > 0 Then Return True + If DdlPS.SelectedValue.ToEntero > 0 Then Return True + If TxtFolio.Text.Trim.Length > 0 Then Return True + If DdlNombre.SelectedValue.ToEntero > 0 Then Return True + If TxtFolioFiscal.Text.Trim.Length > 0 Then Return True + If TxtPedidoContrato.Text.Length > 0 Then Return True + If TxtOrdenCompra.Text.Length > 0 Then Return True + + Return False + + End Function End Class diff --git a/Ventas/PopUpBuscarPs.aspx.vb b/Ventas/PopUpBuscarPs.aspx.vb index f5baa1e9e..986ee61da 100644 --- a/Ventas/PopUpBuscarPs.aspx.vb +++ b/Ventas/PopUpBuscarPs.aspx.vb @@ -64,18 +64,24 @@ Partial Class PopUpBuscarPs If TxtCodigoBarras.Text.Trim = "" Then CodigoBarras = "-1" Else CodigoBarras = TxtCodigoBarras.Text.Trim If TxtNombre.Text = "" Then Nombre = "-1" Else Nombre = TxtNombre.Text.ToUpper - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre, pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero, CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero) Then - GvDatos.DataSource = ObjPS.DtResultados - dvbusqueda.Visible = True - Else - GvDatos.DataSource = Nothing - dvbusqueda.Visible = False - End If - ObjPS.Dispose() + If ValidarUnFiltroSeleccionado() Then + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPS(-1, Ddlclasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Codigo:=Codigo, CodigoBarras:=CodigoBarras, PS:=Nombre, + pEstado:=DdlEstado.SelectedValue.ToEntero, CveTipoPS:=DdlCveTipoPS.SelectedValue.ToEntero, pAplicaParaVenta:=DdlAplicaVenta.SelectedValue.ToEntero, + CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, TopSelect:=100) Then + GvDatos.DataSource = ObjPS.DtResultados + dvbusqueda.Visible = True + Else + GvDatos.DataSource = Nothing + dvbusqueda.Visible = False + End If + ObjPS.Dispose() - GvDatos.DataBind() - GvDatos.UseAccessibleHeader = True + GvDatos.DataBind() + GvDatos.UseAccessibleHeader = True + Else + Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia) + End If End Sub #End Region @@ -91,6 +97,19 @@ Partial Class PopUpBuscarPs End Sub #End Region + Private Function ValidarUnFiltroSeleccionado() As Boolean + If TxtCodigo.Text.Trim <> String.Empty Then Return True + If TxtCodigoBarras.Text.Trim <> String.Empty Then Return True + If TxtNombre.Text.Trim <> String.Empty Then Return True + + If DdlCveTipoPS.SelectedValue.ToEntero > 0 Then Return True + If DdlEstado.SelectedValue.ToEntero > 0 Then Return True + If DdlAplicaVenta.SelectedValue.ToEntero > 0 Then Return True + If Ddlclasificacion.SelectedValue.ToEntero > 0 Then Return True + If DdlCompuesto.SelectedValue.ToEntero > 0 Then Return True + + Return False + End Function End Class diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx b/Ventas/RepCancelacionesPorRespuesta.aspx index 878847631..5d2d38310 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx +++ b/Ventas/RepCancelacionesPorRespuesta.aspx @@ -130,7 +130,7 @@
    -