--FIX varios

This commit is contained in:
2024-12-13 11:17:32 -07:00
parent 65761b0069
commit aea0408671
2 changed files with 98 additions and 67 deletions

View File

@@ -6848,6 +6848,8 @@ Partial Class Ventas
RBLPago.Items(0).Enabled = True
Dim CveUsoCFDICliente As Integer = -1
Dim ObjCliente As New ClsClientes()
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus, TipoCliente:=-1) Then
@@ -7001,46 +7003,10 @@ Partial Class Ventas
DdlMetodoPago33.Enabled = True
End If
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
Me.CveMetodoPago33Cliente = ObjCliente.CveMetodoPago33
Me.CveFormaPago33Cliente = ObjCliente.CveFormaPago33
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
'SI EL METODO DE PAGO ES PUE, SELECCIONA CONTADO
If Me.CveMetodoPago33Cliente = 1 Then
RBLPago.SelectedValue = "2"
ElseIf Me.CveMetodoPago33Cliente = 3 Then
RBLPago.SelectedValue = "1"
End If
RBLPago_SelectedIndexChanged(RBLPago, Nothing)
UPCondicionesPago.Update()
Else
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
CambiaMetodoPago33()
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33)
End If
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
RegimenFiscalCliente = "616"
ClienteCodigoRegimenFiscal = "616"
Else
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DdlUsoCFDI.Enabled = True
End If
If NuevaFactura = 1 Then
DdlUsoCFDI.Enabled = True
End If
End If
End If
CveUsoCFDICliente = ObjCliente.CveUsoCFDI
PlazoCobranza = ObjCliente.PlazoCobranza
PlazoCobranzaRemision = ObjCliente.PlazoCobranzaRemision
@@ -7390,6 +7356,48 @@ Partial Class Ventas
CargaRestriccionesCreditoCliente(True, CveVentaRef)
Dim CveCotizacion As Integer = IfNull(ViewState("CveCotizacion"), 0).ToString().ToEntero()
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
'SI EL METODO DE PAGO ES PUE, SELECCIONA CONTADO
If Me.CveMetodoPago33Cliente = 1 Then
RBLPago.SelectedValue = "2"
ElseIf Me.CveMetodoPago33Cliente = 3 Then
RBLPago.SelectedValue = "1"
'SI ESTA BLOQUEADO EL CREDITO, DEJAR CONTADO
If Not RBLPago.Items(0).Enabled Then
RBLPago.SelectedValue = "2"
End If
End If
RBLPago_SelectedIndexChanged(RBLPago, Nothing)
UPCondicionesPago.Update()
Else
DdlMetodoPago33.SelectedValueExist(Me.CveMetodoPago33Cliente)
CambiaMetodoPago33()
DdlFormaPago33.SelectedValueExist(Me.CveFormaPago33Cliente)
End If
DdlUsoCFDI.SelectedValueExist(CveUsoCFDICliente)
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
'S01 Sin efectos fiscales.
DdlUsoCFDI.SelectedValueExist("23")
DdlUsoCFDI.Enabled = False
RegimenFiscalCliente = "616"
ClienteCodigoRegimenFiscal = "616"
Else
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DdlUsoCFDI.Enabled = True
End If
If NuevaFactura = 1 Then
DdlUsoCFDI.Enabled = True
End If
End If
End If
If CveVenta <= 0 Then
CalculaLineasAdicionales()
HabilitaRemisionPublicoGeneral = 0
@@ -8988,6 +8996,17 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Try
If GvPS.Rows(e.NewEditIndex).DataKey("CvePrecioLista").ToString().ToEntero() > 0 Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
End If
Catch ex As Exception
End Try
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
If EsVentaMedica Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
@@ -9023,6 +9042,8 @@ Partial Class Ventas
End If
UpPS.Update()
End Sub
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
GvPS.EditIndex = -1