-- solicitud de anticipos y mejoras GDIaz
This commit is contained in:
@@ -1665,7 +1665,6 @@ Partial Class Ventas
|
||||
ViewState("CveOC") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property RegistroxOC As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("RegistroxOC"), False))
|
||||
@@ -1674,8 +1673,6 @@ Partial Class Ventas
|
||||
ViewState("RegistroxOC") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property EnviarCorreoCliente As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("EnviarCorreoCliente"), False))
|
||||
@@ -2598,10 +2595,6 @@ Partial Class Ventas
|
||||
CargaGestionCobranza()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(595) = "2" Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
End If
|
||||
|
||||
DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat")
|
||||
DivPSSAT.Visible = True
|
||||
|
||||
@@ -7709,6 +7702,8 @@ Partial Class Ventas
|
||||
Private Sub CargaRestriccionesCreditoCliente(Optional Alertas As Boolean = False, Optional CveVenta As Integer = -1)
|
||||
|
||||
Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595)
|
||||
'solo para bdh, que se generen NC
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then DdlSolCreditoTipoDocto.Items.Add(New ListItem("Nota de crédito", "Egs"))
|
||||
|
||||
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
|
||||
If Not EsFilial AndAlso (Not UsuarioActual.Empresa.Funcionalidad(702).Contiene("1")) AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then
|
||||
@@ -7750,7 +7745,7 @@ Partial Class Ventas
|
||||
|
||||
If Me.PermiteCredito Then
|
||||
If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then
|
||||
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
Dim CreditoDispo As Decimal = GetSaldoCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
If CreditoDispo > 0 Then
|
||||
TrCreditoDisponible.Visible = True
|
||||
LblCreditoDisponible.Text = String.Format("{0:C}", CreditoDispo)
|
||||
@@ -7778,7 +7773,7 @@ Partial Class Ventas
|
||||
UPCondicionesPago.Update()
|
||||
End If
|
||||
|
||||
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
Dim CreditoDispo As Decimal = GetSaldoCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
|
||||
If CreditoDispo > 0 Then
|
||||
TrCreditoDisponible.Visible = True
|
||||
@@ -7801,7 +7796,7 @@ Partial Class Ventas
|
||||
If Not EsCreaApartirDe AndAlso (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then
|
||||
DdlTipoComprobante.SelectedValueExist("Cot")
|
||||
Else
|
||||
If UsuarioActual.Empresa.Funcionalidad(595) = "1" Then
|
||||
If ValorAutorizacion = "1" Then
|
||||
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
|
||||
DdlTipoComprobante.SelectedValue = "PA"
|
||||
|
||||
@@ -7814,7 +7809,7 @@ Partial Class Ventas
|
||||
If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then DdlTipoComprobante.SelectedValue = "Cot"
|
||||
|
||||
'quito remisión y factura
|
||||
If UsuarioActual.Empresa.Funcionalidad(595) <> "2" Then
|
||||
If ValorAutorizacion = "1" Then
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
|
||||
If Not UsuarioActual.TienePermisoProceso(325) Then
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
||||
@@ -7839,7 +7834,6 @@ Partial Class Ventas
|
||||
|
||||
If Bloqueo AndAlso ValorAutorizacion = "2" Then
|
||||
Dim Autorizacion As Integer = 0
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
@@ -7862,6 +7856,13 @@ Partial Class Ventas
|
||||
TieneBloqueoPorCreditoVencimiento = 0
|
||||
Alert("El cliente tiene una autorización aprobada", TipoMensaje.ToastInformacion)
|
||||
End If
|
||||
LnkSolicitarCredito.Visible = True
|
||||
DdlTipoAutorizacion.SelectedValueExist("1")
|
||||
End If
|
||||
|
||||
If Bloqueo AndAlso ValorAutorizacion = "3" Then ' autorización con vinculación a una venta registrada
|
||||
If UsuarioActual.CveRol = 1 Then TrCredito1.Visible = True
|
||||
ChkSolicitudAutorizacionCredito.Checked = True
|
||||
End If
|
||||
|
||||
'SI ES AUTORIZACION DEBE PERMITIR GENERARLA
|
||||
@@ -7999,16 +8000,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
Case "2" 'Autorizacion desde una solicitud del catalogo de autorizaciones
|
||||
'RMF. validacion temporal
|
||||
'verifica si tiene autorizaciones de Nota de crédito autorizadas
|
||||
'Dim ObjVentas As New ClsVentas
|
||||
'If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Ing", CveEstatus:=1) Then
|
||||
' Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion")
|
||||
' If RowAutorizacion IsNot Nothing Then
|
||||
' DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos")
|
||||
' End If
|
||||
'End If
|
||||
'ObjVentas.Dispose()
|
||||
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
@@ -8128,7 +8120,7 @@ Partial Class Ventas
|
||||
|
||||
'CREDITO NO SUFICIENTE
|
||||
If Opcion = 3 Then
|
||||
'Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
'Dim CreditoDispo As Decimal = GetSaldoCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
'If CreditoDispo < 0 AndAlso RBLPago.SelectedValue = "1" Then
|
||||
' BloquearCliente = True
|
||||
'End If
|
||||
@@ -8295,7 +8287,7 @@ Partial Class Ventas
|
||||
Alert("La Sucursal/Departamento del cliente se encuentra inactivo", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
RBLPago.Items(0).Enabled = True
|
||||
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero(), ObjVentas)
|
||||
Dim CreditoDispo As Decimal = GetSaldoCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero(), ObjVentas)
|
||||
|
||||
TrCreditoDisponible.Visible = True
|
||||
LblCreditoDisponible.Text = String.Format("{0:C}", CreditoDispo)
|
||||
@@ -8435,7 +8427,7 @@ Partial Class Ventas
|
||||
UpCliente.Update()
|
||||
UpEmitirTransitorio.Update()
|
||||
End Sub
|
||||
Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
|
||||
Private Function GetSaldoCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
|
||||
Dim Retorno As Decimal = 0
|
||||
Dim ObjVentasAplciar As ClsVentas = Nothing
|
||||
If ObjVentas IsNot Nothing Then
|
||||
@@ -10904,6 +10896,23 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If ErrorList.Count = 0 AndAlso ObjFactura.CveVenta > 0 AndAlso ChkSolicitudAutorizacionCredito.Checked Then
|
||||
' crea la solicitud de autorización de crédito
|
||||
Dim tCveTipoAutorizacion As Integer = 1
|
||||
If ObjVentas.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtTotal.Text.ToDecimal(), 0, UsuarioActual.CveUsuario, tCveTipoAutorizacion, TipoDocumento:=DdlTipoComprobante.SelectedValue, DiasVencidos:=25, CveVenta:=ObjFactura.CveVenta) Then
|
||||
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
|
||||
Dim Arr As New ArrayList
|
||||
|
||||
Arr.Add(NombreCliente)
|
||||
Arr.Add($" $ {TxtTotal.Text.ToDecimal}")
|
||||
Arr.Add(DdlSubProyectoDatos.SelectedItem.Text)
|
||||
EnviarNotificacionWhatsAppPlantilla("526621430964", "solicitud_autorizacion_credito2", Arr)
|
||||
' Alert("bien")
|
||||
'Else
|
||||
' Alert("mal", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Paso CRM actualizar importe de acercamiento y guardar en bitacora
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
|
||||
@@ -37340,8 +37349,11 @@ Partial Class Ventas
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
Protected Sub DdlTipoAutorizacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoAutorizacion.SelectedIndexChanged
|
||||
DivImporteSolicitud.Visible = DdlTipoAutorizacion.SelectedValue.ToEntero() = 1
|
||||
DivDiasVencidos.Visible = DdlTipoAutorizacion.SelectedValue.ToEntero() = 2
|
||||
DivImporteSolicitud.Visible = DdlTipoAutorizacion.SelectedValue = "1"
|
||||
DivDiasVencidos.Visible = DdlTipoAutorizacion.SelectedValue = "2"
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||
TxtDiasVencidos.Text = "25"
|
||||
End If
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user