This commit is contained in:
2024-12-30 10:06:39 -07:00
parent a5dd057e5d
commit 4a2b273841
2 changed files with 82 additions and 56 deletions

View File

@@ -11,6 +11,7 @@ Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
Imports ADSNetLibrary.SIGAPI.Services.CRM
Imports ADSTimbrado
Imports Extensiones
Imports Microsoft.Ajax.Utilities
Imports Microsoft.Reporting.WebForms
Imports Modelos
Imports Newtonsoft.Json.Linq
@@ -7861,8 +7862,11 @@ Partial Class Ventas
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
TrCredito1.Visible = True
ChkSolicitudAutorizacionCredito.Checked = True
LnkSolicitarCredito.Visible = True
divModalidad2.Visible = False
divModalidad3.Visible = True
End If
'SI ES AUTORIZACION DEBE PERMITIR GENERARLA
@@ -9075,9 +9079,9 @@ Partial Class Ventas
GvPS.DataBind()
End Sub
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
'Dim TipoDescuento As Integer
Dim CvePSNuevo As Integer = GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero()
Dim CvePSNuevo As Integer = GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero()
Dim CvePSAnterior As Integer = GvPS.Rows(e.RowIndex).DataKey("CvePS").ToEntero
Dim Cantidad, PU As Decimal
Dim ObjDescuento As New Modelos.VentaDescuentos
Dim CuentaPredial As String
@@ -9104,7 +9108,7 @@ Partial Class Ventas
End If
'SI ESTA HABILITADO LA OPCION DE DESCUENTO, SE AGREGO UN DESCUENTO MANUAL Y NO TIENE PROMOCION
If GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Enabled AndAlso (ObjDescuento.CvePromocionDetalle <= 0 AndAlso ObjDescuento.ImporteDescuento <= 0) AndAlso DescuentoManual > 0 Then
If GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Enabled AndAlso CvePSAnterior = CvePSNuevo Then 'AndAlso (ObjDescuento.CvePromocionDetalle <= 0 AndAlso ObjDescuento.ImporteDescuento <= 0) Then
ObjDescuento.ImporteDescuento = DescuentoManual
End If
@@ -10906,11 +10910,23 @@ Partial Class Ventas
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
Dim dtt As DataTable = Nothing
Dim ObjProceso As New ClsSisProcesos
If ObjProceso.GetUsuariosconProceso(379, UsuarioActual.CveEmpresa) Then 'proceso para autorizar
dtt = ObjProceso.DtResultados.FiltraParametros("", DistinctColumns:={"CveUsuario", "Celular"})
End If
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.Rows
Dim NumeroTelefono = "526621143532"
If EsProduccion Then
NumeroTelefono = String.Format("52{0}", dr("Celular").ToString())
End If
EnviarNotificacionWhatsAppPlantilla(NumeroTelefono, "solicitud_autorizacion_credito2", Arr)
'ClsSisNotificaciones.EnviarAlerta("Solicitud de Autorización de crédito", $"Solicitud de autorización de crédito Folio: {Folio} <br/><a href='/Ventas/Clientes.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
Next
End If
ObjProceso.Dispose()
End If
End If
@@ -37321,11 +37337,16 @@ Partial Class Ventas
UpModalSolicitud.Update()
End Sub
Protected Sub BtnSolicitarCredito_Click(sender As Object, e As EventArgs) Handles BtnSolicitarCredito.Click
If UsuarioActual.Empresa.Funcionalidad(595) = "3" Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Exit Sub
End If
Dim DiasVencidos As Integer = 0
Dim CveEstatus As Integer = 0
Dim TipoDocto As String = DdlSolCreditoTipoDocto.SelectedValue
Dim CveTipoAutorizacion As Integer = DdlTipoAutorizacion.SelectedValue.ToEntero()
If CveTipoAutorizacion <= 0 Then
If UsuarioActual.Empresa.Funcionalidad(595) <> "3" AndAlso CveTipoAutorizacion <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
Exit Sub
End If