Commit inicial Ventas Productivo
This commit is contained in:
137
Contabilidad/ComparacionesContabilidad.aspx.vb
Normal file
137
Contabilidad/ComparacionesContabilidad.aspx.vb
Normal file
@@ -0,0 +1,137 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Contabilidad_ComparacionesContabilidad
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private ReadOnly Property CveCajaChica As Integer
|
||||
Get
|
||||
Return ViewState("CveCajaChica").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private Property DtCheques As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCheques"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCheques") = 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
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
BtnConsultar.Enabled = True
|
||||
CargaEjercicios()
|
||||
CargaDatos()
|
||||
Else
|
||||
Alert("La empresa no usa contabilidad.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
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
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
|
||||
'Compras
|
||||
If ObjAC.GetComparaciones(1, DdlEjercicio.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvCompras.DataSource = ObjAC.DtResultados
|
||||
Else
|
||||
GvCompras.DataSource = Nothing
|
||||
End If
|
||||
|
||||
'Bancos
|
||||
If ObjAC.GetComparaciones(2, DdlEjercicio.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvBancos.DataSource = ObjAC.DtResultados
|
||||
Else
|
||||
GvBancos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
'Proveedores
|
||||
If ObjAC.GetComparaciones(3, DdlEjercicio.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvProveedores.DataSource = ObjAC.DtResultados
|
||||
Else
|
||||
GvProveedores.DataSource = Nothing
|
||||
End If
|
||||
|
||||
'Clientes
|
||||
If ObjAC.GetComparaciones(4, DdlEjercicio.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvClientes.DataSource = ObjAC.DtResultados
|
||||
Else
|
||||
GvClientes.DataSource = Nothing
|
||||
End If
|
||||
|
||||
'Clientes
|
||||
If ObjAC.GetComparaciones(5, DdlEjercicio.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvInv.DataSource = ObjAC.DtResultados
|
||||
Else
|
||||
GvInv.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjAC.Dispose()
|
||||
|
||||
|
||||
GvCompras.DataBind()
|
||||
GvBancos.DataBind()
|
||||
GvProveedores.DataBind()
|
||||
GvClientes.DataBind()
|
||||
GvInv.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub GvBancos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", e.Row.DBCampo("PolID"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCompras_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCHyperLink("HLCompra").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GvInv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("DifImporte").ToDouble <> 0.00 Then
|
||||
e.Row.Cells(3).ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("FechaDiferente") = "1" Then
|
||||
e.Row.Cells(4).ForeColor = Drawing.Color.Red
|
||||
e.Row.Cells(5).ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user