Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -4384,6 +4384,7 @@ Public Class ClsContabilidad
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.SelectCommand.CommandTimeout = 0
|
||||
SqlAdapter.Fill(DSet)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
|
||||
263
Ashx/E140.ashx
Normal file
263
Ashx/E140.ashx
Normal file
@@ -0,0 +1,263 @@
|
||||
<%@ WebHandler Language="VB" Class="E140" %>
|
||||
|
||||
Imports System
|
||||
Imports System.Web
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Public Class E140 : Implements IHttpHandler, IRequiresSessionState
|
||||
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||
Get
|
||||
Return False
|
||||
End Get
|
||||
End Property
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
|
||||
Try
|
||||
Select Case context.Request("metodo")
|
||||
Case "MetasVendedores"
|
||||
MetasVendedores(context)
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Private Shared Sub MetasVendedores(ByVal context As HttpContext)
|
||||
|
||||
Dim CveEmpresa = 140
|
||||
Dim RutaEmpresa As String = String.Format("{0}Empresas\{1}\", DirectorioBaseEmpresas, CveEmpresa)
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
If ObjEmpresa.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||
End If
|
||||
|
||||
If ObjEmpresa.Empresa.RutaArchivos.Trim.Length > 0 Then
|
||||
RutaEmpresa = ObjEmpresa.Empresa.RutaArchivos.Trim
|
||||
End If
|
||||
|
||||
ObjEmpresa.Dispose()
|
||||
|
||||
Dim DTVendedores As System.Data.DataTable = New System.Data.DataTable()
|
||||
Dim Temporal As String = ""
|
||||
|
||||
Temporal = String.Format("{0}\Temp\", RutaEmpresa, CveEmpresa)
|
||||
Dim Empresa As String = "BDH BATERIAS DISTRIBUCIONES DE HERMOSILLO SA DE CV"
|
||||
|
||||
DTVendedores.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
DTVendedores.Columns.Add("Sucursal")
|
||||
DTVendedores.Columns.Add("Nombre")
|
||||
DTVendedores.Columns.Add("Correo")
|
||||
|
||||
Dim Row_11791 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11993 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11796 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11797 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11793 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_12010 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_12011 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11790 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11795 As DataRow = DTVendedores.NewRow
|
||||
Dim Row_11794 As DataRow = DTVendedores.NewRow
|
||||
|
||||
Row_11791("CveSubProyecto") = 11791
|
||||
Row_11791("Sucursal") = "SOLIDARIDAD"
|
||||
Row_11791("Nombre") = "Fernando grijalva López"
|
||||
Row_11791("Correo") = "hmo.martirezdecananea@bdhbaterias.com.mx"
|
||||
|
||||
Row_11993("CveSubProyecto") = 11993
|
||||
Row_11993("Sucursal") = "PROGRESO"
|
||||
Row_11993("Nombre") = "Brayam Uriel Corrales Soto"
|
||||
Row_11993("Correo") = "cajaprogreso.hmo@bdhbaterias.com"
|
||||
|
||||
Row_11796("CveSubProyecto") = 11796
|
||||
Row_11796("Sucursal") = "OBREGON"
|
||||
Row_11796("Nombre") = "Brayam Uriel Corrales Soto"
|
||||
Row_11796("Correo") = "cen.pisocentro@bdhbaterias.mx"
|
||||
|
||||
Row_11797("CveSubProyecto") = 11797
|
||||
Row_11797("Sucursal") = "NAVOJOA"
|
||||
Row_11797("Nombre") = "Orlando Lagarda Cantú"
|
||||
Row_11797("Correo") = "almacen.nvj@bdhbaterias.mx"
|
||||
|
||||
Row_11793("CveSubProyecto") = 11793
|
||||
Row_11793("Sucursal") = "LOMA LINDA"
|
||||
Row_11793("Nombre") = "Adrian fernando murrieta Rodríguez"
|
||||
Row_11793("Correo") = "adrian.murrieta@bdhbaterias.com"
|
||||
|
||||
Row_12010("CveSubProyecto") = 12010
|
||||
Row_12010("Sucursal") = "LOS NOGALES"
|
||||
Row_12010("Nombre") = "GERMAN LUNA CASTRO"
|
||||
Row_12010("Correo") = ""
|
||||
|
||||
Row_12011("CveSubProyecto") = 12011
|
||||
Row_12011("Sucursal") = "NOGALES CENTRO"
|
||||
Row_12011("Nombre") = "GERMAN LUNA CASTRO"
|
||||
Row_12011("Correo") = "german.luna@bdhbaterias.com"
|
||||
|
||||
Row_11790("CveSubProyecto") = 11790
|
||||
Row_11790("Sucursal") = "MATRIZ"
|
||||
Row_11790("Nombre") = "Luis Fernando grijalva cota"
|
||||
Row_11790("Correo") = "luis.grijalva@bdhbaterias.com"
|
||||
|
||||
|
||||
Row_11795("CveSubProyecto") = 11795
|
||||
Row_11795("Sucursal") = "GUAYMAS CENTRO"
|
||||
Row_11795("Nombre") = "Gastelum Hurtado Juan Daniel"
|
||||
Row_11795("Correo") = "daniel.gastelum@bdhbaterias.com"
|
||||
|
||||
Row_11794("CveSubProyecto") = 11794
|
||||
Row_11794("Sucursal") = "GUAYMAS AURORA"
|
||||
Row_11794("Nombre") = "Gastelum Hurtado Juan Daniel"
|
||||
Row_11794("Correo") = "daniel.gastelum@bdhbaterias.com"
|
||||
|
||||
DTVendedores.Rows.Add(Row_11791)
|
||||
DTVendedores.Rows.Add(Row_11993)
|
||||
DTVendedores.Rows.Add(Row_11796)
|
||||
DTVendedores.Rows.Add(Row_11797)
|
||||
DTVendedores.Rows.Add(Row_11793)
|
||||
DTVendedores.Rows.Add(Row_12010)
|
||||
DTVendedores.Rows.Add(Row_12011)
|
||||
DTVendedores.Rows.Add(Row_11790)
|
||||
DTVendedores.Rows.Add(Row_11795)
|
||||
DTVendedores.Rows.Add(Row_11794)
|
||||
|
||||
For Each dRow As System.Data.DataRow In DTVendedores.Rows
|
||||
|
||||
|
||||
Dim CorreoSupervisor As String = dRow("Correo").ToString()
|
||||
Dim Sucursal As String = dRow("Sucursal").ToString
|
||||
Dim Vendedor As String = dRow("Nombre").ToString()
|
||||
Dim CveSubProyecto As Integer = dRow("CveSubProyecto").ToString()
|
||||
|
||||
|
||||
CorreoSupervisor = "oscar.irigoyen@adssistemas.mx;rene.molina@adssistemas.mx"
|
||||
|
||||
Dim ObjGen = New ClsVentas
|
||||
|
||||
Dim RutaRDLC As String = If(File.Exists($"{RutaEmpresa}\Formatos\MetasVendedores.rdlc"), $"{RutaEmpresa}\Formatos\MetasVendedores.rdlc", $"{DirectorioBaseEmpresas}\Empresas\Grales\Formatos\MetasVendedores.rdlc")
|
||||
|
||||
If ObjGen.GetRepMetasVendedores(DateTime.Now, CveEmpresa, -1, -1, -1, -1, -1, CveSubProyecto, -1, -1, 0) Then
|
||||
|
||||
|
||||
Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", RutaEmpresa))
|
||||
Dim parametros As List(Of ReportParameter) = New List(Of ReportParameter)()
|
||||
parametros.Add(New ReportParameter("pEmp", Empresa))
|
||||
|
||||
If Imagen.Exists Then
|
||||
parametros.Add(New ReportParameter("pImg", $"file://{Imagen.FullName}"))
|
||||
Else
|
||||
parametros.Add(New ReportParameter("pImg", ""))
|
||||
End If
|
||||
|
||||
parametros.Add(New ReportParameter("UsuarioImprimio", "Sistema"))
|
||||
parametros.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
|
||||
parametros.Add(New ReportParameter("SubProyecto", Sucursal))
|
||||
parametros.Add(New ReportParameter("Agente", Vendedor))
|
||||
|
||||
Dim bytes As Byte() = Nothing
|
||||
|
||||
Dim rds1 As ReportDataSource = New ReportDataSource()
|
||||
rds1.Name = "DataSet1"
|
||||
rds1.Value = ObjGen.DtResultados
|
||||
|
||||
If EsProduccion Then
|
||||
|
||||
Dim wsreport As New WSRDLC2.WebServiceSoapClient
|
||||
Dim params As New List(Of WSRDLC2.ReportParameter)
|
||||
Dim reportobjects As New List(Of WSRDLC2.ReportObjects)
|
||||
|
||||
Dim jsonData As String = Nothing
|
||||
Dim ds As New DataSet
|
||||
|
||||
Dim dt As DataTable = DirectCast(rds1.Value, Data.DataTable)
|
||||
dt = dt.Copy()
|
||||
dt.TableName = rds1.Name
|
||||
ds.Tables.Add(dt)
|
||||
|
||||
For Each rpds As ReportParameter In parametros
|
||||
Dim param As New WSRDLC2.ReportParameter
|
||||
param.Name = rpds.Name
|
||||
'SI ES TEXTO, QUITAR TABS Y OTROS ESPACIOS QUE DEN PROBLEMAS AL MANDAR LA PETICION
|
||||
If rpds IsNot Nothing AndAlso rpds.Values IsNot Nothing AndAlso rpds.Values.Count > 0 AndAlso rpds.Values(0) IsNot Nothing AndAlso rpds.Values(0).GetType() = GetType(String) Then
|
||||
param.Values = {rpds.Values(0).Replace(vbVerticalTab, "")}
|
||||
Else
|
||||
param.Values = {rpds.Values(0)}
|
||||
End If
|
||||
params.Add(param)
|
||||
Next
|
||||
|
||||
bytes = wsreport.StreamNEWPDFBytes(RutaRDLC, ds, reportobjects.ToArray(), params.ToArray(), "MetasVendedores", "PDF", CveEmpresa, 100, jsonData)
|
||||
wsreport = Nothing
|
||||
params = Nothing
|
||||
ds.Dispose() : ds = Nothing
|
||||
|
||||
Else
|
||||
|
||||
Using MR As ReportViewer = New ReportViewer()
|
||||
|
||||
MR.LocalReport.DataSources.Add(rds1)
|
||||
MR.LocalReport.ReportPath = RutaRDLC
|
||||
MR.ProcessingMode = ProcessingMode.Local
|
||||
MR.LocalReport.EnableExternalImages = True
|
||||
MR.LocalReport.SetParameters(parametros)
|
||||
MR.LocalReport.Refresh()
|
||||
Dim warnings As Warning() = Nothing
|
||||
Dim streamids As String() = Nothing
|
||||
Dim mimeType As String = Nothing
|
||||
Dim encoding As String = Nothing
|
||||
Dim extension As String = Nothing
|
||||
|
||||
bytes = MR.LocalReport.Render("PDF", Nothing, mimeType, encoding, extension, streamids, warnings)
|
||||
|
||||
End Using
|
||||
|
||||
End If
|
||||
|
||||
MandaCorreo(CorreoSupervisor, $"Envió de estado de scorecard sucursal {Sucursal} a {Now.ToString("dd/MM/yyyy")}", bytes)
|
||||
bytes = Nothing
|
||||
|
||||
End If
|
||||
|
||||
ObjGen.Dispose()
|
||||
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Shared Sub MandaCorreo(Para As String, Cuerpo As String, bytes As Byte())
|
||||
Try
|
||||
Dim ListaArchivos As List(Of ClsSisMail.ArchivoMail) = New List(Of ClsSisMail.ArchivoMail)()
|
||||
|
||||
Dim AdjuntoReporte As ClsSisMail.ArchivoMail = New ClsSisMail.ArchivoMail()
|
||||
|
||||
AdjuntoReporte.NombreArchivo = "MetasVendedores.Pdf"
|
||||
AdjuntoReporte.ArchivoBinario = bytes
|
||||
ListaArchivos.Add(AdjuntoReporte)
|
||||
|
||||
Dim Correo As ClsSisMail = New ClsSisMail()
|
||||
|
||||
Dim Asunto As String = Cuerpo
|
||||
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:=ListaArchivos)
|
||||
|
||||
Catch ex As Exception
|
||||
Extensiones.ModExtensiones.GuardaLog(Nothing, $"Error Tareas Programadas 140 error enviar mail --> {ex.Message} ")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Public Shared ReadOnly Property EsProduccion As Boolean
|
||||
Get
|
||||
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
||||
Return False
|
||||
Else
|
||||
Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
@@ -1010,6 +1010,14 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
If CveIE < 0 Then
|
||||
MsgError = "No se pudo registrar movimiento bancario"
|
||||
Exit For
|
||||
Else
|
||||
|
||||
If tFolio > 0 Then
|
||||
FolioIE = tFolio
|
||||
Else
|
||||
FolioIE = ObjIE.Folio
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -2421,7 +2429,7 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
End If
|
||||
|
||||
Folio = FolioExcel
|
||||
ImporteDocumento = IIf(Row("Abono").ToString.ToDecimal > 0, Row("Abono").ToString.ToDecimal, Row("Cargo").ToString.ToDecimal)
|
||||
ImporteDocumento = IIf(Row("Abono").ToString.ToDecimal <> 0, Row("Abono").ToString.ToDecimal, Row("Cargo").ToString.ToDecimal)
|
||||
Observaciones = Row("Referencia").ToString
|
||||
Beneficiario = Row("Concepto").ToString
|
||||
|
||||
|
||||
Reference in New Issue
Block a user