This commit is contained in:
Antonio Gonzalez
2019-12-26 17:37:30 -07:00
32 changed files with 601 additions and 482 deletions

View File

@@ -206,10 +206,7 @@ Partial Class Acumuladores_CatTiposDefecto
'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00")
'TxtPuntos.Text = GvRow.DataKey("Puntos").ToDecimal.ToString("###,###,###.00")
'DdlPS.Items.Clear()
'DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
'DdlPS.DataBind()
'DdlPS.SelectedValueExist(GvRow.DataKey("CvePSCargo").ToEntero)
BtnAgregarTiposDModal.Text = "Actualizar"

View File

@@ -207,10 +207,6 @@ Partial Class Acumuladores_CatTiposUso
'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00")
'TxtPuntos.Text = GvRow.DataKey("Puntos").ToDecimal.ToString("###,###,###.00")
'DdlPS.Items.Clear()
'DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
'DdlPS.DataBind()
'DdlPS.SelectedValueExist(GvRow.DataKey("CvePSCargo").ToEntero)
BtnAgregarTiposUsoModal.Text = "Actualizar"

View File

@@ -587,7 +587,7 @@ Public Class ClsAcumuladores
Public Function GetNuevoConsecutivoFolio(CveFolioGarantia As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter(String.Format("SELECT MAX(Consecutivo) + 1 AS NuevoConsecutivo FROM Acum_GarantiasDetalle d WHERE d.CveFolioGarantia = {0}", CveFolioGarantia), CommandType.Text)
SqlDataAdapter(String.Format("SELECT MAX(dbo.FNC_Numero(Consecutivo)) AS NuevoConsecutivo FROM Acum_GarantiasDetalle d WHERE d.CveFolioGarantia = {0}", CveFolioGarantia), CommandType.Text)
Try
SqlAdapter.Fill(Data)
@@ -758,6 +758,23 @@ Public Class ClsAcumuladores
Return Retorno
End Function
Public Function UpdateGarantiasDetallePoliza(CveVenta As Integer, FolioPolizaVirtual As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetallePolizaUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@FolioPolizaVirtual", SqlDbType.VarChar).Value = FolioPolizaVirtual
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error a actualizar folio de garantia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region

View File

@@ -1100,11 +1100,12 @@ Public Class ClsCompProveedores
#Region "S U C U R S A L E S"
Public Function GetSucursales(CveProveedor As Integer) As Boolean
Public Function GetSucursales(CveProveedor As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ProveedorSucursalGet")
SqlAdapter.SelectCommand.Parameters.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
Try
SqlAdapter.Fill(Data)
Retorno = True

View File

@@ -1238,6 +1238,25 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetMovimientosDetalleVirtual(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveCompra As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleVirtualGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los movimientos virtuales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddMovimientoDetalle(CveMovimiento As Integer, Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Double, CveAF As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional SerieLote As String = "",
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Double = -1, Optional FechaCaducidad As Date = MinFecha,
Optional CostoIndirecto As Double = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,

View File

@@ -431,32 +431,50 @@ Public Class ClsPaginas
End Property
Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim P As New ClsCompProveedores
If P.GetProveedorClasificacion(UsuarioActual.CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTProveedorClasificacion"), DataTable), String.Format("CveEmpresa ={0}", CveEmpresa), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa ={0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProveedorClasificacion = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProveedorClasificacion = DirectCast(Application("GlobalDTProveedorClasificacion"), DataTable)
GlobalDTProveedorClasificacion = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTProveedorClasificacion") = value
Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTProveedorSucursales(CveProveedor As Integer) As DataTable
Property GlobalDTProveedorSucursales(CveProveedor As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProveedorSucursales{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim P As New ClsCompProveedores
If P.GetSucursales(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProveedor <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTProveedorSucursales"), DataTable), String.Format("CveProveedor = {0}", CveProveedor), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveProveedor = {0}", CveProveedor), "", DataViewRowState.CurrentRows)
GlobalDTProveedorSucursales = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProveedorSucursales = DirectCast(Application("GlobalDTProveedorSucursales"), DataTable)
GlobalDTProveedorSucursales = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTProveedorSucursales") = value
Dim AppNombre As String = String.Format("GlobalDTProveedorSucursales{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTRoles(CveEmpresa As Integer) As DataTable
@@ -737,32 +755,50 @@ Public Class ClsPaginas
Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get
Public Shared Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida()
If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
'If ObjUnidadesMedida.GetUnidadesMedidaAlias() Then Application("GlobalDTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedidaAlias") = Nothing
ObjUnidadesMedida.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable)
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTUnidadesMedida") = value
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
Get
Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida()
If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados Else Application(AppNombre) = Nothing
ObjUnidadesMedida.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedidaAlias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUnidadesMedidaAlias = DirectCast(Application("GlobalDTUnidadesMedidaAlias"), DataTable)
GlobalDTUnidadesMedidaAlias = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTUnidadesMedidaAlias") = value
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTEstatusOrdenCompra() As DataTable
@@ -843,19 +879,20 @@ Public Class ClsPaginas
Application("GlobalDTProyectos") = value
End Set
End Property
Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Public Shared Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos Then
Application("GlobalDTSubProyectos") = P.DtResultados
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then
HttpContext.Current.Application(AppNombre) = P.DtResultados
End If
P.Dispose()
Dim msg As String = "aqui no se carga subproyectos"
If Request IsNot Nothing Then
msg = msg & Request.ServerVariables("URL")
If HttpContext.Current.Request IsNot Nothing Then
msg = msg & HttpContext.Current.Request.ServerVariables("URL")
End If
msg.GuardaLog()
@@ -868,25 +905,26 @@ Public Class ClsPaginas
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable)
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
If value Is Nothing OrElse value.Rows.Count = 0 Then
Dim msg As String = "aqui no se carga subproyectos"
If Request IsNot Nothing Then
msg = msg & Request.ServerVariables("URL")
If HttpContext.Current.Request IsNot Nothing Then
msg = msg & HttpContext.Current.Request.ServerVariables("URL")
End If
msg.GuardaLog()
End If
Application("GlobalDTSubProyectos") = value
End If
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
@@ -1141,11 +1179,20 @@ Public Class ClsPaginas
ObjPS.Dispose()
End Get
End Property
Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
Public Shared Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(-1) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable() Else HttpContext.Current.Application("GlobalDTPSSimplificado") = Nothing
ObjPS.Dispose()
End If
Dim Cons = DirectCast(Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
@@ -1160,48 +1207,73 @@ Public Class ClsPaginas
End Try
Else
GlobalDTPSSimplificado = DirectCast(Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Application("GlobalDTPSSimplificado") = value
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTProductosServiciosAlias(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosAlias{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAlias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing
ObjPS.Dispose()
End If
If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstado = {0} ", Estatus)
Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosAlias"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosAlias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosAlias = DirectCast(Application("GlobalDTProductosServiciosAlias"), DataTable)
GlobalDTProductosServiciosAlias = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTProductosServiciosAlias") = value
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosAlias{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer) As DataTable
Public Shared Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
ObjPS.Dispose()
End If
End If
If CvePS <> -1 OrElse CveUM <> -1 Then
Dim StrSQL As New StringBuilder
If CvePS <> -1 Then StrSQL.AppendFormat(" AND CvePS = {0}", CvePS)
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(Application("GlobalDTProductosServiciosEquivalencias"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosEquivalencias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosEquivalencias = DirectCast(Application("GlobalDTProductosServiciosEquivalencias"), DataTable)
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTProductosServiciosEquivalencias") = value
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable
@@ -1222,20 +1294,31 @@ Public Class ClsPaginas
Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPSAdicionales{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing
ObjPS.Dispose()
End If
End If
Dim Str As New StringBuilder
If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS)
If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa)
If CvePS > 0 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTPSAdicionales"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTPSAdicionales = Dv.ToTable
Dv.Dispose()
Else
GlobalDTPSAdicionales = DirectCast(Application("GlobalDTPSAdicionales"), DataTable)
GlobalDTPSAdicionales = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTPSAdicionales") = value
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSAdicionales{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable
@@ -1287,20 +1370,29 @@ Public Class ClsPaginas
End Property
Property GlobalDTImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTImpuestosLocales{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing
ObjPS.Dispose()
End If
Dim Str As New StringBuilder
If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS)
If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa)
If CvePS > 0 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTImpuestosLocales"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTImpuestosLocales = Dv.ToTable
Dv.Dispose()
Else
GlobalDTImpuestosLocales = DirectCast(Application("GlobalDTImpuestosLocales"), DataTable)
GlobalDTImpuestosLocales = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTImpuestosLocales") = value
Dim AppNombre As String = String.Format("GlobalDTImpuestosLocales{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
'Bancos
@@ -1419,49 +1511,56 @@ Public Class ClsPaginas
'Fin Ruta
'Cliente
Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
Get
Get
Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados Else Application(AppNombre) = Nothing
ObjClientes.Dispose()
End If
If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
If Application("GlobalDTCliente") Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados Else Application("GlobalDTCliente") = Nothing
ObjClientes.Dispose()
Dim Dv As New DataView(DirectCast(Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
Else
Dim Dv As New DataView(DirectCast(Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
End If
Dv.Dispose()
Else
GlobalDTCliente = DirectCast(Application("GlobalDTCliente"), DataTable)
GlobalDTCliente = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTCliente") = value
Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClienteClasificacion(UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados Else Application(AppNombre) = Nothing
ObjClientes.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTClienteClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClienteClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClienteClasificaciones = DirectCast(Application("GlobalDTClienteClasificaciones"), DataTable)
GlobalDTClienteClasificaciones = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTClasificacionesCliente") = value
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable
@@ -1509,17 +1608,26 @@ Public Class ClsPaginas
End Property
Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados Else Application(AppNombre) = Nothing
ObjProveedores.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTCompProveedores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTCompProveedores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCompProveedores = DirectCast(Application("GlobalDTCompProveedores"), DataTable)
GlobalDTCompProveedores = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTCompProveedores") = value
Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
'EstatusFactura
@@ -1637,7 +1745,7 @@ Public Class ClsPaginas
Application("GlobalDTNom_Periodos") = value
End Set
End Property
Property GlobalDTVtaFormaPago() As DataTable
Public Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(Application("GlobalDTVtaFormaPago"), DataTable)
End Get

View File

@@ -110,10 +110,14 @@ Public Class ClsSubProyectos
SqlTransacc.Commit()
End Sub
Public Function GetSubProyectos() As Boolean
Public Function GetSubProyectos(Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_SubProyectosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -121,10 +125,6 @@ Public Class ClsSubProyectos
OnError("Ocurrió un error al obtener el Catálogo de SubProyectos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function

View File

@@ -126,14 +126,14 @@ Public Class ClsUnidadesMedida
#Region " UNIDADES DE MEDIDA "
Public Function GetUnidadesMedida() As Boolean
Public Function GetUnidadesMedida(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_UnidadesMedidaGet")
' With SqlAdapter.SelectCommand.Parameters
'.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
'End With
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
@@ -234,10 +234,11 @@ Public Class ClsUnidadesMedida
#End Region
#Region " UM ALIAS "
Public Function GetUnidadesMedidaAlias(Optional CveUnidadMedida As Integer = -1) As Boolean
Public Function GetUnidadesMedidaAlias(CveEmpresa As Integer, CveUnidadMedida As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_UnidadesMedidaAliasGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
End With
Try

View File

@@ -2630,7 +2630,7 @@ Namespace Modelos
importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador)
importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, ClsPaginas.GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
@@ -2705,7 +2705,7 @@ Namespace Modelos
importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador)
importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, ClsPaginas.GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
@@ -3204,7 +3204,7 @@ Namespace Modelos
If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1)
DtEquivalencias = ClsPaginas.GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
@@ -5446,11 +5446,11 @@ Namespace Modelos
Public Sub SetSubProyecto()
If CveSubProyecto > 0 Then
SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
End If
End Sub
Public Sub SetSubProyectoMatriz()
Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
Dim Row As Data.DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
If Not IsNothing(Row) Then
SubProyectoMatriz = New Modelos.SubProyectoModel(Row)
End If
@@ -5496,12 +5496,12 @@ Namespace Modelos
End Sub
Public Sub SetSubProyecto(obj As ClsPaginas)
If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then
SubProyecto = New Modelos.SubProyectoModel(obj.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
End If
End Sub
Public Sub SetSubProyectoMatriz(obj As ClsPaginas)
If Not IsNothing(obj) Then
Dim Row As Data.DataRow = obj.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
Dim Row As Data.DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
If Not IsNothing(Row) Then
SubProyectoMatriz = New Modelos.SubProyectoModel(Row)
End If
@@ -6339,45 +6339,8 @@ Namespace Modelos
End If
HttpContext.Current.Application("GlobalDTProyectos") = value
End Set
End Property
Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
If DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos Then
HttpContext.Current.Application("GlobalDTSubProyectos") = P.DtResultados
End If
P.Dispose()
Dim msg As String = "aqui no se carga subproyectos"
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then
Dim msg As String = "aqui no se carga subproyectos"
End If
HttpContext.Current.Application("GlobalDTSubProyectos") = value
End Set
End Property
End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get
@@ -6566,100 +6529,10 @@ Namespace Modelos
ObjPS.Dispose()
End Get
End Property
Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Cons = DirectCast(HttpContext.Current.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
Try
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Catch ex As Exception
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTPSSimplificado") = value
End Set
End Property
Property GlobalDTProductosServiciosAlias(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstado = {0} ", Estatus)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosAlias"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosAlias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosAlias = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosAlias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosAlias") = value
End Set
End Property
Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer) As DataTable
Get
If CvePS <> -1 OrElse CveUM <> -1 Then
Dim StrSQL As New StringBuilder
If CvePS <> -1 Then StrSQL.AppendFormat(" AND CvePS = {0}", CvePS)
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosEquivalencias"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosEquivalencias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosEquivalencias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosEquivalencias") = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosCaracteristicas = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosCaracteristicas = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicas"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicas") = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosCaracteristicasOpciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosCaracteristicasOpciones = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicasOpciones"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosCaracteristicasOpciones") = value
End Set
End Property
End Property
Property GlobalDTInvMetodosInventario() As DataTable
Get
GlobalDTInvMetodosInventario = DirectCast(HttpContext.Current.Application("GlobalDTInvMetodosInventario"), DataTable)

View File

@@ -519,7 +519,7 @@ Public Class WS_PuntoVenta
Dim objUnidadesMedida As New ClsUnidadesMedida
Dim Respuesta As New RespuestaWS
If objUnidadesMedida.GetUnidadesMedida() Then
If objUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then
Respuesta.Datos = objUnidadesMedida.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Respuesta.Datos.TableName = "Resultados"
Respuesta.HuboError = False

View File

@@ -1929,24 +1929,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTProductosServiciosAlias") = value
End Set
End Property
Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer) As DataTable
Get
If CvePS <> -1 OrElse CveUM <> -1 Then
Dim StrSQL As New StringBuilder
If CvePS <> -1 Then StrSQL.AppendFormat(" AND CvePS = {0}", CvePS)
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosEquivalencias"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosEquivalencias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application("GlobalDTProductosServiciosEquivalencias"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTProductosServiciosEquivalencias") = value
End Set
End Property
Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then

View File

@@ -344,10 +344,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If UsaGlobal Then
Dim DTPS = DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
If UsaGlobal Then
'Dim DTPS = DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
If DTPS IsNot Nothing Then
@@ -583,10 +583,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim DTPS = DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable ' DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
If DTPS IsNot Nothing Then
'APLICACION DE FILTROS

View File

@@ -2804,7 +2804,7 @@ Partial Class Bancos_IE
If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then
ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TCDocumento)) - ImporteAplicar).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
MsgError = "Ocurrió un error al registrara el asiento de bancos complementaria de devolución"
End If
End If

View File

@@ -2361,10 +2361,10 @@ Partial Class Compras_Compras
CambiaEjercicioAC(False)
End If
If GlobalDTProveedorSucursales(CveProveedor).Rows.Count > 0 Then
If GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).Rows.Count > 0 Then
RowProveedorSucursal.Visible = True
DdlProveedorSucursal.Items.Clear()
DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(CveProveedor)
DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
DdlProveedorSucursal.DataBind()
DdlProveedorSucursal.Items.Insert(0, New ListItem("Matriz", "0"))
DdlProveedorSucursal.SelectedValueExist(dr("CveProveedorSucursal").ToString.ToEntero)
@@ -3128,7 +3128,7 @@ Partial Class Compras_Compras
If Not CveCompra > 0 Then '[IPP] SI YA ESTA REGISTRADA LOS VALORES SE CARGAN EN EL CARGACOMPRA()
'DF 11-04-17
Dim dtprovsuc As DataTable = GlobalDTProveedorSucursales(ObjProveedor.CveProveedor)
Dim dtprovsuc As DataTable = GlobalDTProveedorSucursales(ObjProveedor.CveProveedor, UsuarioActual.CveEmpresa)
If dtprovsuc IsNot Nothing AndAlso dtprovsuc.Rows.Count > 0 Then
RowProveedorSucursal.Visible = True
DdlProveedorSucursal.Items.Clear()
@@ -3809,7 +3809,7 @@ Partial Class Compras_Compras
'DF - 10/04/2017
If UsuarioActual.TienePermisoProceso(187) Then
If TxtSerie.Text <> SerieVieja Then
Dim SerieNueva As String = GlobalDTProveedorSucursales(CveProveedor).FiltroPrimeroValor("Serie", $"Serie = '{TxtSerie.Text}'").ToString
Dim SerieNueva As String = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).FiltroPrimeroValor("Serie", $"Serie = '{TxtSerie.Text}'").ToString
If SerieNueva = "" Then
Alert("La Serie no es válida, por favor revise que se encuentre dentro de la lista de las sucursales del proveedor.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -5069,7 +5069,7 @@ Partial Class Compras_Compras
'UNIDAD BASE - EQUIVALENCIAS - INVENTARIO
If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1)
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
@@ -10215,7 +10215,7 @@ Partial Class Compras_Compras
'VALIDA UNIDAD DE MEDIDA
If e.Row.DBCampo("CvePS").ToString.ToEntero > 0 Then
Dim DtEquivalencias = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToString.ToEntero, -1)
Dim DtEquivalencias = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
'SI UM NO ESTA REGISTRADA
If e.Row.DBCampo("CveUM").ToString.ToEntero <= 0 Then
@@ -10378,17 +10378,19 @@ Partial Class Compras_Compras
#Region "METODOS"
Private Sub GeneraGlobalDT(data As Object)
Dim ObjPS As New ClsProductosServicios
If (ObjPS.GetPSSimplificado(-1)) Then
Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable
End If
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
End If
ObjPS.Dispose()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
'If (ObjPS.GetPSSimplificado(-1)) Then
' Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable
'End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
'ObjPS.Dispose()
End Sub
Private Function notienepresupuesto() As Boolean
Dim notienerecursos = False
@@ -12026,10 +12028,10 @@ Partial Class Compras_Compras
ChkConsignacion.Enabled = False
End If
If GlobalDTProveedorSucursales(DdlProveedor.SelectedValue.ToEntero).Rows.Count > 0 Then
If GlobalDTProveedorSucursales(DdlProveedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows.Count > 0 Then
RowProveedorSucursal.Visible = True
DdlProveedorSucursal.Items.Clear()
DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(DdlProveedor.SelectedValue.ToEntero)
DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(DdlProveedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlProveedorSucursal.DataBind()
DdlProveedorSucursal.Items.Insert(0, New ListItem("Selecciona una Sucursal", "-1"))
DdlProveedorSucursal.Items.Insert(0, New ListItem("Matriz", "0"))
@@ -16583,7 +16585,7 @@ Partial Class Compras_Compras
ddlUM.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
ddlUM.DataSource = GlobalDTProductosServiciosEquivalencias(GvRow.DataKey("CvePS").ToEntero, -1)
ddlUM.DataSource = GlobalDTProductosServiciosEquivalencias(GvRow.DataKey("CvePS").ToEntero, -1, UsuarioActual.CveEmpresa)
Else
ddlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If
@@ -16707,7 +16709,7 @@ Partial Class Compras_Compras
ddlUM.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
ddlUM.DataSource = GlobalDTProductosServiciosEquivalencias(PS("CvePS").ToString.ToEntero, -1)
ddlUM.DataSource = GlobalDTProductosServiciosEquivalencias(PS("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
Else
ddlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If
@@ -17363,7 +17365,7 @@ Partial Class Compras_Compras
If Not DdlPSAlias2.SelectedValue = "" Then
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPSAlias2.SelectedValue.ToEntero).FiltroPrimero("")
If DrPS IsNot Nothing Then
DdlUnidadAlias.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPSAlias2.SelectedValue.ToEntero, -1)
DdlUnidadAlias.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPSAlias2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidadAlias.DataBind()
HdnPSAliasCveClasificacion.Value = DrPS("CveClasificacion").ToString
HdnPSAliasClasificacion.Value = DrPS("Clasificacion").ToString
@@ -17424,7 +17426,7 @@ Partial Class Compras_Compras
Private Sub GeneraGlobalEquivalencias()
Dim ObjPS = New ClsProductosServicios
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
End If
ObjPS.Dispose()
End Sub
@@ -17438,7 +17440,7 @@ Partial Class Compras_Compras
UpUMAlias.Update()
End Sub
Protected Sub DdlUMAlias_SelectedIndexChanged(sender As Object, e As EventArgs)
If GlobalDTProductosServiciosEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, DdlUMAlias.SelectedValue.ToEntero).Rows.Count > 0 Then
If GlobalDTProductosServiciosEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, DdlUMAlias.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows.Count > 0 Then
RegistraScript("$('#RowUMEquivalencia').addClass('hidden')", "RowUMEquivalenciaShow")
Else
RegistraScript("$('#RowUMEquivalencia').removeClass('hidden')", "RowUMEquivalenciaHide")
@@ -17450,7 +17452,7 @@ Partial Class Compras_Compras
Dim ObjPS As New ClsProductosServicios(ObjUM.IniciaTransacSQL())
Dim TieneError = False
Dim DtEquivalencia = GlobalDTProductosServiciosEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, -1)
Dim DtEquivalencia = GlobalDTProductosServiciosEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
Dim CveUM = -1
Dim UM = ""
Dim Equivalencia = 0.0
@@ -17464,7 +17466,7 @@ Partial Class Compras_Compras
'SI NO TIENE EQUIVALENCIA DEL PS - AGREGA LA EQUIVALENCIA
If Not TieneError Then
If Not GlobalDTProductosServiciosEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, DdlUMAlias.SelectedValue.ToEntero).Rows.Count > 0 Then
If Not GlobalDTProductosServiciosEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, DdlUMAlias.SelectedValue.ToEntero, UsuarioActual.CveEmpresa).Rows.Count > 0 Then
If Not ObjPS.AddPSEquivalencias(TmpDT.Rows(HdnUMAliasInd.Value.ToEntero)("CvePS").ToString.ToEntero, DdlUMAlias.SelectedValue.ToEntero, TxtUMEquivalenciaCantidad.Text.ToDecimal, False, 0, UsuarioActual.CveUsuario) Then
TieneError = True
End If
@@ -17559,7 +17561,7 @@ Partial Class Compras_Compras
End Sub
Protected Sub LBAplicarEquivalencia_Click(sender As Object, e As EventArgs)
Dim Dr = TmpDT.Rows(CType(CType(sender, LinkButton).NamingContainer, GridViewRow).RowIndex)
Dim DtEquivalencia = GlobalDTProductosServiciosEquivalencias(Dr("CvePS").ToString.ToEntero, -1)
Dim DtEquivalencia = GlobalDTProductosServiciosEquivalencias(Dr("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
Dim Equivalencia = DtEquivalencia.FiltroPrimeroValor("Cantidad", $"CveUM = {Dr("CveUM")}").ToDouble
If Equivalencia > 0 Then
@@ -17586,7 +17588,7 @@ Partial Class Compras_Compras
Dim OjbUM As New ClsUnidadesMedida
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
End If
If OjbUM.GetUnidadesMedidaAlias(-1) Then
@@ -18982,11 +18984,12 @@ Partial Class Compras_Compras
RecargaPSGlobal()
End Sub
Private Sub RecargaPSGlobal()
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
'ObjPS.Dispose()
End Sub
#End Region

View File

@@ -867,7 +867,8 @@ Partial Class General_SaldosIniciales
If Not ErrorPS Then
ObjPS.Commit()
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Productos/Servicios correctamente. <br>Se Actualizaron: <b>{1}</b> Productos/Servicios ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else

View File

@@ -318,27 +318,27 @@
If ObjVenta.GetClasificacionDetalle(-1, CveClasificacion:=-1) Then
Application("GlobalDTClasificacionesDetalle") = ObjVenta.DtResultados
End If
ObjVenta.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'S U C U R S A L E S
'Dim ObjSucursales As New ClsSucursales()
'If ObjSucursales.GetSucursales() Then Application("GlobalDTSucursales") = ObjSucursales.DtResultados Else Application("GlobalDTSucursales") = Nothing
'ObjSucursales.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'U N I D A D E S - D E - M E D I D A
Dim ObjUnidadesMedida As New ClsUnidadesMedida()
If ObjUnidadesMedida.GetUnidadesMedida() Then Application("GlobalDTUnidadesMedida") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedida") = Nothing
If ObjUnidadesMedida.GetUnidadesMedidaAlias() Then Application("GlobalDTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedidaAlias") = Nothing
ObjUnidadesMedida.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'M E T O D O S - D E - P A G O
ObjVenta.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'S U C U R S A L E S
'Dim ObjSucursales As New ClsSucursales()
'If ObjSucursales.GetSucursales() Then Application("GlobalDTSucursales") = ObjSucursales.DtResultados Else Application("GlobalDTSucursales") = Nothing
'ObjSucursales.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'U N I D A D E S - D E - M E D I D A
'Dim ObjUnidadesMedida As New ClsUnidadesMedida()
'If ObjUnidadesMedida.GetUnidadesMedida(-1) Then Application("GlobalDTUnidadesMedida") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedida") = Nothing
'If ObjUnidadesMedida.GetUnidadesMedidaAlias() Then Application("GlobalDTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedidaAlias") = Nothing
'ObjUnidadesMedida.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'M E T O D O S - D E - P A G O
Dim ObjMetodoPago As New ClsMetodosPagos()
If ObjMetodoPago.GetMetodosPago() Then Application("GlobalDTMetodosPago") = ObjMetodoPago.DtResultados Else Application("GlobalDTMetodosPago") = Nothing
ObjMetodoPago.Dispose()
@@ -383,7 +383,7 @@
'S U B P R O Y E C T O S
Dim ObjSubProyectos As New ClsSubProyectos
If ObjSubProyectos.GetSubProyectos Then Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados Else Application("GlobalDTSubProyectos") = Nothing
'If ObjSubProyectos.GetSubProyectos Then Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados Else Application("GlobalDTSubProyectos") = Nothing
If ObjSubProyectos.GetSubProyectosUsuarios Then
Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"})
Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
@@ -413,40 +413,40 @@
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'P R O D U C T O S S E R V I C I O S
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAlias(-1, -1) Then Application("GlobalDTProductosServiciosAlias") = ObjPS.DtResultados Else Application("GlobalDTProductosServiciosAlias") = Nothing
If ObjPS.GetPSEquivalencias(-1, -1) Then Application("GlobalDTProductosServiciosEquivalencias") = ObjPS.DtResultados Else Application("GlobalDTProductosServiciosEquivalencias") = Nothing
'If ObjPS.GetPS(-1, -1, -1) Then Application("GlobalDTProductosServicios") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTProductosServicios") = Nothing
If ObjPS.GetMetodosInv() Then Application("GlobalDTInvMetodosInventario") = ObjPS.DtResultados Else Application("GlobalDTInvMetodosInventario") = Nothing
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
If ObjPS.GetPSAdicionales(-1, -1) Then Application("GlobalDTPSAdicionales") = ObjPS.DtResultados Else Application("GlobalDTPSAdicionales") = Nothing
ObjPS.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'P R O V E E D O R E S
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProveedores.DtResultados Else Application("GlobalDTCompProveedores") = Nothing
If ObjProveedores.GetProveedorClasificacion(-1) Then Application("GlobalDTProveedorClasificacion") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorClasificacion") = Nothing
If ObjProveedores.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing
ObjProveedores.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'P R O V E E D O R E S C U E N T A S
Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSAlias(-1, -1) Then Application("GlobalDTProductosServiciosAlias") = ObjPS.DtResultados Else Application("GlobalDTProductosServiciosAlias") = Nothing
'If ObjPS.GetPSEquivalencias(-1, -1) Then Application("GlobalDTProductosServiciosEquivalencias") = ObjPS.DtResultados Else Application("GlobalDTProductosServiciosEquivalencias") = Nothing
'If ObjPS.GetPS(-1, -1, -1) Then Application("GlobalDTProductosServicios") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTProductosServicios") = Nothing
If ObjPS.GetMetodosInv() Then Application("GlobalDTInvMetodosInventario") = ObjPS.DtResultados Else Application("GlobalDTInvMetodosInventario") = Nothing
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
'If ObjPS.GetPSAdicionales(-1, -1) Then Application("GlobalDTPSAdicionales") = ObjPS.DtResultados Else Application("GlobalDTPSAdicionales") = Nothing
ObjPS.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'P R O V E E D O R E S
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProveedores.DtResultados Else Application("GlobalDTCompProveedores") = Nothing
'If ObjProveedores.GetProveedorClasificacion(-1) Then Application("GlobalDTProveedorClasificacion") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorClasificacion") = Nothing
'If ObjProveedores.GetSucursales(-1, -1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing
'ObjProveedores.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'P R O V E E D O R E S C U E N T A S
Dim ObjProveedoresBancos As New ClsGenerales
If ObjProveedoresBancos.GetCuentasDepositos() Then Application("GlobalDTProveedoresCuentas") = ObjProveedoresBancos.DtResultados Else Application("GlobalDTProveedoresCuentas") = Nothing
ObjProveedoresBancos.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'C L I E N T E S
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados Else Application("GlobalDTCliente") = Nothing
If ObjClientes.GetClienteClasificacion(-1) Then Application("GlobalDTClienteClasificaciones") = ObjClientes.DtResultados Else Application("GlobalDTClienteClasificaciones") = Nothing
ObjClientes.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'C O N T R A T O S
ObjProveedoresBancos.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'C L I E N T E S
'Dim ObjClientes As New ClsClientes
'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados Else Application("GlobalDTCliente") = Nothing
'If ObjClientes.GetClienteClasificacion(-1) Then Application("GlobalDTClienteClasificaciones") = ObjClientes.DtResultados Else Application("GlobalDTClienteClasificaciones") = Nothing
'ObjClientes.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'C O N T R A T O S
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, -1) Then Application("GlobalDTContratos") = ObjContratos.DtResultados Else Application("GlobalDTContratos") = Nothing
If ObjContratos.GetSecciones() Then Application("GlobalDTContratosSecciones") = ObjContratos.DtResultados Else Application("GlobalDTContratosSecciones") = Nothing
@@ -565,25 +565,25 @@
System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.None
Dim EmpresaNotificaciones As New Empresa With {.SendMail = "signotificaciones@adssistemas.mx", .SendMailPassword = "sig123987", .SendMailServer = "mail.adssistemas.mx", .SendMailPuerto = 587}
ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'I M P U E S T O S L O C A L E S
Dim ObjPSImpuestos As New ClsProductosServicios
If ObjPSImpuestos.GetPSImpuestosLocales(-1, -1) Then
If ObjPSImpuestos.DtResultados.Rows.Count > 0 Then
Application("GlobalDTImpuestosLocales") = ObjPSImpuestos.DtResultados
Else
Application("GlobalDTImpuestosLocales") = Nothing
End If
End If
ObjPSImpuestos.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' R A S T R E O
ClsPaginas.EmpresaNotificaciones = EmpresaNotificaciones
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'I M P U E S T O S L O C A L E S
'Dim ObjPSImpuestos As New ClsProductosServicios
'If ObjPSImpuestos.GetPSImpuestosLocales(-1, -1) Then
' If ObjPSImpuestos.DtResultados.Rows.Count > 0 Then
' Application("GlobalDTImpuestosLocales") = ObjPSImpuestos.DtResultados
' Else
' Application("GlobalDTImpuestosLocales") = Nothing
' End If
'End If
'ObjPSImpuestos.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' R A S T R E O
Dim ObjGPS As New ClsGPS
If ObjGPS.DispositivosGet(-1, -1, -1, -1) Then
If ObjGPS.DtResultados.Rows.Count > 0 Then

View File

@@ -264,7 +264,7 @@ Partial Class Inventarios_Apartados
End If
DdlUnidad.Items.Clear()
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1)
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind()
UpDatos.Update()

View File

@@ -1462,7 +1462,7 @@ Partial Class Inventarios_Consignaciones
'End If
End If
Dim dtpse As DataTable
dtpse = GlobalDTProductosServiciosEquivalencias(DdlProducto.SelectedValue.ToEntero, -1)
dtpse = GlobalDTProductosServiciosEquivalencias(DdlProducto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
'dtpse.Columns("UM").ColumnName = "UnidadMedida"
'dtpse.Columns("CveUM").ColumnName = "CveUnidadMedida"
DdlUnidad.DataSource = dtpse

View File

@@ -2154,7 +2154,7 @@ Partial Class Inventarios_EntradasSalidas
End If
DdlUnidad.Items.Clear()
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1)
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind()
UPDatos.Update()
End Sub

View File

@@ -162,7 +162,7 @@ Partial Class Inventarios_Kardex
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
DdlUnidadMedida.Items.Clear()
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1)
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidadMedida.DataBind()
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -90,7 +90,7 @@ Partial Class Inventarios_KardexAlmacen
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
DdlUnidadMedida.Items.Clear()
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1)
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidadMedida.DataBind()
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -104,7 +104,7 @@ Partial Class Inventarios_KardexAlmacen
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
DdlUnidadMedida.Items.Clear()
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1)
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidadMedida.DataBind()
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -1304,7 +1304,7 @@ Partial Class Inventarios_RecepcionUsados
EscondeColumnasGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
DdlUnidad.Items.Clear()
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1)
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind()
HdnCveTamaño.Value = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTamaño", $"CvePS = { DdlProducto2.SelectedValue.ToEntero }")

View File

@@ -367,7 +367,7 @@ Partial Class Inventarios_ResguardoMaterial
'End If
DdlUnidad.Items.Clear()
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1)
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind()
UPDatos.Update()

View File

@@ -749,6 +749,10 @@ Partial Class Inventarios_TraspasoAlmacen
Dim CveMovimientoEntrada = 0
Dim IDPoliza As Integer = 0
Dim FolioSalida = 0
Dim CveMovimientoVirtualEntrada As Integer = 0
Dim CveMovimientoVirtualSalida As Integer = 0
Dim FolioVirtualEntrada As Integer = 0
Dim FolioVirtualSalida As Integer = 0
Dim FolioEntrada = 0
Dim AlmacenEntrada = -1
Dim Fecha As Date = TxtFecha.Text.ToDate
@@ -790,9 +794,38 @@ Partial Class Inventarios_TraspasoAlmacen
End If
Cont += 1
Next
End If
'AGREGAMOS LA ENTRADA
End If
'VIRTUAL SALIDA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V")
FolioVirtualSalida = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
dtvirtual = ObjInventario.DtResultados
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
Dim PU As Double = RowVirtual("PU").ToString().ToDouble()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
Else
ErrorMovInv = True
End If
End If
'AGREGAMOS LA ENTRADA
If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO
If Not ErrorMovInv Then
Dim TipoMovimientoEntrada = 9
@@ -826,7 +859,35 @@ Partial Class Inventarios_TraspasoAlmacen
Cont += 1
Next
End If
End If
'VIRTUAL ENTRADA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S")
FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
dtvirtual = ObjInventario.DtResultados
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
Dim PU As Double = RowVirtual("PU").ToString().ToDouble()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
Else
ErrorMovInv = True
End If
End If
End If
End If
@@ -847,10 +908,13 @@ Partial Class Inventarios_TraspasoAlmacen
MensajeAlert.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
MensajeAlert.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
If CveMovimientoVirtualSalida > 0 Then MensajeAlert.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a>&nbsp;<a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Salida Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualSalida)), CveMovimientoVirtualSalida, FolioVirtualSalida)
If Not ChkTransitorio.Checked Then
MensajeAlert.AppendFormat("<br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioEntrada, CveMovimientoEntrada)
MensajeAlert.AppendFormat("<br/><br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioEntrada, CveMovimientoEntrada)
MensajeAlert.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
If CveMovimientoVirtualEntrada > 0 Then MensajeAlert.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a>&nbsp;<a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
End If
'DdlClasificacion.SelectedValue = "-1"
@@ -965,10 +1029,8 @@ Partial Class Inventarios_TraspasoAlmacen
Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento)
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
LimpiaMovimiento()
Else
@@ -1068,7 +1130,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
DdlUnidad.Items.Clear()
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1)
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind()
UpDatos.Update()
End Sub
@@ -1544,6 +1606,37 @@ Partial Class Inventarios_TraspasoAlmacen
Cont += 1
Next
End If
'VIRTUAL ENTRADA
Dim CveMovimientoVirtualEntrada As Integer = 0
Dim FolioVirtualEntrada As Integer = 0
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S")
FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
dtvirtual = ObjInventario.DtResultados
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
Dim PU As Double = RowVirtual("PU").ToString().ToDouble()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
Else
ErrorMovInv = True
End If
End If
''AGREGAMOS LA ENTRADA
@@ -1619,6 +1712,8 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida)
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) 'onclick='ImprimirTraslado()'
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)

View File

@@ -7315,11 +7315,12 @@ Partial Class OC
RecargaPSGlobal()
End Sub
Private Sub RecargaPSGlobal()
Dim ObjPS As New ClsProductosServicios
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
'ObjPS.Dispose()
End Sub

View File

@@ -2313,7 +2313,7 @@ Partial Class Ventas_PortalCliente
If drPS IsNot Nothing Then
DdlUM.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPS.SelectedValue.ToEntero, -1)
DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPS.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
Else
DdlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If

View File

@@ -220,9 +220,10 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaProductosServiciosSimplificado()
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
ObjPS.Dispose()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
'ObjPS.Dispose()
End Sub

View File

@@ -1615,6 +1615,8 @@ Partial Class PV
If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then
TrEsDistribuidor.Visible = True
LbVendedor.Text = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Vendedor", $"CveVendedor = {ObjCliente.Vendedor}")
Else
TrEsDistribuidor.Visible = False
End If
ViewState("CliNoExt") = ObjCliente.NoExt
@@ -1643,8 +1645,14 @@ Partial Class PV
End If
If CveVenta <= 0 Then
CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString.ToEntero
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI.ToString)
DdlMetodoPago.SelectedValueExist(ObjCliente.CveMetodoPago.ToString)
DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString)
DdlMetodoPago33_SelectedIndexChanged(DdlMetodoPago33, EventArgs.Empty)
DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
End If
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
@@ -1969,7 +1977,7 @@ Partial Class PV
End If
Catch ex As Exception
Alert("No se pudo verificar la fecha del certificado", TipoMensaje.MsgError)
Alert("No se pudo verificar la fecha del certificado", TipoMensaje.ToastError)
End Try
End Sub
@@ -2800,7 +2808,7 @@ Partial Class PV
DdlUnidadMedida.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(CvePSParametro, -1)
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(CvePSParametro, -1, UsuarioActual.CveEmpresa)
Else
DdlUnidadMedida.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If
@@ -4890,17 +4898,19 @@ Partial Class PV
Hilo.Start()
End Sub
Private Sub GeneraGlobalDT()
Dim ObjPS As New ClsProductosServicios
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
If (ObjPS.GetPSSimplificado(-1)) Then
Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable 'Cargamos el GlobalDTPSSimplificado
End If
'If (ObjPS.GetPSSimplificado(-1)) Then
' Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable 'Cargamos el GlobalDTPSSimplificado
'End If
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
'End If
ObjPS.Dispose()
'ObjPS.Dispose()
End Sub
Private Sub RecargaGlobalCliente()
@@ -5020,8 +5030,6 @@ Partial Class PV
GvRecepcionUsados.DataBind()
GvRecepcionUsadosModal.DataBind()
CargaPSAjuste()
CreaDTmpDTAjustes()
CreaDTmpDTRecepcionUsados()
CargaBCIAjuste()
@@ -5216,10 +5224,11 @@ Partial Class PV
Private Sub CalculaPorcentajeAjuste()
If DdlPS.SelectedValue.ToEntero <= 0 Then
'Alert("No se ha especificado producto a entregar")
Alert("No se ha especificado producto a entregar")
Exit Sub
End If
Try
TxtImporteAjuste.Text = "0.00"
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
Dim CveMarca As Integer = -1
@@ -5267,10 +5276,13 @@ Partial Class PV
TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
Else
Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia)
'cuando no está registrada, no da ajuste
TxtImporteAjuste.ToolTip = "El producto no tiene ajuste en ese periodo"
TxtImporteAjuste.Text = "0.00"
End If
Else
Alert("No se tiene especificado tabla de garantía")
End If
ObjAcum.Dispose()
End If
@@ -5430,8 +5442,8 @@ Partial Class PV
Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFolioGarantia.SelectedIndexChanged
Dim ObjAcumuladores As New ClsAcumuladores
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo")
TxtConsecutivoAjuste.Text = resultado
Dim resultado As Integer = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo").ToEntero
TxtConsecutivoAjuste.Text = resultado.ToString
UpAjuste.Update()
End If
ObjAcumuladores.Dispose()

View File

@@ -1009,7 +1009,7 @@ Partial Class ProductosyServicios
End Sub
Private Sub ElProductoChange()
ddlUnidad.Items.Clear()
ddlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1)
ddlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
ddlUnidad.DataBind()
UpDatos.Update()
End Sub
@@ -1301,7 +1301,7 @@ Partial Class ProductosyServicios
RecargaGlobal()
End Sub
Protected Sub HFProducto_ValueChanged(sender As Object, e As EventArgs) Handles HFProducto.ValueChanged
ddlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(HFProducto.Value.ToEntero, -1)
ddlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(HFProducto.Value.ToEntero, -1, UsuarioActual.CveEmpresa)
ddlUnidad.DataBind()
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
@@ -1330,27 +1330,34 @@ Partial Class ProductosyServicios
Hilo.Start()
End Sub
Private Sub GeneraGlobalDT()
Dim ObjPS As New ClsProductosServicios
GlobalDTPSAdicionales(-1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = Nothing
GlobalDTImpuestosLocales(-1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTPSAdicionales(-1, UsuarioActual.CveEmpresa) = Nothing
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
'Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAlias(-1, -1) Then
GlobalDTProductosServiciosAlias(-1) = ObjPS.DtResultados
End If
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()
If ObjPS.GetPSImpuestosLocales(-1, -1) Then
GlobalDTImpuestosLocales(-1, -1) = ObjPS.DtResultados
End If
'If ObjPS.GetPSAlias(-1, -1) Then
' GlobalDTProductosServiciosAlias(-1) = ObjPS.DtResultados
'End If
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
End If
'If ObjPS.GetPSImpuestosLocales(-1, -1) Then
' GlobalDTImpuestosLocales(-1, -1) = ObjPS.DtResultados
'End If
If ObjPS.GetPSAdicionales(-1, -1) Then
GlobalDTPSAdicionales(-1, -1) = ObjPS.DtResultados
End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
ObjPS.Dispose()
''If ObjPS.GetPSAdicionales(-1, -1) Then
'' GlobalDTPSAdicionales(-1, -1) = ObjPS.DtResultados
''End If
'ObjPS.Dispose()
End Sub
#End Region
@@ -1398,11 +1405,12 @@ Partial Class ProductosyServicios
Hilo.Start()
End Sub
Private Sub GeneraGlobalEquivalencias()
Dim ObjPS = New ClsProductosServicios
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
End If
ObjPS.Dispose()
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS = New ClsProductosServicios
'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
'ObjPS.Dispose()
End Sub
Private Sub CargaGvEquivalencias()
If DtEquivalencias IsNot Nothing Then

View File

@@ -5781,7 +5781,7 @@
<%--APLICAR NC--%>
<div id="ModalAplicarNC" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpAplicarNC" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpAplicarNC" class="modal-dialog rowpadding modal-lg" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">

View File

@@ -5494,7 +5494,7 @@ Partial Class Ventas
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
'MODO EDICION
e.Row.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToEntero, -1)
e.Row.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToEntero, -1, UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlUnidadMedida").DataBind()
e.Row.FCDropDownList("DdlUnidadMedida").SelectedValueExist(e.Row.DBCampo("CveUM"))
@@ -6739,12 +6739,6 @@ Partial Class Ventas
End If
End If
End If
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
GeneraPolizaVentaWS(ObjFactura)
End If
End If
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 Then
@@ -6847,6 +6841,14 @@ Partial Class Ventas
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot", "DPe", "PeC", "PA", "Pd2")) Then
ObjVentas.Commit()
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" Then
GeneraPolizaVentaWS(ObjFactura)
End If
End If
'ContPAQ El movimiento 1 es el de Venta
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
@@ -10693,7 +10695,7 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1)
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
@@ -13008,7 +13010,7 @@ Partial Class Ventas
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString
DdlUnidadMedida.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(CvePSParametro, -1)
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(CvePSParametro, -1, UsuarioActual.CveEmpresa)
Else
DdlUnidadMedida.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If
@@ -15248,7 +15250,7 @@ Partial Class Ventas
Protected Sub DdlPS_SelectedIndexChanged1(sender As Object, e As EventArgs)
Dim Ddl As DropDownList = CType(sender, DropDownList)
Dim gvr As GridViewRow = CType(Ddl.BindingContainer, GridViewRow)
gvr.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTProductosServiciosEquivalencias(Ddl.SelectedValue.ToEntero, -1)
gvr.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTProductosServiciosEquivalencias(Ddl.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
gvr.FCDropDownList("DdlUnidadMedida").DataBind()
End Sub
@@ -19166,17 +19168,19 @@ Partial Class Ventas
Hilo.Start()
End Sub
Private Sub GeneraGlobalDT()
Dim ObjPS As New ClsProductosServicios
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios
If (ObjPS.GetPSSimplificado(-1)) Then
Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable 'Cargamos el GlobalDTPSSimplificado
End If
'If (ObjPS.GetPSSimplificado(-1)) Then
' Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable 'Cargamos el GlobalDTPSSimplificado
'End If
If ObjPS.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados
End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If
ObjPS.Dispose()
'ObjPS.Dispose()
End Sub
#End Region
@@ -19300,7 +19304,7 @@ Partial Class Ventas
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString
DdlUMPyME.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
DdlUMPyME.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPSPyME.SelectedValue.ToEntero, -1)
DdlUMPyME.DataSource = GlobalDTProductosServiciosEquivalencias(DdlPSPyME.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
Else
DdlUMPyME.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If
@@ -20906,16 +20910,16 @@ Partial Class Ventas
InicializaDTVentasNC()
Dim DtImpuestos As New DataTable
DtImpuestos.Columns.Add("ImportePU", GetType(Double))
DtImpuestos.Columns.Add("ImporteTotal", GetType(Double))
DtImpuestos.Columns.Add("PorcentajeIVA", GetType(Double))
DtImpuestos.Columns.Add("ImporteIVA", GetType(Double))
DtImpuestos.Columns.Add("PorcentajeRetIVA", GetType(Double))
DtImpuestos.Columns.Add("ImporteRetIVA", GetType(Double))
DtImpuestos.Columns.Add("PorcentajeRetISR", GetType(Double))
DtImpuestos.Columns.Add("ImporteRetISR", GetType(Double))
DtImpuestos.Columns.Add("PorcentajeIEPS", GetType(Double))
DtImpuestos.Columns.Add("ImporteIEPS", GetType(Double))
DtImpuestos.Columns.Add("ImportePU", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteTotal", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeIVA", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteIVA", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteRetIVA", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeRetISR", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteRetISR", GetType(Decimal))
DtImpuestos.Columns.Add("PorcentajeIEPS", GetType(Decimal))
DtImpuestos.Columns.Add("ImporteIEPS", GetType(Decimal))
DtImpuestos.Columns.Add("CveSubProyecto", GetType(Integer))
DtImpuestos.AcceptChanges()
@@ -20945,14 +20949,15 @@ Partial Class Ventas
Into x = Group
Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal),
ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal),
ImporteIVA = x.Sum(Function(s) s("ImporteIVA").ToString.ToDecimal),
ImporteRetIVA = x.Sum(Function(s) s("ImporteRetIVA").ToString.ToDecimal),
ImporteRetISR = x.Sum(Function(s) s("ImporteRetISR").ToString.ToDecimal),
ImporteIEPS = x.Sum(Function(s) s("ImporteIEPS").ToString.ToDecimal),
ImporteIVA = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA,
ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA,
ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR,
ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS,
PorcentajeIVA = PorcentajeIVA,
PorcentajeRetIVA = PorcentajeRetIVA,
PorcentajeRetISR = PorcentajeRetISR,
PorcentajeIEPS = PorcentajeIEPS
'(1 + DrPS("IEPSPorcentaje").ToString.ToDecimal)
Dim DrSubProyecto = GlobalDTSubProyectos(-1, TmpDT.FiltroPrimeroValor("CveSubProyecto", "", "ImporteTotal DESC").ToEntero, UsuarioActual.CveEmpresa, -1).FiltroPrimero("")
If DrSubProyecto Is Nothing Then
@@ -21058,25 +21063,24 @@ Partial Class Ventas
ObjVentas.Dispose()
Dim DtImpuestosLocal = TmpDT.FiltraParametros("", "", {"PorcentajeIVA", "PorcentajeRetIVA", "PorcentajeRetISR", "PorcentajeIEPS", "CveSubProyecto"}).Copy
DtImpuestosLocal.Columns.Add("ImportePU", GetType(Double))
DtImpuestosLocal.Columns.Add("ImporteTotal", GetType(Double))
DtImpuestosLocal.Columns.Add("ImporteIVA", GetType(Double))
DtImpuestosLocal.Columns.Add("ImporteRetIVA", GetType(Double))
DtImpuestosLocal.Columns.Add("ImporteRetISR", GetType(Double))
DtImpuestosLocal.Columns.Add("ImporteIEPS", GetType(Double))
DtImpuestosLocal.Columns.Add("ImportePU", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteTotal", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteIVA", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteRetIVA", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteRetISR", GetType(Decimal))
DtImpuestosLocal.Columns.Add("ImporteIEPS", GetType(Decimal))
Dim ImporteReferencia As Decimal = If(DdlNCNivelImporte.SelectedValue.ToEntero = 1, Total, SubTotal)
Dim Porcentaje As Decimal = ((Importe * 100) / ImporteReferencia) / 100
Dim FiltroStr As String = ""
For Each Dr As DataRow In DtImpuestosLocal.Rows
Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ") - TmpDT.SUM("Descuento", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ")), 2)
' COMENTANDO POR JESUS MURUA ALIAS EL CHOLO, LO HIZO EL RAUL ARRIBA ALV ! 28/02/2018
'Dr("ImporteTotal") = Porcentaje * TmpDT.SUM("TotalImporte", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' ")
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto"))
Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr)), 2)
Dr("ImporteIVA") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetIVA") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetISR") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = (Porcentaje * Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * (1 + Dr("PorcentajeIEPS").ToString().ToDecimal()) * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetISR") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2)
'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2)
'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2)