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/ClsClientes.vb b/App_Code/ClsClientes.vb index 3373f9526..7a14674f8 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -1022,22 +1022,22 @@ Public Class ClsClientes End Function - Public Function GetEstados(Optional ClaveSATPais As String = "-1") As Boolean - Dim Retorno As Boolean = False + 'Public Function GetEstados(Optional ClaveSATPais As String = "-1") As Boolean + ' Dim Retorno As Boolean = False - DataAdapter("PA_ClientesEstadosGet") + ' DataAdapter("PA_ClientesEstadosGet") - SqlAdapter.SelectCommand.Parameters.Add("@ClaveSATPais", SqlDbType.VarChar).Value = ClaveSATPais + ' SqlAdapter.SelectCommand.Parameters.Add("@ClaveSATPais", SqlDbType.VarChar).Value = ClaveSATPais - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el los estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener el los estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function @@ -1596,8 +1596,8 @@ Public Class ClsClientes Return Retorno End Function - Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, - Pais As String, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, + Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer, + RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesNoFrecuenteAdd") @@ -1610,8 +1610,8 @@ Public Class ClsClientes .Add("@Colonia", SqlDbType.VarChar).Value = Colonia .Add("@Localidad", SqlDbType.VarChar).Value = Localidad .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad - .Add("@Estado", SqlDbType.VarChar).Value = Estado - .Add("@Pais", SqlDbType.VarChar).Value = Pais + .Add("@CveEstado", SqlDbType.Int).Value = CveEstado + ' .Add("@Pais", SqlDbType.VarChar).Value = Pais .Add("@RFC", SqlDbType.VarChar).Value = RFC .Add("@CP", SqlDbType.VarChar).Value = CP .Add("@Telefono", SqlDbType.VarChar).Value = Telefono 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 daee7399b..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 @@ -4468,11 +4505,11 @@ Public Class ClsVentas Return retorno End Function - Public Function GetOCRelacionadas(CveVentasDetalles As String) As Boolean + Public Function GetOCRelacionadas(CveVenta As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Vta_OrdenCompraRelacionada", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters - .Add("@CveVentasDetalles", SqlDbType.NVarChar).Value = CveVentasDetalles + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta End With Try SqlAdapter.Fill(Data) 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/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 17e401ead..0f7b199d5 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -585,7 +585,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'verifica existencias - If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141) Then + If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152) Then UsaGlobal = False Dim objInv As New ClsInventarios 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%>' />--%> + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+
+ + + + + + +