--FIX autorizaciones de NC
This commit is contained in:
@@ -10505,7 +10505,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub VerificaAutorizacionEgs(Optional VerificarImportes As Boolean = True)
|
Private Sub VerificaAutorizacionEgs(Optional VerificarImportes As Boolean = True, Optional MostrarAlertas As Boolean = True)
|
||||||
Dim ImporteAutorizacion As Decimal = 0
|
Dim ImporteAutorizacion As Decimal = 0
|
||||||
Dim TipoAutorizacion As Integer = 0
|
Dim TipoAutorizacion As Integer = 0
|
||||||
|
|
||||||
@@ -10535,7 +10535,10 @@ Partial Class Ventas
|
|||||||
CveAutorizacion = -1
|
CveAutorizacion = -1
|
||||||
|
|
||||||
If BloquearCredito Then
|
If BloquearCredito Then
|
||||||
Alert($"El importe autorizado es insuficiente. Importe autorizado:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
If MostrarAlertas Then
|
||||||
|
Alert($"El importe autorizado es insuficiente. Importe autorizado:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -10543,7 +10546,10 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Else
|
Else
|
||||||
CveAutorizacion = -1
|
CveAutorizacion = -1
|
||||||
Alert($"No se encontro una autorización de crédito.", TipoMensaje.MsgAdvertencia)
|
If MostrarAlertas Then
|
||||||
|
Alert($"No se encontro una autorización de crédito.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -31508,6 +31514,23 @@ Partial Class Ventas
|
|||||||
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False, Optional AplicoNCFacturaActual As Boolean = False, Optional TipoDoctoNC As String = "Egs")
|
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False, Optional AplicoNCFacturaActual As Boolean = False, Optional TipoDoctoNC As String = "Egs")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
'VALIDACION DE AUTORIZACION PARA NC, POR AHORA SOLO BDH
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso AplicoNCFacturaActual AndAlso TipoDoctoNC = "Egs" Then
|
||||||
|
Dim PermiteAutorizacion = False
|
||||||
|
'SI NO ES GENERADA CON REMISIONES DE NC, UTILIZAR LA AUTORIZACION
|
||||||
|
If (ListaRemisionesNC Is Nothing OrElse ListaRemisionesNC.Count = 0) Then
|
||||||
|
PermiteAutorizacion = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If PermiteAutorizacion Then
|
||||||
|
VerificaAutorizacionEgs(VerificarImportes:=True, MostrarAlertas:=True)
|
||||||
|
If Me.CveAutorizacion <= 0 Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Me.AplicaDocumentoNuevoNC = AplicaNuevoDocumento
|
Me.AplicaDocumentoNuevoNC = AplicaNuevoDocumento
|
||||||
Dim DrPS As DataRow = Nothing
|
Dim DrPS As DataRow = Nothing
|
||||||
|
|
||||||
@@ -40582,10 +40605,13 @@ Partial Class Ventas
|
|||||||
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
VerificaAutorizacionEgs(VerificarImportes:=True)
|
|
||||||
If Me.CveAutorizacion <= 0 Then
|
TxtImportesRemisionesNC.Text = "0.00"
|
||||||
Exit Sub
|
TxtNCImporte.Text = "0.00"
|
||||||
Else
|
|
||||||
|
VerificaAutorizacionEgs(VerificarImportes:=True, MostrarAlertas:=False)
|
||||||
|
|
||||||
|
If Me.CveAutorizacion > 0 Then
|
||||||
Using ObjVentas As New ClsVentas
|
Using ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetAutorizacion(Me.CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetAutorizacion(Me.CveAutorizacion, UsuarioActual.CveEmpresa) Then
|
||||||
If ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero() > 0 Then
|
If ObjVentas.DtResultados.FiltroPrimeroValor("CveTipoVenta").ToEntero() > 0 Then
|
||||||
@@ -40595,7 +40621,12 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Using
|
End Using
|
||||||
|
Else
|
||||||
|
DivTipoVentaAsingado.Visible = True
|
||||||
|
LblTipoVentaAsignado.Text = "Sin definir"
|
||||||
|
DdlNCPS.Enabled = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
RegistraScript("$('#ModalAplicarNC').modal('show');", "ModalNC")
|
RegistraScript("$('#ModalAplicarNC').modal('show');", "ModalNC")
|
||||||
|
|||||||
Reference in New Issue
Block a user