diff --git a/AC/CatClasificacionAdministrativa.aspx.vb b/AC/CatClasificacionAdministrativa.aspx.vb index d59b43943..2e7ad3f49 100644 --- a/AC/CatClasificacionAdministrativa.aspx.vb +++ b/AC/CatClasificacionAdministrativa.aspx.vb @@ -17,15 +17,7 @@ Partial Class AC_CatClasificacionAdministrativa End Sub Public Sub CargaDatos() - Dim ObjClasificacionAdministrativa As New ClsAC - If ObjClasificacionAdministrativa.GetClasificacionAdministrativa() Then - ViewState("DTClasificacionAdministrativas") = ObjClasificacionAdministrativa.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionAdministrativa(UsuarioActual.CveEmpresa) = ObjClasificacionAdministrativa.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionAdministrativa.Dispose() + ViewState("DTClasificacionAdministrativas") = GlobalDTAC_ClasificacionAdministrativa(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatClasificacionFuncional.aspx.vb b/AC/CatClasificacionFuncional.aspx.vb index 109a265fb..4261995b2 100644 --- a/AC/CatClasificacionFuncional.aspx.vb +++ b/AC/CatClasificacionFuncional.aspx.vb @@ -52,15 +52,7 @@ Partial Class AC_CatClasificacionFuncional End Sub Public Sub CargaDatos() - Dim ObjClasificacionFuncional As New ClsAC - If ObjClasificacionFuncional.GetClasificacionFuncional() Then - ViewState("DTClasificacionFuncional") = ObjClasificacionFuncional.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionFuncional(UsuarioActual.CveEmpresa) = ObjClasificacionFuncional.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionFuncional.Dispose() + ViewState("DTClasificacionFuncional") = GlobalDTAC_ClasificacionFuncional(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatClasificacionGeografica.aspx.vb b/AC/CatClasificacionGeografica.aspx.vb index 2b871ee67..f9a5434c9 100644 --- a/AC/CatClasificacionGeografica.aspx.vb +++ b/AC/CatClasificacionGeografica.aspx.vb @@ -56,15 +56,7 @@ Partial Class AC_CatClasificacionGeografica End Sub Public Sub CargaDatos() - Dim ObjClasificacionGeografica As New ClsAC - If ObjClasificacionGeografica.GetClasificacionGeografica() Then - ViewState("DTClasificacionGeografica") = ObjClasificacionGeografica.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_ClasificacionGeografica(UsuarioActual.CveEmpresa) = ObjClasificacionGeografica.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjClasificacionGeografica.Dispose() + ViewState("DTClasificacionGeografica") = GlobalDTAC_ClasificacionGeografica(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatFuentesFinanciamiento.aspx.vb b/AC/CatFuentesFinanciamiento.aspx.vb index 89ad47690..c28547b0b 100644 --- a/AC/CatFuentesFinanciamiento.aspx.vb +++ b/AC/CatFuentesFinanciamiento.aspx.vb @@ -47,15 +47,7 @@ Partial Class AC_CatFuentesFinanciamiento End Sub Public Sub CargaDatos() - Dim ObjFuentesFinanciamiento As New ClsAC - If ObjFuentesFinanciamiento.GetFuentesFinanciamiento() Then - ViewState("DTFuentesFinanciamiento") = ObjFuentesFinanciamiento.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_FuentesFinanciamiento(-1) = ObjFuentesFinanciamiento.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjFuentesFinanciamiento.Dispose() + ViewState("DTFuentesFinanciamiento") = GlobalDTAC_FuentesFinanciamiento(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatFuentesRecaudacion.aspx.vb b/AC/CatFuentesRecaudacion.aspx.vb index 349f696f1..41d7a1105 100644 --- a/AC/CatFuentesRecaudacion.aspx.vb +++ b/AC/CatFuentesRecaudacion.aspx.vb @@ -48,15 +48,7 @@ Partial Class AC_CatFuentesRecaudacion End Sub Public Sub CargaDatos() - Dim ObjFuenteRecaudacion As New ClsAC - If ObjFuenteRecaudacion.GetFuentesRecaudacion() Then - ViewState("DTFuenteRecaudacion") = ObjFuenteRecaudacion.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa)) - GlobalDTAC_FuentesRecaudacion(-1) = ObjFuenteRecaudacion.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjFuenteRecaudacion.Dispose() + ViewState("DTFuenteRecaudacion") = GlobalDTAC_FuentesRecaudacion(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/CatOGClasificaciones.aspx.vb b/AC/CatOGClasificaciones.aspx.vb index 02524768e..e41239c25 100644 --- a/AC/CatOGClasificaciones.aspx.vb +++ b/AC/CatOGClasificaciones.aspx.vb @@ -47,10 +47,10 @@ Partial Class AC_CatOGClasificaciones Public Sub CargaDatos() Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones() Then + If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' AND CveEmpresa = " & UsuarioActual.CveEmpresa, "Codigo") - GlobalDTClasificaciones = ObjClasificaciones.DtResultados - GlobalDTACClasificadorObjetoGasto = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") + + GlobalDTACClasificadorObjetoGasto(UsuarioActual.CveEmpresa) = Nothing Else Me.GvDatos.DataSource = Nothing End If @@ -74,14 +74,14 @@ Partial Class AC_CatOGClasificaciones Alert("La Clasificacion de Objeto de Gasto se guardó correctamente.", TipoMensaje.MsgInformacion) 'UpTitulos.Update() ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing End If Else If ObjClasificaciones.UpdateClasificacion(TxtOGClasificacion.Text, TxtCodigo.Text, -1, "", -1, "", -1, "", ChkEstatus.Checked, ChkAfectable.Checked, 0, UsuarioActual.CveUsuario, CveClasificacion) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If End If @@ -119,7 +119,7 @@ Partial Class AC_CatOGClasificaciones If ObjClasificaciones.RemoveClasificacion(GvRow.DataKey("CveClasificacion").ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("la Clasificacion de Objeto de Gasto se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -159,7 +159,7 @@ Partial Class AC_CatOGClasificaciones If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("la Clasificacion de Objeto de Gasto se eliminó correctamente.", TipoMensaje.MsgInformacion) End If @@ -194,7 +194,7 @@ Partial Class AC_CatOGClasificaciones If ObjOGClasificaciones.UpdateClasificacion(OGClasificacion, Codigo, -1, "", -1, "", -1, "", Estatus, Afectable, 0, UsuarioActual.CveUsuario, CveOGClasificacion) Then GvDatos.EditIndex = -1 ViewState("DTOGClasificaciones") = ObjOGClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTClasificaciones = ObjOGClasificaciones.DtResultados + GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) End If diff --git a/AC/CatUnidadesAdministrativas.aspx.vb b/AC/CatUnidadesAdministrativas.aspx.vb index 1ac5a94dc..ce7080619 100644 --- a/AC/CatUnidadesAdministrativas.aspx.vb +++ b/AC/CatUnidadesAdministrativas.aspx.vb @@ -26,15 +26,7 @@ Partial Class AC_CatUnidadesAdministrativas End Sub Public Sub CargaDatos() - Dim ObjUnidadAdministrativas As New ClsAC - If ObjUnidadAdministrativas.GetUnidadesAdministrativas() Then - ViewState("DTUnidadAdministrativas") = ObjUnidadAdministrativas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTAC_UnidadesAdministrativas(-1) = ObjUnidadAdministrativas.DtResultados - Else - Me.GvDatos.DataSource = Nothing - End If - - ObjUnidadAdministrativas.Dispose() + ViewState("DTUnidadAdministrativas") = GlobalDTAC_UnidadesAdministrativas(UsuarioActual.CveEmpresa) If ViewState("Orden").ToString() <> String.Empty Then CargaGrid(ViewState("Orden").ToString()) diff --git a/AC/RepPresupuestoEgresos.aspx.vb b/AC/RepPresupuestoEgresos.aspx.vb index b4f15938e..152d498b5 100644 --- a/AC/RepPresupuestoEgresos.aspx.vb +++ b/AC/RepPresupuestoEgresos.aspx.vb @@ -115,7 +115,7 @@ Partial Class AC_RepPresupuestoEgresos Private Sub CargaDatos() Dim objAC As New ClsContPAQi(UsuarioActual.Empresa) Dim FechaF As Date = txtFechaF.Text.ToDate - Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto.FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) + Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) If objAC.GetRepPresupuestosEgresosSaldos(DdlEjercicio.SelectedValue.ToEntero, FechaF, Capitulo, DdlClasificaciones.SelectedValue.ToEntero, DdlFuenteFinanciamiento.SelectedValue.ToEntero, DdlProgramaOperativo.SelectedValue.ToEntero, DdlUnidadAdministrativa.SelectedValue.ToEntero, DdlTipoGasto.SelectedValue.ToEntero, DdlOrden.SelectedValue.ToEntero) Then DtPresupuestoEgresos = objAC.DtResultados diff --git a/AC/RepPresupuestoEgresosMensual.aspx.vb b/AC/RepPresupuestoEgresosMensual.aspx.vb index 70514d7bd..2aef73b62 100644 --- a/AC/RepPresupuestoEgresosMensual.aspx.vb +++ b/AC/RepPresupuestoEgresosMensual.aspx.vb @@ -75,7 +75,7 @@ Partial Class AC_RepPresupuestoEgresosMensual BtnImprimir.Visible = False Dim objAC As New ClsContPAQi(UsuarioActual.Empresa) - Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto.FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) + Dim Capitulo As String = If(DdlCapituloClasificaciones.SelectedValue.ToEntero = -1, "-1", GlobalDTACClasificadorObjetoGasto(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion = {0}", DdlCapituloClasificaciones.SelectedValue.ToEntero)).Rows(0)("Codigo").ToString.Substring(0, 1)) UPPDatos.Update() Gv.DataBind() diff --git a/AC/RepProgramasOperativosAvances.aspx b/AC/RepProgramasOperativosAvances.aspx new file mode 100644 index 000000000..f1cfb142d --- /dev/null +++ b/AC/RepProgramasOperativosAvances.aspx @@ -0,0 +1,154 @@ +<%@ Page Title="Reporte Avance Programatico" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepProgramasOperativosAvances.aspx.vb" Inherits="AC_RepProgramasOperativosAvances" %> + + + + + + + + + +
  • + Agregar +
  • +
  • + Exporta PDF +
  • +
  • + Exporta Excel +
  • + +
    + + Reporte de Avance Programatico + + + + + + + +
    +
    +
    + +
    +
    +
    + +
    + + + + +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + + + + + + + + + + <%----%> + + + + + Acciones
    Realizadas +
    + + + +
    + + + + + Dif. Meta
    Acciones Realizadas +
    + + + +
    + + + <%----%> + + + + + + + + + + <%----%> + + + + + + + + + +
    + +
    +
    +
    + + + + + +
    +
    + + + + + + + + +
    + +
    +
    +
    + + + +
    + + diff --git a/AC/RepProgramasOperativosAvances.aspx.vb b/AC/RepProgramasOperativosAvances.aspx.vb new file mode 100644 index 000000000..312da416f --- /dev/null +++ b/AC/RepProgramasOperativosAvances.aspx.vb @@ -0,0 +1,208 @@ +Imports Extensiones +Imports Microsoft.Reporting.WebForms +Imports System.Data +Imports System.Drawing + +Partial Class AC_RepProgramasOperativosAvances + Inherits ClsPaginas + + +#Region "PROPIEDADES" + + Private Property DtProgramaOperativo As DataTable + Get + Return CType(ViewState("DtProgramaOperativo"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtProgramaOperativo") = value + End Set + End Property +#End Region + + + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + SetValues() + CargaDatos() + End If + End Sub + + +#Region " VALORES INICIALES " + Private Sub SetValues() + CargaEjercicios() + End Sub + Private Sub CargaEjercicios() + Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) + If ClsConta.GetEjercicios() Then + DdlEjercicio.DataSource = ClsConta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ClsConta.Dispose() + DdlEjercicio.DataBind() + + DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) + End Sub +#End Region + + + Protected Sub CargaDatos() + Dim objAC As New ClsAC + Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString.ToEntero + Dim EsProyecto As Boolean = CBool(DdlProyecto.SelectedValue.ToString) + + BtnProyecto.Visible = False + + If objAC.GetProgramasOperativosAvances(-1, UsuarioActual.CveEmpresa, EsProyecto, Ejercicio) Then + GVD.DataSource = objAC.DtResultados + GlobalDTAC_ProgramaOperativo(-1) = objAC.DtResultados + DtProgramaOperativo = objAC.DtResultados + + 'debe de haber datos para habilitar los botones + If DtProgramaOperativo.Rows.Count > 0 Then + If EsProyecto Then + If DtProgramaOperativo.Rows(0)("Bloqueado").ToString = "0" Then + BtnProyecto.Visible = True + End If + Else + 'si es anteproyecto + If DtProgramaOperativo.Rows(0)("Bloqueado").ToString = "0" Then + BtnProyecto.Visible = True + End If + End If + End If + + End If + + UPPDatos.Update() + + objAC.Dispose() + GVD.DataBind() + End Sub + + + Protected Sub consultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + + Protected Sub GVD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVD.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + 'DataNavigateUrlFields = "CveProgramaOperativo,EsProyecto,Bloqueado" + 'DataNavigateUrlFormatString = "/AC/ProgramaOperativo.aspx?CveProgramaOperativo={0}&EsProyecto={1},&Bloqueado={2}" + + e.Row.FCHyperLink("GvHLAgregar").NavigateUrl = $"/AC/ProgramaOperativo.aspx?CveProgramaOperativo={e.Row.DataKey("CveProgramaOperativo")}&EsProyecto={e.Row.DataKey("EsProyecto")}&Bloqueado={e.Row.DataKey("Bloqueado")}" + + + End If + End Sub + + + Protected Sub BtnProyecto_Click(sender As Object, e As EventArgs) Handles BtnProyecto.Click + Dim objAC As New ClsAC() + objAC.IniciaTransacSQL() + + + + Dim ErrorAC = False + For Each dr As DataRow In DtProgramaOperativo.Rows + If Not objAC.BloquearProgramaOperativo(dr("CveProgramaOperativo").ToString.ToEntero) Then + ErrorAC = True + End If + Next + + If Not ErrorAC Then + objAC.Commit() + Alert("Los Programas Operativos se autorizaron correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al bloquear los Programas Operativos ", TipoMensaje.MsgInformacion) + End If + + + + + objAC.Dispose() + + CargaDatos() + End Sub + + +#Region "I M P R I M I R " + Protected Sub LBPdf_Click(sender As Object, e As EventArgs) + ' ImprimirReporte() + End Sub + Protected Sub LBExcel_Click(sender As Object, e As EventArgs) + ' ImprimirReporte("Excel") + End Sub + Protected Sub ImprimirReporte(Optional Formato As String = "PDF") + 'nombre del archivo a generar + Dim fileName As String = "ReporteProgramaOperativo" + 'ubicacion del rdlc + Dim reportpath As String = "AC/Reportes/RepProgramaOperativo.rdlc" + + 'parametros a enviar al reporte + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") + params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) + params.Add(New ReportParameter("pEjercicio", DdlEjercicio.SelectedValue.ToString)) + ImprimirPDF(reportpath, DtProgramaOperativo, params, fileName, Formato) + End Sub +#End Region + + + + Protected Sub GVD_DataBound(sender As Object, e As EventArgs) + + Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + Dim cell As New TableHeaderCell() + + cell = New TableHeaderCell() + cell.ColumnSpan = 1 + cell.Text = "" + row.Controls.Add(cell) + + cell = New TableHeaderCell() + cell.ColumnSpan = 1 + cell.Text = "" + row.Controls.Add(cell) + + cell = New TableHeaderCell() + cell.ColumnSpan = 1 + cell.Text = "" + + row.Controls.Add(cell) + + cell = New TableHeaderCell() + cell.Text = "POA" + cell.ColumnSpan = 3 + row.Controls.Add(cell) + + cell = New TableHeaderCell() + cell.ColumnSpan = 4 + cell.Text = "Presupuesto" + row.Controls.Add(cell) + + + + cell = New TableHeaderCell() + cell.ColumnSpan = 2 + cell.Text = "" + row.Controls.Add(cell) + Try + GVD.HeaderRow.Parent.Controls.AddAt(0, row) + Catch ex As Exception + + End Try + + + + + End Sub + + + + +End Class diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index be04003c1..97108838c 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -2492,7 +2492,8 @@ Partial Class AF_AF TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, CveMovimientoSalidaInv, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero, FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then - ViewState("CveActivoFijo") = ObjAF.CveActivoFijo + ViewState("CveActivoFijo") = ObjAF.CveActivoFijo + GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing Else ErrorGuardar = True End If @@ -2506,7 +2507,6 @@ Partial Class AF_AF End If Next - If Not ErrorGuardar Then For Each GvRowPlagaEnfermedad As GridViewRow In GvPlagaEnfermedad.Rows If Not ObjAF.AddPlagaEnfermedad(ObjAF.CveActivoFijo, GvRowPlagaEnfermedad.DataKey("Observaciones"), GvRowPlagaEnfermedad.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario) Then @@ -2516,11 +2516,8 @@ Partial Class AF_AF Next End If - - If Not ErrorGuardar Then - For Each GvRowMantenimiento As GridViewRow In GvMantenimientos.Rows Dim CveMantenimientoTemp As Integer = ObjAF.AddMantenimientos(ObjAF.CveActivoFijo, GvRowMantenimiento.DataKey("Mantenimiento"), GvRowMantenimiento.DataKey("Observaciones"), GvRowMantenimiento.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario, "") @@ -2556,7 +2553,6 @@ Partial Class AF_AF End If - Else ErrorGuardar = True Exit For @@ -2564,8 +2560,6 @@ Partial Class AF_AF Next - - End If End If @@ -2603,7 +2597,9 @@ Partial Class AF_AF 'UPHistModificaciones.Update() 'UpDatos.Update() ' GuardaValores() - ErrorGuardar = True + ErrorGuardar = True + Else + GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing End If End If diff --git a/AF/RepDepreciacion.aspx b/AF/RepDepreciacion.aspx index 81b4c087e..1c991098c 100644 --- a/AF/RepDepreciacion.aspx +++ b/AF/RepDepreciacion.aspx @@ -97,7 +97,7 @@
    - + diff --git a/AF/RepDepreciacion.aspx.vb b/AF/RepDepreciacion.aspx.vb index 00cdc75ca..63e255224 100644 --- a/AF/RepDepreciacion.aspx.vb +++ b/AF/RepDepreciacion.aspx.vb @@ -24,28 +24,29 @@ Partial Class AF_RepDepreciacion Protected Sub BtnGenerarDepreciacion_Click(sender As Object, e As System.EventArgs) Handles BtnGenerarDepreciacion.Click - If GvDatos.Rows.Count > 0 Then Dim CveActivoFijo As Integer Dim ObjInventario As New ClsInventarios Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ErrorMovInv As Boolean = False Dim ConceptoPoliza As String = String.Format("Depreciación - {0}", txtFechaI.Text) - Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer ' = DdlSubProyecto.SelectedValue.ToEntero Dim CvePrePoliza = ObjConta.AddPrePolizas("Depreciacion", 74, 0, 0, 1, txtFechaI.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) For Each RowsDt As GridViewRow In GvDatos.Rows CveActivoFijo = RowsDt.DataKey("CveActivoFijo").ToEntero + CveSubProyecto = RowsDt.DataKey("CveSubProyecto").ToEntero Dim MontoDepreciacion As Decimal = RowsDt.FCLiteral("LtlDepreciacionMensual").Text.ToDecimal If MontoDepreciacion > 0 And CveActivoFijo <> 0 Then Dim ConceptoPolizaDetalle As String = String.Format("Depreciación - {0} - {1}", txtFechaI.Text, RowsDt.FCLiteral("LtlDescripcion").Text) If CvePrePoliza > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, -MontoDepreciacion, -MontoDepreciacion, 270, ConceptoPolizaDetalle, ConceptoPolizaDetalle, 0, CveActivoFijo:=CveActivoFijo, CveSubProyecto:=CveSubProyecto) Then + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, MontoDepreciacion, MontoDepreciacion, 101, ConceptoPolizaDetalle, ConceptoPolizaDetalle, 0, CveActivoFijo:=CveActivoFijo, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True Exit For End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, MontoDepreciacion, MontoDepreciacion, 101, ConceptoPolizaDetalle, ConceptoPolizaDetalle, 0, CveActivoFijo:=CveActivoFijo, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, MontoDepreciacion, MontoDepreciacion, 270, ConceptoPolizaDetalle, ConceptoPolizaDetalle, 0, CveActivoFijo:=CveActivoFijo, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True Exit For End If @@ -54,7 +55,6 @@ Partial Class AF_RepDepreciacion Exit For End If End If - Next If ErrorMovInv = False Then diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 9633d73ca..9d44d0e67 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -121,7 +121,7 @@ + diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index 739276730..1ac31b0e6 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -20,6 +20,21 @@ Partial Class Acumuladores_CatFoliosGarantia End Property + Private Property CveMovimiento As Integer + Get + If ViewState("CveMovimiento") IsNot Nothing Then + Return ViewState("CveMovimiento").ToString.ToEntero + Else + Return -1 + End If + + End Get + Set(value As Integer) + ViewState("CveMovimiento") = value + End Set + + End Property + Private Property Actualizar As Boolean Get If Not ViewState("Actualizar") Is Nothing Then @@ -219,13 +234,14 @@ Partial Class Acumuladores_CatFoliosGarantia Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) CveFolioGarantia = GvRow.DataKey("CveFolioGarantia") - + CveMovimiento = IIf(GvRow.DataKey("CveMovimiento") <> "", GvRow.DataKey("CveMovimiento"), -1) LblFolio.Text = GvRow.DataKey("FolioGarantia") Using ObjAcum As New ClsAcumuladores If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia, CveEstatusConsecutivo:=DdlEstatusConsecutivo.SelectedValue.ToEntero()) Then GvGarantiasDetalle.DataSource = ObjAcum.DtResultados HplGenerarSalida.NavigateUrl = "/Inventarios/TraspasoAlmacen.aspx?CveFolioGarantia=" & CveFolioGarantia + HplGenerarSalida.Visible = (CveMovimiento = -1) End If End Using GvGarantiasDetalle.DataBind() diff --git a/App_Code/ClsAC.vb b/App_Code/ClsAC.vb index a48e0b047..7cfe17261 100644 --- a/App_Code/ClsAC.vb +++ b/App_Code/ClsAC.vb @@ -140,10 +140,32 @@ Public Class ClsAC Return Retorno End Function - Public Function GetProgramaOperativo() As Boolean + Public Function GetProgramasOperativosAvances(CveProgramaOperativo As Integer, CveEmpresa As Integer, Proyecto As Boolean, Optional Ejercicio As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_AC_ProgramasOperativosAvancesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProgramaOperativo", SqlDbType.Int).Value = CveProgramaOperativo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Ejercicio", SqlDbType.SmallInt).Value = Ejercicio + .Add("@EsProyecto", SqlDbType.Bit).Value = Proyecto + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los programas Operativos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + Public Function GetProgramaOperativo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ProgramaOperativoGet") - + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1013,9 +1035,12 @@ Public Class ClsAC #End Region #Region "AC_UnidadesAdministrativas" - Public Function GetUnidadesAdministrativas() As Boolean + Public Function GetUnidadesAdministrativas(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_UnidadesAdministrativasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1107,9 +1132,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionGeografica" - Public Function GetClasificacionGeografica() As Boolean + Public Function GetClasificacionGeografica(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionGeograficaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1741,9 +1769,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionFuncional" - Public Function GetClasificacionFuncional() As Boolean + Public Function GetClasificacionFuncional(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionFuncionalGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1832,9 +1863,12 @@ Public Class ClsAC #End Region #Region "AC_FuentesFinanciamiento" - Public Function GetFuentesFinanciamiento() As Boolean + Public Function GetFuentesFinanciamiento(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_FuentesFinanciamientoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2203,9 +2237,12 @@ Public Class ClsAC #End Region #Region "AC_ClasificacionAdministrativa" - Public Function GetClasificacionAdministrativa() As Boolean + Public Function GetClasificacionAdministrativa(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_ClasificacionAdministrativaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2295,9 +2332,12 @@ Public Class ClsAC #End Region #Region "AC_PD_EjeRector" - Public Function GetPD_EjeRector() As Boolean + Public Function GetPD_EjeRector(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_PD_EjeRectorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2767,9 +2807,12 @@ Public Class ClsAC #End Region #Region "AC_FuentesRecaudacion" - Public Function GetFuentesRecaudacion() As Boolean + Public Function GetFuentesRecaudacion(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AC_FuentesRecaudacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 8c9eb613c..e9aa5a929 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -1246,6 +1246,27 @@ Public Class ClsAcumuladores Return Retorno End Function + Public Function GetFoliosGarantiasDetalleDisponibles(CveFolioGarantia As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + SqlDataAdapter("PA_Acum_GarantiasDetalleFolioDisponibleGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar los movimientos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateGarantiaCancelacion(CveVenta As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 912ad3e9f..4073459b0 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -197,7 +197,7 @@ Public Class ClsCompras Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1, - Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1) As Boolean + Optional CveContrato As Integer = -1, Optional EsImportacion As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional DoctosRelacionados As String = "-1", Optional CveFolioGarantia As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -251,7 +251,8 @@ Public Class ClsCompras .Add("@CveContrato", SqlDbType.Int).Value = CveContrato .Add("@EsImportacion", SqlDbType.Bit).Value = EsImportacion .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - + .Add("@DoctosRelacionados", SqlDbType.VarChar).Value = DoctosRelacionados + .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia End With Try @@ -275,7 +276,8 @@ Public Class ClsCompras Public Function UpdateCompra(Descripcion As String, FolioSecundario As String, FechaVencimiento As Date, AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer, CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0, Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, - Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Optional CveFactura As Integer = -1, Optional CveContrato As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveRetISRConcepto As Integer = -1, Optional CveSubProyecto As Integer = -1, + Optional CveFolioGarantia As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -305,11 +307,10 @@ Public Class ClsCompras .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@CveFactura", SqlDbType.Int).Value = CveFactura .Add("@CveContrato", SqlDbType.Int).Value = CveContrato - .Add("@CveRetIVAConcepto", SqlDbType.Int).Value = CveRetIVAConcepto .Add("@CveRetISRConcepto", SqlDbType.Int).Value = CveRetISRConcepto - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia End With Try diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 952337c9a..92b5aa4d1 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1019,21 +1019,25 @@ Public Class ClsContabilidad Dim dtt As DataTable = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable) Dim StrMsg As String = "" If dtt IsNot Nothing Then + Dim tCveEmp As Integer = CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa Dim dr As Data.DataRow = dtt.FiltroPrimero("") If dr IsNot Nothing Then StrMsg = dr("ConceptoContable").ToString If dr("AplicaClasificacion").ToString = "True" Then - StrMsg = StrMsg + " - Clasificación: " + ClsPaginas.GlobalDTClasificaciones(CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("Clasificacion", "") + StrMsg = StrMsg + " - Clasificación: " + ClsPaginas.GlobalDTClasificaciones(tCveEmp, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("Clasificacion", "") + End If + If dr("AplicaActivoFijo").ToString = "True" Then + StrMsg = StrMsg + " - Activo Fijo: " + ClsPaginas.GlobalDTActivoFijos(tCveEmp, CveActivoFijo:=CveActivoFijo).FiltroPrimeroValor("CodigoDescripcion", "") + End If + If dr("AplicaProveedor").ToString = "True" Then + StrMsg = StrMsg + " - Proveedor: " + ClsPaginas.GlobalDTCompProveedores(tCveEmp, CveProveedor:=CveProveedor).FiltroPrimeroValor("NombreComercial", "") End If End If End If OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", StrMsg), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto2 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then - Dim Concepto3 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") - OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") OrElse ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then + Dim Concepto2 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable") + OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50025;") Then OnError("La empresa no tiene un formato de cuenta asignado.", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex1.Message.Contains("50026;") Then diff --git a/App_Code/ClsFlotillas.vb b/App_Code/ClsFlotillas.vb index 10ea41055..569737e73 100644 --- a/App_Code/ClsFlotillas.vb +++ b/App_Code/ClsFlotillas.vb @@ -142,11 +142,12 @@ Public Class ClsFlotillas #Region " C O M B U S T I B L E S " - Public Function GetCombustibles() As Boolean + Public Function GetCombustibles(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Flo_CombustiblesGet") - - + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index f1f307ee8..51915e47c 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -531,10 +531,27 @@ Public Class ClsGPS OnError("Ocurrió un error al obtener las coordenadas del equipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try + Return Retorno + End Function + + + Public Function DispositivoComentarioupdate(CveDispositivo As Integer, comentario As String, CveUsuario As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_GPS_DispositivoComentarioupdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo + .Add("@Comentarios", SqlDbType.VarChar).Value = comentario + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las coordenadas del equipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno End Function - - Public Function UltimaPosicionEquipoGet(CveDispositivos As String, CveCliente As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GPS_UltimaPosicionTGet") @@ -3072,7 +3089,7 @@ Public Class ClsGPS #Region "Dispositivos" Public Function DispositivoAdd(TipoDispositivo As Integer, NumTelefono As String, CveModelo As Integer, CveProveedorComunicacionCuenta As Integer, CveCliente As Integer, IMEI As String, Serie As String, CveEstatus As Integer, SerieVehiculo As String, ColorVehiculo As String, NombreVehiculo As String, NoEconomico As String, devID As String, devPort As Integer, ModeloVehiculo As String, AñoVehiculo As String, ClaseVehiculo As String, PlacasVehiculo As String, LimiteVelocidad As Boolean, VelocidadMaxima As Double, - DetallesVehiculo As String, Rendimiento As Double, Icono As String, ColorTrazo As String, CveUsuario As Integer) As Boolean + DetallesVehiculo As String, Rendimiento As Double, Icono As String, ColorTrazo As String, CveUsuario As Integer, AsignadoEn As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GPS_DispositivosAdd") With SqlAdapter.SelectCommand.Parameters @@ -3102,6 +3119,7 @@ Public Class ClsGPS .Add("@Icono", SqlDbType.VarChar).Value = Icono .Add("@ColorTrazo", SqlDbType.VarChar).Value = ColorTrazo .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@AsignadoEn", SqlDbType.VarChar).Value = AsignadoEn End With @@ -3283,7 +3301,7 @@ Public Class ClsGPS Public Function DispositivosUpdate(TipoDispositivo As Integer, NumTelefono As String, CveDispositivo As Integer, CveModelo As Integer, CveProveedorComunicacionCuenta As Integer, CveCliente As Integer, IMEI As String, Serie As String, CveEstatus As Integer, SerieVehiculo As String, ColorVehiculo As String, NombreVehiculo As String, NoEconomico As String, devID As String, devPort As Integer, ModeloVehiculo As String, AñoVehiculo As String, ClaseVehiculo As String, PlacasVehiculo As String, LimiteVelocidad As Boolean, VelocidadMaxima As Double, - DetallesVehiculo As String, Rendimiento As Double, Icono As String, ColorTrazo As String, CveUsuario As Integer) As Boolean + DetallesVehiculo As String, Rendimiento As Double, Icono As String, ColorTrazo As String, CveUsuario As Integer, AsignadoEn As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GPS_DispositivosUpdate") With SqlAdapter.SelectCommand.Parameters @@ -3313,6 +3331,7 @@ Public Class ClsGPS .Add("@Icono", SqlDbType.VarChar).Value = Icono .Add("@ColorTrazo", SqlDbType.VarChar).Value = ColorTrazo .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@AsignadoEn", SqlDbType.VarChar).Value = AsignadoEn End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index d24033dfe..fa1c9f6d7 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3,7 +3,8 @@ Option Explicit On Imports System.Data Imports System.Data.SqlClient Imports Extensiones - +Imports Stimulsoft.Base.Analysis + Public Class ClsGenerales Implements IDisposable @@ -1621,7 +1622,14 @@ Public Class ClsGenerales ' Me.OnError("Ocurrió un error al Guardar el registro.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' End If Catch ex As Exception - OnError("Ocurrió un error al Guardar la cuenta", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then + OnError($"Ocurrió un error al Guardar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al Guardar la cuenta", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + + End Try Return Retorno @@ -1653,7 +1661,7 @@ Public Class ClsGenerales Return Retorno End Function - Public Function UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer) As Boolean + Public Function UpdateCuentasDepositosPersonal(CveCuentaDeposito As Integer, BancoNombre As String, Cuenta As String, CLABE As String, CveMoneda As Integer, CveUsuarioModifico As Integer, EstatusPagoElectronico As Boolean, Estatus As Boolean, CveSATBanco As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_CuentasDepositosPersonalUpdate") @@ -1678,11 +1686,21 @@ Public Class ClsGenerales Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then + OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) Else + Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then + OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If + + End Try Return Retorno @@ -1727,12 +1745,19 @@ Public Class ClsGenerales Retorno = True Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then - Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia) + Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then + OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) Else Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If - Catch ex As Exception - OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Catch ex As Exception + + If ex.Message.Contains("IX_Gral_CuentasDepositos_CLABE") Then + OnError($"Ocurrió un error al actualizar la cuenta, la CLABE {CLABE} ya esta registrada en otra cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + Else + OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End If End Try Return Retorno diff --git a/App_Code/ClsGralProductosServiciosCaracteristicas.vb b/App_Code/ClsGralProductosServiciosCaracteristicas.vb index 8ee0d7822..593903c4f 100644 --- a/App_Code/ClsGralProductosServiciosCaracteristicas.vb +++ b/App_Code/ClsGralProductosServiciosCaracteristicas.vb @@ -100,7 +100,7 @@ Public Class ClsGralProductosServiciosCaracteristicas #End Region #Region "ProductosServiciosCaracteristicas" - Public Function GetProductosServiciosCaracteristicas(Optional CveEmpresa As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Public Function GetProductosServiciosCaracteristicas(CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GRAL_ProductosServiciosCaracteristicasGet") @@ -203,7 +203,7 @@ Public Class ClsGralProductosServiciosCaracteristicas #Region "ProductosServiciosCaracteristicasOpciones" - Public Function GetProductosServiciosCaracteristicasOpciones(Optional CveEmpresa As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean + Public Function GetProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GRAL_ProductosServiciosCaracteristicasOpcionesGet") diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 18f5f4656..dc48e03e1 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -597,26 +597,48 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTCuentasDepositosClientes(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional Estatus As Boolean = True) As DataTable + Property GlobalDTCuentasDepositosClientes(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveCuentaDeposito As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTCuentasDepositosClientes-{CveEmpresa}" - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim P As New ClsGenerales - If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-2) Then Application(AppNombre) = P.DtResultados + If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-2) Then HttpContext.Current.Application(AppNombre) = P.DtResultados P.Dispose() End If - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCliente <> -1 Then Str.AppendFormat(" AND CveCliente = {0}", CveCliente) - If Estatus = True Then Str.AppendFormat(" AND Estatus = 1 ") - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim filtros As New List(Of String) + If CveCliente <> -1 Then filtros.Add($"CveCliente = {CveCliente}") + If CveCuentaDeposito <> -1 Then filtros.Add($"CveCuentaDeposito = {CveCuentaDeposito}") + + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTCuentasDepositosClientes = Dv.ToTable Dv.Dispose() End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTCuentasDepositosClientes-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + + Property GlobalDTCuentasDepositosPersonales(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveCuentaDeposito As Integer = -1) As DataTable + Get + Dim AppNombre As String = $"GlobalDTCuentasDepositosPersonales-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim P As New ClsGenerales + If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CvePersonal:=-2) Then HttpContext.Current.Application(AppNombre) = P.DtResultados + P.Dispose() + End If + Dim filtros As New List(Of String) + If CvePersonal <> -1 Then filtros.Add($"CvePersonal = {CvePersonal}") + If CveCuentaDeposito <> -1 Then filtros.Add($"CveCuentaDeposito = {CveCuentaDeposito}") + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTCuentasDepositosPersonales = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTCuentasDepositosPersonales-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable @@ -745,7 +767,7 @@ Public Class ClsPaginas Application("GlobalDTNomSatTipoIncapacidad") = value End Set End Property - 'Este GlobalDT no estoy seguro si se deba segmentar por empresa, se usa mucho en todos lados + 'Este GlobalDT no debe segmentarse por empresas, puesto que es para todas las empresas Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable Get Dim AppNombre As String = "GlobalDTEmpresas" @@ -759,6 +781,7 @@ Public Class ClsPaginas If Not IO.Directory.Exists(Ruta) Then IO.Directory.CreateDirectory(Ruta) If Not System.IO.Directory.Exists(String.Format("{0}\XML\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\XML\", Ruta)) If Not System.IO.Directory.Exists(String.Format("{0}\PDF\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\PDF\", Ruta)) + If Not System.IO.Directory.Exists(String.Format("{0}\Temp\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\Temp\", Ruta)) Next End If End Using @@ -824,12 +847,12 @@ Public Class ClsPaginas End Set End Property #End Region - Public Shared Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones(CveEmpresa As Integer, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If Dim filtros As New List(Of String) @@ -865,26 +888,25 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificaciones2(CveEmpresa As Integer, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" - 'sino existe, recarga los datos - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=4) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados ObjClasificaciones.Dispose() End If If CveCategoria <> -1 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) GlobalDTClasificaciones2 = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificaciones2 = DirectCast(Application(AppNombre), DataTable) + GlobalDTClasificaciones2 = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTClasificaciones2-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTClasificacionesSubProyectos(Optional CveClasificacion As Integer = -1, Optional CveEmpresa As Integer = -1) As DataTable @@ -910,12 +932,12 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTACClasificadorObjetoGasto(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Property GlobalDTACClasificadorObjetoGasto(CveEmpresa As Integer, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTACClasificadorObjetoGasto-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim ObjClasificaciones As New ClsClasificaciones - If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados.FiltraParametros("Codigo <> '' ") ObjClasificaciones.Dispose() End If Dim filtros As New List(Of String) @@ -933,7 +955,7 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificacionesDetalle(Optional CveEmpresa As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Property GlobalDTClasificacionesDetalle(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTClasificacionesDetalle-{CveEmpresa}" If Application(AppNombre) Is Nothing Then @@ -954,27 +976,30 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTSubFamilias(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable + Public Shared Property GlobalDTSubFamilias(CveEmpresa As Integer, Optional CveCategoria As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - Dim Dv As New DataView(DirectCast(Application("GlobalDTSubFamilias"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTSubFamilias-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=2) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + End Using + End If + If CveCategoria <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows) GlobalDTSubFamilias = Dv.ToTable Dv.Dispose() Else - GlobalDTSubFamilias = DirectCast(Application("GlobalDTSubFamilias"), DataTable) + GlobalDTSubFamilias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTSubFamilias") = value + Dim AppNombre As String = $"GlobalDTSubFamilias-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTFamilias(Optional CveEmpresa As Integer = -1) As DataTable + Property GlobalDTFamilias(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTFamilias-{CveEmpresa}" - 'sino existe, recarga los datos If Application(AppNombre) Is Nothing Then Dim ObjGenerales As New ClsGenerales If ObjGenerales.GetCategorias(CveEmpresa, 2) Then Application(AppNombre) = ObjGenerales.DtResultados @@ -987,7 +1012,7 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTCategoriasPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable + Property GlobalDTCategoriasPresupuestos(CveEmpresa As Integer) As DataTable Get Dim AppNombre As String = $"GlobalDTCategoriasPresupuestos-{CveEmpresa}" If Application(AppNombre) Is Nothing Then @@ -1023,18 +1048,19 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTClasificacionesPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable + Public Shared Property GlobalDTClasificacionesPresupuestos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificacionesPresupuestos"), DataTable), String.Format("CveEmpresa = {0} ", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTClasificacionesPresupuestos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTClasificacionesPresupuestos = DirectCast(Application("GlobalDTClasificacionesPresupuestos"), DataTable) + Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa:=CveEmpresa, Tipo:=3) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados + End Using End If + GlobalDTClasificacionesPresupuestos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTClasificacionesPresupuestos") = value + Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTMetodosPago() As DataTable @@ -1452,48 +1478,48 @@ Public Class ClsPaginas Application("GlobalDTCaracteristicasOpciones") = value End Set End Property - Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquipos = DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquipos") = value - End Set - End Property - Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value - End Set - End Property - Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTTipoCuentasEquiposOpciones = DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTTipoCuentasEquiposOpciones") = value - End Set - End Property + 'Property GlobalDTTipoCuentasEquipos(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquipos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquipos = DirectCast(Application("GlobalDTTipoCuentasEquipos"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquipos") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquiposCaracteristicas(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposCaracteristicas = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposCaracteristicas = DirectCast(Application("GlobalDTTipoCuentasEquiposCaracteristicas"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquiposCaracteristicas") = value + ' End Set + 'End Property + 'Property GlobalDTTipoCuentasEquiposOpciones(CveEmpresa As Integer) As DataTable + ' Get + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTTipoCuentasEquiposOpciones = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTTipoCuentasEquiposOpciones = DirectCast(Application("GlobalDTTipoCuentasEquiposOpciones"), DataTable) + ' End If + ' End Get + ' Set(value As DataTable) + ' Application("GlobalDTTipoCuentasEquiposOpciones") = value + ' End Set + 'End Property ''Property GlobalDTProductosServicios(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional Estatus As Integer = 1, ' Optional CvePS As Integer = -1, Optional AplicaParaVenta As Integer = -1, Optional CveTipoPS As Integer = -1, Optional SATClavePS As String = "-1") As DataTable ' Get @@ -1633,18 +1659,20 @@ Public Class ClsPaginas HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicas = DirectCast(Application("GlobalDTProductosServiciosCaracteristicas"), DataTable) + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProductosServiciosCaracteristicas As New ClsGralProductosServiciosCaracteristicas + If ObjProductosServiciosCaracteristicas.GetProductosServiciosCaracteristicas(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProductosServiciosCaracteristicas.DtResultados + End Using End If + GlobalDTProductosServiciosCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicas") = value + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable @@ -1669,18 +1697,20 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicasOpciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProductosServiciosCaracteristicas As New ClsGralProductosServiciosCaracteristicas + If ObjProductosServiciosCaracteristicas.GetProductosServiciosCaracteristicasOpciones(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProductosServiciosCaracteristicas.DtResultados + End Using End If + GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value + Dim AppNombre As String = $"GlobalDTProductosServiciosCaracteristicasOpciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTInvMetodosInventario() As DataTable @@ -2403,47 +2433,63 @@ Public Class ClsPaginas End Property #End Region #Region " **********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosCaracteristicasClasificaciones() As DataTable + Public Shared Property GlobalDTProspectosCaracteristicasClasificaciones(CveEmpresa As Integer) As DataTable Get - GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(Application("GlobalDTProspectosCaracteristicasClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicasClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosCaracteristicasClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicasClasificaciones") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosTiposCaracteristicas() As DataTable + Public Shared Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable Get - GlobalDTProspectosTiposCaracteristicas = DirectCast(Application("GlobalDTProspectosTiposCaracteristicas"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosTiposCaracteristicas") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosCaracteristicas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosCaracteristicasOpciones(CveEmpresa As Integer, CveCaracteristica As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosCaracteristicas = Dv.ToTable + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasOpciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCaracteristicasOpciones(CveCaracteristica:=CveCaracteristica, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveCaracteristica <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCaracteristica = {CveCaracteristica}", "", DataViewRowState.CurrentRows) + GlobalDTProspectosCaracteristicasOpciones = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosCaracteristicas = DirectCast(Application("GlobalDTProspectosCaracteristicas"), DataTable) + GlobalDTProspectosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicas") = value - End Set - End Property - Property GlobalDTProspectosCaracteristicasOpciones() As DataTable - Get - GlobalDTProspectosCaracteristicasOpciones = DirectCast(Application("GlobalDTProspectosCaracteristicasOpciones"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTProspectosCaracteristicasOpciones") = value + Dim AppNombre As String = $"GlobalDTProspectosCaracteristicasOpciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region #Region "***********************************************************************DT ACTIVOS FIJOS**********************************************************************************" - Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable + Public Shared Property GlobalDTActivoFijos(CveEmpresa As Integer, Optional CveSubTipoActivoFijo As Integer = -1, Optional CveActivoFijo As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTActivoFijo-{CveEmpresa}" If HttpContext.Current.Application(AppNombre) Is Nothing Then @@ -2460,7 +2506,7 @@ Public Class ClsPaginas End Get Set(ByVal value As DataTable) Dim AppNombre As String = $"GlobalDTActivoFijo-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value End Set End Property Public Shared Property GlobalDTEstadoActivoFijo() As DataTable @@ -2651,124 +2697,145 @@ Public Class ClsPaginas End Property #End Region #Region "***********************************************************************DT PROSPECTOS*************************************************************************************" - Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSupervisores(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSupervisores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSupervisores = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSupervisores = DirectCast(Application("GlobalDTProspectosSupervisores"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSupervisores-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSupervisores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSupervisores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSupervisores") = value + Dim AppNombre As String = $"GlobalDTProspectosSupervisores-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosCoordinadores(CveSupervisor As Integer, CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveSupervisor <> -1 Then Str.AppendFormat(" {0} CveSupervisor = {1}", If(Str.Length > 0, "AND", ""), CveSupervisor) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosCoordinadores"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosCoordinadores-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetCoordinadores(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveSupervisor <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveSupervisor = {CveSupervisor}", "", DataViewRowState.CurrentRows) GlobalDTProspectosCoordinadores = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosCoordinadores = DirectCast(Application("GlobalDTProspectosCoordinadores"), DataTable) + GlobalDTProspectosCoordinadores = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosCoordinadores") = value + Dim AppNombre As String = $"GlobalDTProspectosCoordinadores-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosApoyos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyos = DirectCast(Application("GlobalDTProspectosApoyos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosApoyos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectoApoyo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosApoyos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosApoyos") = value + Dim AppNombre As String = $"GlobalDTProspectosApoyos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosClasificaciones(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosClasificaciones = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosClasificaciones = DirectCast(Application("GlobalDTProspectosClasificaciones"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosClasificaciones-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosClasificaciones") = value + Dim AppNombre As String = $"GlobalDTProspectosClasificaciones-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEventosTipo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEventosTipo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosEventosTipo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEventosTipo = DirectCast(Application("GlobalDTProspectosEventosTipo"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEventosTipo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetEventosTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosEventosTipo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEventosTipo") = value + Dim AppNombre As String = $"GlobalDTProspectosEventosTipo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEvento(CveEventoTipo As Integer, CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEventoTipo <> -1 Then Str.AppendFormat(" {0} CveEventoTipo = {1}", If(Str.Length > 0, "AND", ""), CveEventoTipo) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEvento"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEvento-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosEventos(CveEvento:=-1, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveEventoTipo <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEventoTipo = {CveEventoTipo}", "", DataViewRowState.CurrentRows) GlobalDTProspectosEvento = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEvento = DirectCast(Application("GlobalDTProspectosEvento"), DataTable) + GlobalDTProspectosEvento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEvento") = value + Dim AppNombre As String = $"GlobalDTProspectosEvento-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEstatus(CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEstatus"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEstatus = DirectCast(Application("GlobalDTProspectosEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosEventos(CveEvento:=-1, CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEstatus") = value + Dim AppNombre As String = $"GlobalDTProspectosEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosApoyosTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosApoyosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosApoyosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosApoyosTipos = DirectCast(Application("GlobalDTProspectosApoyosTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosApoyosTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetApoyoTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosApoyosTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosApoyosTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosApoyosTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTProspectosApoyosTipos() As DataTable @@ -2779,138 +2846,175 @@ Public Class ClsPaginas Application("GlobalDTProspectosApoyosTipos") = value End Set End Property - Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosTiposCaracteristicas(CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEncuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) - GlobalDTProspectosEncuestas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosEncuestas = DirectCast(Application("GlobalDTProspectosEncuestas"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosTiposCaracteristicas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetTiposCaracteristicas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosTiposCaracteristicas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestas") = value + Dim AppNombre As String = $"GlobalDTProspectosTiposCaracteristicas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEncuestas(CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta) - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEncuestasPreguntas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEncuestas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetEncuestas(CveEmpresa:=CveEmpresa, CveEncuesta:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + GlobalDTProspectosEncuestas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTProspectosEncuestas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + Public Shared Property GlobalDTProspectosEncuestasPreguntas(CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = $"GlobalDTProspectosEncuestasPreguntas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetPreguntas(CveEmpresa:=CveEmpresa, CveEncuesta:=-1, CveUsuario:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + If CveEncuesta <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEncuesta = {CveEncuesta}", "", DataViewRowState.CurrentRows) GlobalDTProspectosEncuestasPreguntas = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEncuestasPreguntas = DirectCast(Application("GlobalDTProspectosEncuestasPreguntas"), DataTable) + GlobalDTProspectosEncuestasPreguntas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestasPreguntas") = value + Dim AppNombre As String = $"GlobalDTProspectosEncuestasPreguntas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosEncuestasRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As DataTable Get - Dim Str As New StringBuilder - If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveEncuesta <> -1 Then Str.AppendFormat(" {0} CveEncuesta = {1}", If(Str.Length > 0, "AND", ""), CveEncuesta) - If CvePregunta <> -1 Then Str.AppendFormat(" {0} CvePregunta = {1}", If(Str.Length > 0, "AND", ""), CvePregunta) - - If Str.Length > 0 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosEncuestasRespuestas"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosEncuestasRespuestas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetRespuestas(CveEmpresa:=CveEmpresa, CvePregunta:=-1, CveEncuesta:=-1) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CvePregunta <> -1 Then filtros.Add($"CvePregunta = {CvePregunta}") + If CveEncuesta <> -1 Then filtros.Add($"CveEncuesta = {CveEncuesta}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTProspectosEncuestasRespuestas = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosEncuestasRespuestas = DirectCast(Application("GlobalDTProspectosEncuestasRespuestas"), DataTable) + GlobalDTProspectosEncuestasRespuestas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosEncuestasRespuestas") = value + Dim AppNombre As String = $"GlobalDTProspectosEncuestasRespuestas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosTipos = DirectCast(Application("GlobalDTProspectosTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosTipos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #Region " DT PROSPECTOS SOLICITUDES" - Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudes(CveEmpresa As Integer, Optional CveProspecto As Integer = -1, Optional CveApoyoTipo As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProspectoSolicitud As Integer = -1) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudes"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudes-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetProspectosSolicitudes(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using + End If + Dim filtros As New List(Of String) + If CveProspecto <> -1 Then filtros.Add($"CveProspecto = {CveProspecto}") + If CveApoyoTipo <> -1 Then filtros.Add($"CveApoyoTipo = {CveApoyoTipo}") + If CveClasificacion <> -1 Then filtros.Add($"CveClasificacion = {CveClasificacion}") + If CveProspectoSolicitud <> -1 Then filtros.Add($"CveProspectoSolicitud = {CveProspectoSolicitud}") + If filtros.Count > 0 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTProspectosSolicitudes = Dv.ToTable Dv.Dispose() Else - GlobalDTProspectosSolicitudes = DirectCast(Application("GlobalDTProspectosSolicitudes"), DataTable) + GlobalDTProspectosSolicitudes = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudes") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudes-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudesEstatus(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesEstatus = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesEstatus = DirectCast(Application("GlobalDTProspectosSolicitudesEstatus"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesEstatus-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSolicitudEstatus(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSolicitudesEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesEstatus") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesEstatus-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTProspectosSolicitudesTipos(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesTipos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesTipos = DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable) + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjProspectos As New ClsProspectos + If ObjProspectos.GetSolicitudTipo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProspectos.DtResultados + End Using End If + GlobalDTProspectosSolicitudesTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesTipos") = value + Dim AppNombre As String = $"GlobalDTProspectosSolicitudesTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - 'Property GlobalDTProspectosSolicitudesTipos() As DataTable + 'Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable ' Get - ' GlobalDTProspectosSolicitudesTipos = DirectCast(Application("GlobalDTProspectosSolicitudesTipos"), DataTable) + ' If CveEmpresa <> -1 Then + ' Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + ' GlobalDTProspectosSolicitudesApoyos = Dv.ToTable + ' Dv.Dispose() + ' Else + ' GlobalDTProspectosSolicitudesApoyos = DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) + ' End If ' End Get ' Set(value As DataTable) - ' Application("GlobalDTProspectosSolicitudesTipos") = value + ' Application("GlobalDTProspectosSolicitudesApoyos") = value ' End Set 'End Property - Property GlobalDTProspectosSolicitudesApoyos(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTProspectosSolicitudesApoyos = Dv.ToTable - Dv.Dispose() - Else - GlobalDTProspectosSolicitudesApoyos = DirectCast(Application("GlobalDTProspectosSolicitudesApoyos"), DataTable) - End If - End Get - Set(value As DataTable) - Application("GlobalDTProspectosSolicitudesApoyos") = value - End Set - End Property #End Region #End Region #Region "**********************************************DT AMORTIZACIÓN CONTABLE PLAN DE DESARROLLO********************************************************************************" @@ -2923,19 +3027,20 @@ Public Class ClsPaginas Application("GlobalDTAC_RubrosIngreso") = value End Set End Property - Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_FuentesRecaudacion(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_FuentesRecaudacion"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesRecaudacion = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesRecaudacion = DirectCast(Application("GlobalDTAC_FuentesRecaudacion"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_FuentesRecaudacion-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetFuentesRecaudacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_FuentesRecaudacion = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_FuentesRecaudacion") = value + Dim AppNombre As String = $"GlobalDTAC_FuentesRecaudacion-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_FuentesFinanciamiento() As DataTable @@ -2977,47 +3082,52 @@ Public Class ClsPaginas Application("GlobalDTAC_Ubicaciones") = value End Set End Property - Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_UnidadesAdministrativas(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_UnidadesAdministrativas"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_UnidadesAdministrativas = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_UnidadesAdministrativas = DirectCast(Application("GlobalDTAC_UnidadesAdministrativas"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_UnidadesAdministrativas-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetUnidadesAdministrativas(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_UnidadesAdministrativas = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_UnidadesAdministrativas") = value + Dim AppNombre As String = $"GlobalDTAC_UnidadesAdministrativas-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionFuncional(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionFuncional"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionFuncional = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionFuncional = DirectCast(Application("GlobalDTAC_ClasificacionFuncional"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionFuncional-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionFuncional(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionFuncional = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionFuncional") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionFuncional-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionGeografica(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionGeografica"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionGeografica = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionGeografica = DirectCast(Application("GlobalDTAC_ClasificacionGeografica"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionGeografica-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionGeografica(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionGeografica = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionGeografica") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionGeografica-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_Cuentas() As DataTable @@ -3044,19 +3154,20 @@ Public Class ClsPaginas ' Application("GlobalDTAC_FuenteFinanciamiento") = value ' End Set 'End Property - Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_FuentesFinanciamiento(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As String = String.Format("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_FuentesFinanciamiento"), DataTable), StrSQL, "", DataViewRowState.CurrentRows) - GlobalDTAC_FuentesFinanciamiento = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_FuentesFinanciamiento = DirectCast(Application("GlobalDTAC_FuentesFinanciamiento"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_FuentesFinanciamiento-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetFuentesFinanciamiento(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_FuentesFinanciamiento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_FuentesFinanciamiento") = value + Dim AppNombre As String = $"GlobalDTAC_FuentesFinanciamiento-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_FuentesFinanciamientoCONAC() As DataTable @@ -3115,18 +3226,20 @@ Public Class ClsPaginas Application("GlobalDTAC_SubProgramas") = value End Set End Property - Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ClasificacionAdministrativa(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ClasificacionAdministrativa = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ClasificacionAdministrativa = DirectCast(Application("GlobalDTAC_ClasificacionAdministrativa"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ClasificacionAdministrativa-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetClasificacionAdministrativa(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ClasificacionAdministrativa = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ClasificacionAdministrativa") = value + Dim AppNombre As String = $"GlobalDTAC_ClasificacionAdministrativa-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_TipoGasto() As DataTable @@ -3137,18 +3250,20 @@ Public Class ClsPaginas Application("GlobalDTAC_TipoGasto") = value End Set End Property - Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_ProgramaOperativo(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_ProgramaOperativo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_ProgramaOperativo = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_ProgramaOperativo = DirectCast(Application("GlobalDTAC_ProgramaOperativo"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_ProgramaOperativo-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetProgramaOperativo(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_ProgramaOperativo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_ProgramaOperativo") = value + Dim AppNombre As String = $"GlobalDTAC_ProgramaOperativo-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_MatrizIngresos() As DataTable @@ -3169,18 +3284,20 @@ Public Class ClsPaginas End Property #End Region - Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTAC_PD_EjeRector(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTAC_PD_EjeRector"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTAC_PD_EjeRector = Dv.ToTable - Dv.Dispose() - Else - GlobalDTAC_PD_EjeRector = DirectCast(Application("GlobalDTAC_PD_EjeRector"), DataTable) + Dim AppNombre As String = $"GlobalDTAC_PD_EjeRector-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjAC As New ClsAC + If ObjAC.GetPD_EjeRector(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjAC.DtResultados + End Using End If + GlobalDTAC_PD_EjeRector = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTAC_PD_EjeRector") = value + Dim AppNombre As String = $"GlobalDTAC_PD_EjeRector-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTAC_PD_Programas(CveEjeRector As Integer) As DataTable @@ -3627,36 +3744,43 @@ Public Class ClsPaginas End Property #End Region #Region "*********** D T - C O M B U S T I B L E S ***********" - Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable + Public Shared Property GlobalDTCombustibles(CveEmpresa As Integer) As DataTable Get - If CveEmpresa <> -1 Then - Dim StrSQL As New StringBuilder - StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) - Dim Dv As New DataView(DirectCast(Application("GlobalDTCombustibles"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCombustibles = Dv.ToTable - Dv.Dispose() - Else - GlobalDTCombustibles = DirectCast(Application("GlobalDTCombustibles"), DataTable) + Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjFlotillas As New ClsFlotillas + If ObjFlotillas.GetCombustibles(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjFlotillas.DtResultados + End Using End If + GlobalDTCombustibles = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End Get Set(value As DataTable) - Application("GlobalDTCombustibles") = value + Dim AppNombre As String = $"GlobalDTCombustibles-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property - Property GlobalDTCombustiblesTipos(Optional CveCombustibleTipo As Integer = -1) As DataTable + Public Shared Property GlobalDTCombustiblesTipos(CveEmpresa As Integer, Optional CveCombustibleTipo As Integer = -1) As DataTable Get + Dim AppNombre As String = $"GlobalDTCombustiblesTipos-{CveEmpresa}" + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Using ObjFlotillas As New ClsFlotillas + If ObjFlotillas.GetCombustiblesTipos(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjFlotillas.DtResultados + End Using + End If + Dim filtros As New List(Of String) If CveCombustibleTipo <> -1 Then - Dim StrSQL As New StringBuilder - If CveCombustibleTipo <> -1 Then StrSQL.AppendFormat("CveCombustibleTipo = {0}", CveCombustibleTipo) - Dim Dv As New DataView(DirectCast(Application("GlobalDTCombustiblesTipos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveCombustibleTipo = {CveCombustibleTipo}", "", DataViewRowState.CurrentRows) GlobalDTCombustiblesTipos = Dv.ToTable Dv.Dispose() Else - GlobalDTCombustiblesTipos = DirectCast(Application("GlobalDTCombustiblesTipos"), DataTable) + GlobalDTCombustiblesTipos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) End If End Get - Set(ByVal value As DataTable) - Application("GlobalDTCombustiblesTipos") = value + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTCombustiblesTipos-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property #End Region @@ -7571,7 +7695,7 @@ Public Class ClsPaginas ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento Dim ContabilizableISR As Boolean = False - If UsuarioActual.CveEmpresa.Contiene(140, 7, 11, 12, 122, 145, 172, 173) Then + If UsuarioActual.CveEmpresa.Contiene(140, 7, 11, 12, 122, 145, 172, 173, 174) Then ContabilizableISR = True End If Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaRetISR @@ -8290,6 +8414,8 @@ Public Class ClsPaginas PaginaDict.Add("/AC/CatFuentesFinanciamientoCONAC.aspx".ToUpper(), 277) PaginaDict.Add("/AC/ProgramaOperativo.aspx".ToUpper(), 289) PaginaDict.Add("/AC/RepProgramaOperativo.aspx".ToUpper(), 289) + PaginaDict.Add("/AC/RepProgramasOperativosAvances.aspx".ToUpper(), 1335) + PaginaDict.Add("/AC/RepPresupuestoEgresos.aspx".ToUpper(), 290) PaginaDict.Add("/AC/RepPresupuestoEgresosMensual.aspx".ToUpper(), 290) PaginaDict.Add("/AC/RepPresupuestoEgresosDetalle.aspx".ToUpper(), 290) diff --git a/App_Code/ClsProspectos.vb b/App_Code/ClsProspectos.vb index 2866b3324..47fe6ac76 100644 --- a/App_Code/ClsProspectos.vb +++ b/App_Code/ClsProspectos.vb @@ -1409,9 +1409,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - C L A S I F I C A C I O N" - Public Function GetClasificacion() As Boolean + Public Function GetClasificacion(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosClasificacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1674,9 +1677,12 @@ Public Class ClsProspectos #Region "P R O S P E C T O S - T I P O S" - Public Function GetProspectosTipos() As Boolean + Public Function GetProspectosTipos(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -1957,9 +1963,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - A P O Y O S " - Public Function GetProspectoApoyo() As Boolean + Public Function GetProspectoApoyo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosApoyosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2265,7 +2274,7 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S " - Public Function GetProspectosSolicitudes(CveProspecto As Integer, CveApoyoTipo As Integer, CveClasificacion As Integer, CveProspectoSolicitud As Integer, CveEmpresa As Integer) As Boolean + Public Function GetProspectosSolicitudes(CveEmpresa As Integer, Optional CveProspecto As Integer = -1, Optional CveApoyoTipo As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProspectoSolicitud As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesGet") With SqlAdapter.SelectCommand.Parameters @@ -2586,9 +2595,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - A P O Y O S - T I P O S " - Public Function GetApoyoTipo() As Boolean + Public Function GetApoyoTipo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosApoyosTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2679,9 +2691,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - E S T A T U S " - Public Function GetSolicitudEstatus() As Boolean + Public Function GetSolicitudEstatus(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesEstatusGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -2772,9 +2787,12 @@ Public Class ClsProspectos #End Region #Region "P R O S P E C T O S - S O L I C I T U D E S - T I P O S " - Public Function GetSolicitudTipo() As Boolean + Public Function GetSolicitudTipo(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_ProspectosSolicitudesTiposGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True @@ -4235,12 +4253,13 @@ Public Class ClsProspectos #End Region #Region "E N C U E S T A S - R E S P U E S T A S" - Public Function GetRespuestas(CvePregunta As Integer, CveEncuesta As Integer) As Boolean + Public Function GetRespuestas(CvePregunta As Integer, CveEncuesta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Pros_EncuestasRespuestasGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveEncuesta", SqlDbType.Int).Value = CveEncuesta .Add("@CvePregunta", SqlDbType.Int).Value = CvePregunta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx index 05e98d2ff..26ea50579 100644 --- a/Ashx/SIGFacturacionCiclica.ashx +++ b/Ashx/SIGFacturacionCiclica.ashx @@ -343,7 +343,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt Dim DtDetalle As DataTable = Nothing Dim objContratos As New ClsContratos - If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveUsuario) Then + If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then DtDetalle = objContratos.DtResultados.FiltraParametros("CveTipoPresupuesto=2") Else DtDetalle = Nothing diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 8c8b8769a..c7634465c 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -368,7 +368,7 @@ CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + @@ -475,7 +475,7 @@
    @@ -696,7 +696,7 @@ CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + @@ -738,8 +738,8 @@
    @@ -750,7 +750,7 @@
    - +
    @@ -806,6 +806,17 @@
    + + + + + + + +
    diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 0257fb67f..c6ec2a338 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -73,9 +73,9 @@ Partial Class Bancos_FluctuacionCambiaria If T.ActiveTabIndex = 3 Then CargaDatosClientesAnticipos() If T.ActiveTabIndex = 4 Then CargaDatosAcreedores() If T.ActiveTabIndex = 5 Then CargaDatosAcreedoresAnticipos() - If T.ActiveTabIndex = 6 Then CargaDatosCuentas() + If T.ActiveTabIndex = 6 Then CargaDatosBancosCuentas() - If T.ActiveTabIndex = 7 Then CargaDatosFiliales() + If T.ActiveTabIndex = 7 Then CargaDatosAcreedoresDiversos() 'CargaDatosFiliales() If T.ActiveTabIndex = 8 Then CargaDatosDeudores() UpTabs.Update() End Sub @@ -301,42 +301,42 @@ Partial Class Bancos_FluctuacionCambiaria GvAcreedoresAnt.DataBind() End Sub - Private Sub CargaDatosCuentas() + Private Sub CargaDatosBancosCuentas() Dim ObjBancos As New ClsBancos LblTotalBancos.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 77, UsuarioActual.CveEmpresa) Then Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal - Dim TotAcumulado As Decimal = 0 - Dim Conta As New ClsContabilidad - For Each Dr As DataRow In DtTemp.Rows - Dim Total As Decimal = 0 - Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero - If CveCuentaExtranjera > 0 Then - If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then - If Conta.DtResultados.Rows.Count > 1 Then - Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal - End If - End If - End If - Dr("Saldo") = Total - Total = Total * TCCierreFluctuacion - Total - Dim SaldoActualContabilidad As Decimal = 0 - Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero - If CveCuentaComplementaria > 0 Then - If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then - If Conta.DtResultados.Rows.Count > 1 Then - SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal - End If - End If - End If + Dim TotAcumulado As Decimal = ObjBancos.DtResultados.SUMD("Fluctuacion") + 'Dim Conta As New ClsContabilidad + 'For Each Dr As DataRow In DtTemp.Rows + ' Dim Total As Decimal = 0 + ' Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero + ' If CveCuentaExtranjera > 0 Then + ' If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then + ' If Conta.DtResultados.Rows.Count > 1 Then + ' Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal + ' End If + ' End If + ' End If + ' Dr("Saldo") = Total + ' Total = Total * TCCierreFluctuacion - Total + ' Dim SaldoActualContabilidad As Decimal = 0 + ' Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero + ' If CveCuentaComplementaria > 0 Then + ' If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, -1, -1, UsuarioActual.CveEmpresa, "1") Then + ' If Conta.DtResultados.Rows.Count > 1 Then + ' SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal + ' End If + ' End If + ' End If - Total = Total - SaldoActualContabilidad - TotAcumulado += Math.Round(Total, 2) - Dr("Fluctuacion") = Total - Next - DtTemp.AcceptChanges() - Conta.Dispose() + ' Total = Total - SaldoActualContabilidad + ' TotAcumulado += Math.Round(Total, 2) + ' Dr("Fluctuacion") = Total + 'Next + 'DtTemp.AcceptChanges() + 'Conta.Dispose() GvCuentas.DataSource = DtTemp LblTotalBancos.Text = TotAcumulado.FormatoNumero @@ -366,7 +366,7 @@ Partial Class Bancos_FluctuacionCambiaria Private Sub CargaDatosFiliales() Dim ObjBancos As New ClsBancos LblTotalAcreedores.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 8, UsuarioActual.CveEmpresa) Then + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 88, UsuarioActual.CveEmpresa) Then GvFiliales.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0") LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else @@ -376,6 +376,19 @@ Partial Class Bancos_FluctuacionCambiaria ObjBancos.Dispose() GvFiliales.DataBind() End Sub + Private Sub CargaDatosAcreedoresDiversos() + Dim ObjBancos As New ClsBancos + LblTotalAcreedores.Text = "0.00" + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 88, UsuarioActual.CveEmpresa) Then + GvAcreedorDiversos.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0") + LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + Else + GvAcreedorDiversos.DataSource = Nothing + Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia) + End If + ObjBancos.Dispose() + GvAcreedorDiversos.DataBind() + End Sub #End Region @@ -435,7 +448,7 @@ Partial Class Bancos_FluctuacionCambiaria IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -515,7 +528,7 @@ Partial Class Bancos_FluctuacionCambiaria IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -526,7 +539,11 @@ Partial Class Bancos_FluctuacionCambiaria End If Next - Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, CveBitacora, UsuarioActual.CveEmpresa) + If Not ErrorRegistrar Then + If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, CveBitacora, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + End If + End If End If @@ -538,6 +555,7 @@ Partial Class Bancos_FluctuacionCambiaria Conta.RollBack() Alert("Error al generar la fluctuación", TipoMensaje.MsgError) End If + Banco.Dispose() Conta.Dispose() End Sub @@ -613,7 +631,7 @@ Partial Class Bancos_FluctuacionCambiaria End If 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveCliente:=gvr.DataKey("CveCliente").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -796,7 +814,7 @@ Partial Class Bancos_FluctuacionCambiaria IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero, CveProveedor:=gvr.DataKey("CveProveedor").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -905,8 +923,8 @@ Partial Class Bancos_FluctuacionCambiaria Dim Total As Decimal = 0 Dim Conta As New ClsContabilidad Conta.IniciaTransacSQL() - Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) - ObjContPaq.IniciaTransacSQL() + 'Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa) + 'ObjContPaq.IniciaTransacSQL() Dim idCta As Integer = 0 Dim CveCuenta As Integer = 0 Dim CveCuentaPerdida, CveCuentaGanancia As Integer @@ -932,11 +950,10 @@ Partial Class Bancos_FluctuacionCambiaria For Each gvr As GridViewRow In GvCuentas.Rows Dim cb As CheckBox = gvr.FCCheckBox("ChkGenerarBancos") If cb.Checked Then - Total = gvr.DataKey("Fluctuacion").ToDecimal - Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero + Total = gvr.DataKey("Fluctuacion").ToDecimal + ' Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero Dim ConceptoReferencia As String = String.Format("{0} - {1} {2}", gvr.DataKey("Banco"), gvr.DataKey("NumCuenta"), MesTCtexto) - 'MOVIMIENTO DE FLUCTUACION If Total > 0 Then CveConceptoContable = 64 @@ -948,15 +965,16 @@ Partial Class Bancos_FluctuacionCambiaria CveCuenta = CveCuentaPerdida idCta = idCtaPerdida TipoMovto = False - End If - - 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConconceptoBancos, ConceptoReferencia, Now, IdCtaComplementaria, 0, TipoCambio:=TC, ImporteMX:=Math.Abs(Total), ImporteME:=Math.Abs(Total)) Then + End If + + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConconceptoBancos, ConceptoReferencia, Now, 0, 0, TipoCambio:=TC, ImporteMX:=Math.Abs(Total), ImporteME:=Math.Abs(Total), CveCuenta:=gvr.DataKey("CveCuentaMEComplementaria").ToEntero) Then ErrorRegistrar = True Exit For End If - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), ConceptoReferencia, CveConceptoContable, ConceptoReferencia, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), Math.Abs(Total), CveConceptoContable, ConceptoReferencia, ConceptoReferencia, 0, CveSubProyecto:=DdlSubproyectoBancos.SelectedValue.ToEntero) Then ErrorRegistrar = True End If End If @@ -966,7 +984,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" If AutoConta Then - If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then + If Conta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then SeContabilizo = True Else ErrorRegistrar = True @@ -974,15 +992,15 @@ Partial Class Bancos_FluctuacionCambiaria End If End If - If Not ErrorRegistrar And SeContabilizo Then + If Not ErrorRegistrar Then - Conta.Commit() - ObjContPaq.Commit() + Conta.Commit() + ' ObjContPaq.Commit() Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) - CargaDatosCuentas() + CargaDatosBancosCuentas() Else - Conta.RollBack() - ObjContPaq.Dispose() + Conta.RollBack() + ' ObjContPaq.Dispose() End If Conta.Dispose() End Sub @@ -1161,20 +1179,20 @@ Partial Class Bancos_FluctuacionCambiaria #Region "GRIDVIEWS" - Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble - 'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString - 'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio") - 'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString, "No aplica") - - If Not e.Row.DBCampo("IdCtaContable").ToString.ToEntero > 0 Then - ' e.Row.FCLabel("LabelBanco").ForeColor = Drawing.Color.Red - End If - - End If - End Sub - + 'Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble + ' 'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString + ' 'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio") + ' 'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString, "No aplica") + + ' 'If Not e.Row.DBCampo("IdCtaContable").ToString.ToEntero > 0 Then + ' ' ' e.Row.FCLabel("LabelBanco").ForeColor = Drawing.Color.Red + ' 'End If + + ' End If + 'End Sub + Private Sub GvFiliales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFiliales.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -1268,7 +1286,6 @@ Partial Class Bancos_FluctuacionCambiaria Banco.Dispose() End Sub - Protected Sub BtnAcreedoresAntRemove_Click(sender As Object, e As EventArgs) Dim Banco As New ClsBancos Banco.IniciaTransacSQL() diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 7b28e1a9d..ea0fb4252 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -5201,6 +5201,8 @@ Partial Class Bancos_IE dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) ElseIf CveCliente > 0 Then dtc = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente) + ElseIf cvepersonal > 0 Then + dtc = GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) End If @@ -5221,20 +5223,16 @@ Partial Class Bancos_IE ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE <= -1 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus = 'True' ") trCuentaDeposito.Visible = True BtnGuardar.ToolTip = "" - Else - BtnGuardar.Enabled = False Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" End If DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - UpGuardar.Update() Else diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index ca0559b4b..958844dd5 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -273,10 +273,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas string MsgError = ""; int CveIE = 0; - int CveConceptoContableBanco = 30; int CveConceptoContablePago = 42; - int CveConceptoContableBancoComplementario = 204; - int CveConceptoContablePrestamoComplementario = 202; + int CveConceptoContablePrestamoComplementario = 351; int CvePlantillaPoliza = 43; int CvePrePoliza = 0; int CveMonedaPago = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); @@ -302,7 +300,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas // DATOS PREPOLIZA if (DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); - CvePrePoliza = ObjMov.AddPrePolizas("PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMonedaPago, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); + CvePrePoliza = ObjMov.AddPrePolizas("PAGO ACREEDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMonedaPago, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); if (CvePrePoliza > 0) { @@ -332,6 +330,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas decimal AcumImporteMN = 0; bool TipoMovtoComision = false; int IdCtaContableOtrosGastos = 0; + int CveConceptoDiferenciaCambiaria = 0; //GUARDA PREPOLIZAS DETALLE foreach (GridViewRow gvr in GvMovAcreedor.Rows) @@ -342,7 +341,6 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ImporteComisionMN = ImporteComision; ImporteComplementaria = 0; - if (gvr.FCTextBox("TxtComision").Text.ToDecimal() < 0) { TipoMovtoComision = true; @@ -415,23 +413,23 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (tCveMoneda != 1) { - - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePago, Conc, DateTime.Now, IDCtaContableAcreedorExtranjera, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de pago acreedor"; - break; - } - if (UsaComplementaria) - { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de acreedor complementaria"; - } - } + IDCtaContableAcreedor = IDCtaContableAcreedorExtranjera; + } + + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePago, Conc, DateTime.Now, IDCtaContableAcreedor, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + { + MsgError = "No se pudo insertar concepto de pago acreedor"; + break; + } + + if (UsaComplementaria) + { + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePrestamoComplementario, Conc, DateTime.Now, IDCtaContableAcreedorComplementaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + MsgError = "No se pudo insertar concepto de acreedor complementaria"; + } if (TCPago != TC) - { - int CveConceptoDiferenciaCambiaria = 0; + { bool TipoMovto = false; int IdCtaContableDiferenciaCambiaria = 0; if (TCPago > TC) @@ -451,21 +449,9 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ImporteMN = Importe; if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Ref, CveConceptoDiferenciaCambiaria, Conc, DateTime.Now, IdCtaContableDiferenciaCambiaria, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), ImporteME: Importe, TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) - { MsgError = "No se pudo insertar concepto de diferencia cambiaria"; - } } - - } - else - { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContablePago, Conc, DateTime.Now, IDCtaContableAcreedor, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de pago acreedor"; - break; - } - } - + if (ImporteComisionMN > 0) { if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoComision, ImporteComision, Ref, 255, Conc, DateTime.Now, IdCtaContableOtrosGastos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComisionMN, CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) @@ -474,9 +460,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas break; } } - } - } if (CveMonedaPago != 1) @@ -491,38 +475,33 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ImporteMNBanco = (ImporteBanco * TCPago).RoundSQL(); ImporteComplementaria = 0; } - } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 30, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos"; + + //movimiento de ajuste por sino se aplicó en el proceso anterior + if (CveMonedaPago != 1 && UsaComplementaria ) { - MsgError = "No se pudo insertar concepto de bancos"; + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, 204, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) MsgError = "No se pudo insertar concepto de bancos complementaria"; + } - - if (CveMonedaPago != 1 && UsaComplementaria) + if (AcumImporteMN != (ImporteBanco + ImporteComplementaria) && CveConceptoDiferenciaCambiaria == 0) { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + int tCveConceptoOtIngresos = 0; + bool TipoMovtoOt = false; + decimal Dif = AcumImporteMN - (ImporteBanco + ImporteComplementaria); + if (Dif < 0) { - MsgError = "No se pudo insertar concepto de bancos complementaria"; + tCveConceptoOtIngresos = 65; TipoMovtoOt = false; } - if (AcumImporteMN != (ImporteBanco + ImporteComplementaria)) + else { - int tCveConceptoOtIngresos = 0; - bool TipoMovtoOt = false; - decimal Dif = AcumImporteMN - (ImporteBanco + ImporteComplementaria); - if (Dif < 0) - { - tCveConceptoOtIngresos = 65; TipoMovtoOt = false; - } - else - { - tCveConceptoOtIngresos = 64; TipoMovtoOt = true; - } + tCveConceptoOtIngresos = 64; TipoMovtoOt = true; + } - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOt, Dif.Abs(), Ref, tCveConceptoOtIngresos, Conc, DateTime.Now, 0, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Dif.Abs(), ImporteME: Dif.Abs(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) - { - MsgError = "No se pudo insertar concepto de ajuste en redondeo"; - } + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOt, Dif.Abs(), Ref, tCveConceptoOtIngresos, Conc, DateTime.Now, 0, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Dif.Abs(), ImporteME: Dif.Abs(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) + { + MsgError = "No se pudo insertar concepto de ajuste en redondeo"; } } @@ -703,7 +682,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas int CveConceptoContableBanco = 30; int CveConceptoContablePrestamo = 41; int CveConceptoContableBancoComplementario = 204; - int CveConceptoContablePrestamoComplementario = 202; + int CveConceptoContablePrestamoComplementario = 351; int CvePlantillaPoliza = 44; int CvePrePoliza = 0; int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuentaPrestamo.SelectedValue.ToEntero()}").ToEntero(); diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index d96237c96..a6e121345 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1400,7 +1400,7 @@ Partial Class Bancos_ProveedoresAbonar Protected Sub DdlCuentaDeposito_SelectedIndexChanged(sender As Object, e As EventArgs) - Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero) If dtc IsNot Nothing AndAlso dtc.Rows.Count = 1 Then If dtc.Rows.Count > 0 Then @@ -1939,29 +1939,31 @@ Partial Class Bancos_ProveedoresAbonar End If End If - If MsgError = "" AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then - If ObjConta.ValorPolizaDescuadre > 0 Then - MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia - GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - Exit For - Else + End If + Next - If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) - Else - 'Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) - MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico" - End If + If MsgError.Trim.Length = 0 AndAlso CvePrePoliza > 0 Then + If MsgError = "" AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia + GuardaLogAD($"Bancos/ProveedoresAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + Else + If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then + + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then + ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) + Else + 'Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) + MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico" End If End If - End If + End If End If - Next + End If diff --git a/CGame/CatEmpaque.aspx b/CGame/CatEmpaque.aspx index 01faedc2d..f7d514f31 100644 --- a/CGame/CatEmpaque.aspx +++ b/CGame/CatEmpaque.aspx @@ -3,9 +3,30 @@ + - Catalogo de Empaques + Catalogo de Empaque Destino @@ -15,67 +36,87 @@
  • - Agregar Empaque
  • + Agregar
    - -
    + +
    +
    +
    + + Información + +
    + +
    + + <%----%> +
    +
    +
    +
    +
    +
    " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - +
    +
    + - + - + - + - + - + - + - + - - + + - - + + - + @@ -83,6 +124,8 @@ + +
    -
    +
    -<%-- + <%-- --%>
    -
    +
    -<%-- + <%-- --%>
    -
    +
    -<%-- + <%-- --%>
    -
    +
    -<%-- + <%-- --%>
    -
    +
    - <%-- + <%-- --%>
    -
    +
    - <%-- + <%-- --%> diff --git a/CGame/CatEmpaque.aspx.VB b/CGame/CatEmpaque.aspx.VB index b137fac8d..ef251b0c9 100644 --- a/CGame/CatEmpaque.aspx.VB +++ b/CGame/CatEmpaque.aspx.VB @@ -1,12 +1,6 @@ Option Strict On Imports System.Data Imports System.Collections.Generic Imports System.Linq Imports System.Web Imports System.Web.UI.WebControls Imports Extensiones Partial Class CATTiposEtiqueta Inherits ClsPaginas - - - - - - #Region "Propiedades" Private Property CveEmpaque() As Integer Get Return If(IsNothing(ViewState("CveEmpaque")), 0, CInt(ViewState("CveEmpaque"))) @@ -28,9 +22,9 @@ GvEmpaque.DataBind() End If ObjTipo.Dispose() upDatosTipo.Update() End Sub Protected Sub LimpiaEmpaque() TxtEmpaque.Text = "" TxtCostoXTonelada.Text = "" TxtCostoPreEnfriado.Text = "" TxtFull.Text = "" TxtSencillo.Text = "" TxtTermoFull.Text = "" TxtTermoSencillo.Text = "" UPModalTipo.Update() End Sub Protected Sub LnkEditarTipo_Click(sender As Object, e As EventArgs) LimpiaEmpaque() Dim gvRow As GridViewRow= DirectCast((DirectCast(sender,LinkButton)).NamingContainer,GridViewRow) - CveEmpaque = gvRow.DataKey("CveEmpaque").ToEntero() TxtEmpaque.Text = gvRow.DataKey("Empaque") TxtCostoXTonelada.Text = gvRow.DataKey("CostoXTonelada") TxtCostoPreEnfriado.Text = gvRow.DataKey("CostoPreEnfriado") TxtFull.Text = gvRow.DataKey("Lleno") TxtSencillo.Text = gvRow.DataKey("Sencillo") TxtTermoFull.Text = gvRow.DataKey("TermoLleno") TxtTermoSencillo.Text = gvRow.DataKey("TermoSencillo") ChkTipoestatus.Checked = CBool(gvRow.DataKey("Estatus")) RegistraScript("$('#DModalTiposEtiqueta').modal()") BtnTipoADD.Visible=False BtnTipoEdit.Visible = True DivEstatus.Visible = True UPModalTipo.Update() End Sub Protected Sub LnkAgregarTipo_Click(sender As Object, e As EventArgs) RegistraScript("$('#DModalTiposEtiqueta').modal()") LimpiaEmpaque() BtnTipoADD.Visible=True BtnTipoEdit.Visible = False DivEstatus.Visible = False UPModalTipo.Update() End Sub Protected Sub BtnTipoADD_Click(sender As Object, e As EventArgs) Dim ObjTipo As New ClsCGame() Dim Continuar As Boolean = ObjTipo.AddEmpaque(TxtEmpaque.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtCostoXTonelada.Text.ToDouble, TxtCostoPreEnfriado.Text.ToDouble, TxtFull.Text.ToDouble, TxtSencillo.Text.ToDouble, TxtTermoFull.Text.ToDouble, TxtTermoSencillo.Text.ToDouble) ObjTipo.Dispose() If (Continuar) Then RegistraScript("$('#DModalTiposEtiqueta').modal('hide')") LimpiaEmpaque() UPModalTipo.Update() Alert("El empaquese ha agregado") CargaEmpaque() End If End Sub Protected Sub BtnTipoEdit_Click(sender As Object, e As EventArgs) Dim ObjTipo As New ClsCGame() Dim Continuar As Boolean = ObjTipo.UpdateEmpaque(CveEmpaque, ChkTipoestatus.Checked, TxtEmpaque.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtCostoXTonelada.Text.ToDouble, TxtCostoPreEnfriado.Text.ToDouble, TxtFull.Text.ToDouble, TxtSencillo.Text.ToDouble, TxtTermoFull.Text.ToDouble, TxtTermoSencillo.Text.ToDouble) ObjTipo.Dispose() If (Continuar) Then RegistraScript("$('#DModalTiposEtiqueta').modal('hide')") LimpiaEmpaque() UPModalTipo.Update() Alert("El empaque se ha actualizado") + CveEmpaque = gvRow.DataKey("CveEmpaque").ToEntero() TxtEmpaque.Text = gvRow.DataKey("Empaque") TxtCostoXTonelada.Text = gvRow.DataKey("CostoXTonelada") TxtCostoPreEnfriado.Text = gvRow.DataKey("CostoPreEnfriado") TxtFull.Text = gvRow.DataKey("Lleno") TxtSencillo.Text = gvRow.DataKey("Sencillo") TxtTermoFull.Text = gvRow.DataKey("TermoLleno") TxtTermoSencillo.Text = gvRow.DataKey("TermoSencillo") ChkTipoestatus.Checked = CBool(gvRow.DataKey("Estatus")) RegistraScript("$('#DModalTiposEtiqueta').modal()") BtnTipoADD.Visible=False BtnTipoEdit.Visible = True DivEstatus.Visible = True UPModalTipo.Update() End Sub Protected Sub LnkAgregarTipo_Click(sender As Object, e As EventArgs) RegistraScript("$('#DModalTiposEtiqueta').modal()") LimpiaEmpaque() BtnTipoADD.Visible=True BtnTipoEdit.Visible = False DivEstatus.Visible = False UPModalTipo.Update() End Sub Protected Sub BtnTipoADD_Click(sender As Object, e As EventArgs) Dim ObjTipo As New ClsCGame() Dim Continuar As Boolean = ObjTipo.AddEmpaque(TxtEmpaque.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtCostoXTonelada.Text.ToDouble, TxtCostoPreEnfriado.Text.ToDouble, TxtFull.Text.ToDouble, TxtSencillo.Text.ToDouble, TxtTermoFull.Text.ToDouble, TxtTermoSencillo.Text.ToDouble) ObjTipo.Dispose() If (Continuar) Then RegistraScript("$('#DModalTiposEtiqueta').modal('hide')") LimpiaEmpaque() UPModalTipo.Update() Alert("El empaque destino se ha agregado") CargaEmpaque() End If End Sub Protected Sub BtnTipoEdit_Click(sender As Object, e As EventArgs) Dim ObjTipo As New ClsCGame() Dim Continuar As Boolean = ObjTipo.UpdateEmpaque(CveEmpaque, ChkTipoestatus.Checked, TxtEmpaque.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtCostoXTonelada.Text.ToDouble, TxtCostoPreEnfriado.Text.ToDouble, TxtFull.Text.ToDouble, TxtSencillo.Text.ToDouble, TxtTermoFull.Text.ToDouble, TxtTermoSencillo.Text.ToDouble) ObjTipo.Dispose() If (Continuar) Then RegistraScript("$('#DModalTiposEtiqueta').modal('hide')") LimpiaEmpaque() UPModalTipo.Update() Alert("El empaque destino se ha actualizado") CargaEmpaque() End If End Sub Protected Sub LnkEliminarTipo_Click(sender As Object, e As EventArgs) Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - CveEmpaque = gvRow.DataKey("CveEmpaque").ToEntero() Dim ObjTipo As New ClsCGame() Dim Continuar As Boolean = ObjTipo.RemoveEmpaque(CveEmpaque) ObjTipo.Dispose() If (Continuar) Then Alert("El empaque se ha eliminado") + CveEmpaque = gvRow.DataKey("CveEmpaque").ToEntero() Dim ObjTipo As New ClsCGame() Dim Continuar As Boolean = ObjTipo.RemoveEmpaque(CveEmpaque) ObjTipo.Dispose() If (Continuar) Then Alert("El empaque destino se ha eliminado") CargaEmpaque() End If End Sub Private Sub GVTiposEtiqueta_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEmpaque.RowDataBound diff --git a/CGame/CatHuerta.aspx b/CGame/CatHuerta.aspx index 9f64fea71..94b10ec1a 100644 --- a/CGame/CatHuerta.aspx +++ b/CGame/CatHuerta.aspx @@ -3,9 +3,18 @@ + - Catalogo de Huerta + Catalogo de Productor @@ -15,17 +24,37 @@
  • - Agregar Huerta
  • + Agregar
    -
    + +
    +
    +
    + + Información + +
    + +
    + + <%----%> +
    +
    +
    +
    +
    +
    " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + +
    +
    +
    @@ -34,27 +63,27 @@ - + - + - + - + - + @@ -72,7 +101,7 @@ - +
    diff --git a/GPS/WizardDispositivos.aspx.cs b/GPS/WizardDispositivos.aspx.cs index 7f08c3690..c85998c46 100644 --- a/GPS/WizardDispositivos.aspx.cs +++ b/GPS/WizardDispositivos.aspx.cs @@ -232,6 +232,7 @@ public partial class GPS_WizardDispositivos : ClsPaginas TxtModeloV.Text = drow["ModeloVehiculo"].ToString(); TxtAñoV.Text = drow["AñoVehiculo"].ToString(); TxtPlacas.Text = drow["PlacasVehiculo"].ToString(); + TxtAsignadoEn.Text = drow["AsignadoEn"].ToString(); ChkTipoLinea.Checked = drow["CveProveedorComunicacionCuenta"].ToString().ToEntero() <= 0; } @@ -346,6 +347,7 @@ public partial class GPS_WizardDispositivos : ClsPaginas string AñoV = TxtAñoV.Text; string ClaseVehiculo = "";//TxtClaseVehiculo.Text; string Placas = TxtPlacas.Text; + string AsignadoEn = TxtAsignadoEn.Text; bool LimiteVelocidad = false; double LimiteVelocidadV = 0;//chkLimiteVelocidad.Checked ? TxtLimiteVelocidad.Text.ToDouble : 0 string Detalles = "";//TxtDetalles.Text; @@ -365,12 +367,12 @@ public partial class GPS_WizardDispositivos : ClsPaginas if (CveDispositivo > 0) { continuar = ObjGPS.DispositivosUpdate(TipoDispositivo,NumTelefono, CveDispositivo, modelo, LineaTelefonica, CveCliente, IMEI, Serie, 1, SerieV, ColorV, NombreV, NoEconomico, DevId, puerto, - ModeloV, AñoV, ClaseVehiculo, Placas, LimiteVelocidad, LimiteVelocidadV, Detalles, Rendimiento, icono, Color,UsuarioActual.CveUsuario); + ModeloV, AñoV, ClaseVehiculo, Placas, LimiteVelocidad, LimiteVelocidadV, Detalles, Rendimiento, icono, Color,UsuarioActual.CveUsuario, AsignadoEn); } else { continuar = ObjGPS.DispositivoAdd(TipoDispositivo, NumTelefono, modelo, LineaTelefonica, CveCliente, IMEI, Serie, 1, SerieV, ColorV, NombreV, NoEconomico, DevId, puerto, - ModeloV, AñoV, ClaseVehiculo, Placas, LimiteVelocidad, LimiteVelocidadV, Detalles, Rendimiento, icono, Color, UsuarioActual.CveUsuario); + ModeloV, AñoV, ClaseVehiculo, Placas, LimiteVelocidad, LimiteVelocidadV, Detalles, Rendimiento, icono, Color, UsuarioActual.CveUsuario, AsignadoEn); CveDispositivo = ObjGPS.CveDispositivo; } if (continuar) diff --git a/General/CatProductosServiciosCaracteristicas.aspx.vb b/General/CatProductosServiciosCaracteristicas.aspx.vb index d0e6ccfec..df4c3adfd 100644 --- a/General/CatProductosServiciosCaracteristicas.aspx.vb +++ b/General/CatProductosServiciosCaracteristicas.aspx.vb @@ -40,9 +40,9 @@ Partial Class GRAL_CatCaracteristicasProductosServicios Public Sub CargaDatos() Dim ObjCaracteristicas As New ClsGralProductosServiciosCaracteristicas - If ObjCaracteristicas.GetProductosServiciosCaracteristicas() Then + If ObjCaracteristicas.GetProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) Then ViewState("DTProductosServiciosCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados + 'GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados Else Me.GvDatosCaracteristicas.DataSource = Nothing End If @@ -56,9 +56,9 @@ Partial Class GRAL_CatCaracteristicasProductosServicios Public Sub CargaDatosO() Dim ObjOpciones As New ClsGralProductosServiciosCaracteristicas - If ObjOpciones.GetProductosServiciosCaracteristicasOpciones() Then + If ObjOpciones.GetProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) Then ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados + 'GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados Else GvDatosOpciones.DataSource = Nothing End If diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 67d851a82..3b858e92f 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1814,6 +1814,9 @@ Partial Class General_SaldosIniciales If Not dt.Columns.Contains("CveCuentaContableDepreciacion") Then dt.Columns.Add("CveCuentaContableDepreciacion", GetType(Integer)) End If + If Not dt.Columns.Contains("CveCuentaContableDepreciacionAcum") Then + dt.Columns.Add("CveCuentaContableDepreciacionAcum", GetType(Integer)) + End If Dim sbErrores As New StringBuilder For Each Row As DataRow In dt.Rows @@ -1821,11 +1824,9 @@ Partial Class General_SaldosIniciales Dim Codigo As String = Row("Código").ToString() Dim Descripcion As String = Row("Descripción").ToString() - Dim CuentaContable As String = Row("CuentaContable").ToString().Trim.Replace("-", "").Replace(" ", "") - + Dim CuentaContable As String = Row("Cuenta Contable").ToString().Trim.Replace("-", "").Replace(" ", "") If CuentaContable.Length > 0 Then Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero() - If CveCuentaContable > 0 Then Row("CveCuentaContable") = CveCuentaContable Else @@ -1833,11 +1834,10 @@ Partial Class General_SaldosIniciales ErrorAF = True End If End If - CuentaContable = Row("Cuenta Depreciación").ToString().Trim.Replace("-", "").Replace(" ", "") + CuentaContable = Row("Cuenta Depreciación").ToString().Trim.Replace("-", "").Replace(" ", "") If CuentaContable.Length > 0 Then Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero() - If CveCuentaContable > 0 Then Row("CveCuentaContableDepreciacion") = CveCuentaContable Else @@ -1845,6 +1845,17 @@ Partial Class General_SaldosIniciales ErrorAF = True End If End If + + CuentaContable = Row("Cuenta Depreciación Acumulada").ToString().Trim.Replace("-", "").Replace(" ", "") + If CuentaContable.Length > 0 Then + Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero() + If CveCuentaContable > 0 Then + Row("CveCuentaContableDepreciacionAcum") = CveCuentaContable + Else + sbErrores.AppendLine($"Activo Fijo {Codigo} {Descripcion} cuenta {CuentaContable} no encontrada.
    ") + ErrorAF = True + End If + End If Next If Not ErrorAF Then @@ -1859,8 +1870,6 @@ Partial Class General_SaldosIniciales Dim ObjConta As New ClsContabilidad(ObjAF.IniciaTransacSQL) Try - - Dim Contador As Integer = 0 Dim NumRow As Integer = 0 @@ -1869,8 +1878,8 @@ Partial Class General_SaldosIniciales Dim Descripcion As String = Row("Descripción").ToString() Dim TipoAF As String = Row("Tipo").ToString().Trim Dim SubTipo As String = Row("SubTipo").ToString().Trim - Dim Valor As Decimal = Row("Valor de compra").ToString().ToDecimal - Dim FechaAF As Date = Row("Fecha de compra").ToString().ToDate + Dim Valor As Decimal = Row("Valor").ToString().ToDecimal + Dim FechaAF As Date = Row("Fecha").ToString().ToDate Dim NumeroSerie As String = Row("No. Serie").ToString() Dim Año As Integer = Row("Año").ToString().ToEntero() Dim CuentaContable As String = Row("Cuenta Contable").ToString() @@ -1889,7 +1898,8 @@ Partial Class General_SaldosIniciales Dim CveEstadoActivoFijo As Integer = GlobalDTEstadoActivoFijo().FiltroPrimeroValor("CveEstadoActivoFijo", $"EstadoActivoFijo = '{Estado}'").ToString().ToEntero() Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"Nombre = '{Cliente}'").ToString().ToEntero() Dim CveCuentaContable As Integer = Row("CveCuentaContable").ToString().ToEntero() - Dim CveCuentaContableDepreciacion As Integer = Row("CveCuentaContable").ToString().ToEntero() + Dim CveCuentaContableDepreciacion As Integer = Row("CveCuentaContableDepreciacion").ToString().ToEntero() + Dim CveCuentaContableDepreciacionAcum As Integer = Row("CveCuentaContableDepreciacionAcum").ToString().ToEntero() 'VALIDACIONES If Not CveSubTipoAF > 0 Then Alert($"No se encontró el SubTipo: {TipoAF} Descripcion: {Descripcion} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorAF = True : Exit For @@ -1920,6 +1930,13 @@ Partial Class General_SaldosIniciales ErrorAF = True End If End If + If CveCuentaContableDepreciacion > 0 Then + If Not ObjConta.AddCuentasAsignaciones(270, UsuarioActual.CveEmpresa, CveCuentaContableDepreciacionAcum, -1, + -1, -1, -1, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=CveAF, + CveTipoGasto:=-1, RegeneraCuenta:=False) Then + ErrorAF = True + End If + End If Else ErrorAF = True Exit For @@ -1934,6 +1951,7 @@ Partial Class General_SaldosIniciales ObjAF.Commit() TxtExcel.Text = "" UpDatos.Update() + GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing Else Alert(String.Format("Se agregaron: {0} Activos Fijos correctamente.", NumRows), TipoMensaje.MsgInformacion) ObjAF.Commit() diff --git a/Global.asax b/Global.asax index c9642f892..d37060357 100644 --- a/Global.asax +++ b/Global.asax @@ -42,23 +42,22 @@ GuardaLogAsax(String.Format("Globalasax 5:{0}", DateTime.Now)) Using ObjAC As New ClsAC - If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing - If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + 'If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing + 'If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing + 'If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing - If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing - If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing - If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing + 'If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing + 'If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing + 'If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing - If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing - If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing + 'If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing - If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing + 'If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing ' If ObjAC.GetAreas() Then Application("GlobalDTAC_Areas") = ObjAC.DtResultados Else Application("GlobalDTAC_Areas") = Nothing @@ -103,50 +102,50 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'P R O S P E C T O S - GuardaLogAsax(String.Format("Globalasax 10:{0}", DateTime.Now)) - Using ObjProspectos As New ClsProspectos - If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing - If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificacionesCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificacionesCaracteristicas") = Nothing - If ObjProspectos.GetCoordinadores(-1) Then Application("GlobalDTProspectosCoordinadores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCoordinadores") = Nothing - If ObjProspectos.GetSupervisores(-1) Then Application("GlobalDTProspectosSupervisores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSupervisores") = Nothing - If ObjProspectos.GetProspectosSolicitudes(-1, -1, -1, -1, -1) Then Application("GlobalDTProspectosSolicitudes") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudes") = Nothing - If ObjProspectos.GetSolicitudTipo Then Application("GlobalDTProspectosSolicitudesTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesTipos") = Nothing - If ObjProspectos.GetApoyoTipo Then Application("GlobalDTProspectosApoyosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyosTipos") = Nothing - If ObjProspectos.GetProspectoApoyo Then Application("GlobalDTProspectosApoyos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyos") = Nothing - If ObjProspectos.GetSolicitudEstatus Then Application("GlobalDTProspectosSolicitudesEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesEstatus") = Nothing - If ObjProspectos.GetEventosTipo(-1) Then Application("GlobalDTProspectosEventosTipo") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEventosTipo") = Nothing - If ObjProspectos.GetProspectosEventos(-1, -1) Then Application("GlobalDTProspectosEvento") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEvento") = Nothing - If ObjProspectos.GetProspectosTipos() Then Application("GlobalDTProspectosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTipos") = Nothing - If ObjProspectos.GetProspectosEstatus() Then Application("GlobalDTProspectosEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEstatus") = Nothing - If ObjProspectos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTProspectosCaracteristicasClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasClasificaciones") = Nothing - If ObjProspectos.GetTiposCaracteristicas(-1) Then Application("GlobalDTProspectosTiposCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTiposCaracteristicas") = Nothing - If ObjProspectos.GetCaracteristicas(-1) Then Application("GlobalDTProspectosCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicas") = Nothing - If ObjProspectos.GetCaracteristicasOpciones(-1, -1) Then Application("GlobalDTProspectosCaracteristicasOpciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasOpciones") = Nothing - If ObjProspectos.GetEncuestas(-1, -1) Then Application("GlobalDTProspectosEncuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestas") = Nothing - If ObjProspectos.GetPreguntas(-1, -1, -1) Then Application("GlobalDTProspectosEncuestasPreguntas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasPreguntas") = Nothing - If ObjProspectos.GetRespuestas(-1, -1) Then Application("GlobalDTProspectosEncuestasRespuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasRespuestas") = Nothing - End Using + 'GuardaLogAsax(String.Format("Globalasax 10:{0}", DateTime.Now)) + 'Using ObjProspectos As New ClsProspectos + 'If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing + 'If ObjProspectos.GetClasificacion Then Application("GlobalDTProspectosClasificacionesCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosClasificacionesCaracteristicas") = Nothing + 'If ObjProspectos.GetCoordinadores(-1) Then Application("GlobalDTProspectosCoordinadores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCoordinadores") = Nothing + 'If ObjProspectos.GetSupervisores(-1) Then Application("GlobalDTProspectosSupervisores") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSupervisores") = Nothing + 'If ObjProspectos.GetProspectosSolicitudes(-1, -1, -1, -1, -1) Then Application("GlobalDTProspectosSolicitudes") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudes") = Nothing + 'If ObjProspectos.GetSolicitudTipo Then Application("GlobalDTProspectosSolicitudesTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesTipos") = Nothing + 'If ObjProspectos.GetApoyoTipo Then Application("GlobalDTProspectosApoyosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyosTipos") = Nothing + 'If ObjProspectos.GetProspectoApoyo Then Application("GlobalDTProspectosApoyos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosApoyos") = Nothing + 'If ObjProspectos.GetSolicitudEstatus Then Application("GlobalDTProspectosSolicitudesEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosSolicitudesEstatus") = Nothing + 'If ObjProspectos.GetEventosTipo(-1) Then Application("GlobalDTProspectosEventosTipo") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEventosTipo") = Nothing + 'If ObjProspectos.GetProspectosEventos(-1, -1) Then Application("GlobalDTProspectosEvento") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEvento") = Nothing + 'If ObjProspectos.GetProspectosTipos() Then Application("GlobalDTProspectosTipos") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTipos") = Nothing + 'If ObjProspectos.GetProspectosEstatus() Then Application("GlobalDTProspectosEstatus") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEstatus") = Nothing + 'If ObjProspectos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTProspectosCaracteristicasClasificaciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasClasificaciones") = Nothing + 'If ObjProspectos.GetTiposCaracteristicas(-1) Then Application("GlobalDTProspectosTiposCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosTiposCaracteristicas") = Nothing + 'If ObjProspectos.GetCaracteristicas(-1) Then Application("GlobalDTProspectosCaracteristicas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicas") = Nothing + 'If ObjProspectos.GetCaracteristicasOpciones(-1, -1) Then Application("GlobalDTProspectosCaracteristicasOpciones") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosCaracteristicasOpciones") = Nothing + 'If ObjProspectos.GetEncuestas(-1, -1) Then Application("GlobalDTProspectosEncuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestas") = Nothing + 'If ObjProspectos.GetPreguntas(-1, -1, -1) Then Application("GlobalDTProspectosEncuestasPreguntas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasPreguntas") = Nothing + 'If ObjProspectos.GetRespuestas(-1, -1) Then Application("GlobalDTProspectosEncuestasRespuestas") = ObjProspectos.DtResultados Else Application("GlobalDTProspectosEncuestasRespuestas") = Nothing + 'End Using - GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) + 'GuardaLogAsax(String.Format("Globalasax 11:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C L A S I F I C A C I O N E S - Using ObjClasificaciones As New ClsClasificaciones() + 'Using ObjClasificaciones As New ClsClasificaciones() - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'F A M I L I A S - If ObjClasificaciones.GetClasificaciones(Tipo:=2) Then Application("GlobalDTSubFamilias") = ObjClasificaciones.DtResultados Else Application("GlobalDTSubFamilias") = Nothing + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'F A M I L I A S + 'If ObjClasificaciones.GetClasificaciones(Tipo:=2) Then Application("GlobalDTSubFamilias") = ObjClasificaciones.DtResultados Else Application("GlobalDTSubFamilias") = Nothing - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'P R E S U P U E S T O - If ObjClasificaciones.GetClasificaciones(Tipo:=3) Then Application("GlobalDTClasificacionesPresupuestos") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificacionesPresupuestos") = Nothing + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'P R E S U P U E S T O + 'If ObjClasificaciones.GetClasificaciones(Tipo:=3) Then Application("GlobalDTClasificacionesPresupuestos") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificacionesPresupuestos") = Nothing - '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C L A S I F I C A C I O N E S 2 - If ObjClasificaciones.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificaciones2") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 'C L A S I F I C A C I O N E S 2 + 'If ObjClasificaciones.GetClasificaciones(Tipo:=4) Then Application("GlobalDTClasificaciones2") = ObjClasificaciones.DtResultados Else Application("GlobalDTClasificaciones2") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 20:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------S I S T E M A ---------------------------------------------------------------------------------- @@ -162,11 +161,11 @@ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 'C O M B U S T I B L E S - Using ObjFlotillas As New ClsFlotillas - If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing - If ObjFlotillas.GetCombustiblesTipos(-1) Then Application("GlobalDTCombustiblesTipos") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustiblesTipos") = Nothing - End Using - GuardaLogAsax(String.Format("Globalasax 39:{0}", DateTime.Now)) + 'Using ObjFlotillas As New ClsFlotillas + 'If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing + 'If ObjFlotillas.GetCombustiblesTipos(-1) Then Application("GlobalDTCombustiblesTipos") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustiblesTipos") = Nothing + 'End Using + 'GuardaLogAsax(String.Format("Globalasax 39:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -185,7 +184,7 @@ BundleConfig.RegistrarBundles(BundleTable.Bundles) BundleTable.EnableOptimizations = True - System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None + ' System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587} ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones @@ -228,9 +227,9 @@ End Sub Sub Application_End(sender As Object, e As EventArgs) - If EsProduccion = "1" Then - SqlDependency.Stop(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) - End If + 'If EsProduccion = "1" Then + ' SqlDependency.Stop(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString) + 'End If ' Code that runs on application shutdown End Sub diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index c30cfc4bb..2c538f4b3 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4490,7 +4490,7 @@ Partial Class Inventarios_EntradasSalidas For Each Dr As DataRow In DtMovimientosSalidaInvFisico.Rows If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1) >= Dr("Cantidad").ToString.ToDouble Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, - Dr("PU").ToString.ToDecimal, -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, + Dr("PU").ToString.ToDecimal.RoundSQL(6), -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then Mensaje = "Ocurrió un error al guardar los movimientos de salida" ErrorMovInv = True @@ -4511,10 +4511,10 @@ Partial Class Inventarios_EntradasSalidas If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - Dim ProTotalSalida As Decimal = ObjInventario.DtResultados.SUMD("Total", "") + Dim ProTotalSalida As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL(2) Dim ProCantidadEntrada As Decimal = DtMovimientosEntradaInvFisico.SUMD("Cantidad", "") - ProPU = (ProTotalSalida / ProCantidadEntrada).RoundSQL(6) + ProPU = (ProTotalSalida / ProCantidadEntrada).RoundSQL(10) If Not ProPU > 0 Then ErrorMovInv = True @@ -4546,7 +4546,7 @@ Partial Class Inventarios_EntradasSalidas 'Obtiene valor entrada If Not ErrorMovInv AndAlso CveMovimientoEntrada > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then - Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL() + Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL(2) ValorEntrada = tValorInventario Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", DdlAlmacenInventarioFisico.SelectedValue)) @@ -4563,7 +4563,7 @@ Partial Class Inventarios_EntradasSalidas 'Obtiene valor salida If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL() + Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUMD("Total", "").RoundSQL(2) ValorSalida = tValorInventario Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", DdlAlmacenInventarioFisico.SelectedValue)) If drA2 IsNot Nothing Then diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 41d6e338c..9c4e09413 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3133,7 +3133,17 @@ Partial Class Inventarios_EntregaAlmacen ErrorMovInv = True End If - 'AutoConta - El movimiento 1 es el de Venta + + + If Not ErrorMovInv AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjConta.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + ErrorMovInv = True + End If + End If + + + Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" If AutoConta And Not ErrorMovInv Then diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index c23c87baf..b1237c243 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -3567,7 +3567,6 @@ Partial Class Inventarios_RecepcionAlmacen CveClasificacionDifCostoNC = gvr.DataKey("CveClasificacion").ToEntero Next Dim IdCtaContableClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero - Dim CveCuentaClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {CveClasificacionDifCostoNC}").ToEntero TotalNC = TotalNC.RoundSQL Dim DifCostoNC As Decimal = (TotalCosto - TotalNC).RoundSQL @@ -3609,7 +3608,7 @@ Partial Class Inventarios_RecepcionAlmacen If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalNC, SerieFolio, CveConceptoContableNC, SerieFolio, Fecha, IdCtaContableNC, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalNC, Contabilizable:=EsContabilizable) Then If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then If DifCostoNC <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, CveCuenta:=CveCuentaClasificacion, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then ErrorMovInv = True End If End If @@ -4040,7 +4039,13 @@ Partial Class Inventarios_RecepcionAlmacen End If End If If CvePrePoliza > 0 Then - Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DdlAlmacen.SelectedValue}").ToEntero + Dim dtta As DataTable = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero) + Dim IdCtaContableAlmacen As Integer = -1 + Dim CveSubProyecto As Integer = -1 + If dtta IsNot Nothing Then + IdCtaContableAlmacen = dtta.FiltroPrimeroValor("IdCtaContable").ToEntero + CveSubProyecto = dtta.FiltroPrimeroValor("CveSubProyecto").ToEntero + End If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Dim TotalCosto As Decimal = ObjInventario.DtResultados.SUMD("Total").RoundSQL() @@ -4049,7 +4054,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim PorcentajeRecepcionCompras As Decimal = TotalCosto / DtTempCompras.SUMD("SubTotalTC") Dim ConceptoPartida As String = String.Format("{0}- Inv#{1}", HLFolio.Text, InvFolio) - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto, InvFolio, 68, InvFolio, FechaMovto, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto, CveSubProyecto:=CveSubProyecto, Contabilizable:=If(CveTipoCompra = 10, False, True)) Then 'se recorren las facturas a descontar el recepción If DtTempCompras IsNot Nothing AndAlso DtTempCompras.Rows.Count > 0 Then @@ -4073,7 +4078,7 @@ Partial Class Inventarios_RecepcionAlmacen - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, CveConceptoCostoIndirecto, ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, CveConceptoCostoIndirecto, ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono, CveSubProyecto:=CveSubProyecto) Then ' si tiene valor es que hay complementaria If ImporteAbonoME > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAbono, ConceptoPartida, If(CveImportacionSurtir > 0, 242, 239), ConceptoPartida, FechaMovto, IdCtaContableCostoInd, -1, CveCompra:=CveComp, CveProveedor:=dr("CveProveedor").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImporteAbono) Then diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 39c126845..4c5cdf47e 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1006,7 +1006,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim CveConceptoEntrada As Integer = 27 If Not ChkTransitorio.Checked Then CveConceptoEntrada = 27 Else CveConceptoEntrada = 9 - Dim CveFolioGarantia As Integer = Request.QueryString("CveFolioGarantia").ToEntero + Dim CveFolioGarantia As Integer = IfNull(Request("CveFolioGarantia"), -1).ToString.ToEntero 'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, @@ -1014,7 +1014,7 @@ Partial Class Inventarios_TraspasoAlmacen CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, CveChofer:=If(ChkTransitorio.Checked, DdlChofer.SelectedValue.ToEntero, -1), Placa:="", FechaEntrega:=If(ChkTransitorio.Checked, TxtFechaEntrega.Text.Trim.ToDateTime.ToString("dd/MM/yyyy"), "-1"), EspecifUnidad:="", ResponsableCarga:="", ResponsableRecibio:="", Identificacion:="", Domicilio:="", - Telefono:="", Ciudad:="", Licencia:="", Modulo:="TA/G2", CveFolioGarantia:=If(CveFolioGarantia > 0, CveFolioGarantia, -1)) + Telefono:="", Ciudad:="", Licencia:="", Modulo:="TA/G2", CveFolioGarantia:=CveFolioGarantia) FolioSalida = ObjInventario.Folio Folio = ObjInventario.Folio If CveMovimientoSalida <= 0 Then @@ -1035,7 +1035,7 @@ Partial Class Inventarios_TraspasoAlmacen 'ENTRADA CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, CveConceptoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"), - CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3", CveFolioGarantia:=If(CveFolioGarantia > 0, CveFolioGarantia, -1)) + CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3", CveFolioGarantia:=CveFolioGarantia) FolioEntrada = ObjInventario.Folio If CveMovimientoEntrada <= 0 Then TextoError = "Ocurrió un error al generar el movimiento de entrada" diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 03caae8d9..9357e8b57 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -1256,7 +1256,7 @@ public partial class Nomina_Nomina2 : ClsPaginas string PathXMLF = ""; string Xmlname = ""; string XmlnameF = ""; - string empleado = ""; + //string empleado = ""; Ruta = UsuarioActual.Empresa.Ruta; PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml"; PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml"; @@ -1395,7 +1395,7 @@ public partial class Nomina_Nomina2 : ClsPaginas string PathXMLF = ""; string Xmlname = ""; string XmlnameF = ""; - string empleado = ""; + //string empleado = ""; Ruta = UsuarioActual.Empresa.Ruta; PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml"; PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml"; @@ -1519,7 +1519,7 @@ public partial class Nomina_Nomina2 : ClsPaginas string PathXMLF = ""; string Xmlname = ""; string XmlnameF = ""; - string empleado = ""; + //string empleado = ""; Ruta = UsuarioActual.Empresa.Ruta; PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml"; PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml"; @@ -1626,7 +1626,7 @@ public partial class Nomina_Nomina2 : ClsPaginas string PathXMLF = ""; string Xmlname = ""; string XmlnameF = ""; - string empleado = ""; + //string empleado = ""; Ruta = UsuarioActual.Empresa.Ruta; PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml"; PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml"; @@ -2888,7 +2888,7 @@ public partial class Nomina_Nomina2 : ClsPaginas DataRow drow = dtempleados.FiltroPrimero(string.Format("CvePersonal = {0}", SRCvePersonal)); TxtCCSysSalarioMinimo.Text = ""; - TxtCCSysUMA.Text = "$96.22"; + //TxtCCSysUMA.Text = "$96.22"; if (drow != null) { TxtCCSysSalarioMinimo.Text = string.Format("${0:N2}", drow["SalarioMinimo"]); @@ -2984,6 +2984,18 @@ public partial class Nomina_Nomina2 : ClsPaginas if (drow != null) { decimal UMA = 96.22M; + + using (ClsClaseBase objbase = new ClsClaseBase()) + { + if (objbase.runQuerystr($"SELECT Valor UMA FROM [dbo].[RH_TablasValores] WHERE Tipo =1 AND CveEmpresa ={UsuarioActual.CveEmpresa} AND Fecha<'{DateTime.Now:yyyy/MM/dd}' ORDER BY Fecha DESC")) + { + if (objbase.DtResultados.Rows.Count > 0) + { + UMA = objbase.DtResultados.Rows[0]["UMA"].ToString().ToDecimal(); + } + } + } + TxtCCSysUMA.Text = $"{UMA:N2}"; decimal HorasDobles = drow["HorasDobles"].ToString().ToDecimal(); decimal HorasTriples = drow["HorasTriples"].ToString().ToDecimal(); decimal ImporteHora = drow["SalarioDiario"].ToString().ToDecimal() / 8; diff --git a/OS/PopUpMateriales.aspx.vb b/OS/PopUpMateriales.aspx.vb index 1dadf3c2e..c2ea18ead 100644 --- a/OS/PopUpMateriales.aspx.vb +++ b/OS/PopUpMateriales.aspx.vb @@ -96,7 +96,7 @@ Partial Class OS_PopUpMateriales End Sub Private Sub CargaClasificaciones() - DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() End Sub @@ -129,7 +129,7 @@ Partial Class OS_PopUpMateriales Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString.ToEntero Dim UM = GlobalDTUnidadesMedida.FiltraParametros("CveUnidadMedida = " & CveUnidadMedida).Rows(0)("UnidadMedida").ToString Dim CveClasificacion As Integer = RowPS("CveClasificacion").ToString.ToEntero - Dim Clasificacion As String = GlobalDTClasificaciones.FiltraParametros("CveClasificacion = " & CveClasificacion).Rows(0)("Clasificacion").ToString + Dim Clasificacion As String = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("CveClasificacion = " & CveClasificacion).Rows(0)("Clasificacion").ToString AddPS(Material("CveMaterialUtilizado").ToString.ToEntero, CveOSDetalle, Material("Cantidad").ToString.ToDecimal, CveUnidadMedida, UM, Material("CvePS").ToString.ToEntero, PS, CveClasificacion, Clasificacion, Material("SeFacturara").ToString) Next @@ -176,7 +176,7 @@ Partial Class OS_PopUpMateriales e.Row.FCDropDownList("DdlPS").DataBind() e.Row.FCDropDownList("DdlPS").SelectedValue = e.Row.DBCampo("CvePS") - e.Row.FCDropDownList("DdlClasificacion").DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlClasificacion").DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlClasificacion").DataBind() e.Row.FCDropDownList("DdlClasificacion").SelectedValue = e.Row.DBCampo("CveClasificacion") End If diff --git a/PortalGPS/InicioGPS.aspx b/PortalGPS/InicioGPS.aspx index aad37218f..0a0094743 100644 --- a/PortalGPS/InicioGPS.aspx +++ b/PortalGPS/InicioGPS.aspx @@ -128,6 +128,43 @@
    --%> + + +
    +
    + +