diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 567e32a28..480201076 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -547,6 +547,24 @@ Public Class ClsVentas
Return Retorno
End Function
+ Public Function CancelarPagos(CveVenta As Integer, CvePrePoliza As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_CancelarPagosVenta")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+ .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al cancelar los pagos de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
Public Function RemoveVta_VentaPago(CveVenta As Integer, CveMetodoPago As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasPagoRemove")
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index f3f8f4c5e..f6ab19071 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -4285,7 +4285,7 @@ Namespace Modelos
End If
'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO
- If (((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse (CvePlantillaPoliza = 7 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) Then
+ If Not EsRefacturacion AndAlso ((((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse (CvePlantillaPoliza = 7 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20))) Then
'CUANDO SE CANCELA, LA PÓLIZA DEBE DE SER DE DIARIO
CvePrePoliza = ObjConta.AddPrePolizas("Modelos/CancelarDocumento", CvePlantillaPoliza, ObjFactura.Total, ObjFactura.Total, ObjFactura.CveMoneda, Now, ObjFactura.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
@@ -4296,8 +4296,16 @@ Namespace Modelos
MensajeError = "Ocurrió un error al generar la prepoliza de cancelación."
End If
+ ''CANCELAR PAGOS
+ 'If EsRefacturacion AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant") AndAlso ObjFactura.Pagado > 0 Then
+ ' If Not ObjVentas.CancelarPagos(ObjFactura.CveVenta, CvePrePoliza) Then
+ ' ErrorCancelar = True
+ ' MensajeError = "Ocurrió un error al generar la cancelación de pagos."
+ ' End If
+ 'End If
+
'CANCELAR PAGOS
- If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
+ If Not EsRefacturacion AndAlso ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
If Not ErrorCancelar Then
If Not ObjConta.PrePolizasCancelarPagos(ObjFactura.CveDevolucion, CvePrePoliza) Then
ErrorCancelar = True
@@ -4306,6 +4314,7 @@ Namespace Modelos
End If
End If
+
'CANCELA PREPOLIZA
If Not ErrorCancelar Then
ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, SeCancelaRemisionProceso:=SeCancelaRemisionProceso,
diff --git a/Ventas/RepRemisionesDetalle.aspx b/Ventas/RepRemisionesDetalle.aspx
index a42d59d3a..88a19d02a 100644
--- a/Ventas/RepRemisionesDetalle.aspx
+++ b/Ventas/RepRemisionesDetalle.aspx
@@ -202,70 +202,14 @@
CssClass="table table-striped table-advance table-hover ScrollAD"
data-sort="true" Width="100%" Style="text-align: center;" GridLines="None">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/Ventas/RepRemisionesDetalle.aspx.vb b/Ventas/RepRemisionesDetalle.aspx.vb
index 922842e23..f8e1fbe6a 100644
--- a/Ventas/RepRemisionesDetalle.aspx.vb
+++ b/Ventas/RepRemisionesDetalle.aspx.vb
@@ -280,9 +280,13 @@ Partial Class RepRemisionesDetalle
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString)
+ 'GvDatos.ExportToExcel("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString)
+ GvDatos.ExportToExcelG("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString, Titulo:="Reporte de Remisiones por Facturar Detalle ", Usuario:=UsuarioActual)
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
+ Public Overrides Sub VerifyRenderingInServerForm(control As Control)
+ 'MyBase.VerifyRenderingInServerForm(control)
+ End Sub
End Class
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 315aade63..93b3b113b 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -17736,20 +17736,20 @@ Partial Class Ventas
End Sub
Private Function ValidaPagosContado() As Boolean
Dim Retorno = False
- Dim Total As Decimal = TxtTotal.Text.ToDecimal()
+
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
- If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0 Then
+ If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True
Return Retorno
End If
- If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso Total > 0 Then
+ If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
- If TotalPago < Total Then
+ If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True
Return Retorno
@@ -17767,11 +17767,10 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
- If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
-
+ If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
- If TotalPago < Total Then
+ If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True
Return Retorno
diff --git a/vwd.webinfo b/vwd.webinfo
index ea9dcacfe..c61135231 100644
--- a/vwd.webinfo
+++ b/vwd.webinfo
@@ -32,6 +32,8 @@
+
+