Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -1718,9 +1718,9 @@ Public Class ClsBancos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function CancelarBancos_IE(CveUsuario As Integer, CveIE As Integer, MesAnterior As Boolean, IdPoliza As Integer, FolioPoliza As Integer, Optional FechaCancelacion As Date = MinFecha, Optional TipoMovimiento As Integer = 1) As Boolean
|
||||
Public Function CancelarBancos_IE(CveUsuario As Integer, CveIE As Integer, MesAnterior As Boolean, IdPoliza As Integer, FolioPoliza As Integer, Optional FechaCancelacion As Date = MinFecha, Optional TipoMovimiento As Integer = 1) As Integer
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
Dim Retorno As Integer = 0
|
||||
DataAdapter("PA_Banc_IECancelar")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -1731,11 +1731,12 @@ Public Class ClsBancos
|
||||
.Add("@FolioPoliza", SqlDbType.Int).Value = FolioPoliza
|
||||
.Add("@FechaCancelacion", SqlDbType.Date).Value = FechaCancelacion
|
||||
.Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento
|
||||
.Add("@CvePrePoliza", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePoliza").Value.ToString.ToEntero
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cancelar el movimiento en bancos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
@@ -360,7 +360,7 @@ Public Class ClsInventarios
|
||||
End Function
|
||||
|
||||
|
||||
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean
|
||||
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_AlmacenesAdd")
|
||||
@@ -377,7 +377,7 @@ Public Class ClsInventarios
|
||||
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
|
||||
.Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -396,7 +396,7 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean
|
||||
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_AlmacenesUpdate")
|
||||
@@ -413,6 +413,7 @@ Public Class ClsInventarios
|
||||
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
|
||||
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
|
||||
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
|
||||
.Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual
|
||||
|
||||
End With
|
||||
|
||||
|
||||
@@ -3634,92 +3634,6 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
||||
|
||||
#Region "C H E C A D O R E S T A C I O N E S"
|
||||
|
||||
Public Function ChecadorEstacionesAdd(CveChecadorTipo As Integer, CveZonaHoraria As Integer, CveUsuario As Integer, CveEmpresa As Integer, ChecadorEstacion As String, Ip As String, Puerto As Integer, Estatus As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorEstacionesAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecadorTipo", SqlDbType.Int).Value = CveChecadorTipo
|
||||
.Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@ChecadorEstacion", SqlDbType.VarChar).Value = ChecadorEstacion
|
||||
.Add("@Ip", SqlDbType.VarChar).Value = Ip
|
||||
.Add("@Puerto", SqlDbType.Int).Value = Puerto
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function ChecadorEstacionesUpdate(CveChecadorEstacion As Integer, CveChecadorTipo As Integer, CveZonaHoraria As Integer, CveUsuario As Integer, CveEmpresa As Integer, ChecadorEstacion As String, Ip As String, Puerto As Integer, Estatus As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorEstacionesUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion
|
||||
.Add("@CveChecadorTipo", SqlDbType.Int).Value = CveChecadorTipo
|
||||
.Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@ChecadorEstacion", SqlDbType.VarChar).Value = ChecadorEstacion
|
||||
.Add("@Ip", SqlDbType.VarChar).Value = Ip
|
||||
.Add("@Puerto", SqlDbType.Int).Value = Puerto
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function ChecadorEstacionesRemove(CveChecadorEstacion As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorEstacionesRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion
|
||||
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function ChecadorEstacionesGet(CveChecadorEstacion As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorEstacionesGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function DdlChecadorTipoGet(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_DdlChecadorTipoGet")
|
||||
|
||||
@@ -5105,6 +5105,12 @@ Namespace Modelos
|
||||
Dim ValidaVirtual = True
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
|
||||
Dim tCveAlmacen As Integer = -1
|
||||
|
||||
If ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
tCveAlmacen = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
|
||||
End If
|
||||
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoRelacionado) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
@@ -5113,7 +5119,7 @@ Namespace Modelos
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento
|
||||
|
||||
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
|
||||
|
||||
457
Ashx/E141.ashx
457
Ashx/E141.ashx
@@ -1,14 +1,13 @@
|
||||
<%@ WebHandler Language="VB" Class="E141" %>
|
||||
|
||||
Imports System
|
||||
Imports System.Web
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Net.Http
|
||||
Imports System.Net
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
|
||||
Public Class E141 : Implements IHttpHandler
|
||||
|
||||
@@ -50,7 +49,7 @@ Public Class E141 : Implements IHttpHandler
|
||||
Public ReadOnly Property TokenAutorizacion As String
|
||||
Get
|
||||
If EsProduccion Then
|
||||
Return "$2y$10$AGCCDbEoGEpd0ys89fuBXedtWlunwUeLRlo4MdeLyxDvJF4GwpL7a"
|
||||
Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane"
|
||||
Else
|
||||
Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane"
|
||||
End If
|
||||
@@ -60,7 +59,7 @@ Public Class E141 : Implements IHttpHandler
|
||||
Public ReadOnly Property URLBase As String
|
||||
Get
|
||||
If EsProduccion Then
|
||||
Return "https://services.fidelityapps.mx/"
|
||||
Return "https://econollantas-pruebas.fidelityapps.mx"
|
||||
Else
|
||||
Return "https://econollantas-pruebas.fidelityapps.mx/"
|
||||
End If
|
||||
@@ -68,11 +67,11 @@ Public Class E141 : Implements IHttpHandler
|
||||
End Property
|
||||
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
context.Response.ContentType = "application/json"
|
||||
Dim retorno As String = "no se encontro la variable"
|
||||
Dim retorno As String = ""
|
||||
Try
|
||||
Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString())
|
||||
|
||||
'DESCARGA DEL PDF
|
||||
If Not String.IsNullOrEmpty(Params) Then
|
||||
Dim UrlParametros As Hashtable = Parametros(Decripta(Params))
|
||||
|
||||
@@ -80,41 +79,54 @@ Public Class E141 : Implements IHttpHandler
|
||||
If Not String.IsNullOrEmpty(File) Then
|
||||
ImprimirbytesPDF(context, DescargarFactura(File), File)
|
||||
End If
|
||||
Else
|
||||
|
||||
End If
|
||||
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
|
||||
'OBTENER EXISTENCIAS
|
||||
If Metodo = "GetExistencia" Then
|
||||
context.Response.ContentType = "application/json"
|
||||
|
||||
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
|
||||
Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString())
|
||||
retorno = GetExistencia(context, Codigo)
|
||||
|
||||
Dim FiltrarTodos = If(context.Request("FiltrarTodos") = Nothing, "", context.Request("FiltrarTodos").ToString())
|
||||
Else
|
||||
context.Response.ContentType = "text/html"
|
||||
|
||||
If Metodo = "CrearActualizarProductos" Then
|
||||
retorno = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
|
||||
End If
|
||||
Dim FiltrarTodos = If(context.Request("FiltrarTodos") = Nothing, "", context.Request("FiltrarTodos").ToString())
|
||||
|
||||
If Metodo = "ActualizarPrecios" Then
|
||||
retorno = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
|
||||
End If
|
||||
Dim respuesta As Boolean = False
|
||||
|
||||
If Metodo = "ActualizarExistencias" Then
|
||||
retorno = ActualizarExistencias(If(FiltrarTodos = "1", True, False))
|
||||
End If
|
||||
'TAREAS PROGRAMADAS
|
||||
Select Case Metodo
|
||||
Case "CrearActualizarProductos"
|
||||
respuesta = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
|
||||
Case "ActualizarPrecios"
|
||||
respuesta = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
|
||||
Case "ActualizarExistencias"
|
||||
respuesta = ActualizarExistencias()
|
||||
Case "ActualizarVendedores"
|
||||
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
||||
End Select
|
||||
|
||||
If Metodo = "ActualizarVendedores" Then
|
||||
retorno = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
|
||||
End If
|
||||
If respuesta Then
|
||||
retorno = "True"
|
||||
Else
|
||||
retorno = "False"
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
context.Response.Write(retorno)
|
||||
|
||||
If Metodo = "GetExistencia" Then
|
||||
Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString())
|
||||
retorno = GetExistencia(context, Codigo)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
context.Response.ContentType = "text/html"
|
||||
retorno = ex.ToString()
|
||||
ex.GuardaLog(ex.ToString())
|
||||
|
||||
context.Response.Write(retorno)
|
||||
End Try
|
||||
|
||||
context.Response.Write(retorno)
|
||||
End Sub
|
||||
|
||||
Private Function GetExistencia(ByVal context As HttpContext, Codigo As String) As String
|
||||
@@ -157,17 +169,23 @@ Public Class E141 : Implements IHttpHandler
|
||||
Using ObjPS As New ClsProductosServicios()
|
||||
If ObjPS.GetExistenciasEmpresa(Codigo, CveEmpresa) Then
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In ObjPS.DtResultados.Rows
|
||||
Dim producto As New JObject(
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("stock", RowPS("Existencia"))
|
||||
)
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
If ObjPS.DtResultados.Rows.Count > 0 Then
|
||||
For Each RowPS As DataRow In ObjPS.DtResultados.Rows
|
||||
Dim producto As New JObject(
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("stock", RowPS("Existencia"))
|
||||
)
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
respuesta.isSuccess = True
|
||||
respuesta.message = "La existencia se obtuvo correctamente"
|
||||
Else
|
||||
respuesta.isSuccess = True
|
||||
respuesta.message = "No se encontro ningun producto"
|
||||
End If
|
||||
|
||||
respuesta.products = ArrayPS
|
||||
respuesta.isSuccess = True
|
||||
respuesta.message = "La existencia se obtuvo correctamente"
|
||||
|
||||
Else
|
||||
respuesta.isSuccess = False
|
||||
respuesta.message = "Ocurrió un error al obtener la existencia"
|
||||
@@ -182,6 +200,7 @@ Public Class E141 : Implements IHttpHandler
|
||||
Dim Retorno As String = "{}"
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
httpClient.Timeout = New TimeSpan(0, 5, 0)
|
||||
Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url))
|
||||
request.Headers.Add("token", TokenAutorizacion)
|
||||
|
||||
@@ -233,12 +252,10 @@ Public Class E141 : Implements IHttpHandler
|
||||
' Return Retorno
|
||||
'End Function
|
||||
#Region "C R E A C I Ó N / A C T U A L I Z A C I Ó N - P R O D U C T O S"
|
||||
Private Function CrearActualizarProductos(Todos As Boolean) As String
|
||||
Return EnviarInformacion($"{Me.URLBase}api/services/products/import", GetProductosModificados(Todos))
|
||||
End Function
|
||||
|
||||
Private Function GetProductosModificados(Todos As Boolean) As String
|
||||
Dim Retorno As String = "{}"
|
||||
Private Function CrearActualizarProductos(Todos As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||
|
||||
Dim DtPS As DataTable = Nothing
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
@@ -250,59 +267,124 @@ Public Class E141 : Implements IHttpHandler
|
||||
|
||||
If DtPS IsNot Nothing Then
|
||||
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
If DtPS.Rows.Count > 0 AndAlso DtPS.Rows.Count = 1 Then
|
||||
Dim Dt As DataTable = DtPS.FiltraPorIndices(0, 0)
|
||||
Dim payload = New JObject()
|
||||
|
||||
Dim PSData As String() = RowPS("PS").ToString().Split(" ".ToCharArray())
|
||||
payload.Add(New JProperty("products", GenerarPayloadProductos(Dt)))
|
||||
|
||||
Dim Measurement As String = "", Size As String = "", alt_code As String = ""
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/services/products/import", payload.ToString())
|
||||
|
||||
If PSData.Length > 0 Then
|
||||
Measurement = PSData(0)
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If PSData.Length > 1 Then
|
||||
Size = PSData(1)
|
||||
End If
|
||||
Else
|
||||
Dim TotalIndex As Integer = DtPS.Rows.Count - 1
|
||||
Dim TotaRegistrosPorPeticion As Integer = 500
|
||||
Dim PrevIndex As Integer = 0
|
||||
Dim CurrentIndex As Integer = 0
|
||||
|
||||
alt_code = String.Concat(Measurement, Size)
|
||||
While PrevIndex < TotalIndex
|
||||
CurrentIndex += TotaRegistrosPorPeticion
|
||||
|
||||
Dim producto As New JObject(
|
||||
New JProperty("clasificacion", RowPS("Clasificacion")),
|
||||
New JProperty("category", "Prod"),
|
||||
New JProperty("pza", RowPS("Unidad")),
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("name", RowPS("PS")),
|
||||
New JProperty("measurement", Measurement),
|
||||
New JProperty("size", Size),
|
||||
New JProperty("brand", RowPS("Marca")),
|
||||
New JProperty("price", RowPS("Precio")),
|
||||
New JProperty("active", RowPS("Estado")),
|
||||
New JProperty("user", RowPS("UsuarioModifico")),
|
||||
New JProperty("alt_code", alt_code),
|
||||
New JProperty("short_description", ""),
|
||||
New JProperty("description", ""),
|
||||
New JProperty("currency", 1),
|
||||
New JProperty("promo_price", RowPS("PrecioPromocion"))
|
||||
)
|
||||
If CurrentIndex > TotalIndex Then
|
||||
CurrentIndex = TotalIndex
|
||||
End If
|
||||
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
Retorno = New JObject(New JProperty("products", ArrayPS)).ToString()
|
||||
Dim Dt As DataTable = DtPS.FiltraPorIndices(PrevIndex, CurrentIndex)
|
||||
Dim payload = New JObject()
|
||||
|
||||
'If Not EsProduccion Then
|
||||
' payload.Add(New JProperty("deleteNotIncluded", True))
|
||||
'End If
|
||||
|
||||
payload.Add(New JProperty("products", GenerarPayloadProductos(Dt)))
|
||||
|
||||
PrevIndex = CurrentIndex
|
||||
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/services/products/import", payload.ToString())
|
||||
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Threading.Thread.Sleep(3000)
|
||||
End While
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If CountPeticionesExitosas = CountPeticiones Then
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function GenerarPayloadProductos(DtPS As DataTable) As JArray
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
|
||||
Dim PSData As String() = RowPS("PS").ToString().Split(" ".ToCharArray())
|
||||
|
||||
Dim Measurement As String = "", Size As String = "", alt_code As String = ""
|
||||
|
||||
If PSData.Length > 0 Then
|
||||
Measurement = PSData(0)
|
||||
End If
|
||||
|
||||
If PSData.Length > 1 Then
|
||||
Size = PSData(1)
|
||||
End If
|
||||
|
||||
alt_code = String.Concat(Measurement, Size)
|
||||
|
||||
Dim producto As New JObject(
|
||||
New JProperty("clasificacion", RowPS("Clasificacion")),
|
||||
New JProperty("category", "Prod"),
|
||||
New JProperty("pza", RowPS("Unidad")),
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("name", RowPS("PS")),
|
||||
New JProperty("measurement", Measurement),
|
||||
New JProperty("size", Size),
|
||||
New JProperty("brand", RowPS("Marca")),
|
||||
New JProperty("price", RowPS("Precio")),
|
||||
New JProperty("active", RowPS("Estado")),
|
||||
New JProperty("user", RowPS("UsuarioModifico")),
|
||||
New JProperty("alt_code", alt_code),
|
||||
New JProperty("short_description", ""),
|
||||
New JProperty("description", ""),
|
||||
New JProperty("currency", 1),
|
||||
New JProperty("promo_price", RowPS("PrecioPromocion"))
|
||||
)
|
||||
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
|
||||
Return ArrayPS
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "A C T U A L I Z A R - P R E C I O S"
|
||||
|
||||
Private Function ActualizarPrecios(Todos As Boolean) As String
|
||||
Return EnviarInformacion($"{Me.URLBase}api/services/products/price-import", GetPreciosModificados(Todos))
|
||||
End Function
|
||||
'Private Function ActualizarPrecios(Todos As Boolean) As String
|
||||
' Return EnviarInformacion($"{Me.URLBase}api/services/products/price-import", GetPreciosModificados(Todos))
|
||||
'End Function
|
||||
|
||||
Private Function GetPreciosModificados(Todos As Boolean) As String
|
||||
Dim Retorno As String = "{}"
|
||||
Private Function ActualizarPrecios(Todos As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||
|
||||
Dim DtPS As DataTable = Nothing
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
@@ -314,32 +396,90 @@ Public Class E141 : Implements IHttpHandler
|
||||
|
||||
If DtPS IsNot Nothing Then
|
||||
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
If DtPS.Rows.Count > 0 AndAlso DtPS.Rows.Count = 1 Then
|
||||
Dim Dt As DataTable = DtPS.FiltraPorIndices(0, 0)
|
||||
Dim payload = New JObject()
|
||||
|
||||
Dim producto As New JObject(
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("price", RowPS("Precio")),
|
||||
New JProperty("promo_price", RowPS("PrecioPromocion"))
|
||||
)
|
||||
payload.Add(New JProperty("products", GenerarPayloadPrecios(Dt)))
|
||||
|
||||
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/services/products/price-import", payload.ToString())
|
||||
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
Dim TotalIndex As Integer = DtPS.Rows.Count - 1
|
||||
Dim TotaRegistrosPorPeticion As Integer = 500
|
||||
Dim PrevIndex As Integer = 0
|
||||
Dim CurrentIndex As Integer = 0
|
||||
|
||||
While PrevIndex < TotalIndex
|
||||
CurrentIndex += TotaRegistrosPorPeticion
|
||||
|
||||
If CurrentIndex > TotalIndex Then
|
||||
CurrentIndex = TotalIndex
|
||||
End If
|
||||
|
||||
Dim Dt As DataTable = DtPS.FiltraPorIndices(PrevIndex, CurrentIndex)
|
||||
Dim payload = New JObject()
|
||||
|
||||
payload.Add(New JProperty("products", GenerarPayloadPrecios(Dt)))
|
||||
|
||||
PrevIndex = CurrentIndex
|
||||
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/services/products/price-import", payload.ToString())
|
||||
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Threading.Thread.Sleep(3000)
|
||||
End While
|
||||
End If
|
||||
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
Retorno = New JObject(New JProperty("products", ArrayPS)).ToString()
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
|
||||
Dim producto As New JObject(
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("price", RowPS("Precio")),
|
||||
New JProperty("promo_price", RowPS("PrecioPromocion"))
|
||||
)
|
||||
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
|
||||
Return ArrayPS
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
|
||||
|
||||
Private Function ActualizarExistencias() As String
|
||||
Return EnviarInformacion($"{Me.URLBase}api/services/products/stock", GetPSExistencias())
|
||||
End Function
|
||||
'Private Function ActualizarExistencias() As String
|
||||
' Return EnviarInformacion($"{Me.URLBase}api/services/products/stock", GetPSExistencias())
|
||||
'End Function
|
||||
|
||||
Private Function GetPSExistencias() As String
|
||||
Dim Retorno As String = "{}"
|
||||
Private Function ActualizarExistencias() As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||
|
||||
Dim DtPS As DataTable = Nothing
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
@@ -350,34 +490,90 @@ Public Class E141 : Implements IHttpHandler
|
||||
End Using
|
||||
|
||||
If DtPS IsNot Nothing Then
|
||||
If DtPS.Rows.Count > 0 AndAlso DtPS.Rows.Count = 1 Then
|
||||
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
Dim Dt As DataTable = DtPS.FiltraPorIndices(0, 0)
|
||||
Dim payload = New JObject()
|
||||
|
||||
Dim producto As New JObject(
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("branch_office_code", "01"),
|
||||
New JProperty("stock", RowPS("Existencia"))
|
||||
)
|
||||
payload.Add(New JProperty("stock", GenerarPayloadExistencias(Dt)))
|
||||
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
Retorno = New JObject(New JProperty("stock", ArrayPS)).ToString()
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/services/products/stock", payload.ToString())
|
||||
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
Dim TotalIndex As Integer = DtPS.Rows.Count - 1
|
||||
Dim TotaRegistrosPorPeticion As Integer = 500
|
||||
Dim PrevIndex As Integer = 0
|
||||
Dim CurrentIndex As Integer = 0
|
||||
|
||||
While PrevIndex < TotalIndex
|
||||
CurrentIndex += TotaRegistrosPorPeticion
|
||||
|
||||
If CurrentIndex > TotalIndex Then
|
||||
CurrentIndex = TotalIndex
|
||||
End If
|
||||
|
||||
Dim Dt As DataTable = DtPS.FiltraPorIndices(PrevIndex, CurrentIndex)
|
||||
Dim payload = New JObject()
|
||||
|
||||
payload.Add(New JProperty("stock", GenerarPayloadExistencias(Dt)))
|
||||
|
||||
PrevIndex = CurrentIndex
|
||||
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/services/products/stock", payload.ToString())
|
||||
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
|
||||
Threading.Thread.Sleep(3000)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
|
||||
If CountPeticionesExitosas = CountPeticiones Then
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
|
||||
Dim ArrayPS As New JArray
|
||||
For Each RowPS As DataRow In DtPS.Rows
|
||||
|
||||
Dim producto As New JObject(
|
||||
New JProperty("sku", RowPS("Codigo")),
|
||||
New JProperty("branch_office_code", "01"),
|
||||
New JProperty("stock", RowPS("Existencia").ToString())
|
||||
)
|
||||
|
||||
ArrayPS.Add(producto)
|
||||
Next
|
||||
|
||||
Return ArrayPS
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
|
||||
|
||||
Private Function ActualizarVendedores(Todos As Boolean) As String
|
||||
Return EnviarInformacion($"{Me.URLBase}api/v1/sellers/import", GetVendedores(Todos))
|
||||
End Function
|
||||
|
||||
Private Function GetVendedores(Todos As Boolean) As String
|
||||
Dim Retorno As String = "{}"
|
||||
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
|
||||
|
||||
Dim DtVendedores As DataTable = Nothing
|
||||
Using ObjPS As New ClsProductosServicios
|
||||
@@ -410,6 +606,11 @@ Public Class E141 : Implements IHttpHandler
|
||||
Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
|
||||
End Select
|
||||
|
||||
If VendedorData.Length > 4 Then
|
||||
Nombre = String.Concat(VendedorData(VendedorData.Length - 1), " ", VendedorData(VendedorData.Length))
|
||||
Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
|
||||
End If
|
||||
|
||||
Dim vendedor As New JObject(
|
||||
New JProperty("email", RowVendedor("Correo")),
|
||||
New JProperty("password", RowVendedor("Correo")),
|
||||
@@ -426,7 +627,19 @@ Public Class E141 : Implements IHttpHandler
|
||||
|
||||
ArrayVendedores.Add(vendedor)
|
||||
Next
|
||||
Retorno = New JObject(New JProperty("sellers", ArrayVendedores)).ToString()
|
||||
|
||||
Dim payload = New JObject(New JProperty("sellers", ArrayVendedores)).ToString()
|
||||
|
||||
Dim resp = EnviarInformacion($"{Me.URLBase}api/v1/sellers/import", payload)
|
||||
|
||||
CountPeticiones += 1
|
||||
|
||||
If IsValidJson(resp) Then
|
||||
Dim respuesta = JObject.Parse(resp)
|
||||
If respuesta("status").ToString() = "success" Then
|
||||
CountPeticionesExitosas += 1
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
@@ -495,4 +708,28 @@ Public Class E141 : Implements IHttpHandler
|
||||
Return URLParametros
|
||||
End Function
|
||||
|
||||
Private Shared Function IsValidJson(ByVal strInput As String) As Boolean
|
||||
If String.IsNullOrWhiteSpace(strInput) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
strInput = strInput.Trim()
|
||||
|
||||
If (strInput.StartsWith("{") AndAlso strInput.EndsWith("}")) OrElse (strInput.StartsWith("[") AndAlso strInput.EndsWith("]")) Then
|
||||
|
||||
Try
|
||||
Dim obj = JToken.Parse(strInput)
|
||||
Return True
|
||||
Catch jex As JsonReaderException
|
||||
Console.WriteLine(jex.Message)
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
Console.WriteLine(ex.ToString())
|
||||
Return False
|
||||
End Try
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -1180,7 +1180,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<asp:CheckBox ID="ChkCancelarNegativo" CssClass="md-checksd2" Text="Falta de fondos" TextAlign="Right" runat="server" />
|
||||
<asp:CheckBox ID="ChkCancelarNegativo" CssClass="md-checksd2" Text="Falta de fondos" TextAlign="Right" runat="server" Visible="false" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:CheckBox ID="ChkGeneraCancelacion" CssClass="md-checksd2" Text="Genera Devolución" TextAlign="Right" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4391,7 +4391,7 @@ Partial Class Bancos_IE
|
||||
Dim IdPolizaNueva = -1
|
||||
Dim FolioPolizaNueva = -1
|
||||
|
||||
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1")) Then
|
||||
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then
|
||||
|
||||
If ObjAC Is Nothing Then
|
||||
ErrorCancelar = True
|
||||
@@ -4427,7 +4427,7 @@ Partial Class Bancos_IE
|
||||
|
||||
'CANCELA IE
|
||||
If Not ErrorCancelar Then
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE"
|
||||
End If
|
||||
@@ -4458,7 +4458,7 @@ Partial Class Bancos_IE
|
||||
|
||||
'CANCELA IE
|
||||
If Not ErrorCancelar Then
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE"
|
||||
End If
|
||||
@@ -4479,22 +4479,42 @@ Partial Class Bancos_IE
|
||||
Else
|
||||
|
||||
' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
||||
If TxtFechaDocumento.Text.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then
|
||||
Dim GeneraCancelacionEnCero As Boolean = True
|
||||
If TxtFechaDocumento.Text.ToDate >= TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero
|
||||
GeneraCancelacionEnCero = True
|
||||
End If
|
||||
|
||||
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
|
||||
GeneraCancelacionEnCero = False
|
||||
End If
|
||||
Dim CvePrePolizaCancelacion As Integer = 0
|
||||
|
||||
If Not GeneraCancelacionEnCero Then
|
||||
'CANCELA IE MES ANTERIOR
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then
|
||||
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate)
|
||||
If CvePrePolizaCancelacion <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE MES ANTERIOR"
|
||||
End If
|
||||
Else
|
||||
'CANCELA IE MES ACTUAL
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate) Then
|
||||
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate)
|
||||
If CvePrePolizaCancelacion <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE MES ACTUAL"
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al contabilizar poliza"
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If Not ErrorCancelar Then
|
||||
If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
||||
If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
|
||||
If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
|
||||
@@ -4656,7 +4676,7 @@ Partial Class Bancos_IE
|
||||
|
||||
'genera nuevo IE contrario
|
||||
If Not ErrorCancelar Then
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
@@ -4672,7 +4692,7 @@ Partial Class Bancos_IE
|
||||
Else
|
||||
|
||||
'siempre se hace una cancelación
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
|
||||
|
||||
@@ -1584,7 +1584,7 @@ Partial Class Bancos_PagoElectronico
|
||||
Else
|
||||
|
||||
'Cuando salio NO exitoso cancelamos el IE
|
||||
If Not ObjIE.CancelarBancos_IE(UsuarioActual.CveUsuario, ArrayCveIEs(index).ToEntero, False, -1, -1) Then
|
||||
If ObjIE.CancelarBancos_IE(UsuarioActual.CveUsuario, ArrayCveIEs(index).ToEntero, False, -1, -1) <= 0 Then
|
||||
ErrorDB = True
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -2818,7 +2818,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
|
||||
'CANCELA IE
|
||||
If Not ErrorCancelar Then
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE"
|
||||
End If
|
||||
@@ -2849,7 +2849,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
|
||||
'CANCELA IE
|
||||
If Not ErrorCancelar Then
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE"
|
||||
End If
|
||||
@@ -2872,13 +2872,13 @@ Partial Class Bancos_PagoElectronicoGrupos
|
||||
' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
||||
If FechaDocumento < FechaCancelacion.FirstDayOfMonth Then
|
||||
'CANCELA IE MES ANTERIOR
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE MES ANTERIOR"
|
||||
End If
|
||||
Else
|
||||
'CANCELA IE MES ACTUAL
|
||||
If Not Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) Then
|
||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, FechaCancelacion) <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al cancelar IE MES ACTUAL"
|
||||
End If
|
||||
|
||||
@@ -3969,6 +3969,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
|
||||
'------------------INICIA VALIDACIONES------------------
|
||||
Dim EstatusCredito As Integer = 0
|
||||
Dim CveSubProyecto As Integer = 0
|
||||
@@ -6806,6 +6807,19 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
|
||||
|
||||
Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
|
||||
Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
|
||||
Select New With
|
||||
{
|
||||
.Total = dr2.Field(Of Double)("Total")
|
||||
}).Sum(Function(item) item.Total)
|
||||
|
||||
importeMovimiento += Valor.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
End If
|
||||
|
||||
Dim ConceptoContabilizacionNC = 225
|
||||
Dim CveMovimientoDevolucion As Integer = -1
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza,CveAlmacenVirtual" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="15%" HeaderText="Almacen">
|
||||
<ItemTemplate>
|
||||
@@ -314,8 +314,16 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
<div id="divAlmacenesVirtuales" runat="server" class="row" visible="false">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlAlmacenesVirtuales" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" Width="50%" CssClass="form-control input-sm select2me"/>
|
||||
<asp:Label AssociatedControlID="DdlAlmacenesVirtuales" runat="server" Text="Almacén Virtual:"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -49,6 +49,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
CargaTipoAlmacen()
|
||||
CargaDatos()
|
||||
CargaUsuarios()
|
||||
CargaAlmacenVirtual()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -64,7 +65,14 @@ Partial Class Inventarios_CatAlmacenes
|
||||
ObjAlmacen.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaAlmacenVirtual()
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
divAlmacenesVirtuales.Visible = True
|
||||
DdlAlmacenesVirtuales.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24)
|
||||
DdlAlmacenesVirtuales.DataBind()
|
||||
DdlAlmacenesVirtuales.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
|
||||
@@ -84,23 +92,23 @@ Partial Class Inventarios_CatAlmacenes
|
||||
DdlTipoAlmacen.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsuarios()
|
||||
|
||||
Dim DT As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros(" Estatus = 1 ").Copy
|
||||
|
||||
DT.DefaultView.Sort = "Nombre ASC"
|
||||
DT = DT.DefaultView.ToTable
|
||||
|
||||
DdlUsuariosAutoriza.DataSource = DT
|
||||
DdlUsuariosAutoriza.DataBind()
|
||||
|
||||
DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
Private Sub CargaUsuarios()
|
||||
|
||||
Dim DT As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros(" Estatus = 1 ").Copy
|
||||
|
||||
DT.DefaultView.Sort = "Nombre ASC"
|
||||
DT = DT.DefaultView.ToTable
|
||||
|
||||
DdlUsuariosAutoriza.DataSource = DT
|
||||
DdlUsuariosAutoriza.DataBind()
|
||||
|
||||
DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentasContables()
|
||||
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
||||
divCuentasCompac.Visible = False
|
||||
divCuentasCompac.Visible = False
|
||||
pnlCuentassig.Visible = True
|
||||
Using ObjContabilidad As New ClsContabilidad
|
||||
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
|
||||
@@ -111,22 +119,22 @@ Partial Class Inventarios_CatAlmacenes
|
||||
End If
|
||||
End Using
|
||||
Else
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
divCuentasCompac.Visible = True
|
||||
pnlCuentassig.Visible = False
|
||||
Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
|
||||
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
|
||||
DtCuentasContables = ObjContabilidad.DtResultados
|
||||
Else
|
||||
DtCuentasContables = Nothing
|
||||
End If
|
||||
End Using
|
||||
|
||||
DdlCuentasContables.DataSource = DtCuentasContables
|
||||
DdlCuentasContables.DataBind()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
divCuentasCompac.Visible = True
|
||||
pnlCuentassig.Visible = False
|
||||
Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
|
||||
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
|
||||
DtCuentasContables = ObjContabilidad.DtResultados
|
||||
Else
|
||||
DtCuentasContables = Nothing
|
||||
End If
|
||||
End Using
|
||||
|
||||
DdlCuentasContables.DataSource = DtCuentasContables
|
||||
DdlCuentasContables.DataBind()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UpAddAlmacen.Update()
|
||||
@@ -159,9 +167,9 @@ Partial Class Inventarios_CatAlmacenes
|
||||
'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
|
||||
|
||||
If e.Row.DBCampo("IdCtaContable").ToEntero > 0 Then
|
||||
e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCtaContable")}")
|
||||
'Else
|
||||
' e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta"
|
||||
e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCtaContable")}")
|
||||
'Else
|
||||
' e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta"
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -184,14 +192,14 @@ Partial Class Inventarios_CatAlmacenes
|
||||
|
||||
e.Row.FCDropDownList("DdlTipoAlmacen").DataSource = GlobalDTTipoAlmacen(-1)
|
||||
e.Row.FCDropDownList("DdlTipoAlmacen").DataBind()
|
||||
e.Row.FCDropDownList("DdlTipoAlmacen").SelectedValue = e.Row.DBCampo("CveTipoAlmacen")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'e.Row.FCDropDownList("DdlModalidad").DataSource =
|
||||
'e.Row.FCDropDownList("DdlModalidad").DataBind()
|
||||
e.Row.FCDropDownList("DdlTipoAlmacen").SelectedValue = e.Row.DBCampo("CveTipoAlmacen")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'e.Row.FCDropDownList("DdlModalidad").DataSource =
|
||||
'e.Row.FCDropDownList("DdlModalidad").DataBind()
|
||||
e.Row.FCDropDownList("DdlModalidad").Items.Add(New ListItem("Solo Existencia", "0"))
|
||||
e.Row.FCDropDownList("DdlModalidad").Items.Add(New ListItem("Contable", "1"))
|
||||
e.Row.FCDropDownList("DdlModalidad").SelectedValue = If(e.Row.DBCampo("Modalidad").ToString = "Contable", "1", "0")
|
||||
@@ -199,20 +207,20 @@ Partial Class Inventarios_CatAlmacenes
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
'Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
'End Sub
|
||||
'Private Sub OrdenaDatos()
|
||||
' If (GvDatos.Rows.Count > 0) Then
|
||||
' GvDatos.UseAccessibleHeader = True
|
||||
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
' RegistraScript("OrdenarGV();")
|
||||
' End If
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
Private Sub RecargaGlobalAlmacenes()
|
||||
GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing
|
||||
'Dim ObjAlmacen As New ClsInventarios
|
||||
@@ -239,19 +247,21 @@ Partial Class Inventarios_CatAlmacenes
|
||||
Dim Estatus = 0
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
Dim CuentaContable As Integer = 0
|
||||
Dim CveCuenta As Integer = 0
|
||||
|
||||
|
||||
If pnlCuentassig.Visible Then
|
||||
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
|
||||
End If
|
||||
If divCuentasCompac.Visible Then
|
||||
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
|
||||
Dim CveCuenta As Integer = 0
|
||||
|
||||
|
||||
If pnlCuentassig.Visible Then
|
||||
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
|
||||
End If
|
||||
If divCuentasCompac.Visible Then
|
||||
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then
|
||||
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero,
|
||||
CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero()) Then
|
||||
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatos.Update()
|
||||
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
@@ -261,7 +271,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then
|
||||
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero, CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero) Then
|
||||
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpDatos.Update()
|
||||
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
@@ -278,7 +288,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
End Sub
|
||||
|
||||
Public Sub Agregar()
|
||||
HdnModalidad.Value = "A"
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
If DdlModalidad.SelectedValue = 1 Then
|
||||
DdlCuentasContables.Visible = True
|
||||
@@ -290,6 +300,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
ChkEstatus.Checked = True
|
||||
divEstatus.Visible = False
|
||||
DdlUsuariosAutoriza.SelectedValueExist("-1")
|
||||
DdlAlmacenesVirtuales.SelectedValue = "-1"
|
||||
|
||||
UpAddAlmacen.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
|
||||
@@ -326,16 +337,17 @@ Partial Class Inventarios_CatAlmacenes
|
||||
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
|
||||
DdlTipoAlmacen.SelectedValueExist(GvRow.DataKey("CveTipoAlmacen"))
|
||||
TxtAlmacen.Text = GvRow.DataKey("Almacen")
|
||||
TxtOrden.Text = GvRow.DataKey("Orden")
|
||||
DdlUsuariosAutoriza.SelectedValueExist(If(GvRow.DataKey("CveUsuarioAutoriza").ToEntero > 0, GvRow.DataKey("CveUsuarioAutoriza"), "-1"))
|
||||
|
||||
|
||||
TxtOrden.Text = GvRow.DataKey("Orden")
|
||||
DdlUsuariosAutoriza.SelectedValueExist(If(GvRow.DataKey("CveUsuarioAutoriza").ToEntero > 0, GvRow.DataKey("CveUsuarioAutoriza"), "-1"))
|
||||
DdlAlmacenesVirtuales.SelectedValueExist(GvRow.DataKey("CveAlmacenVirtual"))
|
||||
|
||||
|
||||
divEstatus.Visible = True
|
||||
ChkEstatus.Checked = If((GvRow.DataKey("Estatus")) = "Activo", True, False)
|
||||
UpAddAlmacen.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
|
||||
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub LnkAlmacen_Click(sender As Object, e As EventArgs) Handles LnkAlmacen.Click
|
||||
Agregar()
|
||||
|
||||
@@ -2663,7 +2663,12 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
' COMIENZA: VIRTUAL
|
||||
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Dev") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso CveMovimiento > 0 Then
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
Dim tCveAlmacen As Integer = -1
|
||||
|
||||
If ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
tCveAlmacen = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
|
||||
End If
|
||||
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
@@ -2685,7 +2690,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento
|
||||
Dim ValidaVirtual As Boolean = False
|
||||
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
If TipoMovimiento = 1 Then
|
||||
CveConceptoMovimientoVirtual = 37
|
||||
|
||||
@@ -551,18 +551,15 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DdlTipo.Items.Insert(0, New ListItem("Compra", "1"))
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Then
|
||||
DdlTipo.Items.Insert(1, New ListItem("OC", "2"))
|
||||
|
||||
|
||||
|
||||
DdlTipo.Items.Add(New ListItem("OC", "2"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(155).ToEntero > 0 Then
|
||||
DdlTipo.Items.Insert(DdlTipo.Items.Count - 1, New ListItem("Importación", "3"))
|
||||
DdlTipo.Items.Add(New ListItem("Importación", "3"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(158).ToEntero > 0 Then
|
||||
DdlTipo.Items.Insert(DdlTipo.Items.Count - 1, New ListItem("Costo Indirecto", "4"))
|
||||
DdlTipo.Items.Add(New ListItem("Costo Indirecto", "4"))
|
||||
End If
|
||||
|
||||
UpFiltros.Update()
|
||||
@@ -774,7 +771,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim DtPendientes As New DataTable
|
||||
|
||||
If ObjInventarios.ComprasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
Dim FiltroTemporal = If(UsuarioActual.CveEmpresa.Contiene(119, 140, 1, 72, 80), "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')")
|
||||
Dim FiltroTemporal = If(UsuarioActual.CveEmpresa.Contiene(119, 140, 1, 72, 80, 153, 154), "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')")
|
||||
DtPendientes = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}")
|
||||
Else
|
||||
DtPendientes = Nothing
|
||||
@@ -2251,7 +2248,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
Retorno = False
|
||||
@@ -2707,6 +2704,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
|
||||
Dim tCveAlmacen As Integer = -1
|
||||
|
||||
If ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
tCveAlmacen = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
|
||||
End If
|
||||
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados
|
||||
End If
|
||||
@@ -2716,7 +2719,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
Dim CveTipoAlmacenFiltro As Integer = If(CveTipoCompra = 9, 25, 24)
|
||||
|
||||
Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacenFiltro).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim CveAlmacenVirutal As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
@@ -686,6 +686,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim CveSubProyectoOrigen, CveSubProyectoDestino As Integer
|
||||
Dim IdCtaContableOrigen, IdCtaContableDestino As Integer
|
||||
|
||||
Dim CveAlmacenVirtualSalida As Integer = -1
|
||||
Dim CveAlmacenVirtualEntrada As Integer = -1
|
||||
|
||||
DrAlmO = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
DrAlmD = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestino.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
|
||||
@@ -694,11 +697,14 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TipoAlmacenOrigen = DrAlmO("CveTipoAlmacen").ToString.ToEntero
|
||||
CveSubProyectoOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero
|
||||
IdCtaContableOrigen = DrAlmO("IdCtaContable").ToString.ToEntero
|
||||
CveAlmacenVirtualSalida = DrAlmO("CveAlmacenVirtual").ToString.ToEntero
|
||||
|
||||
|
||||
CveSucursalDestino = DrAlmD("CveSubProyecto").ToString.ToEntero
|
||||
TipoAlmacenDestino = DrAlmD("CveTipoAlmacen").ToString.ToEntero
|
||||
CveSubProyectoDestino = DrAlmD("CveSubProyecto").ToString.ToEntero
|
||||
IdCtaContableDestino = DrAlmO("IdCtaContable").ToString.ToEntero
|
||||
IdCtaContableDestino = DrAlmD("IdCtaContable").ToString.ToEntero
|
||||
CveAlmacenVirtualEntrada = DrAlmD("CveAlmacenVirtual").ToString.ToEntero
|
||||
|
||||
End If
|
||||
|
||||
@@ -863,17 +869,14 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'VIRTUAL SALIDA
|
||||
If RealizarMovimientoVirtual Then
|
||||
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If TipoAlmacenOrigen = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
End If
|
||||
'If TipoAlmacenOrigen = 27 Then
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
'Else
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
'End If
|
||||
|
||||
|
||||
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
FolioVirtualSalida = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
@@ -932,14 +935,14 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
|
||||
|
||||
'SI EL ALMACEN DESTINO ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If TipoAlmacenDestino = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
End If
|
||||
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S3")
|
||||
'If TipoAlmacenDestino = 27 Then
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
'Else
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
'End If
|
||||
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtualEntrada, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S3")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
@@ -1690,15 +1693,15 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero}").ToEntero()
|
||||
|
||||
Dim CveTipoAlmacenOrigen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveTipoAlmacen").ToEntero()
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If CveTipoAlmacenOrigen = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
End If
|
||||
'Dim CveAlmacenVirtual As Integer = -1
|
||||
'If CveTipoAlmacenOrigen = 27 Then
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
'Else
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
'End If
|
||||
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
|
||||
@@ -1921,14 +1924,15 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim CveMovimientoVirtualEntrada As Integer = 0
|
||||
Dim FolioVirtualEntrada As Integer = 0
|
||||
If RealizarMovimientoVirtual Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenRecepcion.SelectedValue}").ToEntero()
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenRecepcion.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If TipoAlmacenDestino = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
End If
|
||||
'Dim CveAlmacenVirtual As Integer = -1
|
||||
'If TipoAlmacenDestino = 27 Then
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
'Else
|
||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
'End If
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenRecepcion.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatChecadorEstaciones.aspx.vb" Inherits="RH_CatChecadorEstaciones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Catálogo Estaciones
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkChecadorEstaciones" runat="server"><i class="fa fa-plus-circle"></i> Agregar</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveChecadorEstaciones" Value="-1" />
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;text-align:right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvChecadorEstaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvChecadorEstaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvChecadorEstaciones" runat="server" GridLines="None" DataKeyNames="CveChecadorEstacion,ChecadorEstacion,CveChecadorTipo,Ip,Puerto,CveZonaHoraria,Estatus,Fecha,CveUsuario,CveEmpresa,ChecadorTipo,Usuario,ZonaHoraria"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-freezerows="1" AutoGenerateColumns ="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Checadores de Estaciones ">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ChecadorEstacion" HeaderText="Checador de Estacion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ChecadorTipo" HeaderText="Tipo de Checador" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ZonaHoraria" HeaderText="Zona Horaria" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Ip" HeaderText="IP" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Puerto" HeaderText="Puerto" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddChecadorEstaciones" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddChecadorEstaciones" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Checador de Estacion</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyChecadorEstaciones" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtChecadorEstaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVChecadorEstaciones" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtChecadorEstaciones" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Checador de Estaciones''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtChecadorEstaciones.ClientID.ToString()%>">Checador de Estaciones:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlChecadorTipo" DataValueField="CveChecadorTipo" Width="150" DataTextField="ChecadorTipo" runat="server" CssClass="form-control select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlChecadorTipo.ClientID.ToString()%>">Tipo de Checador:</label>
|
||||
|
||||
<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RfvDdlChecadorTipo" ControlToValidate="DdlChecadorTipo" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VADdlChecadorTipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChecadorTipo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlZonaHoraria" DataValueField="CveZonaHoraria" DataTextField="ZonaHoraria" Width="150" runat="server" CssClass="form-control select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlZonaHoraria.ClientID.ToString()%>">Zona Horaria:</label>
|
||||
|
||||
<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RfvDdlZonaHoraria" ControlToValidate="DdlZonaHoraria" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VADdlZonaHoraria" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlZonaHoraria" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIp" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="25"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVIp" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtIp" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''IP''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtIp.ClientID.ToString()%>">IP:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPuerto" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="5" ></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FIETxtPuerto" TargetControlID="TxtPuerto" FilterType="Numbers" runat="server" />
|
||||
<asp:RequiredFieldValidator ID="RFVPuerto" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPuerto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puerto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPuerto.ClientID.ToString()%>">Puerto:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarChecadorEstaciones" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class RH_CatChecadorEstaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDdlChecadorTipo()
|
||||
CargaDdlZonaHoraria()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjRH As New ClsRH()
|
||||
HdnID.Value = -1
|
||||
If ObjRH.ChecadorEstacionesGet(HdnID.Value, UsuarioActual.CveEmpresa) Then
|
||||
GvChecadorEstaciones.DataSource = ObjRH.DtResultados
|
||||
GvChecadorEstaciones.DataBind()
|
||||
End If
|
||||
ObjRH.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlChecadorTipo()
|
||||
Dim ObjRH As New ClsRH()
|
||||
If ObjRH.DdlChecadorTipoGet(UsuarioActual.CveEmpresa) Then
|
||||
DdlChecadorTipo.DataSource = ObjRH.DtResultados
|
||||
DdlChecadorTipo.DataBind()
|
||||
|
||||
End If
|
||||
ObjRH.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlZonaHoraria()
|
||||
Dim ObjRH As New ClsRH()
|
||||
If ObjRH.DdlZonaHorariaGet() Then
|
||||
DdlZonaHoraria.DataSource = ObjRH.DtResultados
|
||||
DdlZonaHoraria.DataBind()
|
||||
|
||||
End If
|
||||
ObjRH.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarChecadorEstaciones_Click(sender As Object, e As EventArgs) Handles BtnAgregarChecadorEstaciones.Click
|
||||
Dim ObjRH As New ClsRH
|
||||
Dim Estatus = 0
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjRH.ChecadorEstacionesAdd(DdlChecadorTipo.SelectedValue, DdlZonaHoraria.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtChecadorEstaciones.Text, TxtIp.Text, TxtPuerto.Text, Estatus) Then
|
||||
CargaDatos()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
If ObjRH.ChecadorEstacionesUpdate(HdnID.Value, DdlChecadorTipo.SelectedValue, DdlZonaHoraria.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtChecadorEstaciones.Text, TxtIp.Text, TxtPuerto.Text, Estatus) Then
|
||||
CargaDatos()
|
||||
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddChecadorEstaciones"))
|
||||
ObjRH.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
HdnID.Value = GvRow.DataKey("CveChecadorEstacion")
|
||||
UpDatos.Update()
|
||||
BtnAgregarChecadorEstaciones.Text = "Actualizar"
|
||||
DdlChecadorTipo.SelectedValueExist(GvRow.DataKey("CveChecadorTipo"))
|
||||
DdlZonaHoraria.SelectedValueExist(GvRow.DataKey("CveZonaHoraria"))
|
||||
TxtChecadorEstaciones.Text = GvRow.DataKey("ChecadorEstacion")
|
||||
TxtIp.Text = GvRow.DataKey("Ip")
|
||||
TxtPuerto.Text = GvRow.DataKey("Puerto")
|
||||
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
UpAddChecadorEstaciones.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddChecadorEstaciones"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Agregar()
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
BtnAgregarChecadorEstaciones.Text = "Agregar"
|
||||
TxtChecadorEstaciones.Text = ""
|
||||
TxtIp.Text = ""
|
||||
TxtPuerto.Text = ""
|
||||
CargaDdlChecadorTipo()
|
||||
CargaDdlZonaHoraria()
|
||||
ChkEstatus.Checked = False
|
||||
UpAddChecadorEstaciones.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddChecadorEstaciones"))
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjRH As New ClsRH()
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CveChecadorEstacion")
|
||||
UpDatos.Update()
|
||||
If ObjRH.ChecadorEstacionesRemove(HdnID.Value) Then
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
ObjRH.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkChecadorEstaciones_Click(sender As Object, e As EventArgs) Handles LnkChecadorEstaciones.Click
|
||||
Agregar()
|
||||
End Sub
|
||||
|
||||
Private Sub GvChecadorEstaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvChecadorEstaciones.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
@@ -64,9 +64,19 @@
|
||||
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCODdlSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlModelo">Modelo:</label>
|
||||
<asp:DropDownList ID="DdlModelo" Width="100%" runat="server" AppendDataBoundItems="true" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="zkteco" Value="1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlModelo" runat="server" ControlToValidate="DdlModelo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modelo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceDdlModelo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModelo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIPLocal" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="RfvTxtIPLocal" runat="server"
|
||||
|
||||
@@ -52,6 +52,7 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
{
|
||||
TxtChecador.Text = "";
|
||||
DdlSubProyecto.SelectedValue = "-1";
|
||||
DdlModelo.SelectedValue = "-1";
|
||||
TxtIPLocal.Text = "";
|
||||
TxtPuerto.Text = "";
|
||||
BtnChecadorAgregar.Text = "Agregar";
|
||||
@@ -65,14 +66,14 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
ClsRH ObjRH = new ClsRH();
|
||||
if (BtnChecadorAgregar.Text == "Agregar")
|
||||
{
|
||||
if (ObjRH.AddChecadores(TxtChecador.Text, DdlSubProyecto.SelectedValue.ToEntero(), TxtIPLocal.Text, TxtPuerto.Text, UsuarioActual.CveUsuario))
|
||||
if (ObjRH.AddChecadores(TxtChecador.Text, DdlSubProyecto.SelectedValue.ToEntero(), TxtIPLocal.Text, TxtPuerto.Text, UsuarioActual.CveUsuario,CveModelo:DdlModelo.SelectedValue.ToEntero()))
|
||||
{
|
||||
Alert("Checador agregado correctamente");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked))
|
||||
if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked, CveModelo: DdlModelo.SelectedValue.ToEntero()))
|
||||
{
|
||||
Alert("Checador actualizado correctamente");
|
||||
}
|
||||
@@ -90,6 +91,7 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
CveChecador = GvRow.DataKey("CveChecador").ToEntero();
|
||||
TxtChecador.Text = GvRow.DataKey("Checador");
|
||||
DdlSubProyecto.SelectedValue = GvRow.DataKey("CveSubProyecto");
|
||||
DdlModelo.SelectedValue = GvRow.DataKey("CveModelo");
|
||||
TxtIPLocal.Text = GvRow.DataKey("IPLocal");
|
||||
TxtPuerto.Text = GvRow.DataKey("Puerto");
|
||||
BtnChecadorAgregar.Text = "Actualizar";
|
||||
|
||||
@@ -3738,7 +3738,7 @@
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
|
||||
<asp:Literal ID="LtlFechaA" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
|
||||
@@ -213,7 +213,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Correcto = ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
|
||||
|
||||
If Correcto Then
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row)
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
|
||||
Else
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -418,6 +418,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim Correcto As Boolean = False
|
||||
Dim TieneError As Boolean = False
|
||||
Dim CvePS As Integer = DtPS.FiltroPrimeroValor("CvePS", String.Format("Codigo='{0}' AND CveEmpresa={1}", row(0).ToString(), UsuarioActual.CveEmpresa)).ToEntero
|
||||
Dim CvePrecioLista As Integer = DdlPrecioListaCarga.SelectedValue.ToEntero()
|
||||
Dim PrecioNuevo As Decimal = row("Precio").ToString().ToDecimal()
|
||||
@@ -429,6 +430,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
|
||||
If Correcto Then
|
||||
RowsCargados += 1
|
||||
TieneError = ActualizarPreciosFranquicia(ObjPS, row(0).ToString(), row(1).ToString(), PrecioNuevo, 0, DdlPrecioListaCarga.SelectedItem.Text)
|
||||
End If
|
||||
Else
|
||||
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
|
||||
@@ -527,28 +529,35 @@ Partial Class Ventas_ActualizarPrecios
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, row As GridViewRow) As Boolean
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(137)
|
||||
Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, PS As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String) As Boolean
|
||||
Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||
Dim Franquicias = FranquiciasStr.Split(","c)
|
||||
Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal)
|
||||
Dim Codigo As String = row.DataKey("Codigo")
|
||||
Dim StrMsg As New StringBuilder
|
||||
For Each Franquicia In Franquicias
|
||||
Dim CveFranquicia As Integer = Franquicia.ToEntero
|
||||
Dim CvePS As Integer = GlobalDTPS(CveFranquicia).FiltroPrimeroValor("CvePS", String.Format("Codigo LIKE '%{0}%'", Codigo)).ToEntero
|
||||
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", DdlPrecioLista.SelectedItem.Text)).ToEntero
|
||||
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero
|
||||
Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero
|
||||
|
||||
If CvePS <= 0 Then
|
||||
Alert(String.Format("El producto '{0}' no se encuentra en la Franquicia '{1}'", row.DataKey("PS"), EmpresaFranquicia), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}'", PS, EmpresaFranquicia)
|
||||
|
||||
End If
|
||||
If CvePrecioLisa <= 0 Then
|
||||
Alert(String.Format("El precio lista '{0}' no existe en la Franquicia '{1}'", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia), TipoMensaje.MsgAdvertencia)
|
||||
Return True
|
||||
Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
|
||||
StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
|
||||
End If
|
||||
If Not ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal) Then
|
||||
Return True
|
||||
If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
|
||||
StrMsg.AppendFormat("No se pudo actualizar el producto")
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
|
||||
If StrMsg.ToString = "" Then
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
|
||||
End Function
|
||||
End Class
|
||||
@@ -2055,7 +2055,7 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.Items.Insert(DdlTipoComprobante.Items.Count, New ListItem("Autorización", "PA"))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa <> 141 Then
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then
|
||||
LnkAgregarCliente.Visible = False
|
||||
End If
|
||||
|
||||
@@ -5141,40 +5141,44 @@ Partial Class Ventas
|
||||
|
||||
End Function
|
||||
Private Sub CargarAlmacenes()
|
||||
If UsuarioActual.Empresa.UsaInventarios Then
|
||||
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.CveEmpresa = 141 AndAlso EsCreaApartirDe) Then
|
||||
DivAlmacen.Visible = False
|
||||
Else
|
||||
Dim DTAlmacen As DataTable
|
||||
ddlAlmacen.Items.Clear()
|
||||
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
|
||||
ddlAlmacen.DataSource = DTAlmacen
|
||||
If DTAlmacen Is Nothing Or DTAlmacen.Rows.Count = 0 Then
|
||||
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
ddlAlmacen.SelectedValue = "-1"
|
||||
End If
|
||||
ddlAlmacen.DataBind()
|
||||
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").Rows.Count > 0 Then
|
||||
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||
End If
|
||||
End If
|
||||
|
||||
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.CveEmpresa = 141 AndAlso EsCreaApartirDe) Then
|
||||
DivAlmacen.Visible = False
|
||||
'SI TIENE CONTRATO NO SE MUEVE
|
||||
If Not CveContrato > 0 Then
|
||||
DdlAlmacenAsignado.Items.Clear()
|
||||
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()} AND CveTipoAlmacen IN (4,10)")
|
||||
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
DdlAlmacenAsignado.SelectedValue = "-1"
|
||||
DdlAlmacenAsignado.DataBind()
|
||||
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").ToString().ToEntero())
|
||||
End If
|
||||
|
||||
If CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
|
||||
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
|
||||
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
DdlAlmacenAsignado.SelectedValue = "-1"
|
||||
DdlAlmacenAsignado.DataBind()
|
||||
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero())
|
||||
End If
|
||||
Else
|
||||
Dim DTAlmacen As DataTable
|
||||
ddlAlmacen.Items.Clear()
|
||||
DTAlmacen = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
|
||||
ddlAlmacen.DataSource = DTAlmacen
|
||||
If DTAlmacen Is Nothing Or DTAlmacen.Rows.Count = 0 Then
|
||||
ddlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
ddlAlmacen.SelectedValue = "-1"
|
||||
End If
|
||||
ddlAlmacen.DataSource = Nothing
|
||||
ddlAlmacen.DataBind()
|
||||
If GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").Rows.Count > 0 Then
|
||||
ddlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI TIENE CONTRATO NO SE MUEVE
|
||||
If Not CveContrato > 0 Then
|
||||
DdlAlmacenAsignado.Items.Clear()
|
||||
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()} AND CveTipoAlmacen IN (4,10)")
|
||||
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
DdlAlmacenAsignado.SelectedValue = "-1"
|
||||
DdlAlmacenAsignado.DataBind()
|
||||
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}").ToString().ToEntero())
|
||||
End If
|
||||
|
||||
If CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then
|
||||
DdlAlmacenAsignado.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros($"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue.ToEntero()}")
|
||||
DdlAlmacenAsignado.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
DdlAlmacenAsignado.SelectedValue = "-1"
|
||||
DdlAlmacenAsignado.DataBind()
|
||||
DdlAlmacenAsignado.SelectedValueExist(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString().ToEntero())
|
||||
End If
|
||||
|
||||
UpINV.Update()
|
||||
@@ -18025,7 +18029,7 @@ Partial Class Ventas
|
||||
CveMovimientoEntradaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
|
||||
Dim tCveAlmacen = RowMovimiento("CveAlmacen").ToString().ToEntero()
|
||||
CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {tCveAlmacen}").ToEntero()
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen = 24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
|
||||
Reference in New Issue
Block a user