diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index b8c623c45..ac4aa3906 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -9729,10 +9729,7 @@ Public Class ClsPaginas
Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia)
Dim ConPrePNC As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(6, Pago.CveMonedaPago, True, 2)
- Dim CveClienteAplicacion As Integer = VentaActual.CveCliente
- If Pago.CveClienteNC > 0 Then
- CveClienteAplicacion = Pago.CveClienteNC
- End If
+ Dim CveClienteAplicacion As Integer = If(Pago.CveClientePago > 0, Pago.CveClientePago, VentaActual.CveCliente)
If Pago.CveMonedaPago > 1 Then
'Agregamos la Extranjera
@@ -9847,7 +9844,6 @@ Public Class ClsPaginas
Public Property Referencia As String
Public Property CveConceptoPago As Integer = -1
Public Property CveClientePago As Integer = -1
- Public Property CveClienteNC As Integer = -1
Public Property ImporteFluctuacionAdicional As Decimal = 0
Public Property ValorMultiplicador As Decimal = 1
Public Property AplicaConceptoImpuestoPendiente As Boolean = False
diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index bc4c2a2a3..e8c8fa9f8 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -630,7 +630,9 @@ Partial Class Ventas_PVCobranza
If ObjVtaRemision.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
DbRowVenta = ObjVtaRemision.DtResultados.Copy().FiltroPrimero("")
End If
- ObjVtaRemision.Dispose()
+ ObjVtaRemision.Dispose()
+
+ Dim SeTimbro As Boolean = False
If DbRowVenta IsNot Nothing Then
Dim VentaActual As New Venta(UsuarioActual)
@@ -924,7 +926,7 @@ Partial Class Ventas_PVCobranza
Dim MsgTimbrado As String = ""
Dim FolioFiscalFactura = ""
Dim DebeTimbrar As Boolean = True
- Dim SeTimbro As Boolean = False
+
'SI SE GENERO FACTURA DE INGRESO, TIMBRARLA DESPUES DE REALIZAR EL PAGO
If DebeTimbrar AndAlso respFactura IsNot Nothing Then
@@ -1058,14 +1060,19 @@ Partial Class Ventas_PVCobranza
If MsgError = "" Then
Try
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ Dim ImpresionDirecta As Boolean = UsuarioActual.Empresa.Funcionalidad(109) = "1"
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso Not SeTimbro Then
+ ImpresionDirecta = False
+ End If
+
+ If ImpresionDirecta Then
ImpresionDirectaPDF(CveVenta)
End If
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
'ENVIO DE CORREO
Try
- If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing Then
+ If respFactura IsNot Nothing AndAlso respFactura.Factura IsNot Nothing AndAlso SeTimbro Then
Dim EnviarMail As Boolean = respFactura.Factura.Cliente.EnviarFactura = "Si"
Dim Hilo As New System.Threading.Thread(Sub() EnviarMailFactura(EnviarMail, respFactura.Factura, UsuarioActual))
Hilo.Start()
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 290c4e66d..8dbf47ff7 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -15919,9 +15919,8 @@ Partial Class Ventas
Pago.Referencia = row2.DataKey("Folio").ToString()
Pago.CveVentaAmortizacion = row2.DataKey("CveVenta").ToString().ToEntero()
Pago.TipoPago = "NC"
- Pago.CveClientePago = ObjFactura.CveCliente
+ Pago.CveClientePago = row2.DataKey("CveCliente").ToString().ToEntero()
Pago.Referencia = Referencia
- Pago.CveClienteNC = row2.DataKey("CveCliente").ToString().ToEntero()
ErrorPrepoliza = ClsPaginas.AplicaPrePolizaPagoVenta(VentaRef, Pago, ObjFactura.CvePrePoliza, ObjConta, AplicarConceptoAplicacion:=True)
@@ -27159,7 +27158,7 @@ Partial Class Ventas
Using ObjVentas As New ClsVentas
If ObjVentas.GetMovimientosDepositoCaja(Me.CveVenta, UsuarioActual.CveEmpresa) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
- SbCondiciones.Append("
*No se puede cancelar debido a que tiene un deposito.")
+ SbCondiciones.Append("
*No se puede cancelar la factura, debido a que tiene el pago ya depositado.")
BtnCancelarDocumento.Visible = False
End If
Else