diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb
index 6d76cfee3..c367fba25 100644
--- a/Acumuladores/CatFoliosGarantia.aspx.vb
+++ b/Acumuladores/CatFoliosGarantia.aspx.vb
@@ -47,7 +47,8 @@ Partial Class Acumuladores_CatFoliosGarantia
#Region "Folios Garantía"
Private Sub CargaSubProyectos()
- CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, lblSubProyecto)
+ CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, lblSubProyecto)
+ CargarCentrosDeCosto(Nothing, DdlSubProyectoFiltro, Nothing, lblSubProyecto)
GvFolioGarantia.Columns(3).HeaderText = lblSubProyecto.Text
End Sub
@@ -55,7 +56,7 @@ Partial Class Acumuladores_CatFoliosGarantia
Dim objAcum As New ClsAcumuladores
- If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=EstatusValor, TipoFolio:=tipoFolioValor, Area:=-1) Then
+ If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa, Estatus:=EstatusValor, TipoFolio:=tipoFolioValor, Area:=-1, CveSubProyecto:=DdlSubProyectoFiltro.SelectedValue.ToEntero()) Then
GvFolioGarantia.DataSource = objAcum.DtResultados
Else
GvFolioGarantia.DataSource = Nothing
@@ -92,7 +93,7 @@ Partial Class Acumuladores_CatFoliosGarantia
BtnAgregarFolioGarantiaModal.Text = "Agregar"
TxtFolioGarantia.Text = ""
- ChkEstatus.Checked = True
+ DdlEstatusEditar.SelectedValueExist("1")
DdlSubProyectos.SelectedValueExist("-1")
Actualizar = False
@@ -114,10 +115,10 @@ Partial Class Acumuladores_CatFoliosGarantia
If Not Actualizar Then
- If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then
+ If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then
TxtFolioGarantia.Text = ""
- ChkEstatus.Checked = True
+ DdlEstatusEditar.SelectedValueExist("1")
'TxtCargo.Text = ""
'TxtBonificacion.Text = ""
'TxtCompra.Text = ""
@@ -133,11 +134,11 @@ Partial Class Acumuladores_CatFoliosGarantia
Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError)
End If
Else
- If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero,
+ If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero,
DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero) Then
TxtFolioGarantia.Text = ""
- ChkEstatus.Checked = True
+ DdlEstatusEditar.SelectedValueExist("1")
'TxtCargo.Text = ""
'TxtBonificacion.Text = ""
'TxtCompra.Text = ""
@@ -191,7 +192,7 @@ Partial Class Acumuladores_CatFoliosGarantia
CveFolioGarantia = GvRow.DataKey("CveFolioGarantia")
TxtFolioGarantia.Text = GvRow.DataKey("FolioGarantia")
- ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
+ DdlEstatusEditar.SelectedValueExist(GvRow.DataKey("CveEstatus"))
TxtLimite.Text = GvRow.DataKey("Limite")
DdlTipoFolioModal.SelectedValue = GvRow.DataKey("tipoFolio")
'TxtCargo.Text = GvRow.DataKey("Cargo").ToDecimal.ToString("###,###,###.00")
diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index 365c14035..7f01aa20f 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -521,7 +521,7 @@ Public Class ClsAcumuladores
With SqlAdapter.SelectCommand.Parameters
.Add("@FolioGarantia", SqlDbType.VarChar).Value = FolioGarantia
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
@@ -553,7 +553,7 @@ Public Class ClsAcumuladores
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
.Add("@FolioGarantia", SqlDbType.VarChar).Value = FolioGarantia
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoFolio", SqlDbType.VarChar).Value = TipoFolio
diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index 154097b80..5b4bd4c6b 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -567,7 +567,7 @@ Public Class ClsClientes
Optional AplicaComercioExterior As Boolean = False, Optional CveTipoOperacion As Integer = -1, Optional CvePedimento As Integer = -1, Optional CveIncoterm As Integer = -1, Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1,
Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
- Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1) As Boolean
+ Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -707,6 +707,8 @@ Public Class ClsClientes
.Add("@CorreoEntregaAlmacen", SqlDbType.VarChar).Value = CorreoEntregaAlmacen
.Add("@CveSATEstado", SqlDbType.Int).Value = CveSATEstado
+ .Add("@CveAdminTrayecto", SqlDbType.TinyInt).Value = CveAdminTrayecto
+
End With
Try
@@ -755,7 +757,7 @@ Public Class ClsClientes
Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "-1", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1",
Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
- Optional CveSATEstado As Integer = -1) As Boolean
+ Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -910,7 +912,7 @@ Public Class ClsClientes
.Add("@CorreoEntregaAlmacen", SqlDbType.VarChar).Value = CorreoEntregaAlmacen
.Add("@CveSATEstado", SqlDbType.Int).Value = CveSATEstado
-
+ .Add("@CveAdminTrayecto", SqlDbType.TinyInt).Value = CveAdminTrayecto
End With
Try
diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb
index 568713257..a16f069eb 100644
--- a/App_Code/ClsGPS.vb
+++ b/App_Code/ClsGPS.vb
@@ -3231,7 +3231,7 @@ Public Class ClsGPS
Return retorno
End Function
- Public Function DispositivosUsuariosGet(CveDispositivo As Integer, CveEstatus As Integer, CveCliente As Integer, Optional CveEmpresa As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean
+ Public Function DispositivosUsuariosGet(CveDispositivo As Integer, CveEstatus As Integer, CveCliente As Integer, Optional CveEmpresa As Integer = -1, Optional CveUsuario As Integer = -1, Optional ConcatenarDispuestos As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_GPS_DispositivosUsuariosGet")
With SqlAdapter.SelectCommand.Parameters
@@ -3240,6 +3240,7 @@ Public Class ClsGPS
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@ConcatenarDispuestos", SqlDbType.Bit).Value = ConcatenarDispuestos
End With
Try
SqlAdapter.Fill(Data)
@@ -5105,6 +5106,41 @@ Public Class ClsGPS
Return retorno
End Function
+ Public Function UpdateUnidadesDispuestas(CveDispositivo As Integer, Dispuesta As Boolean) As Boolean
+ Dim retorno As Boolean = False
+ DataAdapter("PA_GPS_UnidadesDispuestasUpdate", CommandType.StoredProcedure)
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo
+ .Add("@Dispuesta", SqlDbType.Bit).Value = Dispuesta
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar las unidades dispuestas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return retorno
+ End Function
+
+ Public Function GetUnidadesDispuestas(CveDispositivo As Integer, CveCliente As Integer, CveEmpresa As Integer) As Boolean
+ Dim retorno As Boolean = False
+ DataAdapter("PA_GPS_UnidadesDispuestasGet", CommandType.StoredProcedure)
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las unidades dispuestas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return retorno
+ End Function
+
#End Region
#Region "G A S T O S"
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index e72bfba0e..a15ada6c8 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -1,6 +1,7 @@
Option Explicit On
Option Strict On
+Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
@@ -1753,6 +1754,33 @@ Public Class ClsInventarios
Return Retorno
End Function
+ Public Function RepExistenciasLote(CveEmpresa As Integer, FechaI As Date, FechaF As Date, CveProveedor As Integer, Almacenes As String,
+ CvePS As Integer, CveClasificacion As Integer, Optional CveMarca As Integer = -1, Optional CveTipoAlmacen As String = "-1") As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_RepExistenciaLote")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaI", SqlDbType.Date).Value = FechaI
+ .Add("@FechaF", SqlDbType.Date).Value = FechaF
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener la lista de movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
'Nuevo R: 19/10/2017
Public Function RepMovimientosGen(CveEmpresa As Integer, FechaI As String, FechaF As String, CveProveedor As Integer, CveAlmacen As Integer,
CvePS As Integer, CveClasificacion As Integer, Agrupador As Integer, Optional CveClasificacion2 As Integer = -1) As Boolean
@@ -1877,7 +1905,7 @@ Public Class ClsInventarios
Return Retorno
End Function
- Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveEmpresa As Integer) As Boolean
+ Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveTipoAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_RepTraspasoAlmacen")
@@ -1887,6 +1915,7 @@ Public Class ClsInventarios
.Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen
.Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino
.Add("@Recibido", SqlDbType.Bit).Value = Recibido
+ .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -3061,7 +3090,7 @@ Public Class ClsInventarios
#Region " INVENTARIOS - COMPRAS "
- Public Function RecepcionAlmacenGet(CveCompra As Integer, TipoRecepcion As Integer, CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As Boolean
+ Public Function RecepcionAlmacenGet(CveCompra As Integer, TipoRecepcion As Integer, CveProveedor As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_RecepcionAlmacenGet")
With SqlAdapter.SelectCommand.Parameters
@@ -3069,6 +3098,7 @@ Public Class ClsInventarios
.Add("@TipoRecepcion", SqlDbType.Int).Value = TipoRecepcion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 24d24e0cd..6f614ab00 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2356,6 +2356,33 @@ Public Class ClsPaginas
End Set
End Property
+ Property GlobalDTGralMarcas(CveEmpresa As Integer, Optional CveMarca As Integer = -1) As DataTable
+ Get
+ Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
+ Dim ObjMarcas As New ClsProductosServicios
+ If ObjMarcas.GetMarcas(CveEmpresa) Then Application(AppNombre) = ObjMarcas.DtResultados Else Application(AppNombre) = Nothing
+ ObjMarcas.Dispose()
+ End If
+
+ Dim filtro As New StringBuilder
+ If CveMarca > 0 Then
+ filtro.AppendFormat(" CveMarca={0} ", CveMarca)
+ End If
+
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
+ GlobalDTGralMarcas = Dv.ToTable
+ Dv.Dispose()
+
+
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa)
+ Application(AppNombre) = value
+ End Set
+ End Property
+
#End Region
#Region "***********************************************************************DT PROSPECTOS*************************************************************************************"
@@ -4716,6 +4743,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/CatAlmacenClasificacionSecciones.aspx".ToUpper(), 764)
PaginaDict.Add("/Inventarios/ReconstruirCostos.aspx".ToUpper(), 764)
PaginaDict.Add("/Inventarios/RecepcionDevolucion.aspx".ToUpper(), 696)
+ PaginaDict.Add("/Inventarios/RepExistenciaLote.aspx".ToUpper(), 109)
#End Region
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 6242b9d0e..4af16b530 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -1342,13 +1342,14 @@ Public Class ClsProductosServicios
Return Retorno
End Function
- Public Function AddPSAlias(PS As String, CvePS As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
+ Public Function AddPSAlias(PS As String, CvePS As Integer, Flexible As Boolean, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosAliasAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@PSAlias", SqlDbType.VarChar).Value = If(PS.Length > 845, PS.Substring(0, 845), PS)
.Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Flexible", SqlDbType.Bit).Value = If(Flexible, 1, 0)
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With
@@ -1360,7 +1361,12 @@ Public Class ClsProductosServicios
If Ex1.Message.Contains("Número: 2627;") Then
OnError("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
- Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ If Ex1.Message.Contains("Número: 5555;") Then
+ Dim Str As String = Ex1.Message.Substring(14) 'toma el valor posterior
+ OnError("No se puede registrar un alias porque ya existe la siguiente:" + Str, Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Else
+ Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index cc953d4a8..c0ca015c2 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -2826,7 +2826,7 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
+ Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUtilidadGet")
@@ -2839,6 +2839,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try
@@ -2853,7 +2854,7 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
+ Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUtilidadDetalleGet")
With SqlAdapter.SelectCommand.Parameters
@@ -2866,6 +2867,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try
@@ -2883,7 +2885,7 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
+ Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepVentasUtilidadGet")
@@ -2897,6 +2899,7 @@ Public Class ClsVentas
.Add("@Gpo", SqlDbType.Int).Value = Gpo
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try
SqlAdapter.Fill(Data)
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 7bde7a0bc..1ad24c658 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -3222,10 +3222,8 @@ Partial Class Bancos_IE
IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2)
- Dim CveCuentaDevolucionIMPUESTOS As Integer = -1
Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1
-
If DdlMoneda.SelectedValue.ToEntero > 1 Then
IVADevMN = IVADev
IEPSDevMN = IEPSDev
@@ -3239,15 +3237,13 @@ Partial Class Bancos_IE
If IVADev > 0 Then
- CveCuentaDevolucionIMPUESTOS = CveCuentaIVAxAcreditarDevDinC
IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev) Then
- CveCuentaDevolucionIMPUESTOS = CveCuentaIVAAcreditableDevDinC
IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
ErrorDevolucionImpuestos = True
End If
@@ -3263,22 +3259,19 @@ Partial Class Bancos_IE
'Dim ObjContabilidad As New ClsContabilidad
If ObjMov.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then
Try
- CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero
IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IEPSDev, ReferenciaAplicar, 25, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IEPSDev, ReferenciaAplicar, 25, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev) Then
If ObjMov.GetRetCuenta(26, UsuarioActual.CveEmpresa) Then
Try
- CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero
IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IEPSDev, ReferenciaAplicar, 26, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IEPSDev, ReferenciaAplicar, 26, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
ErrorDevolucionImpuestos = True
End If
-
Catch ex As Exception
Alert("Se presento un error al obtener las cuentas de IEPS acreditable.")
ErrorDevolucionImpuestos = True
@@ -3456,7 +3449,6 @@ Partial Class Bancos_IE
IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2)
- Dim CveCuentaDevolucionIMPUESTOS As Integer = -1
Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1
@@ -3473,15 +3465,13 @@ Partial Class Bancos_IE
If IVADev > 0 Then
- CveCuentaDevolucionIMPUESTOS = CveCuentaIVAxAcreditarDevDinC
IdCtaIVADevolucionIMPUESTOS = IdCtaIVAXAcreditarDevDinC
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not True, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, ReferenciaAplicar, 14, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev) Then
- CveCuentaDevolucionIMPUESTOS = CveCuentaIVAAcreditableDevDinC
IdCtaIVADevolucionIMPUESTOS = IdCtaIVAAcreditableDevDinC
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, ReferenciaAplicar, 19, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IVADevMN, ImporteME:=-IVADev) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
ErrorDevolucionImpuestos = True
End If
@@ -3497,17 +3487,15 @@ Partial Class Bancos_IE
'Dim ObjContabilidad As New ClsContabilidad
If ObjMov.GetRetCuenta(25, UsuarioActual.CveEmpresa) Then
Try
- CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditarSIG").ToString.ToEntero
IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IEPSDev, ReferenciaAplicar, 25, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IEPSDev, ReferenciaAplicar, 25, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev) Then
If ObjMov.GetRetCuenta(26, UsuarioActual.CveEmpresa) Then
Try
- CveCuentaDevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero
IdCtaIVADevolucionIMPUESTOS = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IEPSDev, ReferenciaAplicar, 26, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev, CveCuenta:=CveCuentaDevolucionIMPUESTOS) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IEPSDev, ReferenciaAplicar, 26, ConceptoAplicar, Now, IdCtaIVADevolucionIMPUESTOS, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=-IEPSDevMN, ImporteME:=-IEPSDev) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución "
ErrorDevolucionImpuestos = True
End If
@@ -6476,10 +6464,10 @@ Partial Class Bancos_IE
Protected Sub LnkCancelarComplemetno_Click(sender As Object, e As EventArgs)
- If ChkConciliado.Checked Then
- Alert("El documento se encuentra conciliado, no se puede cancelar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
+ 'If ChkConciliado.Checked Then
+ ' Alert("El documento se encuentra conciliado, no se puede cancelar.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 80ebeed31..468b3e084 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -1661,6 +1661,40 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
+
+ If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
+ 'fluctuación.
+ Dim TCPago = TxtTCDolares.Text.ToDecimal
+
+ Dim ImporteFluctuacion As Decimal = 0 '((ImporteSeleccionado / TCPago) - TxtImporte.Text.ToDecimal)
+
+ Dim DtPrePoliza As DataTable = Nothing
+ If ObjMov.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ DtPrePoliza = ObjMov.DtResultados.Copy
+ End If
+
+ Dim PagoProveedoresME = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 312 AND TipoMovto = 0")
+ Dim Bancos = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 30 AND TipoMovto = 1")
+ Dim BancosComplementaria = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 204 AND TipoMovto = 1")
+
+ DtPrePoliza.Dispose()
+
+ ImporteFluctuacion = PagoProveedoresME - (Bancos + BancosComplementaria)
+
+ If ImporteFluctuacion.RoundSQL() <> 0 Then
+ 'SI EL PAGO DE PROVEEDORES ME ES MAYOR QUE BANCOS METER EL CONCEPTO DE GANANCIA
+ If ImporteFluctuacion > 0 Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Referencia, 64, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+ ElseIf ImporteFluctuacion < 0 Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Referencia, 65, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then
+ MsgError = "Ocurrio un error al saldar el movimiento"
+ End If
+ End If
+ End If
+ End If
+
Else
If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
TipoCambioPago = TxtTCDolares.Text.ToDecimal
diff --git a/Bancos/RepIE.aspx b/Bancos/RepIE.aspx
index c1a7bb7be..ae5d9e704 100644
--- a/Bancos/RepIE.aspx
+++ b/Bancos/RepIE.aspx
@@ -69,7 +69,7 @@
-
+
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 74bee1337..19f9b146a 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -4587,8 +4587,11 @@
-
+
+
+
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 637b9c61f..8f680c62e 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1617,6 +1617,11 @@ Partial Class Compras_Compras
DdlTipoGastoAsignar.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
DdlTipoGastoAsignar.DataBind()
UpParametros.Update()
+
+ If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa = 119 Then
+ ChkAliasFlexible.Visible = True
+ End If
+
End Sub
Private Sub CargaGvAcarreos(tCveProveedor As Integer)
@@ -1649,7 +1654,7 @@ Partial Class Compras_Compras
Private Function CargaFactura(CveFactura As Integer) As String
Dim ObjeFacturas As New ClsCompras
Dim RFC As String = ""
- If ObjeFacturas.GetFacturas(CveFactura, "-1", Now.AddYears(-3), Now, "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
+ If ObjeFacturas.GetFacturas(CveFactura, "-1", Now.AddYears(-4), Now, "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
Dim XMLDoc As New XmlDocument
@@ -5962,10 +5967,6 @@ Partial Class Compras_Compras
End If
End If
-
-
-
-
End If
If TipoCambioCompra > 1 AndAlso DdlMoneda.SelectedValue.ToEntero <> 1 Then Concepto += $" TC{TipoCambioCompra} ${importeMovimiento.FormatoNumero(2)}"
@@ -6062,7 +6063,7 @@ Partial Class Compras_Compras
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
Case 14 'IVA X Acreditar
importeMovimiento = importeIVAxAcreditar
- importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
+ importeMN = (importeMovimiento * tipoCambioActual * Multiplicador).RoundSQL
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
PorcentajeImpuesto = PorcentajeIVA
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
@@ -6382,30 +6383,30 @@ Partial Class Compras_Compras
Else
importeMovimiento = 0
End If
- Case 285 'Ret IVA 6% Servicios
+ 'Case 285 'Ret IVA 6% Servicios
- IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
+ ' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
- 'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
- ' If ObjConta.DtResultados.Rows.Count > 0 Then
- ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
- ' End If
- 'End If
+ ' 'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
+ ' ' If ObjConta.DtResultados.Rows.Count > 0 Then
+ ' ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ ' ' End If
+ ' 'End If
- If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
+ ' If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
- If CveMoneda = 2 Then
- importeMN = TxtRetIVA.Text.ToDecimal * TxtTC.Text.ToDecimal
- Else
- importeMN = TxtRetIVA.Text.ToDecimal
- importeMovimiento = TxtRetIVA.Text.ToDecimal
+ ' If CveMoneda = 2 Then
+ ' importeMN = TxtRetIVA.Text.ToDecimal * TxtTC.Text.ToDecimal
+ ' Else
+ ' importeMN = TxtRetIVA.Text.ToDecimal
+ ' importeMovimiento = TxtRetIVA.Text.ToDecimal
- End If
+ ' End If
- Else
- importeMovimiento = 0
- End If
+ ' Else
+ ' importeMovimiento = 0
+ ' End If
Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141, 152, 153, 154, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
@@ -8446,7 +8447,7 @@ Partial Class Compras_Compras
Dim Respuesta As Boolean = False
- Dim IVADetalles As Decimal = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
+ Dim IVADetalles As Decimal = TmpDT.SUMD("IVA", " IVA > 0 ")
Dim DiferenciaIVas As Decimal = TxtIVA.Text.ToDecimal - IVADetalles
@@ -8459,8 +8460,9 @@ Partial Class Compras_Compras
End If
For Each dRow As DataRow In TmpDT.Rows
- If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dRow("CvePS").ToString.ToEntero).Rows.Count > 0 Then
- Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dRow("CvePS").ToString.ToEntero).Rows(0)
+ Dim DttPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dRow("CvePS").ToString.ToEntero)
+ If DttPS.Rows.Count > 0 Then
+ Dim DrPS As DataRow = DttPS.Rows(0)
dRow("AplicaIEPS") = Boolean.Parse(DrPS("AplicaIEPS").ToString)
dRow("IEPSGrabaIVA") = Boolean.Parse(DrPS("IEPSGrabaIVA").ToString)
Else
@@ -8486,7 +8488,7 @@ Partial Class Compras_Compras
IndiceContador = IndiceContador + 1
Next
- IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
+ IVADetalles = TmpDT.SUMD("IVA", " IVA > 0 ")
DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles
If Math.Abs(DiferenciaIVas) > 0.01D Then
@@ -8506,21 +8508,16 @@ Partial Class Compras_Compras
TmpDT.Rows(IndiceUltimo)("IVA") = TmpDT.Rows(IndiceUltimo)("IVA").ToString.ToDecimal + DiferenciaIVas
End If
-
-
TmpDT.AcceptChanges()
End If
End If
-
'Revalidacion de ajuste
- IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
+ IVADetalles = TmpDT.SUMD("IVA", " IVA > 0 ")
DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles
-
-
If Math.Abs(DiferenciaIVas) > 0.01D Then
Respuesta = False
If IVADetalles > 0 Then
@@ -8542,8 +8539,6 @@ Partial Class Compras_Compras
Respuesta = True
End If
-
-
If Respuesta Then
Dim IEPSPSDetalles As Decimal = TmpDT.SUMD("IEPSPS", " IEPSPS > 0 ")
@@ -8552,11 +8547,9 @@ Partial Class Compras_Compras
Dim DTConsultaIEPSPS As New DataTable
DTConsultaIEPSPS = TmpDT.FiltraParametros(" AplicaIEPS = 'True'")
-
Dim IndiceContador As Integer = 0
Dim IndicePrimero As Integer = 0
-
For Each dRow As DataRow In TmpDT.Rows
If Boolean.Parse(dRow("AplicaIEPS").ToString) Then
IndicePrimero = IndiceContador
@@ -8590,12 +8583,6 @@ Partial Class Compras_Compras
End If
-
-
-
-
-
-
Return Respuesta
End Function
@@ -15471,7 +15458,7 @@ Partial Class Compras_Compras
Dim Cont As Integer = 0
For Each gvr As GridViewRow In GvOC1.Rows
- RegistraScript($"CalculaTotalOCEdit('{gvr.DataKey("PS").Replace("'", "")}', {gvr.DataKey("CantidadPendienteVincular").ToString.ToDouble}, {gvr.FCTextBox("TxtCantidad").ClientID}, {gvr.FCTextBox("TxtPU").ClientID}, {gvr.FCTextBox("TxtTotalOC1").ClientID}, {gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {gvr.DataKey("IVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IVA").ClientID},{gvr.DataKey("RetIVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetIVA").ClientID},{gvr.DataKey("RetISR").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetISR").ClientID},{gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSIVA").ClientID},{gvr.DataKey("Descuento")},{gvr.FCHiddenField("HdnOC1Descuento").ClientID},{gvr.DataKey("IVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetIVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetISRPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSIVAPorcentaje").ToString.ToDouble});", $"Gv{Cont}")
+ RegistraScript($"CalculaTotalOCEdit('{gvr.DataKey("PS").Replace("'", "")}', {gvr.DataKey("Cantidad").ToString.ToDouble}, {gvr.FCTextBox("TxtCantidad").ClientID}, {gvr.FCTextBox("TxtPU").ClientID}, {gvr.FCTextBox("TxtTotalOC1").ClientID}, {gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {gvr.DataKey("IVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IVA").ClientID},{gvr.DataKey("RetIVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetIVA").ClientID},{gvr.DataKey("RetISR").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetISR").ClientID},{gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSIVA").ClientID},{gvr.DataKey("Descuento")},{gvr.FCHiddenField("HdnOC1Descuento").ClientID},{gvr.DataKey("IVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetIVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetISRPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSIVAPorcentaje").ToString.ToDouble});", $"Gv{Cont}")
Cont += 1
Next
@@ -15487,7 +15474,7 @@ Partial Class Compras_Compras
Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- Dim JSCambiaScript = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "")}', {e.Row.DBCampo("CantidadPendienteVincular").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
+ Dim JSCambiaScript = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}")
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript)
@@ -18666,12 +18653,18 @@ Partial Class Compras_Compras
UpPSAlias.Update()
End Sub
Protected Sub BtnAddPSAlias_Click(sender As Object, e As EventArgs) Handles BtnAddPSAlias.Click
- Dim PS As New ClsProductosServicios
- Dim CvePS = -1
- Dim tPS = ""
- Dim CveSubProyecto As Integer = TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CveSubProyecto").ToString.ToEntero
+
+ Dim CvePS As Integer = -1
+ Dim tPS As String = ""
+
CvePS = DdlPSAlias2.SelectedValue.ToEntero
tPS = DdlPSAlias2.SelectedText
+ If CvePS <= 0 Then
+ Alert("No se ha seleccionado el producto.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ Dim CveSubProyecto As Integer = TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CveSubProyecto").ToString.ToEntero
+
Dim DtpsTemp As DataTable = Nothing
Dim CveContrato As Integer = GlobalDTContratos(UsuarioActual.CveEmpresa, -1, CveSubProyecto).FiltroPrimeroValor("CveContrato").ToEntero
If CveContrato > 0 Then
@@ -18685,9 +18678,9 @@ Partial Class Compras_Compras
DtpsTemp = GetPSContratoDetalle(CveContrato, dttemp)
End If
-
- If PS.AddPSAlias(System.Web.HttpUtility.HtmlDecode(TxtPSAlias.Text.Trim), CvePS, UsuarioActual.CveUsuario) Then
- GlobalDTProductosServiciosAlias(-1) = PS.DtResultados
+ Dim PS As New ClsProductosServicios
+ If PS.AddPSAlias(System.Web.HttpUtility.HtmlDecode(TxtPSAlias.Text.Trim), CvePS, ChkAliasFlexible.Checked, UsuarioActual.CveUsuario) Then
+ GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = PS.DtResultados
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CvePS") = CvePS
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("PS") = tPS
@@ -20954,6 +20947,10 @@ Partial Class Compras_Compras
UpFacturaNC.Update()
UpMostrarTodos.Update()
End Sub
+
+ Private Sub ChkAliasFlexible_CheckedChanged(sender As Object, e As EventArgs) Handles ChkAliasFlexible.CheckedChanged
+ TxtPSAlias.Enabled = ChkAliasFlexible.Checked
+ End Sub
End Class
Public Class MMensajeDevolucion
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index b44d243cc..8ebb9c854 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -915,12 +915,206 @@ Partial Class PopUpVerFactura
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
'HttpContext.Current.Response.Flush()
- HttpContext.Current.Response.End()
+ HttpContext.Current.Response.End()
+ Else
+
End If
Archivo = Nothing
End If
End Sub
+ 'Protected Sub LnkGenerarPDF_Click(sender As Object, e As EventArgs)
+ ' GeneraPDFFactura()
+ 'End Sub
+ 'Private Sub GeneraPDFFactura()
+ ' Try
+ ' Dim objFactura = CreaObjetosVenta()
+ ' PdfFactura(objFactura)
+ ' objFactura.Dispose()
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al generar el PDF", ex)
+ ' End Try
+ 'End Sub
+
+ 'Private Function CreaObjetosTraslado() As Modelos.Factura
+ ' Dim ObjFactura = New Modelos.Factura
+ ' ObjFactura.Version = "3.3"
+ ' ObjFactura.CveUsuario = UsuarioActual.CveUsuario
+ ' ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
+ ' ObjFactura.TipoCambio = 0
+ ' ObjFactura.ConvertirPesos = False
+ ' ObjFactura.TipoCambio = 0
+ ' ObjFactura.CveMoneda = 1
+ ' ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
+ ' ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1")
+ ' ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ")
+ ' ObjFactura.TipoDocto = "Tra"
+ ' ObjFactura.RefDocto = ""
+ ' ObjFactura.Folio = Folio.ToEntero
+ ' ObjFactura.Serie = "Tra"
+ ' ObjFactura.CveMesa = -1
+ ' ObjFactura.Fecha = Now
+ ' ObjFactura.CvePrePoliza = -1
+ ' ObjFactura.FechaPago = Now
+ ' ObjFactura.MotivoDescuento = ""
+ ' ObjFactura.Observaciones = ""
+ ' ObjFactura.FechaEjecucion = Now
+ ' ObjFactura.UsuarioCreo = UsuarioActual.Usuario
+ ' ObjFactura.CveCondicionEntrega = -1
+ ' ObjFactura.CondicionEntrega = ""
+ ' ObjFactura.NumeroCuenta = ""
+ ' ObjFactura.CondicionesPago = 0
+ ' ObjFactura.FormaPago = 0
+ ' ObjFactura.PedidoContrato = ""
+ ' ObjFactura.OrdenCompra = ""
+ ' ObjFactura.NumeroContrato = ""
+ ' ObjFactura.NumeroDescripcionContrato = ""
+ ' ObjFactura.DescripcionContrato = ""
+ ' ObjFactura.CveCorte = -1
+ ' ObjFactura.TipoDocumento = "Traspaso"
+ ' ObjFactura.Alfa1 = ""
+ ' ObjFactura.Alfa2 = ""
+ ' ObjFactura.Alfa3 = ""
+ ' ObjFactura.Descuento = 0
+ ' ObjFactura.Amortizacion = 0
+ ' ObjFactura.CveContrato = 0
+ ' ObjFactura.CveVendedor = 0
+ ' ObjFactura.FechaVencimiento = Now
+ ' ObjFactura.TipoEstatus = 0
+ ' ObjFactura.Det_OrdenCompra = ""
+ ' ObjFactura.Inv_CveEstatusEntrega = 0
+ ' ObjFactura.FormaPago33 = ""
+ ' ObjFactura.MetodoPago33 = ""
+ ' ObjFactura.UsoCFDI = ""
+ ' ObjFactura.CveClienteSucursal = 0
+ ' Dim CveSubProyecto As Integer = -1
+ ' If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows.Count > 0 Then
+ ' CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero
+ ' End If
+ ' ObjFactura.CveSubProyecto = CveSubProyecto
+ ' ObjFactura.CveSubProyectoCobranza = CveSubProyecto
+ ' ObjFactura.CveSubProyectoEjecucion = CveSubProyecto
+
+ ' ObjFactura.SubTotal = 0
+ ' ObjFactura.Descuento = 0
+ ' ObjFactura.Amortizacion = 0
+ ' ObjFactura.IVA = 0
+ ' ObjFactura.RetIVA = 0
+ ' ObjFactura.RetISR = 0
+ ' ObjFactura.IEPS = 0
+ ' ObjFactura.Total = 0
+ ' ObjFactura.RFCReceptor = "XAXX010101000"
+
+ ' Dim dt As DataTable = DtMovimientos.Copy
+
+ ' dt.Columns.Add("TotalImporte", Type.GetType("System.Double"))
+ ' dt.Columns.Add("Descuento", Type.GetType("System.Double"))
+ ' dt.Columns.Add("UM")
+ ' dt.Columns.Add("SATClaveUM")
+ ' dt.Columns.Add("SATClaveProdServ")
+ ' dt.Columns.Add("Noidentificacion")
+ ' dt.Columns.Add("CuentaPredial")
+ ' dt.Columns.Add("Obs")
+ ' dt.Columns.Add("ImporteIVA", Type.GetType("System.Double"))
+ ' dt.Columns.Add("PorcentajeIVA", Type.GetType("System.Double"))
+
+
+ ' For Each Row As DataRow In dt.Rows
+ ' Row("TotalImporte") = Row("Total")
+ ' Row("Descuento") = 0
+ ' Row("UM") = Row("UnidadMedida")
+ ' Row("SATClaveUM") = Row("SATClaveUnidadMedida")
+ ' Row("SATClaveProdServ") = Row("SATClavePS")
+ ' Row("Noidentificacion") = Row("Codigo")
+ ' Row("CuentaPredial") = ""
+ ' Row("Obs") = Row("Observaciones")
+ ' Row("ImporteIVA") = 0
+ ' Row("PorcentajeIVA") = 0
+ ' Next
+
+ ' 'DETALLES
+ ' ObjFactura.DtDetalle = dt
+
+ ' 'SUBPROYECTO
+ ' ObjFactura.SetSubProyectoMatriz(Me)
+ ' ObjFactura.SetSubProyecto(Me)
+
+ ' ObjFactura.Inv_CveMovimiento = Me.CveMovimiento
+
+ ' ObjFactura.Timbre = PreParaTimbreTraslado(ObjFactura)
+
+ ' Return ObjFactura
+ 'End Function
+ 'Private Function PreParaTimbreTraslado(Obj As Modelos.Factura) As CFDITimbre
+ ' Dim Timbre As New CFDITimbre
+ ' Timbre.Comprobante.TipoComprobante = "T"
+ ' Timbre.Comprobante.Folio = Obj.Folio.ToString
+ ' Timbre.Comprobante.Serie = Obj.Serie
+ ' Timbre.Comprobante.Fecha = Obj.Fecha
+ ' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
+ ' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
+ ' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
+ ' Timbre.Comprobante.Subtotal = Obj.SubTotal
+ ' Timbre.Comprobante.Descuentos = Obj.Descuento
+ ' Timbre.Comprobante.Moneda = Obj.MonedaSAT
+ ' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
+ ' Timbre.Comprobante.Total = Obj.Total
+
+ ' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
+ ' Timbre.Comprobante.Confirmacion = ""
+
+ ' Timbre.Receptor.RFC = "XAXX010101000"
+ ' Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa
+ ' Timbre.Receptor.UsoCFDI = "P01"
+
+ ' Dim totSubTotal As Decimal = Obj.SubTotal
+ ' Dim totIVA As Decimal = Obj.IVA
+ ' Dim totRetIVA As Decimal = Obj.RetIVA
+ ' Dim totRetISR As Decimal = Obj.RetISR
+ ' Dim i As Integer = 1
+
+ ' 'DETALLES
+ ' Dim tPS As String = ""
+
+ ' For Each drr As DataRow In Obj.DtDetalle.Rows
+ ' If drr("PS").ToString.Length = 1 Then
+ ' tPS = drr("Obs").ToString
+ ' Else
+ ' If drr("PS").ToString.Length = 0 Then
+ ' tPS = ""
+ ' Else
+ ' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
+ ' End If
+ ' End If
+
+ ' 'CONDICIONANTE, ESPECIAL
+ ' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
+
+ ' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
+ ' .Descripcion = tPS,
+ ' .ValorUnitario = drr("PU").ToString.ToDecimal,
+ ' .Importe = drr("TotalImporte").ToString.ToDecimal,
+ ' .Descuento = drr("Descuento").ToString.ToDecimal,
+ ' .Unidad = drr("UM").ToString,
+ ' .ClaveUnidad = drr("SATClaveUM").ToString,
+ ' .ClaveProdServ = drr("SATClaveProdServ").ToString,
+ ' .Noidentificacion = drr("Noidentificacion").ToString,
+ ' .CuentaPredial = drr("CuentaPredial").ToString}
+ ' 'VERIFICA SUMA SUBTOTALES
+ ' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
+ ' concepto.Importe = totSubTotalW
+ ' End If
+ ' totSubTotal = totSubTotal - concepto.Importe
+
+ ' 'SIEMPRE ESTAMOS AGREGANDO EL IVA
+ ' 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
+
+ ' Timbre.Conceptos.Add(concepto)
+ ' i += 1
+ ' Next
+ ' Return Timbre
+ 'End Function
+
#End Region
#Region " OP = 'Vta,Fact' - IMPRIME PDF VENTAS"
@@ -1441,7 +1635,7 @@ Partial Class PopUpVerFactura
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCompra > 0 Then
- If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
+ If ObjInventarios.RecepcionAlmacenGet(CveCompra, -1, -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
Dim DtFaltante As DataTable = ObjInventarios.DtResultados.FiltraParametros("CantidadF > 0")
If DtFaltante.Rows.Count > 0 Then
Dim SbPendientes As New StringBuilder
@@ -2920,9 +3114,11 @@ Partial Class PopUpVerFactura
Case 24 'SALIDA POR RESGUARDO
If DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 20 Or DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 19 Then
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
- Dim params As New List(Of ReportParameter)
- Dim ArchivoRuta As New System.IO.FileInfo(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta))
- Dim Archivo As String = String.Format("{0}Formatos/EntradaSalidaUniforme.rdlc", UsuarioActual.Empresa.Ruta)
+ Dim params As New List(Of ReportParameter)
+
+ Dim ArchivoRuta As New System.IO.FileInfo(String.Format("{0}Formatos/EntradaSalidaUniforme.rdlc", UsuarioActual.Empresa.Ruta))
+ Dim Archivo As String = String.Format("{0}Formatos/EntradaSalidaUniforme.rdlc", UsuarioActual.Empresa.Ruta)
+
If Not ArchivoRuta.Exists Then
Archivo = "Empresas/Grales/Formatos/EntradaSalidaUniforme.rdlc"
End If
@@ -4839,7 +5035,7 @@ Partial Class PopUpVerFactura
Nombre = DatosClienteSeleccionado("Nombre").ToString
Ciudad = DatosClienteSeleccionado("Ciudad").ToString
Estado = DatosClienteSeleccionado("Estado").ToString
- Direccion = DatosClienteSeleccionado("Direccion").ToString
+ Direccion = String.Format("{0} {1}{2} COL. {3}", DatosClienteSeleccionado("Direccion"), DatosClienteSeleccionado("NoInt"), DatosClienteSeleccionado("NoExt"), DatosClienteSeleccionado("Colonia"))
Telefono = DatosClienteSeleccionado("Telefono").ToString
End If
diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx
index b5e938280..0a1cc36c0 100644
--- a/Contabilidad/RepIVA.aspx
+++ b/Contabilidad/RepIVA.aspx
@@ -316,7 +316,7 @@
-
+
diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs
index 4652cbd29..075d299bf 100644
--- a/Contabilidad/RepIVA.aspx.cs
+++ b/Contabilidad/RepIVA.aspx.cs
@@ -104,7 +104,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT";
}
- GvA.Columns[11].Visible = DtIVAAcreditable.SUM("IvaExentoImpo") > 0; // sino tiene valor la columna de importación de oculta
+ GvA.Columns[10].Visible = DtIVAAcreditable.SUM("IvaExentoImpo") > 0; // sino tiene valor la columna de importación de oculta
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
diff --git a/Contabilidad2/RepBalanzaComprobacion.aspx.vb b/Contabilidad2/RepBalanzaComprobacion.aspx.vb
index 525bea3b5..fae21caf0 100644
--- a/Contabilidad2/RepBalanzaComprobacion.aspx.vb
+++ b/Contabilidad2/RepBalanzaComprobacion.aspx.vb
@@ -133,15 +133,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
- 'If e.Row.DBCampo("Id").ToEntero = IdCuenta Then
- ' e.Row.ControlStyle.Font.Bold = True
- ' 'e.Row.ControlStyle.Font.Size = 9
- ' 'e.Row.ControlStyle.Height = 30
- 'Else
- ' e.Row.ControlStyle.Font.Bold = False
- 'End If
-
- If e.Row.DBCampo("CtaMayor") = "1" Or e.Row.DBCampo("CtaMayor") = "1" Then
+ If e.Row.DBCampo("CtaMayor") = "1" OrElse e.Row.DBCampo("CtaMayor") = "3" OrElse e.Row.DBCampo("CtaMayor") = "4" Then
e.Row.ControlStyle.Font.Bold = True
End If
@@ -167,8 +159,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
'Total general
If e.Row.DBCampo("Id") = "" Then
- 'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.NotSet
- 'Dim TotSaldoID, TotSaldoIA As Double
+
e.Row.ControlStyle.Font.Bold = True
e.Row.ControlStyle.Font.Size = 9
e.Row.ControlStyle.Height = 30
@@ -192,33 +183,6 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
ImprimirReporte()
- 'Using sw As New StringWriter()
- ' Using hw As New HtmlTextWriter(sw)
-
- ' Dim style As StringBuilder = New StringBuilder()
- ' style.Append(" ")
- ' 'To Export all pages
- ' 'Gv.AllowPaging = False
- ' 'Gv.DataBind()
- ' Tbl.RenderControl(hw)
- ' Dim sr As New StringReader(sw.ToString())
- ' Dim pdfDoc As New Document(PageSize.A2, 10.0F, 10.0F, 10.0F, 0.0F)
- ' Dim htmlparser As New HTMLWorker(pdfDoc)
- ' PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
- ' pdfDoc.Open()
- ' htmlparser.Parse(sr)
- ' pdfDoc.Close()
-
- ' Response.ContentType = "application/pdf"
- ' Response.AddHeader("content-disposition", "attachment;filename=BalanzaComprobacion.pdf")
- ' Response.Cache.SetCacheability(HttpCacheability.NoCache)
- ' Response.Write(style.ToString)
- ' Response.Write(pdfDoc)
- ' Response.[End]()
- ' End Using
- 'End Using
End Sub
'No quitar porque no funciona el exporta PDF
@@ -228,7 +192,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- 'GvDatos.ExportToExcel("BalanzaComprobacion")
+
ImprimirReporte("Excel")
End Sub
diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb
index 18d959c83..8e7140752 100644
--- a/Contratos/ContratoObra.aspx.vb
+++ b/Contratos/ContratoObra.aspx.vb
@@ -4580,7 +4580,7 @@ Partial Class Contratos_ContratoObra
CveUnidadMedida = GlobalDTUnidadesMedida(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveUnidadMedida").ToString.ToEntero
End If
- If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, DrowPS("Codigo").ToString.Trim, "", "", DrowPS("Producto").ToString, DrowPS("PU").ToString.ToDouble, 0, 0, False, 0, False, If(TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas, True, False),
+ If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, DrowPS("Codigo").ToString.Trim, "", "", DrowPS("Producto").ToString, DrowPS("PU").ToString.ToDouble, -1, 0, False, 0, False, If(TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas, True, False),
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=2, CveSATPS:=-1, CveMarca:=-1, CveTamaño:=-1, CveMedida:=-1, CveRinTamaño:=-1, CveModelo:=-1, Litraje:=-1, IEPSPorcentaje:=-1, CveClasificacion2:=-1, CveClasificacionDetalle:=-1) > 0 Then
CvePS = ObjPS.CvePS
Else
@@ -4656,17 +4656,12 @@ Partial Class Contratos_ContratoObra
End If
-
-
If Not DTCargaPresupuestoManoObra Is Nothing And Not ErrorProceso Then
-
-
For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows
Dim CveActividad As Integer = 0
Dim Actividad As String
-
If DrowPS("Actividad").ToString.Trim.Length > 0 Then
GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing
CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero
@@ -4691,14 +4686,11 @@ Partial Class Contratos_ContratoObra
End If
ObjRH.Dispose()
-
End If
-
If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 And Not ErrorProceso Then
Actividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Actividad", $" CveActividad = {CveActividad}")
-
Dim Row As DataRow = DTPS.NewRow()
Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
@@ -4717,7 +4709,6 @@ Partial Class Contratos_ContratoObra
Row("CveActividad") = CveActividad
Row("CveSubTipoActivoFijo") = -1
Row("Dias") = DrowPS("Dias").ToString.ToEntero
-
Row("NoIdentificacion") = ""
Row("OCInterna") = ""
Row("LimitarCantidad") = 0
@@ -4905,7 +4896,6 @@ Partial Class Contratos_ContratoObra
Dim NrowTmpDT As DataRow = TmpDT.NewRow
-
NrowTmpDT("Cantidad") = Row("Cantidad")
NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
NrowTmpDT("CveUM") = Row("CveUM")
@@ -4933,7 +4923,6 @@ Partial Class Contratos_ContratoObra
NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo")
NrowTmpDT("Dias") = Row("Dias")
-
NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
TmpDT.Rows.Add(NrowTmpDT)
@@ -4946,7 +4935,6 @@ Partial Class Contratos_ContratoObra
End If
Next
-
If ErrorProceso Then
ObjContratos.RollBack()
Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
diff --git a/Contratos/RepContratosObraAvancesPartida.aspx.vb b/Contratos/RepContratosObraAvancesPartida.aspx.vb
index e81971e0a..cc749280b 100644
--- a/Contratos/RepContratosObraAvancesPartida.aspx.vb
+++ b/Contratos/RepContratosObraAvancesPartida.aspx.vb
@@ -59,7 +59,7 @@ Partial Class RepContratosObraAvancesPartida
CveContrato = If(Request("CveContrato") IsNot Nothing AndAlso Request("CveContrato").ToString.ToEntero > 0, Request("CveContrato").ToString.ToEntero, -1)
NumeroContrato = If(Request("NumeroContrato") IsNot Nothing AndAlso Request("NumeroContrato").ToString.Length > 0, $"{Request("NumeroContrato").ToString}", "")
- LblEstimacion.Text = If(Request("NumeroEstimacion") IsNot Nothing AndAlso Request("NumeroEstimacion").ToString.Length > 0, $"Contgrato { NumeroContrato } Estimacion {Request("NumeroEstimacion").ToString}", "")
+ LblEstimacion.Text = If(Request("NumeroEstimacion") IsNot Nothing AndAlso Request("NumeroEstimacion").ToString.Length > 0, $"Contrato { NumeroContrato } Estimación {Request("NumeroEstimacion").ToString}", "")
If CveEstimacion > 0 Then
diff --git a/Empresas/140/Formatos/Cotizacion.rdlc b/Empresas/140/Formatos/Cotizacion.rdlc
index 8daf9c681..d94b32714 100644
--- a/Empresas/140/Formatos/Cotizacion.rdlc
+++ b/Empresas/140/Formatos/Cotizacion.rdlc
@@ -944,6 +944,7 @@
Myriad Pro9ptNormal
+ n2
diff --git a/Empresas/140/Formatos/Factura.rdlc b/Empresas/140/Formatos/Factura.rdlc
index c2e5f7e8d..d8d7cf6c7 100644
--- a/Empresas/140/Formatos/Factura.rdlc
+++ b/Empresas/140/Formatos/Factura.rdlc
@@ -1963,6 +1963,7 @@
Myriad Pro7.5ptNormal
+ n2
diff --git a/Empresas/140/Formatos/Remision.rdlc b/Empresas/140/Formatos/Remision.rdlc
index e68ef4c45..3001212dd 100644
--- a/Empresas/140/Formatos/Remision.rdlc
+++ b/Empresas/140/Formatos/Remision.rdlc
@@ -771,6 +771,7 @@
Myriad Pro9.64ptNormal
+ n2
diff --git a/Empresas/72/Formatos/CursoInvitacion.docx b/Empresas/72/Formatos/CursoInvitacion.docx
index 272b365c8..7c26b33c0 100644
Binary files a/Empresas/72/Formatos/CursoInvitacion.docx and b/Empresas/72/Formatos/CursoInvitacion.docx differ
diff --git a/GPS/Trayectos.aspx b/GPS/Trayectos.aspx
index c07974719..b7e70ad7d 100644
--- a/GPS/Trayectos.aspx
+++ b/GPS/Trayectos.aspx
@@ -104,7 +104,7 @@
diff --git a/GPS/Trayectos.aspx.vb b/GPS/Trayectos.aspx.vb
index e473a0319..bc8ed7985 100644
--- a/GPS/Trayectos.aspx.vb
+++ b/GPS/Trayectos.aspx.vb
@@ -56,16 +56,24 @@ Partial Class GPS_Trayectos
CargaTrayectos()
End Sub
Public Sub CargaDispositivos()
- DdlDispositivo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
+ Dim DtDispositivos As DataTable = Nothing
+
+ Using ObjGPS As New ClsGPS
+ If ObjGPS.DispositivosUsuariosGet(-1, 1, UsuarioActual.CveCliente, CveUsuario:=UsuarioActual.CveUsuario, ConcatenarDispuestos:=True) Then
+ DtDispositivos = ObjGPS.DtResultados.Copy
+ End If
+ End Using
+
+ DdlDispositivo.DataSource = DtDispositivos 'GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
DdlDispositivo.DataBind()
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
- DdlDispositivoNuevo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
+ DdlDispositivoNuevo.DataSource = DtDispositivos 'GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
DdlDispositivoNuevo.DataBind()
DdlDispositivoNuevo.Items.Insert(0, New ListItem("Seleccione", "-1"))
- DdlDispositivoFiltro.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
+ DdlDispositivoFiltro.DataSource = DtDispositivos 'GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
DdlDispositivoFiltro.DataBind()
DdlDispositivoFiltro.Items.Insert(0, New ListItem("Seleccione", "-1"))
diff --git a/General/CatMarcas.aspx.vb b/General/CatMarcas.aspx.vb
index 8bdf09f8e..1042c6b7a 100644
--- a/General/CatMarcas.aspx.vb
+++ b/General/CatMarcas.aspx.vb
@@ -68,12 +68,14 @@ Partial Class General_CatMarcas
RegistraScript("$('#DModalMarca').modal('hide')")
Alert("La Marca se agregó correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
+ GlobalDTGralMarcas(UsuarioActual.CveEmpresa) = Nothing
End If
ElseIf Modalidad = "U" Then
If ObjPS.UpdateMarca(TxtMarca.Text, CveMarca, ChkEstatus.Checked) Then
RegistraScript("$('#DModalMarca').modal('hide')")
Alert("La Marca se actualizo correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
+ GlobalDTGralMarcas(UsuarioActual.CveEmpresa) = Nothing
End If
End If
ObjPS.Dispose()
diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx
index f71da7eea..5cd3ac542 100644
--- a/Inventarios/EntradasSalidas.aspx
+++ b/Inventarios/EntradasSalidas.aspx
@@ -104,6 +104,10 @@
+
+
+
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 9a71020a2..1143a7c1e 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -780,6 +780,11 @@ Partial Class Inventarios_EntradasSalidas
HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", $"Tra-{Folio}", "Tra")))
HplCartaPorte.Visible = True
HplCartaPorte.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimiento)))
+
+ If UsuarioActual.CveRol = 1 Then
+ LnkGenerarPDF.Visible = True
+ End If
+
End If
@@ -3856,7 +3861,7 @@ Partial Class Inventarios_EntradasSalidas
Dim Lote As String = If(TxtLoteSalida.Text = "", "", TxtLoteSalida.Text)
Dim FechaCaducidad As Date = If(TxtCaducidadSalida.Text = "", MinFecha.ToShortDateString, TxtCaducidadSalida.Text).ToDate
- If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
+ If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=Lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
If Not DdlPSSalida.SelectedValue.ToEntero > 0 Then
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
Alert("Es necesario especificar el producto.", TipoMensaje.MsgAdvertencia)
@@ -5092,4 +5097,198 @@ Partial Class Inventarios_EntradasSalidas
End If
End Sub
+
+
+ Protected Sub LnkGenerarPDF_Click(sender As Object, e As EventArgs)
+ GeneraPDFFactura()
+ End Sub
+ Private Sub GeneraPDFFactura()
+ Try
+ Dim objFactura = CreaObjetosVenta()
+ PdfFactura(objFactura)
+ objFactura.Dispose()
+ Catch ex As Exception
+ OnError("Ocurrió un error al generar el PDF", ex)
+ End Try
+ End Sub
+
+ Private Function CreaObjetosVenta() As Modelos.Factura
+ Dim ObjFactura = New Modelos.Factura
+ ObjFactura.Version = "3.3"
+ ObjFactura.CveUsuario = UsuarioActual.CveUsuario
+ ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
+ ObjFactura.TipoCambio = 0
+ ObjFactura.ConvertirPesos = False
+ ObjFactura.TipoCambio = 0
+ ObjFactura.CveMoneda = 1
+ ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
+ ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1")
+ ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ")
+ ObjFactura.TipoDocto = "Tra"
+ ObjFactura.RefDocto = ""
+ ObjFactura.Folio = Folio.ToEntero
+ ObjFactura.Serie = "Tra"
+ ObjFactura.CveMesa = -1
+ ObjFactura.Fecha = Now
+ ObjFactura.CvePrePoliza = -1
+ ObjFactura.FechaPago = Now
+ ObjFactura.MotivoDescuento = ""
+ ObjFactura.Observaciones = ""
+ ObjFactura.FechaEjecucion = Now
+ ObjFactura.UsuarioCreo = UsuarioActual.Usuario
+ ObjFactura.CveCondicionEntrega = -1
+ ObjFactura.CondicionEntrega = ""
+ ObjFactura.NumeroCuenta = ""
+ ObjFactura.CondicionesPago = 0
+ ObjFactura.FormaPago = 0
+ ObjFactura.PedidoContrato = ""
+ ObjFactura.OrdenCompra = ""
+ ObjFactura.NumeroContrato = ""
+ ObjFactura.NumeroDescripcionContrato = ""
+ ObjFactura.DescripcionContrato = ""
+ ObjFactura.CveCorte = -1
+ ObjFactura.TipoDocumento = "Traspaso"
+ ObjFactura.Alfa1 = ""
+ ObjFactura.Alfa2 = ""
+ ObjFactura.Alfa3 = ""
+ ObjFactura.Descuento = 0
+ ObjFactura.Amortizacion = 0
+ ObjFactura.CveContrato = 0
+ ObjFactura.CveVendedor = 0
+ ObjFactura.FechaVencimiento = Now
+ ObjFactura.TipoEstatus = 0
+ ObjFactura.Det_OrdenCompra = ""
+ ObjFactura.Inv_CveEstatusEntrega = 0
+ ObjFactura.FormaPago33 = ""
+ ObjFactura.MetodoPago33 = ""
+ ObjFactura.UsoCFDI = ""
+ ObjFactura.CveClienteSucursal = 0
+ Dim CveSubProyecto As Integer = -1
+ If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows.Count > 0 Then
+ CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero
+ End If
+ ObjFactura.CveSubProyecto = CveSubProyecto
+ ObjFactura.CveSubProyectoCobranza = CveSubProyecto
+ ObjFactura.CveSubProyectoEjecucion = CveSubProyecto
+
+ ObjFactura.SubTotal = 0
+ ObjFactura.Descuento = 0
+ ObjFactura.Amortizacion = 0
+ ObjFactura.IVA = 0
+ ObjFactura.RetIVA = 0
+ ObjFactura.RetISR = 0
+ ObjFactura.IEPS = 0
+ ObjFactura.Total = 0
+ ObjFactura.RFCReceptor = "XAXX010101000"
+
+ Dim dt As DataTable = DtMovimientos.Copy
+
+ dt.Columns.Add("TotalImporte", Type.GetType("System.Double"))
+ dt.Columns.Add("Descuento", Type.GetType("System.Double"))
+ dt.Columns.Add("UM")
+ dt.Columns.Add("SATClaveUM")
+ dt.Columns.Add("SATClaveProdServ")
+ dt.Columns.Add("Noidentificacion")
+ dt.Columns.Add("CuentaPredial")
+ dt.Columns.Add("Obs")
+ dt.Columns.Add("ImporteIVA", Type.GetType("System.Double"))
+ dt.Columns.Add("PorcentajeIVA", Type.GetType("System.Double"))
+
+
+ For Each Row As DataRow In dt.Rows
+ Row("TotalImporte") = Row("Total")
+ Row("Descuento") = 0
+ Row("UM") = Row("UnidadMedida")
+ Row("SATClaveUM") = Row("SATClaveUnidadMedida")
+ Row("SATClaveProdServ") = Row("SATClavePS")
+ Row("Noidentificacion") = Row("Codigo")
+ Row("CuentaPredial") = ""
+ Row("Obs") = Row("Observaciones")
+ Row("ImporteIVA") = 0
+ Row("PorcentajeIVA") = 0
+ Next
+
+ 'DETALLES
+ ObjFactura.DtDetalle = dt
+
+ 'SUBPROYECTO
+ ObjFactura.SetSubProyectoMatriz(Me)
+ ObjFactura.SetSubProyecto(Me)
+
+ ObjFactura.Inv_CveMovimiento = Me.CveMovimiento
+
+ ObjFactura.Timbre = PreParaTimbre(ObjFactura)
+
+ Return ObjFactura
+ End Function
+ Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
+ Dim Timbre As New CFDITimbre
+ Timbre.Comprobante.TipoComprobante = "T"
+ Timbre.Comprobante.Folio = Obj.Folio.ToString
+ Timbre.Comprobante.Serie = Obj.Serie
+ Timbre.Comprobante.Fecha = Obj.Fecha
+ Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
+ Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
+ Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
+ Timbre.Comprobante.Subtotal = Obj.SubTotal
+ Timbre.Comprobante.Descuentos = Obj.Descuento
+ Timbre.Comprobante.Moneda = Obj.MonedaSAT
+ Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
+ Timbre.Comprobante.Total = Obj.Total
+
+ Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
+ Timbre.Comprobante.Confirmacion = ""
+
+ Timbre.Receptor.RFC = "XAXX010101000"
+ Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa
+ Timbre.Receptor.UsoCFDI = "P01"
+
+ Dim totSubTotal As Decimal = Obj.SubTotal
+ Dim totIVA As Decimal = Obj.IVA
+ Dim totRetIVA As Decimal = Obj.RetIVA
+ Dim totRetISR As Decimal = Obj.RetISR
+ Dim i As Integer = 1
+
+ 'DETALLES
+ Dim tPS As String = ""
+
+ For Each drr As DataRow In Obj.DtDetalle.Rows
+ If drr("PS").ToString.Length = 1 Then
+ tPS = drr("Obs").ToString
+ Else
+ If drr("PS").ToString.Length = 0 Then
+ tPS = ""
+ Else
+ tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
+ End If
+ End If
+
+ 'CONDICIONANTE, ESPECIAL
+ If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
+
+ Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
+ .Descripcion = tPS,
+ .ValorUnitario = drr("PU").ToString.ToDecimal,
+ .Importe = drr("TotalImporte").ToString.ToDecimal,
+ .Descuento = drr("Descuento").ToString.ToDecimal,
+ .Unidad = drr("UM").ToString,
+ .ClaveUnidad = drr("SATClaveUM").ToString,
+ .ClaveProdServ = drr("SATClaveProdServ").ToString,
+ .Noidentificacion = drr("Noidentificacion").ToString,
+ .CuentaPredial = drr("CuentaPredial").ToString}
+ 'VERIFICA SUMA SUBTOTALES
+ If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
+ concepto.Importe = totSubTotal
+ End If
+ totSubTotal = totSubTotal - concepto.Importe
+
+ 'SIEMPRE ESTAMOS AGREGANDO EL IVA
+ 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
+
+ Timbre.Conceptos.Add(concepto)
+ i += 1
+ Next
+ Return Timbre
+ End Function
+
End Class
diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb
index 64b3c1c10..9dffa4eec 100644
--- a/Inventarios/Kardex.aspx.vb
+++ b/Inventarios/Kardex.aspx.vb
@@ -220,6 +220,8 @@ Partial Class Inventarios_Kardex
If AplicaSerie Then GvM.Columns(9).Visible = True
If AplicaLote Then GvM.Columns(10).Visible = True
If AplicaCaducidad Then GvM.Columns(11).Visible = True
+ If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvM.Columns(11).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
+
Dim Drp As datarow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("")
Dim AuxAplicaSerie As Boolean
@@ -232,6 +234,7 @@ Partial Class Inventarios_Kardex
LnkSeries.Visible = AuxAplicaSerie
LnkCaducidad.Visible = AuxAplicaCad
'CARGA INDICADORES
+
If UsuarioActual.TienePermisoProceso(201) Then
DivIndicadores.Visible = True
@@ -363,7 +366,9 @@ Partial Class Inventarios_Kardex
GvProductoCaducidad.DataSource = ObjInventarios.DtResultados
GvProductoCaducidad.columns(2).visible = ObjInventarios.DtResultados.max("Serie") <> ""
GvProductoCaducidad.columns(3).visible = ObjInventarios.DtResultados.max("Lote") <> ""
- GvProductoCaducidad.columns(4).visible = ObjInventarios.DtResultados.max("FechaCaducidad").todate > minfecha
+ GvProductoCaducidad.Columns(4).Visible = ObjInventarios.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
+ If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvProductoCaducidad.Columns(4).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
+
End If
ObjInventarios.Dispose()
GvProductoCaducidad.DataBind()
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
index d00f0f716..01f56bb74 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
@@ -98,9 +98,15 @@ Partial Class Inventarios_Default
Private Sub CargaDatos(CvePS As Integer, Tipo As Integer)
If ValidarFiltrosSeleccionados() OrElse CvePS > 0 Then
+ Dim RestringirAlmacenes As Integer = -1
+ If UsuarioActual.CveEmpresa = 119 Then
+ RestringirAlmacenes = 1 'restringue los almacenes:Consignación,Productos Financieros Asignados,,roductos Financieros,Consumo Interno,Activo Fijo,Merma,Consignación de Contrato,Devolucion proveedor,
+ End If
+
Dim ObjInventarios As New ClsInventarios()
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
- ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero, ExcluyeTransitorios:=1, TopSelect:=100) Then
+ ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
+ ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100) Then
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If dr IsNot Nothing Then
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 3c2820087..d93ba5ca0 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -991,7 +991,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim CargaSoloUsados As Boolean = False
- If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
+ If ObjInventario.RecepcionAlmacenGet(pCveCompra, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim DtRecepcion As DataTable = ObjInventario.DtResultados.Copy()
Dim NumUsados = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = True").ToEntero()
Dim NumProductos = ObjInventario.DtResultados.COUNT("EsUsado", "EsUsado = False").ToEntero()
@@ -1010,7 +1010,11 @@ Partial Class Inventarios_RecepcionAlmacen
ValidarRecepcionUsados = True
DtRecepcion = ObjInventario.DtResultados.Copy()
- CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
+ If TipoMovimiento = 3 Then
+ CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "21", CveTipoCompra)
+ Else
+ CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
+ End If
Else
DtRecepcion = ObjInventario.DtResultados.Copy()
@@ -2112,7 +2116,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim VariableCampo = If(TipoMovimiento.Contiene(1, 3), "CantidadF", "CantidadS")
Dim ObjComprasDif As New ClsInventarios
Dim DtDatosCompra As New DataTable
- If ObjComprasDif.RecepcionAlmacenGet(CveCompraSurtir, BuscaEntregaDirecta, UsuarioActual.CveEmpresa) Then
+ If ObjComprasDif.RecepcionAlmacenGet(CveCompraSurtir, BuscaEntregaDirecta, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
DtDatosCompra = ObjComprasDif.DtResultados
End If
Dim CantidadGV = GvInv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
@@ -2863,7 +2867,8 @@ Partial Class Inventarios_RecepcionAlmacen
'VERIFICA SI TIENE ALMACEN VIRTUAL
If CveAlmacenVirtual > 0 Then
- If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveCompra:=CveCompraSurtir, ValidaUsadosCompra:=ValidarRecepcionUsados) Then
+ ValidarRecepcionUsados = RecibidaCompleta
+ If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveCompra:=CveCompraSurtir, ValidaUsadosCompra:=ValidarRecepcionUsados) Then 'ValidarRecepcionUsados
DtPSVirtual = ObjInventario.DtResultados
End If
@@ -3130,7 +3135,7 @@ Partial Class Inventarios_RecepcionAlmacen
'VERIFICA SI TIENE PENDIENTE POR SURTIR
If UsuarioActual.CveEmpresa = 140 AndAlso TipoMovimiento = 3 Then
- If ObjInventario.RecepcionAlmacenGet(CveCompraSurtir, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
+ If ObjInventario.RecepcionAlmacenGet(CveCompraSurtir, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim DtFaltante As DataTable = ObjInventario.DtResultados.FiltraParametros("CantidadF > 0")
If DtFaltante.Rows.Count = 0 Then
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 2, UsuarioActual.CveUsuario) Then
@@ -3647,7 +3652,7 @@ Partial Class Inventarios_RecepcionAlmacen
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
- If ObjInventario.RecepcionAlmacenGet(CveCompraSurtir, -1, UsuarioActual.CveEmpresa) Then
+ If ObjInventario.RecepcionAlmacenGet(CveCompraSurtir, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
CreaDTInv(ObjInventario.DtResultados)
CargaGVInv()
BtnGuardar.Visible = True
@@ -4783,6 +4788,4 @@ Partial Class Inventarios_RecepcionAlmacen
' Return Retorno
'End Function
-
End Class
-
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 7d4de7d44..51caa9b03 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -2272,12 +2272,24 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.CveMetodoPago = ObjCliente.CveMetodoPago33
- If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)).Rows.Count > 0 Then
- Me.ObjRemisionNC.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)).Rows(0)("MetodoPago").ToString
- Else
- Me.ObjRemisionNC.CveMetodoPago = 1
- Me.ObjRemisionNC.MetodoPago = "Efectivo"
+ If GlobalDTMetodosPago IsNot Nothing Then
+ Dim DtMetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
+
+ If DtMetodoPago IsNot Nothing Then
+
+ If DtMetodoPago.Rows.Count > 0 Then
+ Me.ObjRemisionNC.MetodoPago = DtMetodoPago.Rows(0)("MetodoPago").ToString
+ Else
+ Me.ObjRemisionNC.CveMetodoPago = 1
+ Me.ObjRemisionNC.MetodoPago = "Efectivo"
+ End If
+
+ DtMetodoPago.Dispose()
+ DtMetodoPago = Nothing
+ End If
+
End If
+
End If
End If
diff --git a/Inventarios/RepExistenciaLote.aspx b/Inventarios/RepExistenciaLote.aspx
new file mode 100644
index 000000000..7967e6e56
--- /dev/null
+++ b/Inventarios/RepExistenciaLote.aspx
@@ -0,0 +1,164 @@
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepExistenciaLote.aspx.vb" Inherits="Inventarios_RepExistenciaLote" %>
+
+
+
+ Generar PDF
+
+
+ Generar Excel
+
+
+
+
+
+
+
+
+ Reporte de Existencia Lote
+
+
+
+ <%--Tabla con los campos para filtrar--%>
+
+
+
+
+
+
+
+
+
diff --git a/Inventarios/RepExistenciaLote.aspx.vb b/Inventarios/RepExistenciaLote.aspx.vb
new file mode 100644
index 000000000..685490a6f
--- /dev/null
+++ b/Inventarios/RepExistenciaLote.aspx.vb
@@ -0,0 +1,514 @@
+Imports System.Data
+Imports Extensiones
+Imports Microsoft.Reporting.WebForms
+Imports System.IO
+
+Partial Class Inventarios_RepExistenciaLote
+ Inherits ClsPaginas
+#Region "propiedades"
+ 'Private ReadOnly Property reporteador As Microsoft.Reporting.WebForms.ReportViewer
+ ' Get
+ ' Return CType(Master.FindControl("ReportMaster"), Microsoft.Reporting.WebForms.ReportViewer)
+ ' End Get
+ 'End Property
+ Private Property dt As DataTable
+ Get
+ Try
+ dt = DirectCast(ViewState("dt"), DataTable)
+ Return DirectCast(ViewState("dt"), DataTable)
+ Catch ex As Exception
+ Return Nothing
+ End Try
+ End Get
+ Set(value As DataTable)
+ ViewState("dt") = value
+ End Set
+ End Property
+ Public Property DtEquivalencias() As DataTable
+ Get
+ Return CType(ViewState("dtReporte"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("dtReporte") = value
+ End Set
+ End Property
+ Public Property FechaInicial As String
+ Get
+ Return ViewState("FechaInicial").ToString
+ End Get
+ Set(value As String)
+ ViewState("FechaInicial") = value
+ End Set
+ End Property
+ Public Property FechaFinal As String
+ Get
+ Return ViewState("FechaFinal").ToString
+ End Get
+ Set(value As String)
+ ViewState("FechaFinal") = value
+ End Set
+ End Property
+
+ Private ReadOnly Property PermiteClasificacion2 As Boolean
+ Get
+ Return (UsuarioActual.CveEmpresa.Contiene(72, 80))
+ End Get
+ End Property
+#End Region
+
+ Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+
+ TxtFechaI.Text = Now.AddMonths(-1).ToShortDateString
+ TxtFechaF.Text = Now
+ FechaInicial = "-1"
+ FechaFinal = "-1"
+
+ CargaCombos()
+
+ GvM.DataBind()
+ If Not IsNothing(Request("CveAlmacen")) Then
+ DdlAlmacen.SelectedValue = Request("CveAlmacen").ToString()
+ TxtFechaI.Text = "01/01/2000"
+ If Not IsNothing(Request("FechaCorte")) Then
+ TxtFechaF.Text = Request("FechaCorte")
+ End If
+
+ If Not IsNothing(Request("FechaInicio")) And IsDate(Request("FechaInicio")) Then
+ TxtFechaI.Text = Request("FechaInicio")
+ End If
+
+ btConsultar_Click(Nothing, Nothing)
+ End If
+ End If
+ End Sub
+
+
+ Private Sub CargaCombos()
+
+
+ DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
+ DdlAlmacen.DataBind()
+ DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
+ If Not IsNothing(Request("CveAlmacen")) Then
+ If DdlAlmacen.Items.FindByValue(Request("CveAlmacen").ToString) Is Nothing Then
+ Dim CveAlmacen = Request("CveAlmacen").ToString
+ Dim Almacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {Request("CveAlmacen").ToString}")
+ DdlAlmacen.Items.Insert(0, New ListItem(Almacen, CveAlmacen))
+ End If
+ Else
+ DdlAlmacen.SelectedValuesIfExistM("-1")
+ End If
+
+ 'Llenar dropdownlist de proveedores
+ DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
+ DdlProveedor.DataBind()
+ DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ 'CARGA CLASIFICACIONES
+ Dim ObjClasificaciones As New ClsClasificaciones
+ If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
+ DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
+ End If
+ ObjClasificaciones.Dispose()
+ DdlClasificacion.DataBind()
+ DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
+
+
+
+
+ 'Carga Productos
+ DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
+
+ If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
+ DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
+ DdlPS.SelectedText = ""
+ DdlPS.SelectedValue = "-1"
+ Else
+ DdlPS.ddl.Items.Clear()
+ DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero)
+ DdlPS.ddl.DataBind()
+ DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
+ End If
+
+
+ 'Llenar dropdownlist de personal
+ DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
+ DdlPersonal.DataBind()
+ DdlPersonal.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ CargarMarcas()
+
+ DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1)
+ DdlTipoAlmacen.DataBind()
+ DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ End Sub
+
+ Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
+ CargaDatos()
+ End Sub
+
+ Private Sub CargaDatos()
+ Dim Reporte As New ClsInventarios
+ Dim rpt As DataTable = Nothing
+ Dim CveMarca As Integer = -1
+
+ 'Dim fechaI As String = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
+ 'Dim fechaF As String = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
+ FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
+ FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
+ Dim TipoAlmacen As String = If(DdlTipoAlmacen.GetSelectedValuesM = "", "-1", DdlTipoAlmacen.GetSelectedValuesM)
+ Dim Almacenes As String = If(DdlAlmacen.GetSelectedValuesM = "", "-1", DdlAlmacen.GetSelectedValuesM)
+
+ If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
+ CveMarca = DdlMarca.SelectedValue.ToEntero
+ End If
+
+ If Reporte.RepExistenciasLote(UsuarioActual.CveEmpresa, FechaInicial.ToDate, FechaFinal.ToDate, DdlProveedor.SelectedValue.ToEntero, Almacenes, DdlPS.SelectedValue.ToEntero,
+ DdlClasificacion.SelectedValue.ToEntero, CveMarca, TipoAlmacen) Then
+ If Reporte.DtResultados.Rows.Count > 0 Then
+ GvM.DataSource = Reporte.DtResultados
+ GvM.DataBind()
+ ViewState("dtReporte") = Reporte.DtResultados
+ dt = Reporte.DtResultados
+
+ End If
+
+
+ End If
+ Reporte.Dispose()
+ UPPMov.Update()
+ End Sub
+
+ Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
+ If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
+ DdlPS.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
+ DdlPS.SelectedText = ""
+ DdlPS.SelectedValue = "-1"
+ Else
+ DdlPS.ddl.Items.Clear()
+ DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero)
+ DdlPS.ddl.DataBind()
+ DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
+ End If
+ End Sub
+
+ Protected Sub GvM_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowCreated
+
+ 'If e.Row.RowType = DataControlRowType.Header Then
+ ' 'GENERO ENCABEZADO
+ ' Dim FC As New SortedList
+ ' FC.Add(0, "Código,1,2,Titulos")
+
+ ' If ChkCodigoAlterno.Checked Then
+ ' FC.Add(1, "Código Alterno,1,2,Titulos")
+ ' End If
+
+ ' FC.Add(10, "Descripción,1,2,Titulos")
+ ' FC.Add(20, "CANTIDAD,4,1,Titulos")
+ ' FC.Add(30, "IMPORTE,4,1,Titulos")
+
+ ' Dim FC2 As New SortedList
+ ' FC2.Add(0, "Exist. inicial,1,1,Titulos")
+ ' FC2.Add(1, "Entradas,1,1S,Titulos")
+ ' FC2.Add(2, "Salidas,1,1,Titulos")
+ ' FC2.Add(3, "Exist. final,1,1,Titulos")
+ ' FC2.Add(4, "Saldo inicial,1,1,Titulos")
+ ' FC2.Add(5, "Entradas,1,1,Titulos")
+ ' FC2.Add(6, "Salidas,1,1,Titulos")
+ ' FC2.Add(7, "Saldo final,1,1,Titulos")
+
+ ' GetMultiRowHeader(DirectCast(sender, GridView), e, FC2, "Titulosfijos")
+ ' GetMultiRowHeader(DirectCast(sender, GridView), e, FC, "Titulosfijos")
+
+ ''End If
+
+ End Sub
+
+ Protected Sub gvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+
+ End If
+ End Sub
+
+
+#Region "MARCA"
+ Protected Sub CargarMarcas()
+
+ If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
+ DivMarca.Visible = True
+
+ Dim ObjMarcas As New ClsProductosServicios
+ ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
+ DdlMarca.DataSource = ObjMarcas.DtResultados
+ ObjMarcas.Dispose()
+ DdlMarca.DataBind()
+ End If
+
+ DdlMarca.Items.Insert(0, New ListItem(" Todas ", "-1"))
+ End Sub
+#End Region
+
+
+#Region " EXPORTAR - PDF - EXCEL "
+ Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
+ ' GvM.ExportToExcel("Reporte de Entradas y Salidas")
+ ImprimiReporte("EXCEL")
+ End Sub
+ Private Sub LnkImprimir_Click(sender As Object, e As EventArgs) Handles LnkImprimir.Click
+ ImprimiReporte()
+ End Sub
+
+ Protected Sub ImprimiReporte(Optional Formato As String = "PDF", Optional FormatoInventario As Boolean = False)
+
+ Dim RutaPDF As String
+ Dim NombreArchivoDescarga = "ReporteExistenciaLotes"
+
+ RutaPDF = "Empresas/Grales/Formatos/RepExistenciaLotes.rdlc"
+
+
+ Dim params As New List(Of ReportParameter)
+ params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("LogoPath", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
+ params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
+ params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+
+ ImprimirPDF(RutaPDF, dt, params, NombreArchivoDescarga, Formato)
+
+ End Sub
+
+#End Region
+
+
+ Protected Sub Lnkcompuxlsinventarios_Click(sender As Object, e As EventArgs)
+ Dim continuar = True
+ Try
+
+ Dim wb As New ClosedXML.Excel.XLWorkbook()
+ Dim libro As ClosedXML.Excel.IXLWorksheet = wb.AddWorksheet("Reporte de inventarios")
+
+
+
+ Dim Fila As Integer = 0
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 7)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
+ libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 7)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
+ libro.Cell(Fila + 3, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166))
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 7)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 7)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
+ libro.Column(1).Width = 34.43
+ libro.Cell(Fila + 1, 1).Value = "TIPO DO REGISTRO"
+ libro.Cell(Fila + 2, 1).Value = "RECORD Type"
+ libro.Cell(Fila + 3, 1).Value = "OBLIGATORIO"
+
+ libro.Column(2).Width = 24
+ libro.Cell(Fila + 1, 2).Value = "Codigo del Partner"
+ libro.Cell(Fila + 2, 2).Value = "Reporter_id "
+ libro.Cell(Fila + 3, 2).Value = "OBLIGATORIO"
+
+ libro.Column(3).Width = 28.71
+ libro.Cell(Fila + 1, 3).Value = "Nombre de la Empresa"
+ libro.Cell(Fila + 2, 3).Value = "Reporter Company Name"
+ libro.Cell(Fila + 3, 3).Value = "OBLIGATORIO"
+
+ libro.Column(4).Width = 23.57
+ libro.Cell(Fila + 1, 4).Value = "CÓDIGO DEL PAÍS"
+ libro.Cell(Fila + 2, 4).Value = "COUNTRY CD"
+ libro.Cell(Fila + 3, 4).Value = "OBLIGATORIO"
+
+ libro.Column(5).Width = 17.57
+ libro.Cell(Fila + 1, 5).Value = "Ubicación"
+ libro.Cell(Fila + 2, 5).Value = "LOCATION"
+ libro.Cell(Fila + 3, 5).Value = "OPCIONAL"
+
+ libro.Column(6).Width = 35.29
+ libro.Cell(Fila + 1, 6).Value = "FECHA DEL INVENTARIO"
+ libro.Cell(Fila + 2, 6).Value = "Period End Date"
+ libro.Cell(Fila + 3, 6).Value = "OBLIGATORIO"
+
+ libro.Column(7).Width = 23.43
+ libro.Cell(Fila + 1, 7).Value = "REENVIO"
+ libro.Cell(Fila + 2, 7).Value = "RESUBMIT"
+ libro.Cell(Fila + 3, 7).Value = "OBLIGATORIO"
+
+ libro.Column(8).Width = 29.29
+ libro.Column(9).Width = 25
+ libro.Column(10).Width = 18.14
+ libro.Column(11).Width = 32.71
+ libro.Column(12).Width = 13.57
+ libro.Column(13).Width = 13
+ libro.Column(14).Width = 32
+ libro.Column(15).Width = 12.71
+ libro.Column(16).Width = 13
+
+
+
+ Fila = Fila + 3
+
+ libro.Cell(Fila + 1, 1).Value = "IH"
+ libro.Cell(Fila + 1, 2).Value = "10245068"
+ libro.Cell(Fila + 1, 3).Value = "COMPUPROVEEDORES SA DE CV"
+ libro.Cell(Fila + 1, 4).Value = "MX"
+ libro.Cell(Fila + 1, 5).Value = ""
+ libro.Cell(Fila + 1, 6).Value = String.Format("{0:yyyyMMdd}", TxtFechaF.Text.ToDate())
+ libro.Cell(Fila + 1, 7).Value = "N"
+
+
+ Fila = Fila + 1
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 16)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
+ libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 16)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
+ libro.Range(libro.Cell(Fila + 3, 3), libro.Cell(Fila + 3, 15)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(166, 166, 166))
+ libro.Cell(Fila + 3, 7).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
+ libro.Cell(Fila + 3, 10).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 16)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 16)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
+ libro.Cell(Fila + 1, 1).Value = "TIPO DO REGISTRO"
+ libro.Cell(Fila + 1, 2).Value = "NÚMERO DEL PRODUCTO"
+ libro.Cell(Fila + 1, 3).Value = "OPCION DEL PRODUCTO"
+ libro.Cell(Fila + 1, 4).Value = "UPC"
+ libro.Cell(Fila + 1, 5).Value = "CODIGO SKU"
+ libro.Cell(Fila + 1, 6).Value = "ORDENES DE COMPRAS EN ABIERTO "
+ libro.Cell(Fila + 1, 7).Value = "INVENTARIO DISPONIBLE"
+ libro.Cell(Fila + 1, 8).Value = "DEVOLUCIONES"
+ libro.Cell(Fila + 1, 9).Value = "INVENTARIO RESERVADO"
+ libro.Cell(Fila + 1, 10).Value = "INVENTARIO TOTAL"
+ libro.Cell(Fila + 1, 11).Value = "EN TRANSITO"
+ libro.Cell(Fila + 1, 12).Value = "VALOR UNITARIO DEL PRODUCTO HP"
+ libro.Cell(Fila + 1, 13).Value = "VALOR TOTAL DEL INVENTARIO"
+ libro.Cell(Fila + 1, 14).Value = "NOMBRE DE LA TIENDA"
+ libro.Cell(Fila + 1, 15).Value = "Codigo de la tienda"
+ libro.Cell(Fila + 1, 16).Value = "MONEDA"
+
+ Fila = Fila + 1
+ libro.Cell(Fila + 1, 1).Value = "RECORD TYPE "
+ libro.Cell(Fila + 1, 2).Value = "Partner Reported Product ID"
+ libro.Cell(Fila + 1, 3).Value = "PROD_OPTION"
+ libro.Cell(Fila + 1, 4).Value = "UPC"
+ libro.Cell(Fila + 1, 5).Value = "Reseller product number "
+ libro.Cell(Fila + 1, 6).Value = "Quantity on Order"
+ libro.Cell(Fila + 1, 7).Value = "Quantity on Hand"
+ libro.Cell(Fila + 1, 8).Value = "Quantity in stock allocated to be returned to supplier"
+ libro.Cell(Fila + 1, 9).Value = "Reserved Inventory"
+ libro.Cell(Fila + 1, 10).Value = "Quantity avail. for sale"
+ libro.Cell(Fila + 1, 11).Value = "Quantity in float (In transit between partner warehouses)"
+ libro.Cell(Fila + 1, 12).Value = "INVENTORY UNIT VALUE"
+ libro.Cell(Fila + 1, 13).Value = "INVENTORY VALUATION"
+ libro.Cell(Fila + 1, 14).Value = "Sell from name (For retailers, ""Store Name / Site Name"")"
+ libro.Cell(Fila + 1, 15).Value = "Sell From Location ID"
+ libro.Cell(Fila + 1, 16).Value = "CURRENCY"
+
+ Fila = Fila + 1
+ libro.Cell(Fila + 1, 1).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 2).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 3).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 4).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 5).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 6).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 7).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 8).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 9).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 10).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 11).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 12).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 13).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 14).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 15).Value = "OPCIONAL"
+ libro.Cell(Fila + 1, 16).Value = "OBLIGATORIO"
+
+
+ If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
+
+ For Each row As DataRow In dt.Select("CvePS>0 AND SaldoFCant >0")
+
+ Fila = Fila + 1
+ libro.Cell(Fila + 1, 1).Value = "ID" ' "TIPO DO REGISTRO"
+ libro.Cell(Fila + 1, 2).Value = String.Format("'{0}", row("Codigo")) ' "NÚMERO DEL PRODUCTO"
+ libro.Cell(Fila + 1, 3).Value = "" ' "OPCION DEL PRODUCTO"
+ libro.Cell(Fila + 1, 4).Value = "" ' "UPC"
+ libro.Cell(Fila + 1, 5).Value = "" ' "CODIGO SKU"
+ libro.Cell(Fila + 1, 6).Value = "" ' "ORDENES DE COMPRAS EN ABIERTO "
+ libro.Cell(Fila + 1, 7).Value = String.Format("{0}", row("SaldoFCant")) ' "INVENTARIO DISPONIBLE"
+ 'libro.Cell(Fila + 1, 7).Style.NumberFormat.Format = "N2"
+ libro.Cell(Fila + 1, 8).Value = "" ' "DEVOLUCIONES"
+ libro.Cell(Fila + 1, 9).Value = "" ' "INVENTARIO RESERVADO"
+ libro.Cell(Fila + 1, 10).Value = String.Format("{0}", row("SaldoFCant")) ' "INVENTARIO TOTAL"
+ 'libro.Cell(Fila + 1, 10).Style.NumberFormat.Format = "$ #,##0.00"
+ libro.Cell(Fila + 1, 11).Value = "" ' "EN TRANSITO"
+ libro.Cell(Fila + 1, 12).Value = "" ' "VALOR UNITARIO DEL PRODUCTO HP"
+ libro.Cell(Fila + 1, 13).Value = "" ' "VALOR TOTAL DEL INVENTARIO"
+ libro.Cell(Fila + 1, 14).Value = "" ' "NOMBRE DE LA TIENDA"
+ libro.Cell(Fila + 1, 15).Value = "" ' "Codigo de la tienda"
+ libro.Cell(Fila + 1, 16).Value = "MXN" ' "MONEDA"
+ Next
+ End If
+
+ Fila = Fila + 1
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 2, 4)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(217, 225, 242))
+ libro.Range(libro.Cell(Fila + 3, 1), libro.Cell(Fila + 3, 4)).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(0, 176, 80))
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 4)).Style.Border.InsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
+ libro.Range(libro.Cell(Fila + 1, 1), libro.Cell(Fila + 3, 4)).Style.Border.OutsideBorder = ClosedXML.Excel.XLBorderStyleValues.Thin
+ libro.Cell(Fila + 1, 1).Value = "TIPO DEL REGISTRO"
+ libro.Cell(Fila + 1, 2).Value = "TOTAL DE REGISTROS"
+ libro.Cell(Fila + 1, 3).Value = "Suma del Inventario Disponible"
+ libro.Cell(Fila + 1, 4).Value = "Suma del Inventario Total"
+
+ Fila = Fila + 1
+ libro.Cell(Fila + 1, 1).Value = "RECORD TYPE"
+ libro.Cell(Fila + 1, 2).Value = "COUNT OF RECORDS"
+ libro.Cell(Fila + 1, 3).Value = "SUM OF “"On Hand”""
+ libro.Cell(Fila + 1, 4).Value = "SUM OF “"Total Inventory"”"
+
+
+ Fila = Fila + 1
+ libro.Cell(Fila + 1, 1).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 2).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 3).Value = "OBLIGATORIO"
+ libro.Cell(Fila + 1, 4).Value = "OBLIGATORIO"
+
+ Dim Codigo As Double = 0
+ Dim SaldoFCant As Double = 0
+ Dim SaldoFImp As Double = 0
+ If Not IsNothing(dt) AndAlso dt.Rows.Count > 0 Then
+ Codigo = dt.COUNT("Codigo", "CvePS>0")
+ SaldoFCant = dt.SUM("SaldoFCant", "CvePS>0")
+ SaldoFImp = dt.SUM("SaldoFImp", "CvePS>0")
+ End If
+ Fila = Fila + 1
+ libro.Cell(Fila + 1, 1).Value = "IT"
+ libro.Cell(Fila + 1, 2).Value = String.Format("{0}", Codigo)
+ 'libro.Cell(Fila + 1, 2).Style.NumberFormat.Format = "N2"
+ libro.Cell(Fila + 1, 3).Value = String.Format("{0}", SaldoFCant)
+ 'libro.Cell(Fila + 1, 3).Style.NumberFormat.Format = "N2"
+ libro.Cell(Fila + 1, 4).Value = String.Format("{0}", SaldoFCant)
+ 'libro.Cell(Fila + 1, 4).Style.NumberFormat.Format = "$ #,##0.00"
+
+
+ ''Guarda streem y descarga
+ Dim fs As Stream = New MemoryStream()
+ wb.SaveAs(fs)
+ fs.Position = 0
+ Dim memoryStream As New MemoryStream()
+ Using input As Stream = fs
+ input.CopyTo(memoryStream)
+ End Using
+ memoryStream.Position = 0
+
+ Response.Clear()
+ Response.Buffer = True
+
+ Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+ Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.xlsx", "Reporte de Inventarios HP"))
+ Response.BinaryWrite(memoryStream.ToArray())
+ Response.End()
+
+ ''endGuarda streem y descarga
+ Catch
+
+ continuar = False
+ End Try
+ If Not continuar Then
+ Alert("Ocurrió un error al gener el excel", TipoMensaje.MsgAdvertencia)
+ End If
+ End Sub
+End Class
diff --git a/Inventarios/RepTraspasoAlmacen.aspx b/Inventarios/RepTraspasoAlmacen.aspx
index b211ab7f2..e8c40b88c 100644
--- a/Inventarios/RepTraspasoAlmacen.aspx
+++ b/Inventarios/RepTraspasoAlmacen.aspx
@@ -187,6 +187,11 @@
+
Tipo Almacen:
+
+
+
+
diff --git a/Inventarios/RepTraspasoAlmacen.aspx.vb b/Inventarios/RepTraspasoAlmacen.aspx.vb
index 221fb1c6e..6b3ca229e 100644
--- a/Inventarios/RepTraspasoAlmacen.aspx.vb
+++ b/Inventarios/RepTraspasoAlmacen.aspx.vb
@@ -74,7 +74,7 @@ Partial Class RepTraspasoAlmacen
'Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString
- If ObjInventarios.RepTraspasoAlmacen(FechaI.ToDate, FechaF.ToDate, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, UsuarioActual.CveEmpresa) Then
+ If ObjInventarios.RepTraspasoAlmacen(FechaI.ToDate, FechaF.ToDate, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, DdlTipoAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjInventarios.DtResultados
DtInventarios = ObjInventarios.DtResultados
GvDatos.Columns(5).Visible = DtInventarios.MAX("Serie") <> ""
@@ -119,6 +119,12 @@ Partial Class RepTraspasoAlmacen
DdlAlmacenOrigen.SelectedValue = "-1"
DdlAlmacenOrigen.DataBind()
DdlAlmacenOrigen.SelectedValueExist(UsuarioActual.CveAlmacen)
+
+ DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)")
+ DdlTipoAlmacen.DataBind()
+ DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
+
+
End Sub
Private Sub CargaAlmacenDestino()
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)")
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 21c7931e4..5c0aa1737 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -615,7 +615,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
'Existencia= Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
- If Existencia > Cantidad Then
+ If Existencia >= Cantidad Then
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
'las segunda consulta, que tenga existencia, ya con los parametros especificos
If (FechaCaducidad > MinFecha OrElse Not Serie.Contiene("", "-1") OrElse Not Lote.Contiene("", "-1")) Then
@@ -647,6 +647,7 @@ Partial Class Inventarios_TraspasoAlmacen
Else
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
+ Retorno = False
End If
Inv.Dispose()
@@ -863,7 +864,7 @@ Partial Class Inventarios_TraspasoAlmacen
'las segunda consulta, que tenga existencia, ya con los parametros especificos
If FechaCaducidad > MinFecha OrElse (Lote <> "-1" AndAlso Lote <> "") Then
If ObjInventario.GetExistenciasProducto(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, Caducidad:=FechaCaducidad) Then
- ExistenciaEspecificada = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CVeAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
+ ExistenciaEspecificada = ObjInventario.DtResultados.FiltroPrimeroValor("Existencia", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue)).ToDecimal
End If
'ExistenciaEspecificada = ObjInventario.GetExistenciasPS(dr("CvePS").ToString.ToEntero, dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
@@ -1721,12 +1722,6 @@ Partial Class Inventarios_TraspasoAlmacen
End If
-
-
-
-
-
-
'FUNCIONALIDAD PISTOLA DE CODIGOS
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
e.Row.FCTextBox("TxtCantidad").Enabled = False
@@ -1747,6 +1742,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim TextoError As String = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim CveMovimientoVirtualEntrada As Integer = 0
+ Dim CveMovimientoSalidaTransitorio As Integer = 0
Dim FolioVirtualEntrada As Integer = 0
Dim ObjInventario As New ClsInventarios
@@ -1761,6 +1757,13 @@ Partial Class Inventarios_TraspasoAlmacen
ErrorMovInv = True
End If
+
+ 'AGREGAMOS LA SALIDA
+ CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenTransitorio, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
+ Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero,
+ CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/G12")
+
+
Dim CvePrePoliza As Integer = -1
Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Cancelación Traspaso"
@@ -1796,11 +1799,21 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For
End If
- If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, -1, -1, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
+ 'MOV, Alm, Transito
+ If GvRow.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, Cantidad, GvRow.DataKey("CveUM").ToString.ToEntero, CvePS, PrecioUnitario, CveSeccionAlmacen:=-3, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote").ToString, FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=GvRow.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then
+ ErrorMovInv = True
+ TextoError = "Ocurrió un error al guardar los movimientos de salida"
+ Exit For
+ End If
+ Else
+ CveMovimientoSalidaTransitorio = 0
+ End If
importe += Cantidad * PrecioUnitario
End If
End If
@@ -1860,16 +1873,16 @@ Partial Class Inventarios_TraspasoAlmacen
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
- CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
+ CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al cancelar el traspaso"
End If
- 'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
- ' CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then
- ' ErrorMovInv = True
- ' TextoError = "Ocurrió un erro al cancelar el traspaso"
- 'End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
+ CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then
+ ErrorMovInv = True
+ TextoError = "Ocurrió un erro al cancelar el traspaso"
+ End If
End If
End If
@@ -2632,6 +2645,7 @@ Partial Class Inventarios_TraspasoAlmacen
ObjFactura.RetISR = 0
ObjFactura.IEPS = 0
ObjFactura.Total = 0
+ ObjFactura.RFCReceptor = "XAXX010101000"
'DETALLES
ObjFactura.DtDetalle = DtMovimientos
diff --git a/OC/CatEstatus.aspx.vb b/OC/CatEstatus.aspx.vb
index 724daf754..856492b95 100644
--- a/OC/CatEstatus.aspx.vb
+++ b/OC/CatEstatus.aspx.vb
@@ -99,7 +99,7 @@ Partial Class OC_CatEstatus
Dim ObjEstatus As New ClsOC
If ObjEstatus.GetEstatus() Then
ViewState("DTOCEstatus") = ObjEstatus.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
- GlobalDTOCEstatus(-1) = ObjEstatus.DtResultados
+ GlobalDTOCEstatus(UsuarioActual.CveEmpresa) = ObjEstatus.DtResultados
Else
GvDatos.DataSource = Nothing
End If
diff --git a/OC/OC.aspx b/OC/OC.aspx
index 113ef0fa1..54eed75cc 100644
--- a/OC/OC.aspx
+++ b/OC/OC.aspx
@@ -1102,7 +1102,7 @@
@@ -2880,103 +3120,114 @@
-
diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb
index 2ed1f151e..b17cec2e5 100644
--- a/Sistemas/UsuarioDetalle.aspx.vb
+++ b/Sistemas/UsuarioDetalle.aspx.vb
@@ -2473,7 +2473,17 @@ Partial Class Sistemas_UsuarioDetalle
End Sub
#Region "GRIDVIEW"
- Protected Sub GvEstatusUsuariosREQ_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosREQ.RowDataBound
+ Protected Sub GvEstatusUsuariosREQ_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosREQ.RowDataBound
+ If e.Row.RowType = DataControlRowType.Header Then
+ For i As Integer = 2 To GvEstatusUsuariosREQ.Columns.Count - 1
+ Dim CveEstatus As Integer = GvEstatusUsuariosREQ.Columns(i).FooterText.ToEntero
+ Dim idIndex As Integer = i - 1
+ If CveEstatus > -1 Then
+ e.Row.FCLabel($"LblTituloEstatusREQ{idIndex}").Text = GvEstatusUsuariosREQ.Columns(i).HeaderText
+ End If
+ Next
+ End If
+
If e.Row.RowType = DataControlRowType.DataRow Then
Dim tmpT As DataTable = DTEstatusSubProyectos.FiltraParametros(String.Format("CveSubProyecto = {0}", e.Row.DBCampo("CveSubProyecto").ToString))
@@ -2487,6 +2497,7 @@ Partial Class Sistemas_UsuarioDetalle
Dim hdnCveEstatusUsuarios As HiddenField = e.Row.FCHiddenField($"hdnCveEstatusUsuarios{idIndex}")
Dim lblSuperior As Label = e.Row.FCLabel($"lblSuperior{idIndex}")
Dim lblLimites As Label = e.Row.FCLabel($"lblLimites{idIndex}")
+ chkEstatus.CssClass = $"chkEstatusREQ{idIndex}"
Dim dtTemp As New DataTable
Dim existenPermisosActuales As Boolean
@@ -2599,7 +2610,18 @@ Partial Class Sistemas_UsuarioDetalle
Next
End If
End Sub
- Protected Sub GvEstatusUsuariosOC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosOC.RowDataBound
+ Protected Sub GvEstatusUsuariosOC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosOC.RowDataBound
+
+ If e.Row.RowType = DataControlRowType.Header Then
+ For i As Integer = 2 To GvEstatusUsuariosOC.Columns.Count - 1
+ Dim CveEstatus As Integer = GvEstatusUsuariosOC.Columns(i).FooterText.ToEntero
+ Dim idIndex As Integer = i - 1
+ If CveEstatus > -1 Then
+ e.Row.FCLabel($"LblTituloEstatus{idIndex}").Text = GvEstatusUsuariosOC.Columns(i).HeaderText
+ End If
+ Next
+ End If
+
If e.Row.RowType = DataControlRowType.DataRow Then
Dim tmpT As DataTable = DTEstatusSubProyectos.FiltraParametros(String.Format("CveSubProyecto = {0}", e.Row.DBCampo("CveSubProyecto").ToString))
@@ -2612,8 +2634,8 @@ Partial Class Sistemas_UsuarioDetalle
Dim ImgClasificaciones As LinkButton = e.Row.FCLinkButton($"ImgClasificaciones{idIndex}")
Dim hdnCveEstatusUsuarios As HiddenField = e.Row.FCHiddenField($"hdnCveEstatusUsuarios{idIndex}")
Dim lblSuperior As Label = e.Row.FCLabel($"lblSuperior{idIndex}")
- Dim lblLimites As Label = e.Row.FCLabel($"lblLimites{idIndex}")
-
+ Dim lblLimites As Label = e.Row.FCLabel($"lblLimites{idIndex}")
+ chkEstatus.CssClass = $"chkEstatus{idIndex}"
Dim dtTemp As New DataTable
Dim existenPermisosActuales As Boolean
diff --git a/Site.master b/Site.master
index 6c399c64c..24da7ea86 100644
--- a/Site.master
+++ b/Site.master
@@ -274,6 +274,7 @@
diff --git a/Site.master.vb b/Site.master.vb
index a6f63e6b8..cca4daef4 100644
--- a/Site.master.vb
+++ b/Site.master.vb
@@ -77,6 +77,7 @@ Partial Class Site
If UsuarioActual.Empresa.CvePlataforma = 3 Then
lnkFavicon.Href = "/Imagenes/favicongps.ico"
tTitulo.Text = "SIGNALS GPS"
+ LnkDescargarManual.Visible = False
Else
lnkFavicon.Href = "/Imagenes/favicon.ico"
End If
@@ -571,6 +572,34 @@ Partial Class Site
UpNotificacionesFoliosSAT.Update()
RegistraScript(String.Format("$('#{0}').modal();", pnlNotificacionSAT.ClientID))
End Sub
+ Protected Sub LnkDescargarManual_Click(sender As Object, e As EventArgs)
+ Dim ruta As String = $"{ModExtensiones.DirectorioEmpresas}Grales\ManualSIG.pdf"
+
+ Dim Archivo As New System.IO.FileInfo(ruta)
+
+ Try
+ If Archivo IsNot Nothing Then
+ If Archivo.Exists Then
+
+ HttpContext.Current.Response.Clear()
+ HttpContext.Current.Response.ClearContent()
+ HttpContext.Current.Response.ContentType = "application/octet-stream"
+ HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", "Manual Plataforma SIG 2021.pdf"))
+ HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
+ HttpContext.Current.Response.TransmitFile(ruta)
+ Response.Flush() ' send it to the client to download
+ HttpContext.Current.Response.SuppressContent = True
+ HttpContext.Current.ApplicationInstance.CompleteRequest()
+ Response.End()
+
+ Else
+ Alert("El archivo no existe", TipoMensaje.MsgAdvertencia)
+ End If
+
+ End If
+ Catch ex As Exception
+ End Try
+ End Sub
End Class
Public Class TipoCambioActual
Public Fecha As Date
diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx
index c3a985ea4..d24a76714 100644
--- a/Ventas/ActualizarPrecios.aspx
+++ b/Ventas/ActualizarPrecios.aspx
@@ -154,7 +154,7 @@
" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
-
diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb
index eee8c3a09..5f654f4da 100644
--- a/Ventas/ActualizarPrecios.aspx.vb
+++ b/Ventas/ActualizarPrecios.aspx.vb
@@ -179,9 +179,12 @@ Partial Class Ventas_ActualizarPrecios
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
GVPrecios.Columns(2).Visible = True
+ End If
+
+ If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec
+ GVPrecios.Columns(11).Visible = True
End If
-
dvDatos.Visible = True
GVPrecios.DataBind()
@@ -400,28 +403,37 @@ Partial Class Ventas_ActualizarPrecios
Alert("Debe Seleccionar la lista de precios a cargar. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
+
+ 'LA PRIMERA COLUMNA SIEMRPE ES CODIGO
If Not dt.Columns(0).ColumnName = "Código" Then
Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
+ End If
+
+ Dim IndiceActualColExcel As Integer = 1
+ Dim StrColPos As String() = {"primera", "segunda", "tecera", "cuarta"}
+
+ 'SI ES EMPRESA DE ACUMULADORES SE AGREGA LA COLUMNA "Código CPK"
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ If Not dt.Columns(IndiceActualColExcel).ColumnName = "Código CPK" Then
+ Alert("El nombre de la segunda columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ IndiceActualColExcel += 1
+ End If
+
+ If Not dt.Columns(IndiceActualColExcel).ColumnName = "Producto / Servicio" Then
+ Alert($"El nombre de la {StrColPos(IndiceActualColExcel)} columna debe ser 'Producto / Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ IndiceActualColExcel += 1
+
+ If Not dt.Columns(IndiceActualColExcel).ColumnName = "Precio" Then
+ Alert($"El nombre de la {StrColPos(IndiceActualColExcel)} columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
+ Exit Sub
End If
- If Not dt.Columns(1).ColumnName = "Producto / Servicio" Then
- Alert("El nombre de la segunda columna debe ser 'Producto / Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
- Exit Sub
- End If
-
- If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
- If Not dt.Columns(3).ColumnName = "Precio" Then
- Alert("El nombre de la cuarta columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
- Exit Sub
- End If
- Else
- If Not dt.Columns(2).ColumnName = "Precio" Then
- Alert("El nombre de la tercera columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
- Exit Sub
- End If
- End If
-
-
dt.TableName = "Datos"
@@ -483,11 +495,7 @@ Partial Class Ventas_ActualizarPrecios
ObjPS.Dispose()
End Try
- 'If RowNoEncontrados.Length > 0 Then
- ' Alert("Los siguientes Productos o Servicios no se encontraron en la Base de Datos.<\BR>" & RowNoEncontrados, TipoMensaje.MsgAdvertencia)
- 'Else
- ' Alert("Se Cargaron " & NumRow & " Productos o Servicios correctamente.")
- 'End If
+
End If
End Sub
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index 80259f113..4362af25c 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -173,10 +173,9 @@
}
- .orange{
- color:orange;
- background-color:orange;
-
+ .orange {
+ color: orange;
+ background-color: orange;
}
@@ -879,6 +878,56 @@