Cambio de correo de cotizacion
This commit is contained in:
@@ -1,181 +1,181 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Bancos_CatBancos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
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 e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(206) 'EJECUTIVO
|
||||
e.Row.Cells(2).Width = Unit.Pixel(106) 'TELEFONO
|
||||
e.Row.Cells(3).Width = Unit.Pixel(95) 'ESTATUS
|
||||
e.Row.Cells(4).Width = Unit.Pixel(95) 'FECHA
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(7).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim
|
||||
Dim Ejecutivo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEjecutivo"), TextBox).Text.Trim
|
||||
Dim Telefono As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTelefono"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTBancos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTBancos"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Bancos_CatBancos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
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 e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(156) 'BANCO
|
||||
e.Row.Cells(1).Width = Unit.Pixel(206) 'EJECUTIVO
|
||||
e.Row.Cells(2).Width = Unit.Pixel(106) 'TELEFONO
|
||||
e.Row.Cells(3).Width = Unit.Pixel(95) 'ESTATUS
|
||||
e.Row.Cells(4).Width = Unit.Pixel(95) 'FECHA
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO
|
||||
e.Row.Cells(6).Width = Unit.Pixel(100) 'EDITAR
|
||||
e.Row.Cells(7).Width = Unit.Pixel(65) 'ELIMINAR
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
|
||||
Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim
|
||||
Dim Ejecutivo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEjecutivo"), TextBox).Text.Trim
|
||||
Dim Telefono As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTelefono"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
|
||||
If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTBancos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTBancos"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
3068
Bancos/IE.aspx
3068
Bancos/IE.aspx
File diff suppressed because it is too large
Load Diff
37530
Compras/Compras.aspx.vb
37530
Compras/Compras.aspx.vb
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,388 +1,388 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Compras_RepRembolsoComprobaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private ReadOnly Property CveCajaChica As Integer
|
||||
Get
|
||||
Return ViewState("CveCajaChica").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CvePersonal As Integer
|
||||
Get
|
||||
Return ViewState("CvePersonal").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private Property CveMoneda As Integer
|
||||
Get
|
||||
Return ViewState("CveMoneda").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IdCuentaBancaria As Integer
|
||||
Get
|
||||
Return ViewState("IdCuentaBancaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IdCuentaBancaria") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property NumeroReembolso As String
|
||||
Get
|
||||
NumeroReembolso = ViewState("NumeroReembolso").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("NumeroReembolso") = 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
|
||||
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
|
||||
Private Sub Compras_RepRembolsoComprobaciones_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
ViewState("CveMoneda") = 1
|
||||
|
||||
'Cargar Filtros
|
||||
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1
|
||||
DdlCajaChica.DataSource = dt
|
||||
DdlCajaChica.DataBind()
|
||||
|
||||
Dim ObjPersonal As New ClsRH
|
||||
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
||||
ObjPersonal.Dispose()
|
||||
DdlPersonal.DataBind()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ViewState("CveCajaChica") = -2
|
||||
ViewState("CvePersonal") = -2
|
||||
|
||||
LtTituloPago.Text = ""
|
||||
|
||||
If DdlTipoPago.SelectedValue = "1" Then
|
||||
DdlPersonal.Visible = True
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "F / E:"
|
||||
|
||||
'Valida Proceso 120 para ROL Administrador de obra - para FyE solo puede ver los del UsuarioActual
|
||||
If UsuarioActual.TienePermisoProceso(120) Then
|
||||
If UsuarioActual.CvePersonal > 0 Then
|
||||
DdlPersonal.SelectedValue = UsuarioActual.CvePersonal.ToString
|
||||
ViewState("CvePersonal") = UsuarioActual.CvePersonal
|
||||
End If
|
||||
DdlPersonal.Enabled = False
|
||||
End If
|
||||
|
||||
Else
|
||||
DdlPersonal.Visible = False
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
|
||||
DdlPersonal.Enabled = True
|
||||
End If
|
||||
|
||||
If DdlTipoPago.SelectedValue = "2" Then
|
||||
DdlCajaChica.Visible = True
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "Caja Chica:"
|
||||
Else
|
||||
DdlCajaChica.Visible = False
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
|
||||
ViewState("CvePersonal") = DdlPersonal.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCajaChica.SelectedIndexChanged
|
||||
ViewState("CveCajaChica") = DdlCajaChica.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
'If e.Row.RowIndex = 1 Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(100)
|
||||
' e.Row.Cells(1).Width = Unit.Pixel(300)
|
||||
' e.Row.Cells(2).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(3).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(4).Width = Unit.Pixel(80)
|
||||
' e.Row.Cells(5).Width = Unit.Pixel(40)
|
||||
' e.Row.Cells(6).Width = Unit.Pixel(60)
|
||||
' e.Row.Cells(7).Width = Unit.Pixel(60)
|
||||
'End If
|
||||
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxP" Then e.Row.Cells(5).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Abonado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAbonado"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldo"), Literal).Text = ""
|
||||
If Not e.Row.DBCampo("IdPoliza").ToEntero > 0 Then e.Row.Cells(13).Text = ""
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LbkUnificar_Click(sender As Object, e As EventArgs) Handles LbkUnificar.Click
|
||||
Dim ObjComp As New ClsCompras()
|
||||
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
Dim TieneError = False
|
||||
Dim CvePrePoliza As Integer = 0
|
||||
Dim IdPoliza As Integer = 0
|
||||
Dim Msg As New StringBuilder
|
||||
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
|
||||
If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
If CvePrePoliza > 0 AndAlso DdlCajaChica.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, -1, DdlCajaChica.SelectedValue.ToEntero, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Compras/RepRembolsoComprobaciones - Unificar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Msg.AppendFormat("Se unificaron todas las compras con éxito")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad AndAlso Not TieneError Then
|
||||
If ObjAC Is Nothing Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||
TieneError = True
|
||||
Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
IdPoliza = ObjMov.ContaIdPoliza
|
||||
End If
|
||||
End If
|
||||
|
||||
If IdPoliza > 0 AndAlso Not TieneError Then
|
||||
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjComp.Commit()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjComp.RollBack()
|
||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||
Alert("Ocurrió un error al unificar las compras", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ObjComp.Dispose()
|
||||
ObjMov.Dispose()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaCxP()
|
||||
End Sub
|
||||
Private Sub CargaDatos(tCveIE As Integer)
|
||||
Dim ObjIE As New ClsBancos()
|
||||
|
||||
If ObjIE.GetBancosIE(tCveIE, UsuarioActual.CveEmpresa) Then
|
||||
If ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Else
|
||||
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub CargaCxP()
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
|
||||
GvCxP.Visible = True
|
||||
|
||||
ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim))
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
GvCxP.DataSource = DtDatos
|
||||
|
||||
'cargo si tiene cheques pendientes sin amortizar
|
||||
If CvePersonal > 0 Then
|
||||
If DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlPersonal.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
CargaEgresosSinComprobar()
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then divUnificar.Visible = False
|
||||
End If
|
||||
'ObjMovtos.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveCajaChica > 0 AndAlso DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlCajaChica.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
divUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GvCxP.DataBind()
|
||||
|
||||
LnkImprimir.Visible = True
|
||||
NumeroReembolso = TxtNumeroReembolso.Text
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
If NumeroReembolso <> "" AndAlso CvePersonal > 0 AndAlso DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero > 0 Then
|
||||
DivVincularEgreso.Visible = True
|
||||
Else
|
||||
DivVincularEgreso.Visible = False
|
||||
End If
|
||||
If DtDatos.MAX("IdPoliza").ToEntero > 0 Then
|
||||
LbkUnificar.Visible = False
|
||||
Else
|
||||
LbkUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
|
||||
UPCompras.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "PDF"
|
||||
Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click
|
||||
Imprimir("PDF")
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
Imprimir("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub Imprimir(Formato As String)
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
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)
|
||||
|
||||
If Archivo.Exists Then
|
||||
params.Add(New ReportParameter("Numero", NumeroReembolso))
|
||||
params.Add(New ReportParameter("Anio", DtDatos.FiltraParametros("CveCompra > 0").MAX("Fecha").ToDate.Year.ToString))
|
||||
params.Add(New ReportParameter("Nombre", DtDatos.MAX("SubProyecto")))
|
||||
params.Add(New ReportParameter("Fecha", Now.Date.ToString))
|
||||
params.Add(New ReportParameter("Elaboro", ""))
|
||||
params.Add(New ReportParameter("Autorizo", ""))
|
||||
params.Add(New ReportParameter("ElaboroPuesto", ""))
|
||||
params.Add(New ReportParameter("AutorizoPuesto", ""))
|
||||
ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras")
|
||||
Else
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
|
||||
|
||||
params.Add(New ReportParameter("CajaChica", If(DdlCajaChica.SelectedValue.ToEntero > 0, "Caja chica: " & DdlCajaChica.SelectedItem.Text, "Funcionario/Empleado: " & DdlPersonal.SelectedItem.Text)))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtDatos, params, "RepRembolsosComprobaciones", Formato:=Formato)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub CargaEgresosSinComprobar()
|
||||
If CvePersonal > 0 Then
|
||||
DdlCheque.Items.Clear()
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
If ObjMov.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
DdlCheque.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha")
|
||||
DdlCheque.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
ObjMov.Dispose()
|
||||
DdlCheque.DataBind()
|
||||
UPCompras.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnVincularEgreso_Click(sender As Object, e As EventArgs)
|
||||
If Not DdlCheque.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que tener seleccionado un egreso sin comprobar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjIE As New ClsBancos
|
||||
If ObjIE.UpdateComprobacionSinBancos(DdlCheque.SelectedValue.ToEntero, DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero,
|
||||
CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Vinculado correctamente")
|
||||
DdlCheque.SelectedIndex = 0
|
||||
CargaEgresosSinComprobar()
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Compras_RepRembolsoComprobaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private ReadOnly Property CveCajaChica As Integer
|
||||
Get
|
||||
Return ViewState("CveCajaChica").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private ReadOnly Property CvePersonal As Integer
|
||||
Get
|
||||
Return ViewState("CvePersonal").ToString.ToEntero
|
||||
End Get
|
||||
End Property
|
||||
Private Property CveMoneda As Integer
|
||||
Get
|
||||
Return ViewState("CveMoneda").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMoneda") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IdCuentaBancaria As Integer
|
||||
Get
|
||||
Return ViewState("IdCuentaBancaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IdCuentaBancaria") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property NumeroReembolso As String
|
||||
Get
|
||||
NumeroReembolso = ViewState("NumeroReembolso").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("NumeroReembolso") = 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
|
||||
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
|
||||
Private Sub Compras_RepRembolsoComprobaciones_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
ViewState("CveMoneda") = 1
|
||||
|
||||
'Cargar Filtros
|
||||
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario)
|
||||
dt = dt.FiltraParametros(String.Format("CveTipoCuenta = 1")) 'caja chica = 1
|
||||
DdlCajaChica.DataSource = dt
|
||||
DdlCajaChica.DataBind()
|
||||
|
||||
Dim ObjPersonal As New ClsRH
|
||||
ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
||||
ObjPersonal.Dispose()
|
||||
DdlPersonal.DataBind()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
ViewState("CveCajaChica") = -2
|
||||
ViewState("CvePersonal") = -2
|
||||
|
||||
LtTituloPago.Text = ""
|
||||
|
||||
If DdlTipoPago.SelectedValue = "1" Then
|
||||
DdlPersonal.Visible = True
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "F / E:"
|
||||
|
||||
'Valida Proceso 120 para ROL Administrador de obra - para FyE solo puede ver los del UsuarioActual
|
||||
If UsuarioActual.TienePermisoProceso(120) Then
|
||||
If UsuarioActual.CvePersonal > 0 Then
|
||||
DdlPersonal.SelectedValue = UsuarioActual.CvePersonal.ToString
|
||||
ViewState("CvePersonal") = UsuarioActual.CvePersonal
|
||||
End If
|
||||
DdlPersonal.Enabled = False
|
||||
End If
|
||||
|
||||
Else
|
||||
DdlPersonal.Visible = False
|
||||
DdlPersonal.SelectedValue = "-2"
|
||||
|
||||
DdlPersonal.Enabled = True
|
||||
End If
|
||||
|
||||
If DdlTipoPago.SelectedValue = "2" Then
|
||||
DdlCajaChica.Visible = True
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
LtTituloPago.Text = "Caja Chica:"
|
||||
Else
|
||||
DdlCajaChica.Visible = False
|
||||
DdlCajaChica.SelectedValue = "-2"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
|
||||
ViewState("CvePersonal") = DdlPersonal.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCajaChica.SelectedIndexChanged
|
||||
ViewState("CveCajaChica") = DdlCajaChica.SelectedValue
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
End If
|
||||
'If e.Row.RowIndex = 1 Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(100)
|
||||
' e.Row.Cells(1).Width = Unit.Pixel(300)
|
||||
' e.Row.Cells(2).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(3).Width = Unit.Pixel(70)
|
||||
' e.Row.Cells(4).Width = Unit.Pixel(80)
|
||||
' e.Row.Cells(5).Width = Unit.Pixel(40)
|
||||
' e.Row.Cells(6).Width = Unit.Pixel(60)
|
||||
' e.Row.Cells(7).Width = Unit.Pixel(60)
|
||||
'End If
|
||||
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
|
||||
|
||||
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(7).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxP" Then e.Row.Cells(5).ForeColor = Drawing.Color.Red
|
||||
If e.Row.DBCampo("Original").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldoOriginal"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Abonado").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlAbonado"), Literal).Text = ""
|
||||
If e.Row.DBCampo("Saldo").ToDouble = 0 Then DirectCast(e.Row.FindControl("LtlSaldo"), Literal).Text = ""
|
||||
If Not e.Row.DBCampo("IdPoliza").ToEntero > 0 Then e.Row.Cells(13).Text = ""
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LbkUnificar_Click(sender As Object, e As EventArgs) Handles LbkUnificar.Click
|
||||
Dim ObjComp As New ClsCompras()
|
||||
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
Dim TieneError = False
|
||||
Dim CvePrePoliza As Integer = 0
|
||||
Dim IdPoliza As Integer = 0
|
||||
Dim Msg As New StringBuilder
|
||||
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
|
||||
If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
If CvePrePoliza > 0 AndAlso DdlCajaChica.SelectedValue.ToEntero > 0 Then
|
||||
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, -1, DdlCajaChica.SelectedValue.ToEntero, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||
If ObjMov.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Compras/RepRembolsoComprobaciones - Unificar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
Msg.AppendFormat("Se unificaron todas las compras con éxito")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.UsaContabilidad AndAlso Not TieneError Then
|
||||
If ObjAC Is Nothing Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||
TieneError = True
|
||||
Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
IdPoliza = ObjMov.ContaIdPoliza
|
||||
End If
|
||||
End If
|
||||
|
||||
If IdPoliza > 0 AndAlso Not TieneError Then
|
||||
Msg.AppendFormat("<br/><br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjComp.Commit()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjComp.RollBack()
|
||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||
Alert("Ocurrió un error al unificar las compras", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
ObjComp.Dispose()
|
||||
ObjMov.Dispose()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaCxP()
|
||||
End Sub
|
||||
Private Sub CargaDatos(tCveIE As Integer)
|
||||
Dim ObjIE As New ClsBancos()
|
||||
|
||||
If ObjIE.GetBancosIE(tCveIE, UsuarioActual.CveEmpresa) Then
|
||||
If ObjIE.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Else
|
||||
Alert("El Documento solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub CargaCxP()
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
|
||||
GvCxP.Visible = True
|
||||
|
||||
ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim))
|
||||
DtDatos = ObjMovtos.DtResultados
|
||||
GvCxP.DataSource = DtDatos
|
||||
|
||||
'cargo si tiene cheques pendientes sin amortizar
|
||||
If CvePersonal > 0 Then
|
||||
If DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlPersonal.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
CargaEgresosSinComprobar()
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then divUnificar.Visible = False
|
||||
End If
|
||||
'ObjMovtos.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
divUnificar.Visible = True
|
||||
If DtDatos.Rows.Count > 1 Then TxtFechaUnificacion.Text = DtDatos(1)("FechaCompra").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso CveCajaChica > 0 AndAlso DtDatos.Rows.Count > 0 AndAlso TxtNumeroReembolso.Text.Trim <> "" Then
|
||||
TxtConcepto.Text = $"{DdlCajaChica.SelectedItem} R#{TxtNumeroReembolso.Text} ${DtDatos(0)("Original").ToString.FormatoNumero}"
|
||||
|
||||
divUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjMovtos.Dispose()
|
||||
GvCxP.DataBind()
|
||||
|
||||
LnkImprimir.Visible = True
|
||||
NumeroReembolso = TxtNumeroReembolso.Text
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
If NumeroReembolso <> "" AndAlso CvePersonal > 0 AndAlso DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero > 0 Then
|
||||
DivVincularEgreso.Visible = True
|
||||
Else
|
||||
DivVincularEgreso.Visible = False
|
||||
End If
|
||||
If DtDatos.MAX("IdPoliza").ToEntero > 0 Then
|
||||
LbkUnificar.Visible = False
|
||||
Else
|
||||
LbkUnificar.Visible = True
|
||||
End If
|
||||
End If
|
||||
UpAcciones.Update()
|
||||
|
||||
UPCompras.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "PDF"
|
||||
Protected Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click
|
||||
Imprimir("PDF")
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
Imprimir("EXCEL")
|
||||
End Sub
|
||||
|
||||
Private Sub Imprimir(Formato As String)
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
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)
|
||||
|
||||
If Archivo.Exists Then
|
||||
params.Add(New ReportParameter("Numero", NumeroReembolso))
|
||||
params.Add(New ReportParameter("Anio", DtDatos.FiltraParametros("CveCompra > 0").MAX("Fecha").ToDate.Year.ToString))
|
||||
params.Add(New ReportParameter("Nombre", DtDatos.MAX("SubProyecto")))
|
||||
params.Add(New ReportParameter("Fecha", Now.Date.ToString))
|
||||
params.Add(New ReportParameter("Elaboro", ""))
|
||||
params.Add(New ReportParameter("Autorizo", ""))
|
||||
params.Add(New ReportParameter("ElaboroPuesto", ""))
|
||||
params.Add(New ReportParameter("AutorizoPuesto", ""))
|
||||
ImprimirPDF(String.Format("{0}Formatos\Reembolso.rdlc", UsuarioActual.Empresa.Ruta), DtDatos.FiltraParametros("CveCompra > 0"), params, "Reembolso", RDSName:="DsCompras")
|
||||
Else
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
|
||||
|
||||
params.Add(New ReportParameter("CajaChica", If(DdlCajaChica.SelectedValue.ToEntero > 0, "Caja chica: " & DdlCajaChica.SelectedItem.Text, "Funcionario/Empleado: " & DdlPersonal.SelectedItem.Text)))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepRembolsosComprobaciones.rdlc", DtDatos, params, "RepRembolsosComprobaciones", Formato:=Formato)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub CargaEgresosSinComprobar()
|
||||
If CvePersonal > 0 Then
|
||||
DdlCheque.Items.Clear()
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
If ObjMov.GetEgresosSinComprobarPersonalDetalle(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
DdlCheque.DataSource = ObjMov.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha")
|
||||
DdlCheque.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
ObjMov.Dispose()
|
||||
DdlCheque.DataBind()
|
||||
UPCompras.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnVincularEgreso_Click(sender As Object, e As EventArgs)
|
||||
If Not DdlCheque.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que tener seleccionado un egreso sin comprobar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjIE As New ClsBancos
|
||||
If ObjIE.UpdateComprobacionSinBancos(DdlCheque.SelectedValue.ToEntero, DtDatos.MAX("CvePrePolizaComprobacionSinBancos").ToEntero,
|
||||
CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Vinculado correctamente")
|
||||
DdlCheque.SelectedIndex = 0
|
||||
CargaEgresosSinComprobar()
|
||||
End If
|
||||
ObjIE.Dispose()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
6980
Ventas/PV.aspx
6980
Ventas/PV.aspx
File diff suppressed because it is too large
Load Diff
10948
Ventas/PV.aspx.vb
10948
Ventas/PV.aspx.vb
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user