diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 7a39219a4..da147e2c4 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4446,5 +4446,312 @@ Public Class ClsBancos End Function +#Region "N O T I F I C A C I O N E S D E P A G O P R O V E E D O R E S" + + Public Function NotificacionPago(CveIENotificar As Integer, CorreoNotificarA As String, CopiaPara As String, UsuarioActual As Usuario) As Boolean + + Dim RutaComprobante As String = "" + If GetBancosIE(CveIENotificar, UsuarioActual.CveEmpresa) Then + RutaComprobante = Comprobante + End If + + + Dim Body As String = GeneraCorreo(CveIENotificar, UsuarioActual) + 'Dim Comprobante As String = "" + + Dim File As Byte() = Nothing + + + 'If MostrarConfirmacion Then + Return MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, RutaComprobante, File, UsuarioActual, CopiaPara) + 'Else + ' Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, RutaComprobante, File, UsuarioActual, MostrarConfirmacion, CopiaPara)) + ' Hilo.Start() + 'End If + + + End Function + + Private Function MandaCorreo(Para As String, Asunto As String, Body As String, RutaComprobante As String, File As Byte(), UsuarioActual As Usuario, CopiaPara As String) As Boolean + + Dim Respuesta As Boolean = False + + Try + Dim Mail As New ClsSisMail() + Para = If(Para IsNot Nothing, Para, "") + Asunto = If(Asunto IsNot Nothing, Asunto, "") + Body = If(Body IsNot Nothing, Body, "") + + Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail) + + If RutaComprobante IsNot Nothing AndAlso RutaComprobante <> "" Then + ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaComprobante}) + End If + + If File IsNot Nothing Then + ListaArchivos.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoCuentaCxP.pdf"}) + End If + + Dim separador As Char() = {";"c, ","c} + Dim strArray As String() = Para.Split(separador) + + Para = "" + + For Each sCorreo As String In strArray + If ClsSisMail.IsMailShared(sCorreo) And sCorreo.Trim.Length > 0 Then + Para = $"{Para}{sCorreo};" + End If + Next + + + If Para.Length > 0 Then + + Para = Para.Substring(0, Para.Length - 1) + + If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos, Displayname:=$"SIG Notificaciones: Pago de {UsuarioActual.Empresa.Empresa}", CCP:=CopiaPara) Then + + Respuesta = True + 'If MostrarConfirmacion Then + ' Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) + 'End If + + + + 'If MostrarConfirmacion Then + ' Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError) + 'End If + + End If + + End If + + + Catch ex As Exception + OnError("Ocurrio un error al enviar el correo", ex) + + + End Try + + Return Respuesta + + End Function + + Private Function GeneraCorreo(CveIENotificar As Integer, UsuarioActual As Usuario) As String + + Dim strBody As New StringBuilder + + + If GetBancosIE(CveIENotificar, UsuarioActual.CveEmpresa) Then + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat(" {0}", UsuarioActual.Empresa.Empresa) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", UsuarioActual.Empresa.Direccion) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", UsuarioActual.Empresa.Colonia) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", UsuarioActual.Empresa.Ciudad, UsuarioActual.Empresa.Estado, UsuarioActual.Empresa.CP) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", UsuarioActual.Empresa.RFC) + strBody.AppendFormat(" ") + strBody.AppendFormat("
{0}
Col. {0}
{0}, {1}, C.P.{2}
RFC {0}
") + strBody.AppendFormat("
") + strBody.AppendFormat("


") + + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + + If CveTipoTransaccion = 1 Then ' cuando es cheque + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + End If + + If CveTipoTransaccion.Contiene(2, 9, 17) Then ' cuando es transf + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + End If + + + strBody.Append(" ") + strBody.AppendFormat(" ") + strBody.Append(" ") + strBody.Append("
Favor de pasar a nuestras oficinas por el cheque con la siguientes instrucciones.
Notificación de transferencia de pago realizada.
 
") + strBody.AppendFormat("
") + strBody.Append("
") + + + strBody.AppendFormat("
") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat(" Beneficiario:{0} ", PagueseA) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", TipoTransaccion) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", Banco) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", NumCuenta) + strBody.AppendFormat(" ") + If CuentaDepositado.ToString <> "" Then + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", CuentaDepositado) + strBody.AppendFormat(" ") + End If + + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", FechaDocumento.ToString("dd/MM/yyyy")) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", Importe.FormatoNumero, Moneda) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", Observaciones) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat("
Movimiento:{0}
Banco:{0}
Cuenta:{0}
Cuenta Destino:{0}
Fecha:{0}
Importe:$ {0} {1}
Observaciones:{0}
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + + + + + 'MOVIMIENTOS CHEQUE + If GetBancosIEMovimientos(CveIENotificar, UsuarioActual.CveEmpresa) Then + Dim Textov33 As String = "" + If UsuarioActual.Empresa.Funcionalidad(520) = "1" Then + Textov33 = "Favor de emitir complemento de pago de los siguientes documentos" + End If + + + strBody.AppendFormat("
") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat(" Documentos abonados o pagados
{0}
", Textov33) + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + + + For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17) AND CveCompra > 0").Rows + strBody.AppendFormat(" ") + strBody.AppendFormat(" ", dr("Fecha").ToString.ToDate.ToShortDateString()) + strBody.AppendFormat(" ", dr("SerieFolio").ToString) + strBody.AppendFormat(" ", dr("Importe").ToString.FormatoNumero) + strBody.AppendFormat(" ", dr("FolioFiscal")) + strBody.AppendFormat(" ", dr("ImporteNC").ToString.FormatoNumero) + strBody.AppendFormat(" ") + Next + + + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat(" ") + strBody.AppendFormat("
FechaFacturaImporte ($)Folio FiscalNC Aplicadas
{0}{0}$ {0}{0}{0}
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + strBody.AppendFormat("
") + End If + + strBody.Append("
Favor de no responder a este correo.
") + + strBody.Append("") + End If + + 'objIE.Dispose() + Return strBody.ToString + + End Function + +#End Region End Class diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f49aabb3c..45cb0773d 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -460,7 +460,8 @@ Public Class ClsVentas Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1, Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1, - Optional RetISR As Double = -1, Optional Kilometraje As Double = 0) As Boolean + Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveVendedor As Integer = -1, Optional ObsAlm As String = "", Optional FormaPaqueteria As Integer = -1, + Optional CorreoNot As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUpdate") @@ -491,6 +492,10 @@ Public Class ClsVentas .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal .Add("@OrdenCompra", SqlDbType.VarChar).Value = OrdenCompra .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@ObservacionesAlm", SqlDbType.NVarChar).Value = ObsAlm + .Add("@FormaPaqueteria", SqlDbType.Int).Value = FormaPaqueteria + .Add("@CorreoNotificacion", SqlDbType.NVarChar).Value = CorreoNot End With Try diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 4cacca5f8..c5e19185d 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -441,6 +441,115 @@
+ + + + +
+
+
+ + Notas de Crédito + +
+ +
+ + + +
+ +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + +   + + + + + + <%-- Visible='<%# Eval("CveCompra").ToString <> "" andalso CDbl(Eval("Saldo")) > 0%>' />--%> + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+
+ + + + + + +