Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -4145,16 +4145,21 @@ Public Class ClsContabilidad
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetAnexoCatalogoAnual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Public Function GetAnexoCatalogoAnual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, EjercicioFinal As Integer, Divisor As Integer, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_AnexoCatalogoAnualGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
|
||||
.Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@EjercicioFinal", SqlDbType.Int).Value = EjercicioFinal
|
||||
.Add("@Divisor", SqlDbType.Int).Value = Divisor
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -17,6 +17,16 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public 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
|
||||
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
Dim retorno As String = "no se encontro la variable"
|
||||
|
||||
@@ -34,7 +44,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
Dim ListaDS = New List(Of ReportDataSource)
|
||||
Dim Parametros As New List(Of ReportParameter)
|
||||
|
||||
Dim Formato = context.ModExtensiones.DirectorioBaseEmpresas + "Empresas/1/Report.rdlc"
|
||||
Dim Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPI.rdlc"
|
||||
|
||||
Parametros.Add(New ReportParameter("Empresa", datos.Empresa.Empresa))
|
||||
Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC))
|
||||
@@ -49,20 +59,20 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
Parametros.Add(New ReportParameter("ImporteLetra", datos.Factura.Total.Texto2Letras()))
|
||||
Parametros.Add(New ReportParameter("FormaPago", datos.Factura.FormaPago))
|
||||
Parametros.Add(New ReportParameter("MetodoPago", datos.Factura.MetodoPago))
|
||||
Parametros.Add(New ReportParameter("SelloCFDI", ""))
|
||||
Parametros.Add(New ReportParameter("SelloSAT", ""))
|
||||
Parametros.Add(New ReportParameter("CadenaOriginal", ""))
|
||||
Parametros.Add(New ReportParameter("SelloCFDI", datos.Timbrado.SelloCFDI))
|
||||
Parametros.Add(New ReportParameter("SelloSAT", datos.Timbrado.SelloSAT))
|
||||
Parametros.Add(New ReportParameter("CadenaOriginal", datos.Timbrado.CadenaOriginal))
|
||||
Parametros.Add(New ReportParameter("FolioFiscal", datos.Factura.UUID))
|
||||
Parametros.Add(New ReportParameter("SerieCertificadoSAT", ""))
|
||||
Parametros.Add(New ReportParameter("FechaCertificado", ""))
|
||||
Parametros.Add(New ReportParameter("CertificadoContribuyente", ""))
|
||||
Parametros.Add(New ReportParameter("SerieCertificadoSAT", datos.Timbrado.SerieCertificadoSAT))
|
||||
Parametros.Add(New ReportParameter("FechaCertificado", datos.Timbrado.FechaCertificado))
|
||||
Parametros.Add(New ReportParameter("CertificadoContribuyente", datos.Timbrado.CertificadoContribuyente))
|
||||
Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI))
|
||||
Parametros.Add(New ReportParameter("Vencimiento", Now.AddDays(30)))
|
||||
Parametros.Add(New ReportParameter("Vencimiento", datos.Factura.FechaVencimiento))
|
||||
Parametros.Add(New ReportParameter("SubTotal", datos.Factura.SubTotal))
|
||||
Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA))
|
||||
Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS))
|
||||
Parametros.Add(New ReportParameter("Total", datos.Factura.Total))
|
||||
Parametros.Add(New ReportParameter("QR", ""))
|
||||
Parametros.Add(New ReportParameter("QR", datos.Timbrado.QR))
|
||||
|
||||
Dim DtDatos As New DataTable
|
||||
DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
@@ -85,9 +95,10 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
|
||||
DtDatos.Rows.Add(Row)
|
||||
Next
|
||||
|
||||
ListaDS.Add(New ReportDataSource("DsProductos", DtDatos))
|
||||
|
||||
ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "test")
|
||||
ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "Factura")
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -97,48 +108,87 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte()
|
||||
'limpio ReportViwer
|
||||
Dim sw As New System.Diagnostics.Stopwatch()
|
||||
sw.Start()
|
||||
|
||||
If IsNothing(MR) Then MR = New ReportViewer
|
||||
Dim Bytes As Byte() = Nothing
|
||||
Try
|
||||
' MasterReporteador.LocalReport.DataSources.Clear()
|
||||
For Each RDS As ReportDataSource In DataSource
|
||||
MR.LocalReport.DataSources.Add(RDS)
|
||||
Next
|
||||
|
||||
MR.LocalReport.ReportPath = RutaReporte
|
||||
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(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
|
||||
Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException
|
||||
GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
|
||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
||||
'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
||||
Catch ex As Exception
|
||||
GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
|
||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
||||
'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
||||
End Try
|
||||
|
||||
sw.Stop()
|
||||
If sw.Elapsed.TotalSeconds > 10 Then
|
||||
GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
|
||||
End If
|
||||
|
||||
Return Bytes
|
||||
Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte()
|
||||
'limpio ReportViwer
|
||||
Dim sw As New System.Diagnostics.Stopwatch()
|
||||
sw.Start()
|
||||
Dim Bytes As Byte() = Nothing
|
||||
|
||||
Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory)
|
||||
RutaReporte.Replace("/", "\")
|
||||
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
|
||||
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
|
||||
End If
|
||||
|
||||
If EsProduccion Then
|
||||
|
||||
Dim CveUsuario As Integer = 0
|
||||
Dim CveEmpresa As Integer = 0
|
||||
|
||||
Dim wsreport As New WSRDLC.WebServiceSoapClient
|
||||
Dim params As New List(Of WSRDLC.ReportParameter)
|
||||
Dim ds As New DataSet
|
||||
For Each rpds As ReportDataSource In DataSource
|
||||
Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable)
|
||||
If dt Is Nothing Then
|
||||
dt = New DataTable()
|
||||
Else
|
||||
dt = dt.Copy()
|
||||
End If
|
||||
dt.TableName = rpds.Name
|
||||
ds.Tables.Add(dt)
|
||||
Next
|
||||
For Each rpds As ReportParameter In Parametros
|
||||
Dim param As New WSRDLC.ReportParameter
|
||||
param.Name = rpds.Name
|
||||
param.Values = {rpds.Values(0)}
|
||||
params.Add(param)
|
||||
Next
|
||||
Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario)
|
||||
wsreport = Nothing
|
||||
params = Nothing
|
||||
Else
|
||||
If IsNothing(MR) Then MR = New ReportViewer
|
||||
Try
|
||||
' MasterReporteador.LocalReport.DataSources.Clear()
|
||||
For Each RDS As ReportDataSource In DataSource
|
||||
MR.LocalReport.DataSources.Add(RDS)
|
||||
Next
|
||||
|
||||
MR.LocalReport.ReportPath = RutaReporte
|
||||
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(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
|
||||
Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException
|
||||
GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
|
||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
||||
'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
||||
Catch ex As Exception
|
||||
GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
|
||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
||||
'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
||||
End Try
|
||||
MR.Dispose()
|
||||
|
||||
End If
|
||||
sw.Stop()
|
||||
|
||||
If sw.Elapsed.TotalSeconds > 5 Then
|
||||
GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
|
||||
End If
|
||||
|
||||
Return Bytes
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Sub ImprimirbytesPDF(ByVal context As HttpContext, bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False)
|
||||
'limpio ReportViwer
|
||||
Dim mimeType As String = Nothing
|
||||
@@ -181,6 +231,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
Public Property CveCliente As Integer
|
||||
Public Property NombreCliente As String
|
||||
Public Property Fecha As DateTime
|
||||
Public Property FechaVencimiento As DateTime
|
||||
Public Property CveSubCentroCosto As Integer
|
||||
Public Property CveTipoDocumento As Integer
|
||||
Public Property TipoDocumento As String
|
||||
@@ -271,10 +322,21 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
||||
Public Property RegimenFiscal As String
|
||||
End Class
|
||||
|
||||
Public Class DatosSATWS
|
||||
Public Property SelloCFDI As String
|
||||
Public Property SelloSAT As String
|
||||
Public Property CadenaOriginal As String
|
||||
Public Property SerieCertificadoSAT As String
|
||||
Public Property FechaCertificado As String
|
||||
Public Property CertificadoContribuyente As String
|
||||
Public Property QR As String
|
||||
End Class
|
||||
|
||||
Public Class ParametroWS
|
||||
Public Property Factura As FacturaWS
|
||||
Public Property Cliente As ClienteWS
|
||||
Public Property Empresa As EmpresaWS
|
||||
Public Property Timbrado As DatosSATWS
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -11,40 +11,64 @@ Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports Modelos
|
||||
|
||||
Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
Private Property CveEmpresaFacturar As Integer = 143
|
||||
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
context.Response.ContentType = "application/json"
|
||||
Try
|
||||
If context.Request.InputStream IsNot Nothing Then
|
||||
Using reader As New StreamReader(context.Request.InputStream)
|
||||
Dim json = reader.ReadToEnd
|
||||
context.Response.ContentType = "text/plain"
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
If Not String.IsNullOrEmpty(json) Then
|
||||
Dim JsonRequest As JObject = JObject.Parse(json)
|
||||
If JsonRequest IsNot Nothing Then
|
||||
Dim Metodo = JsonRequest("Metodo").ToString()
|
||||
If Metodo = "FactMasivaRemisiones" Then
|
||||
Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
|
||||
Dim pFechaI As String = ""
|
||||
Dim pFechaF As String = ""
|
||||
|
||||
If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
|
||||
pFechaI = JsonRequest("FechaI")
|
||||
pFechaF = JsonRequest("FechaF")
|
||||
End If
|
||||
|
||||
IniciaFacturacionMasiva(context, pCveEmpresa, pFechaI, pFechaF)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Using
|
||||
Try
|
||||
'If context.Request.InputStream IsNot Nothing Then
|
||||
' Using reader As New StreamReader(context.Request.InputStream)
|
||||
' Dim json = reader.ReadToEnd
|
||||
|
||||
' If Not String.IsNullOrEmpty(json) Then
|
||||
' Dim JsonRequest As JObject = JObject.Parse(json)
|
||||
' If JsonRequest IsNot Nothing Then
|
||||
' Dim Metodo = JsonRequest("Metodo").ToString()
|
||||
' If Metodo = "FactMasivaRemisiones" Then
|
||||
' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
|
||||
' Dim pFechaI As String = ""
|
||||
' Dim pFechaF As String = ""
|
||||
|
||||
' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
|
||||
' pFechaI = JsonRequest("FechaI")
|
||||
' pFechaF = JsonRequest("FechaF")
|
||||
' End If
|
||||
|
||||
' IniciaFacturacionMasiva(context, CveEmpresaFacturar, pFechaI, pFechaF)
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End Using
|
||||
'End If
|
||||
|
||||
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
|
||||
If Metodo = "FactMasivaRemisiones" Then
|
||||
Dim pFechaI As String = ""
|
||||
Dim pFechaF As String = ""
|
||||
|
||||
If context.Request("FechaI") IsNot Nothing AndAlso context.Request("FechaF") IsNot Nothing Then
|
||||
pFechaI = context.Request("FechaI")
|
||||
pFechaF = context.Request("FechaF")
|
||||
End If
|
||||
|
||||
Retorno = IniciaFacturacionMasiva(CveEmpresaFacturar, pFechaI, pFechaF)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ex.GuardaLog(ex.Message)
|
||||
End Try
|
||||
End Try
|
||||
|
||||
If Retorno Then
|
||||
context.Response.Write("True")
|
||||
Else
|
||||
context.Response.Write("False")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||
@@ -53,7 +77,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub IniciaFacturacionMasiva(ByVal context As HttpContext, pCveEmpresa As String, pFechaI As String, pFechaF As String)
|
||||
Private Function IniciaFacturacionMasiva(pCveEmpresa As String, pFechaI As String, pFechaF As String) As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
Dim JsonRetorno As New JObject()
|
||||
Dim CveEmpresa As Integer = pCveEmpresa.ToEntero()
|
||||
If CveEmpresa > 0 Then
|
||||
@@ -71,7 +96,10 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
FechaI = New DateTime(DomingoAnterior.Year, DomingoAnterior.Month, DomingoAnterior.Day, 0, 0, 0)
|
||||
FechaF = New DateTime(Sabado.Year, Sabado.Month, Sabado.Day, 23, 59, 59)
|
||||
|
||||
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
|
||||
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
|
||||
Else
|
||||
Retorno = False
|
||||
GuardaLogFacturacion("Ejecución no permitida, no es el dia permitido para ejecucion o no se espeficaron las fechas")
|
||||
End If
|
||||
Else
|
||||
FechaI = pFechaI.ToDateTime()
|
||||
@@ -79,11 +107,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
context.Response.Write(JsonRetorno)
|
||||
End Sub
|
||||
End If
|
||||
|
||||
GuardaLogFacturacion("Ejecución Exitosa, se generaron las siguientes facturas:")
|
||||
GuardaLogFacturacion(JsonRetorno.ToString())
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime
|
||||
|
||||
@@ -6546,9 +6546,11 @@ Partial Class Compras_Compras
|
||||
'SumatoriaOCINV = -SumatoriaOCINV
|
||||
|
||||
Dim CveClasificacionCostoOC = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -6587,6 +6589,8 @@ Partial Class Compras_Compras
|
||||
|
||||
If RegistraConcepto225 Then
|
||||
|
||||
|
||||
|
||||
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
@@ -6635,13 +6639,18 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 ").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
|
||||
|
||||
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
Else
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -19510,6 +19519,8 @@ Partial Class Compras_Compras
|
||||
'' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||
|
||||
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
|
||||
If DiferenciaInvOC.RoundSQL() <> 0 Then
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePoliza > 0 Then
|
||||
@@ -19521,14 +19532,14 @@ Partial Class Compras_Compras
|
||||
Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, ConceptoPartida, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, ConceptoPartida, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then
|
||||
Retorno = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, ConceptoPartida, Fecha, IdCtaContableRecepcionOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, ConceptoPartida, Fecha, IdCtaContableRecepcionOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, IdCtaContable69, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC) Then
|
||||
If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, IdCtaContable69, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC, CveSubProyecto:=CveSubProyecto) Then
|
||||
Retorno = False
|
||||
Exit For
|
||||
End If
|
||||
@@ -19542,7 +19553,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
Else
|
||||
'2018.11.24 se cambia concepto 177, de cargo a abono negativo., petición MALL
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), ConceptoPartida, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), ConceptoPartida, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, SerieFolio, 176, ConceptoPartida, Fecha, IdCtaContableRecepcionOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
Retorno = False
|
||||
Exit For
|
||||
|
||||
@@ -28,11 +28,14 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
|
||||
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
|
||||
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
|
||||
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
|
||||
DivisorParametro = IfNull(Request("D"), "-1").ToString.ToEntero
|
||||
Dim EjercicioParametro, EjercicioParametroFinal, SubProyectoParametro, DivisorParametro As Integer
|
||||
|
||||
CveCuenta = IfNull(Request("CveCuenta"), "-1").ToString.ToEntero
|
||||
EjercicioParametro = IfNull(Request("Ejercicio"), "-1").ToString.ToEntero
|
||||
EjercicioParametroFinal = IfNull(Request("Ejerciciofinal"), "-1").ToString.ToEntero
|
||||
SubProyectoParametro = IfNull(Request("CveSubproyecto"), "-1").ToString.ToEntero
|
||||
DivisorParametro = IfNull(Request("Divisor"), "-1").ToString.ToEntero
|
||||
|
||||
EsVertical = IfNull(Request("V"), "-1").ToString.ToEntero
|
||||
|
||||
InicializaValores()
|
||||
|
||||
@@ -557,7 +557,8 @@
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>' Width="238px" ></asp:Label>
|
||||
<%--<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>' Width="238px" ></asp:Label>--%>
|
||||
<asp:HyperLink ID="HLNombre" runat="server" Text='<%# Eval("Nombre")%>' CssClass="Texto" Target="_blank" ></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
<HeaderTemplate>
|
||||
@@ -609,7 +610,8 @@
|
||||
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>' Width="238px"></asp:Label>
|
||||
<%--<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>' Width="238px"></asp:Label>--%>
|
||||
<asp:HyperLink ID="HLNombre" runat="server" Text='<%# Eval("Nombre")%>' CssClass="Texto" Target="_blank" ></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
<HeaderTemplate>
|
||||
|
||||
@@ -294,8 +294,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
End If
|
||||
|
||||
If Tab.ActiveTabIndex = 2 Then
|
||||
ValidaEjercicios()
|
||||
|
||||
ValidaEjercicios()
|
||||
|
||||
LiSubProyectoDdl.Visible = True
|
||||
LiSubProyectoLbl.Visible = True
|
||||
@@ -418,6 +418,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1272,6 +1274,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
||||
|
||||
e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto=-1"
|
||||
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
@@ -1327,7 +1330,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero
|
||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
||||
|
||||
|
||||
e.Row.FCHyperLink("HLNombre").NavigateUrl = $"./RepAnexoCatalogoAnual.aspx?CveCuenta={e.Row.DBCampo("CveCuenta").ToString}&Ejercicio={DdlEjercicio.SelectedValue}&Divisor={DdlDivisor.SelectedValue}&CveSubProyecto=-1"
|
||||
Dim CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||
Dim IndiceInicio As Integer = 1
|
||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||
@@ -1711,29 +1714,22 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
#Region "DESCARGA EXCEL"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
|
||||
Imprimir("Excel")
|
||||
|
||||
End Sub
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
|
||||
|
||||
|
||||
If Tab.ActiveTabIndex = 0 Then
|
||||
If Tab.ActiveTabIndex = 0 AndAlso GvIngresosMes.Rows.Count > 0 Then
|
||||
ExportToExcelG(GvIngresosMes, GvGastosMes, TMesT1, "Reporte_Mensual", UsuarioActual, "Mensual")
|
||||
ElseIf Tab.ActiveTabIndex = 1 Then
|
||||
ElseIf Tab.ActiveTabIndex = 1 AndAlso GvIngresosMesH.Rows.Count > 0 Then
|
||||
ExportToExcelG(GvIngresosMesH, GvGastosMesH, TMesT1, "Reporte_Mensual_Horizontal", UsuarioActual, "Mensual Horizontal", Gv3:=GvTotalesMesH)
|
||||
ElseIf Tab.ActiveTabIndex = 2 Then
|
||||
ElseIf Tab.ActiveTabIndex = 2 AndAlso GvIngresosAnualH.Rows.Count > 0 Then
|
||||
ExportToExcelG(GvIngresosAnualH, GvGastosAnualH, TMesT1, "Reporte_Anual_Horizontal", UsuarioActual, "Anual Horizontal", Gv3:=GvTotalesAnualH)
|
||||
|
||||
ElseIf Tab.ActiveTabIndex = 3 Then
|
||||
ElseIf Tab.ActiveTabIndex = 3 AndAlso GvIngresosSubProyectoH.Rows.Count > 0 Then
|
||||
ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, "Proyecto Horizontal", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
'Public Sub ExportToExcelG(Gv1 As GridView, Gv2 As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100)
|
||||
@@ -1807,6 +1803,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
||||
|
||||
Dim HtmlCompleto As String = myStr1 & "<br>" & myStr2 & "<br>" & myStr3
|
||||
|
||||
|
||||
HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
|
||||
|
||||
Dim asd As String = ""
|
||||
|
||||
|
||||
|
||||
3710
Empresas/Grales/ReporteAPI.rdlc
Normal file
3710
Empresas/Grales/ReporteAPI.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2016,9 +2016,19 @@ Partial Class Inventarios_EntradasSalidas
|
||||
DdlConcepto.Items.Insert(0, New ListItem("Entrada Almacen ", "2"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 72 AndAlso CveTipoAlmacen.Contiene(14, 19) AndAlso UsuarioActual.CveUsuario = 2185 Then
|
||||
|
||||
'DdlConcepto.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlConcepto.Items.Add(New ListItem("Entrada por Ajuste", "32"))
|
||||
DdlConcepto.Items.Add(New ListItem("Salida por Ajuste", "34"))
|
||||
|
||||
End If
|
||||
|
||||
DdlConcepto.SelectedValue = "-1"
|
||||
ddlConcepto_SelectedIndexChanged(DdlConcepto, EventArgs.Empty)
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ddlConcepto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConcepto.SelectedIndexChanged
|
||||
|
||||
@@ -104,7 +104,9 @@ Partial Class Inventarios_PrestamosdeProveedor
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
||||
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If GvD.Rows.Count > 0 Then
|
||||
|
||||
'Valida Movimientos
|
||||
@@ -132,11 +134,11 @@ Partial Class Inventarios_PrestamosdeProveedor
|
||||
If Not ValidaMovtos > 0 Then
|
||||
Alert("No hay movimientos que realizar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
|
||||
Dim CveMovimientoEntrada As Integer = 0
|
||||
@@ -190,14 +192,22 @@ Partial Class Inventarios_PrestamosdeProveedor
|
||||
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = 29").ToEntero
|
||||
If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
|
||||
|
||||
Dim CveConceptoContable As Integer = 69
|
||||
Dim CveConceptoContable As Integer = 69
|
||||
' Dim CveSubProyecto As Integer = 0
|
||||
Dim CveSubProyecto As Integer = -1
|
||||
If ObjInventario.GetAlmacenes(-1, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
CveSubProyecto = ObjInventario.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero } ").FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS))
|
||||
IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=-tValorInventario) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=-tValorInventario, CveSubProyecto:=CveSubProyecto) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -2163,7 +2163,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
Dim CveMovimiento As Integer
|
||||
Dim CveMovimientoOriginal As Integer
|
||||
' Dim CveMovimientoS
|
||||
|
||||
'Dim CveMovimientoS
|
||||
|
||||
Dim InvFolio As String = ""
|
||||
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
||||
@@ -2172,6 +2173,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim MensajeError = ""
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
|
||||
Dim ObjBitacora As New ClsOIEventos(ObjInventario.IniciaTransacSQL())
|
||||
Dim ObjCompras As New ClsCompras(ObjInventario.IniciaTransacSQL())
|
||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||
@@ -2896,13 +2898,17 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen-NC", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePoliza > 0 Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalNC, SerieFolio, CveConceptoContableNC, SerieFolio, Fecha, IdCtaContableNC, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalNC, Contabilizable:=EsContabilizable) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, TotalCosto * -1, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=TotalCosto * -1, CveCuenta:=CveCuentaAlmacen, Contabilizable:=EsContabilizable) Then
|
||||
If DifCostoNC <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, CveCuenta:=CveCuentaClasificacion, Contabilizable:=EsContabilizable) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifCostoNC * -1, SerieFolio, 69, SerieFolio, Fecha, IdCtaContableClasificacion, -1, CveClasificacion:=CveClasificacionDifCostoNC, CveCompra:=CveCompraSurtir, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DifCostoNC * -1, CveCuenta:=CveCuentaClasificacion, Contabilizable:=EsContabilizable, CveSubProyecto:=CveSubProyecto) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
@@ -2917,6 +2923,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPNC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
|
||||
@@ -2769,7 +2769,10 @@ Partial Class OC
|
||||
' TieneError = True
|
||||
' Exit For
|
||||
'End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -2787,7 +2790,7 @@ Partial Class OC
|
||||
'2018.11.24 se cambia concepto 176, de cargo a abono negativo., petición MALL
|
||||
'2019.03.26 se cambia concepto 177, de abono a cargo., petición MALL
|
||||
'2019.04.10 se cambia concepto 177, de cargo a abono., petición MALL
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCER), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveCuenta:=CveCuentaAlmacen, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, SerieFolio, 176, SerieFolio, Fecha, IdCtaContableRecepcionOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
|
||||
Reference in New Issue
Block a user