diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index b6ad9ae04..d47cf410c 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -2407,7 +2407,7 @@ Partial Class AF_AF Dim filemove As String = "" For Each fileItem As Archivo In filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.filename Next diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 9575d4c06..ffbec5e23 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1133,7 +1133,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetMovimientosDetalle(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveCompra As Integer = -1) As Boolean + Public Function GetMovimientosDetalle(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveCompra As Integer = -1, Optional CveMovimientoDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_MovimientosDetalleGet") @@ -1141,6 +1141,7 @@ Public Class ClsInventarios .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb index 658e42ace..5bf90db2e 100644 --- a/App_Code/ClsOIEventos.vb +++ b/App_Code/ClsOIEventos.vb @@ -219,6 +219,294 @@ Public Class ClsOIEventos Public Property objCorreo As ObjEventosCorreo #End Region +#Region "Cuestionario" + + Public Function GetUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario As Integer, cveUsuario As Integer, CveSeguir As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoaUnoCuestionario_UsuariosGet", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (cveUnoaUnoCuestionario) + .Add("@CveSeguir", SqlDbType.Int).Value = (CveSeguir) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function UpUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario As Integer, cveUsuario As Integer, CveSeguir As Integer, conUser As Boolean) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoaUnoCuestionario_UsuarioUp", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (cveUnoaUnoCuestionario) + .Add("@CveSeguir", SqlDbType.Int).Value = (CveSeguir) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + .Add("@conUser", SqlDbType.Bit).Value = (conUser) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function AddUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario As Integer, cveUsuario As Integer, CveSeguir As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoaUnoCuestionario_UsuarioAdd", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (cveUnoaUnoCuestionario) + .Add("@CveSeguir", SqlDbType.Int).Value = (CveSeguir) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RemoveUnoaUnoCuestionario_Usuarios(cveUsuario As Integer, CveSeguir As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoaUnoCuestionario_UsuarioRemove", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSeguir", SqlDbType.Int).Value = (CveSeguir) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + Public Function GetUnoaUnoCuestionario(cveUnoaUnoCuestionario As Int32, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoaUnoCuestionarioGet", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (cveUnoaUnoCuestionario) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function GetUnoaUnoCuestionarioPreguntas(cveUnoaUnoCuestionario As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoaUnoCuestionarioPreguntasGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = cveUnoaUnoCuestionario + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function AddUnoaUnoCuestionario(Cuestionario As String, Comentario As String, CveUsuario As Integer, ListPreguntas As List(Of Integer)) As Boolean + Dim retorno As Boolean = False + + Dim xmlPreguntas As System.Xml.Linq.XDocument = Nothing + If ListPreguntas IsNot Nothing AndAlso ListPreguntas.Count > 0 Then + xmlPreguntas = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("Preguntas", ListPreguntas.[Select](Function(x) New System.Xml.Linq.XElement("CveUnoaUnoPregunta", x)))) + End If + DataAdapter("PA_OI_UnoaUnoCuestionarioAdd", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@Cuestionario", SqlDbType.VarChar).Value = (Cuestionario) + .Add("@Comentario", SqlDbType.VarChar).Value = (Comentario) + .Add("@CveUsuario", SqlDbType.Int).Value = (CveUsuario) + .Add("@xmlPreguntas", SqlDbType.Xml).Value = If(xmlPreguntas Is Nothing, DBNull.Value, DirectCast(xmlPreguntas.ToString(), Object)) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function UpUnoaUnoCuestionario(CveUnoaUnoCuestionario As Integer, Cuestionario As String, Comentario As String, CveUsuario As Integer, ListPreguntas As List(Of Integer)) As Boolean + Dim retorno As Boolean = False + + Dim xmlPreguntas As System.Xml.Linq.XDocument = Nothing + If ListPreguntas IsNot Nothing AndAlso ListPreguntas.Count > 0 Then + xmlPreguntas = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("Preguntas", ListPreguntas.[Select](Function(x) New System.Xml.Linq.XElement("CveUnoaUnoPregunta", x)))) + End If + DataAdapter("PA_OI_UnoaUnoCuestionarioUp", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (CveUnoaUnoCuestionario) + .Add("@Cuestionario", SqlDbType.VarChar).Value = (Cuestionario) + .Add("@Comentario", SqlDbType.VarChar).Value = (Comentario) + .Add("@CveUsuario", SqlDbType.Int).Value = (CveUsuario) + .Add("@xmlPreguntas", SqlDbType.Xml).Value = If(xmlPreguntas Is Nothing, DBNull.Value, DirectCast(xmlPreguntas.ToString(), Object)) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function RemoveUnoaUnoCuestionario(CveUnoaUnoCuestionario As Integer, CveUsuario As Integer) As Boolean + Dim retorno As Boolean = False + + DataAdapter("PA_OI_UnoaUnoRemoveCuestionario", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUnoaUnoCuestionario", SqlDbType.Int).Value = (CveUnoaUnoCuestionario) + .Add("@CveUsuario", SqlDbType.Int).Value = (CveUsuario) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el cuestionario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region +#Region "uno a uno" + Public Function GetUnoAUnoSiguiendoA(CveUsuario As Integer, CveUsuarioSeguidor As Integer, cveEmpresa As Integer, Optional Fechastr As String = "") As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoAUnoSiguiendoA", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUsuario", SqlDbType.Int).Value = (CveUsuario) + .Add("@CveUsuarioSeguidor", SqlDbType.Int).Value = (CveUsuarioSeguidor) + .Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + .Add("@Fechastr", SqlDbType.VarChar).Value = (Fechastr) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el UnoaUnoPregunta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetUnoaUnoPregunta(cveUnoaUnoPregunta As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_GetUnoaUnoPregunta", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveUnoaUnoPregunta", SqlDbType.Int).Value = (cveUnoaUnoPregunta) + .Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el UnoaUnoPregunta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function AddUnoaUnoPregunta(Pregunta As String, cveUnoaUnoPreguntaVinculo As Int32, CveUsuarioIng As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_AddUnoaUnoPregunta", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@Pregunta", SqlDbType.VarChar).Value = (Pregunta) + .Add("@cveUnoaUnoPreguntaVinculo", SqlDbType.Int).Value = (cveUnoaUnoPreguntaVinculo) + .Add("@CveUsuarioIng", SqlDbType.Int).Value = (CveUsuarioIng) + .Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el UnoaUnoPregunta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function UpUnoaUnoPregunta(cveUnoaUnoPregunta As Int32, Pregunta As String, cveUnoaUnoPreguntaVinculo As Int32, CveUsuarioIng As Int32, cveEmpresa As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UpUnoaUnoPregunta", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveUnoaUnoPregunta", SqlDbType.Int).Value = (cveUnoaUnoPregunta) + .Add("@Pregunta", SqlDbType.VarChar).Value = (Pregunta) + .Add("@cveUnoaUnoPreguntaVinculo", SqlDbType.Int).Value = (cveUnoaUnoPreguntaVinculo) + .Add("@CveUsuarioIng", SqlDbType.Int).Value = (CveUsuarioIng) + .Add("@cveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el UnoaUnoPregunta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RemoveUnoaUnoPregunta(cveUnoaUnoPregunta As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_RemoveUnoaUnoPregunta", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveUnoaUnoPregunta", SqlDbType.Int).Value = (cveUnoaUnoPregunta) + .Add("@cveEmpresa", SqlDbType.Int).Value = (CveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el UnoaUnoPregunta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function UnoAUnoTableroGet(cveEmpresa As Int32, fecha As String, cveUsuario As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoAUnoTableroGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@Fecha", SqlDbType.Date).Value = (fecha) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + .Add("@CveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Tablero Uno A Uno.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return retorno + End Function + Public Function UnoAUnoTableroAdd(cveEmpresa As Int32, fecha As String, cveUsuario As Int32, CveUnoaUnoPregunta As Integer, Comentarios As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_OI_UnoAUnoADD", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@Fecha", SqlDbType.Date).Value = (fecha) + .Add("@CveUsuario", SqlDbType.Int).Value = (cveUsuario) + .Add("@CveUnoaUnoPregunta", SqlDbType.Int).Value = (CveUnoaUnoPregunta) + .Add("@Comentarios", SqlDbType.VarChar).Value = (Comentarios) + .Add("@CveEmpresa", SqlDbType.Int).Value = (cveEmpresa) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Tablero Uno A Uno.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return retorno + End Function +#End Region #Region "Trello" Public Function GetTablero(cveTablero As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean Dim retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8a7db43d1..389d0dbed 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1182,11 +1182,11 @@ Public Class ClsPaginas ' Application("GlobalDTProductosServicios") = value ' End Set 'End Property - ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1) As DataTable + ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1, Optional Codigo As String = "-1") As DataTable Get Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPS(CvePS, -1, CveEmpresa, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then + If ObjPS.GetPS(CvePS, -1, CveEmpresa, Codigo:=Codigo, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then GlobalDTPS = ObjPS.DtResultados Else GlobalDTPS = Nothing @@ -3630,6 +3630,8 @@ Public Class ClsPaginas PaginaDict.Add("/OI/Proyecto.aspx".ToUpper(), -1) PaginaDict.Add("/OI/Tablero.aspx".ToUpper(), -1) PaginaDict.Add("/OI/TableroDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/UnoaUno.aspx".ToUpper(), -1) + PaginaDict.Add("/OI/UnoaUnoConfiguracion.aspx".ToUpper(), -1) PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), -1) PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), -1) PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 07867e7bf..7a8561d47 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -399,7 +399,8 @@ Public Class ClsProductosServicios Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1, Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", - Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False) As Integer + Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, + Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_ProductosServiciosAdd") @@ -473,6 +474,11 @@ Public Class ClsProductosServicios .Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad .Add("@Litraje", SqlDbType.Float).Value = Litraje .Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing + + .Add("@AplicaSerie", SqlDbType.Bit).Value = AplicaSerie + .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote + .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad + .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion End With Try @@ -620,6 +626,7 @@ Public Class ClsProductosServicios Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False) As Boolean + Dim Retorno As Boolean = False DataAdapter("PA_ProductosServiciosUpdate") @@ -699,7 +706,6 @@ Public Class ClsProductosServicios .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion - End With Try diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 7f7473927..1b799cb7d 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -68,6 +68,53 @@ Namespace Extensiones #End Region + Public Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable + GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + Dim excelFile As GemBox.Spreadsheet.ExcelFile = GemBox.Spreadsheet.ExcelFile.Load(flatFilePath) + + Dim unnamed As Integer = 0 + Dim cols As Integer + Dim columns As String() + Dim curRow As Integer = 0 + Dim curCol As Integer = 0 + Dim dataTable As DataTable = New DataTable() + Dim worksheet As GemBox.Spreadsheet.ExcelWorksheet = excelFile.Worksheets(0) + + For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 + + If firstRowHasHeaders Then + + If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then + dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) + Else + dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) + End If + + curRow = 1 + Else + dataTable.Columns.Add("Column " & (cols + 1)) + End If + Next + + While curRow < worksheet.Rows.Count + columns = New String(cols - 1) {} + + For curCol = 0 To cols - 1 + + If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then + columns(curCol) = "" + Else + columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() + End If + Next + + dataTable.Rows.Add(columns) + curRow += 1 + End While + + Return dataTable + End Function + Public Function CadenaConexion() As String Dim BaseDatos As String = "Ventas" 'If Not IsNothing(System.Web.HttpContext.Current) AndAlso Not IsNothing(System.Web.HttpContext.Current.Session) Then diff --git a/Bancos/CreditosPagoMultiple.aspx.vb b/Bancos/CreditosPagoMultiple.aspx.vb index 615b0c0b8..70a1873b4 100644 --- a/Bancos/CreditosPagoMultiple.aspx.vb +++ b/Bancos/CreditosPagoMultiple.aspx.vb @@ -216,7 +216,7 @@ Partial Class Bancos_CreditosPagoMultiple Dim filemove As String = "" Dim Comprobante As String = "" For Each fileItem As Archivo In filesgral - Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.filename Next diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 683b16d2f..62b657d9f 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -718,13 +718,15 @@ Partial Class Bancos_PagoElectronicoGrupos If SBErrores.ToString.Length > 0 Then Mensaje.Append("Errores Cuentas
") - Mensaje.Append("
") Mensaje.Append(SBErrores.ToString) Mensaje.Append("
") End If If NombreArchivoBancomer.Length > 0 Or NombreArchivoInterbancario.Length > 0 Then Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) + Else + Alert(Mensaje.ToString, TipoMensaje.MsgAdvertencia) End If @@ -1100,8 +1102,9 @@ Partial Class Bancos_PagoElectronicoGrupos End If + Else - + Alert(MENSAJEError.ToString, TipoMensaje.MsgAdvertencia) End If @@ -2417,7 +2420,7 @@ Partial Class Bancos_PagoElectronicoGrupos TipoMasiva = 2 GvProveedores.Columns(0).HeaderText = "Funcionario" CargaFyE() - BtnGenerarProveedores.Text = "Generar Layout Alta Funcionarios" + BtnGenerarProveedores.Text = "Generar LayoutBtnGenerarPago Alta Funcionarios" End If End Sub Protected Sub BtnGenerarProveedores_Click(sender As Object, e As EventArgs) diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index c27586b07..c608e31d7 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -978,7 +978,10 @@ Partial Class Bancos_PopIECompras Case 2 LblPagueseA.Text = "Beneficiario" - End Select + End Select + + + CargaCuentas() CargaCuentasDepositos() UpDatos.Update() @@ -3335,51 +3338,57 @@ Partial Class Bancos_PopIECompras Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") End Sub - Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) - Try - Dim Msg As String = "" - If NombreArchivo <> "-1" Then ' - - Dim ObjMail As New ClsSisMail() - Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo) - Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo) - - Dim Cuerpo As String = "Se hace entrega del comprobante de pago" - Dim Asunto As String = "Entrega de comprobante de pago" - - If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then - - Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) - - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF}) - LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML}) - - If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then - - If ConAlerta Then - RegistraScript("$('#ModalDivMail').modal('hide');") - Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) - End If - - Else - Msg = "No se pudo enviar el correo electrónico." - End If - - Else - Msg = "No se pudo adjuntar el correo electrónico." - End If - - End If - - If ConAlerta AndAlso Msg <> "" Then - Alert(Msg, TipoMensaje.MsgError) - End If + Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True) + + If Not DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then + Try + + Dim Msg As String = "" + If NombreArchivo <> "-1" Then ' + + Dim ObjMail As New ClsSisMail() + Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo) + Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo) + + Dim Cuerpo As String = "Se hace entrega del comprobante de pago" + Dim Asunto As String = "Entrega de comprobante de pago" + + If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then + + Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) + + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF}) + LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML}) + + If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then + + If ConAlerta Then + RegistraScript("$('#ModalDivMail').modal('hide');") + Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) + End If + + Else + Msg = "No se pudo enviar el correo electrónico." + End If + + Else + Msg = "No se pudo adjuntar el correo electrónico." + End If + + End If + + If ConAlerta AndAlso Msg <> "" Then + Alert(Msg, TipoMensaje.MsgError) + End If + + + Catch ex As Exception + OnError("Ocurrió error al mandar MAIL", ex) + + End Try + End If - Catch ex As Exception - OnError("Ocurrió error al mandar MAIL", ex) - - End Try End Sub #End Region diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 9bfc2c3e8..1f79da289 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -2377,10 +2377,23 @@ Partial Class Bancos_ProveedoresAbonar 'cuando es cheque If DdlTipoTransaccion.SelectedValue = "1" Then ChkAbonoCuenta.Visible = True + + Else ChkAbonoCuenta.Visible = False End If + If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then + ChkEnviarCorreo.Enabled = False + ChkEnviarCorreo.Checked = False + Else + ChkEnviarCorreo.Enabled = True + ChkEnviarCorreo.Checked = True + End If + + + + CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) RecargaCuentasDepositos() diff --git a/Bancos/RepSaldosDetalle.aspx b/Bancos/RepSaldosDetalle.aspx index 6c2f52af6..9b1f0539e 100644 --- a/Bancos/RepSaldosDetalle.aspx +++ b/Bancos/RepSaldosDetalle.aspx @@ -6,25 +6,49 @@
  • - Generar
  • + Excel
    - Reporte de Saldos Bancarios Detalle -  + Reporte de Saldos Bancarios Detalle
  • - Imprimir + PDF

  • -
    +
    + Banco: +
    +
    + +
    +
    + Cuenta: +
    +
    + +
    +
    + Fecha Inicial: +
    +
    + +
    +
    + Fecha Fin: +
    +
    + +
    +
    - +

    diff --git a/Bancos/RepSaldosDetalle.aspx.vb b/Bancos/RepSaldosDetalle.aspx.vb index 620ae912b..3ecb33a4d 100644 --- a/Bancos/RepSaldosDetalle.aspx.vb +++ b/Bancos/RepSaldosDetalle.aspx.vb @@ -155,6 +155,9 @@ Partial Class Bancos_RepSaldosDetalle Cuenta = dr("NumCuenta").ToString CLABE = dr("CLABE").ToString Banco = dr("Banco").ToString + lbBancoNombre.Text = Banco + LblFechaI.Text = FechaInicio + LblFechaF.Text = FechaFin If CveCuenta > 0 Then LblCuenta.Text = dr("NumCuenta").ToString LblSaldoInicial.Text = dr("SaldoInicial").ToString.ToDouble.FormatoNumero @@ -174,13 +177,15 @@ Partial Class Bancos_RepSaldosDetalle End Sub Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click - GvS.ExportToExcel("ReporteSaldos" & Now.ToShortDateString) + ImprimirReporte("Excel") End Sub - - #Region "P D F" Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click + ImprimirReporte("PDF") + End Sub + + Private Sub ImprimirReporte(formato As String) 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) @@ -215,7 +220,7 @@ Partial Class Bancos_RepSaldosDetalle params.Add(New ReportParameter("LogoPath", "")) End If - ImprimirPDF("Empresas/Grales/Formatos/RepSaldosDetalle.rdlc", dt, params, "RepSaldosDetalle") + ImprimirPDF("Empresas/Grales/Formatos/RepSaldosDetalle.rdlc", dt, params, "RepSaldosDetalle", Formato:=formato) Ban.Dispose() End Sub diff --git a/Bancos/Reportes.aspx.vb b/Bancos/Reportes.aspx.vb index 5d0cb6b33..b96bf50c4 100644 --- a/Bancos/Reportes.aspx.vb +++ b/Bancos/Reportes.aspx.vb @@ -141,7 +141,7 @@ Partial Class Bancos_Reportes rv.LocalReport.DataSources.Clear() rv.LocalReport.DataSources.Add(rds) rv.LocalReport.DataSources.Add(rds2) - rv.LocalReport.ReportPath = ModExtensiones.DirectorioBaseEmpresas & "Bancos\Reportes\rptChequeMovimientos.rdlc" + rv.LocalReport.ReportPath = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\rptChequeMovimientos.rdlc" rv.LocalReport.Refresh() Dim paramList As New List(Of ReportParameter) diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 0d11cf687..6e1e76ea6 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -2625,7 +2625,7 @@ Partial Class Compras_Proveedores Dim filemove As String = "" For Each fileItem As Archivo In filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.filename Next @@ -2871,7 +2871,7 @@ Partial Class Compras_Proveedores Try - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) diff --git a/Empresas/72/Formatos/ConsumoInterno.rdlc b/Empresas/72/Formatos/ConsumoInterno.rdlc index 4f83b35f6..cf6d31666 100644 --- a/Empresas/72/Formatos/ConsumoInterno.rdlc +++ b/Empresas/72/Formatos/ConsumoInterno.rdlc @@ -6,19 +6,22 @@ - 1.08025cm + 1.10177cm - 2.86537cm + 2.88689cm - 10.83004cm + 7.80282cm - 2.36735cm + 2.38887cm - 2.1384cm + 2.86584cm + + + 2.15992cm @@ -169,7 +172,7 @@ - Serie/Lote + Serie + + + + + + Textbox4 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -356,14 +404,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -1645,8 +1726,12 @@ Almacen System.String - - SerieLote + + Serie + System.String + + + SeccionAlmacen System.String diff --git a/Empresas/72/Formatos/DevolucionCliente.rdlc b/Empresas/72/Formatos/DevolucionCliente.rdlc index ba12d2d1f..b04d46e3c 100644 --- a/Empresas/72/Formatos/DevolucionCliente.rdlc +++ b/Empresas/72/Formatos/DevolucionCliente.rdlc @@ -6,19 +6,22 @@ - 1.4138cm + 1.08751cm 2.86537cm - 7.90885cm + 5.59405cm 2.36735cm - 2.7734cm + 2.92336cm + + + 2.35004cm @@ -169,7 +172,7 @@ - Serie/Lote + Serie + + + + + + Textbox17 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -350,14 +398,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -366,7 +414,37 @@ + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -419,6 +497,7 @@ + @@ -435,7 +514,7 @@ 0.17639cm 0.12931cm 0.96717cm - 17.32877cm + 17.18768cm @@ -667,7 +746,7 @@ 1.28125in + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + @@ -382,14 +429,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -400,7 +447,39 @@ - SerieLote1 + Serie + + + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "1pt", "0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + + + + SeccionAlmacen @@ -423,6 +502,7 @@ + @@ -1014,8 +1094,12 @@ Almacen System.String - - SerieLote + + Serie + System.String + + + SeccionAlmacen System.String diff --git a/Empresas/72/Formatos/EntradaGarantia.rdlc b/Empresas/72/Formatos/EntradaGarantia.rdlc index 82e7a4f82..1232b8f04 100644 --- a/Empresas/72/Formatos/EntradaGarantia.rdlc +++ b/Empresas/72/Formatos/EntradaGarantia.rdlc @@ -6,19 +6,22 @@ - 1.4138cm + 1.19235cm - 2.86537cm + 2.76934cm - 7.90885cm + 6.51065cm 2.36735cm - 2.7734cm + 2.8175cm + + + 1.6716cm @@ -169,7 +172,7 @@ - Serie/Lote + Serie + + + + + + Textbox10 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -214,7 +262,7 @@ - Unidad Medida + U. M. @@ -366,7 +414,37 @@ + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -419,6 +497,7 @@ + @@ -435,7 +514,7 @@ 0.17639cm 0.09031cm 0.96717cm - 17.32877cm + 17.32879cm @@ -458,7 +537,7 @@ 0.54167in + + + + + + Textbox17 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -214,7 +262,7 @@ - Unidad Medida + U.M. @@ -366,7 +414,37 @@ + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -419,6 +497,7 @@ + @@ -435,7 +514,7 @@ 0.17639cm 0.12931cm 0.96717cm - 17.17002cm + 17.12418cm @@ -1523,8 +1602,12 @@ Almacen System.String - - SerieLote + + Serie + System.String + + + SeccionAlmacen System.String diff --git a/Empresas/72/Formatos/Entradas.rdlc b/Empresas/72/Formatos/Entradas.rdlc index 5a9ef0bb3..beab2af56 100644 --- a/Empresas/72/Formatos/Entradas.rdlc +++ b/Empresas/72/Formatos/Entradas.rdlc @@ -12,13 +12,16 @@ 2.06688cm - 7.9493cm + 6.26873cm - 2.51129cm + 1.69187cm - 1.43594cm + 2.8175cm + + + 1.11844cm 1.56514cm @@ -175,7 +178,7 @@ - Serie/Lote + Serie + + + + + + Textbox1 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -454,14 +502,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -787,7 +868,7 @@ 1.75444in + + + + + + Textbox2 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -448,14 +496,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -464,7 +512,37 @@ + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -589,6 +667,7 @@ + @@ -783,7 +862,7 @@ 1.83333in + + + + + + Textbox45 + + + + + + + + + Silver + 2pt + 2pt + 2pt + + + + @@ -590,7 +634,7 @@ - =Fields!SerieLote.Value + =Fields!Serie.Value + + + + + + SeccionAlmacen + + + =IIF(RowNumber(nothing) Mod 2 = 0,"LightGrey","White") + 2pt + 2pt + 2pt + 2pt + + + + @@ -737,6 +815,7 @@ + @@ -2104,8 +2183,12 @@ PS System.String - - SerieLote + + Serie + System.String + + + SeccionAlmacen System.String diff --git a/Empresas/72/Formatos/Salidas.rdlc b/Empresas/72/Formatos/Salidas.rdlc index 6d8f328e2..41362ace5 100644 --- a/Empresas/72/Formatos/Salidas.rdlc +++ b/Empresas/72/Formatos/Salidas.rdlc @@ -6,19 +6,22 @@ - 1.08025cm + 1.04906cm 2.86537cm - 10.83004cm + 8.0952cm 2.36735cm - 2.1384cm + 2.73484cm + + + 2.16959cm @@ -169,7 +172,7 @@ - Serie/Lote + Serie + + + + + + Textbox1 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -356,14 +404,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + + + + + + + Textbox3 + + + + + 1pt + + + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -348,14 +395,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -364,7 +411,38 @@ + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -489,7 +568,7 @@ 1.76239in + + + + + + Textbox10 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + @@ -350,14 +398,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -366,7 +414,37 @@ + + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + @@ -419,6 +497,7 @@ + @@ -435,7 +514,7 @@ 0.17639cm 0.09031cm 0.96717cm - 17.32877cm + 17.32879cm @@ -458,7 +537,7 @@ 0.54167in + + + + + + Textbox10 + + + + Black + + 1pt + + + Black + + 1pt + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + @@ -401,14 +449,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -419,7 +467,40 @@ - SerieLote + Serie + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + + + + SeccionAlmacen @@ -443,6 +524,7 @@ + @@ -459,7 +541,7 @@ 0.07056cm 0.03488cm 0.92264cm - 20.29478cm + 20.18483cm @@ -545,8 +627,8 @@ Textbox31 - 1.15947cm - 2.85732cm + 1.13431cm + 2.8926cm 0.90014cm 17.46676cm 3 @@ -1564,8 +1646,12 @@ Almacen System.String - - SerieLote + + Serie + System.String + + + SeccionAlmacen System.String diff --git a/Empresas/72/Formatos/TrasladoAlmacen.rdlc b/Empresas/72/Formatos/TrasladoAlmacen.rdlc index 00ae4fedc..1714ac257 100644 --- a/Empresas/72/Formatos/TrasladoAlmacen.rdlc +++ b/Empresas/72/Formatos/TrasladoAlmacen.rdlc @@ -6,7 +6,7 @@ - 1.37635cm + 1.03892cm 1.74824cm @@ -15,21 +15,24 @@ 1.41283cm - 8.7207cm + 7.13876cm - 2.50488cm + 2.21384cm + + + 2.51239cm 2.15376cm - 2.60235cm + 2.07958cm - 0.51314cm + 1.01502cm @@ -229,7 +232,7 @@ - Serie/Lote + Serie + + + + + + Textbox2 + + + + Black + + 1pt + + + Black + + 1pt + + #0e2455 + 2pt + 2pt + 2pt + 2pt + + + + @@ -497,14 +545,14 @@ - + true true - =Fields!SerieLote.Value + =Fields!Serie.Value @@ -515,7 +563,40 @@ - SerieLote + Serie + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + + + + + true + true + + + + + =Fields!SeccionAlmacen.Value + + + + + + + SeccionAlmacen @@ -772,6 +853,40 @@ + + + + true + true + + + + + + + + + + + + Textbox15 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + @@ -1026,6 +1141,40 @@ + + + + true + true + + + + + + + + + + + + Textbox18 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + @@ -1280,6 +1429,40 @@ + + + + true + true + + + + + + + + + + + + Textbox42 + + + Bottom + 2pt + 2pt + =IIf(rownumber(nothing) = 1, "2pt", "0pt") + + + + @@ -1371,6 +1554,7 @@ + @@ -1395,8 +1579,8 @@ DsInventarios 0.07056cm 0.03488cm - 2.80201cm - 20.51911cm + 3.30389cm + 20.29832cm @@ -1504,7 +1688,7 @@ 1.68587in @@ -50,7 +50,7 @@ - 0.62012cm + 1.25512cm 0.22583cm 0cm 17.79586cm @@ -65,16 +65,16 @@ - 3.65719cm + 2.95132cm - 3.49856cm + 2.94294cm 1.44923cm - 1.99986cm + 1.5894cm 2.68423cm @@ -82,6 +82,9 @@ 2.54257cm + + 1.5217cm + 2.19006cm @@ -288,6 +291,39 @@ + + + + true + true + + + + + Estatus + + + + Textbox5 + + + Silver + 2pt + 2pt + 2pt + 2pt + + + + @@ -531,6 +567,40 @@ + + + + true + true + + + + + =iif(Fields!Estatus.Value="1","Activo","Inactivo") + + + + + + + Estatus + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -578,6 +648,7 @@ + @@ -591,9 +662,9 @@ DataSet1 - 0.79651cm + 1.43151cm 1.16648cm - 18.02169cm + 17.87145cm 2 + + true + true + + + + + Cliente: + HTML + + + + =Parameters!Cliente.Value + HTML + + + + + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + - 0.86559in + 1.13642in - Textbox11 @@ -958,6 +1079,10 @@ FechaIng System.String + + Estatus + System.String + DataSet @@ -994,6 +1119,12 @@ true ReportParameter1 + + String + true + true + ReportParameter1 + Cm 40c94aad-a12a-44fb-ab0d-ea36a9656792 diff --git a/Empresas/Grales/Formatos/RepSaldosDetalle.rdlc b/Empresas/Grales/Formatos/RepSaldosDetalle.rdlc index fdd9645ea..67c6632b2 100644 --- a/Empresas/Grales/Formatos/RepSaldosDetalle.rdlc +++ b/Empresas/Grales/Formatos/RepSaldosDetalle.rdlc @@ -5,7 +5,7 @@ 0.08792cm 0cm - 20.43968cm + 19.02093cm @@ -16,31 +16,31 @@ - 1cm + 0.99817cm - 1.7cm + 0.89235cm - 1.6439cm + 1.64207cm - 6.48678cm + 6.29065cm - 2.63648cm + 2.28597cm - 1.29cm + 1.28817cm - 1.83034cm + 1.82851cm - 1.70625cm + 1.70442cm - 2.02375cm + 2.02192cm @@ -473,7 +473,7 @@ - 0.6cm + 0.83813cm @@ -803,8 +803,8 @@ DataSet1 0.36336cm 0.06868cm - 1.06771cm - 20.3175cm + 1.30584cm + 18.95225cm 1 - 0.60091in + 0.79883in - Textbox1 @@ -979,7 +981,7 @@ Textbox13 0.11854cm - 16.8543cm + 15.48905cm 1.76352cm 3.53188cm 3 @@ -1038,7 +1040,7 @@ Textbox13 2.41272cm - 15.92826cm + 14.56301cm 0.52945cm 4.45792cm 4 @@ -1110,7 +1112,7 @@ 0.11437cm 0.10583cm 0cm - 20.33385cm + 18.9151cm @@ -1266,7 +1268,7 @@ Textbox3 0.22726cm - 18.32031cm + 16.95506cm 0.36335cm 2.06587cm 5 diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index de9a07d40..9fcbd9d2b 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -618,7 +618,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas { try { - FileExtension = System.IO.Path.GetExtension(string.Format("{0}Temp\\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", ""); + FileExtension = System.IO.Path.GetExtension(string.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); string rutaDestino = UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\" + CvePaqueteriaGuia + "." + FileExtension; if (!System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\")) { diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx index 9056f3383..795fb5427 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -1,70 +1,124 @@ <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="AjustesSeccionAlmacen.aspx.vb" Inherits="Inventarios_AjustesSeccionAlmacen" %> - + - + - + Ajustes de Productos en Secciones de Almacen - + - + + + +
  • + Importar Listado +
  • +
  • + Descargar Formato +
  • +
    + + + +
    - + - - - -
    -
    -
    - -
    -
    - - -
    - -
    - - -
    - -
    - -
    -
    + + + +
    +
    +
    + +
    +
    + + +
    +
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - + +
    + +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 0e11ceb67..db2791104 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -1,144 +1,340 @@ - -Imports System.Data -Imports Extensiones - -Partial Class Inventarios_AjustesSeccionAlmacen - Inherits ClsPaginas - - Private Sub Inventarios_AjustesSeccionAlmacen_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not Page.IsPostBack Then - CargaCombos() - End If - End Sub - - Private Sub CargaCombos() - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - DdlAlmacen.DataBind() - - DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - DdlClasificaciones.DataBind() - DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1")) - End Sub - - Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click - CargaDatos() - End Sub - - Private Sub CargaDatos() - Dim ObjInv As New ClsInventarios - - If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvD.DataSource = ObjInv.DtResultados - End If - - ObjInv.Dispose() - GvD.DataBind() - UppD.Update() - End Sub - - Private Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvD.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - - e.Row.FCDropDownList("DDlS").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero) - e.Row.FCDropDownList("DDlS").DataBind() - - End If - End Sub - - Private Sub BtnCambiarSeccion_Click(sender As Object, e As EventArgs) Handles BtnCambiarSeccion.Click - Dim ObjInventario As New ClsInventarios - Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL) - Dim Dtt As DataTable = Nothing - Dim CveMovimientoEntrada As Integer = 0 - Dim Folio = 0 - Dim ErrorMovInv As Boolean = False - Dim TextoError = "" - Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero - - - - Dim Fecha As Date = DateTime.Now - 'AGREGAMOS LA ENTRADA - Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, - Observaciones:="", Modulo:="ASA/G1") - Folio = ObjInventario.Folio - - If CveMovimientoSalida <= 0 Then - TextoError = "No se pudo generar el movimiento de salida correctamente" - ErrorMovInv = True - Else - - Dim CveMovimientoDetalleEntrada As Integer = 0 - Dim Cont As Integer = 0 - For Each gvr As GridViewRow In GvD.Rows - - 'que este seleccionado y que tenga diferente seccion - If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCDropDownList("DDlS").SelectedValue.ToEntero <> gvr.DataKey("CveSeccionAlmacen").ToEntero Then - - If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then - ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True) - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de salida" - Exit For - End If - - End If - - Next - - If Not ErrorMovInv Then - - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - - Dim resultado As DataTable = ObjInventario.DtResultados - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ASA/G1") - Dim ind As Integer = 0 - - For Each Row As DataRow In resultado.Rows - Dim CvePS = Row("CvePS").ToString().ToEntero() - Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() - Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal() - Dim CveUM As Integer = Row("CveUM").ToString().ToEntero() - Dim CveSeccionAlmacen As Integer = GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero() - Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal() - Dim Serie As String = Row("Serie").ToString() - Dim Lote As String = Row("Lote").ToString() - Dim FechaCaducidad As Date = IfNull(Row("FechaCaducidad"), MinFecha).ToString.ToDate - - 'actualizamos el PS, para que tenga el aplica seccion - - ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True) - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then - ErrorMovInv = True - Exit For - End If - ind += 1 - Next - resultado.Dispose() - - Else - TextoError = "No se pudo registrar el movimiento" - ErrorMovInv = True - End If - - End If - - End If - - - If Not ErrorMovInv Then - ObjInventario.Commit() - cargadatos - Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion) - Else - ObjInventario.RollBack() - Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgError) - End If - - ObjInventario.Dispose() - End Sub -End Class + +Imports System.Data +Imports Extensiones + +Partial Class Inventarios_AjustesSeccionAlmacen + Inherits ClsPaginas + + Private Sub Inventarios_AjustesSeccionAlmacen_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + End If + End Sub + + Private Sub CargaCombos() + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacen.DataBind() + + DdlAlmacenExcel.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacenExcel.DataBind() + + DdlClasificaciones.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificaciones.DataBind() + DdlClasificaciones.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + Private Sub CargaDatos() + Dim ObjInv As New ClsInventarios + + If ObjInv.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvD.DataSource = ObjInv.DtResultados + End If + + ObjInv.Dispose() + GvD.DataBind() + UppD.Update() + End Sub + + Private Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvD.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + e.Row.FCDropDownList("DDlS").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero) + e.Row.FCDropDownList("DDlS").DataBind() + + End If + End Sub + + Private Sub BtnCambiarSeccion_Click(sender As Object, e As EventArgs) Handles BtnCambiarSeccion.Click + Dim ObjInventario As New ClsInventarios + Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL) + Dim Dtt As DataTable = Nothing + Dim CveMovimientoEntrada As Integer = 0 + Dim Folio = 0 + Dim ErrorMovInv As Boolean = False + Dim TextoError = "" + Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero + + + + Dim Fecha As Date = DateTime.Now + 'AGREGAMOS LA ENTRADA + Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacen, 3, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, + Observaciones:="", Modulo:="ASA/G1") + Folio = ObjInventario.Folio + + If CveMovimientoSalida <= 0 Then + TextoError = "No se pudo generar el movimiento de salida correctamente" + ErrorMovInv = True + Else + + Dim CveMovimientoDetalleEntrada As Integer = 0 + Dim Cont As Integer = 0 + For Each gvr As GridViewRow In GvD.Rows + + 'que este seleccionado y que tenga diferente seccion + If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCDropDownList("DDlS").SelectedValue.ToEntero <> gvr.DataKey("CveSeccionAlmacen").ToEntero Then + + If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then + ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True) + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then + ErrorMovInv = True + TextoError = "Ocurrió un error al guardar los movimientos de salida" + Exit For + End If + + End If + + Next + + If Not ErrorMovInv Then + + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then + + Dim resultado As DataTable = ObjInventario.DtResultados + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ASA/G1") + Dim ind As Integer = 0 + + For Each Row As DataRow In resultado.Rows + Dim CvePS = Row("CvePS").ToString().ToEntero() + Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal() + Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal() + Dim CveUM As Integer = Row("CveUM").ToString().ToEntero() + Dim CveSeccionAlmacen As Integer = GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero() + Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal() + Dim Serie As String = Row("Serie").ToString() + Dim Lote As String = Row("Lote").ToString() + Dim FechaCaducidad As Date = IfNull(Row("FechaCaducidad"), MinFecha).ToString.ToDate + + 'actualizamos el PS, para que tenga el aplica seccion + + ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True) + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For + End If + ind += 1 + Next + resultado.Dispose() + + Else + TextoError = "No se pudo registrar el movimiento" + ErrorMovInv = True + End If + + End If + + End If + + If Not ErrorMovInv Then + ObjInventario.Commit() + CargaDatos() + Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion) + Else + ObjInventario.RollBack() + Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgError) + End If + + ObjInventario.Dispose() + 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() + End If + End Sub + + Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click + If TxtExcel.getfiles().Archivos.Count > 0 Then + Dim file As Archivo = TxtExcel.getfiles().Archivos(0) + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "") + If Tipo = "EXCEL" Then + Dim CveAlmacen As Integer = DdlAlmacenExcel.SelectedValue.ToEntero() + Dim CveSubProyecto As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}") + + CargarArchivo(Directorio, file.filename, CveAlmacen, CveSubProyecto) + Else + Alert("El archivo no es de tipo excel", TipoMensaje.MsgAdvertencia) + End If + + Else + Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) + End If + End Sub + + Private Sub CargarArchivo(Ruta As String, FileName As String, CveAlmacen As Integer, CveSubProyecto As Integer) + Dim DtExcel As DataTable = ReadExcelFile(Ruta + FileName, True) + + Dim ErrorArchivo = False + If Not ErrorArchivo AndAlso DtExcel IsNot Nothing Then + If Not DtExcel.Columns(0).ColumnName = "Código" Then + Alert("El nombre de la segunda columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not DtExcel.Columns(1).ColumnName = "Producto/Servicio" Then + Alert("El nombre de la cuarta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not DtExcel.Columns(2).ColumnName = "SeccionAlmacen" Then + Alert("El nombre de la quinta columna debe ser 'SeccionAlmacen'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not DtExcel.Columns(3).ColumnName = "Serie" Then + Alert("El nombre de la sexta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not DtExcel.Columns(4).ColumnName = "Lote" Then + Alert("El nombre de la séptima columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not DtExcel.Columns(5).ColumnName = "FechaCaducidad" Then + Alert("El nombre de la octava columna debe ser 'FechaCaducidad'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + DtExcel.TableName = "Datos" + + If Not ErrorArchivo Then + Dim ErrorMovInv As Boolean = False + + Dim RowNoEncontrados As New StringBuilder() + Dim NumAgregados As Integer = 0 + + Dim ObjInventario As New ClsInventarios() + Dim ObjPS As New ClsProductosServicios(ObjInventario.IniciaTransacSQL()) + + Try + Dim DtExistenciasSecciones As DataTable = Nothing + If ObjInventario.GetMovimientosDetalleSeccionesAlmacen(DdlAlmacen.SelectedValue.ToEntero, DdlClasificaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + DtExistenciasSecciones = ObjInventario.DtResultados.Copy() + End If + + 'SALIDA ALMACÉN + Dim CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1, + MovimientoFijo:=False, Modulo:="ASA/SA") + + 'ENTRADA ALMACÉN + Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:="", TipoCambio:=-1, + MovimientoFijo:=False, Modulo:="ASA/EA") + + Dim dtSecciones As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, CveAlmacen) + dtSecciones.CaseSensitive = False + + For Each RowExcel As DataRow In DtExcel.Rows + + Dim Codigo As String = RowExcel("Código").ToString.Trim + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).Rows(0) + + If DrPS IsNot Nothing Then + If Not ErrorMovInv Then + Dim CvePS As Integer = DrPS("CvePS").ToString().ToEntero() + Dim CveUM As Integer = DrPS("CveUM").ToString().ToEntero() + Dim ProductoServicio As String = RowExcel("Producto/Servicio").ToString.Trim + + Dim SeccionAlmacen As String = RowExcel("SeccionAlmacen").ToString.Trim + Dim CveSeccionAlmacen As Integer = dtSecciones.FiltroPrimeroValor("CveSeccion", $"AlmacenSeccion='{SeccionAlmacen}'") + + Dim Serie As String = RowExcel("Serie").ToString() + Dim Lote As String = RowExcel("Lote").ToString() + Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate + + Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}") + + Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() + Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal() + Dim SerieSalida As String = RowExistencia("Serie").ToString() + Dim LoteSalida As String = RowExistencia("Lote").ToString() + Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate + Dim PUSalida As Decimal = RowExistencia("PU").ToString() + + 'GENERA LA SALIDA DE LOS PRODUCTOS QUE VIENEN EN EL EXCEL + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadSalida, CveUM, CvePS, PUSalida, CveSeccionAlmacen:=CveSeccionAlmacenSalida, Serie:=SerieSalida, Lote:=LoteSalida, FechaCaducidad:=FechaCaducidadSalida, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For + End If + + Dim CveMovimientoDetalleSalida As Integer = ObjInventario.CveMovimientoDetalle + + ErrorMovInv = CveMovimientoDetalleSalida <= 0 + + 'GENERA LA ENTRADA DE LOS PRODUCTOS QUE SE DIERON ENTRADA + If Not ErrorMovInv Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa, CveMovimientoDetalle:=CveMovimientoDetalleSalida) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0) + + Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero() + Dim CantidadEntrada As Decimal = RowEntrada("Cantidad").ToString().ToDecimal() + Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal() + Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero() + + Dim CostoIndirecto As Decimal = RowEntrada("CostoIndirecto").ToString().ToDecimal() + + 'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION + ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True) + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, CantidadEntrada, CveUMEntrada, CvePSEntrada, PUEntrada, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorMovInv = True + Exit For + End If + + Else + ErrorMovInv = True + End If + End If + End If + Else + ErrorMovInv = True + RowNoEncontrados.AppendFormat("{0},", Codigo) + End If + + Next + dtSecciones.Dispose() + + Catch ex As Exception + ErrorMovInv = True + OnError("Ocurrió un error al agregar el inventario", ex) + End Try + + If ErrorMovInv Then + ObjInventario.RollBack() + + Dim SbError As New StringBuilder() + SbError.Append("Ocurrió un error al guardar") + If RowNoEncontrados.Length > 0 Then + SbError.Append("Los siguientes códigos no fueron encontrados en el sistema.
    ") + SbError.Append(RowNoEncontrados.ToString()) + End If + + Alert(SbError.ToString(), TipoMensaje.MsgError) + Else + ObjInventario.Commit() + Alert("Se realizó el ajuste de los productos correctamente.") + End If + + ObjInventario.Dispose() + ObjPS.Dispose() + + End If + Else + Alert("Ocurrió un error al cargar el excel.", TipoMensaje.MsgError) + End If + End Sub + +End Class \ No newline at end of file diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 101e8490f..e5b6eb401 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1540,7 +1540,7 @@ Partial Class Inventarios_RecepcionUsados Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos For Each fileItem As Archivo In Filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") Filename = fileItem.filename Next @@ -1624,7 +1624,7 @@ Partial Class Inventarios_RecepcionUsados Dim Filename As String = "" For Each fileItem As Archivo In Filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)) '.Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) '.Replace(".", "") Filename = fileItem.filename Next diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index ea5f2e8f6..f070cb6d2 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -4811,7 +4811,7 @@ Partial Class OC Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos For Each fileItem As Archivo In Filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") Filename = fileItem.filename Next @@ -6102,7 +6102,7 @@ Partial Class OC Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = 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") CargarArchivo(Directorio, file.filename, Tipo) Else @@ -6110,52 +6110,6 @@ Partial Class OC End If End Sub - Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) - - Dim unnamed As Integer = 0 - Dim cols As Integer - Dim columns As String() - Dim curRow As Integer = 0 - Dim curCol As Integer = 0 - Dim dataTable As DataTable = New DataTable() - Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) - - For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 - - If firstRowHasHeaders Then - - If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) - Else - dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) - End If - - curRow = 1 - Else - dataTable.Columns.Add("Column " & (cols + 1)) - End If - Next - - While curRow < worksheet.Rows.Count - columns = New String(cols - 1) {} - - For curCol = 0 To cols - 1 - - If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then - columns(curCol) = "" - Else - columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() - End If - Next - - dataTable.Rows.Add(columns) - curRow += 1 - End While - - Return dataTable - End Function Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) @@ -7509,7 +7463,7 @@ Partial Class OC Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs) If TxtExcelCot.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch CargarArchivoCot(Directorio, file.filename) CargaCotizaciones(CveOrdenCompra) diff --git a/OI/SoporteADS.aspx.vb b/OI/SoporteADS.aspx.vb index e91072dd1..13e589cda 100644 --- a/OI/SoporteADS.aspx.vb +++ b/OI/SoporteADS.aspx.vb @@ -2011,7 +2011,7 @@ Partial Class OI_SoporteADS For Each fileItem As Archivo In Filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") 'Filename = fileItem.filename Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) @@ -2061,7 +2061,7 @@ Partial Class OI_SoporteADS For Each fileItem As Archivo In Filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") 'Filename = fileItem.filename Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) diff --git a/OI/UnoaUno.aspx b/OI/UnoaUno.aspx new file mode 100644 index 000000000..084ef99db --- /dev/null +++ b/OI/UnoaUno.aspx @@ -0,0 +1,452 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="UnoaUno.aspx.cs" Inherits="OI_UnoaUno" %> + + + + + + + + + + + Tablero Uno a Uno - + + + + + + + + + +
  • + Seguir
  • +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    + + + Siguiendo A +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + + Seguido por +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + + + Preguntas +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
      +
    • Fecha :
    • +
    • +
      + + + + + + + + + + +
      +
    • +
    +
    +
    +
    + + + + +

    +

    +
    + +
    +
    +
    +
    +
    +
    +
    + Guardar +
    +
    +
    +
    +
    + + + +
    +
    + + + + +
    + + + diff --git a/OI/UnoaUno.aspx.cs b/OI/UnoaUno.aspx.cs new file mode 100644 index 000000000..69060c408 --- /dev/null +++ b/OI/UnoaUno.aspx.cs @@ -0,0 +1,576 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +public partial class OI_UnoaUno : ClsPaginas +{ + + + #region Propiedades + public const string idDivModalSeguir = "idDivModalSeguir"; + public const string idDivModalSiguiendoA = "idDivModalSiguiendoA"; + private int CcveUnoaUnoPregunta + { + get { return (ViewState["CcveUnoaUnoPregunta"] == null) ? 0 : Convert.ToInt32(ViewState["CcveUnoaUnoPregunta"]); } + set { ViewState["CcveUnoaUnoPregunta"] = value; } + } + private System.Data.DataTable DtPreguntas + { + get { return (ViewState["DtPreguntas"] == null) ? null : (System.Data.DataTable)ViewState["DtPreguntas"]; } + set { ViewState["DtPreguntas"] = value; } + } + //private int CcveUnoaUnoCuestionario + //{ + // get { return (ViewState["CcveUnoaUnoCuestionario"] == null) ? 0 : Convert.ToInt32(ViewState["CcveUnoaUnoCuestionario"]); } + // set { ViewState["CcveUnoaUnoCuestionario"] = value; } + //} + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + TxtCFecha.Text = DateTime.Now.ToString("dd/MM/yyyy"); + LtlusuarioTitulo.Text = UsuarioActual.Nombre; + + + + GvUsuarioCuest.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC"); + GvUsuarioCuest.DataBind(); + CargarSiguiendoA(); + CargarSeguidoPor(); + BtnConsultar_Click(null, null); + } + } + private void CargarSiguiendoA() + { + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.GetUnoAUnoSiguiendoA(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa); + GVSiguiendoA.DataSource = ObjUnoa.DtResultados;//.FiltraParametros("","",new string[] { "CveSeguir", "Usuario" }); + } + GVSiguiendoA.DataBind(); + } + private void CargarSeguidoPor() + { + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.GetUnoaUnoCuestionario_Usuarios(-1, -1, UsuarioActual.CveUsuario); + GVSeguidoPor.DataSource = ObjUnoa.DtResultados.FiltraParametros("", "", new string[] { "CveUsuarioSeguidor", "NombreSeguidor" }); + } + GVSeguidoPor.DataBind(); + } + protected void BtnConsultar_Click(object sender, EventArgs e) + { + GVPA_OI_UnoAUnoTableroGet.DataSource = new System.Data.DataTable(); + using (ClsOIEventos ObjPA_O = new ClsOIEventos()) + { + + ObjPA_O.UnoAUnoTableroGet(UsuarioActual.CveEmpresa, TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario); + GVPA_OI_UnoAUnoTableroGet.DataSource = ObjPA_O.DtResultados; + ObjPA_O.Dispose(); + } + GVPA_OI_UnoAUnoTableroGet.DataBind(); + if (GVPA_OI_UnoAUnoTableroGet.Rows.Count > 0) + { + LnkGuardar.Visible = true; + } + else + { + LnkGuardar.Visible = false; + } + UpContenido.Update(); + } + + protected void LnkGuardar_Click(object sender, EventArgs e) + { + string fecha = TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd"); + bool continuar = true; + using (ClsOIEventos ObjPA_O = new ClsOIEventos()) + { + foreach (GridViewRow gvrow in GVPA_OI_UnoAUnoTableroGet.Rows) + { + if (continuar) + { + int CveUnoaUnoPregunta = gvrow.DataKey("CveUnoaUnoPregunta").ToEntero(); + if (CveUnoaUnoPregunta > 0) + { + string Comentarios = gvrow.FCTextBox("TxtComentarios").Text; + continuar = ObjPA_O.UnoAUnoTableroAdd(UsuarioActual.CveEmpresa, fecha, UsuarioActual.CveUsuario, CveUnoaUnoPregunta, Comentarios); + } + + } + } + + } + if (continuar) + { + Alert("Tus respuestas se han actualizado", ModExtensiones.TipoMensaje.ToastInformacion); + } + } + + protected void LnkSeguir_Click(object sender, EventArgs e) + { + TabContainerSeguir.ActiveTabIndex = 0; + CargarPreguntas(); + cargarCuestionario(); CargarSeguirA(); + if (GVUnoaUnoPregunta.Rows.Count > 0) + { + TabContainerSeguir.ActiveTabIndex = 1; + //if (GVCuestionario.Rows.Count > 0) + //{ + // TabContainerSeguir.ActiveTabIndex = 2; + //} + } + else + { + TabContainerSeguir.ActiveTabIndex = 0; + } + switch (TabContainerSeguir.ActiveTabIndex) + { + case 1: + TxtCuestionario.Focus(); + break; + case 2: + //TxtCuestionario.Focus(); + break; + default: + TxtPregunta.Focus(); + break; + } + RegistraScript(string.Format("$('#{0}').modal()", idDivModalSeguir)); + UpModalSeguir.Update(); + openmodalseguir(); + } + private void openmodalseguir() + { + string focustxt = "$('.TxtPregunta').focus();"; + switch (TabContainerSeguir.ActiveTabIndex) + { + case 1: + focustxt = "$('.TxtCuestionario').focus();"; + break; + default: + focustxt = "$('.TxtPregunta').focus();"; + break; + } + RegistraScript(string.Format("$('#{0}').modal();$('#{0}').on('shown.bs.modal', function (e) {{ {1} }});", idDivModalSeguir, focustxt)); + } + #region pregunta + private void CargarPreguntas() + { + + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + if (ObjUnoa.GetUnoaUnoPregunta(-1, UsuarioActual.CveEmpresa)) + { + GVUnoaUnoPregunta.DataSource = ObjUnoa.DtResultados; + DdlPregunta.DataSource = ObjUnoa.DtResultados; + GvPreguntasCuestionario.DataSource = ObjUnoa.DtResultados; + + } + } + GvPreguntasCuestionario.DataBind(); + GVUnoaUnoPregunta.DataBind(); + DdlPregunta.DataBind(); + //DdlPregunta.Items.Insert(0, new ListItem("", "-2")); + DdlPregunta.Items.Insert(0, new ListItem("Seleccione", "-1")); + upPreguntas.Update(); + } + + //protected void LnkAgregarPregunta_Click(object sender, EventArgs e) + //{ + // TxtPregunta.Text = ""; + // DdlPregunta.SelectedIndex = -1; + // CcveUnoaUnoPregunta = -1; + // LtlTituloPregunta.Text = "Agregar Pregunta"; + // TxtPregunta.Focus(); + + // LnkAgregarPregunta.Visible = false; + // LnkGuardarPregunta.Visible = true; + // LnkCancelarPregunta.Visible = true; + //} + protected void LnkEditarPregunta_Click(object sender, EventArgs e) + { + TxtPregunta.Text = ""; + CcveUnoaUnoPregunta = -1; + TxtPregunta.Focus(); + + + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CcveUnoaUnoPregunta = gvRow.DataKey("CveUnoaUnoPregunta").ToEntero(); + string Pregunta = gvRow.DataKey("Pregunta"); + int cveUnoaUnoPreguntaVinculo = gvRow.DataKey("CveUnoaUnoPreguntaVinculo").ToEntero(); + + TxtPregunta.Text = Pregunta; + DdlPregunta.SelectedValue = "-1"; + DdlPregunta.SelectedValueExist(cveUnoaUnoPreguntaVinculo.ToString()); + + + LnkGuardarPregunta.Text = "Actualizar"; + LnkCancelarPregunta.Visible = true; + upPreguntas.Update(); + openmodalseguir(); + } + protected void LnkCancelarPregunta_Click(object sender, EventArgs e) + { + CcveUnoaUnoPregunta = -1; + LnkGuardarPregunta.Text = "Guardar"; + LnkCancelarPregunta.Visible = false; + upPreguntas.Update(); + openmodalseguir(); + } + protected void LnkEliminarPregunta_Click(object sender, EventArgs e) + { + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CcveUnoaUnoPregunta = gvRow.DataKey("CveUnoaUnoPregunta").ToEntero(); + bool continuar = true; + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + + continuar = ObjUnoa.RemoveUnoaUnoPregunta(CcveUnoaUnoPregunta, UsuarioActual.CveEmpresa); + } + if (continuar) + { + CcveUnoaUnoPregunta = -1; + TxtPregunta.Text = ""; + CcveUnoaUnoPregunta = -1; + TxtPregunta.Focus(); + LnkGuardarPregunta.Text = "Guardar"; + LnkCancelarPregunta.Visible = false; + Alert("La pregunta se ha eliminado correctamente", ModExtensiones.TipoMensaje.ToastInformacion); + CargarPreguntas(); + } + openmodalseguir(); + } + + protected void LnkGuardarPregunta_Click(object sender, EventArgs e) + { + bool continuar = true; + + string Pregunta = TxtPregunta.Text; + int cveUnoaUnoPreguntaVinculo = DdlPregunta.SelectedValue.ToEntero(); + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + if (CcveUnoaUnoPregunta > 0) + { + + continuar = ObjUnoa.UpUnoaUnoPregunta(CcveUnoaUnoPregunta, Pregunta, cveUnoaUnoPreguntaVinculo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + } + else + { + continuar = ObjUnoa.AddUnoaUnoPregunta(Pregunta, cveUnoaUnoPreguntaVinculo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); + } + } + if (continuar) + { + CargarPreguntas(); + CcveUnoaUnoPregunta = -1; + TxtPregunta.Text = ""; + CcveUnoaUnoPregunta = -1; + TxtPregunta.Focus(); + LnkGuardarPregunta.Text = "Guardar"; + LnkCancelarPregunta.Visible = false; + Alert("La pregunta se ha agregado correctamente", ModExtensiones.TipoMensaje.ToastInformacion); + } + openmodalseguir(); + } + + #endregion + #region Cuestionario + private void cargarCuestionario() + { + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.GetUnoaUnoCuestionario(-1, UsuarioActual.CveUsuario); + DtPreguntas = ObjUnoa.DtResultados; + DdlCuestionario.DataSource = ObjUnoa.DtResultados; + } + //GVCuestionario.DataBind(); + DdlCuestionario.DataBind(); + DdlCuestionario.Items.Insert(0, new ListItem("Seleccione", "-1")); + openmodalseguir(); + } + protected void LnkGuardarCuestionario_Click(object sender, EventArgs e) + { + + bool continuar = true; + + string Cuestionario = TxtCuestionario.Text; + string Comentario = TxtCuestComentario.Text; + int cveUnoaUnoPreguntaVinculo = DdlPregunta.SelectedValue.ToEntero(); + int CveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero(); + string msg = ""; + List lPreguntas = new List(); + foreach (GridViewRow item in GvPreguntasCuestionario.Rows) + { + CheckBox chk = item.FCCheckBox("ChkConPregunta"); + if (chk.Checked) + { + lPreguntas.Add(item.DataKey("CveUnoaUnoPregunta").ToEntero()); + } + } + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + if (CveUnoaUnoCuestionario > 0) + { + + continuar = ObjUnoa.UpUnoaUnoCuestionario(CveUnoaUnoCuestionario, Cuestionario, Comentario, UsuarioActual.CveUsuario, lPreguntas); + msg = "El cuestionario se ha actualizado correctamente"; + } + else + { + continuar = ObjUnoa.AddUnoaUnoCuestionario(Cuestionario, Comentario, UsuarioActual.CveUsuario, lPreguntas); + msg = "El cuestionario se ha agregado correctamente"; + } + } + if (continuar) + { + DdlCuestionario.SelectedIndex = -1; + cargarCuestionario(); + DdlCuestionario_SelectedIndexChanged(null, null); + Alert(msg, ModExtensiones.TipoMensaje.ToastInformacion); + } + openmodalseguir(); + } + + + protected void DdlCuestionario_SelectedIndexChanged(object sender, EventArgs e) + { + int CveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero(); + string Cuestionario = DdlCuestionario.SelectedItem.Text; + string Comentario = ""; + if (CveUnoaUnoCuestionario > 0) + { + System.Data.DataRow drow = DtPreguntas.FiltroPrimero(string.Format("CveUnoaUnoCuestionario={0}", CveUnoaUnoCuestionario)); + if (drow != null) + { + Comentario = drow["Comentario"].ToString(); + } + System.Data.DataTable dt = new System.Data.DataTable(); + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.GetUnoaUnoCuestionarioPreguntas(CveUnoaUnoCuestionario); + dt = ObjUnoa.DtResultados; + } + foreach (GridViewRow item in GvPreguntasCuestionario.Rows) + { + CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta"); + int CveUnoaUnoPregunta = item.DataKey("CveUnoaUnoPregunta").ToEntero(); + ChkConPregunta.Checked = false; + if (dt.FiltraParametros(string.Format("CveUnoaUnoPregunta={0}", CveUnoaUnoPregunta)).Rows.Count > 0) + { + ChkConPregunta.Checked = true; + } + } + LnkGuardarCuestionario.Text = "Actualizar"; + } + else + { + Cuestionario = ""; + Comentario = ""; + foreach (GridViewRow item in GvPreguntasCuestionario.Rows) + { + CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta"); + ChkConPregunta.Checked = false; + } + LnkGuardarCuestionario.Text = "Guardar"; + } + TxtCuestionario.Text = Cuestionario; + TxtCuestComentario.Text = Comentario; + UpCuestionario.Update(); + CargarSeguirA(); + UpSeguirA.Update(); + openmodalseguir(); + } + //protected void LnkCancelarCuestionario_Click(object sender, EventArgs e) + //{ + + // CcveUnoaUnoCuestionario = -1; + // LnkGuardarCuestionario.Text = "Guardar"; + // LnkCancelarCuestionario.Visible = false; + // UpCuestionario.Update(); + // openmodalseguir(); + //} + + //protected void LnkEditarCuestionario_Click(object sender, EventArgs e) + //{ + // TxtCuestionario.Text = ""; + // CcveUnoaUnoPregunta = -1; + // TxtPregunta.Focus(); + + // GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + // CcveUnoaUnoCuestionario = gvRow.DataKey("CveUnoaUnoCuestionario").ToEntero(); + // string Cuestionario = gvRow.DataKey("Cuestionario"); + // TxtCuestionario.Text = Cuestionario; + // System.Data.DataTable dt = new System.Data.DataTable(); + // using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + // { + // ObjUnoa.GetUnoaUnoCuestionarioPreguntas(CcveUnoaUnoCuestionario); + // dt = ObjUnoa.DtResultados; + // } + // foreach (GridViewRow item in GvPreguntasCuestionario.Rows) + // { + // CheckBox ChkConPregunta=item.FCCheckBox("ChkConPregunta"); + // int CveUnoaUnoPregunta = item.DataKey("CveUnoaUnoPregunta").ToEntero(); + // ChkConPregunta.Checked = false; + // if(dt.FiltraParametros(string.Format("CveUnoaUnoPregunta={0}", CveUnoaUnoPregunta)).Rows.Count > 0) + // { + // ChkConPregunta.Checked = true; + // } + + // } + // LnkGuardarCuestionario.Text = "Actualizar"; + // LnkCancelarCuestionario.Visible = true; + // UpCuestionario.Update(); + // openmodalseguir(); + //} + + //protected void LnkEliminarCuestionario_Click(object sender, EventArgs e) + //{ + + // GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + // CcveUnoaUnoCuestionario = gvRow.DataKey("CveUnoaUnoCuestionario").ToEntero(); + // bool continuar = true; + // using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + // { + // continuar = ObjUnoa.RemoveUnoaUnoCuestionario(CcveUnoaUnoPregunta, UsuarioActual.CveUsuario); + // } + // if (continuar) + // { + // CcveUnoaUnoCuestionario = -1; + // Alert("El cuestionario se ha eliminado correctamente", ModExtensiones.TipoMensaje.ToastInformacion); + // cargarCuestionario(); + // } + // openmodalseguir(); + //} + #endregion + + private void CargarSeguirA() + { + System.Data.DataTable dt = null; + int cveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero(); + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.GetUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario, UsuarioActual.CveUsuario, -1); + dt = ObjUnoa.DtResultados; + } + bool isdtok = (dt != null && dt.Rows.Count > 0); + foreach (GridViewRow item in GvUsuarioCuest.Rows) + { + CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta"); + int CveSeguir = item.DataKey("CveUsuario").ToEntero(); + if (isdtok && dt.FiltraParametros(string.Format("CveSeguir={0}", CveSeguir)).Rows.Count > 0) + { + ChkConPregunta.Checked = true; + } + else + { + ChkConPregunta.Checked = false; + } + } + CargarSiguiendoA(); + UpContenido.Update(); + UpSeguirA.Update(); + } + protected void LnkGuardarSeguirA_Click(object sender, EventArgs e) + { + + bool continuar = true; + string msg = ""; + int cveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero(); + //int CveSeguir = DdlUsuario.SelectedValue.ToEntero(); + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.IniciaTransacSQL(); + + foreach (GridViewRow item in GvUsuarioCuest.Rows) + { + CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta"); + int CveSeguir = item.DataKey("CveUsuario").ToEntero(); + if (continuar) + { + continuar = ObjUnoa.UpUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario, UsuarioActual.CveUsuario, CveSeguir, ChkConPregunta.Checked); + + } + } + if (continuar) + { + msg = "El cuestionario se ha actualizado correctamente"; + ObjUnoa.Commit(); + } + else + { + ObjUnoa.RollBack(); + } + } + if (continuar) + { + //CcveUnoaUnoCuestionario = -1; + Alert(msg, ModExtensiones.TipoMensaje.ToastInformacion); + CargarSeguirA(); + RegistraScript(string.Format("$('#{0}').modal('hide');", idDivModalSeguir)); + } + openmodalseguir(); + } + + //protected void LnkEliminarCuestionarioUser_Click(object sender, EventArgs e) + //{ + + + // bool continuar = true; + // int cveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero(); + // int CveSeguir = DdlUsuario.SelectedValue.ToEntero(); + // using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + // { + // continuar = ObjUnoa.AddUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario, UsuarioActual.CveUsuario, CveSeguir); + // } + // if (continuar) + // { + // //CcveUnoaUnoCuestionario = -1; + // Alert("El cuestionario se ha eliminado correctamente", ModExtensiones.TipoMensaje.ToastInformacion); + // CargarSeguirA(); + // } + // openmodalseguir(); + //} + + + protected void TabContainerSeguir_ActiveTabChanged(object sender, EventArgs e) + { + LnkGuardarSeguirA.Visible = false; + if (TabContainerSeguir.ActiveTab == TabUsuarios) + { + if (DdlCuestionario.SelectedValue.ToEntero() <= 0) + { + TabContainerSeguir.ActiveTab = TabCuestionario; + Alert("debe Seleccionar un cuestioniario", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + else + { + LnkGuardarSeguirA.Visible = true; + } + } + openmodalseguir(); + UpSeguirA.Update(); + } + + + protected void SiguiendoAUser_Click(object sender, EventArgs e) + { + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + int CveUsuario = gvRow.DataKey("CveUsuario").ToEntero(); + string Nombre = gvRow.DataKey("Nombre"); + LtlTitulosiguiendoA.Text = Nombre; + gvPregResSiguiendoA.DataSource = null; + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + ObjUnoa.GetUnoAUnoSiguiendoA(UsuarioActual.CveUsuario, CveUsuario, UsuarioActual.CveEmpresa); + gvPregResSiguiendoA.DataSource = ObjUnoa.DtResultados; + } + gvPregResSiguiendoA.DataBind(); + RegistraScript(string.Format("$('#{0}').modal();", idDivModalSiguiendoA)); + UpModalSiguiendoA.Update(); + } +} \ No newline at end of file diff --git a/OI/UnoaUnoConfiguracion.aspx b/OI/UnoaUnoConfiguracion.aspx new file mode 100644 index 000000000..583ed8e8e --- /dev/null +++ b/OI/UnoaUnoConfiguracion.aspx @@ -0,0 +1,81 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="UnoaUnoConfiguracion.aspx.cs" Inherits="OI_UnoaUnoConfiguracion" %> + + + + + + + Configuración Uno a Uno + + + + + + +
  • Etiqueta
  • +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OI/UnoaUnoConfiguracion.aspx.cs b/OI/UnoaUnoConfiguracion.aspx.cs new file mode 100644 index 000000000..455ba507a --- /dev/null +++ b/OI/UnoaUnoConfiguracion.aspx.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class OI_UnoaUnoConfiguracion : ClsPaginas +{ + + #region Propiedades + private int CcveUnoaUnoEtiqueta + { + get { return (ViewState["CcveUnoaUnoEtiqueta"] == null) ? 0 : Convert.ToInt32(ViewState["CcveUnoaUnoEtiqueta"]); } + set { ViewState["CcveUnoaUnoEtiqueta"] = value; } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaUnoaUnoEtiqueta(); + } + } + protected void CargaUnoaUnoEtiqueta() + { + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + + ObjUnoa.GetUnoaUnoEtiqueta(-1, UsuarioActual.CveEmpresa); + GVUnoaUnoEtiqueta.DataSource = ObjUnoa.DtResultados; + DdlUnoaetiqueta1.DataSource = ObjUnoa.DtResultados; + } + GVUnoaUnoEtiqueta.DataBind(); + DdlUnoaetiqueta1.DataBind(); + DdlUnoaetiqueta1.Items.Insert(0,new ListItem("Seleccione","-1")); + upDatosUnoa.Update(); + } + protected void LimpiaUnoaUnoEtiqueta() + { + TxtUnoaetiqueta.Text = ""; + DdlUnoaetiqueta1.SelectedIndex = 0; + UPModalUnoa.Update(); + } + protected void LnkEditarUnoa_Click(object sender, EventArgs e) + { + LimpiaUnoaUnoEtiqueta(); + ltlUnoatitulo.Text = "Actualizar Etiqueta"; + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CcveUnoaUnoEtiqueta = gvRow.DataKey("CveUnoaUnoEtiqueta").ToEntero(); + string etiqueta = gvRow.DataKey("Etiqueta"); + int cveUnoaUnoEtiquetaVinculo = gvRow.DataKey("CveUnoaUnoEtiquetaVinculo").ToEntero(); + int cveGrupo = gvRow.DataKey("CveGrupo").ToEntero(); + int cveEmpresa = gvRow.DataKey("CveEmpresa").ToEntero(); + + TxtUnoaetiqueta.Text = etiqueta.ToString(); + DdlUnoaetiqueta1.SelectedValue = "-1"; + DdlUnoaetiqueta1.SelectedValueExist(cveUnoaUnoEtiquetaVinculo.ToString()); + this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal();"); + BtnUnoaADD.Visible = false; + BtnUnoaEdit.Visible = true; + UPModalUnoa.Update(); + } + protected void LnkAgregarUnoa_Click(object sender, EventArgs e) + { + ltlUnoatitulo.Text = "Agregar Etiqueta"; + this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal();"); + LimpiaUnoaUnoEtiqueta(); + BtnUnoaADD.Visible = true; + BtnUnoaEdit.Visible = false; + UPModalUnoa.Update(); + } + protected void BtnUnoaADD_Click(object sender, EventArgs e) + { + + string etiqueta = TxtUnoaetiqueta.Text; + int cveUnoaUnoEtiquetaVinculo = DdlUnoaetiqueta1.SelectedValue.ToEntero(); + int cveGrupo = 1; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + Continuar=ObjUnoa.AddUnoaUnoEtiqueta(etiqueta, cveUnoaUnoEtiquetaVinculo, cveGrupo, cveEmpresa); + } + if (Continuar) + { + this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal('hide');"); + LimpiaUnoaUnoEtiqueta(); + CargaUnoaUnoEtiqueta(); + UPModalUnoa.Update(); + this.Alert("La Etiqueta se ha agregado"); + } + } + protected void BtnUnoaEdit_Click(object sender, EventArgs e) + { + + string etiqueta = TxtUnoaetiqueta.Text; + int cveUnoaUnoEtiquetaVinculo = DdlUnoaetiqueta1.SelectedValue.ToEntero(); + int cveGrupo = 1; + int cveEmpresa = UsuarioActual.CveEmpresa; + bool Continuar = false; + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + Continuar = ObjUnoa.UpUnoaUnoEtiqueta(CcveUnoaUnoEtiqueta, etiqueta, cveUnoaUnoEtiquetaVinculo, cveGrupo, cveEmpresa); + } + if (Continuar) + { + this.RegistraScript("$('#DModalUnoaUnoEtiqueta').modal('hide');"); + LimpiaUnoaUnoEtiqueta(); + UPModalUnoa.Update(); + CargaUnoaUnoEtiqueta(); + this.Alert("La Etiqueta se ha actualizado"); + } + } + protected void LnkEliminarUnoa_Click(object sender, EventArgs e) + { + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CcveUnoaUnoEtiqueta = gvRow.DataKey("CveUnoaUnoEtiqueta").ToEntero(); + bool Continuar = false; + using (ClsOIEventos ObjUnoa = new ClsOIEventos()) + { + + Continuar = ObjUnoa.RemoveUnoaUnoEtiqueta(CcveUnoaUnoEtiqueta); + } + if (Continuar) + { + CargaUnoaUnoEtiqueta(); + this.Alert("La Etiqueta se ha Eliminado"); + } + } +} diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index 74ae350dd..fe6e0251c 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -1676,7 +1676,7 @@ Partial Class Portal_PortalProveedor ' Try - ' FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "") + ' FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") ' Dim tempArray() As String ' tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 459603c9b..e9fc7d01e 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -283,7 +283,7 @@
  • - +
  • @@ -294,7 +294,7 @@
  • - +
  • diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 74de44917..971422716 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -3758,6 +3758,7 @@ Partial Class Clientes params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("NombreUsuario", UsuarioActual.Usuario)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario)) + params.Add(New ReportParameter("Cliente", TxtNombre.Text)) Dim ObjGPS As New ClsGPS Dim tablaReporte As DataTable diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index a9126e7f2..427b7f4f4 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1776,6 +1776,17 @@ Partial Class PV Moneda = 1 End If + 'ELIMINA LOS DETALLES + If Not OcurrioError Then + Dim DtEliminados As DataTable = TmpDT.FiltraParametros("EliminarDB = True AND CveVentaDetalle > 0", "", {"CveVentaDetalle"}) + + For Each Dr1 As DataRow In DtEliminados.Rows + If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then + OcurrioError = True + End If + Next + End If + 'Actualizo los parametros de la venta If Not ObjVentas.UpdateVentas(TxtSubTotal.Text.ToDecimal, LblDescuentos.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtIEPS.Text.ToDecimal, TxtTotal.Text.ToDecimal, Moneda, TipoCambio, TxtFecha.Text.Trim.ToDate, TxtObsFact.Text.Trim, UsuarioActual.CveEmpresa, CveVenta, 0, 0, @@ -1789,7 +1800,7 @@ Partial Class PV 'Cargo de nueva cuenta el detalle de Ventas (Conceptos) If Not OcurrioError Then Dim index As Integer = 0 - For Each Row As DataRow In TmpDT.Rows + For Each Row As DataRow In TmpDT.FiltraParametros("EliminarDB = False").Rows Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero() If CveVentaDetalle > 0 Then If Not ObjVentas.UpdateVentaDetalleRemision(Row("CveVentaDetalle").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal(), Row("ImporteIEPS").ToString.ToDecimal(), Row("PorcentajeIEPS").ToString().ToDecimal(), Row("Obs").ToString, UsuarioActual.CveUsuario) Then @@ -1834,32 +1845,46 @@ Partial Class PV Next End If + 'RECARGA LOS DATOS + ObjFactura.Dispose() + ObjFactura = Nothing + ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa) - 'ELIMINA LOS DETALLES - If Not OcurrioError Then - Dim DtEliminados As DataTable = TmpDT.FiltraParametros("EliminarDB = True AND CveVentaDetalle > 0", "", {"CveVentaDetalle"}) + If ObjFactura Is Nothing Then + OcurrioError = True + Else + TmpDT = ObjFactura.DtDetalle + TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) + TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) - For Each Dr1 As DataRow In DtEliminados.Rows - If Not ObjVentas.RemoveVentasDetalle(CveVenta, Dr1("CveVentaDetalle").ToString.ToEntero) Then - OcurrioError = True + Dim NumRowsPS As Integer = 0 + Dim CantidadPS As Decimal = 0 + For Each GvRow As GridViewRow In GvPS.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + NumRowsPS += 1 + CantidadPS += GvRow.DataKey("Cantidad").ToDecimal() End If Next + + 'VALIDA NUMERO DE REGISTROS + If TmpDT.Rows.Count <> NumRowsPS Then + OcurrioError = True + End If + + 'VALIDA CANTIDAD DE REGISTROS + If TmpDT.SUM("Cantidad") <> CantidadPS Then + OcurrioError = True + End If + End If - 'RECARGA LOS DATOS - If ObjVentas.GetVentaDetalle(CveVenta) Then - TmpDT = ObjVentas.DtResultados.Copy() - ObjFactura.DtDetalle = TmpDT - Else - OcurrioError = True - End If 'GUARDA USADOS - If Not ObjVentas.EliminarUsados(CveVenta) Then + If Not OcurrioError AndAlso Not ObjVentas.EliminarUsados(CveVenta) Then OcurrioError = True End If - If TmpDTRecepcionUsados IsNot Nothing Then + If Not OcurrioError AndAlso TmpDTRecepcionUsados IsNot Nothing Then For Each drow As DataRow In TmpDTRecepcionUsados.Rows If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("CveBCIUsado").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero) Then OcurrioError = True @@ -1869,11 +1894,11 @@ Partial Class PV End If 'GUARDAR AJUSTES' - If Not ObjAcum.EliminarGarantiasDetalle(CveVenta) Then + If Not OcurrioError AndAlso Not ObjAcum.EliminarGarantiasDetalle(CveVenta) Then OcurrioError = True End If - If TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0 Then + If Not OcurrioError AndAlso TmpDTAjustes IsNot Nothing AndAlso TmpDTAjustes.Rows.Count > 0 Then For Each Dr As DataRow In TmpDTAjustes.Rows If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero, @@ -1884,11 +1909,11 @@ Partial Class PV End If 'GUARDAR POLIZA VIRTUAL - If Not ObjAcum.EliminarPolizaVirtual(CveVenta) Then + If Not OcurrioError AndAlso Not ObjAcum.EliminarPolizaVirtual(CveVenta) Then OcurrioError = True End If - If TmpDTPolizaVirtual IsNot Nothing Then + If Not OcurrioError AndAlso TmpDTPolizaVirtual IsNot Nothing Then For Each drow As DataRow In TmpDTPolizaVirtual.Rows If ObjAcum.AddPolizaVirtual(CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal, drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString), @@ -2758,13 +2783,18 @@ Partial Class PV #Region "GVPS" Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting - Dim DbRow As DataRow = Nothing DbRow = TmpDT.Rows(e.RowIndex) - EliminarUsados(DbRow("Consec").ToString().ToEntero()) + Me.CveVentaDetalle = DbRow("CveVentaDetalle").ToString().ToEntero() - TmpDT.Rows.Remove(DbRow) + If Me.CveVentaDetalle <= 0 Then + EliminarUsados(DbRow("Consec").ToString().ToEntero()) + TmpDT.Rows.Remove(DbRow) + Else + EliminarUsados() + DbRow("EliminarDB") = True + End If GvPS.DataSource = TmpDT.FiltraParametros("EliminarDB = False") DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") @@ -2774,6 +2804,9 @@ Partial Class PV Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion) + Me.CveVentaDetalle = -1 + + UpContado.Update() End Sub Protected Sub GvPS_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPS.RowDataBound diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index f2e53e0e0..d1d61a0b7 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6281,6 +6281,14 @@ Partial Class Ventas e.Row.FCCheckBox("cbInv").Enabled = False End If + 'SI DEBE HACER SALIDA DIRECTA DE ALMACEN DEBE ESTAR SELECCIONADO SIEMPRE + If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then + e.Row.FCCheckBox("cbInv").Checked = True + If UsuarioActual.CveEmpresa = 141 Then + e.Row.FCCheckBox("cbInv").Enabled = False + End If + End If + End If If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not AplicaDevolucion Then @@ -11197,6 +11205,15 @@ Partial Class Ventas Next End If + 'EN ECONOLLANTAS DEBE REALIZAR SIEMPRE LA SALIDA DE ALMACEN + If UsuarioActual.CveEmpresa = 141 AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then + For Each GvRow As GridViewRow In GvInv.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + GvRow.FCCheckBox("cbInv").Checked = True + End If + Next + End If + If DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then Dim Filtro As String = "" @@ -11299,6 +11316,11 @@ Partial Class Ventas i = i + 1 Next + 'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN + If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then + OcurrioError = True + End If + 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN If Not OcurrioError Then Dim DtCostos As DataTable = Nothing @@ -19505,30 +19527,11 @@ Partial Class Ventas Public Sub LbDescargarExcel_Click(sender As Object, e As EventArgs) Handles LbDescargarExcelVentas.Click DescargarFormato() End Sub - Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) + Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String, FileUrl As String) Dim dt As New DataTable - 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$] WHERE Cantidad >=1" - Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd) - DataAdapter.Fill(dt) - Case Else - Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError) - Exit Sub - End Select - Catch ex As Exception - ErrorArchivo = True - OnError("Ocurrio un Error al leer el archivo
    " & ex.Message, ex) - End Try - Conexion.Close() + dt = ReadExcelFile(FileUrl, True) If Not ErrorArchivo Then If Not dt.Columns(0).ColumnName = "Cantidad" Then Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError) @@ -19577,6 +19580,7 @@ Partial Class Ventas Dim RowNoEncontrados As String = "" Dim NumAgregados As Integer = 0 For Each Row As DataRow In dt.Rows + NumAgregados = NumAgregados + 1 Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal Dim UM As String = Row("UM").ToString() Dim Codigo As String = Row("Código").ToString().Trim.ToUpper @@ -19728,7 +19732,7 @@ Partial Class Ventas 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"), "EXCEL", "CSV") - CargarArchivo(Directorio, file.filename, Tipo) + CargarArchivo(Directorio, file.filename, Tipo, file.FileUrl) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) End If @@ -25504,4 +25508,7 @@ Partial Class Ventas Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs) CargaEventoBitacora() End Sub + + + End Class \ No newline at end of file diff --git a/WEB.rar b/WEB.rar index f1421731b..7c07463c9 100644 Binary files a/WEB.rar and b/WEB.rar differ diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 461d63f35..88b6270ad 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -1,5 +1,5 @@ -<%@ WebService Language="VB" Class="WSApp" %> - +<%@ WebService Language="VB" Class="WSApp" %> + Option Explicit On Imports System.Data @@ -22,9 +22,9 @@ Imports Newtonsoft.Json.Linq Public Class WSApp - Inherits System.Web.Services.WebService + Inherits System.Web.Services.WebService #Region "G L O B A L - D T" - + Public ReadOnly Property UrlSitio As String Get Return ConfigurationManager.AppSettings("UrlSitio").ToString @@ -425,9 +425,34 @@ Public Class WSApp Set(value As DataTable) Application("GlobalDTMotivosHorasExtras") = value End Set - End Property + End Property + + + Public Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then + Dim ObjUnidadesMedida As New ClsUnidadesMedida() + If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados + ObjUnidadesMedida.Dispose() + End If + + If CveEmpresa <> -1 Then + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) + GlobalDTUnidadesMedida = Dv.ToTable + Dv.Dispose() + Else + GlobalDTUnidadesMedida = DirectCast(Application(AppNombre), DataTable) + End If + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property #End Region - + Public Property CveEmpresa As Integer = 143 Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario) @@ -448,7 +473,7 @@ Public Class WSApp Else End If ObjEmpresa.Dispose() - End Sub + End Sub #Region "M E T O D O S - S E R V I C I O" Public Function ValidaUsuario(CveUsuario As Integer) As Usuario Dim UsuarioActual As Usuario = Nothing @@ -783,9 +808,9 @@ Public Class WSApp Retorno.Mensajes.Add("Ocurrió un error al eliminar el movimiento. Por favor vuelva a intetar.") End If ObjInv.Dispose() - End Sub + End Sub #End Region - + #Region "P E D I D O S" Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre Dim Timbre As New CFDITimbre @@ -899,9 +924,9 @@ Public Class WSApp i += 1 Next Return Timbre - End Function + End Function #End Region - + #Region "R E M I S I O N E S" Private Function CreaFactura(ByRef Retorno As Modelos.Factura.MMensajeFactura, CveCliente As Integer, CveAlmacen As Integer, CveSubProyecto As Integer, CveMoneda As Integer, UsuarioActual As Usuario, Observaciones As String, ListaPS As List(Of MVentaProductos)) As Modelos.Factura If CveSubProyecto <= 0 Then @@ -1430,9 +1455,10 @@ Public Class WSApp End Try ObjVentas.Dispose() Return strBody.ToString - End Function + End Function #End Region - + + End Class Namespace WebServiceAppModels2 diff --git a/packages.config b/packages.config index 0878a2900..40443914d 100644 --- a/packages.config +++ b/packages.config @@ -28,7 +28,6 @@ - diff --git a/vwd.webinfo b/vwd.webinfo index 71c73829a..8dd65e0da 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -58,6 +58,8 @@ + +