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/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 21eb83cd4..2a66e9236 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4820,6 +4820,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721) PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722) PaginaDict.Add("/Ventas/CatMetasVendedores.aspx".ToUpper(), 723) + PaginaDict.Add("/Ventas/RepAuxiliarFacturas.aspx".ToUpper(), 704) #End Region diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 59d5678ba..f5ac79de9 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1643,6 +1643,43 @@ Public Class ClsVentas Return Retorno End Function + 'Reporte de Ventas - Auxiliar Facturas + Public Function GetRepAuxliarFacturas(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, + CveCliente As Integer, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, + Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = -1, Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1") As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_RepAuxiliarGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio + .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte auxiliar de facturas de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + #End Region #Region "V E N T A S - P R E C I O L I S T A S" 'Hecho por Charlie 1/9/2016 diff --git a/Ashx/SIGGPSRCService.ashx b/Ashx/SIGGPSRCService.ashx index 33e0b4b40..30ad9d59c 100644 --- a/Ashx/SIGGPSRCService.ashx +++ b/Ashx/SIGGPSRCService.ashx @@ -26,85 +26,21 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState } } - private Usuario ValidaUsuarioSistema(int CveEmpresa) - { - Usuario UsuarioActual = null; - ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios(); - if (ObjUsuarios.GetUsuarios(1727)) - { - if (ObjUsuarios.DtResultados.Rows.Count > 0) - { - var Usuario = ObjUsuarios.DtResultados.Rows[0]["Usuario"].ToString(); - var Contrasenia = ObjUsuarios.DtResultados.Rows[0]["Contraseña"].ToString(); - - UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, ModExtensiones.IMEI, CveEmpresa); - - UsuarioActual.CveEmpresa = CveEmpresa; - UsuarioActual.CveCliente = 183798; - - CreaObjetoEmpresa(ref UsuarioActual); - CargaZonasHorarias(ref UsuarioActual); - } - } - ObjUsuarios.Dispose(); - return UsuarioActual; - } - private void CreaObjetoEmpresa(ref Usuario UsuarioActual) - { - ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas(); - if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1")) - { - if (ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa)) - { - System.Data.DataTable dttmp = ObjEmpresa.DtResultados; - - var EmpresasFuncionalidades = new HybridDictionary(); - foreach (System.Data.DataRow Row in dttmp.Rows) - EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString()); - - ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades); - } - - UsuarioActual.Empresa = ObjEmpresa.Empresa; - } - ObjEmpresa.Dispose(); - } - private void CargaZonasHorarias(ref Usuario UsuarioActual) - { - ClsClientes ObjClientes = new ClsClientes(); - try - { - if (ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus: 1)) - { - if (ObjClientes.DtResultados.Rows.Count == 1) - UsuarioActual.UTCOffset = ObjClientes.DtResultados.Rows[0]["UTCOffset"].ToString().ToEntero(); - } - } - catch (Exception ex) - { - ex.ToString().GuardaLog(); - } - finally - { - ObjClientes.Dispose(); - } - } - public bool IsReusable => false; public void ProcessRequest(HttpContext context) { + context.Response.ContentType = "text/plain"; + bool retorno = false; try { - context.Response.ContentType = "text/plain"; - bool retorno = false; + string Metodo = context.Request["Metodo"] == null ? "" : context.Request["Metodo"]; switch (Metodo) { case "EjecutaServicio": ModExtensiones.GuardaLogAD("Servicio Ejecutado...........", "LogServicioConfiable"); - IniciarTransmision(context); - retorno = true; + retorno = IniciarTransmision(); break; default: break; @@ -123,11 +59,14 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState { ex.GuardaLog(ex.Message); } + + context.Response.End(); } - private void IniciarTransmision(HttpContext context) + private bool IniciarTransmision() { - var UsuarioActual = ValidaUsuarioSistema(121); + var retorno = false; + var TieneError = false; var WS = new RCGPSService.RCServiceClient(); @@ -142,6 +81,10 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState { DtTrackings = ObjGPS.DtResultados.Copy(); } + else + { + TieneError = true; + } if (DtTrackings != null) { @@ -152,6 +95,10 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState { dtTracking = ObjGPS.DtResultados.Copy(); } + else + { + TieneError = true; + } if (dtTracking != null) { foreach (DataRow Row in dtTracking.Rows) @@ -175,6 +122,7 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState } catch (Exception ex) { + TieneError = true; this.OnError("Ocurrió un error al enviar los datos", ex); } ObjGPS.Dispose(); @@ -182,15 +130,22 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState DtTrackings.Dispose(); DtTrackings = null; - if (ListaEventos.Count > 0) + if (ListaEventos.Count > 0 && !TieneError) { - var respuesta = WS.GPSAssetTracking(Token.token, ListaEventos.ToArray()); - context.Response.Write(JsonConvert.SerializeObject(respuesta)); + if (respuesta.Length > 0) + { + retorno = !TieneError; + } + } + else + { + retorno = !TieneError; } WS.Close(); - //context.Response.Write(JsonConvert.SerializeObject(new { idJob = "1", exception = "" })); + + return retorno; } 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%>' />--%> + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+
+ + + + + + +