Commit inicial Ventas Productivo
This commit is contained in:
628
Compras/RepCxPDetalle.aspx.vb
Normal file
628
Compras/RepCxPDetalle.aspx.vb
Normal file
@@ -0,0 +1,628 @@
|
||||
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class RepCxPDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Public Property CveProveedor() As Integer
|
||||
Get
|
||||
Return ViewState("CveProveedor").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProveedor") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveProveedorClasificacion() As Integer
|
||||
Get
|
||||
Return ViewState("CveProveedorClasificacion").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProveedorClasificacion") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Serie() As String
|
||||
Get
|
||||
Return ViewState("Serie").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Serie") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Anio() As Integer
|
||||
Get
|
||||
Return ViewState("Anio").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Anio") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Mes() As Integer
|
||||
Get
|
||||
Return ViewState("Mes").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Mes") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property AnioMes() As String
|
||||
Get
|
||||
Return ViewState("AnioMes").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("AnioMes") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Fecha() As String
|
||||
Get
|
||||
Return ViewState("Fecha").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Fecha") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaInicio() As String
|
||||
Get
|
||||
Return ViewState("FechaInicio").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaInicio") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaFin() As String
|
||||
Get
|
||||
Return ViewState("FechaFin").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaFin") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaVInicio() As String
|
||||
Get
|
||||
Return ViewState("FechaVInicio").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaVInicio") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaVFin() As String
|
||||
Get
|
||||
Return ViewState("FechaVFin").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaVFin") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property FechaCorte() As String
|
||||
Get
|
||||
Return ViewState("FechaCorte").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("FechaCorte") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveMoneda() As Integer
|
||||
Get
|
||||
Return ViewState("CveMoneda").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveUsuario() As Integer
|
||||
Get
|
||||
Return ViewState("CveUsuario").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUsuario") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Agrupador() As Integer
|
||||
Get
|
||||
Return ViewState("Agrupador").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Agrupador") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Opcion() As String
|
||||
Get
|
||||
Return ViewState("Opcion").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Opcion") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveEstatusFactura() As Integer
|
||||
Get
|
||||
Return ViewState("CveEstatusFactura").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEstatusFactura") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveSubProyecto() As Integer
|
||||
Get
|
||||
Return ViewState("CveSubProyecto").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSubProyecto") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property CveProveedorSucursal() As Integer
|
||||
Get
|
||||
Return ViewState("CveProveedorSucursal").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProveedorSucursal") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveTipoProveedor() As Integer
|
||||
Get
|
||||
Return ViewState("CveTipoProveedor").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveTipoProveedor") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TCEspecifico As Double
|
||||
|
||||
|
||||
Public Property DTCuentasContables() As DataTable
|
||||
Get
|
||||
If ViewState("DTCuentasContables") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTCuentasContables"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTCuentasContables") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
'pRivate ReadOnly Property ColumnasVisibles As
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
ViewState("Opcion") = IfNull(Request("Op"), "S")
|
||||
CargaCombos()
|
||||
If Request("Op") IsNot Nothing Then
|
||||
CargaDatos()
|
||||
End If
|
||||
'ImgPersonalizar.Attributes.Add("onclick", "$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
Private Sub CargaCombos()
|
||||
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedores.DataBind()
|
||||
Dim Proveedor As Integer = IfNull(Request("CveProveedor"), -1).ToString.ToEntero
|
||||
|
||||
DdlProveedores.SelectedValueExist(Proveedor)
|
||||
CveProveedor = Proveedor
|
||||
CveProveedorClasificacion = IfNull(Request("CveProveedorClasificacion"), -1).ToString.ToEntero
|
||||
|
||||
Dim ProveedorClasificacion As Integer = IfNull(Request("CveProveedorClasificacion"), -1).ToString.ToEntero
|
||||
DdlProveedoresClasificaciones.DataSource = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa)
|
||||
DdlProveedoresClasificaciones.DataBind()
|
||||
DdlProveedoresClasificaciones.Items.Insert(1, New ListItem("Sin Clasificación", "0"))
|
||||
DdlProveedoresClasificaciones.SelectedValueExist(ProveedorClasificacion)
|
||||
|
||||
'CargaUsuarios
|
||||
Dim UsuarioResponsable As Integer = IfNull(Request("CveUsuarioResponsable"), -1).ToString.ToEntero
|
||||
DdlUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa).FiltraParametros("ProveedoresResponsables > 0")
|
||||
DdlUsuarioResponsable.DataBind()
|
||||
DdlUsuarioResponsable.SelectedValueExist(UsuarioResponsable)
|
||||
|
||||
Dim UsuarioRegistro As Integer = IfNull(Request("CveUsuario"), -1).ToString.ToEntero
|
||||
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa), "Nombre") 'GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioRegistro.DataBind()
|
||||
DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlUsuarioRegistro.SelectedValueExist(UsuarioRegistro)
|
||||
|
||||
|
||||
Dim CveSucursal As Integer = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(1, New ListItem("Sin Sucursal", "0"))
|
||||
DdlSubProyecto.SelectedValueExist(CveSucursal)
|
||||
|
||||
Dim TipoMoneda As Integer = IfNull(Request("TipoMoneda"), 1).ToString.ToEntero
|
||||
RblTipoCambio.SelectedValue = TipoMoneda.ToString
|
||||
|
||||
If RblTipoCambio.SelectedValue = "3" Then
|
||||
LiEspecifico.Visible = True
|
||||
End If
|
||||
|
||||
Dim TCEspecifico As String = IfNull(Request("TCEspecifico"), 1).ToString
|
||||
TxtEspecifico.Text = TCEspecifico
|
||||
|
||||
'Carga Agrupador
|
||||
Dim GPO As Integer = IfNull(Request("GPO"), 5).ToString.ToEntero
|
||||
DdlGrupo.SelectedValueExist(GPO)
|
||||
Agrupador = GPO
|
||||
|
||||
'CargaFechas
|
||||
FechaInicio = IfNull(Request("FechaI"), "-1").ToString
|
||||
FechaFin = IfNull(Request("FechaF"), "-1").ToString
|
||||
FechaVInicio = IfNull(Request("FechaVI"), "-1").ToString
|
||||
FechaVFin = IfNull(Request("FechaVF"), "-1").ToString
|
||||
FechaCorte = IfNull(Request("FechaCorte"), Now.ToDate.ToString).ToString
|
||||
txtCorteA.Text = $"31/12/{Now.Year}"
|
||||
|
||||
|
||||
If Request("FechaI") <> "-1" AndAlso IsDate(Request("FechaI")) Then txtFechaI.Text = Request("FechaI")
|
||||
If Request("FechaF") <> "-1" AndAlso IsDate(Request("FechaF")) Then txtFechaF.Text = Request("FechaF")
|
||||
If Request("FechaVI") <> "-1" AndAlso IsDate(Request("FechaVI")) Then txtFechaVI.Text = Request("FechaVI")
|
||||
If Request("FechaVF") <> "-1" AndAlso IsDate(Request("FechaVF")) Then txtFechaVF.Text = Request("FechaVF")
|
||||
If Request("FechaCorte") <> "-1" AndAlso IsDate(Request("FechaCorte")) Then txtCorteA.Text = Request("FechaCorte")
|
||||
|
||||
Anio = IfNull(Request("Anio"), -1).ToString.ToEntero
|
||||
Mes = IfNull(Request("Mes"), -1).ToString.ToEntero
|
||||
AnioMes = IfNull(Request("AnioMes"), "-1").ToString
|
||||
CveMoneda = IfNull(Request("CveMoneda"), -1).ToString.ToEntero
|
||||
Fecha = IfNull(Request("Fecha"), "-1").ToString
|
||||
CveProveedorSucursal = IfNull(Request("CveProveedorSucursal"), -1).ToString.ToEntero
|
||||
CveUsuario = IfNull(Request("CveUsuario"), -1).ToString.ToEntero
|
||||
CveEstatusFactura = IfNull(Request("CveEstatusFactura"), -1).ToString.ToEntero
|
||||
CveSubProyecto = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero
|
||||
|
||||
|
||||
DdlEstatusCompra.DataSource = GlobalDTCompEstatusFactura.FiltraParametros("CveEstatusFactura IN (1, 2)")
|
||||
DdlEstatusCompra.DataBind()
|
||||
DdlEstatusCompra.SelectedValueExist(CveEstatusFactura)
|
||||
|
||||
CveTipoProveedor = IfNull(Request("CveTipoProveedor"), -1).ToString.ToEntero
|
||||
DdlTipoProveedor.SelectedValueExist(CveTipoProveedor)
|
||||
|
||||
Dim Comprobaciones = IfNull(Request("Comprobaciones"), -1).ToString.ToEntero
|
||||
DdlComprobacion.SelectedValueExist(Comprobaciones)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function CargaCuentasContables(DT As DataTable) As DataTable
|
||||
|
||||
Dim ObjConpaq As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
Try
|
||||
If ObjConpaq.GetCuentas(-1, -1, -1) Then
|
||||
DTCuentasContables = ObjConpaq.DtResultados
|
||||
|
||||
For Each Proveedor As DataRow In DT.Rows
|
||||
If Proveedor("IdCtaContProveedores").ToString.ToEntero > 0 Then
|
||||
|
||||
If Not DTCuentasContables.FiltraParametros($"Id = {Proveedor("IdCtaContProveedores").ToString }") Is Nothing Then
|
||||
Proveedor("Cuenta") = DTCuentasContables.FiltroPrimeroValor("CuentaFormato", $"id = {Proveedor("IdCtaContProveedores").ToString.ToEntero }")
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
DT.AcceptChanges()
|
||||
Else
|
||||
DTCuentasContables = New DataTable
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar las cuentas contables", ex)
|
||||
End Try
|
||||
ObjConpaq.Dispose()
|
||||
|
||||
Return DT
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
Try
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
|
||||
TCEspecifico = TxtEspecifico.Text.ToDouble
|
||||
Else
|
||||
TCEspecifico = -1
|
||||
End If
|
||||
|
||||
Dim FechaI, FechaF, FechaVI, FechaVF As String
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1")
|
||||
FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1")
|
||||
|
||||
CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero
|
||||
|
||||
If ObjMovtos.GetCxPDetalle(FechaI, FechaF, DdlProveedores.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, CveProveedorSucursal, CveUsuario,
|
||||
DdlUsuarioResponsable.SelectedValue.ToEntero, Anio, Mes, AnioMes, CveMoneda, CveSubProyecto, DdlEstatusCompra.SelectedValue.ToEntero,
|
||||
Fecha, DdlGrupo.SelectedValue.ToEntero, Opcion, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero,
|
||||
TCEspecifico, FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=IIf(CveTipoProveedor = 3,
|
||||
-1, CveTipoProveedor), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero) Then
|
||||
|
||||
|
||||
Dim TMP_DTDatos As New DataTable
|
||||
TMP_DTDatos = ObjMovtos.DtResultados
|
||||
TMP_DTDatos.Columns.Add("Cuenta")
|
||||
|
||||
If DdlGrupo.SelectedValue.ToEntero = 5 And UsuarioActual.Empresa.UsaContabilidad Then
|
||||
TMP_DTDatos = CargaCuentasContables(TMP_DTDatos)
|
||||
GvDatos.Columns(7).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(7).Visible = False
|
||||
End If
|
||||
|
||||
DtDatos = TMP_DTDatos
|
||||
|
||||
|
||||
GvDatos.DataSource = DtDatos
|
||||
HplProgramar.NavigateUrl = $"/Bancos/RepProgramarRecursos.aspx{HttpContext.Current.Request.Url.PathAndQuery.Replace("/Compras/RepCxPDetalle.aspx", "")}"
|
||||
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el reporte de CxP detalle", ex)
|
||||
End Try
|
||||
ObjMovtos.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONSULTAR"
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
ConfiguraEmpresa()
|
||||
'UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONFIGURACIONES"
|
||||
|
||||
Private Function AddRows(ByRef DT As DataTable) As DataTable
|
||||
'Dim i As Integer = 0
|
||||
'Dim Ultima As String = String.Empty
|
||||
'Dim Rows As Integer = 0
|
||||
'Dim dbRow As DataRow
|
||||
|
||||
'While i < DT.Rows.Count
|
||||
' If DT.Rows(i)("GPO").ToString <> "" AndAlso DT.Rows(i)("CveVenta").ToString = "" AndAlso Ultima <> DT.Rows(i)("GPO").ToString Then
|
||||
' dbRow = DT.NewRow()
|
||||
' dbRow("GPO") = DT.Rows(i)("GPO") : Ultima = DT.Rows(i)("GPO").ToString
|
||||
' DT.Rows.InsertAt(dbRow, i)
|
||||
' End If
|
||||
' i += 1
|
||||
'End While
|
||||
Return DT
|
||||
End Function
|
||||
|
||||
Private Sub ConfiguraEmpresa()
|
||||
'Dim ObjEmpresa As New ClsEmpresas()
|
||||
'If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
|
||||
If Opcion <> "S" Then
|
||||
If Not UsuarioActual.Empresa.MostrarRetIVA Then GvDatos.Columns(7).Visible = False
|
||||
If Not UsuarioActual.Empresa.MostrarRetISR Then GvDatos.Columns(8).Visible = False
|
||||
End If
|
||||
'End If
|
||||
'ObjEmpresa.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "GRIDVIEW"
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If DdlGrupo.SelectedValue.ToEntero = 11 Then
|
||||
If e.Row.DBCampo("CveSubProyecto") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
ElseIf e.Row.DBCampo("RazonSocial") = "" Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End If
|
||||
Else
|
||||
If e.Row.DBCampo("RazonSocial") = "" And e.Row.DBCampo("SerieFolio") = "" Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Agrupador") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.FCHyperLink("HplFolio").ForeColor = Drawing.Color.White
|
||||
|
||||
If e.Row.DBCampo("CveMoneda") = "1" Then
|
||||
e.Row.FCHyperLink("HplFolio").Text = "Total Pesos"
|
||||
ElseIf e.Row.DBCampo("CveMoneda") = "2" Then
|
||||
e.Row.FCHyperLink("HplFolio").Text = "Total Dólares"
|
||||
Else
|
||||
e.Row.FCHyperLink("HplFolio").Text = "Total"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("CveCompra") = "" And e.Row.DBCampo("Agrupador") <> "" Then
|
||||
e.Row.FCHyperLink("HplFolio").Text = e.Row.DBCampo("Agrupador")
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
If e.Row.DBCampo("Agrupador").Length > 25 Then
|
||||
e.Row.FCHyperLink("HplFolio").Text = String.Format("{0}...", e.Row.DBCampo("Agrupador").Substring(0, 25))
|
||||
End If
|
||||
Else
|
||||
e.Row.FCHyperLink("HplFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "PERSONALIZAR"
|
||||
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||
|
||||
If ChkFolio.Checked Then
|
||||
GvDatos.Columns(1).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(1).Visible = False
|
||||
End If
|
||||
|
||||
If ChkSubTotal.Checked Then
|
||||
GvDatos.Columns(2).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(2).Visible = False
|
||||
End If
|
||||
|
||||
If ChkSaldo.Checked Then
|
||||
GvDatos.Columns(3).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(3).Visible = False
|
||||
End If
|
||||
|
||||
If ChkFechaVencimiento.Checked Then
|
||||
GvDatos.Columns(4).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(4).Visible = False
|
||||
End If
|
||||
|
||||
If ChkDiasVencidos.Checked Then
|
||||
GvDatos.Columns(5).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(5).Visible = False
|
||||
End If
|
||||
|
||||
If ChkProveedor.Checked Then
|
||||
GvDatos.Columns(6).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(6).Visible = False
|
||||
End If
|
||||
|
||||
If ChkCuenta.Checked Then
|
||||
GvDatos.Columns(7).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(7).Visible = False
|
||||
End If
|
||||
|
||||
If ChkObservaciones.Checked Then
|
||||
GvDatos.Columns(8).Visible = True
|
||||
Else
|
||||
GvDatos.Columns(8).Visible = False
|
||||
End If
|
||||
UPDatos.Update()
|
||||
|
||||
RegistraScript("$('#DivPersonalizar').modal('hide');")
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "IMPRESIONES"
|
||||
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
|
||||
GenerarPDF("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
|
||||
TCEspecifico = TxtEspecifico.Text.ToDouble
|
||||
Else
|
||||
TCEspecifico = -1
|
||||
End If
|
||||
|
||||
Dim FechaI, FechaF, FechaVI, FechaVF As String
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1")
|
||||
FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1")
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||
params.Add(New ReportParameter("FechaFin", FechaF))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
'PARA REPORTE
|
||||
Dim Sucursal = If(DdlSubProyecto.SelectedValue = "-1", "", $" <b>Sucursal:</b> {DdlSubProyecto.SelectedItem.Text}")
|
||||
Dim Proveedor = If(DdlProveedores.SelectedValue = "-1", "", $" <b>Proveedor:</b> {DdlProveedores.SelectedItem.Text}")
|
||||
Dim Grupo = If(DdlGrupo.SelectedValue = "-1", "", $" <b>Grupo:</b> {DdlGrupo.SelectedItem.Text}")
|
||||
Dim FechaIn As String = If(txtFechaI.Text = "", "", $" <b>Fecha Inicio:</b> {txtFechaI.Text}")
|
||||
Dim FechaFn As String = If(txtFechaF.Text = "", "", $" <b>Fecha Fin:</b> {txtFechaF.Text}")
|
||||
Dim FechaInV As String = If(txtFechaVI.Text = "", "", $" <b>Fecha Inicio Venc:</b> {txtFechaVI.Text}")
|
||||
Dim FechaFnV As String = If(txtFechaVF.Text = "", "", $" <b>Fecha Fin Venc:</b> {txtFechaVF.Text}")
|
||||
Dim Responsable = If(DdlUsuarioResponsable.SelectedValue = "-1", "", $" <b>Responsable:</b> {DdlUsuarioResponsable.SelectedItem.Text}")
|
||||
Dim Estatus = If(DdlEstatusCompra.SelectedValue = "-1", "", $" <b>Estatus:</b> {DdlEstatusCompra.SelectedItem.Text}")
|
||||
Dim Registro = If(DdlUsuarioRegistro.SelectedValue = "-1", "", $" <b>Registró:</b> {DdlUsuarioRegistro.SelectedItem.Text}")
|
||||
Dim Clasificacion = If(DdlProveedoresClasificaciones.SelectedValue = "-1", "", $" <b>Clasificación:</b> {DdlProveedoresClasificaciones.SelectedItem.Text}")
|
||||
Dim TipoMoneda = If(RblTipoCambio.SelectedValue = "-1", "", $" <b>Tipo Moneda:</b> {RblTipoCambio.SelectedItem.Text}")
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"{Grupo}{Proveedor}{FechaIn}{FechaFn}{FechaInV}{FechaFnV}{Responsable}{Estatus}{Registro}{Clasificacion}{Sucursal}{TipoMoneda}"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepCxPDetalle.rdlc", DtDatos, params, "ReporteCxPDetalle", Formato)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "TIPO DE CAMBIO"
|
||||
|
||||
Private Sub DdlTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
|
||||
Dim TipoCambio As Double
|
||||
LiEspecifico.Visible = True
|
||||
TipoCambio = GlobalTipoCambio(Now)
|
||||
TxtEspecifico.Text = TipoCambio.ToString
|
||||
Else
|
||||
LiEspecifico.Visible = False
|
||||
End If
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
RegistraScript("$('#DivPersonalizar').modal({ backdrop: 'static', keyboard: false});")
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user