-- unificación de globalDTs

This commit is contained in:
2023-02-18 13:40:31 -07:00
parent a8eb7895e0
commit e59d485489
6 changed files with 107 additions and 1076 deletions

View File

@@ -59,206 +59,6 @@ Public Class E141 : Implements IHttpHandler
End Get
End Property
#Region "GLOBAL DT"
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1, Optional Codigo As String = "-1") As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, Codigo:=Codigo, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
Public Property GlobalDTPSSimplificado(Optional CveClasificacion As Integer = -1, Optional Codigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
Codigo = Codigo.ToUpper()
If Codigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!Codigo).ToUpper() = Codigo))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
Try
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Catch ex As Exception
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMonedas") = value
End Set
End Property
Public Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaFormaPago") = value
End Set
End Property
Property GlobalDTVtaMetodoPago() As DataTable
Get
GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value
End Set
End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get
If EsPersonaFisica <> -1 Then
Dim Tipo As String = ""
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
GlobalDTSATUsosCFDI = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjUsr As New ClsInventarios
If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
ObjUsr.Dispose()
End If
Dim Str As New StringBuilder
Str.Append("1=1 AND ")
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
'Get
' Dim Str As New StringBuilder
' Str.Append("1=1 AND ")
' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTAlmacen = Dv.ToTable
' Dv.Dispose()
'End Get
'Set(value As DataTable)
' Application("GlobalDTAlmacen") = value
'End Set
End Property
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
Get
If HttpContext.Current.Application("GlobalDTEstado") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATEstado("-1") Then HttpContext.Current.Application("GlobalDTEstado") = ObjGrales.DtResultados Else HttpContext.Current.Application("GlobalDTEstado") = Nothing
ObjGrales.Dispose()
End If
If ClaveSATPais <> "-1" Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
GlobalDTEstado = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEstado = DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstado") = value
End Set
End Property
#End Region
#Region "V A L I D A - D A T O S"
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
@@ -852,7 +652,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(Estado) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
@@ -936,8 +736,8 @@ Public Class E141 : Implements IHttpHandler
ObjFactura.TipoCambio = 1
ObjFactura.ConvertirPesos = False
ObjFactura.CveMoneda = CveMoneda
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.TipoDocto = TipoDocto
ObjFactura.RefDocto = ""
'ObjFactura.CveMesa = -1
@@ -965,8 +765,8 @@ Public Class E141 : Implements IHttpHandler
ObjFactura.CveSubProyecto = CveSubProyecto
ObjFactura.CveSubProyectoCobranza = CveSubProyecto
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
'CLIENTE
ObjFactura.CveCliente = CveCliente
@@ -978,16 +778,16 @@ Public Class E141 : Implements IHttpHandler
If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
ObjFactura.CveFormaPago33 = ObjClientes.CveFormaPago33
ObjFactura.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.CveMetodoPago33 = ObjClientes.CveMetodoPago33
ObjFactura.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.CveUsoCFDI = ObjClientes.CveUsoCFDI
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
End If
End If
@@ -1002,7 +802,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(JsonRequest("invoice_way_to_pay").ToString()) Then
Dim RowFormaPago As DataRow = GlobalDTVtaFormaPago.FiltroPrimero(String.Format("ClaveFormaPagoSAT = '{0}'", JsonRequest("invoice_way_to_pay").ToString()))
Dim RowFormaPago As DataRow = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimero(String.Format("ClaveFormaPagoSAT = '{0}'", JsonRequest("invoice_way_to_pay").ToString()))
If RowFormaPago IsNot Nothing Then
ObjFactura.CveFormaPago33 = RowFormaPago("CveFormaPago").ToString().ToEntero()
ObjFactura.FormaPago33 = RowFormaPago("FormaPago").ToString()
@@ -1026,7 +826,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(JsonRequest("invoice_use").ToString()) Then
Dim RowUsoCFDi As DataRow = GlobalDTSATUsosCFDI.FiltroPrimero(String.Format("UsoCFDI = '{0}'", JsonRequest("invoice_use").ToString()))
Dim RowUsoCFDi As DataRow = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimero(String.Format("UsoCFDI = '{0}'", JsonRequest("invoice_use").ToString()))
If RowUsoCFDi IsNot Nothing Then
ObjFactura.CveUsoCFDI = RowUsoCFDi("CveUsoCFDI").ToString().ToEntero()
ObjFactura.UsoCFDI = RowUsoCFDi("Descripcion").ToString()
@@ -1050,7 +850,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(JsonRequest("invoice_payment_method").ToString()) Then
Dim RowMetodoPago As DataRow = GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", JsonRequest("invoice_payment_method").ToString()))
Dim RowMetodoPago As DataRow = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", JsonRequest("invoice_payment_method").ToString()))
If RowMetodoPago IsNot Nothing Then
ObjFactura.CveMetodoPago33 = RowMetodoPago("CveMetodoPago").ToString().ToEntero()
ObjFactura.MetodoPago33 = RowMetodoPago("MetodoPago").ToString()
@@ -1114,7 +914,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(ObjFactura.Cliente.Estado) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{ObjFactura.Cliente.Estado.Trim}'").ToEntero()
CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{ObjFactura.Cliente.Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
@@ -1133,7 +933,7 @@ Public Class E141 : Implements IHttpHandler
End If
ObjFactura.CveAlmacen = GlobalDTAlmacen(CveEmpresa, CveTipoAlmacen:=1).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
ObjFactura.CveAlmacen = ClsPaginas.GlobalDTAlmacen(CveEmpresa, CveTipoAlmacen:=1).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
'DETALLES
ObjFactura.DtDetalle = CreaDTDetalle(ObjInventario, ObjFactura, Resp, UsuarioActual, JsonRequest)
@@ -1436,9 +1236,9 @@ Public Class E141 : Implements IHttpHandler
For Each JsonPS As JObject In ListaPS
Dim Cantidad As Decimal = JsonPS("quantity").ToString.ToDecimal()
Dim CvePS As Integer = GlobalDTPSSimplificado(Codigo:=JsonPS("product_sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
Dim CvePS As Integer = ClsPaginas.GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, Codigo:=JsonPS("product_sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
Dim DrPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Retorno.TieneError = True
@@ -1471,7 +1271,7 @@ Public Class E141 : Implements IHttpHandler
Dim PorcentajeIVADefault As Decimal = 0.16D
Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, JsonRequest("branch_office_id").ToEntero(), CveEmpresa:=CveEmpresa).Rows(0)
Dim DrSubProyecto As DataRow = ClsPaginas.GlobalDTSubProyectos(-1, JsonRequest("branch_office_id").ToEntero(), CveEmpresa:=CveEmpresa).Rows(0)
If DrSubProyecto IsNot Nothing Then
PorcentajeIVADefault = DrSubProyecto("IVA").ToString().ToDecimal()
@@ -1523,7 +1323,7 @@ Public Class E141 : Implements IHttpHandler
Optional ClienteRetIVA As Double = 0, Optional ClienteRetISR As Double = 0, Optional ClienteDesglosaIEPS As Boolean = True) As DataRow
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
Dim DrPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Retorno.Mensajes.Add("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.")
@@ -1560,7 +1360,7 @@ Public Class E141 : Implements IHttpHandler
Dim Row As DataRow = Nothing
Dim TotalCalculableImpuestos As Decimal = 0
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0)
Dim DrSubProyecto As DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0)
Row = TmpDT.NewRow()
Row("CveProyecto") = DrSubProyecto("CveProyecto").ToString().ToEntero()
@@ -1738,7 +1538,7 @@ Public Class E141 : Implements IHttpHandler
Dim data As New JArray
Dim DtSucursales As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltraParametros("EsSucursal = True")
Dim DtSucursales As DataTable = ClsPaginas.GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltraParametros("EsSucursal = True")
If DtSucursales IsNot Nothing Then
Try
For Each Row As DataRow In DtSucursales.Rows

View File

@@ -20,31 +20,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Dim Retorno As Boolean = False
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
@@ -951,55 +926,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
ArchivoW.Dispose()
End Sub
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambioEuro <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioEuro") = ObjGral.DtResultados.Rows(0)("TipoCambioEuro").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambioEuro") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambioEuro").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambioEuro") = value
End Set
End Property

View File

@@ -139,7 +139,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
End If
If Row("Observaciones").ToString().Contains("{TC}") Then
Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", ClsPaginas.GlobalTipoCambio(Now).FormatoNumero)
End If
Dim Resp = EmitirImprimir(UsuarioActual, Row)
@@ -290,9 +290,9 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
ObjFactura.ConvertirPesos = False
ObjFactura.CveMoneda = DR("CveMoneda").ToString.ToEntero
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, GlobalTipoCambio(Now))
ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(Now))
ObjFactura.TipoDocto = "Ing"
ObjFactura.RefDocto = ""
ObjFactura.Folio = -1
@@ -335,8 +335,8 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.CveSubProyectoCobranza = CveSubProyecto.ToEntero
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto.ToEntero
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", ObjFactura.CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", ObjFactura.CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
SubProyecto = DR("SubProyectoContrato").ToString
@@ -359,7 +359,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR)
For Each row As DataRow In DtDetalle.Rows
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
Dim drPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
DtR = TmpDT.NewRow
DtR("CveVenta") = -1
@@ -414,16 +414,16 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33
ObjFactura.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33
ObjFactura.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
@@ -584,126 +584,4 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
End Function
#End Region
#Region "G L O B A L - D T"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMonedas") = value
End Set
End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1, Optional Codigo As String = "-1") As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, Codigo:=Codigo, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
Public Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaFormaPago") = value
End Set
End Property
Property GlobalDTVtaMetodoPago() As DataTable
Get
GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value
End Set
End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get
If EsPersonaFisica <> -1 Then
Dim Tipo As String = ""
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
GlobalDTSATUsosCFDI = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
Property GlobalDTMetodosPago() As DataTable
Get
GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application("GlobalDTMetodosPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMetodosPago") = value
End Set
End Property
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
#End Region
End Class

View File

@@ -555,7 +555,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
sr.Close()
Catch ex As Exception
ex.ToString().GuardaLog()
'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}")
End Try
Return resultado
@@ -768,23 +767,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1, CveClienteClasificacion:=cveclienteclasificacion) Then
context.Application(AppNombre) = ObjClientes.DtResultados
End If
ObjClientes.Dispose()
End If
'Dim ObjClientes As New ClsClientes
'If ObjClientes.GetClientes(-1, Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then
' DtRetorno = ObjClientes.DtResultados
'End If
'ObjClientes.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = ClsPaginas.GlobalDTCliente(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
If EsDistribuidor <> -1 Then
dt = dt.FiltraParametros(String.Format("EsDistribuidor = {0} ", CBool(EsDistribuidor)))
@@ -832,22 +816,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTCompProveedores-{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
context.Application(AppNombre) = ObjProveedores.DtResultados
End If
ObjProveedores.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = ClsPaginas.GlobalDTCompProveedores(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
End If
@@ -1000,17 +970,17 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
If UsaGlobal Then
'se recarga el global, y el clspaginas, son los unicos 2 lugares
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
If context.Application(String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
'Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
'If context.Application(String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)) Is Nothing Then
' Dim ObjPS As New ClsProductosServicios
' If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
' ObjPS.Dispose()
End If
'End If
Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
'Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
'Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
If DTPS IsNot Nothing Then
@@ -1078,10 +1048,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
DTPS = Nothing
End If
If (usuario.TienePermisoProceso(300) Or usuario.TienePermisoProceso(301)) And (DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0) Then
Dim ObjClasificaciones As New ClsClasificaciones()
@@ -1129,11 +1095,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CvePS").ColumnName = "id"
DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text"
If PSCodigoDescripcion = "PSCodigo" Then
@@ -1156,16 +1119,12 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End Function
#End Region
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
#Region "Funciones"
Public Function GetJson(ByVal dt As DataTable) As String
Dim Retorno As String = ""
@@ -1198,15 +1157,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETPSSAT(ByVal context As HttpContext) As String
Dim retorno As String = ""
'Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow))
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
'If Name <> "-1" Then
' DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*")))
'End If
'DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"})
DtPSRetorno = ClsPaginas.GlobalDTPSATPS(Name.ToLower)
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
@@ -1232,7 +1186,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETUMSAT(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DTUM = ClsPaginas.GlobalDTPSATUM 'DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow))
Dim DTUM = ClsPaginas.GlobalDTPSATUM
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
@@ -1459,22 +1413,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTRHPersonal-{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveEmpresa) Then
context.Application(AppNombre) = ObjPersonal.DtResultados
End If
ObjPersonal.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
Dim dt As DataTable = ClsPaginas.GlobalDTRHPersonal(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
End If
@@ -1540,56 +1480,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
'xmlCFDI.comprobante.xmlns_cfdi = xtr.Value
Case "XMLNS:XSI"
'xmlCFDI.comprobante.xmlns_xsi = xtr.Value
'Case "XSI:SCHEMALOCATION"
' xmlCFDI.comprobante.xsi_schemaLocation = xtr.Value
'Case "VERSION"
' xmlCFDI.comprobante.Version = xtr.Value
'Case "SERIE"
' xmlCFDI.comprobante.Serie = xtr.Value
'Case "FOLIO"
' xmlCFDI.comprobante.Folio = xtr.Value
Case "FECHA"
fecha = xtr.Value
'Case "MONEDA"
' xmlCFDI.comprobante.Moneda = xtr.Value
'Case "SUBTOTAL"
' Dim SubTotal As Decimal = 0
' Decimal.TryParse(xtr.Value, SubTotal)
' xmlCFDI.comprobante.SubTotal = SubTotal
'Case "TOTAL"
' Dim Total As Decimal = 0
' Decimal.TryParse(xtr.Value, Total)
' xmlCFDI.comprobante.Total = Total
'Case "DESCUENTO"
' Dim Descuento As Decimal = 0
' Decimal.TryParse(xtr.Value, Descuento)
' xmlCFDI.comprobante.Descuento = Descuento
'Case "TIPOCAMBIO"
' Dim TipoCambio As Decimal = 0
' Decimal.TryParse(xtr.Value, TipoCambio)
' xmlCFDI.comprobante.TipoCambio = TipoCambio
'Case "TIPODECOMPROBANTE"
' xmlCFDI.comprobante.TipoDeComprobante = xtr.Value
'Case "FORMAPAGO"
' xmlCFDI.comprobante.FormaPago = xtr.Value
'Case "FORMADEPAGO"
' xmlCFDI.comprobante.FormaPago = xtr.Value
'Case "METODOPAGO"
' xmlCFDI.comprobante.MetodoPago = xtr.Value
'Case "METODODEPAGO"
' xmlCFDI.comprobante.MetodoPago = xtr.Value
'Case "CONDICIONESDEPAGO"
' xmlCFDI.comprobante.CondicionesDePago = xtr.Value
'Case "LUGAREXPEDICION"
' xmlCFDI.comprobante.LugarExpedicion = xtr.Value
'Case "CONFIRMACION"
' xmlCFDI.comprobante.Confirmacion = xtr.Value
'Case "NOCERTIFICADO"
' xmlCFDI.comprobante.NoCertificado = xtr.Value
'Case "SELLO"
' xmlCFDI.comprobante.Sello = xtr.Value
'Case "CERTIFICADO"
' xmlCFDI.comprobante.Certificado = xtr.Value
End Select
cont = xtr.MoveToNextAttribute()
@@ -1663,17 +1556,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function getSATColonias(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DtRetorno As DataTable = Nothing
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim dt As DataTable = DirectCast(context.Application("GlobalDTColonia"), DataTable)
Dim dt As DataTable = ClsPaginas.GlobalDTGralColonias("-1", "-1", "-1")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"ClaveSATColoniaCP like '%{Name}%'")
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CveColonia").ColumnName = "id"
DtRetorno.Columns("ClaveSATColoniaCP").ColumnName = "text"
@@ -1701,7 +1590,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim dt As DataTable = DirectCast(context.Application("GlobalDTContratos"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = ClsPaginas.GlobalDTContratos(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NumeroContrato like '%{0}%'", Name))
End If