+
+
+
+
+
+
+
+
diff --git a/AC/RepProgramasOperativosAvances.aspx.vb b/AC/RepProgramasOperativosAvances.aspx.vb
new file mode 100644
index 000000000..94d2c5f5b
--- /dev/null
+++ b/AC/RepProgramasOperativosAvances.aspx.vb
@@ -0,0 +1,204 @@
+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)
+
+ GVD.HeaderRow.Parent.Controls.AddAt(0, row)
+
+
+
+ End Sub
+
+
+
+
+End Class
diff --git a/App_Code/ClsAC.vb b/App_Code/ClsAC.vb
index a48e0b047..070c21364 100644
--- a/App_Code/ClsAC.vb
+++ b/App_Code/ClsAC.vb
@@ -140,6 +140,26 @@ Public Class ClsAC
Return Retorno
End Function
+ 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() As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AC_ProgramaOperativoGet")
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 2679686e1..e53221499 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -8312,6 +8312,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/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 0c645ba81..32c2f3541 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -4919,7 +4919,7 @@ Partial Class Compras_Compras
End If
Next
- Dim DoctosRelacionados As String = If(UUIDSList.Count > 0, String.Join(",", UUIDSList.ToArray()), "-1")
+ Dim DoctosRelacionados As String = GeneraStrinDoctosRelacionados()
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
@@ -8234,6 +8234,29 @@ Partial Class Compras_Compras
End If
End Sub
+ Private Function GeneraStrinDoctosRelacionados() As String
+
+ Dim DoctosRelacionados As String = "-1"
+ Dim listaUUIDSRelacionados As New List(Of String)
+
+ If UUIDSList.Count > 0 Then
+ For Each s As String In UUIDSList
+ If s.Trim.Length > 0 Then
+ listaUUIDSRelacionados.Add(s.Trim)
+ End If
+ Next
+ End If
+
+ If listaUUIDSRelacionados.Count > 0 Then
+ DoctosRelacionados = String.Join(",", listaUUIDSRelacionados.ToArray())
+ DoctosRelacionados = DoctosRelacionados.Substring(0, DoctosRelacionados.Length - 2)
+ End If
+
+ Return DoctosRelacionados
+
+
+ End Function
+
Private Function AsignarSubProyectoPrincipal() As Integer
Dim CveSubProyectoPrincioal As Integer = -1
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index da8efa4a5..3b858e92f 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -1824,7 +1824,7 @@ 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
@@ -1834,6 +1834,7 @@ Partial Class General_SaldosIniciales
ErrorAF = True
End If
End If
+
CuentaContable = Row("Cuenta Depreciación").ToString().Trim.Replace("-", "").Replace(" ", "")
If CuentaContable.Length > 0 Then
Dim CveCuentaContable As Integer = DTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContable}'").ToEntero()
@@ -1844,6 +1845,7 @@ 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()
@@ -1876,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()
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index 71a1f4cda..cd8b91676 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -2033,7 +2033,7 @@ Partial Class ProductosyServicios
Dim ObjPS As New ClsProductosServicios
- 'ObjPS.IniciaTransacSQL()
+ ObjPS.IniciaTransacSQL()
If ObjPS.UnificarPS(CvePS, DdlPsUnificar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("Los productos y/o servicios han sido unificados", TipoMensaje.MsgInformacion)
@@ -2042,11 +2042,11 @@ Partial Class ProductosyServicios
ErrorUnificacion = True
End If
- 'If ErrorUnificacion Then
- ' ObjPS.RollBack()
- 'Else
- ' ObjPS.Commit()
- 'End If
+ If ErrorUnificacion Then
+ ObjPS.RollBack()
+ Else
+ ObjPS.Commit()
+ End If
ObjPS.Dispose()