--FIX validacion de estatus de cobranza al editar remision, recargar info al cobrar

This commit is contained in:
JPerez
2025-06-10 12:54:41 -07:00
parent 648623fd6f
commit 3dfc7afab9
2 changed files with 100 additions and 70 deletions

View File

@@ -501,7 +501,16 @@ Partial Class Ventas_PVCobranza
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim CveVenta As Integer = e.CommandArgument.ToString.ToEntero Dim CveVenta As Integer = e.CommandArgument.ToString.ToEntero
Dim CondicionesPagoContado As Boolean = GvRow.DataKey("CondicionesPago") = "0"
Dim RowVenta As DataRow = Nothing
Using ObjVta As New ClsVentas
If ObjVta.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
RowVenta = ObjVta.DtResultados.Copy().Rows(0)
End If
End Using
If RowVenta IsNot Nothing Then
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()
@@ -510,16 +519,21 @@ Partial Class Ventas_PVCobranza
TieneError = True TieneError = True
End If End If
HdnCveVenta.Value = CveVenta.ToString HdnCveVenta.Value = CveVenta.ToString
HdnCveCliente.Value = GvRow.DataKey("CveCliente")
TxtImporteContado.Text = GvRow.DataKey("Saldo").FormatoNumero
HdnTotal.Value = GvRow.DataKey("Saldo")
TxtImporteEfectivo.Focus()
LtlNombre.Text = GvRow.DataKey("AtencionA")
LtlFolio.Text = GvRow.DataKey("SerieFolio")
LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero
LtlMoneda.Text = GvRow.DataKey("Moneda")
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero() Dim Saldo As Decimal = RowVenta("Saldo").ToString().ToDecimal()
Dim CveFormaPago33 As String = RowVenta("CveFormaPago33").ToString()
HdnCveCliente.Value = RowVenta("CveCliente").ToString()
TxtImporteContado.Text = Saldo.FormatoNumero
HdnTotal.Value = Saldo.ToString()
TxtImporteEfectivo.Focus()
LtlNombre.Text = RowVenta("AtencionA").ToString()
LtlFolio.Text = RowVenta("SerieFolio").ToString()
LtlSaldo.Text = Saldo.FormatoNumero
LtlMoneda.Text = RowVenta("Moneda").ToString()
Dim CondicionesPagoContado As Boolean = RowVenta("CondicionesPago").ToString() = "0"
Dim CveMoneda As Integer = RowVenta("CveMoneda").ToString().ToEntero()
HdnMoneda.Value = CveMoneda.ToString() HdnMoneda.Value = CveMoneda.ToString()
If CveMoneda = 2 Then If CveMoneda = 2 Then
@@ -528,29 +542,29 @@ Partial Class Ventas_PVCobranza
TxtTotalMXN.Text = (TxtImporteContado.Text.ToDecimal() * TxtTC.Text.ToDecimal()).FormatoNumero() TxtTotalMXN.Text = (TxtImporteContado.Text.ToDecimal() * TxtTC.Text.ToDecimal()).FormatoNumero()
End If End If
HdnVentaCondicionesPago.Value = GvRow.DataKey("CondicionesPago") HdnVentaCondicionesPago.Value = RowVenta("CondicionesPago").ToString()
HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza") HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza")
If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) AndAlso GvRow.DataKey("TipoDocto").Contiene("Rem", "Ant") Then If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) AndAlso RowVenta("TipoDocto").ToString().Contiene("Rem", "Ant") Then
DivAnticipo.Visible = True DivAnticipo.Visible = True
ImgAntiPend.Visible = True ImgAntiPend.Visible = True
End If End If
If CondicionesPagoContado Then If CondicionesPagoContado Then
'según la forma de pago va a establecer el valor para pago. 'según la forma de pago va a establecer el valor para pago.
Select Case GvRow.DataKey("CveFormaPago33") Select Case CveFormaPago33
Case "1" Case "1"
TxtImporteEfectivo.Text = GvRow.DataKey("Saldo").FormatoNumero TxtImporteEfectivo.Text = Saldo.FormatoNumero
Case "2" Case "2"
TxtImporteCheque.Text = GvRow.DataKey("Saldo").FormatoNumero TxtImporteCheque.Text = Saldo.FormatoNumero
Case "3" Case "3"
TxtImporteTransferencia.Text = GvRow.DataKey("Saldo").FormatoNumero TxtImporteTransferencia.Text = Saldo.FormatoNumero
Case "4" Case "4"
TxtImporteCredito.Text = GvRow.DataKey("Saldo").FormatoNumero TxtImporteCredito.Text = Saldo.FormatoNumero
Case "18" Case "18"
TxtImporteDebito.Text = GvRow.DataKey("Saldo").FormatoNumero TxtImporteDebito.Text = Saldo.FormatoNumero
Case Else Case Else
TxtImporteEfectivo.Text = GvRow.DataKey("Saldo").FormatoNumero TxtImporteEfectivo.Text = Saldo.FormatoNumero
End Select End Select
DivContadoBancos.Visible = True DivContadoBancos.Visible = True
BtnPagar.Text = "Pagar" BtnPagar.Text = "Pagar"
@@ -575,6 +589,9 @@ Partial Class Ventas_PVCobranza
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
End If
'CargaDatos() 'CargaDatos()
End If End If
End Sub End Sub

View File

@@ -24757,6 +24757,19 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
'si es de FNC contado. bloquear edición si está pagada o en proceso de cobro
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
Using ObjVta As New ClsVentas
If ObjVta.GetVenta(Me.CveVenta, UsuarioActual.CveEmpresa) Then
Dim DbRowVenta As DataRow = ObjVta.DtResultados.FiltroPrimero("")
If DbRowVenta IsNot Nothing AndAlso (DbRowVenta("CveCobranzaEstatus").ToString = "1" OrElse DbRowVenta("Saldo").ToString.ToDecimal = 0) Then
Alert("No se puede actualizar la información de la remisión porque esta en proceso de cobro. Para aplicar cambios se debera de liberar desde el módulo de 'cobro por caja'.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End Using
End If
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
ObjVentas.IniciaTransacSQL() ObjVentas.IniciaTransacSQL()