Actulizar TC de prepoliza al timbrar si se cambio el TC.
This commit is contained in:
@@ -2209,6 +2209,16 @@ Partial Class Ventas
|
||||
ViewState("EsGarantia") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TipoCambioOriginal As Decimal
|
||||
Get
|
||||
Return (IfNull(ViewState("TipoCambioOriginal"), 0, ViewState("TipoCambioOriginal"))).ToString().ToDecimal()
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("TipoCambioOriginal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtMercancias As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtMercancias")), Nothing, CType(ViewState("DtMercancias"), DataTable))
|
||||
@@ -4780,6 +4790,7 @@ Partial Class Ventas
|
||||
HdnCveVenta.Value = CveVenta.ToString()
|
||||
|
||||
Me.EsGarantia = CBool(DbRowVenta("EsGarantia"))
|
||||
Me.TipoCambioOriginal = DbRowVenta("TipoCambioOriginal").ToString().ToDecimal()
|
||||
|
||||
RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString()
|
||||
'Adjuntar archivo
|
||||
@@ -17102,7 +17113,24 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
|
||||
Dim SeTimbro As Boolean = False
|
||||
|
||||
Try
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
Catch ex As Exception
|
||||
SeTimbro = False
|
||||
End Try
|
||||
|
||||
'SI SE TIMBRO CON UN TIPO DE CAMBIO DISTINCTO, DEBE ACTUALIZAR LA PREPOLIZA
|
||||
If SeTimbro AndAlso ChkEmitirComercioExterior.Checked AndAlso DdlTipoComprobante.SelectedValue = "Ing" AndAlso DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso TxtTipoCambio.Text.ToDecimal() > 1 AndAlso (TxtTipoCambio.Text.ToDecimal() <> TipoCambioOriginal) Then
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.UpdateVentaTC(Me.CveVenta, UsuarioActual.CveEmpresa, TxtTipoCambio.Text.ToDecimal()) Then
|
||||
Alert("Se actualizó el tipo de cambio del documento")
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
If SeTimbro Then
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert = New StringBuilder
|
||||
|
||||
Reference in New Issue
Block a user