Vinculacion de NC en compras, PA de poliza virutal en ventas.aspx
This commit is contained in:
@@ -753,7 +753,21 @@ Public Class ClsAcumuladores
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
OnError("Ocurrió un al agregar la garantia detalle. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
OnError("Ocurrió un al obtener la garantía detalle. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetGarantiasPolizaVirtual(CveVenta As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
SqlDataAdapter("PA_Acum_GarantiasPolizaVirtualGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
OnError("Ocurrió un al obtener la información de poliza virtual.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
@@ -13590,35 +13590,40 @@ Partial Class Compras_Compras
|
||||
' guardardevolucion(ObjInventario, cvecompra, subtotal, Now.ToDate)
|
||||
'End Sub
|
||||
Protected Sub BtnVinculaDevolucion_Click(sender As Object, e As EventArgs)
|
||||
Dim subtotaldevolucion As Double = 0
|
||||
Dim realizadevolucion As Boolean = False
|
||||
Try
|
||||
Dim subtotaldevolucion As Double = 0
|
||||
Dim realizadevolucion As Boolean = False
|
||||
|
||||
|
||||
'Calculo los subtotales para comparar con la NC
|
||||
Dim cantidad As Double = 0.0
|
||||
|
||||
For Each Dr As GridViewRow In GVDevolucion.Rows
|
||||
cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
If cantidad > 0 Then
|
||||
realizadevolucion = True
|
||||
subtotaldevolucion += Dr.DataKey("PU").ToString.ToDouble * cantidad
|
||||
End If
|
||||
Next
|
||||
|
||||
'si no esta vinculado a nc simplemente me lo brinco
|
||||
If realizadevolucion Then
|
||||
'si el subtotal es iwal a la nc lo guardo si no marco error
|
||||
If TxtSubTotal.Text.ToDouble > subtotaldevolucion - 1 AndAlso TxtSubTotal.Text.ToDouble < subtotaldevolucion + 1 Then
|
||||
|
||||
VinculaDevolucion()
|
||||
|
||||
Else
|
||||
Alert("El Total de la NC debe ser igual al total de la devolucion", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
Alert("No se ha seleccionado nada para la devolución. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al realizar la vinculación", ex)
|
||||
End Try
|
||||
|
||||
|
||||
'Calculo los subtotales para comparar con la NC
|
||||
Dim cantidad As Double = 0.0
|
||||
|
||||
For Each Dr As GridViewRow In GVDevolucion.Rows
|
||||
cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDouble
|
||||
If cantidad > 0 Then
|
||||
realizadevolucion = True
|
||||
subtotaldevolucion += Dr.DataKey("PU").ToString.ToDouble * cantidad
|
||||
End If
|
||||
Next
|
||||
|
||||
'si no esta vinculado a nc simplemente me lo brinco
|
||||
If realizadevolucion Then
|
||||
'si el subtotal es iwal a la nc lo guardo si no marco error
|
||||
If TxtSubTotal.Text.ToDouble > subtotaldevolucion - 1 AndAlso TxtSubTotal.Text.ToDouble < subtotaldevolucion + 1 Then
|
||||
|
||||
VinculaDevolucion()
|
||||
|
||||
Else
|
||||
Alert("El Total de la NC debe ser igual al total de la devolucion", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
Alert("No se ha seleccionado nada para la devolución. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub VinculaDevolucion()
|
||||
@@ -13681,7 +13686,7 @@ Partial Class Compras_Compras
|
||||
GvOC1.DataSource = DTOCTemp
|
||||
|
||||
Dim DTCVEOCS As DataTable = DTOCTemp.FiltraParametros("", "", {"CveOrdenCompra"})
|
||||
If DTCVEOCS.Rows.Count > 1 Then
|
||||
If DTCVEOCS IsNot Nothing AndAlso DTCVEOCS.Rows.Count > 1 Then
|
||||
GvOC1.Columns(0).Visible = True
|
||||
Else
|
||||
GvOC1.Columns(0).Visible = False
|
||||
|
||||
Reference in New Issue
Block a user