This commit is contained in:
HECTOR RODRIGUEZ
2021-03-11 16:57:42 -07:00
25 changed files with 3620 additions and 3179 deletions

View File

@@ -23,11 +23,12 @@ Partial Class AF_CatSubTipos
End Sub
Private Sub CargaGlobal()
Dim ObjSubTipos As New ClsAF
If ObjSubTipos.GetSubTiposActivosFijos(-1) Then
GlobalDTSubTipoActivoFijo(-1) = ObjSubTipos.DtResultados
End If
ObjSubTipos.Dispose()
'Dim ObjSubTipos As New ClsAF
'If ObjSubTipos.GetSubTiposActivosFijos(-1) Then
' GlobalDTSubTipoActivoFijo(-1) = ObjSubTipos.DtResultados
'End If
'ObjSubTipos.Dispose()
GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa, -1) = Nothing
End Sub
Public Sub CargaDatos()

View File

@@ -2048,7 +2048,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer) As Boolean
Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ProductosServiciosInventario")
@@ -2059,6 +2059,7 @@ Public Class ClsInventarios
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@AplicaParaVenta", SqlDbType.Int).Value = AplicaParaVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try

View File

@@ -2184,19 +2184,43 @@ Public Class ClsPaginas
End Set
End Property
Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer) As DataTable
Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer, Optional CveTipoActivoFijo As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTSubTipoActivoFijo = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubTipoActivoFijo-{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjSubTipos As New ClsAF
If ObjSubTipos.GetSubTiposActivosFijos(CveEmpresa) Then Application(AppNombre) = ObjSubTipos.DtResultados
ObjSubTipos.Dispose()
End If
Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveTipoActivoFijo > 0 Then Str.AppendFormat("AND CveTipoActivoFijo = {0}", CveTipoActivoFijo)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTSubTipoActivoFijo = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Application("GlobalDTSubTipoActivoFijo") = value
Dim AppNombre As String = String.Format("GlobalDTSubTipoActivoFijo-{0}", CveEmpresa)
Application(AppNombre) = value
End Set
'Get
' If CveEmpresa <> -1 Then
' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
' GlobalDTSubTipoActivoFijo = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable)
' End If
'End Get
'Set(value As DataTable)
' Application("GlobalDTSubTipoActivoFijo") = value
'End Set
End Property
Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable
Get

View File

@@ -416,7 +416,29 @@ Public Class ClsSisUsuarios
Return Retorno
End Function
Public Function ValidaUsuarioCodigoAcceso(CodigoAcceso As String, CveEmpresa As Integer) As Integer
Dim Retorno As Integer = Nothing
DataAdapter("PA_Sis_UsuariosCodigoAccesoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
If Data.Rows.Count > 0 Then
Retorno = Data.Rows(0)("CveUsuario").ToString.ToEntero
End If
Catch ex As SqlException
OnError("Ocurrió un error al obtener el usuario.", ex)
Retorno = Nothing
End Try
Return Retorno
End Function
Public Function ValidaUsuarioPortalCliente(CveCliente As Integer, Usuario As String, Password As String) As Usuario
Dim Retorno As Usuario = Nothing
@@ -799,7 +821,7 @@ Public Class ClsSisUsuarios
Public Function AddUsuario(Usuario As String, Contraseña As String, Nombre As String, CveRol As Integer, Correo As String,
CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean,
CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0) As Integer
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Integer
Dim Retorno = -1
DataAdapter("PA_Sis_UsuarioAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -819,6 +841,7 @@ Public Class ClsSisUsuarios
.Add("@CveCliente", SqlDbType.Int).Value = CveClientePlataforma
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedorPlataforma
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
.Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -917,7 +940,7 @@ Public Class ClsSisUsuarios
End Function
Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer,
CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
Optional DescuentoAutorizado As Double = 0) As Boolean
Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuarioUpdate")
@@ -938,6 +961,7 @@ Public Class ClsSisUsuarios
.Add("@AsignarSubProyecto", SqlDbType.Bit).Value = AsignarSubProyecto
.Add("@AsignarOC", SqlDbType.Bit).Value = AsignarOC
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
End With
Try

View File

@@ -60,7 +60,9 @@ Public Class Usuario
Public Property UTCOffset As Integer
Public Property isLoginseted As Boolean = False
Public Property isLoginseted As Boolean = False
Public Property SesionBloqueada As Boolean = False
Public ReadOnly Property FechaActualCliente As DateTime
Get

View File

@@ -694,10 +694,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "-1").ToString.ToEntero
Dim CveMarca = IfNull(context.Request("cvemarca"), "-1").ToString.ToEntero
Dim UsaGlobal As Boolean = True
'verifica existencias
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then
UsaGlobal = False
@@ -707,7 +707,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
Dim objInv As New ClsInventarios
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa) Then
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca) Then
' limpio los almacenes donde no tiene ningun producto existencia

View File

@@ -767,12 +767,12 @@ Partial Class Bancos_IE
If TabCancelacion.Visible Then
LnkCancelar.Visible = False
LnkCancelarComplemento.Visible = False
LnkEliminar.Visible = False
LnkCancelarComplementoImporte.Visible = False
End If
'If TabCancelacion.Visible Then
' LnkCancelar.Visible = False
' LnkCancelarComplemento.Visible = False
' 'LnkEliminar.Visible = False
' LnkCancelarComplementoImporte.Visible = False
'End If
UppEliminarIE.Update()
@@ -4490,14 +4490,17 @@ Partial Class Bancos_IE
GeneraCancelacionEnCero = True
End If
Dim TipoMovimiento As Integer = 1
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
GeneraCancelacionEnCero = False
TipoMovimiento = 2
End If
Dim CvePrePolizaCancelacion As Integer = 0
If Not GeneraCancelacionEnCero Then
'CANCELA IE MES ANTERIOR
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
If CvePrePolizaCancelacion <= 0 Then
ErrorCancelar = True
MensajeError = "Error al cancelar IE MES ANTERIOR"

View File

@@ -6711,7 +6711,7 @@ Partial Class Compras_Compras
Dim TCO As Decimal = 1
For Each Dr As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").Rows
If ObjOC.OrdenesCompraDetalleCostoPP(Dr("CveOrdenCompraDetalle").ToString.ToEntero) AndAlso ObjOC.DtResultados.Rows.Count >= 1 Then
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text} OC {ObjOC.DtResultados.FiltroPrimeroValor("Folio").ToString} Inv{ObjOC.DtResultados.FiltroPrimeroValor("FolioAlmacen").ToString}"
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text} OC {ObjOC.DtResultados.FiltroPrimeroValor("Folio").ToString} Inv:{ObjOC.DtResultados.FiltroPrimeroValor("FolioAlmacen").ToString}"
Importe176 = ObjOC.DtResultados.FiltroPrimeroValor("Importe176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN176").ToDecimal * Dr("Cantidad").ToString.ToDecimal
Importe228 = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN228").ToDecimal * Dr("Cantidad").ToString.ToDecimal
Importe229 = ObjOC.DtResultados.FiltroPrimeroValor("Importe229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN229").ToDecimal * Dr("Cantidad").ToString.ToDecimal
@@ -20285,7 +20285,7 @@ Partial Class Compras_Compras
If DiferenciaInvOC.RoundSQL() <> 0 Then
If DiferenciaInvOC.RoundAD() <> 0 Then
@@ -20299,8 +20299,8 @@ Partial Class Compras_Compras
If CvePrePoliza > 0 Then
If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then
ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL()
ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundSQL()
ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD()
ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD()
Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)

View File

@@ -153,7 +153,7 @@
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1">Producto Servicio:</div>
<div class="col-md-1" style="display:none;">Producto Servicio:</div>
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" Width="95%" />
</div>

View File

@@ -214,7 +214,7 @@
<table>
<tr>
<th>Enero</th>
<th>Febero</th>
<th>Febrero</th>
<th>Marzo</th>
<th>Abril</th>
<th>Mayo</th>

View File

@@ -2021,7 +2021,7 @@ Partial Class General_SaldosIniciales
If YaExiste = False Then
If IdCuenta > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 95, Concepto, Now.toDate, -1, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 95, Concepto, Now.toDate, -1, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then
TieneError = True
Exit For
End If
@@ -2035,7 +2035,7 @@ Partial Class General_SaldosIniciales
If Not TieneError Then
ObjConta.Commit()
Alert(String.Format("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, ObjConta.ContaFolio))
Alert(String.Format("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >Prepóliza</a></b>", CvePrePoliza, ObjConta.ContaFolio))
Alert($"Se agregó la póliza {ObjConta.ContaFolio}")

View File

@@ -74,7 +74,7 @@
Using ObjActivosFijos As New ClsAF
If ObjActivosFijos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTAFCaracteristicasClasificaciones") = ObjActivosFijos.DtResultados Else Application("GlobalDTAFCaracteristicasClasificaciones") = Nothing
If ObjActivosFijos.GetCaracteristicas(-1) Then Application("GlobalDTAFCaracteristicas") = ObjActivosFijos.DtResultados Else Application("GlobalDTAFCaracteristicas") = Nothing
If ObjActivosFijos.GetSubTiposActivosFijos(-1) Then Application("GlobalDTSubTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTSubTipoActivoFijo") = Nothing
'If ObjActivosFijos.GetSubTiposActivosFijos(-1) Then Application("GlobalDTSubTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTSubTipoActivoFijo") = Nothing
If ObjActivosFijos.GetTiposActivosFijos(-1) Then Application("GlobalDTTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTTipoActivoFijo") = Nothing
If ObjActivosFijos.GetEstatusActivoFijo() Then Application("GlobalDTEstadoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTEstadoActivoFijo") = Nothing
If ObjActivosFijos.GetMarcasActivosFijos(-1) Then Application(" GlobalDTMarcaActivoFijo") = ObjActivosFijos.DtResultados Else Application(" GlobalDTMarcaActivoFijo") = Nothing

View File

@@ -263,6 +263,15 @@ Partial Class Inventarios_EntregaAlmacen
End Set
End Property
Private Property ValidaLoteCaducidad As Boolean
Get
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
End Get
Set(value As Boolean)
ViewState("ValidaLoteCaducidad") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -270,7 +279,7 @@ Partial Class Inventarios_EntregaAlmacen
InicializaValores()
CargaParametrosAD()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then DdlAlmacen.AutoPostBack = True
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146, 119) Then DdlAlmacen.AutoPostBack = True
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero() = 1 Then
@@ -527,7 +536,7 @@ Partial Class Inventarios_EntregaAlmacen
CveVentaAD = -2
CargaVentaPorSurtir(DdlFolio.SelectedValue.ToEntero())
End Sub
Private Sub CargaVentaPorSurtir(CveVenta As Integer)
Private Sub CargaVentaPorSurtir(CveVenta As Integer, Optional CveAlmacen As Integer = -1)
LbSurtida.Visible = False
CveContrato = -1
CveSubProyecto = -1
@@ -544,14 +553,14 @@ Partial Class Inventarios_EntregaAlmacen
Dim ObjInventario As New ClsInventarios
If ObjInventario.EntregaAlmacenGet(CveVenta) Then
If ObjInventario.EntregaAlmacenGet(CveVenta, CveAlmacen) Then
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
DtDatos = ObjInventario.DtResultados
DtDatos.Columns.Add("Consec", GetType(Integer))
DtDatos.Columns.Add("CantidadGV", GetType(Double))
DtDatos.Columns.Add("CantidadTraspaso", GetType(Double))
DtDatos = ObjInventario.DtResultados
If Not DtDatos.Columns.Contains("Consec") Then DtDatos.Columns.Add("Consec", GetType(Integer))
If Not DtDatos.Columns.Contains("CantidadGV") Then DtDatos.Columns.Add("CantidadGV", GetType(Double))
If Not DtDatos.Columns.Contains("CantidadTraspaso") Then DtDatos.Columns.Add("CantidadTraspaso", GetType(Double))
Dim Index = 1
For Each Dr As DataRow In DtDatos.Rows
Dr("Consec") = Index
@@ -605,43 +614,45 @@ Partial Class Inventarios_EntregaAlmacen
If TipoMovimiento = 2 And TipoDocto = "Rem" And Not CveAlmacenTraspasoDestino > 0 Then
Alert("La remisión que se intenta devolver presenta inconsistencias. Comuniquese con servicio tecnico SIG.", TipoMensaje.MsgError)
BtnGuardar.Visible = False
End If
DdlAlmacen.Items.Clear()
If CveAlmacenTraspasoOrigen > 0 Then 'Not (EsDevolucionVenta = 1 And DtDatos.Rows(0)("TipoDocto").ToString() = "Rem" And UsuarioActual.Empresa.Funcionalidad(145) = "1") - ESTO ES PARA CUANDO SEA REMISION DE ENTREGA POR ADELANTADO FUNCIONA LA DEVOLUCION
DdlAlmacen.Items.Insert(0, New ListItem(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoOrigen}"), CveAlmacenTraspasoOrigen.ToString()))
Else
'[IPP] PARCHE - Debe hacerse permiso proceso - 17Enero2018
Dim RestriccionAlmacenSubProyecto = If(UsuarioActual.CveEmpresa.Contiene(72, 80), $" AND CveSubProyecto = {CveSubProyecto}", "")
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"{StrAlmacenes} {RestriccionAlmacenSubProyecto}")
End If
DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacen.SelectedValue = "-1"
DdlAlmacen.DataBind()
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
If CveAlmacenTraspasoOrigen > 0 Then
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
End If
If Not DtDatos.Columns.Contains("Serie") Then
DtDatos.Columns.Add("Serie", GetType(String))
End If
If Not DtDatos.Columns.Contains("Lote") Then
DtDatos.Columns.Add("Lote", GetType(String))
End If
If Not DtDatos.Columns.Contains("CveSeccion") Then
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
End If
If Not DtDatos.Columns.Contains("FechaCaducidad") Then
DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
End If
If Not DtDatos.Columns.Contains("Seleccionado") Then
DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
End If
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
End If
End If
If CveAlmacen <= 0 Then
DdlAlmacen.Items.Clear()
If CveAlmacenTraspasoOrigen > 0 Then 'Not (EsDevolucionVenta = 1 And DtDatos.Rows(0)("TipoDocto").ToString() = "Rem" And UsuarioActual.Empresa.Funcionalidad(145) = "1") - ESTO ES PARA CUANDO SEA REMISION DE ENTREGA POR ADELANTADO FUNCIONA LA DEVOLUCION
DdlAlmacen.Items.Clear()
DdlAlmacen.Items.Insert(0, New ListItem(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoOrigen}"), CveAlmacenTraspasoOrigen.ToString()))
Else
'[IPP] PARCHE - Debe hacerse permiso proceso - 17Enero2018
Dim RestriccionAlmacenSubProyecto = If(UsuarioActual.CveEmpresa.Contiene(72, 80), $" AND CveSubProyecto = {CveSubProyecto}", "")
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"{StrAlmacenes} {RestriccionAlmacenSubProyecto}")
End If
DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacen.SelectedValue = "-1"
DdlAlmacen.DataBind()
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
If CveAlmacenTraspasoOrigen > 0 Then
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
End If
End If
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then
ValidaLoteCaducidad = True
End If
If Not DtDatos.Columns.Contains("Serie") Then DtDatos.Columns.Add("Serie", GetType(String))
If Not DtDatos.Columns.Contains("Lote") Then DtDatos.Columns.Add("Lote", GetType(String))
If Not DtDatos.Columns.Contains("CveSeccion") Then DtDatos.Columns.Add("CveSeccion", GetType(Integer))
If Not DtDatos.Columns.Contains("FechaCaducidad") Then DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
If Not DtDatos.Columns.Contains("Seleccionado") Then DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
FormaPaqueteria = DtDatos.Rows(0)("FormaPaqueteria").ToString().ToEntero()
Dim FormaPaq As Integer = FormaPaqueteria
@@ -692,7 +703,7 @@ Partial Class Inventarios_EntregaAlmacen
If TipoDocto.Contiene("Ing") AndAlso TipoMovimiento = 2 Then
Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"})
If DtMov.Rows.Count > 0 Then
If DtMov.Rows.Count > 0 AndAlso CveAlmacen <= 0 Then
Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero()
DdlAlmacen.Items.Clear()
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}")
@@ -719,7 +730,7 @@ Partial Class Inventarios_EntregaAlmacen
ObjInventario.Dispose()
UpGenerales.Update()
CargaGvDatos()
If CveAlmacen <= 0 Then CargaGvDatos()
End Sub
Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer)
@@ -853,8 +864,9 @@ Partial Class Inventarios_EntregaAlmacen
'GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) <> "", UsuarioActual.Empresa.Funcionalidad(147), "")
'SugerirFecha()
If DdlAlmacen.SelectedValue.ToEntero > 0 Then
SugiereLoteCaducidad(DdlAlmacen.SelectedValue.ToEntero)
If DdlAlmacen.SelectedValue.ToEntero > 0 And CveVentaSurtir > 0 Then
CargaVentaPorSurtir(CveVentaSurtir, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero)
' SugiereLoteCaducidad(DdlAlmacen.SelectedValue.ToEntero)
End If
End If
GvDatos.DataSource = DtDatos
@@ -943,21 +955,25 @@ Partial Class Inventarios_EntregaAlmacen
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").readonly = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
e.Row.FCTextBox("TxtLote").readonly = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
End If
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString()
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("CantidadF"), e.Row.FCButton("BtnDividir").ClientID))
@@ -1627,7 +1643,13 @@ Partial Class Inventarios_EntregaAlmacen
Exit For
End If
Next
Next
If (Not ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
ValidaSeccion = False
ValidaCaducidad = False
ValidaLote = False
End If
If ValidaSeccion Then
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
@@ -1769,6 +1791,11 @@ Partial Class Inventarios_EntregaAlmacen
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1")
If Not ValidaLoteCaducidad Then
FechaCaducidad = MinFecha
Lote = "-1"
End If
If Dr("CantidadGV").ToString().ToDecimal > 0 Then
If CBool(Dr("AplicaSerie")) Then
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
@@ -2428,18 +2455,17 @@ Partial Class Inventarios_EntregaAlmacen
CantidadPendiente = Dr("CantidadGV").ToString().ToDecimal - Dr("CantidadTraspaso").ToString().ToDecimal - CantidadEntradaSinCosto
If CantidadPendiente > 0 Then
Dim PU As Decimal = 0
Dim CveSeccionAlmacen As Integer = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
'SI FUE POR SERIE
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalle.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
PU = DtExistencias.FiltroPrimeroValor("PU", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For
@@ -2448,11 +2474,10 @@ Partial Class Inventarios_EntregaAlmacen
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalleLote.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For
@@ -2463,7 +2488,7 @@ Partial Class Inventarios_EntregaAlmacen
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
Exit For

View File

@@ -90,7 +90,7 @@
<div class="col-md-1">
<asp:DropDownList runat="server" ID="DdlClasificacion" CssClass="select2me" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" CssStyle="width: 100%;"/>
</div>
<label class="col-md-1 truncate">Productos:</label>
<label class="col-md-1 truncate">Producto:</label>
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:55%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
@@ -102,13 +102,13 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="Cantidad,PS,Lote,FechaCaducidad" EmptyDataText="No se encontraron Registros" ToolTip="Reporte de productos caducidad " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros" ToolTip="Reporte de productos caducidad " CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Almacén" DataField="Almacen" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Producto" DataField="PS" />
<asp:BoundField HeaderText="Lote" DataField="Lote" />
<asp:BoundField HeaderText="Fecha de Caducidad" DataField="FechaCaducidad" DataFormatString = "{0:dd/MM/yyyy}" />
<asp:BoundField HeaderText="Almacén" DataField="Almacen" ItemStyle-Width="150px" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="150px" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" DataFormatString = "{0:dd/MM/yyyy}" ItemStyle-Width="100px" />
</Columns>
</asp:GridView>
</ContentTemplate>

View File

@@ -35,11 +35,16 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
private void CargarDatos()
{
DateTime FI = ModExtensiones.MinFecha;
if (TxtFechaInicio.Text != "") FI = TxtFechaInicio.Text.ToDate();
int CvePS = -1;
if (DdlPS.SelectedValue.ToEntero() > 0) CvePS = DdlPS.SelectedValue.ToEntero();
// aqui siempre se visualiza la caducidad, sin importar la condición, porque siempre se valida la caducidad
//if (!String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147))) { GvDatos.Columns[4].HeaderText = UsuarioActual.Empresa.Funcionalidad(147); }
ClsInventarios ObjInventarios = new ClsInventarios();
if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(),TxtFechaInicio.Text.ToDate(),TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(),
DdlClasificacion.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa))
ClsInventarios ObjInventarios = new ClsInventarios();
if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(), FI, TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(),
DdlClasificacion.SelectedValue.ToEntero(), CvePS, UsuarioActual.CveEmpresa))
{
GvDatos.DataSource = ObjInventarios.DtResultados;
DTDatos = ObjInventarios.DtResultados;
@@ -60,8 +65,8 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
private void CargarFechaText()
{
DateTime date = new DateTime(DateTime.Today.Year, DateTime.Today.Month,1);
TxtFechaInicio.Text = date.ToString("dd/MM/yyyy");
TxtFechaFin.Text = date.AddMonths(3).AddDays(-1).ToString("dd/MM/yyyy");
//TxtFechaInicio.Text = date.AddYears(-5).ToString("dd/MM/yyyy");
TxtFechaFin.Text = date.AddMonths(6).AddDays(-1).ToString("dd/MM/yyyy");
DdlPS.setEsWebService(true);
}

View File

@@ -443,6 +443,7 @@
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td runat="server" id="TdFechaCaducidad" visible="false">
<asp:CheckBox ID="ChkSugiereFechaCaducidad" runat="server" Text="Auto Sugiere" ToolTip="Auto Sugiere Fecha de caducidad" AutoPostBack="true" OnCheckedChanged="ChkSugiereFechaCaducidad_CheckedChanged" />
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td align="center">
@@ -456,7 +457,7 @@
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
<asp:TemplateField ItemStyle-Width="93px">
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Cantidad") %>' ID="ltlCantidad"></asp:Literal>
<asp:TextBox runat="server" ID="TxtCantidad2" Text='<%# Eval("Cantidad", "{0:###,###,###,##0.##}") %>' Width="50px" Visible="false"></asp:TextBox>

View File

@@ -526,19 +526,73 @@ Partial Class Inventarios_TraspasoAlmacen
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("") ' Estado = -1
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
Alert(String.Format("El producto se vende solo en cantidades de {0:#,###.####}", DrPS("VentaMinima")))
Exit Sub
If DrPS IsNot Nothing Then
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
Alert(String.Format("El producto se vende solo en cantidades de {0:#,###.####}", DrPS("VentaMinima")))
Exit Sub
End If
End If
End If
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha))
'codigo provisional.
Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.checked And CveSubP.Contiene(10276) Then
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasCaducidad(CveProducto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.selectedvalue) Then
Dim dtt As DataTable = ObjInventarios.DtResultados
If Cantidad > dtt.SUMD("Cantidad") Then
Alert("No se cuenta con la cantidad requerida")
Else
'recorro las existencias para tomar la cantidad
Dim i As Decimal = 0
Dim CantidadRestante As Decimal = Cantidad
For Each drr As DataRow In dtt.Rows
If drr("Cantidad").ToString.ToDecimal < CantidadRestante Then
i = drr("Cantidad").ToString.ToDecimal
Else
i = CantidadRestante
End If
AgregarPS(i, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Lote:=drr("Lote").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
CantidadRestante -= i
If CantidadRestante <= 0 Then Exit For
Next
End If
End If
ObjInventarios.Dispose()
Else
'codigo temporal
Dim tLote As String
Dim tCaducidad As Date
tLote = If(TxtnLote.Visible, TxtnLote.Text, "-1")
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
If CveSubP <> 10276 Then
tLote = "-1"
tCaducidad = MinFecha
End If
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), tLote, tCaducidad)
If Valido Then
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(tLote = "-1", "", tLote), FechaCaducidad:=tCaducidad, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
End If
End If
End If
If Valido Then
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(TxtnLote.Visible, TxtnLote.Text, ""), FechaCaducidad:=If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha), CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
End If
End If
End Sub
@@ -550,26 +604,39 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Inv As New ClsInventarios
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
'las segunda consulta, que tenga existencia, ya con los parametros especificos
If FechaCaducidad > MinFecha OrElse Serie <> "" OrElse Lote <> "" Then
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
Else
ExistenciaEspecificada = Existencia
End If
Inv.Dispose()
If Existencia - Cantidad - CantidadEnGrid < 0 OrElse ExistenciaEspecificada - Cantidad - CantidadEnGrid < 0 Then
If Existencia < 0 OrElse ExistenciaEspecificada < 0 Then
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
If Existencia > 0 Then
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
'las segunda consulta, que tenga existencia, ya con los parametros especificos
If (FechaCaducidad > MinFecha OrElse Serie <> "" OrElse Lote <> "") Then
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
Dim StrB As New stringbuilder
StrB.appendformat("CvePS = {0} AND CveUM = {1} ", CvePS, CveUnidadMedida)
If Serie <> "" Then StrB.appendformat(" AND Serie = '{0}' ", Serie)
If Lote <> "" Then StrB.appendformat(" AND Lote = '{0}' ", Lote)
If FechaCaducidad.ToDate > MinFecha Then StrB.appendformat(" AND FechaCaducidad = '{0}' ", FechaCaducidad.ToShortDateString)
Dim CantidadEspecificaEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", StrB.tostring)
If ExistenciaEspecificada - Cantidad - CantidadEspecificaEnGrid < 0 Then
Alert(String.Format("Solo hay en existencia: {0:#,###.##}", ExistenciaEspecificada), TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
Retorno = False
End If
Else
Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
ExistenciaEspecificada = Existencia
If Existencia - Cantidad - CantidadEnGrid < 0 Then
Alert(String.Format("Solo hay en existencia: {0:#,###.##}", ExistenciaEspecificada), TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
Retorno = False
End If
End If
Retorno = False
Else
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
End If
Inv.Dispose()
Return Retorno
End Function
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1)
@@ -1482,6 +1549,13 @@ Partial Class Inventarios_TraspasoAlmacen
' CargaGvDatos()
'End Sub
Protected Sub ChkSugiereFechaCaducidad_CheckedChanged(sender As Object, e As EventArgs)
TxtnFechaCaducidad.visible = Not ChkSugiereFechaCaducidad.checked
TxtnLote.visible = Not ChkSugiereFechaCaducidad.checked
End Sub
#End Region

View File

@@ -88,6 +88,7 @@ Partial Class CatSubProyectos
Private Sub RecargaGlobal()
GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
End Sub
#Region "O R D E N A M I E N T O"

View File

@@ -1200,7 +1200,8 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) {
metodo: (!(DdlWS.data('metodo')) || DdlWS.data('metodo') == 'getps') ? ((!(DdlWS.parent().data('metodo')) || DdlWS.parent().data('metodo') == 'getps') ? 'getps' : DdlWS.parent().data('metodo')) : DdlWS.data('metodo'),
Pagina: (!(DdlWS.data('pagina')) || DdlWS.data('pagina') == '') ? '-2' : DdlWS.data('pagina'),
ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto'),
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa')
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa'),
cvemarca: (!(DdlWS.data('cvemarca')) || DdlWS.data('cvemarca') == '') ? -1 : DdlWS.data('cvemarca')
//Metodo: metodo
};

File diff suppressed because it is too large Load Diff

View File

@@ -6,8 +6,8 @@ Imports System.Data
Imports System.Threading
Partial Class Sistemas_UsuarioDetalle
Inherits ClsPaginas
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property DTEstatusSubProyectos As DataTable
Get
@@ -84,6 +84,11 @@ Partial Class Sistemas_UsuarioDetalle
Get
Return ViewState("Password").ToString
End Get
End Property
Private ReadOnly Property CodigoAcceso As String
Get
Return ViewState("CodigoAcceso").ToString
End Get
End Property
Private Property DtClasificaciones As DataTable
Get
@@ -390,10 +395,10 @@ Partial Class Sistemas_UsuarioDetalle
Set(value As Integer)
ViewState("CveEmpresaAnterior") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -444,27 +449,30 @@ Partial Class Sistemas_UsuarioDetalle
TrDescuentoAutorizado.Visible = True
End If
CargaDatos()
InicializaClonarUsuario()
InicializaRestricciones()
CargaGvBitacora()
CargaEmpresasAsignaciones()
CreaDtAsignacionesMultiEmpresa()
CveEmpresaAnterior = DdlEmpresaAsignaciones.SelectedValue.ToEntero
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
TrCodigoAcceso.Visible = True
End If
End Sub
'DOCUMENTACION
'LOS CAMPOS DE DATATABLE "ACCION" SE REFIERE AL ESTATUS DE LOS CAMBIOS QUE OCURRIERON ANTES DE DARLE GUARDAR
' 0/NULL/VACIO = ORIGINAL (SIN CAMBIO)
' 1 = AGREGADO
' 2 = ELIMINADO
' 3 = NADA (AGREGADO Y ELIMINADO): CUANDO AGREGA UN REGISTRO Y LO ELIMINA, ES DECIR, NO SE GUARDA NADA
' 4 = UPDATE
CargaDatos()
InicializaClonarUsuario()
InicializaRestricciones()
CargaGvBitacora()
CargaEmpresasAsignaciones()
CreaDtAsignacionesMultiEmpresa()
CveEmpresaAnterior = DdlEmpresaAsignaciones.SelectedValue.ToEntero
End If
End Sub
'DOCUMENTACION
'LOS CAMPOS DE DATATABLE "ACCION" SE REFIERE AL ESTATUS DE LOS CAMBIOS QUE OCURRIERON ANTES DE DARLE GUARDAR
' 0/NULL/VACIO = ORIGINAL (SIN CAMBIO)
' 1 = AGREGADO
' 2 = ELIMINADO
' 3 = NADA (AGREGADO Y ELIMINADO): CUANDO AGREGA UN REGISTRO Y LO ELIMINA, ES DECIR, NO SE GUARDA NADA
' 4 = UPDATE
#Region " C A R G A R - D A T O S "
Private Sub CargaDatos()
@@ -518,10 +526,10 @@ Partial Class Sistemas_UsuarioDetalle
CargarRol()
CargaAsignaciones()
CargaUsuarioResponsable
' ValidaAccesoEstatusOC()
CargaUsuarioResponsable()
' ValidaAccesoEstatusOC()
End Sub
Public Sub CargaUsuarioResponsable()
@@ -545,7 +553,7 @@ Partial Class Sistemas_UsuarioDetalle
ViewState("CveRol") = ObjUsuario.CveRol.ToString
DdlRol.SelectedValue = ObjUsuario.CveRol.ToString
TxtCorreo.Text = ObjUsuario.Correo
TxtCodigoAcceso.Text = ObjUsuario.DtResultados.Rows(0)("CodigoAcceso").ToString()
Dim autoip As String = ObjUsuario.DtResultados.Rows(0)("AutorizadoxIP").ToString().ToUpper()
'chkSessionxEquipo.Checked = (autoip = "1" OrElse autoip = "TRUE")
@@ -553,6 +561,7 @@ Partial Class Sistemas_UsuarioDetalle
'DdlAutoriza.SelectedValue = ObjUsuario.CveAutoriza.ToString
ViewState("Password") = ObjUsuario.Contraseña
ViewState("CodigoAcceso") = ObjUsuario.DtResultados.Rows(0)("CodigoAcceso").ToString()
ViewState("CveEmpresa") = ObjUsuario.CveEmpresaPredeterminada
DdlEmpresa.SelectedValue = CveEmpresa.ToString
@@ -749,23 +758,23 @@ Partial Class Sistemas_UsuarioDetalle
If CveTipoDocumentoAsignado <> "-1" Then DdlTipoDocumento.SelectedValueExist(CveTipoDocumentoAsignado)
UpFiltrosAsignarPermiso.Update()
End Sub
End Sub
#End Region
'Private Sub CargaSucursal()
' DtSubProyectos2 = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto =" & DdlSubProyectos.SelectedValue.ToEntero)
' If DtSubProyectos2.Rows.Count > 0 Then
' Dim dr As DataRow
' dr = DtSubProyectos2(0)
' CveSucursal = dr("CveSucursal").ToString.ToEntero
' Else
' CveSucursal = -1
' End If
'End Sub
'Private Sub CargaSucursal()
' DtSubProyectos2 = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveSubProyecto =" & DdlSubProyectos.SelectedValue.ToEntero)
' If DtSubProyectos2.Rows.Count > 0 Then
' Dim dr As DataRow
' dr = DtSubProyectos2(0)
' CveSucursal = dr("CveSucursal").ToString.ToEntero
' Else
' CveSucursal = -1
' End If
'End Sub
#Region " G U A R D A R - U P D A T E "
Private Function ValidaUsername(Username As String, Correo As String) As Boolean
Dim Retorno As Boolean = True
'If CveUsuario = -1 Then
@@ -818,10 +827,11 @@ Partial Class Sistemas_UsuarioDetalle
DtAsignacionesMultiEmpresa.Rows.Add(Row)
End If
Dim CodigoAcceso As String = If(String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim), "-1", TxtCodigoAcceso.Text.Trim)
'REGISTRA O ACTUALIZA LOS DATOS GENERALES DEL USUARIO
If CveUsuario = -1 Then
CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble)
CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso)
EsNuevoUsuario = True
If CveUsuario = -1 Then
TieneError = True
@@ -833,7 +843,7 @@ Partial Class Sistemas_UsuarioDetalle
End If
Next
Else
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble) Then
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso) Then
TieneError = True
End If
@@ -1398,10 +1408,10 @@ Partial Class Sistemas_UsuarioDetalle
Catch ex As Exception
OnError("Ocurrió error al mandar MAIL", ex)
End Try
End Sub
End Sub
#End Region
#Region " E L I M I N A R - U S U A R I O "
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
''DENTRO DEL PROCEDIMIENTO ELIMINA TODO LO RELACIONADO CON EL USUARIO (ALMACENES, SUBPROYECTOS, ACCESO A EMPRESAS...)
@@ -1413,10 +1423,10 @@ Partial Class Sistemas_UsuarioDetalle
Alert("Ocurrió un error al eliminar el usuario. Por favor vuelva a intentar", TipoMensaje.MsgError)
End If
ObjUsuario.Dispose()
End Sub
End Sub
#End Region
#Region " CONTRASEÑA "
Protected Sub LnkRestablecer_Click(sender As Object, e As EventArgs) Handles LnkRestablecer.Click
Dim Usuario As New ClsSisUsuarios
@@ -1430,11 +1440,15 @@ Partial Class Sistemas_UsuarioDetalle
Protected Sub LnkVerPass_Click(sender As Object, e As EventArgs) Handles LnkVerPass.Click
Alert(Extensiones.Decripta(Password))
End Sub
End Sub
Protected Sub LnkVerCodigoAcceso_Click(sender As Object, e As EventArgs) Handles LnkVerCodigoAcceso.Click
Alert(CodigoAcceso)
End Sub
#End Region
#Region "TAB - ASIGNACIONES"
Protected Sub DdlEmpresaAsignaciones_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaAsignaciones.SelectedIndexChanged
@@ -1496,8 +1510,8 @@ Partial Class Sistemas_UsuarioDetalle
DtAsignacionesMultiEmpresa.Columns.Add("CveSucursal", GetType(Integer))
DtAsignacionesMultiEmpresa.Columns.Add("CveAlmacen", GetType(Integer))
DtAsignacionesMultiEmpresa.Columns.Add("CveTipoDocumento", GetType(String))
End Sub
End Sub
#Region " PROYECTOS-SUBPROYECTOS "
Private Sub CargaProyectos()
DdlProyecto.Items.Clear()
@@ -1879,8 +1893,8 @@ Partial Class Sistemas_UsuarioDetalle
End If
End If
ChkAsignarAllProyectos.Checked = False
End Sub
End Sub
#Region "GV SUBPROYECTOS"
Protected Sub GvSubProyectos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvSubProyectos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -1982,14 +1996,14 @@ Partial Class Sistemas_UsuarioDetalle
GvSubProyectos.EditIndex = -1
CargaGvSubProyectos()
End Sub
End Sub
#End Region
#End Region
#Region " ALMACENES "
Private Function GetAlmacenesSinGV() As String
Dim SB As New StringBuilder
Dim prefix As String = ""
@@ -2098,8 +2112,8 @@ Partial Class Sistemas_UsuarioDetalle
Private Sub CargaGVAlmacen()
GvAlmacenes.DataSource = DtAlmacenes.FiltraParametros(String.Format("CveEmpresa = {0} And (isnull(Accion,0) < 2 Or Accion = 4)", DdlEmpresaAsignaciones.SelectedValue.ToEntero))
GvAlmacenes.DataBind()
End Sub
End Sub
#Region "GV ALMACENES"
Protected Sub GvAlmacenes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAlmacenes.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2186,11 +2200,11 @@ Partial Class Sistemas_UsuarioDetalle
GvAlmacenes.EditIndex = -1
CargaGVAlmacen()
End Sub
End Sub
#End Region
#End Region
#Region " CUENTAS BANCARIAS "
Private Sub CargaCuentasBancarias()
DdlCuentasBancarias.Items.Clear()
@@ -2253,9 +2267,9 @@ Partial Class Sistemas_UsuarioDetalle
DtCuentasBancarias.AcceptChanges()
CargaGvCuentasBancarias()
End Sub
End Sub
#End Region
#Region " ESTATUS DE ÓRDENES DE COMPRA"
Private Sub CargaEstatusOrdenesCompra()
' Exit Sub
@@ -2449,9 +2463,9 @@ Partial Class Sistemas_UsuarioDetalle
Else
CargaGridEstatusUsuarioOC("OC")
End If
End Sub
End Sub
#Region "GRIDVIEW"
Protected Sub GvEstatusUsuariosREQ_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosREQ.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim tmpT As DataTable = DTEstatusSubProyectos.FiltraParametros(String.Format("CveSubProyecto = {0}", e.Row.DBCampo("CveSubProyecto").ToString))
@@ -2706,13 +2720,13 @@ Partial Class Sistemas_UsuarioDetalle
End If
Next
End If
End Sub
End Sub
#End Region
#End Region
#Region "ESTATUS DE ORDENES DE SERVICIO"
Private Sub CargaEstatusOS()
CreaGridEstatusOS()
@@ -2865,9 +2879,9 @@ Partial Class Sistemas_UsuarioDetalle
End If
Next
Next
End Sub
End Sub
#End Region
#Region " ESTATUS ORDENES DE COMPRA - CLASIFICACIONES USUARIO OC "
Private Sub InicializaEstasClasificacionesOC()
@@ -2929,15 +2943,15 @@ Partial Class Sistemas_UsuarioDetalle
ObjOC.Dispose()
CargaGVOCClasificaciones()
End Sub
End Sub
#End Region
#End Region
#Region "TAB - ACCESO MODULOS"
Public Sub CargaModulosAcceso()
Dim ObjPermisos As New ClsSisUsuarios
@@ -3023,10 +3037,10 @@ Partial Class Sistemas_UsuarioDetalle
Alert("Los Permisos se eliminaron correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/Sistemas/Usuarios.aspx""")
End If
ObjUsuario.Dispose()
End Sub
End Sub
#End Region
#Region "TAB - PERMISO MODULOS"
Public Sub CargaModulosPermisos()
Dim ObjProcesos As New ClsSisUsuarios
@@ -3126,10 +3140,10 @@ Partial Class Sistemas_UsuarioDetalle
Alert("Los Procesos se eliminaron correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/Sistemas/Usuarios.aspx""")
End If
ObjUsuario.Dispose()
End Sub
End Sub
#End Region
#Region "TAB - ACCESO EMPRESAS"
Private Sub CargaEmpresas()
Dim ClsUsuarios As New ClsSisUsuarios
@@ -3319,10 +3333,10 @@ Partial Class Sistemas_UsuarioDetalle
Private Sub LnkRenviaCorreo_Click(sender As Object, e As EventArgs) Handles LnkRenviaCorreo.Click
EnviaCorreo()
Alert("Correo enviado con exito.", TipoMensaje.MsgInformacion)
End Sub
End Sub
#End Region
#Region "TAB - RESTRICCIONES ACCESO "
Private Sub InicializaRestricciones()
CargaDtRestricciones()
@@ -3535,8 +3549,8 @@ Partial Class Sistemas_UsuarioDetalle
CargaGvRestricciones()
RegistraScript("$('#DivAgregarRestricción').modal('hide')")
End Sub
End Sub
#Region " GV "
Private Sub GvRestricciones_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvRestricciones.RowCommand
@@ -3626,13 +3640,13 @@ Partial Class Sistemas_UsuarioDetalle
End If
CargaGvRestricciones()
End Sub
End Sub
#End Region
#End Region
#Region "TAB - INDICADORES"
Public Sub CargaGridIndicadores()
Dim Objeto As New ClsIndicadores
@@ -3649,11 +3663,11 @@ Partial Class Sistemas_UsuarioDetalle
e.Row.FCCheckBox("chkIndicador").Checked = True
End If
End If
End Sub
End Sub
#End Region
#Region " CLONAR USUARIO "
Private Sub InicializaClonarUsuario()
DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
@@ -3739,12 +3753,12 @@ Partial Class Sistemas_UsuarioDetalle
'CargaDatos()
Return Retorno
End Function
End Function
#End Region
#Region " MANDA CORREO "
Private Sub MandaCorreo(Asunto As String, Para As String, Body As String)
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
@@ -3752,13 +3766,13 @@ Partial Class Sistemas_UsuarioDetalle
Dim Mail As New ClsSisMail()
'Mail.MandaCorreo(ClsPaginas.EmpresaNotificaciones, Para, Asunto, "", "", Nothing, Body)
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
End Sub
End Sub
#End Region
#Region " ASIGNACIONES DE PERMISOS "
Protected Sub DdlEmpresaAsignarPermiso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaAsignarPermiso.SelectedIndexChanged
CargaAsignaciones()
@@ -3782,8 +3796,8 @@ Partial Class Sistemas_UsuarioDetalle
CargaDtEstatusOC()
CargaGvEstatusOC()
End Sub
End Sub
#Region " EMPRESAS "
Public Sub CargaDTEmpresasAsignar()
Dim ObjPermisos As New ClsSisUsuarios
@@ -3842,10 +3856,10 @@ Partial Class Sistemas_UsuarioDetalle
CargaAsignaciones()
End Sub
End Sub
#End Region
#Region " ROLES "
Private Sub CargaDtRolesAsignar()
Dim ClsUsuarios As New ClsSisUsuarios
@@ -3934,9 +3948,9 @@ Partial Class Sistemas_UsuarioDetalle
DTRolesAsignar.AcceptChanges()
CargaGVRolesAsignar()
End Sub
End Sub
#End Region
#Region " ALMACENES "
Private Sub CargaDtAlmacenAsignar()
Dim ClsUsuarios As New ClsSisUsuarios
@@ -4027,11 +4041,11 @@ Partial Class Sistemas_UsuarioDetalle
DtAlmacenesAsignar.AcceptChanges()
CargaGVAlmacenAsignar()
End Sub
End Sub
#End Region
#Region " PROYECTOS-SUBPROYECTOS "
Private Sub CargaDtSubProyectosAsignar()
Dim ClsUsuarios As New ClsSisUsuarios
@@ -4142,10 +4156,10 @@ Partial Class Sistemas_UsuarioDetalle
DtSubProyectosAsignar.AcceptChanges()
CargarGvSubProyectosAsignar()
End Sub
End Sub
#End Region
#Region " CUENTAS BANCARIAS "
Private Sub CargaCuentasBancariasAsignar()
DdlCuentasBancariasAsignar.Items.Clear()
@@ -4230,9 +4244,9 @@ Partial Class Sistemas_UsuarioDetalle
DtCuentasBancariasAsignar.AcceptChanges()
CargaGvCuentasBancariasAsignar()
End Sub
End Sub
#End Region
#Region " MODULOS "
Public Sub CargaDTModulosAsignar()
Dim ObjPermisos As New ClsSisUsuarios
@@ -4267,10 +4281,10 @@ Partial Class Sistemas_UsuarioDetalle
End If
End If
End Sub
End Sub
#End Region
#Region " PERMISOS "
Public Sub CargaDTPermisosAsignar()
Dim ObjPermisos As New ClsSisUsuarios
@@ -4305,9 +4319,9 @@ Partial Class Sistemas_UsuarioDetalle
End If
End If
End Sub
End Sub
#End Region
#Region " INDICADORES "
Public Sub CargaDTIndicadoresAsignar()
Dim ObjIndicadores As New ClsSisUsuarios
@@ -4335,13 +4349,13 @@ Partial Class Sistemas_UsuarioDetalle
End If
End If
End Sub
End Sub
#End Region
#End Region
#Region " USUARIO CONTROLADO "
Private Sub InicializaUsuarioControlado()
Dim ClsUsuarios As New ClsSisUsuarios
@@ -4391,12 +4405,12 @@ Partial Class Sistemas_UsuarioDetalle
End If
ClsUsuarios.Dispose()
End Sub
End Sub
#End Region
#Region "C O N T O L E S DE U S U A R I O S"
#Region "ESTATUS DE ÓRDENES DE COMPRA"
Private Sub CargaDtEstatusOCPermisos()
Dim ClsUsuarios As New ClsSisUsuarios
@@ -4517,10 +4531,10 @@ Partial Class Sistemas_UsuarioDetalle
DTEstatusOC = dt
DTEstatusOCAsignar = dt
End Sub
End Sub
#End Region
#Region "GV ESTATUS DE OC"
Protected Sub GvEstatusOC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusOC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -4631,11 +4645,11 @@ Partial Class Sistemas_UsuarioDetalle
GvEstatusUsuariosOC.Columns(i).Visible = (dtValida IsNot Nothing AndAlso dtValida.Rows.Count = 1)
End If
Next
End Sub
End Sub
#End Region
#End Region
Protected Sub LnkAgregarClasificacion_Click(sender As Object, e As EventArgs)
If DtClasificaciones IsNot Nothing Then
Dim CveClasificacion As Integer = DdlClasificacion.SelectedValue.ToEntero
@@ -4762,10 +4776,10 @@ Partial Class Sistemas_UsuarioDetalle
End Sub
End Sub
#Region "USUARIO RESPONSABLE"
Protected Sub BtnUpdateUsuarioResponsable_Click(sender As Object, e As EventArgs)
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.UpdateUsuarioResponsableMasivo(CveUsuario, DdlUsuarioResponsable.SelectedValue.ToEntero) Then
@@ -4773,10 +4787,10 @@ Partial Class Sistemas_UsuarioDetalle
RegistraScript("$('#DivUpdateUsuarioResponsable').modal('hide')")
End If
ObjUsuarios.Dispose()
End Sub
End Sub
#End Region
Protected Sub LnkAutorizarEquipo_Click(sender As Object, e As EventArgs)
'CveUsuario
Dim AdsCodex As String = Encripta(String.Format("{0}_{1}_{2}", CveUsuario, DateTime.Now.Ticks, UsuarioActual.CveUsuario))

View File

@@ -585,6 +585,14 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
<ContentTemplate>
<div id="DivBloqueo" runat="server" style="width: 100%; text-align: center;" visible="false">
<asp:Button ID="BtnBloquearAcceso" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div>
@@ -833,7 +841,7 @@
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight:bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight: bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
<asp:HiddenField ID="HdnVentaSaldo" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnTotalVenta" runat="server" ClientIDMode="Static" Value="0" />
</ContentTemplate>
@@ -1917,6 +1925,45 @@
</asp:Panel>
<!-- ModalPopupExtender -->
<%-- ******************************************** Bloqueo de Caja *************************************************************************************************************************************** --%>
<asp:Button ID="BtnShowBloqueo" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
<asp:Button ID="BtnCloseBloqueo" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueo" TargetControlID="BtnShowBloqueo"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="PanelBloqueo" runat="server" CssClass="modalPopup" align="center" Style="display: none">
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align:center">
<td colspan="2"><asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i>&nbsp;Acceso Restringido"/></td>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
<tr>
<td colspan="1">
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
</td>
<td colspan="1">
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1">&nbsp;</td>
</tr>
</table>
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
&nbsp;
</asp:Panel>
<!-- ModalPopupExtender -->
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 470px; min-width: 470px;">
<div class="modal-content">
@@ -2656,6 +2703,16 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMarcaPS" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlMarcaPS.ClientID.ToString()%>">Marca:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
@@ -2840,6 +2897,16 @@
<br />
<div class="row">
<div class="col-md-9">
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMarcaPSAjuste" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlMarcaPSAjuste.ClientID.ToString()%>">Marca:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost ID="DdlPSAjuste" CssStyle="width: 100%;" CssClass=" form-control input-sm DdlPS" IncluyeTodos="false" CssClassDdl="select2me form-control" runat="server" CausesValidation="true" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlPSAjuste_selectedindexchange"></ADS:Dropdownlost>
<asp:HiddenField ID="HdnPSAjusteMarca" ClientIDMode="Static" runat="server" Value="-1" />
@@ -2868,7 +2935,7 @@
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
</div>
</div>
</div>
@@ -2945,11 +3012,11 @@
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMesesUso" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesesUso"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEMesesUso" runat="server" TargetControlID="TxtMesesUso" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight:bold">Meses de Uso:</label>
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight: bold">Meses de Uso:</label>
</div>
</div>
</div>
@@ -2974,11 +3041,11 @@
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeAjuste"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEPorcentajeAjuste" runat="server" TargetControlID="TxtPorcentajeAjuste" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight:bold">% Ajuste:</label>
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight: bold">% Ajuste:</label>
</div>
</div>
</div>
@@ -3008,11 +3075,11 @@
<div class="row" style="margin-top: 17px;">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50" ></asp:TextBox>
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste"></ajax:ValidatorCalloutExtender>
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight:bold">Importe:</label>
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight: bold">Importe:</label>
</div>
</div>
<div class="col-md-6">
@@ -3046,6 +3113,20 @@
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
// Get the input field
var txtCodigoAcceso = document.getElementById("C_TxtCodigoAcceso");
// Execute a function when the user releases a key on the keyboard
txtCodigoAcceso.addEventListener("keyup", function (event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
// Cancel the default action, if needed
event.preventDefault();
// Trigger the button element with a click
document.getElementById("C_BtnCambiar").click();
}
});
function ValidarCodigoEnsamble(source, arguments) {
let CveMarca = HdnPSAjusteMarca.value;
let CveClasificacion = HdnPSAjusteClasificacion.value;

View File

@@ -9,6 +9,7 @@ Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization
Imports System.Net.Http
Imports Microsoft.Reporting.WebForms
Imports ADSSession
Partial Class PV
Inherits ClsPaginas
@@ -1007,6 +1008,25 @@ Partial Class PV
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
If DrUsuario("CodigoAcceso").ToString() <> "" Then
If UsuarioActual.SesionBloqueada Then
DivBloqueo.Visible = False
TxtCodigoAcceso.Focus()
RegistraScript("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueo"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); }, 1000); }")
Else
DivBloqueo.Visible = True
End If
Else
DivBloqueo.Visible = False
End If
Else
DivBloqueo.Visible = False
End If
DdlBPPS.setEsWebService(True)
DdlBPPS.ddlWS.Attributes.Add("data-clear", "1")
ViewState("ProcesoCorrecto") = True
@@ -1116,6 +1136,8 @@ Partial Class PV
CargarAlmacenes()
CargaFormaEntrega()
CargaCuentasTerminal()
CargaMarcasFiltro()
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
CargaAjuste()
RVPorDesc.MaximumValue = UsuarioActual.DescuentoAutorizado.ToString
@@ -1231,6 +1253,21 @@ Partial Class PV
End If
End Sub
Private Sub CargaMarcasFiltro()
Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPS.DataSource = ObjMarcas.DtResultados
DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados
End If
End Using
DdlMarcaPS.DataBind()
DdlMarcaPSAjuste.DataBind()
UpModalVenta.Update()
UpAjuste.Update()
End Sub
Private Function CargaVenta() As Boolean
Dim Retorno As Boolean = False
'CARGA PARA FACTURACION
@@ -2722,7 +2759,7 @@ Partial Class PV
End If
DdlClasificacion.DataBind()
End Sub
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True)
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True, Optional CveMarca As Integer = -1)
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
Objeto.ddl.Items.Clear()
@@ -2742,6 +2779,7 @@ Partial Class PV
Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
End If
Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
Objeto.ddlWS.Attributes.Add("data-cvemarca", CveMarca.ToString)
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
End If
End Sub
@@ -3038,6 +3076,18 @@ Partial Class PV
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
If DrUsuario("CodigoAcceso").ToString() <> "" Then
If UsuarioActual.SesionBloqueada Then
Alert("Acceso denegado. La sesión se encuentra bloqueada", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
If Not CveCliente > 0 Then
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -3069,7 +3119,7 @@ Partial Class PV
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -4533,7 +4583,7 @@ Partial Class PV
'VALIDA PROMOCIONES
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -7350,4 +7400,93 @@ Partial Class PV
Public Property Valido As Boolean
End Class
Protected Sub DdlMarcaPS_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPS, CveMarca:=DdlMarcaPS.SelectedValue.ToEntero())
UpModalVenta.Update()
End Sub
Protected Sub DdlMarcaPSAjuste_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPSAjuste, CveMarca:=DdlMarcaPSAjuste.SelectedValue.ToEntero())
UpAjuste.Update()
End Sub
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
Alert("Es necesario un código de acceso", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveUsuarioNuevo As Integer = -1
Using ObjUsuarios As New ClsSisUsuarios
CveUsuarioNuevo = ObjUsuarios.ValidaUsuarioCodigoAcceso(TxtCodigoAcceso.Text.Trim, UsuarioActual.CveEmpresa)
End Using
Dim DrUsuario As DataRow = Nothing
If CveUsuarioNuevo > 0 Then
DrUsuario = GlobalDTUsuarios(CveUsuarioNuevo, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "", {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}).Rows(0)
End If
If DrUsuario IsNot Nothing Then
Dim tUsuario, tContraseña As String
Dim tCveEmpresa As Integer
tUsuario = DrUsuario("Usuario").ToString
tContraseña = DrUsuario("Contraseña").ToString
tCveEmpresa = DrUsuario("CveEmpresa").ToString.ToEntero
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
ADSSessionConfig.sessionUser = Usuario
ADSSessionConfig.sessionUser.CvePlataforma = 1
ADSSessionConfig.sessionDpage = False
ADSSessionConfig.sessionUser.ModoSimulacion = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then ADSSessionConfig.sessionUser.MultipleEmpresa = True
End If
End If
dt.Dispose()
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
End If
ObjEmpresa.Dispose()
End If
Response.Redirect($"~/Ventas/PV.aspx")
Else
Alert("No existe el código de acceso", TipoMensaje.MsgAdvertencia)
End If
End Sub
Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
UsuarioActual.SesionBloqueada = True
Response.Redirect($"~/Ventas/PV.aspx")
End Sub
End Class

View File

@@ -341,11 +341,39 @@ Partial Class Ventas_RepProductosServiciosDetalle
If AnioMes.Trim.Length = 7 Then
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
FechaFtemporal = $"01/{AnioMes.Substring(5, 2).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
If FechaF = "-1" Then
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
Else
Dim FechaFRef As DateTime = FechaF.ToDateTime
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate()
If FechaFRef > FechaFMonth Then
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
Else
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
End If
End If
Else
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
FechaFtemporal = $"01/{AnioMes.Substring(5, 1).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
If FechaF = "-1" Then
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
Else
Dim FechaFRef As DateTime = FechaF.ToDateTime
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate
If FechaFRef > FechaFMonth Then
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
Else
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
End If
End If
End If
End If

View File

@@ -6392,6 +6392,7 @@ Partial Class Ventas
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
End If
End Sub
@@ -11289,8 +11290,7 @@ Partial Class Ventas
CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString().ToEntero()
End If
Dim UsaComplementariaClientes As Boolean = False
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
Dim UsaComplementariaClientes As Boolean = True
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
Dim dtt As DataTable = ObjConta.DtResultados
@@ -13005,8 +13005,8 @@ Partial Class Ventas
'If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
OcurrioError = True
End If
OcurrioError = True
End If
'End If
Else
@@ -13834,8 +13834,8 @@ Partial Class Ventas
Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim ContaIdPoliza As Integer = 0
Dim ConceptoAmortizacion As Integer = 0
Dim UsaComplementariaClientes As Boolean = False
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
Dim UsaComplementariaClientes As Boolean = True
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
'Dim FechaMaxima As Date = MinFecha
@@ -15119,7 +15119,7 @@ Partial Class Ventas
Dim ValorInventario As Decimal = 0
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DTMovimientosDetalles.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString().ToDecimal.RoundSQL()
ValorInventario = DTMovimientosDetalles.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD()
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
@@ -15143,7 +15143,7 @@ Partial Class Ventas
End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero()
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundSQL()
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundAD()
If ValorInventario <> 0 Then
'Entrada
@@ -18449,7 +18449,7 @@ Partial Class Ventas
Return Not OcurrioError
End If
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
If CvePrePoliza <= 0 Then
GenerarPrePolizaNueva = True
@@ -18462,7 +18462,7 @@ Partial Class Ventas
End If
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -18603,10 +18603,10 @@ Partial Class Ventas
Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -18720,10 +18720,10 @@ Partial Class Ventas
Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
For Each RowInv As DataRow In DtCostosDistinct.Rows
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
TotalCostoAcumulado += ValorInventario
@@ -23675,11 +23675,7 @@ Partial Class Ventas
IdCuentaContableNoDeducible = 3114
End If
Dim UsaComplementaria As Boolean = False
If UsuarioActual.CveEmpresa = 119 Then
UsaComplementaria = True
End If
Dim UsaComplementaria As Boolean = True
If MsgError = "" Then
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Saldarr", 47, SaldoVenta, SaldoVenta, tCveMoneda, TxtFechaSaldarVenta.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)