diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb
index 778a6275d..26e8947e3 100644
--- a/Acumuladores/CatFoliosGarantia.aspx.vb
+++ b/Acumuladores/CatFoliosGarantia.aspx.vb
@@ -47,6 +47,7 @@ Partial Class Acumuladores_CatFoliosGarantia
#Region "Folios Garantía"
Private Sub CargaSubProyectos()
+ CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, lblSubProyecto)
DdlSubProyectos.Items.Clear()
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectos.DataBind()
diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb
index d49f390ca..a321f9f37 100644
--- a/App_Code/ClsClasificaciones.vb
+++ b/App_Code/ClsClasificaciones.vb
@@ -254,7 +254,7 @@ Public Class ClsClasificaciones
Return Retorno
End Function
- Public Function AddClasificaciones(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngreso As Integer, CuentaIngreso As String, CveCategoria As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = True, Optional RequiereAFInsumo As Boolean = True, Optional RequierePersonal As Boolean = True,
+ Public Function AddClasificaciones(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngreso As Integer, CuentaIngreso As String, CveCategoria As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = False, Optional RequiereAFInsumo As Boolean = False, Optional RequierePersonal As Boolean = False,
Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False, Optional PrecioBaseCosto As Decimal = -1) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index 3373f9526..7a14674f8 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -1022,22 +1022,22 @@ Public Class ClsClientes
End Function
- Public Function GetEstados(Optional ClaveSATPais As String = "-1") As Boolean
- Dim Retorno As Boolean = False
+ 'Public Function GetEstados(Optional ClaveSATPais As String = "-1") As Boolean
+ ' Dim Retorno As Boolean = False
- DataAdapter("PA_ClientesEstadosGet")
+ ' DataAdapter("PA_ClientesEstadosGet")
- SqlAdapter.SelectCommand.Parameters.Add("@ClaveSATPais", SqlDbType.VarChar).Value = ClaveSATPais
+ ' SqlAdapter.SelectCommand.Parameters.Add("@ClaveSATPais", SqlDbType.VarChar).Value = ClaveSATPais
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener el los estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener el los estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ' End Try
- Return Retorno
- End Function
+ ' Return Retorno
+ 'End Function
@@ -1596,8 +1596,8 @@ Public Class ClsClientes
Return Retorno
End Function
- Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String,
- Pais As String, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
+ Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer,
+ RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ClientesNoFrecuenteAdd")
@@ -1610,8 +1610,8 @@ Public Class ClsClientes
.Add("@Colonia", SqlDbType.VarChar).Value = Colonia
.Add("@Localidad", SqlDbType.VarChar).Value = Localidad
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
- .Add("@Estado", SqlDbType.VarChar).Value = Estado
- .Add("@Pais", SqlDbType.VarChar).Value = Pais
+ .Add("@CveEstado", SqlDbType.Int).Value = CveEstado
+ ' .Add("@Pais", SqlDbType.VarChar).Value = Pais
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@CP", SqlDbType.VarChar).Value = CP
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 33c02da87..202c993ec 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -5646,7 +5646,7 @@ Public Class ClsContabilidad
Optional PorcentajeIVA As Decimal = -1) As Boolean
Dim Retorno = False
- DataAdapter("PA_Conta_CuentasAsignacionesAdd")
+ DataAdapter("PA_Conta_CuentasAsignacionesUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCuentaAsignacion", SqlDbType.Int).Value = CveConceptoAsignacion
diff --git a/App_Code/ClsFISConfiguracion.vb b/App_Code/ClsFISConfiguracion.vb
index 3ee63918e..a1d8ddf32 100644
--- a/App_Code/ClsFISConfiguracion.vb
+++ b/App_Code/ClsFISConfiguracion.vb
@@ -16,6 +16,7 @@ Public Class ClsFISConfiguracion
Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter
Private SqlCommand As SqlCommand
+ Private SqlTransacc As SqlTransaction
Private Data As DataTable
'Atributos de la clase
@@ -23,6 +24,7 @@ Public Class ClsFISConfiguracion
Private disposedValue As Boolean = False ' Para detectar llamadas redundantes
'REGISTRAR CONEXIONES ABIERTAS
Private CveConexion As Integer = 0
+ Private EsTransaccionCompartida As Boolean = False
#End Region
#Region "Propiedades"
@@ -42,20 +44,38 @@ Public Class ClsFISConfiguracion
#End Region
- Sub New()
- SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
- Try
- SqlConexion.Open()
- Catch ex As Exception
- Me.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
+ Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
+
+ If TransaccionCompartida Is Nothing Then
+ SqlConexion = New SqlConnection
+ SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
+ Try
+ SqlConexion.Open()
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
+ End Try
+ Else
+ SqlConexion = TransaccionCompartida.Connection
+ SqlTransacc = TransaccionCompartida
+ EsTransaccionCompartida = True
+ End If
+ SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
+
+ End Sub
+ Private Sub DataAdapter(ByVal pStrSQL As String, Optional ByVal TipoComando As CommandType = CommandType.StoredProcedure)
+ With SqlAdapter.SelectCommand
+ .Parameters.Clear()
+ .CommandText = pStrSQL
+ .CommandType = TipoComando
+ End With
+ If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
+ Data = New DataTable
End Sub
#Region "Conexiones"
Private Sub ConexionAdd()
- If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
+ If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
DataAdapter("PA_Sis_RegistrarConexion")
With SqlAdapter.SelectCommand.Parameters
@@ -87,21 +107,14 @@ Public Class ClsFISConfiguracion
End If
End Sub
- Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
- With SqlAdapter.SelectCommand
- .Parameters.Clear()
- .CommandText = StrSQL
- .CommandType = TipoComando
- End With
- Data = New DataTable
- End Sub
+
#End Region
Public Function GetConfiguracion(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
- Data = New DataTable
- SqlAdapter = New SqlDataAdapter("PA_Fis_CuentaContablesGet", SqlConexion)
- SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
+
+ DataAdapter("PA_Fis_CuentaContablesGet")
+
SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
Try
SqlAdapter.Fill(Data)
@@ -117,16 +130,15 @@ Public Class ClsFISConfiguracion
Catch ex As SqlException
OnError("Ocurrió un error al consultar las Configuraciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
- SqlAdapter.Dispose()
+
Return Retorno
End Function
Public Function AddConfiguracion(ActIVAAcreditable As Integer, ActIVAxAcreditar As Integer, PasIVAPagar As Integer, PasIVAxPagar As Integer,
EROtrosIngresos As Integer, ERDSV As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
- Data = New DataTable
- SqlAdapter = New SqlDataAdapter("PA_Fis_CuentaContablesAdd", SqlConexion)
- SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
+
+ DataAdapter("PA_Fis_CuentaContablesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@ActIVAAcreditable", SqlDbType.VarChar).Value = ActIVAAcreditable
@@ -150,7 +162,7 @@ Public Class ClsFISConfiguracion
Catch ex As Exception
OnError("Ocurrió un error al Guardar la Configuración.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
- SqlAdapter.Dispose()
+
Return Retorno
End Function
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 0fe627061..f472bb0b3 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -2484,7 +2484,7 @@ Public Class ClsInventarios
Return Retorno
End Function
- Public Function GetInventarioFisicoDetalle(CveInventarioFisico As Integer, CveUsuario As Integer, Optional Agrupar As Boolean = False) As Boolean
+ Public Function GetInventarioFisicoDetalle(CveInventarioFisico As Integer, CveUsuario As Integer, Optional Agrupar As Boolean = False, Optional TopSelect As Integer = 10000) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoDetalleGet")
@@ -2493,6 +2493,7 @@ Public Class ClsInventarios
.Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Agrupar", SqlDbType.Bit).Value = Agrupar
+ .Add("@TopSelect", SqlDbType.Int).Value = TopSelect
End With
Try
diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb
index f82e8f176..e3b1f758d 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -1940,6 +1940,23 @@ Public Class ClsNominas
Return Retorno
End Function
+ Public Function ProcesarSUA(txtSUA As String, cveEmpresa As Int32) As Boolean
+ Dim retorno As Boolean = False
+ DTSet = New DataSet()
+ DataAdapter("PA_Nom_SUAProcesar", CommandType.StoredProcedure)
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@TxtSUA", SqlDbType.VarChar).Value = txtSUA
+ .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(DTSet)
+ retorno = True
+ Catch ex As Exception
+ retorno = False
+ OnError("Ocurrió un error al procesar SUA.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return retorno
+ End Function
Public Function GetNominaEmpleadoSimulador(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, SalarioDiario As Decimal) As Boolean
Dim retorno As Boolean = False
Try
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 21eb83cd4..7c9436364 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -1627,7 +1627,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjVendedores As New ClsVtaVendedores
- If ObjVendedores.GetVendedores(-1) Then Application(AppNombre) = ObjVendedores.DtResultados
+ If ObjVendedores.GetVendedores(CveEmpresa) Then Application(AppNombre) = ObjVendedores.DtResultados
ObjVendedores.Dispose()
End If
If CveEmpresa <> -1 Then
@@ -3351,7 +3351,7 @@ Public Class ClsPaginas
Application("GlobalDTClasificacionPorcentaje") = value
End Set
End Property
- Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaquteria As Integer = -1) As DataTable
+ Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaqueteria As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPaqueterias-{0}", CveEmpresa)
If Application(AppNombre) Is Nothing Then
@@ -3361,7 +3361,7 @@ Public Class ClsPaginas
End If
Dim Str As StringBuilder = New StringBuilder()
- If TipoPaquteria <> -1 Then Str.AppendFormat("TipoPaqueteria = {0}", TipoPaquteria)
+ If TipoPaqueteria <> -1 Then Str.AppendFormat("TipoPaqueteria = {0}", TipoPaqueteria)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTPaqueterias = Dv.ToTable
@@ -4820,6 +4820,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721)
PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722)
PaginaDict.Add("/Ventas/CatMetasVendedores.aspx".ToUpper(), 723)
+ PaginaDict.Add("/Ventas/RepAuxiliarFacturas.aspx".ToUpper(), 704)
#End Region
@@ -7274,7 +7275,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("TipoCambio", TipoCambio))
params.Add(New ReportParameter("NombreSolicito", dtOC(0)("UsuarioSolicito").ToString)) 'drSol("Nombre").ToString))
params.Add(New ReportParameter("PuestoSolicito", PuestoSol)) 'drPuestoSol("Puesto").ToString
- params.Add(New ReportParameter("NombreAutorizo", UsuarioActual.Nombre))
+ params.Add(New ReportParameter("NombreAutorizo", nombreautorizo))
params.Add(New ReportParameter("PuestoAutorizo", PuestoAut)) 'drPuestoAut("Puesto").ToString
params.Add(New ReportParameter("TipoOC", If(ObjOC.Tipo = "OC", "Orden de Compra", "Requisición")))
params.Add(New ReportParameter("UsoCFDI", ObjOC.UsoCFDI))
@@ -8040,5 +8041,30 @@ Public Class ClsPaginas
End Sub
#End Region
+ Public Sub CargarCentrosDeCosto(DdlProyecto As DropDownList, DdlSubProyecto As DropDownList, LthProyectoP As Label, LblSubProyecto As Label)
+ Select Case UsuarioActual.Empresa.Tipo_CentroCosto
+ Case 1
+ If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False
+ LblSubProyecto.Text = "Centro Costo"
+ Case 2
+ If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False
+ LblSubProyecto.Text = "Sucursal"
+ Case 3
+ If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False
+ LblSubProyecto.Text = "Proyecto"
+ Case 4
+ If LthProyectoP IsNot Nothing Then LthProyectoP.Text = "Proyecto "
+ LblSubProyecto.Text = "Subproyecto"
+ Case 5
+ If LthProyectoP IsNot Nothing Then LthProyectoP.Text = "Proyecto "
+ LblSubProyecto.Text = "Sucursal"
+ End Select
+ DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}))
+ DdlProyecto.DataBind()
+
+ DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
+ DdlSubProyecto.DataBind()
+ DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End Sub
End Class
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index 40f8cfaa0..a13e094b3 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -1973,11 +1973,12 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Try
Return Retorno
End Function
- Public Function UpdateSalarios(CvePersonal As Integer, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double) As Boolean
+ Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalUpdateSalarios")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@SalarioDiarioPago", SqlDbType.Money).Value = SalarioDiarioPago
.Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario
@@ -1994,6 +1995,24 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Function
+ Public Function GetMovimientosToSUA(CveEmpresa As Integer, FechaI As String, FechaF As String) As Boolean
+ Dim Retorno As Boolean = False
+ SqlDataAdapter("PA_RH_MovimientosToSUA")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaI", SqlDbType.VarChar).Value = FechaI
+ .Add("@FechaF", SqlDbType.VarChar).Value = FechaF
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As SqlException
+ OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
+
Public Function UpdateRFCValidado(RFC As String, CveEmpresa As Integer, RFCValidadoisok As Boolean) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsSucursales.vb b/App_Code/ClsSucursales.vb.exclude
similarity index 100%
rename from App_Code/ClsSucursales.vb
rename to App_Code/ClsSucursales.vb.exclude
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 6aad2b55e..4dcf2318d 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -1651,6 +1651,43 @@ Public Class ClsVentas
Return Retorno
End Function
+ 'Reporte de Ventas - Auxiliar Facturas
+ Public Function GetRepAuxliarFacturas(CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CvePS As Integer, FechaI As Date, FechaF As Date,
+ CveCliente As Integer, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer,
+ Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = -1, Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1") As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_RepAuxiliarGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@FechaI", SqlDbType.Date).Value = FechaI
+ .Add("@FechaF", SqlDbType.Date).Value = FechaF
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio
+ .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
+ .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
+ .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el reporte auxiliar de facturas de venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
#End Region
#Region "V E N T A S - P R E C I O L I S T A S" 'Hecho por Charlie 1/9/2016
@@ -4476,11 +4513,11 @@ Public Class ClsVentas
Return retorno
End Function
- Public Function GetOCRelacionadas(CveVentasDetalles As String) As Boolean
+ Public Function GetOCRelacionadas(CveVenta As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Vta_OrdenCompraRelacionada", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveVentasDetalles", SqlDbType.NVarChar).Value = CveVentasDetalles
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index dd42bdcb9..1b3a113ff 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -1344,7 +1344,7 @@ Namespace Modelos
Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing)
Dim Msgok As New StringBuilder
- factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
+ factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVentaM", factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
@@ -2213,7 +2213,7 @@ Namespace Modelos
End If
IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera
- CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera
+ 'CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera
End If
CveSubProyectoContabilizar = CveSubProyectoVenta
ImporteConcepto12 = importeMX.RoundSQL
@@ -2222,10 +2222,10 @@ Namespace Modelos
CuentasContablesInvalidas.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
- If CveCuenta <= 0 Then
- CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
- CveCuentaContabilizacion = 0
- End If
+ 'If CveCuenta <= 0 Then
+ ' CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
+ ' CveCuentaContabilizacion = 0
+ 'End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
Else
@@ -2804,7 +2804,7 @@ Namespace Modelos
End If
- CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
+ 'CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
If importeMovimiento <> 0 Then
@@ -2813,10 +2813,10 @@ Namespace Modelos
idCuentaContabilizacion = 0
End If
- If CveCuenta <= 0 Then
- CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"))
- CveCuentaContabilizacion = 0
- End If
+ 'If CveCuenta <= 0 Then
+ ' CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"))
+ ' CveCuentaContabilizacion = 0
+ 'End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then
ErrorPrepoliza = True
@@ -2891,7 +2891,7 @@ Namespace Modelos
If Row2("CveClasificacion").ToString = "19929" Then IdCtaContable = 1142
End If
- CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
+ 'CveCuenta = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresosSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
If importeMovimiento <> 0 Then
@@ -2900,10 +2900,10 @@ Namespace Modelos
idCuentaContabilizacion = 0
End If
- If CveCuenta <= 0 Then
- CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"))
- CveCuentaContabilizacion = 0
- End If
+ 'If CveCuenta <= 0 Then
+ ' CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"))
+ ' CveCuentaContabilizacion = 0
+ 'End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then
ErrorPrepoliza = True
@@ -2917,42 +2917,66 @@ Namespace Modelos
importeMovimiento = 0
Case 103 'Descuento
- If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoAmortizacionAnticipo = -1 Then
+ If ObjFactura.Descuento <> 0 AndAlso Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoAmortizacionAnticipo = -1 Then
- importeMovimiento = (ObjFactura.Descuento * ValorMultiplicador)
+ importeMovimiento = ObjFactura.Descuento * ValorMultiplicador
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 AndAlso ObjConta.GetRetCuenta(ConceptoContable, ObjFactura.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
- IdCtaContable = ObjConta.DtResultados.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString.ToEntero
- 'CveCuenta = ObjConta.DtResultados.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString.ToEntero
+ IdCtaContable = ObjConta.DtResultados.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString().ToEntero()
+ 'CveCuenta = ObjConta.DtResultados.Rows(0)("Conta_IdCuentaDescuentoVenta").ToString().ToEntero()
End If
End If
- If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
- If importeMovimiento > 0 AndAlso UsuarioActual.CveEmpresa = 119 Then
- 'código fijo en base el porcentaje iva, que se afecten las clasificaciones
- For i = 0 To TmpDTDetalle.Rows.Count - 1
- If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
- TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveClasificacion").ToString
+ DT = TmpDTDetalle.FiltraParametros("", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"})
+
+ If DT.Rows.Count > 0 Then
+ 'Se agrega movimiento separado por la cuenta de ventas (ER)
+ For Each Row2 As DataRow In DT.Rows
+ importeMovimiento = (TmpDTDetalle.SUM("Descuento", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString().ToDecimal) * ValorMultiplicador
+ importeMX = importeMovimiento * tipoCambio * Multiplicador
+ FechaMovimiento = ObjFactura.FechaPago
+ Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString().ToEntero() > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}"), "")} - {If(Row2("CveSubProyecto").ToString().ToEntero() > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString()}"), "Sin SubProyecto Asignado")}"
+
+ If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
+ 'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
+ If ObjFactura.TipoDocto.Contiene("Egs") Then
+ IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero()
+ Else
+ IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero()
+ End If
+
+ If importeMovimiento <> 0 Then
+
+ If IdCtaContable <= 0 Then
+ CuentasContablesInvalidas.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString() + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString()}"))
+ idCuentaContabilizacion = 0
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 103, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveVentaAmortizacion:=-1, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString().ToEntero(), CveSubProyecto:=Row2("CveSubProyecto").ToString().ToEntero(), ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then
+ ErrorPrepoliza = True
+ Else
+ ObjFactura.SeGuardoPrePoliza = True
+ End If
End If
Next
-
End If
End If
+ importeMovimiento = 0
- Case 103 'Descuento
- 'si se amortiza anticipo por concepto de descuento, no debe de registrar esta partida.
- If ObjFactura.CveTipoAmortizacionAnticipo <> 1 Then
- importeMovimiento = (ObjFactura.Descuento * ValorMultiplicador)
- importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
- FechaMovimiento = ObjFactura.FechaPago
- If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
- IdCtaContable = 0
- End If
+ 'Case 103 'Descuento
+ ' 'si se amortiza anticipo por concepto de descuento, no debe de registrar esta partida.
+ ' If ObjFactura.CveTipoAmortizacionAnticipo <> 1 Then
+ ' importeMovimiento = (ObjFactura.Descuento * ValorMultiplicador)
+ ' importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
+ ' FechaMovimiento = ObjFactura.FechaPago
+ ' If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
+ ' IdCtaContable = 0
+ ' End If
Case 8 'Ret IVA por Trasladar
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoRetencion <> 4 Then 'SI NO ES RETENCION DE IVA DE SERVICIOS
@@ -3194,7 +3218,7 @@ Namespace Modelos
If GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows.Count = 1 Then
IdCtaContable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContable").ToString.ToEntero
- CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContableSIG").ToString.ToEntero
+ ' CveCuenta = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If
If IdCtaContable <= 0 Then
@@ -3202,10 +3226,10 @@ Namespace Modelos
idCuentaContabilizacion = 0
End If
- If CveCuenta <= 0 Then
- CuentasContablesInvalidasSIG.AppendFormat(" {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero)
- CveCuentaContabilizacion = 0
- End If
+ 'If CveCuenta <= 0 Then
+ ' CuentasContablesInvalidasSIG.AppendFormat(" {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString.ToEntero).Rows(0)("NumCuentaMoneda").ToString.ToEntero)
+ ' CveCuentaContabilizacion = 0
+ 'End If
'BANCOS
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString)
@@ -3272,10 +3296,10 @@ Namespace Modelos
idCuentaContabilizacion = 0
End If
- If CveCuenta <= 0 Then
- CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
- CveCuentaContabilizacion = 0
- End If
+ 'If CveCuenta <= 0 Then
+ ' CuentasContablesInvalidasSIG.Append(" " & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
+ ' CveCuentaContabilizacion = 0
+ 'End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=tipoCambio, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
diff --git a/App_Code/WS_PuntoVenta.vb b/App_Code/WS_PuntoVenta.vb
index cd18bf021..e22b5f793 100644
--- a/App_Code/WS_PuntoVenta.vb
+++ b/App_Code/WS_PuntoVenta.vb
@@ -429,22 +429,22 @@ Public Class WS_PuntoVenta
Return Respuesta
End Function
-
- Public Function GetSucursales(CveEmpresa As Integer) As RespuestaWS
- Dim objSucursales As New ClsSucursales
- Dim Respuesta As New RespuestaWS
+ '
+ 'Public Function GetSucursales(CveEmpresa As Integer) As RespuestaWS
+ ' Dim objSucursales As New ClsSucursales
+ ' Dim Respuesta As New RespuestaWS
- If objSucursales.GetSucursales() Then
- Respuesta.Datos = objSucursales.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
- Respuesta.Datos.TableName = "Resultados"
- Respuesta.HuboError = False
- Else
- Respuesta.Descripcion = "HUBO UN ERROR"
- End If
+ ' If objSucursales.GetSucursales() Then
+ ' Respuesta.Datos = objSucursales.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
+ ' Respuesta.Datos.TableName = "Resultados"
+ ' Respuesta.HuboError = False
+ ' Else
+ ' Respuesta.Descripcion = "HUBO UN ERROR"
+ ' End If
- objSucursales.Dispose()
- Return Respuesta
- End Function
+ ' objSucursales.Dispose()
+ ' Return Respuesta
+ 'End Function
Public Function GetClientes(CveEmpresa As Integer) As RespuestaWS
@@ -1170,7 +1170,7 @@ Public Class WS_PuntoVenta
'Enviar correo de corte de turno
EnviarCorreo(VtaCorte.CveCorte, VtaCorte.CveEmpresa)
- Dim cuenta As Integer = GetCuenta(2090)
+ ' Dim cuenta As Integer = GetCuenta(2090)
Else
objPV.RollBack()
End If
@@ -1197,16 +1197,16 @@ Public Class WS_PuntoVenta
Return objVentasPago
End Function
-
- Public Function GetCuenta(CveSucursal As Integer) As Integer
- Dim objSU As New ClsSucursales
- Dim Cuenta As Integer
+ '
+ 'Public Function GetCuenta(CveSucursal As Integer) As Integer
+ ' Dim objSU As New ClsSucursales
+ ' Dim Cuenta As Integer
- 'Cuenta = objSU.GetCuenta(CveSucursal)
- objSU.Dispose()
+ ' 'Cuenta = objSU.GetCuenta(CveSucursal)
+ ' objSU.Dispose()
- Return Cuenta
- End Function
+ ' Return Cuenta
+ 'End Function
Public Function AddBancosIE(Importe As Double, Moneda As Integer, Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer, Cuenta As Integer, Comprobante As String, Opcion As String) As Boolean
diff --git a/Ashx/SIGGPSRCService.ashx b/Ashx/SIGGPSRCService.ashx
index 33e0b4b40..30ad9d59c 100644
--- a/Ashx/SIGGPSRCService.ashx
+++ b/Ashx/SIGGPSRCService.ashx
@@ -26,85 +26,21 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState
}
}
- private Usuario ValidaUsuarioSistema(int CveEmpresa)
- {
- Usuario UsuarioActual = null;
- ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
- if (ObjUsuarios.GetUsuarios(1727))
- {
- if (ObjUsuarios.DtResultados.Rows.Count > 0)
- {
- var Usuario = ObjUsuarios.DtResultados.Rows[0]["Usuario"].ToString();
- var Contrasenia = ObjUsuarios.DtResultados.Rows[0]["Contraseña"].ToString();
-
- UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, ModExtensiones.IMEI, CveEmpresa);
-
- UsuarioActual.CveEmpresa = CveEmpresa;
- UsuarioActual.CveCliente = 183798;
-
- CreaObjetoEmpresa(ref UsuarioActual);
- CargaZonasHorarias(ref UsuarioActual);
- }
- }
- ObjUsuarios.Dispose();
- return UsuarioActual;
- }
- private void CreaObjetoEmpresa(ref Usuario UsuarioActual)
- {
- ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas();
- if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1"))
- {
- if (ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa))
- {
- System.Data.DataTable dttmp = ObjEmpresa.DtResultados;
-
- var EmpresasFuncionalidades = new HybridDictionary();
- foreach (System.Data.DataRow Row in dttmp.Rows)
- EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
-
- ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
- }
-
- UsuarioActual.Empresa = ObjEmpresa.Empresa;
- }
- ObjEmpresa.Dispose();
- }
- private void CargaZonasHorarias(ref Usuario UsuarioActual)
- {
- ClsClientes ObjClientes = new ClsClientes();
- try
- {
- if (ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus: 1))
- {
- if (ObjClientes.DtResultados.Rows.Count == 1)
- UsuarioActual.UTCOffset = ObjClientes.DtResultados.Rows[0]["UTCOffset"].ToString().ToEntero();
- }
- }
- catch (Exception ex)
- {
- ex.ToString().GuardaLog();
- }
- finally
- {
- ObjClientes.Dispose();
- }
- }
-
public bool IsReusable => false;
public void ProcessRequest(HttpContext context)
{
+ context.Response.ContentType = "text/plain";
+ bool retorno = false;
try
{
- context.Response.ContentType = "text/plain";
- bool retorno = false;
+
string Metodo = context.Request["Metodo"] == null ? "" : context.Request["Metodo"];
switch (Metodo)
{
case "EjecutaServicio":
ModExtensiones.GuardaLogAD("Servicio Ejecutado...........", "LogServicioConfiable");
- IniciarTransmision(context);
- retorno = true;
+ retorno = IniciarTransmision();
break;
default:
break;
@@ -123,11 +59,14 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState
{
ex.GuardaLog(ex.Message);
}
+
+ context.Response.End();
}
- private void IniciarTransmision(HttpContext context)
+ private bool IniciarTransmision()
{
- var UsuarioActual = ValidaUsuarioSistema(121);
+ var retorno = false;
+ var TieneError = false;
var WS = new RCGPSService.RCServiceClient();
@@ -142,6 +81,10 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState
{
DtTrackings = ObjGPS.DtResultados.Copy();
}
+ else
+ {
+ TieneError = true;
+ }
if (DtTrackings != null)
{
@@ -152,6 +95,10 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState
{
dtTracking = ObjGPS.DtResultados.Copy();
}
+ else
+ {
+ TieneError = true;
+ }
if (dtTracking != null)
{
foreach (DataRow Row in dtTracking.Rows)
@@ -175,6 +122,7 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState
}
catch (Exception ex)
{
+ TieneError = true;
this.OnError("Ocurrió un error al enviar los datos", ex);
}
ObjGPS.Dispose();
@@ -182,15 +130,22 @@ public class SIGGPSRCService : IHttpHandler, IRequiresSessionState
DtTrackings.Dispose();
DtTrackings = null;
- if (ListaEventos.Count > 0)
+ if (ListaEventos.Count > 0 && !TieneError)
{
-
var respuesta = WS.GPSAssetTracking(Token.token, ListaEventos.ToArray());
- context.Response.Write(JsonConvert.SerializeObject(respuesta));
+ if (respuesta.Length > 0)
+ {
+ retorno = !TieneError;
+ }
+ }
+ else
+ {
+ retorno = !TieneError;
}
WS.Close();
- //context.Response.Write(JsonConvert.SerializeObject(new { idJob = "1", exception = "" }));
+
+ return retorno;
}
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index 17e401ead..0f7b199d5 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -585,7 +585,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
'verifica existencias
- If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141) Then
+ If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152) Then
UsaGlobal = False
Dim objInv As New ClsInventarios
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index e02318b0a..14d3f041a 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -571,7 +571,7 @@ Partial Class Bancos_IE
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
-
+ Me.CveCorte = -1
Folio = ""
IDCtaBeneficiario = 0
IDCtaBeneficiarioComplementaria = 0
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index ecbbb6b28..82abd140c 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -613,9 +613,8 @@
Producto o Servicio