This commit is contained in:
2022-09-20 09:26:47 -07:00
5 changed files with 189 additions and 45 deletions

View File

@@ -1135,9 +1135,16 @@ Partial Class Compras_Compras
End Set
End Property
Public Property FechaCompraOriginal As Date
Get
Return ViewState("FechaCompraOriginal").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaCompraOriginal") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -2529,6 +2536,8 @@ Partial Class Compras_Compras
TxtFolio.Text = dr("Folio").ToString
TxtFolioSecundario.Text = dr("FolioSecundario").ToString
TxtFecha.Text = dr("Fecha").ToString.ToDate.ToShortDateString
FechaCompraOriginal = dr("Fecha").ToString.ToDate
TxtDescripcion.Text = dr("Descripcion").ToString
CvePrePoliza = dr("CvePrePoliza").ToString.ToEntero
EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero
@@ -19915,39 +19924,74 @@ Partial Class Compras_Compras
Protected Sub LnkActualziarFechadecompra_Click(sender As Object, e As EventArgs)
Dim ObjCompra As New ClsCompras
Dim ProcesoError As Boolean = True
If FechaCompraOriginal <> TxtFecha.Text.ToDate Then
Dim ObjCompra As New ClsCompras
ObjCompra.IniciaTransacSQL()
Dim ObjEventos As New ClsOIEventos(ObjCompra.IniciaTransacSQL())
If ObjEventos.AddEventoBitacora($"Cambio de Fecha de compra de { FechaCompraOriginal.ToString("dd/MM/yyyy")} a {TxtFecha.Text}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then
ProcesoError = False
Else
ProcesoError = True
End If
If ProcesoError = False And ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then
ProcesoError = False
Else
ProcesoError = True
End If
If Not ProcesoError Then
ObjCompra.Commit()
FechaCompraOriginal = TxtFecha.Text.ToDate
Alert("Fecha Actualizada Correctamente.")
Else
ObjCompra.RollBack()
End If
ObjCompra.Dispose()
If Not ProcesoError Then
CargaEventoBitacora()
UPEventoBitacora.Update()
End If
If ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then
Alert("Fecha Actualizada Correctamente")
End If
ObjCompra.Dispose()
End Sub
Private Function ValidaSeleccionAnticipo() As Boolean
Dim Respuesta As Boolean
Dim Respuesta As Boolean = True
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
If GVAnticipos.Rows.Count > 0 Then
'If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
' If GVAnticipos.Rows.Count > 0 Then
For Each GVRow As GridViewRow In GVAnticipos.Rows
If GVRow.FCCheckBox("Chk").Checked AndAlso GVRow.FCTextBox("TxtAnticipo").Text.ToDecimal > 0 Then
Respuesta = True
Exit For
Else
Respuesta = False
End If
Next
' For Each GVRow As GridViewRow In GVAnticipos.Rows
' If GVRow.FCCheckBox("Chk").Checked AndAlso GVRow.FCTextBox("TxtAnticipo").Text.ToDecimal > 0 Then
' Respuesta = True
' Exit For
' Else
' Respuesta = False
' End If
' Next
Else
Respuesta = True
End If
' Else
' Respuesta = True
' End If
Else
Respuesta = True
End If
'Else
' Respuesta = True
'End If
Return Respuesta