Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -4119,16 +4119,21 @@ Public Class ClsContabilidad
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
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
|
Dim Retorno = False
|
||||||
|
|
||||||
DataAdapter("PA_Conta_AnexoCatalogoAnualGet")
|
DataAdapter("PA_Conta_AnexoCatalogoAnualGet")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||||
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
|
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
|
||||||
.Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto
|
.Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.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
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -279,6 +279,12 @@ Public Class ClsPaginas
|
|||||||
End Property
|
End Property
|
||||||
Property GlobalDTPSATPS() As DataTable
|
Property GlobalDTPSATPS() As DataTable
|
||||||
Get
|
Get
|
||||||
|
If Application("GlobalDTPSATPS") Is Nothing Then
|
||||||
|
Dim ObjGrales As New ClsGenerales
|
||||||
|
If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
|
||||||
|
ObjGrales.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
@@ -353,6 +359,12 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
|
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
|
||||||
Get
|
Get
|
||||||
|
If Application("GlobalDTEstado") Is Nothing Then
|
||||||
|
Dim ObjGrales As New ClsGenerales
|
||||||
|
If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
|
||||||
|
ObjGrales.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
If ClaveSATPais <> "-1" Then
|
If ClaveSATPais <> "-1" Then
|
||||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTEstado = Dv.ToTable
|
GlobalDTEstado = Dv.ToTable
|
||||||
@@ -369,6 +381,12 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable
|
Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable
|
||||||
Get
|
Get
|
||||||
|
If Application("GlobalDTMunicipio") Is Nothing Then
|
||||||
|
Dim ObjGrales As New ClsGenerales
|
||||||
|
If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
|
||||||
|
ObjGrales.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
If ClaveSATEstado <> "-1" Then
|
If ClaveSATEstado <> "-1" Then
|
||||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTMunicipio = Dv.ToTable
|
GlobalDTMunicipio = Dv.ToTable
|
||||||
@@ -385,6 +403,12 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable
|
Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable
|
||||||
Get
|
Get
|
||||||
|
If Application("GlobalDTColonia") Is Nothing Then
|
||||||
|
Dim ObjGrales As New ClsGenerales
|
||||||
|
If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
|
||||||
|
ObjGrales.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
If ClaveSATMunicipio <> "-1" Then
|
If ClaveSATMunicipio <> "-1" Then
|
||||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows)
|
Dim Dv As New DataView(DirectCast(Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows)
|
||||||
GlobalDTColonia = Dv.ToTable
|
GlobalDTColonia = Dv.ToTable
|
||||||
@@ -403,6 +427,11 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
Property GlobalDTPSATUM() As DataTable
|
Property GlobalDTPSATUM() As DataTable
|
||||||
Get
|
Get
|
||||||
|
If Application("GlobalDTPSATUM") Is Nothing Then
|
||||||
|
Dim ObjGrales As New ClsGenerales
|
||||||
|
If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing
|
||||||
|
ObjGrales.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
'System.Data.EnumerableRowCollection
|
'System.Data.EnumerableRowCollection
|
||||||
If Not IsNothing(Application("GlobalDTPSATUM")) Then
|
If Not IsNothing(Application("GlobalDTPSATUM")) Then
|
||||||
@@ -8129,7 +8158,8 @@ Public Class ClsPaginas
|
|||||||
Dim dtsec As DataTable = GlobalDTInvPSSeccionesAlmacen(CveEmpresa, CveAlmacen, CvePS)
|
Dim dtsec As DataTable = GlobalDTInvPSSeccionesAlmacen(CveEmpresa, CveAlmacen, CvePS)
|
||||||
DdlSeccionAlmacen.DataSource = dtsec
|
DdlSeccionAlmacen.DataSource = dtsec
|
||||||
DdlSeccionAlmacen.DataBind()
|
DdlSeccionAlmacen.DataBind()
|
||||||
If dtsec.Rows.Count = 1 Then
|
If dtsec Is Nothing Then Exit Sub
|
||||||
|
If dtsec.Rows.Count = 1 Then
|
||||||
DdlSeccionAlmacen.SelectedIndex = 0
|
DdlSeccionAlmacen.SelectedIndex = 0
|
||||||
DdlSeccionAlmacen.Enabled = False
|
DdlSeccionAlmacen.Enabled = False
|
||||||
Else 'si es mayor a uno que por default seleccione el primero, que seria el predeterminado
|
Else 'si es mayor a uno que por default seleccione el primero, que seria el predeterminado
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
Dim retorno As String = "no se encontro la variable"
|
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 ListaDS = New List(Of ReportDataSource)
|
||||||
Dim Parametros As New List(Of ReportParameter)
|
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("Empresa", datos.Empresa.Empresa))
|
||||||
Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC))
|
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("ImporteLetra", datos.Factura.Total.Texto2Letras()))
|
||||||
Parametros.Add(New ReportParameter("FormaPago", datos.Factura.FormaPago))
|
Parametros.Add(New ReportParameter("FormaPago", datos.Factura.FormaPago))
|
||||||
Parametros.Add(New ReportParameter("MetodoPago", datos.Factura.MetodoPago))
|
Parametros.Add(New ReportParameter("MetodoPago", datos.Factura.MetodoPago))
|
||||||
Parametros.Add(New ReportParameter("SelloCFDI", ""))
|
Parametros.Add(New ReportParameter("SelloCFDI", datos.Timbrado.SelloCFDI))
|
||||||
Parametros.Add(New ReportParameter("SelloSAT", ""))
|
Parametros.Add(New ReportParameter("SelloSAT", datos.Timbrado.SelloSAT))
|
||||||
Parametros.Add(New ReportParameter("CadenaOriginal", ""))
|
Parametros.Add(New ReportParameter("CadenaOriginal", datos.Timbrado.CadenaOriginal))
|
||||||
Parametros.Add(New ReportParameter("FolioFiscal", datos.Factura.UUID))
|
Parametros.Add(New ReportParameter("FolioFiscal", datos.Factura.UUID))
|
||||||
Parametros.Add(New ReportParameter("SerieCertificadoSAT", ""))
|
Parametros.Add(New ReportParameter("SerieCertificadoSAT", datos.Timbrado.SerieCertificadoSAT))
|
||||||
Parametros.Add(New ReportParameter("FechaCertificado", ""))
|
Parametros.Add(New ReportParameter("FechaCertificado", datos.Timbrado.FechaCertificado))
|
||||||
Parametros.Add(New ReportParameter("CertificadoContribuyente", ""))
|
Parametros.Add(New ReportParameter("CertificadoContribuyente", datos.Timbrado.CertificadoContribuyente))
|
||||||
Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI))
|
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("SubTotal", datos.Factura.SubTotal))
|
||||||
Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA))
|
Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA))
|
||||||
Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS))
|
Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS))
|
||||||
Parametros.Add(New ReportParameter("Total", datos.Factura.Total))
|
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
|
Dim DtDatos As New DataTable
|
||||||
DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||||
@@ -85,9 +95,10 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
|||||||
|
|
||||||
DtDatos.Rows.Add(Row)
|
DtDatos.Rows.Add(Row)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
ListaDS.Add(New ReportDataSource("DsProductos", DtDatos))
|
ListaDS.Add(New ReportDataSource("DsProductos", DtDatos))
|
||||||
|
|
||||||
ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "test")
|
ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "Factura")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -97,48 +108,87 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
|||||||
|
|
||||||
End Sub
|
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()
|
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
|
'limpio ReportViwer
|
||||||
Dim sw As New System.Diagnostics.Stopwatch()
|
Dim sw As New System.Diagnostics.Stopwatch()
|
||||||
sw.Start()
|
sw.Start()
|
||||||
|
Dim Bytes As Byte() = Nothing
|
||||||
If IsNothing(MR) Then MR = New ReportViewer
|
|
||||||
Dim Bytes As Byte() = Nothing
|
Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory)
|
||||||
Try
|
RutaReporte.Replace("/", "\")
|
||||||
' MasterReporteador.LocalReport.DataSources.Clear()
|
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
|
||||||
For Each RDS As ReportDataSource In DataSource
|
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
|
||||||
MR.LocalReport.DataSources.Add(RDS)
|
End If
|
||||||
Next
|
|
||||||
|
If EsProduccion Then
|
||||||
MR.LocalReport.ReportPath = RutaReporte
|
|
||||||
MR.ProcessingMode = ProcessingMode.Local
|
Dim CveUsuario As Integer = 0
|
||||||
MR.LocalReport.EnableExternalImages = True
|
Dim CveEmpresa As Integer = 0
|
||||||
MR.LocalReport.SetParameters(Parametros)
|
|
||||||
MR.LocalReport.Refresh()
|
Dim wsreport As New WSRDLC.WebServiceSoapClient
|
||||||
Dim Warnings As Warning() = Nothing
|
Dim params As New List(Of WSRDLC.ReportParameter)
|
||||||
Dim StreamIds As String() = Nothing
|
Dim ds As New DataSet
|
||||||
Dim MimeType As String = Nothing
|
For Each rpds As ReportDataSource In DataSource
|
||||||
Dim Encoding As String = Nothing
|
Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable)
|
||||||
Dim Extension As String = Nothing
|
If dt Is Nothing Then
|
||||||
Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
|
dt = New DataTable()
|
||||||
Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException
|
Else
|
||||||
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}")
|
dt = dt.Copy()
|
||||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
End If
|
||||||
'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
dt.TableName = rpds.Name
|
||||||
Catch ex As Exception
|
ds.Tables.Add(dt)
|
||||||
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}")
|
Next
|
||||||
'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
|
For Each rpds As ReportParameter In Parametros
|
||||||
'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
|
Dim param As New WSRDLC.ReportParameter
|
||||||
End Try
|
param.Name = rpds.Name
|
||||||
|
param.Values = {rpds.Values(0)}
|
||||||
sw.Stop()
|
params.Add(param)
|
||||||
If sw.Elapsed.TotalSeconds > 10 Then
|
Next
|
||||||
GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
|
Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario)
|
||||||
End If
|
wsreport = Nothing
|
||||||
|
params = Nothing
|
||||||
Return Bytes
|
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
|
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)
|
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
|
'limpio ReportViwer
|
||||||
Dim mimeType As String = Nothing
|
Dim mimeType As String = Nothing
|
||||||
@@ -181,6 +231,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
|||||||
Public Property CveCliente As Integer
|
Public Property CveCliente As Integer
|
||||||
Public Property NombreCliente As String
|
Public Property NombreCliente As String
|
||||||
Public Property Fecha As DateTime
|
Public Property Fecha As DateTime
|
||||||
|
Public Property FechaVencimiento As DateTime
|
||||||
Public Property CveSubCentroCosto As Integer
|
Public Property CveSubCentroCosto As Integer
|
||||||
Public Property CveTipoDocumento As Integer
|
Public Property CveTipoDocumento As Integer
|
||||||
Public Property TipoDocumento As String
|
Public Property TipoDocumento As String
|
||||||
@@ -271,10 +322,21 @@ Public Class GenerarPDFFactura : Implements IHttpHandler
|
|||||||
Public Property RegimenFiscal As String
|
Public Property RegimenFiscal As String
|
||||||
End Class
|
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 Class ParametroWS
|
||||||
Public Property Factura As FacturaWS
|
Public Property Factura As FacturaWS
|
||||||
Public Property Cliente As ClienteWS
|
Public Property Cliente As ClienteWS
|
||||||
Public Property Empresa As EmpresaWS
|
Public Property Empresa As EmpresaWS
|
||||||
|
Public Property Timbrado As DatosSATWS
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,40 +11,64 @@ Imports Extensiones
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports Modelos
|
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
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
context.Response.ContentType = "application/json"
|
context.Response.ContentType = "text/plain"
|
||||||
Try
|
Dim Retorno As Boolean = False
|
||||||
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
|
Try
|
||||||
Dim JsonRequest As JObject = JObject.Parse(json)
|
'If context.Request.InputStream IsNot Nothing Then
|
||||||
If JsonRequest IsNot Nothing Then
|
' Using reader As New StreamReader(context.Request.InputStream)
|
||||||
Dim Metodo = JsonRequest("Metodo").ToString()
|
' Dim json = reader.ReadToEnd
|
||||||
If Metodo = "FactMasivaRemisiones" Then
|
|
||||||
Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
|
' If Not String.IsNullOrEmpty(json) Then
|
||||||
Dim pFechaI As String = ""
|
' Dim JsonRequest As JObject = JObject.Parse(json)
|
||||||
Dim pFechaF As String = ""
|
' If JsonRequest IsNot Nothing Then
|
||||||
|
' Dim Metodo = JsonRequest("Metodo").ToString()
|
||||||
If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
|
' If Metodo = "FactMasivaRemisiones" Then
|
||||||
pFechaI = JsonRequest("FechaI")
|
' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
|
||||||
pFechaF = JsonRequest("FechaF")
|
' Dim pFechaI As String = ""
|
||||||
End If
|
' Dim pFechaF As String = ""
|
||||||
|
|
||||||
IniciaFacturacionMasiva(context, pCveEmpresa, pFechaI, pFechaF)
|
' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
|
||||||
End If
|
' pFechaI = JsonRequest("FechaI")
|
||||||
End If
|
' pFechaF = JsonRequest("FechaF")
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
End Using
|
' 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
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ex.GuardaLog(ex.Message)
|
ex.GuardaLog(ex.Message)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
If Retorno Then
|
||||||
|
context.Response.Write("True")
|
||||||
|
Else
|
||||||
|
context.Response.Write("False")
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||||
@@ -53,7 +77,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
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 JsonRetorno As New JObject()
|
||||||
Dim CveEmpresa As Integer = pCveEmpresa.ToEntero()
|
Dim CveEmpresa As Integer = pCveEmpresa.ToEntero()
|
||||||
If CveEmpresa > 0 Then
|
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)
|
FechaI = New DateTime(DomingoAnterior.Year, DomingoAnterior.Month, DomingoAnterior.Day, 0, 0, 0)
|
||||||
FechaF = New DateTime(Sabado.Year, Sabado.Month, Sabado.Day, 23, 59, 59)
|
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
|
End If
|
||||||
Else
|
Else
|
||||||
FechaI = pFechaI.ToDateTime()
|
FechaI = pFechaI.ToDateTime()
|
||||||
@@ -79,11 +107,13 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
|
|||||||
|
|
||||||
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
|
JsonRetorno = EjecutarFacturacionMasiva(Usuario, FechaI, FechaF, Usuario.Empresa.FacturaProduccion)
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
GuardaLogFacturacion("Ejecución Exitosa, se generaron las siguientes facturas:")
|
||||||
context.Response.Write(JsonRetorno)
|
GuardaLogFacturacion(JsonRetorno.ToString())
|
||||||
End Sub
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime
|
Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek, hora As TimeSpan) As DateTime
|
||||||
|
|||||||
@@ -6544,9 +6544,11 @@ Partial Class Compras_Compras
|
|||||||
'SumatoriaOCINV = -SumatoriaOCINV
|
'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 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
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"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
|
ErrorPrepoliza = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -6585,6 +6587,8 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If RegistraConcepto225 Then
|
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
|
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
|
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||||
|
|
||||||
@@ -6633,13 +6637,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
|
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
|
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||||
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
|
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
|
ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -19508,6 +19517,8 @@ Partial Class Compras_Compras
|
|||||||
'' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
'' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||||
|
|
||||||
If DiferenciaInvOC.RoundSQL() <> 0 Then
|
If DiferenciaInvOC.RoundSQL() <> 0 Then
|
||||||
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
If CvePrePoliza > 0 Then
|
If CvePrePoliza > 0 Then
|
||||||
@@ -19519,14 +19530,14 @@ Partial Class Compras_Compras
|
|||||||
Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
|
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
|
Retorno = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
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, 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 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
|
Retorno = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -19540,7 +19551,7 @@ Partial Class Compras_Compras
|
|||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
'2018.11.24 se cambia concepto 177, de cargo a abono negativo., petición MALL
|
'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
|
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
|
Retorno = False
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -28,11 +28,14 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
|
|||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
|
||||||
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
|
Dim EjercicioParametro, EjercicioParametroFinal, SubProyectoParametro, DivisorParametro As Integer
|
||||||
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
|
|
||||||
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
|
CveCuenta = IfNull(Request("CveCuenta"), "-1").ToString.ToEntero
|
||||||
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
|
EjercicioParametro = IfNull(Request("Ejercicio"), "-1").ToString.ToEntero
|
||||||
DivisorParametro = IfNull(Request("D"), "-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
|
EsVertical = IfNull(Request("V"), "-1").ToString.ToEntero
|
||||||
|
|
||||||
InicializaValores()
|
InicializaValores()
|
||||||
|
|||||||
@@ -557,7 +557,8 @@
|
|||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<ItemTemplate>
|
<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>
|
</ItemTemplate>
|
||||||
<ItemStyle HorizontalAlign="Left" />
|
<ItemStyle HorizontalAlign="Left" />
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
@@ -609,7 +610,8 @@
|
|||||||
|
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<ItemTemplate>
|
<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>
|
</ItemTemplate>
|
||||||
<ItemStyle HorizontalAlign="Left" />
|
<ItemStyle HorizontalAlign="Left" />
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
|
|||||||
@@ -294,8 +294,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Tab.ActiveTabIndex = 2 Then
|
If Tab.ActiveTabIndex = 2 Then
|
||||||
ValidaEjercicios()
|
|
||||||
|
|
||||||
|
ValidaEjercicios()
|
||||||
|
|
||||||
LiSubProyectoDdl.Visible = True
|
LiSubProyectoDdl.Visible = True
|
||||||
LiSubProyectoLbl.Visible = True
|
LiSubProyectoLbl.Visible = True
|
||||||
@@ -418,6 +418,8 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
@@ -1272,6 +1274,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
|||||||
|
|
||||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
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 CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||||
Dim IndiceInicio As Integer = 1
|
Dim IndiceInicio As Integer = 1
|
||||||
@@ -1327,7 +1330,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
|||||||
Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero
|
Dim CveSubProyecto As Integer = e.Row.DataKey("CveSubProyecto").ToEntero
|
||||||
If e.Row.DBCampo("CtaMayor").ToString.ToEntero > 0 Then
|
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 CountDinamico As Integer = e.Row.DataKey("CountDinamico").ToEntero
|
||||||
Dim IndiceInicio As Integer = 1
|
Dim IndiceInicio As Integer = 1
|
||||||
Dim IndiceMax As Integer = 1 + CountDinamico
|
Dim IndiceMax As Integer = 1 + CountDinamico
|
||||||
@@ -1711,29 +1714,22 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
|
|||||||
#Region "DESCARGA EXCEL"
|
#Region "DESCARGA EXCEL"
|
||||||
|
|
||||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||||
|
|
||||||
Imprimir("Excel")
|
Imprimir("Excel")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
|
||||||
|
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||||
|
|
||||||
|
|
||||||
|
If Tab.ActiveTabIndex = 0 AndAlso GvIngresosMes.Rows.Count > 0 Then
|
||||||
If Tab.ActiveTabIndex = 0 Then
|
|
||||||
ExportToExcelG(GvIngresosMes, GvGastosMes, TMesT1, "Reporte_Mensual", UsuarioActual, "Mensual")
|
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)
|
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)
|
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)
|
ExportToExcelG(GvIngresosSubProyectoH, GvGastosSubProyectoH, TMesT1, "Reporte_Proyecto_Horizontal", UsuarioActual, "Proyecto Horizontal", Gv3:=GvTotalesSubProyectoH, EsPorSubProtyecto:=True)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
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)
|
'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
|
Dim HtmlCompleto As String = myStr1 & "<br>" & myStr2 & "<br>" & myStr3
|
||||||
|
|
||||||
|
|
||||||
|
HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
|
||||||
|
|
||||||
Dim asd As String = ""
|
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
10
Global.asax
10
Global.asax
@@ -276,8 +276,8 @@
|
|||||||
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
'SAT
|
'SAT
|
||||||
Using ObjGrales As New ClsGenerales
|
Using ObjGrales As New ClsGenerales
|
||||||
If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
|
'If ObjGrales.GetSATProductosServicios Then Application("GlobalDTPSATPS") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATPS") = Nothing
|
||||||
If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing
|
'If ObjGrales.GetSATUnidadMedida Then Application("GlobalDTPSATUM") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTPSATUM") = Nothing
|
||||||
If ObjGrales.GetSATUsosCFDI Then Application("GlobalDTSATUsosCFDI") = ObjGrales.DtResultados Else Application("GlobalDTSATUsosCFDI") = Nothing
|
If ObjGrales.GetSATUsosCFDI Then Application("GlobalDTSATUsosCFDI") = ObjGrales.DtResultados Else Application("GlobalDTSATUsosCFDI") = Nothing
|
||||||
If ObjGrales.GetSATFraccionArancelaria Then Application("GlobalDTFraccionArancelaria") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTFraccionArancelaria") = Nothing
|
If ObjGrales.GetSATFraccionArancelaria Then Application("GlobalDTFraccionArancelaria") = ObjGrales.DtResultados.AsEnumerable() Else Application("GlobalDTFraccionArancelaria") = Nothing
|
||||||
If ObjGrales.GetSATIncoterm Then Application("GlobalDTIncoterm") = ObjGrales.DtResultados Else Application("GlobalDTIncoterm") = Nothing
|
If ObjGrales.GetSATIncoterm Then Application("GlobalDTIncoterm") = ObjGrales.DtResultados Else Application("GlobalDTIncoterm") = Nothing
|
||||||
@@ -286,9 +286,9 @@
|
|||||||
If ObjGrales.GetSATUnidadesAduana Then Application("GlobalDTUnidadAduana") = ObjGrales.DtResultados Else Application("GlobalDTUnidadAduana") = Nothing
|
If ObjGrales.GetSATUnidadesAduana Then Application("GlobalDTUnidadAduana") = ObjGrales.DtResultados Else Application("GlobalDTUnidadAduana") = Nothing
|
||||||
If ObjGrales.GetSATClavePedimento Then Application("GlobalDTClavePedimento") = ObjGrales.DtResultados Else Application("GlobalDTClavePedimento") = Nothing
|
If ObjGrales.GetSATClavePedimento Then Application("GlobalDTClavePedimento") = ObjGrales.DtResultados Else Application("GlobalDTClavePedimento") = Nothing
|
||||||
If ObjGrales.GetSATPais Then Application("GlobalDTPais") = ObjGrales.DtResultados Else Application("GlobalDTPais") = Nothing
|
If ObjGrales.GetSATPais Then Application("GlobalDTPais") = ObjGrales.DtResultados Else Application("GlobalDTPais") = Nothing
|
||||||
If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
|
'If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
|
||||||
If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
|
'If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
|
||||||
If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
|
'If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
|
||||||
End Using
|
End Using
|
||||||
GuardaLogAsax(String.Format("Globalasax 19:{0}", DateTime.Now))
|
GuardaLogAsax(String.Format("Globalasax 19:{0}", DateTime.Now))
|
||||||
|
|
||||||
|
|||||||
@@ -2015,9 +2015,19 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
DdlConcepto.Items.Insert(0, New ListItem("Entrada Almacen ", "2"))
|
DdlConcepto.Items.Insert(0, New ListItem("Entrada Almacen ", "2"))
|
||||||
End If
|
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.SelectedValue = "-1"
|
||||||
ddlConcepto_SelectedIndexChanged(DdlConcepto, EventArgs.Empty)
|
ddlConcepto_SelectedIndexChanged(DdlConcepto, EventArgs.Empty)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub ddlConcepto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConcepto.SelectedIndexChanged
|
Protected Sub ddlConcepto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConcepto.SelectedIndexChanged
|
||||||
|
|||||||
@@ -104,7 +104,9 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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
|
If GvD.Rows.Count > 0 Then
|
||||||
|
|
||||||
'Valida Movimientos
|
'Valida Movimientos
|
||||||
@@ -132,11 +134,11 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
If Not ValidaMovtos > 0 Then
|
If Not ValidaMovtos > 0 Then
|
||||||
Alert("No hay movimientos que realizar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
Alert("No hay movimientos que realizar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||||
|
|
||||||
Dim CveMovimientoEntrada As Integer = 0
|
Dim CveMovimientoEntrada As Integer = 0
|
||||||
@@ -190,14 +192,22 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = 29").ToEntero
|
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = 29").ToEntero
|
||||||
If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
|
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))
|
Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS))
|
||||||
IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero
|
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
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, tValorInventario, TxtObservacionesEntrega.Text.Trim, 68, TxtObservacionesEntrega.Text.Trim, Fecha, idCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=tValorInventario) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Else
|
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
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -2163,7 +2163,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
|
|
||||||
Dim CveMovimiento As Integer
|
Dim CveMovimiento As Integer
|
||||||
Dim CveMovimientoOriginal As Integer
|
Dim CveMovimientoOriginal As Integer
|
||||||
' Dim CveMovimientoS
|
|
||||||
|
'Dim CveMovimientoS
|
||||||
|
|
||||||
Dim InvFolio As String = ""
|
Dim InvFolio As String = ""
|
||||||
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
Dim FechaMovto As Date = TxtFecha.Text.ToDate
|
||||||
@@ -2172,6 +2173,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Dim MensajeError = ""
|
Dim MensajeError = ""
|
||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
|
|
||||||
Dim ObjBitacora As New ClsOIEventos(ObjInventario.IniciaTransacSQL())
|
Dim ObjBitacora As New ClsOIEventos(ObjInventario.IniciaTransacSQL())
|
||||||
Dim ObjCompras As New ClsCompras(ObjInventario.IniciaTransacSQL())
|
Dim ObjCompras As New ClsCompras(ObjInventario.IniciaTransacSQL())
|
||||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||||
@@ -2896,13 +2898,17 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen-NC", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
CvePrePoliza = ObjConta.AddPrePolizas("Inventario/RecepcionAlmacen-NC", 74, TotalCosto, TotalCosto, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
If CvePrePoliza > 0 Then
|
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, 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 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 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
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -2917,6 +2923,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPNC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPNC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
|
|||||||
@@ -872,7 +872,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Dim Cont As Integer = 0
|
Dim Cont As Integer = 0
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=-1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -2770,7 +2770,10 @@ Partial Class OC
|
|||||||
' TieneError = True
|
' TieneError = True
|
||||||
' Exit For
|
' Exit For
|
||||||
'End If
|
'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
|
TieneError = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -2788,7 +2791,7 @@ Partial Class OC
|
|||||||
'2018.11.24 se cambia concepto 176, de cargo a abono negativo., petición MALL
|
'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.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
|
'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
|
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
|
TieneError = True
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -1294,7 +1294,7 @@ Partial Class Ventas_ClientesAbonar
|
|||||||
|
|
||||||
If CveMonedaVenta = 1 And CveMoneda <> 1 Then
|
If CveMonedaVenta = 1 And CveMoneda <> 1 Then
|
||||||
'factura pesos, pago en dolares
|
'factura pesos, pago en dolares
|
||||||
tImporteVenta = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion).RoundSQL
|
tImporteVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL
|
||||||
tImportePago = (((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVenta / tipoCambioPago).RoundSQL * tipoCambioPago).RoundSQL
|
tImportePago = (((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVenta / tipoCambioPago).RoundSQL * tipoCambioPago).RoundSQL
|
||||||
ElseIf CveMonedaVenta <> 1 And CveMoneda <> 1 Then
|
ElseIf CveMonedaVenta <> 1 And CveMoneda <> 1 Then
|
||||||
'factura dolares, pago en dolares
|
'factura dolares, pago en dolares
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ Partial Class Ventas_RepRecuperacion
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
|
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
|
||||||
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString,
|
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero,
|
||||||
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
|
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
|
||||||
GvDatos.DataSource = ObjMovtos.DtResultados
|
GvDatos.DataSource = ObjMovtos.DtResultados
|
||||||
DtDatos = ObjMovtos.DtResultados
|
DtDatos = ObjMovtos.DtResultados
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ Partial Class Ventas_RepRecuperacionDetalle
|
|||||||
DdlVendedor.SelectedValueExist(CveVendedor)
|
DdlVendedor.SelectedValueExist(CveVendedor)
|
||||||
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
|
||||||
If CveCliente > 0 Then
|
If CveCliente > 0 Then
|
||||||
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros($"CveCliente = {CveCliente}").Rows(0)("NombreComercial").ToString
|
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "")
|
||||||
DdlClientes.SelectedValue = CveCliente.ToString
|
DdlClientes.SelectedValue = CveCliente.ToString
|
||||||
End If
|
End If
|
||||||
DdlUsuario.SelectedValueExist(CveUsuario)
|
DdlUsuario.SelectedValueExist(CveUsuario)
|
||||||
|
|||||||
@@ -9618,12 +9618,12 @@ Partial Class Ventas
|
|||||||
|
|
||||||
'Agregamos el gasto de contrato
|
'Agregamos el gasto de contrato
|
||||||
If CveContrato > 0 AndAlso factura.TipoDocto = "Rem" AndAlso AplicaGastoContrato Then
|
If CveContrato > 0 AndAlso factura.TipoDocto = "Rem" AndAlso AplicaGastoContrato Then
|
||||||
Dim ObjContrato As New ClsContratos
|
|
||||||
If Not ObjContrato.AddContratoGasto(CveContrato, Row("PS").ToString(), Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, factura.Fecha, UsuarioActual.CveUsuario, CveVenta:=ObjVentas.CveVenta) Then
|
If Not ObjContr.AddContratoGasto(CveContrato, Row("PS").ToString(), Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, factura.Fecha, UsuarioActual.CveUsuario, CveVenta:=ObjVentas.CveVenta) Then
|
||||||
ErrorList.Add("Ocurrió un error al agregar el gasto de la Factura.")
|
ErrorList.Add("Ocurrió un error al agregar el gasto de la Factura.")
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
ObjContrato.Dispose()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Si es devolucion se agregan a la tabla de Vta_VentasDetalleDevolucion
|
'Si es devolucion se agregan a la tabla de Vta_VentasDetalleDevolucion
|
||||||
@@ -20920,15 +20920,25 @@ Partial Class Ventas
|
|||||||
If Not CveProducto > 0 Then
|
If Not CveProducto > 0 Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
Dim drP As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("")
|
||||||
|
Dim AplicaSeccion As Boolean = CBool(drP("AplicaSeccion"))
|
||||||
|
Dim AplicaSerie As Boolean = CBool(drP("AplicaSerie"))
|
||||||
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
|
|
||||||
If Dr("CveTipoInvPS").ToString().ToEntero() = 5 Then
|
If AplicaSerie Then
|
||||||
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
|
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
|
||||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||||
If Existencia < 1 Then
|
If Existencia < 1 Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
If AplicaSeccion Then
|
||||||
|
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||||
|
Else
|
||||||
|
CveSeccionAlmacen = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -20938,7 +20948,13 @@ Partial Class Ventas
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, Cantidad, CveUnidad, CveProducto, 0, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
If AplicaSeccion Then
|
||||||
|
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||||
|
Else
|
||||||
|
CveSeccionAlmacen = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, Cantidad, CveUnidad, CveProducto, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -20952,8 +20968,14 @@ Partial Class Ventas
|
|||||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E6")
|
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 9, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalidaConsignacion, Modulo:="Vta/E6")
|
||||||
If CveMovimientoEntradaGeneral > 0 Then
|
If CveMovimientoEntradaGeneral > 0 Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
If CBool(Dr("AplicaSeccion")) Then
|
||||||
|
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigenContrato, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||||
|
Else
|
||||||
|
CveSeccionAlmacen = -1
|
||||||
|
End If
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|||||||
Reference in New Issue
Block a user