VyA addContrato valida unidad
This commit is contained in:
@@ -9,6 +9,7 @@ Imports ClosedXML.Excel
|
||||
Imports Profact.TimbraCFDI40
|
||||
Imports System.IO
|
||||
Imports System.Drawing
|
||||
Imports System.Web.Services
|
||||
|
||||
|
||||
|
||||
@@ -111,9 +112,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
|
||||
End If
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto)
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
BtnImprimirPoSubProyecto.Visible = True
|
||||
End If
|
||||
LblAccionesSubProyecto.Text = LblSubProyecto.Text
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -265,52 +264,11 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnImprimirPoSubProyecto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim WBAnexoBalanza = New ClosedXML.Excel.XLWorkbook
|
||||
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
|
||||
|
||||
FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", NowADS(), TxtFechaDel.Text.ToDate)
|
||||
FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", NowADS(), TxtFechaAl.Text.ToDate)
|
||||
|
||||
Dim SPCounter As Integer = 1
|
||||
For Each drSP As DataRow In GlobalDTSubProyectos(UsuarioActual.CveEmpresa).Rows
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
If ObjConta.GetBalanzaComprobacion(FechaInicio, FechaFin, 2, TipoReporte, -1, drSP("CveSubProyecto").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlVista.SelectedValue.ToEntero, DdlNivel.SelectedValue.ToEntero) Then
|
||||
DtDatos = ObjConta.DtResultados
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo", TipoMensaje.MsgError)
|
||||
Exit For
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
If DtDatos.Rows.Count > 0 Then
|
||||
WBAnexoBalanza.AddWorksheet(WSDocumento(drSP("SubProyecto").ToString, DtDatos))
|
||||
Dim spNombre As String = drSP("SubProyecto").ToString().Replace(":", "_").Replace("/", "_").Replace("\", "_").Replace("?", "_").Replace("*", "_").Replace("[", "_").Replace("]", "_")
|
||||
WBAnexoBalanza.Worksheet(SPCounter).Name = $"{SPCounter}_{spNombre}"
|
||||
SPCounter = SPCounter + 1
|
||||
|
||||
End If
|
||||
'Protected Sub BtnImprimirPoSubProyecto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Dim msB = New MemoryStream()
|
||||
WBAnexoBalanza.SaveAs(msB)
|
||||
|
||||
Dim BB As Byte() = msB.ToArray
|
||||
msB.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.Buffer = True
|
||||
Response.AddHeader("content-disposition", "attachment; filename=Balanza_" & Now.ToString("yyyyMMddhhmmss") & ".xlsx")
|
||||
Response.ContentType = "application/vnd.ms-excel"
|
||||
Response.BinaryWrite(BB)
|
||||
Response.End()
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
|
||||
Function WSDocumento(SubProyecto As String, DtDatos As DataTable) As IXLWorksheet
|
||||
@@ -498,4 +456,59 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub BtnImprimirPorsubProyecto_Click(sender As Object, e As EventArgs)
|
||||
Dim WBAnexoBalanza = New ClosedXML.Excel.XLWorkbook
|
||||
'Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
|
||||
|
||||
FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", NowADS(), TxtFechaDel.Text.ToDate)
|
||||
FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", NowADS(), TxtFechaAl.Text.ToDate)
|
||||
|
||||
Dim SPCounter As Integer = 1
|
||||
Dim DtSP As DataTable = GlobalDTSubProyectos(UsuarioActual.CveEmpresa, Estatus:=-1).FiltraParametros("", "SubProyecto")
|
||||
For Each drSP As DataRow In DtSP.Rows
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
If ObjConta.GetBalanzaComprobacion(FechaInicio, FechaFin, 1, 1, -1, drSP("CveSubProyecto").ToString.ToEntero, UsuarioActual.CveEmpresa, 0, -1) Then
|
||||
DtDatos = ObjConta.DtResultados
|
||||
Else
|
||||
DtDatos = Nothing
|
||||
Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo", TipoMensaje.MsgError)
|
||||
Exit For
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
If DtDatos.Rows.Count > 0 Then
|
||||
WBAnexoBalanza.AddWorksheet(WSDocumento(drSP("SubProyecto").ToString, DtDatos))
|
||||
Dim spNombre As String = drSP("SubProyecto").ToString().Replace(":", "_").Replace("/", "_").Replace("\", "_").Replace("?", "_").Replace("*", "_").Replace("[", "_").Replace("]", "_")
|
||||
WBAnexoBalanza.Worksheet(SPCounter).Name = $"{SPCounter}_{spNombre}"
|
||||
SPCounter = SPCounter + 1
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Dim msB = New MemoryStream()
|
||||
WBAnexoBalanza.SaveAs(msB)
|
||||
|
||||
Dim BB As Byte() = msB.ToArray
|
||||
msB.Dispose()
|
||||
|
||||
Response.Clear()
|
||||
Response.Buffer = True
|
||||
Response.AddHeader("content-disposition", "attachment; filename=Balanza_" & Now.ToString("yyyyMMddhhmmss") & ".xlsx")
|
||||
Response.ContentType = "application/vnd.ms-excel"
|
||||
Response.BinaryWrite(BB)
|
||||
'Response.Write("Ready")
|
||||
|
||||
Response.End()
|
||||
End Sub
|
||||
|
||||
<WebMethod>
|
||||
Public Shared Function MyStaticFunction(ByVal parameter As String) As String
|
||||
' Lógica de tu función aquí
|
||||
Return "Resultado: " & parameter
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user