This commit is contained in:
2024-05-15 19:30:17 -07:00

View File

@@ -5443,7 +5443,7 @@ Partial Class OC_OC
If Not TieneError Then
RegistraScript("$('#ModalSolicitarAnticipo').modal('hide');", "ModalSolicitarAnticipoHide")
ObjOC.Commit()
EnviaCorreoSolicitudAnticipo(ObjOI.CveEvento)
EnviaCorreoSolicitudAnticipo(ObjOI.CveEvento, TxtSAImporte.Text.ToDecimal, DdlSAUsuario.SelectedValue.ToEntero)
'LIMPIA
BtnSolicitudAnticipo.Visible = False
DdlSAUsuario.SelectedValue = "-1"
@@ -5465,20 +5465,20 @@ Partial Class OC_OC
End Sub
Private Sub EnviaCorreoSolicitudAnticipo(CveEvento As Integer, Optional ImporteAnticipo As Decimal = 0)
Private Sub EnviaCorreoSolicitudAnticipo(CveEvento As Integer, ImporteAnticipo As Decimal, CveUsuaioCorreo As Integer)
Dim Param As New List(Of String)
Dim DtPara As DataTable = GlobalDTUsuarios(DdlSAUsuario.SelectedValue.ToString.ToEntero, CveEmpresaActual)
Dim DtPara As DataTable = GlobalDTUsuarios(CveUsuaioCorreo, CveEmpresaActual)
If DdlMetodoPago.SelectedValue.ToEntero = 0 Then
'If DdlMetodoPago.SelectedValue.ToEntero = 0 Then
DtPara = GlobalDTUsuarios(DdlSAUsuarioContado.SelectedValue.ToString.ToEntero, CveEmpresaActual)
' DtPara = GlobalDTUsuarios(DdlSAUsuarioContado.SelectedValue.ToString.ToEntero, CveEmpresaActual)
If DtPara Is Nothing Then
DtPara = GlobalDTUsuarios(DdlSAUsuario.SelectedValue.ToString.ToEntero, CveEmpresaActual)
End If
' If DtPara Is Nothing Then
' DtPara = GlobalDTUsuarios(DdlSAUsuario.SelectedValue.ToString.ToEntero, CveEmpresaActual)
' End If
End If
'End If
Try
If DtPara IsNot Nothing AndAlso DtPara.Rows.Count > 0 Then
@@ -5486,20 +5486,19 @@ Partial Class OC_OC
Param.Add(DtPara.Rows(0)("Correo").ToString()) 'Para
Param.Add("Solicitud de anticipo de Orden de Compra") 'Asunto
If ImporteAnticipo = 0 Then
ImporteAnticipo = TxtSAImporte.Text.ToDecimal
End If
'If ImporteAnticipo = 0 Then
' ImporteAnticipo = TxtSAImporte.Text.ToDecimal
'End If
Param.Add(GeneraCorreoAnticipo(lblFolio.Text, DtPara.Rows(0)("Nombre").ToString(), String.Format("http://sig.adssistemas.mx/OI/EventoDetalle.aspx?CveTipoEvento=1&CveEvento={0}", CveEvento), ImporteAnticipo.ToString, DdlProveedores.SelectedText))
Param.Add(String.Format("{0}PDF\OC-{1}.pdf", UsuarioActual.Empresa.Ruta, CveOrdenCompra))
Dim Hilo As New Threading.Thread(AddressOf MandaCorreoAnticipo)
Hilo.Start(Param)
Else
Alert("Correo de solcitud de anticipo no enviado", TipoMensaje.MsgAdvertencia)
End If
Catch ex As Exception
Alert("Correo de solcitud de anticipo no enviado", TipoMensaje.MsgAdvertencia)
End Try
End Sub
@@ -9012,7 +9011,7 @@ Partial Class OC_OC
End If
If Not TieneError Then
EnviaCorreoSolicitudAnticipo(ObjOI.CveEvento, TxtSAImporteContado.Text.ToDecimal)
EnviaCorreoSolicitudAnticipo(ObjOI.CveEvento, TxtSAImporteContado.Text.ToDecimal, DdlSAUsuarioContado.SelectedValue.ToString.ToEntero)
'LIMPIA
DdlSAUsuarioContado.SelectedValue = "-1"
TxtSAImporteContado.Text = ""