Traspasar ventas aplicadas cuando es una refacturacion de anticipo
This commit is contained in:
@@ -3630,6 +3630,23 @@ Public Class ClsVentas
|
|||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function TraspasaVentasAplicadasAnt(CveVentaNueva As Integer, CveVentaAnterior As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Vta_TraspasaVentasAplicadasAnt", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveVentaNueva", SqlDbType.Int).Value = CveVentaNueva
|
||||||
|
.Add("@CveVentaAnterior", SqlDbType.Int).Value = CveVentaAnterior
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al traspasar las ventas aplicadas al nuevo anticipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
#Region " AUTORIZACION DESCUENTOS "
|
#Region " AUTORIZACION DESCUENTOS "
|
||||||
|
|
||||||
Public Function AutorizacionDescuentosGet(CveAutorizacionDescuento As Integer, CveEmpresa As Integer) As Boolean
|
Public Function AutorizacionDescuentosGet(CveAutorizacionDescuento As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|||||||
@@ -10281,6 +10281,13 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO
|
||||||
|
If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then
|
||||||
|
If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
Return ErrorPrepoliza
|
Return ErrorPrepoliza
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
GuardaLog(ex.ToString())
|
GuardaLog(ex.ToString())
|
||||||
|
|||||||
Reference in New Issue
Block a user