diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 75aaea0c6..6d374654f 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -4653,7 +4653,11 @@ Public Class ClsContabilidad
Retorno = SqlAdapter.SelectCommand.Parameters("@CveCuenta").Value.ToString.ToEntero
'Retorno = If(Data IsNot Nothing AndAlso Data.Rows.Count > 0, Data.Rows(0)("CveCuenta").ToString.ToEntero, 0)
Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ If Ex1.Message.Contains("IND_Conta_Cuentas_Codigo_CveEmpresa") Then
+ Me.OnError("No se puede registrar una cuenta ya existente", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Else
+ Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
Catch ex As Exception
Me.OnError("Ocurrió un error al Guardar la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb
index 99017364d..622a9de14 100644
--- a/App_Code/ClsGPS.vb
+++ b/App_Code/ClsGPS.vb
@@ -8,9 +8,9 @@ Imports System.IO
Imports Newtonsoft.Json
Public Class ClsGPS
- Implements IDisposable
+ Implements IDisposable
#Region "Campos"
- 'SQL
+ 'SQL
Private Econ As OleDb.OleDbConnection
Private SqlConexion As SqlConnection
Private SqlAdapter As SqlDataAdapter
@@ -45,9 +45,9 @@ Public Class ClsGPS
Public Property EstaDentro As Boolean
Public Property CvePuntoDeInteresGrupo As Integer
Public Property CveGeoReferencia As Integer
- Public Property MensajeError As String
+ Public Property MensajeError As String
#End Region
-
+
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
If TransaccionCompartida Is Nothing Then
@@ -74,9 +74,9 @@ Public Class ClsGPS
End With
If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
Data = New DataTable
- End Sub
+ End Sub
#Region "Conexiones"
-
+
Private Sub ConexionAdd()
If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
Try
@@ -109,7 +109,7 @@ Public Class ClsGPS
CveConexion = 0
End If
- End Sub
+ End Sub
#End Region
Public Function IniciaTransacSQL() As SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
@@ -120,8 +120,40 @@ Public Class ClsGPS
End Sub
Public Sub Commit()
SqlTransacc.Commit()
- End Sub
-
+ End Sub
+#Region "Arrastre"
+
+ Public Function GPS_ArrastreGET(CveDispositivo As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_GPS_ArrastreGET")
+ With SqlAdapter.SelectCommand.Parameters
+ addParameters("@CveDispositivo", SqlDbType.Int, CveDispositivo)
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los datos de Arrastre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+ End Function
+ Public Function GPS_ArrastreActivarDesactivar(CveDispositivo As Integer, ArrastreActivo As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_GPS_ArrastreActivarDesactivar")
+ With SqlAdapter.SelectCommand.Parameters
+ addParameters("@CveDispositivo", SqlDbType.Int, CveDispositivo)
+ addParameters("@ArrastreActivo", SqlDbType.Bit, ArrastreActivo)
+ End With
+ Try
+ Dataset = New DataSet()
+ SqlAdapter.Fill(Dataset)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al activar o desactivar la alerta de Arrastre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+ End Function
+#End Region
Public Function GetTemperatura(CveDispositivo As Integer, CveSensor As Integer, strFechaInicio As String, strFechaFin As String, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_GPS_TramaData")
@@ -170,8 +202,8 @@ Public Class ClsGPS
OnError("Ocurrió un error al obtener las zonas horarias", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
+ End Function
+
#Region "FacturasSims"
Public Function GetFacturasSims(CveUsuario As Integer, CveEmpresa As Integer, Periodo As Integer) As Boolean
Dim retorno As Boolean = False
@@ -258,9 +290,9 @@ Public Class ClsGPS
addParameters("@cveGpsFacturaSim", SqlDbType.Int, cveGpsFacturaSim)
retorno = RunQuery("Ocurrió un error al eliminar el FacturasSims.")
Return retorno
- End Function
+ End Function
#End Region
-
+
#Region "M O D E L O S"
Public Function AddMarca(Marca As String, Estatus As Boolean, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -456,13 +488,13 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region "Rastreo"
-
+
Public Function CoordenadasGet(id As Integer, Nombre As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Coords_Get")
@@ -1565,11 +1597,11 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region "Puntos de interes"
Public Function PuntoDeInteresAdd(PuntoDeInteres As String, CveCliente As Integer, GEOM As String, Estatus As Boolean, Descripcion As String, CvePuntoDeInteresGrupo As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1736,12 +1768,12 @@ Public Class ClsGPS
OnError("Ocurrió un error al obtener el reporte de los Puntos de Interés.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
-
-
+ End Function
+
+
+
#End Region
-
+
#Region "CONDUCTORES"
Public Function ConductorAdd(Conductor As String, Estatus As Boolean, CveUsuario As Integer, SerieLicencia As String, FechaNacimiento As Date, VencimientoLicencia As Date, Optional CveCliente As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1887,9 +1919,9 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "CONTROLADORES GRAFICOS"
Public Function ControladorGraficoAdd(ControladorGrafico As String, UM As String) As Boolean
Dim Retorno As Boolean = False
@@ -1957,10 +1989,10 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "V E H I C U L O S"
Public Function VehiculoAdd(Modelo As String, Color As String, Serie As String, Nombre As String, NoEconomico As String, CveUsuario As Integer, CveCliente As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2038,9 +2070,9 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "TIPO COMUNICACION"
Public Function TipoComunicacionAdd(TipoComunicacion As String, Estatus As Boolean, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2113,10 +2145,10 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "R U T A S"
Public Function AddRuta(Ruta As String, CveCliente As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2179,9 +2211,9 @@ Public Class ClsGPS
OnError("Ocurrió un error al eliminar la ruta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
Public Function GetResGuardantesSim(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_GPS_ResGuardantesSimnGet")
@@ -2195,9 +2227,9 @@ Public Class ClsGPS
OnError("Ocurrió un error al obtener el proveedor de comunicacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
+ End Function
#Region "Proveedor Comunicacion"
-
+
Public Function ProveedorComunicacion_Add(ProveedorComunicacion As String, Estatus As Byte, CveUsuario As Integer, CveTipoComunicacion As Integer,
APNIP As String, APNUSER As String, APNPASS As String, correo As String) As Boolean
Dim Retorno As Boolean = False
@@ -2279,12 +2311,12 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "Proveedor Comunicacion Cuentas"
-
+
Public Function ProveedoresComunicacionCuentasAdd(CveProveedorComunicacion As Integer, CvePlanDato As Integer, CveUsuario As Integer, IP As String, SSID As String, NumeroTelefono As String, Estatus As Integer, CveEmpresa As Integer, Imei As String, CveUsuarioResguardante As Integer, Optional Activacion As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_GPS_ProveedoresComunicacionCuentasAdd")
@@ -2423,10 +2455,10 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "E V E N T O S"
Public Function EventoTipoAdd(EventoTipo As String, Estatus As Boolean, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2901,15 +2933,15 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
-
-
+ End Function
+
+
+
#End Region
-
+
#Region "Plan de Datos"
-
-
+
+
Public Function PlanesDatosAdd(CveProveedorComunicacion As Integer, CveUsuario As Integer, PlanDato As String, Importe As Decimal, Estatus As Integer, Capacidad As Integer,
TipoPlan As String, CostoAdicional As String, TechoFacturacion As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2998,10 +3030,10 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "Dispositivos"
Public Function DispositivoAdd(TipoDispositivo As Integer, NumTelefono As String, CveModelo As Integer, CveProveedorComunicacionCuenta As Integer, CveCliente As Integer, IMEI As String, Serie As String, CveEstatus As Integer, SerieVehiculo As String, ColorVehiculo As String,
NombreVehiculo As String, NoEconomico As String, devID As String, devPort As Integer, ModeloVehiculo As String, AñoVehiculo As String, ClaseVehiculo As String, PlacasVehiculo As String, LimiteVelocidad As Boolean, VelocidadMaxima As Double,
@@ -3328,10 +3360,10 @@ Public Class ClsGPS
OnError("Ocurrió un error al actualizar los dispositivos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "REPORTES"
Public Function GetReportes() As Boolean
Dim Retorno As Boolean = False
@@ -3645,9 +3677,9 @@ Public Class ClsGPS
OnError("Ocurrió un obtener el reporte de eventos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "I N D I C A D O R E S"
Public Function IndicadoresGet(CveCliente As Integer, FechaInicio As DateTime, FechaFin As DateTime) As Boolean
Dim Retorno As Boolean = False
@@ -3664,9 +3696,9 @@ Public Class ClsGPS
OnError("Ocurrió un obtener el reporte de indicadores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "DashBoard"
Public Function GetDashboard(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime, Optional Top As Integer = 5) As String
Dim Retorno As String = "[]"
@@ -3917,10 +3949,10 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "Controles"
Public Function GetCombustible(CveDispositivo As Integer, CveControl As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4275,9 +4307,9 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "A P L I C A C I O N M O V I L "
Public Function AddTrama(DevID As String, Trama As String, Lat As Double, Lng As Double, FechaTrama As DateTime, Optional Speed As Double = 0, Optional Modelo As String = "App") As Boolean
Dim Retorno As Boolean = False
@@ -4411,9 +4443,9 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "G R U P O S"
Public Function GruposAdd(Nombre As String, CveCliente As Integer) As Integer
@@ -4483,10 +4515,10 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "G R U P O S - D E T A L L E"
Public Function GruposDetallesAdd(CveDispositivoGrupo As Integer, CveDispositivo As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4535,9 +4567,9 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "A L T A S - B A J A S"
Public Function AddAltaBajas(CveDispositivo As Integer, Fecha As DateTime, CveUsuario As Integer, Tipo As Integer, CveCliente As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -4578,9 +4610,9 @@ Public Class ClsGPS
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "P A S A J E R O S"
Public Function GetCortesChofer(CveCorteChofer As Integer, CveDispositivo As Integer, CveUsuarioIngreso As Integer) As Boolean
Dim retorno As Boolean = False
@@ -5270,10 +5302,10 @@ Public Class ClsGPS
OnError("Ocurrió un error al obtener la configuracion de FreightVerify.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "F U N C I O N E S"
Public Function ReaderToJson(ByVal rdr As SqlDataReader) As String
Dim sb As StringBuilder = New StringBuilder()
@@ -5327,10 +5359,10 @@ Public Class ClsGPS
jsonWriter.WriteEndArray()
End Using
Return sw.ToString()
- End Function
-
+ End Function
+
#End Region
-
+
Protected Sub addParameters(name As String, tipo As SqlDbType, valor As Object)
If SqlConexion.State = ConnectionState.Open Then
SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor
@@ -5376,9 +5408,9 @@ Public Class ClsGPS
addParameters("@FechaFin", SqlDbType.DateTime, fechaFin)
retorno = RunQuery("Ocurrió un error al obtener el CombustibleResumen.")
Return retorno
- End Function
+ End Function
#Region " IDisposable Support "
- ' IDisposable
+ ' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not disposedValue Then
If disposing Then
@@ -5409,6 +5441,6 @@ Public Class ClsGPS
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
- End Sub
+ End Sub
#End Region
End Class
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 761bcfd3e..468f9e2d7 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -3482,6 +3482,8 @@ Public Class ClsPaginas
PaginaDict = New System.Collections.Hashtable
PaginaDict.Add("/Inicio.aspx".ToUpper(), -1)
+ PaginaDict.Add("/reporteador.aspx".ToUpper(), -1)
+ PaginaDict.Add("/GPS/RepArrastre.aspx".ToUpper(), 718)
PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1)
PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716)
PaginaDict.Add("/Ventas/SolicitudesSAT.aspx".ToUpper(), 717)
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 52c6d3c82..eeffb9d57 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -1829,7 +1829,7 @@ Namespace Modelos
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean
Dim Resultado As Boolean = True
- If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant") Then
+ If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant", "Rem") Then
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx
index 92a134d6d..47d0375be 100644
--- a/Bancos/FluctuacionCambiaria.aspx
+++ b/Bancos/FluctuacionCambiaria.aspx
@@ -3,6 +3,112 @@
+
@@ -40,7 +146,7 @@
@@ -167,8 +388,10 @@
+
+
@@ -187,7 +410,7 @@
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
-
+
diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb
index ad9f24a9d..1855b24b4 100644
--- a/Bancos/FluctuacionCambiaria.aspx.vb
+++ b/Bancos/FluctuacionCambiaria.aspx.vb
@@ -71,6 +71,21 @@ Partial Class Bancos_FluctuacionCambiaria
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then
GvCompras.DataSource = ObjBancos.DtResultados
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
+ Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
+ Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ")
+
+ Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs
+ Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
+
+ Dim Final As Double = GanaciaAux - PerdidaAux
+
+ IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
+
+ LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero
+ LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero
+ LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
+ LblComprasPerdidaGanancia.Text = If(Final > 0, "Ganancia", "Pérdida")
+
LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
GvCompras.DataSource = Nothing
@@ -78,6 +93,7 @@ Partial Class Bancos_FluctuacionCambiaria
End If
ObjBancos.Dispose()
GvCompras.DataBind()
+ UpIndicadores.Visible = True
If GvCompras.Rows.Count > 0 Then
GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2"
End If
@@ -88,7 +104,25 @@ Partial Class Bancos_FluctuacionCambiaria
LblTotalVentas.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then
GvVentas.DataSource = ObjBancos.DtResultados
+
+ Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
+ Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0")
+
+ Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs
+ Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0")
+
+ Dim Final As Double = GanaciaAux - PerdidaAux
+
+ IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
+
+ LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero
+ LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero
+ LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero
+ LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia")
+
LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
+
+ UpIndicadoresVentas.Visible = True
Else
GvVentas.DataSource = Nothing
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
@@ -217,10 +251,12 @@ Partial Class Bancos_FluctuacionCambiaria
CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
idCta = IdCtaGanancia
+ TipoMovto = True
Else
CveConceptoContable = 65
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida
+ TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
ErrorRegistrar = True
@@ -234,7 +270,7 @@ Partial Class Bancos_FluctuacionCambiaria
'movimiento de complementaria
- If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
+ If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
ErrorRegistrar = True
Exit For
End If
@@ -242,7 +278,8 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then
Conta.Commit()
- Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion)
+ Alert(String.Format("La Fluctuación se ha generado Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+
Else
Conta.RollBack()
End If
@@ -275,7 +312,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalVentas.Text.ToDecimal
- If Total < 0 Then
+ If Total > 0 Then
CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
TipoMovto = True
@@ -294,7 +331,7 @@ Partial Class Bancos_FluctuacionCambiaria
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvVentas.Rows
- Total = gvr.DataKey("Fluctuacion").ToDecimal
+ Total = -gvr.DataKey("Fluctuacion").ToDecimal
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
CveConconceptoCliente = 226
@@ -303,7 +340,7 @@ Partial Class Bancos_FluctuacionCambiaria
End If
'movimiento de complementaria
- If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
+ If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
@@ -311,7 +348,8 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then
Conta.Commit()
- Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion)
+ Alert(String.Format("La Fluctuación se ha generado Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+
Else
Conta.RollBack()
End If
@@ -399,7 +437,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar And SeContabilizo Then
Conta.Commit()
- Alert(String.Format("La Fluctuación se ha generado Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+ Alert(String.Format("La Fluctuación se ha generado Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
CargaDatosCuentas()
Else
Conta.RollBack()
@@ -591,8 +629,8 @@ Partial Class Bancos_FluctuacionCambiaria
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
- Dim CveCuentaComplementaria As Integer = 0
- Dim IdCtaComplementaria As Integer = 0
+ Dim CveCuentaComplementaria As Integer = 55206
+ Dim IdCtaComplementaria As Integer = 1081
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
@@ -607,10 +645,12 @@ Partial Class Bancos_FluctuacionCambiaria
CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
idCta = IdCtaGanancia
+ TipoMovto = True
Else
CveConceptoContable = 65
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida
+ TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
ErrorRegistrar = True
@@ -624,7 +664,7 @@ Partial Class Bancos_FluctuacionCambiaria
'movimiento de complementaria
- If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
+ If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
ErrorRegistrar = True
Exit For
End If
diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb
index 7539c52c7..c10e276d1 100644
--- a/Bancos/RepCxCCliente.aspx.vb
+++ b/Bancos/RepCxCCliente.aspx.vb
@@ -34,6 +34,7 @@ Partial Class Bancos_RepCxCCliente
'DdlSubProyecto.SelectedValueExist(UsuarioActual.CveSucursal.ToString)
'[IPP] 8 Enero 2018 - Se quito por que sera reemplazado al cargar solo los subproyectos del usuario
'If UsuarioActual.TienePermisoProceso(152) Then DdlSubProyecto.Enabled = False
+ If UsuarioActual.Sesion("CobroCliente-Sucursal").ToString <> "" Then DdlSubProyecto.SelectedValueExist(UsuarioActual.Sesion("CobroCliente-Sucursal").ToString.Trim)
InicializaPersonalizarColumnas()
@@ -57,6 +58,7 @@ Partial Class Bancos_RepCxCCliente
If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
GvCxC.DataSource = Mov.DtResultados
End If
+ UsuarioActual.Sesion("CobroCliente-Sucursal") = DdlSubProyecto.SelectedValue
Mov.Dispose()
GvCxC.DataBind()
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 4bb00633a..636954eb7 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -2891,7 +2891,33 @@ Partial Class PopUpVerFactura
End If
End If
- End If
+ End If
+
+ Case 42 'ENTRADAS USADOS
+
+ Dim ObjAcum As New ClsAcumuladores
+ Dim DatosEntradasUsados As New DataTable
+ Dim CveAlmacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", String.Format("Almacen = '{0}'", Almacen))
+ If ObjAcum.EntradasUsadosGet(UsuarioActual.CveEmpresa, CveAlmacen.ToEntero, Convert.ToDateTime(Fecha.ToString), Convert.ToDateTime(Today.ToString)) Then
+ DatosEntradasUsados = ObjAcum.DtResultados
+
+ End If
+ ObjAcum.Dispose()
+
+ Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2))
+ Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1)
+
+ Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today))
+
+ Dim params As New List(Of ReportParameter)
+
+ params.Add(New ReportParameter("Direccion", Almacen))
+ params.Add(New ReportParameter("FechaConFormato", FechaConFormato))
+ params.Add(New ReportParameter("FechaInicial", Fecha))
+ params.Add(New ReportParameter("FechaFinal", Today.ToString))
+ params.Add(New ReportParameter("Sucursal", "Sucursal"))
+
+ ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepUsadosEntradas.rdlc", UsuarioActual.CveEmpresa), DtMovimientos, params, "Reporte entrada usados", "PDF", "DsInventarios")
End Select
diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb
index 6d89b4c77..bde535395 100644
--- a/Compras/ReembolsosComprobaciones.aspx.vb
+++ b/Compras/ReembolsosComprobaciones.aspx.vb
@@ -517,7 +517,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
- CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
+ CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
'AGREGO PREPOLIZA IE BANCOS
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
MsgError = "Error al registrar detalle de concepto bancario"
diff --git a/GPS/RepArrastre.aspx b/GPS/RepArrastre.aspx
new file mode 100644
index 000000000..dbb648fe0
--- /dev/null
+++ b/GPS/RepArrastre.aspx
@@ -0,0 +1,243 @@
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %>
+
+
+
+
+
+
+
+ Reporte de Arrastre
+
+
+
+
+
+ Apagar vehiculo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Vehiculo:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ datos vehiculo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Alerta el vehiculo se encuentra en arrastre
+
+
+
+
+
+
+
+ <%----%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GPS/RepArrastre.aspx.cs b/GPS/RepArrastre.aspx.cs
new file mode 100644
index 000000000..4d3e6ab7e
--- /dev/null
+++ b/GPS/RepArrastre.aspx.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using Extensiones;
+
+public partial class GPS_RepArrastre : ClsPaginas
+{
+
+ public int CveDispositivo
+ {
+ get
+ {
+ if (ViewState["CveDispositivo"] != null)
+ {
+ return ViewState["CveDispositivo"].ToString().ToEntero();
+
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ set { ViewState["CveDispositivo"] = value; }
+ }
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!IsPostBack)
+ {
+ // fijo borrar
+ //DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ;
+ DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ;
+ DdlDispositivo.DataBind();
+ getArrastre();
+ }
+
+ }
+ private void getArrastre()
+ {
+ CveDispositivo = DdlDispositivo.SelectedValue.ToEntero();
+ using (ClsGPS objgps = new ClsGPS())
+ {
+ if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
+ {
+ DataRow dtrow = objgps.DtResultados.Rows[0];
+ upInfo(dtrow);
+ }
+
+ }
+ }
+ public void upInfo(DataRow dtrow)
+ {
+ if ( dtrow != null)
+ {
+ LblVelocidad.Text = $"{dtrow["Speed"]:N0}";
+ LblEncApa.Text = $"{dtrow["EncendidoText"]}";
+ LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy HH:mm:ss}";
+ chkActivarArrastre.Checked = dtrow["ArrastreActivo"].ToString() == "1";
+ pnlAlertaActiva.Visible = dtrow["AlertaArrastre"].ToString() == "1";
+ //LblVelocidad.Text = $"{dtrow[""]}";
+ //LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 })
+ string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]);
+ string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]);
+ TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero());
+ UpInfo.Update();
+ }
+ }
+
+ protected void BtnConsultar_Click(object sender, EventArgs e)
+ {
+ getArrastre();
+ }
+
+ protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e)
+ {
+ using (ClsGPS objgps = new ClsGPS())
+ {
+ if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){
+
+ if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
+ {
+ DataRow dtrow = objgps.DtResultados.Rows[0];
+ upInfo(dtrow);
+ }
+ if (chkActivarArrastre.Checked)
+ {
+ Alert("se ha activado la funcion de arrastre");
+ }
+ else
+ {
+ Alert("se ha desactivado la funcion de arrastre");
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Imagenes/rsz_11rsz_cargreen.png b/Imagenes/rsz_11rsz_cargreen.png
index 374265dcd..2d560ffea 100644
Binary files a/Imagenes/rsz_11rsz_cargreen.png and b/Imagenes/rsz_11rsz_cargreen.png differ
diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb
index 687113a45..ceb88aa8a 100644
--- a/Inicio.aspx.vb
+++ b/Inicio.aspx.vb
@@ -54,8 +54,9 @@ Partial Class Inicio
End Function
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
- If Not IsPostBack Then
- If UsuarioActual.CveUsuario = 100 Then
+ If Not IsPostBack Then
+ 'Reporte de ventas sin registrar sig
+ If UsuarioActual.TienePermisoProceso(287) Then
Using objgral As New ClsGenerales
objgral.RepConciliacionSatDetalleGET(UsuarioActual.CveEmpresa, "I", "", "", 10)
@@ -66,8 +67,9 @@ Partial Class Inicio
End Using
GvFoliosSAT.DataBind()
- End If
- If UsuarioActual.CveUsuario = 100 Then
+ End If
+ 'Reporte de ventas pendientes de cancelar
+ If UsuarioActual.TienePermisoProceso(288) Then
Using objventas As New ClsVentas
If (GetFacturasCanceladasPendientesWS(objventas, UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa, False)) AndAlso objventas.DtResultados.Rows.Count > 0 Then
RegistraScript("$('#ModalMitotereCancelaPendiente').modal();", "mitoterosatCanceladasPendientesWS")
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
index c2f15499c..a3b1a02d3 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
@@ -89,11 +89,17 @@ Partial Class Inventarios_Default
If dr IsNot Nothing Then
LtPs.Text = $"Producto: {dr("PSCodigo").ToString}"
+ Dim CvePrecioLista As Integer = -1
+ If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista
+ CvePrecioLista = -2
+ End If
+
Dim ObjVta As New ClsVentas
Dim objPS As New ClsProductosServicios
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
If ObjVta.DtResultados.Rows.Count > 0 Then
- If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero, -1, DDlPS.SelectedValue.ToEntero) Then
+ If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
+ If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
If objPS.DtResultados.Rows.Count > 0 Then
LtPrecioPS.Text = $"Precio de venta: $: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}"
End If
diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx
index 71ed5c269..631f1dc2d 100644
--- a/Inventarios/RecepcionUsados.aspx
+++ b/Inventarios/RecepcionUsados.aspx
@@ -314,7 +314,7 @@
-
+
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index e85f433a3..7f1732916 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -1010,7 +1010,6 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
-
If DdlClientes.SelectedValue.ToEntero <= 0 Then
Alert("No se ha especificado el cliente", TipoMensaje.MsgError)
Exit Sub
@@ -1934,6 +1933,10 @@ Partial Class Inventarios_RecepcionUsados
If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString())
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
+
+ DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCliente = {0}", CveCliente))
+ DdlClientes.DataBind()
+ DdlClientes.SelectedValueExist(CveCliente)
End If
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO
@@ -1959,10 +1962,9 @@ Partial Class Inventarios_RecepcionUsados
DivTotal.Visible = True
End If
Else
- DivCliente.Visible = False
+ 'DivCliente.Visible = False
'DivFactura.Visible = False
End If
-
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
DtUsados = ObjVentas.DtResultados.Copy()
End If
@@ -2646,7 +2648,7 @@ Partial Class Inventarios_RecepcionUsados
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
If ObjAcum.DtResultados.Rows.Count > 0 Then
- TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
+ TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100.0).FormatoNumero
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index 6c61db7de..b392ba7ff 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -2651,7 +2651,8 @@ Partial Class Ventas_ClientesAbonar
ObjConta.Commit()
CargaDatos(CveMonedaFiltro)
RegistraScript("$('#ModalSaldarCuentaIncobrable').modal('hide')")
- Alert("Los movimientos se saldaron correctamente.")
+ Alert(String.Format("Los movimientos se saldaron correctamente. Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+
Else
ObjConta.RollBack()
Alert(MsgError, TipoMensaje.MsgError)
diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx
index bdb588b42..960263d11 100644
--- a/Ventas/ProductosServicios.aspx
+++ b/Ventas/ProductosServicios.aspx
@@ -568,8 +568,8 @@
-
-
+
+
diff --git a/Ventas/RepConciliacionSat.aspx.cs b/Ventas/RepConciliacionSat.aspx.cs
index fc917b6fe..9bf833b30 100644
--- a/Ventas/RepConciliacionSat.aspx.cs
+++ b/Ventas/RepConciliacionSat.aspx.cs
@@ -30,28 +30,6 @@ public partial class Ventas_RepConciliacionSat : ClsPaginas
{
if (!IsPostBack)
{
-
- //CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
- //cryRpt.Load(String.Format("C:\\Proyectos\\wwwSIG\\Empresas\\Grales\\Formatos\\CatPS.rpt", UsuarioActual.Empresa.Ruta));
- //System.Data.DataTable DtDatos = new System.Data.DataTable();
- //using (ClsProductosServicios ObjPS = new ClsProductosServicios())
- //{
- // if (ObjPS.GetPSLite(-1, 119, "-1", "-1", "02541", -1, -1, -1, -1))
- // {
- // DtDatos = ObjPS.DtResultados;
-
- // }
- //}
- //cryRpt.SetDataSource(DtDatos);
- //CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo coninfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
- //cryRpt.
- ////cryRpt.SetDatabaseLogon("JCaudillo", "JCau127*953");// 293357
- //reports.ReportSource = cryRpt;
- //reports.RefreshReport();
- //// reports.Refresh();
-
-
-
DateTime fecha;
DateTime fechaInicio = DateTime.Now;
DateTime fechaFin = DateTime.Now;
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index c0505bbe8..7660824e9 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -4701,7 +4701,12 @@ Partial Class Ventas
LblTelefono.Text = ObjCliente.Telefono
LblRetIVA.Text = ObjCliente.RetIVA.ToString.FormatoNumero(5)
LblRetISR.Text = ObjCliente.RetISR.ToString.FormatoNumero(5)
- If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then TrRetISR.Style.Add("display", "none")
+ If UsuarioActual.Empresa.MostrarRetISR AndAlso ObjCliente.RetISR > 0 Then
+ ' TrRetISR.Style.Add("display", "none")
+ TrRetISR.Visible = True
+ Else
+ TrRetISR.Visible = False
+ End If
ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100
ViewState("ClienteRetISR") = ObjCliente.RetISR / 100
@@ -5935,7 +5940,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
ClienteRetIVA = 0.0D
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
- ClienteRetIVA = 0.1D
+ ClienteRetIVA = 0.106667D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(TmpDT.Rows(e.RowIndex)("EsOutSourcing").ToString()) Then
@@ -6378,7 +6383,8 @@ Partial Class Ventas
Continue For
End If
- If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
+
+ If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then ' si tiene relacionada una OC,
'VALIDA EXISTENCIA
CveProducto = dr("CvePS").ToString.ToEntero
CveUnidad = dr("CveUM").ToString.ToEntero
@@ -6908,7 +6914,8 @@ Partial Class Ventas
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
- GeneraPolizaVentaWS(ObjFactura)
+ Dim TipoPoliza As Integer = 1
+ GeneraPolizaVentaWS(ObjFactura, TipoPoliza)
End If
End If
@@ -10767,7 +10774,7 @@ Partial Class Ventas
Exit For
End If
- If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") Then
+ If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString.ToEntero < 1 Then
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then
OcurrioError = True
@@ -14255,7 +14262,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
ClienteRetIVA = 0.0D
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
- ClienteRetIVA = 0.1D
+ ClienteRetIVA = 0.106667D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(DrPS("EsOutSourcing").ToString()) Then
@@ -15472,7 +15479,7 @@ Partial Class Ventas
If ConSalida AndAlso Not OcurrioError Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
- OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
+ OcurrioError = GenerarMovimientoAlmacenVirtual(CveRemision, ObjInventario, ObjFactura)
End If
If Not OcurrioError Then
@@ -15739,30 +15746,40 @@ Partial Class Ventas
Try
Dim CveMovimientoVirtual As Integer = -1
Dim CveAlmacenVirtual As Integer = -1
- Dim CveConceptoMovimientoVirtual As Integer = 3
+ Dim CveConceptoMovimientoVirtual As Integer = 36
Dim DtPSVirtual As DataTable = Nothing
Dim DtTamanios As DataTable = Nothing
Dim CveMovimientoEntradaDev As Integer = -1
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
- Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 2 AND CveVenta > 0")
+ Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND ((CveTipoAlmacen = 24 AND CveConcepto = 2) OR (CveTipoAlmacen = 1 AND CveConcepto = 8)) AND CveVenta > 0")
+
+ If RowMovimiento IsNot Nothing Then
+ CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
+ CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
+ Else
+ OcurrioError = True
+ End If
- CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
- CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
Else
OcurrioError = True
End If
-
- 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
- If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
+ If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
DtPSVirtual = ObjInventario.DtResultados.Copy()
Else
OcurrioError = True
End If
+ 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
+ 'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaDev, UsuarioActual.CveEmpresa) Then
+ ' DtPSVirtual = ObjInventario.DtResultados.Copy()
+ 'Else
+ ' OcurrioError = True
+ 'End If
+
If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then
- CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V")
+ CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/V", CveMovimientoRelacionado:=CveMovimientoEntradaDev)
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
@@ -15787,7 +15804,7 @@ Partial Class Ventas
OcurrioError = True
End Try
- Return Not OcurrioError
+ Return OcurrioError
End Function
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
@@ -23921,22 +23938,23 @@ Partial Class Ventas
GvCodigosUnicos.DataBind()
End If
End Sub
- Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura)
+ Protected Sub GeneraPolizaVentaWS(ObjFactura As Modelos.Factura, TipoPoliza As Integer)
+ 'TipoPoliza: 01 Venta, 02 Ajuste, 03 Garantía
Try
For Each Row As GridViewRow In GvCodigosUnicos.Rows
If Row.RowType = DataControlRowType.DataRow Then
Dim obj As New Modelos.MPolizaVentaWS
'DATOS DEL CLIENTE
obj.customer_name = ObjFactura.Cliente.Nombre
- obj.customer_last_name1 = ""
+ obj.customer_last_name1 = "."
obj.customer_last_name2 = ""
obj.customer_birthday = Nothing
obj.customer_phone = ObjFactura.Cliente.Telefono
obj.customer_email = ObjFactura.Cliente.Mail
obj.customer_gender = "03" 'OTRO GENERO
obj.customer_advertising = False
- obj.customer_car_brand = "00"
- obj.customer_car_model = "00"
+ obj.customer_car_brand = "01"
+ obj.customer_car_model = "01"
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA
@@ -23946,12 +23964,12 @@ Partial Class Ventas
obj.sale_type_service = "02" 'COMERCIAL
obj.sale_total = ObjFactura.Total
obj.sale_discount = ObjFactura.Descuento
- obj.sale_id = String.Format("{0}{1}{2}", ObjFactura.Serie, ObjFactura.Folio, ObjFactura.CveVenta)
+ obj.sale_id = ObjFactura.CveVenta.ToString
'DATOS DEL PRODUCTO
obj.product_code = Row.DataKey("IdProductoPolizaVirtual").ToString()
obj.product_unique_code = Row.FCTextBox("TxtCodigoUnico").Text 'se indique el código único de la batería. (SERIE LOTE)
- obj.product_sale_type = "01 " 'VENTA
+ obj.product_sale_type = "0" & TipoPoliza 'VENTA
Dim FechaUsado As DateTime = Row.DataKey("FechaAjuste").ToString().ToDateTime()
@@ -24052,7 +24070,7 @@ Partial Class Ventas
For Each RowServicio As DataRow In TmpDT.Rows
Dim ClienteRetIVA = 0.0D
If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
- ClienteRetIVA = 0.1D
+ ClienteRetIVA = 0.106667D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
ClienteRetIVA = 0.04D
ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then
diff --git a/reporteador.aspx b/reporteador.aspx
new file mode 100644
index 000000000..7839d5639
--- /dev/null
+++ b/reporteador.aspx
@@ -0,0 +1,51 @@
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="reporteador.aspx.cs" Inherits="reporteador" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+