--FIX moneda en anticipo
This commit is contained in:
@@ -1330,13 +1330,15 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtAnticipo.Text.ToDecimal > 0 AndAlso MsgError = "" Then '' si es empresa GDiaz
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtAnticipo.Text.ToDecimal > 0 AndAlso MsgError = "" Then '' si es empresa GDiaz
|
||||||
'generar un anticipo y registrarle el pago.
|
'generar un anticipo y registrarle el pago.
|
||||||
|
|
||||||
Dim tCveMoneda As Integer = 1
|
Dim tCveMoneda As Integer = Me.CveMoneda
|
||||||
Dim tCveFormaPago As Integer = GlobalDTTipoTransacciones().FiltroPrimeroValor("CveFormaPago", $"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}").ToEntero
|
Dim tCveFormaPago As Integer = GlobalDTTipoTransacciones().FiltroPrimeroValor("CveFormaPago", $"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}").ToEntero
|
||||||
Dim tCvePS As Integer
|
Dim tCvePS As Integer
|
||||||
Dim tCveUM As Integer = 0
|
Dim tCveUM As Integer = 0
|
||||||
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
|
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
|
||||||
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
|
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
|
||||||
ObjFacturaAnt.CveMoneda = tCveMoneda
|
ObjFacturaAnt.CveMoneda = tCveMoneda
|
||||||
|
ObjFacturaAnt.TipoCambio = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||||
|
ObjFacturaAnt.TipoCambioDolares = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||||
ObjFacturaAnt.CveFormaPago = tCveFormaPago
|
ObjFacturaAnt.CveFormaPago = tCveFormaPago
|
||||||
ObjFacturaAnt.CveMetodoPago = 1
|
ObjFacturaAnt.CveMetodoPago = 1
|
||||||
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
|
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
|
||||||
@@ -1355,7 +1357,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
|
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
|
||||||
RespAnt.Factura = ObjFacturaAnt
|
RespAnt.Factura = ObjFacturaAnt
|
||||||
|
|
||||||
If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing Then
|
If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing AndAlso RespAnt.Factura.CveVenta > 0 Then
|
||||||
|
|
||||||
Dim VentaActual As New Venta(UsuarioActual)
|
Dim VentaActual As New Venta(UsuarioActual)
|
||||||
VentaActual.CveVenta = RespAnt.Factura.CveVenta
|
VentaActual.CveVenta = RespAnt.Factura.CveVenta
|
||||||
@@ -1365,7 +1367,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
VentaActual.TipoDocto = "Ant"
|
VentaActual.TipoDocto = "Ant"
|
||||||
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
|
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
|
||||||
VentaActual.ClienteNombre = NombreComercial
|
VentaActual.ClienteNombre = NombreComercial
|
||||||
VentaActual.TC = 1
|
VentaActual.TC = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||||
VentaActual.Total = TxtAnticipo.Text.ToDecimal
|
VentaActual.Total = TxtAnticipo.Text.ToDecimal
|
||||||
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
|
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
|
||||||
|
|
||||||
@@ -1381,6 +1383,8 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
|
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
|
||||||
Pago.Referencia = TxtFolio.Text
|
Pago.Referencia = TxtFolio.Text
|
||||||
Pago.TipoPago = "XXX"
|
Pago.TipoPago = "XXX"
|
||||||
|
Pago.TCPago = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
|
||||||
|
|
||||||
'If RblTipoPago.SelectedValue = "3" Then
|
'If RblTipoPago.SelectedValue = "3" Then
|
||||||
' Pago.TipoPago = "I"
|
' Pago.TipoPago = "I"
|
||||||
' Pago.FechaDocumentoRelacionado = FechaIngreso
|
' Pago.FechaDocumentoRelacionado = FechaIngreso
|
||||||
@@ -1390,6 +1394,8 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
|
||||||
MsgError = "No se pudo insertar la póliza"
|
MsgError = "No se pudo insertar la póliza"
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
MsgError = "Ocurrió un error al generar el anticipo"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user