This commit is contained in:
@@ -5192,7 +5192,6 @@ Partial Class Compras_Compras
|
||||
Dim tipoCambioPago As Decimal
|
||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||
Dim idCuentaContabilizacion As Long = 1
|
||||
Dim BanderaContilizar = True
|
||||
Dim CveCuentaContabilizacion As Long = 1
|
||||
Dim FechaMovimiento As Date = TxtFecha.Text.ToDate
|
||||
Dim DT As DataTable = Nothing
|
||||
@@ -6072,7 +6071,6 @@ Partial Class Compras_Compras
|
||||
If OCVinculada Or CveConceptoContableAlmacen.Contiene(237, 240) Then
|
||||
ConceptoContabilizacion = CveConceptoContableAlmacen
|
||||
End If
|
||||
BanderaContilizar = If(ConceptoContabilizacion = 205, False, True)
|
||||
Dim UsaComplementariaFleteImportaciones As Boolean = False
|
||||
|
||||
Select Case ConceptoContabilizacion
|
||||
@@ -6990,6 +6988,12 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
'Simplificacion de PrePolizas
|
||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
ErrorPrepolizaDescuadre = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
@@ -7000,19 +7004,17 @@ Partial Class Compras_Compras
|
||||
|
||||
'Conta ContPAQ
|
||||
If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.UsaContabilidad Then
|
||||
If BanderaContilizar Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
|
||||
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
|
||||
IdPoliza = ObjConta.ContaIdPoliza
|
||||
Else
|
||||
ErrorPrepoliza = True
|
||||
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
|
||||
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
|
||||
IdPoliza = ObjConta.ContaIdPoliza
|
||||
Else
|
||||
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||
ErrorPrepoliza = True
|
||||
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -7614,12 +7616,7 @@ Partial Class Compras_Compras
|
||||
MsgAccionAceptar = "location.href =""Compras.aspx"""
|
||||
End If
|
||||
|
||||
'Simplificacion de PrePolizas
|
||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
|
||||
@@ -11223,10 +11220,10 @@ Partial Class Compras_Compras
|
||||
Dim dr1 As DataRow = TmpDT.Rows(Index)
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
dr.ItemArray = dr1.ItemArray
|
||||
Dim IVA = dr1("IVA").ToString.ToDouble / (dr1("Cantidad").ToString.ToDouble * dr1("PU").ToString.ToDouble)
|
||||
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
|
||||
dr1("IVA") = IVA * dr1("Cantidad").ToString.ToDouble * dr1("PU").ToString.ToDouble
|
||||
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDouble
|
||||
dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDouble * dr1("Total").ToString.ToDouble, 6)
|
||||
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
dr("CvePersonal") = 0
|
||||
@@ -11234,8 +11231,8 @@ Partial Class Compras_Compras
|
||||
dr("CveActivoFijo") = 0
|
||||
dr("CodAF") = 0
|
||||
dr("Cantidad") = Cantidad.ToDouble
|
||||
dr("IVA") = IVA * dr("Cantidad").ToString.ToDouble * dr("PU").ToString.ToDouble
|
||||
dr("Total") = dr("PU").ToString.ToDouble * Cantidad.ToDouble
|
||||
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * dr("Total").ToString.ToDouble, 6)
|
||||
TmpDT.Rows.InsertAt(dr, Index)
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
@@ -11435,6 +11432,7 @@ Partial Class Compras_Compras
|
||||
|
||||
dr1("Cantidad") = (dr1("Cantidad").ToString.ToDouble - Cantidad.ToDouble)
|
||||
dr1("Total") = dr1("PU").ToString.ToDouble * dr1("Cantidad").ToString.ToDouble
|
||||
dr1("IVA") = Math.Round(dr1("IVAPorcentaje").ToString.ToDouble * dr1("Total").ToString.ToDouble, 6)
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
|
||||
@@ -11442,6 +11440,7 @@ Partial Class Compras_Compras
|
||||
dr("CodAF") = ""
|
||||
dr("Cantidad") = Cantidad.ToDouble
|
||||
dr("Total") = dr("PU").ToString.ToDouble * Cantidad.ToDouble
|
||||
dr("IVA") = Math.Round(dr("IVAPorcentaje").ToString.ToDouble * dr("Total").ToString.ToDouble, 6)
|
||||
|
||||
TmpDT.Rows.InsertAt(dr, Index + 1)
|
||||
|
||||
@@ -16756,6 +16755,8 @@ Partial Class Compras_Compras
|
||||
Row("CveClasificacionOG") = DdlACGeneral5.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
|
||||
|
||||
TmpDT.Rows.Add(Row)
|
||||
TmpDT.Rows.IndexOf(Row)
|
||||
|
||||
@@ -16857,6 +16858,10 @@ Partial Class Compras_Compras
|
||||
DrPS("CveTipoGasto") = DdlTipoGasto.SelectedValue.ToEntero
|
||||
DrPS("TipoGasto") = If(DdlTipoGasto.SelectedValue.ToEntero > 0, DdlTipoGasto.SelectedItem.Text, "")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then
|
||||
DrPS("AplicaCostoIndirecto") = "0"
|
||||
End If
|
||||
|
||||
'IMPUESTOS: SI ES COMPRA, FACUTRA O CON OC, NO MODIFICA IMPUESTOS!!
|
||||
'Dim IVA = (TxtIVAModal.Text.ToDouble / 100)
|
||||
Dim IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)
|
||||
|
||||
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.UsaAC 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.UsaAC 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
|
||||
|
||||
Reference in New Issue
Block a user