+
diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb
index 0408ee6a0..b6456f11d 100644
--- a/Acumuladores/CatFoliosGarantia.aspx.vb
+++ b/Acumuladores/CatFoliosGarantia.aspx.vb
@@ -223,10 +223,9 @@ Partial Class Acumuladores_CatFoliosGarantia
LblFolio.Text = GvRow.DataKey("FolioGarantia")
Using ObjAcum As New ClsAcumuladores
- If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia) Then
+ If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia, CveEstatusConsecutivo:=DdlEstatusConsecutivo.SelectedValue.ToEntero()) Then
GvGarantiasDetalle.DataSource = ObjAcum.DtResultados
- HplGenerarSalida.NavigateUrl = "/Inventarios/TraspasoAlmacen.aspx?CveFolioGarantia=" & CveFolioGarantia
-
+ HplGenerarSalida.NavigateUrl = "/Inventarios/TraspasoAlmacen.aspx?CveFolioGarantia=" & CveFolioGarantia
End If
End Using
GvGarantiasDetalle.DataBind()
@@ -313,4 +312,15 @@ Partial Class Acumuladores_CatFoliosGarantia
Protected Sub BtnGenerarSalida_Click(sender As Object, e As EventArgs)
End Sub
+ Protected Sub DdlEstatusConsecutivo_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Using ObjAcum As New ClsAcumuladores
+ If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia, CveEstatusConsecutivo:=DdlEstatusConsecutivo.SelectedValue.ToEntero()) Then
+ GvGarantiasDetalle.DataSource = ObjAcum.DtResultados
+ HplGenerarSalida.NavigateUrl = "/Inventarios/TraspasoAlmacen.aspx?CveFolioGarantia=" & CveFolioGarantia
+ End If
+ End Using
+ GvGarantiasDetalle.DataBind()
+
+ UpGarantiasDetalle.Update()
+ End Sub
End Class
diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index b202f93b3..14962f888 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -1185,7 +1185,7 @@ Public Class ClsAcumuladores
Return Retorno
End Function
- Public Function GetFoliosGarantiasDetalle(CveFolioGarantia As Integer, Optional CveGarantiaDetalle As Integer = -1) As Boolean
+ Public Function GetFoliosGarantiasDetalle(CveFolioGarantia As Integer, Optional CveGarantiaDetalle As Integer = -1, Optional CveEstatusConsecutivo As Integer = -1, Optional Consec As Integer = -1) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetalleFolioGet")
@@ -1193,6 +1193,8 @@ Public Class ClsAcumuladores
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@CveGarantiaDetalle", SqlDbType.Int).Value = CveGarantiaDetalle
+ .Add("@CveEstatusConsecutivo", SqlDbType.Int).Value = CveEstatusConsecutivo
+ .Add("@Consec", SqlDbType.Int).Value = Consec
End With
Try
@@ -1205,6 +1207,25 @@ Public Class ClsAcumuladores
Return Retorno
End Function
+ Public Function UpdateGarantiaCancelacion(CveVenta As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ SqlDataAdapter("PA_Acum_GarantiasDetalleCancelacionUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveVenta
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As SqlException
+ OnError("Ocurrió un error al actualizar los movimientos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function GetSabanaVenta(Fecha As Date, CveOpcion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx
index 3bb74e59c..cb290d40e 100644
--- a/Inventarios/RecepcionUsados.aspx
+++ b/Inventarios/RecepcionUsados.aspx
@@ -455,7 +455,7 @@
-
+
<%--
<%----%>
<%----%>
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index af5282796..9dfc42521 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -3258,6 +3258,11 @@ Partial Class Inventarios_RecepcionUsados
Exit Sub
End If
+ If Not ValidaConsecutivo() Then
+ Alert("Ya existe un consecutivo vigente en este folio", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
Dim ObjPS As New ClsProductosServicios
Try
Dim CveTamaño As Integer = -1
@@ -3489,6 +3494,29 @@ Partial Class Inventarios_RecepcionUsados
UpAjuste.Update()
End Sub
+ Protected Sub TxtConsecutivoAjuste_TextChanged(sender As Object, e As EventArgs) Handles TxtConsecutivoAjuste.TextChanged
+ If Not ValidaConsecutivo() Then
+ Alert("Ya existe un consecutivo vigente en este folio", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End Sub
+
+ Private Function ValidaConsecutivo() As Boolean
+ Dim Retorno As Boolean = True
+
+ If DdlFolioGarantia.SelectedValue.ToEntero() > 0 Then
+ Using ObjAcum As New ClsAcumuladores
+ If ObjAcum.GetFoliosGarantiasDetalle(DdlFolioGarantia.SelectedValue.ToEntero(), CveEstatusConsecutivo:=1, Consec:=TxtConsecutivoAjuste.Text.ToEntero()) Then
+ If ObjAcum.DtResultados.Rows.Count > 0 Then
+ Retorno = False
+ End If
+ End If
+ End Using
+ End If
+
+ Return Retorno
+ End Function
+
#Region "P O L I Z A - V I R T U A L"
Private Sub CreaDTmpDTPolizaVirtual()
TmpDTPolizaVirtual = New DataTable
diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx
index ad071e15d..0b3fd9d00 100644
--- a/Ventas/PV.aspx
+++ b/Ventas/PV.aspx
@@ -3076,7 +3076,7 @@
-
+
<%----%>
<%----%>
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index ec0f0bdc2..6ed007114 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -5319,6 +5319,12 @@ Partial Class PV
Alert($"El folio de garantía no es valido. Clasificacion del Producto:{FolioGarantia.ClasificacionPS}. Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
+
+ If Not ValidaConsecutivo() Then
+ Alert("Ya existe un consecutivo vigente en este folio", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
End If
If AgregarPS() Then
@@ -7091,6 +7097,7 @@ Partial Class PV
If Not CalculaMesesUso() Then
Exit Sub
End If
+
Try
TxtImporteAjuste.Text = "0.00"
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
@@ -8180,4 +8187,26 @@ Partial Class PV
End If
Next
End Sub
+ Protected Sub TxtConsecutivoAjuste_TextChanged(sender As Object, e As EventArgs)
+ If Not ValidaConsecutivo() Then
+ Alert("Ya existe un consecutivo vigente en este folio", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End Sub
+
+ Private Function ValidaConsecutivo() As Boolean
+ Dim Retorno As Boolean = True
+
+ If DdlFolioGarantia.SelectedValue.ToEntero() > 0 Then
+ Using ObjAcum As New ClsAcumuladores
+ If ObjAcum.GetFoliosGarantiasDetalle(DdlFolioGarantia.SelectedValue.ToEntero(), CveEstatusConsecutivo:=1, Consec:=TxtConsecutivoAjuste.Text.ToEntero()) Then
+ If ObjAcum.DtResultados.Rows.Count > 0 Then
+ Retorno = False
+ End If
+ End If
+ End Using
+ End If
+
+ Return Retorno
+ End Function
End Class