activación al saldar. poner fecha, obs

This commit is contained in:
2023-07-07 09:49:55 -07:00
parent 67c63da7ea
commit 307cf0d299
2 changed files with 41 additions and 27 deletions

View File

@@ -94,21 +94,9 @@ Partial Class Bancos_RepEgresosSinComprobante
e.Row.FCHyperLink("Hpl").NavigateUrl = ""
e.Row.FCHyperLink("Hpl").Font.Bold = True
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
End If
If e.Row.RowIndex = 1 Then
e.Row.Cells(1).Width = Unit.Pixel(520)
e.Row.Cells(2).Width = Unit.Pixel(50)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(150)
e.Row.Cells(6).Width = Unit.Pixel(100)
End If
'Sustituido 3-5 lineas mas abajo
'If e.Row.DBCampo("FechaDocumento") = "" Then e.Row.BackColor = Drawing.Color.LightGray
'CUANDO ES SUBTITULO
End If
'CUANDO ES SUBTITULO
If e.Row.DBCampo("CveIE") = "" Then
If e.Row.DBCampo("CveMoneda") = "" Then
@@ -118,7 +106,6 @@ Partial Class Bancos_RepEgresosSinComprobante
e.Row.FCLiteral("LtMoneda").Visible = True
e.Row.FCHyperLink("Hpl").Visible = False
End If
End If
'LINK A IE
@@ -126,9 +113,8 @@ Partial Class Bancos_RepEgresosSinComprobante
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
End If
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(1).ForeColor = Drawing.Color.Red
' e.Row.FCHyperLink("ImgAbonar").NavigateUrl = String.Format("/Bancos/ProveedoresAbonar.aspx?CveProveedor={0}&FechaI={1}&FechaF={2}&CveUsuarioProgramo={3}&CveMoneda={4}&Serie={5}", e.Row.DBCampo("CveProveedor"), If(txtFechaI.Text <> "", txtFechaI.Text, "-1"), If(txtFechaF.Text <> "", txtFechaF.Text, "-1"), DdlUsuarioProgramo.SelectedValue, e.Row.DBCampo("CveMoneda"), e.Row.DBCampo("Serie"))
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(1).ForeColor = Drawing.Color.Red
End If
End Sub
@@ -181,7 +167,8 @@ Partial Class Bancos_RepEgresosSinComprobante
End If
Next
TxtConcepto.Text = "Saldo de Egresos por comprobar"
TxtConcepto.Text = "Saldado de Egresos por comprobar"
TxtFechaSaldar.Text = Now.ToShortDateString
DVSaldar.Visible = True
UpSaldar.Update()
@@ -200,7 +187,6 @@ Partial Class Bancos_RepEgresosSinComprobante
Protected Sub LnkSaldar_Click(sender As Object, e As EventArgs)
Dim Contador As Integer = 0
For Each gr As GridViewRow In GvESC.Rows
If gr.FCCheckBox("Chk").Checked Then
@@ -213,7 +199,6 @@ Partial Class Bancos_RepEgresosSinComprobante
Exit Sub
End If
Dim ObjConta As New ClsContabilidad
Dim ObjProveedor As New ClsCompProveedores(ObjConta.IniciaTransacSQL())
@@ -223,9 +208,9 @@ Partial Class Bancos_RepEgresosSinComprobante
Dim MsgError As String = ""
Try
If Contador > 0 Then
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, 0, 0, 1, Now,
Dim tFecha As Date = TxtFechaSaldar.Text.ToDate
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, 0, 0, 1, tFecha,
TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim ImporteSaldoGral As Decimal = 0
Dim TipoMovtoConcepto As Boolean = True
@@ -243,9 +228,22 @@ Partial Class Bancos_RepEgresosSinComprobante
End If
If gr.DataKey("CveMoneda").ToEntero > 1 Then
Dim ImporteMN As Decimal = (ImporteSaldo * gr.DataKey("TipoCambio").ToDecimal - ImporteSaldo).RoundSQL
Dim TCValuacion As Decimal = gr.DataKey("TipoCambio").ToDecimal
If UsuarioActual.Empresa.Funcionalidad(703) = "1" Then
Dim tFechaUltimaFluctuacion As Date
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
tFechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TCValuacion = UltimaFluctuacion.TCFluctuacion
End If
If gr.DataKey("FechaDocumento").ToDate < tFechaUltimaFluctuacion Then TCValuacion = TCValuacion
End If
End If
Dim ImporteMN As Decimal = (ImporteSaldo * TCValuacion - ImporteSaldo).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, ImporteMN, ImporteMN, ConPrepAplicacion.CveConceptoComplementario, gr.DataKey("Folio"), TxtConcepto.Text, -1,
CveIE:=gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero,
CveIE:=gr.DataKey("CveIE").ToEntero, TipoCambio:=TCValuacion, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero,
ImporteME:=gr.DataKey("Saldo").ToDecimal, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero, Contabilizable:=EsContabilizable) Then
MsgError = "Ocurrio un error al saldar el movimiento"
Exit For