Merge branch 'master' of http://agonzalez@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
|
||||
|
||||
@@ -5017,11 +5017,11 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/PV/PVRepCompras.aspx".ToUpper(), 272)
|
||||
PaginaDict.Add("/PV/PVRepVentasCompras.aspx".ToUpper(), 273)
|
||||
|
||||
PaginaDict.Add("/Contratos/ContratoObra.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Contratos/RepContratosObraAvances.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Contratos/RepContratosObraAvancesDetalle.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Contratos/RepContratosObraAvancesPartida.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Contratos/ContratoObraAutorizacion.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Contratos/ContratoObra.aspx".ToUpper(), 911)
|
||||
PaginaDict.Add("/Contratos/RepContratosObraAvances.aspx".ToUpper(), 914)
|
||||
PaginaDict.Add("/Contratos/RepContratosObraAvancesDetalle.aspx".ToUpper(), 914)
|
||||
PaginaDict.Add("/Contratos/RepContratosObraAvancesPartida.aspx".ToUpper(), 914)
|
||||
PaginaDict.Add("/Contratos/ContratoObraAutorizacion.aspx".ToUpper(), 913)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -699,7 +699,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
|
||||
'verifica existencias
|
||||
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153) Then
|
||||
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then
|
||||
UsaGlobal = False
|
||||
|
||||
If CveEmpresa = 140 And Pagina.Contiene("ventas/ventas") Then
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1805,6 +1805,7 @@ Partial Class Compras_Compras
|
||||
DdlTipoCompra.Items.Clear()
|
||||
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("Apoyo Logístico", "9"))
|
||||
DdlTipoCompra.Items.Add(New ListItem("NC Por Devolución", "11"))
|
||||
|
||||
|
||||
@@ -2704,72 +2705,72 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
GvPS.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
CargaHidendsAC()
|
||||
End If
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
CargaHidendsAC()
|
||||
End If
|
||||
|
||||
CalculaTotales(True)
|
||||
CalculaTotales(True)
|
||||
|
||||
If UsuarioActual.Empresa.UsaInventarios Then
|
||||
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
|
||||
If UsuarioActual.Empresa.UsaInventarios Then
|
||||
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
|
||||
|
||||
If dr("Inventario").ToString = "1" Then
|
||||
If dr("Inventario").ToString = "1" Then
|
||||
|
||||
CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero
|
||||
CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero
|
||||
|
||||
Dim Inv As New ClsInventarios
|
||||
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento")))
|
||||
'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros)
|
||||
Dim Inv As New ClsInventarios
|
||||
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento")))
|
||||
'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros)
|
||||
|
||||
ImgImprimirAlmacen.Visible = True
|
||||
ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento"))
|
||||
ImgImprimirAlmacen.Visible = True
|
||||
ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento"))
|
||||
|
||||
Dim drt As DataRow
|
||||
'actualizo el almacen
|
||||
For Each dri As DataRow In DtInv.Rows
|
||||
Dim drt As DataRow
|
||||
'actualizo el almacen
|
||||
For Each dri As DataRow In DtInv.Rows
|
||||
|
||||
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
||||
If drt IsNot Nothing Then
|
||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie
|
||||
TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie
|
||||
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
||||
If drt IsNot Nothing Then
|
||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie
|
||||
TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie
|
||||
|
||||
dri("CveAlmacen") = drt("CveAlmacen")
|
||||
dri("CveAlmacen") = drt("CveAlmacen")
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
'Proceso Super Tramposo de Charlie
|
||||
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then
|
||||
Dim drt As DataRow
|
||||
For Each dri As DataRow In DtInv.Rows
|
||||
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
||||
If drt IsNot Nothing Then
|
||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0)
|
||||
TmpDr("CveAlmacen") = drt("CveAlmacen")
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Inv.Dispose()
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
CargaGvInv()
|
||||
'Proceso Super Tramposo de Charlie
|
||||
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then
|
||||
Dim drt As DataRow
|
||||
For Each dri As DataRow In DtInv.Rows
|
||||
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
||||
If drt IsNot Nothing Then
|
||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0)
|
||||
TmpDr("CveAlmacen") = drt("CveAlmacen")
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'Ocultamos "Recibir Aqui"
|
||||
GvInv.Columns(6).Visible = False
|
||||
GvInv.Columns(7).Visible = False
|
||||
Inv.Dispose()
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlTipoComprobante.Enabled = False
|
||||
CargaGvInv()
|
||||
|
||||
'Ocultamos "Recibir Aqui"
|
||||
GvInv.Columns(6).Visible = False
|
||||
GvInv.Columns(7).Visible = False
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
DdlTipoComprobante.Enabled = False
|
||||
DdlTipoComprobante.SelectedValue = dr("TipoDocto").ToString
|
||||
If dr("TipoDocto").ToString = "Fac" Then
|
||||
ChkAplicaNotaCredito.Enabled = True
|
||||
@@ -3969,6 +3970,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 +6808,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
|
||||
|
||||
|
||||
@@ -1140,6 +1140,19 @@ Partial Class PopUpVerFactura
|
||||
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
|
||||
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
|
||||
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
|
||||
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
|
||||
@@ -1183,6 +1196,7 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'End If
|
||||
|
||||
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
<div class="progress">
|
||||
<span runat="server" id="SPAvance1" style="width: 76%;" class="progress-bar progress-bar-success green-sharp">
|
||||
<%--<span runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
|
||||
<%--<span runat="server" id="SPAvance2" class="sr-only">76% Avance</span>--%>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
<div class="progress-info">
|
||||
<div class="progress">
|
||||
<span runat="server" id="SPFaltante" style="width: 76%;" class="progress-bar progress-bar-success red-haze">
|
||||
<%--<span class="sr-only">76% Avance</span>--%>
|
||||
<%--<span class="sr-only">76% Avance</span>--%>
|
||||
</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
@@ -442,7 +442,8 @@
|
||||
<div class="row" id="DVddlproyecto" runat="server">
|
||||
|
||||
<asp:Label runat="server" ID="LblProyecto" class="col-md-3 truncate">Proyecto:</asp:Label>
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin Proyecto asignado" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
@@ -451,6 +452,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="CVERFVDdlProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" id="DVSubProyecto" runat="server" visible="false">
|
||||
@@ -777,7 +779,7 @@
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="150px" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Avance" Visible="True">
|
||||
<asp:TemplateField HeaderText="Avance" Visible="false">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton runat="server" ID="LnkHabilitaAvance" Text= "" OnClick="LnkHabilitaAvance_Click" Enabled="false"
|
||||
|
||||
@@ -606,7 +606,7 @@ Partial Class Contratos_ContratoObra
|
||||
TxtFechaFinal.Text = ""
|
||||
TxtPorIVA.Text = ""
|
||||
|
||||
DdlProyecto.SelectedValue = "-1"
|
||||
'DdlProyecto.SelectedValue = "-1"
|
||||
|
||||
TxtCantidad.Text = ""
|
||||
TxtPU.Text = ""
|
||||
@@ -779,7 +779,7 @@ Partial Class Contratos_ContratoObra
|
||||
TxtPorAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero
|
||||
TxtPorAmortizacionAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero
|
||||
TxtPorGarantia.Text = ObjContratos.PorGarantia.FormatoNumero
|
||||
DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString
|
||||
'DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString
|
||||
LblSubProyecto.Text = ObjContratos.SubProyectoContrato
|
||||
DdlTipoContratoObra.SelectedValueExist(ObjContratos.CveContratoTipo)
|
||||
'CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero)
|
||||
@@ -1008,7 +1008,7 @@ Partial Class Contratos_ContratoObra
|
||||
System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString))
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -4592,11 +4592,11 @@ Partial Class Contratos_ContratoObra
|
||||
|
||||
Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal
|
||||
Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal
|
||||
Dim TotalAvancePorcentaje As Decimal = (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2)
|
||||
Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0)
|
||||
|
||||
Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal
|
||||
Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal
|
||||
Dim TotalFaltantePorcentaje As Decimal = (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2)
|
||||
Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0)
|
||||
|
||||
|
||||
LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }"
|
||||
|
||||
@@ -238,12 +238,12 @@
|
||||
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Factura" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" Target="_blank" />
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText="Estado">
|
||||
<%-- <asp:TemplateField HeaderText="Estado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" CssClass="Texto" runat="server" Text='<%# Eval("EstimacionEstatus")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>--%>
|
||||
|
||||
|
||||
<asp:TemplateField HeaderText=" ">
|
||||
|
||||
@@ -342,6 +342,7 @@ Partial Class RepContratosObraAvancesDetalle
|
||||
|
||||
WBAnexo.Worksheet(1).CopyTo(WBAnexoSalvar, "CONTROL")
|
||||
|
||||
Dim Contadorpaginas As Integer = 1
|
||||
|
||||
For Each Drow As DataRow In DtControl.Rows
|
||||
|
||||
@@ -380,7 +381,10 @@ Partial Class RepContratosObraAvancesDetalle
|
||||
|
||||
Dim Imagenes As New List(Of ClosedXML.Excel.Drawings.IXLPicture)
|
||||
|
||||
|
||||
Dim CurrectRowImg As Integer = 19 'Row 19 primera imggen
|
||||
|
||||
|
||||
Dim RowH As Double = WSDetalle.Row(19).Height
|
||||
|
||||
For Each drowArchivos In DTArchivos.Rows
|
||||
@@ -403,7 +407,10 @@ Partial Class RepContratosObraAvancesDetalle
|
||||
End If
|
||||
|
||||
Next
|
||||
WBAnexo.Worksheet(2).CopyTo(WBAnexoSalvar, If(Drow("Codigo").ToString.Trim.Length > 0, Drow("Codigo").ToString, Drow("CvePS").ToString))
|
||||
|
||||
WBAnexo.Worksheet(2).CopyTo(WBAnexoSalvar, If(Drow("Codigo").ToString.Trim.Length > 0, Contadorpaginas & "_" & Drow("Codigo").ToString, Contadorpaginas & "_" & Drow("CvePS").ToString))
|
||||
|
||||
Contadorpaginas = Contadorpaginas + 1
|
||||
|
||||
For Each img As ClosedXML.Excel.Drawings.IXLPicture In Imagenes
|
||||
img.Delete()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:Button Text="Recarga" Width="75px" ID="BtnConsultarPendientes" OnClick="BtnConsultarPendientes_Click" CssClass="btn btn-primary" runat="server" ValidationGroup="GrpPendientes" />
|
||||
<asp:Button Text="Recarga" Width="75px" ID="BtnConsultarPendientes" OnClick="BtnConsultarPendientes_Click" CssClass="btn btn-primary input-sm" runat="server" ValidationGroup="GrpPendientes" />
|
||||
<asp:Timer runat="server" ID="TimmerRefresh" Interval="300000" OnTick="TimmerRefresh_Tick"></asp:Timer>
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</asp:Panel>
|
||||
@@ -280,7 +280,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton Text="Surtir" ID="BtnSurtir" CommandArgument="-1" OnClick="BtnSurtir_Click" CssClass="btn btn-primary" runat="server" />
|
||||
<asp:LinkButton Text="Surtir" ID="BtnSurtir" CommandArgument="-1" OnClick="BtnSurtir_Click" CssClass="btn btn-primary input-sm" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Center" Width="20%" />
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -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
|
||||
@@ -811,10 +808,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
e.Row.FCLinkButton("BtnSurtir").CommandArgument = e.Row.DBCampo("CveCompra")
|
||||
|
||||
If e.Row.DBCampo("TipoDocto").ToString.Contiene({"Fac"}) And e.Row.DBCampo("EstatusAlmacen").ToString.ToEntero = 0 Then
|
||||
e.Row.FCLinkButton("BtnSurtir").CssClass = "btn btn-primary"
|
||||
e.Row.FCLinkButton("BtnSurtir").CssClass = "btn btn-primary input-sm"
|
||||
e.Row.FCLinkButton("BtnSurtir").Text = "<i class='fa fa-arrow-left' > Recibir</i>"
|
||||
Else
|
||||
e.Row.FCLinkButton("BtnSurtir").CssClass = "btn yellow-gold"
|
||||
e.Row.FCLinkButton("BtnSurtir").CssClass = "btn yellow-gold input-sm"
|
||||
e.Row.FCLinkButton("BtnSurtir").Text = " Devolver <i class='fa fa-arrow-right' ></i>"
|
||||
End If
|
||||
|
||||
@@ -933,6 +930,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
CveMoneda = ObjCompras.DtResultados.Rows(0)("CveMoneda").ToString.ToEntero
|
||||
lbDescripcion.Text = ObjCompras.DtResultados.Rows(0)("Descripcion").ToString
|
||||
HdnTipoDocto.Value = ObjCompras.DtResultados.Rows(0)("TipoDocto").ToString
|
||||
If UsuarioActual.CveEmpresa = 140 Then TxtObservaciones.Text = ObjCompras.DtResultados.Rows(0)("Descripcion").ToString
|
||||
|
||||
TipoCambio = ObjCompras.DtResultados.Rows(0)("TipoCambio").ToString.ToDecimal
|
||||
TipoMovimiento = If(ObjCompras.DtResultados.Rows(0)("EstatusAlmacen").ToString.ToEntero = 1, 2, 1)
|
||||
@@ -942,17 +940,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
If TipoMovimiento = 3 Then
|
||||
CargaAlmacenes(-1, "21,2", CveTipoCompra)
|
||||
End If
|
||||
|
||||
If CveTipoCompra = 9 Then
|
||||
ElseIf CveTipoCompra = 9 Then
|
||||
CargaAlmacenes(-1, "27", CveTipoCompra)
|
||||
End If
|
||||
|
||||
If CveTipoCompra = 10 Then
|
||||
ElseIf CveTipoCompra = 10 Then
|
||||
CargaAlmacenes(-1, CveTipoCompra:=CveTipoCompra)
|
||||
Else
|
||||
CargaAlmacenes(-1)
|
||||
End If
|
||||
|
||||
|
||||
RecibidaCompleta = False
|
||||
|
||||
|
||||
@@ -973,7 +968,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
SumarImporteUsados = True
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
CargaAlmacenes(-1, "22,24", CveTipoCompra)
|
||||
CargaAlmacenes(-1, "22", CveTipoCompra)
|
||||
Else
|
||||
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
|
||||
End If
|
||||
@@ -2251,7 +2246,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 +2702,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 +2717,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
|
||||
@@ -3362,8 +3363,11 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso <= 0 Then
|
||||
Msg.AppendFormat("Movimiento Registrado: Folio: <b>{0}</b>", link)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Individual</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Individual")))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Por Caja</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Caja")))
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Individual</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Individual")))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Por Caja</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Caja")))
|
||||
|
||||
End If
|
||||
'SI GENERO UN TRASPASO AL ALMACEN DE DEVOLUCION
|
||||
ElseIf CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso > 0 Then
|
||||
Msg.AppendFormat("Movimiento de Salida: Folio: <b>{0}</b>", String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoSalidaTraspaso, FolioSalidaTraspaso))
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
<asp:Label AssociatedControlID="TxtResponsable" ID="LblResponsable" runat="server" Text="Responsable:" CssClass="col-md-2"></asp:Label>
|
||||
<asp:Panel CssClass="col-md-2" ID="divResponsable" runat="server">
|
||||
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtResponsable" />
|
||||
<asp:TextBox runat="server" Text="" CssClass="form-control input-sm" ID="TxtResponsable" />
|
||||
</asp:Panel>
|
||||
|
||||
<label class="col-md-2">Almacen Transitorio:</label>
|
||||
@@ -204,13 +204,13 @@
|
||||
<div id="divPlacaEspecificacion" runat="server">
|
||||
<label class="col-md-2">Placa:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtPlaca" CssClass="form-control" />
|
||||
<asp:TextBox runat="server" Text="" ID="TxtPlaca" CssClass="form-control input-sm" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtPlaca" runat="server" Enabled="false" ControlToValidate="TxtPlaca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Placa''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceTxtPlaca" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtPlaca" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-2">Especificación de la Unidad:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtEspecifUnidad" CssClass="form-control" />
|
||||
<asp:TextBox runat="server" Text="" ID="TxtEspecifUnidad" CssClass="form-control input-sm" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtEspecifUnidad" runat="server" Enabled="false" ControlToValidate="TxtEspecifUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Especificación Unidad''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceTxtEspecifUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtEspecifUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
@@ -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,36 +869,37 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'VIRTUAL SALIDA
|
||||
If RealizarMovimientoVirtual Then
|
||||
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
|
||||
'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
|
||||
|
||||
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
|
||||
|
||||
|
||||
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)
|
||||
FolioVirtualSalida = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
|
||||
If dtvirtual.Rows.Count > 0 Then
|
||||
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)
|
||||
FolioVirtualSalida = ObjInventario.Folio
|
||||
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||
@@ -932,96 +939,96 @@ 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")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveSubProyectoOrigen).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
If dtvirtual.Rows.Count > 0 Then
|
||||
''hay que verificar que se se tengan movimeintos por registrar
|
||||
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")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
|
||||
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Dim Concepto As String = TxtObservaciones.Text
|
||||
If Concepto = "" Then Concepto = "Traspaso"
|
||||
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
|
||||
If Not ErrorMovInv Then
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
|
||||
'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
|
||||
Dim Contabilizable As Boolean = True
|
||||
|
||||
If IdCtaContableOrigen = IdCtaContableDestino And TipoAlmacenDestino <> 26 Then Contabilizable = False
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Dim Concepto As String = TxtObservaciones.Text
|
||||
If Concepto = "" Then Concepto = "Traspaso"
|
||||
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
|
||||
If Not ErrorMovInv Then
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero
|
||||
'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero
|
||||
Dim Contabilizable As Boolean = True
|
||||
'si el tipo de almacen de entrada es Almacen sin costo, se registra al costo, la salida.
|
||||
If TipoAlmacenOrigen <> 26 AndAlso TipoAlmacenDestino = 26 Then
|
||||
|
||||
If IdCtaContableOrigen = IdCtaContableDestino And TipoAlmacenDestino <> 26 Then Contabilizable = False
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
'si el tipo de almacen de entrada es Almacen sin costo, se registra al costo, la salida.
|
||||
If TipoAlmacenOrigen <> 26 AndAlso TipoAlmacenDestino = 26 Then
|
||||
|
||||
Dim tCveClasificacion As Integer = DtMovimientos.MAX("CveClasificacion").ToEntero
|
||||
Dim dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=tCveClasificacion).FiltroPrimero("")
|
||||
Dim IdCuentaCostos As Integer = -1
|
||||
If dr IsNot Nothing Then
|
||||
IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Contabilizable = False
|
||||
importe = 0
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Dim tCveClasificacion As Integer = DtMovimientos.MAX("CveClasificacion").ToEntero
|
||||
Dim dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=tCveClasificacion).FiltroPrimero("")
|
||||
Dim IdCuentaCostos As Integer = -1
|
||||
If dr IsNot Nothing Then
|
||||
IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
Contabilizable = False
|
||||
importe = 0
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If Not ErrorMovInv Then
|
||||
Dim Concepto As String = TxtObservaciones.Text
|
||||
If Concepto = "" Then Concepto = "Traspaso"
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen2", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
If Not ErrorMovInv Then
|
||||
Dim Concepto As String = TxtObservaciones.Text
|
||||
If Concepto = "" Then Concepto = "Traspaso"
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen2", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -1688,38 +1695,40 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
'VIRTUAL ENTRADA
|
||||
|
||||
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
|
||||
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/C2")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoSalida) Then
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoSalida) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
Dim CostoIndirecto As Decimal = RowVirtual("CostoIndirecto").ToString().ToDecimal()
|
||||
If dtvirtual.Rows.Count > 0 Then
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/C2")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
Dim CostoIndirecto As Decimal = RowVirtual("CostoIndirecto").ToString().ToDecimal()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TextoError = "No se pudo registrar el movimiento virtual"
|
||||
ErrorMovInv = True
|
||||
@@ -1840,8 +1849,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
|
||||
'AGREGAMOS LA SALIDA
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11")
|
||||
'CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
' Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11")
|
||||
|
||||
'AGREGAMOS LA ENTRADA
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
@@ -1882,12 +1891,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
End If
|
||||
'MOV, Alm, Transito
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
End If
|
||||
''MOV, Alm, Transito
|
||||
'If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
ElseIf cantidadDisponibleValidacion < 0 Then
|
||||
TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString)
|
||||
@@ -1898,21 +1907,21 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If Not ErrorMovInv Then
|
||||
Dim Concepto As String = TxtObservacionesRecepcion.Text
|
||||
If Concepto = "" Then Concepto = "Recepción Traspaso"
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
||||
' Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
' Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
' Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1921,34 +1930,31 @@ 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 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
|
||||
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S2")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
If dtvirtual.Rows.Count > 0 Then
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S2")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TextoError = "No se pudo registrar el movimiento virtual"
|
||||
ErrorMovInv = True
|
||||
@@ -2845,7 +2851,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
Dim excelFile As ExcelFile = excelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
@@ -2955,7 +2961,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Else
|
||||
Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto"))
|
||||
End If
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24) AND Estatus = 'Activo' {0} ", Str))
|
||||
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,27,28) AND Estatus = 'Activo' {0} ", Str))
|
||||
DdlAlmacenDestino.DataBind()
|
||||
DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -360,9 +360,9 @@
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkEnviarPolizaVirtual" Visible="false" OnClick="LnkEnviarPolizaVirtual_Click">Enviar Póliza Virtual</asp:LinkButton>
|
||||
</li>
|
||||
<%-- <li>
|
||||
<asp:LinkButton runat="server" ID="LnkDescargarFacturaPrueba" OnClick="LnkDescargarFacturaPrueba_Click">Descargar Factura Prueba</asp:LinkButton>
|
||||
</li>--%>
|
||||
<li>
|
||||
<asp:HyperLink ID="HlFacturasRelaciondas" Visible="false" NavigateUrl="#" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#DivFacturasRelaciondas" runat="server"><i class='fa fa-file'></i> Relacionar Facturas</asp:HyperLink>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="LnkImprimir" EventName="Click" />
|
||||
@@ -6029,6 +6029,59 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DivFacturasRelaciondas" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpFacturasRelacionadas" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Facturas Relacionadas</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="DivDdlFacturaRela" runat="server" class="row">
|
||||
<div class="col-md-2">
|
||||
<label>Factura:</label></div>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlFacturaARelacionar" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:LinkButton ID="LnkAgregarFacturaRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFacturaRelacionada_Click"><i class="fa fa-plus"></i>Agregar</asp:LinkButton></div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<label>Relación:</label></div>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoRelacionARelacionar" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="SATTipoRelacion" DataValueField="CveTipoRelacion">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvFacturasRelacionadas" runat="server" DataKeyNames="CveVenta,SerieFolio,FolioFiscal" GridLines="none" CssClass="tabla_correcto grides Widthall mysmallbtn" AutoGenerateColumns="False" ShowHeaderWhenEmpty="False">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Serie Folio" ReadOnly="true" DataField="SerieFolio" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField HeaderText="FolioFiscal" ReadOnly="true" DataField="FolioFiscal" ItemStyle-Width="70%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEliminarFacturaRelacionada" runat="server" AlternateText="Eliminar" CommandArgument='<%# Eval("CveVenta")%>' OnClick="LnkEliminarFacturaRelacionada_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el concepto?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarFacturasRelaciondas" runat="server" CssClass="btn btn-primary" Text="Asignar" OnClick="BtnAgregarFacturasRelaciondas_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="ModalFolioFiscal" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
@@ -6274,7 +6327,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:RadioButtonList ID="RblRNCTipo" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipo_SelectedIndexChanged" >
|
||||
<asp:RadioButtonList ID="RblRNCTipo" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipo_SelectedIndexChanged">
|
||||
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
|
||||
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>
|
||||
<asp:ListItem Value="3" Class="one"><label><b>Ajuste/Garantía</b></label></asp:ListItem>
|
||||
@@ -6287,7 +6340,8 @@
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase"><asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
|
||||
<span class="caption-subject bold uppercase">
|
||||
<asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -6314,7 +6368,7 @@
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkAplicar" runat="server"/>
|
||||
<asp:CheckBox ID="ChkAplicar" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
|
||||
@@ -8164,161 +8218,161 @@
|
||||
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
|
||||
} else {
|
||||
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
|
||||
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
|
||||
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
|
||||
} else {
|
||||
td = $('<td>' + item[key] + '</td>'); tr.append(td);
|
||||
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
|
||||
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
|
||||
} else {
|
||||
td = $('<td>' + item[key] + '</td>'); tr.append(td);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
indexd += 1;
|
||||
});
|
||||
}
|
||||
function CargaExistenciasSucursales(id, ps) {
|
||||
$.ajax({
|
||||
url: '/Ashx/SIGWeb.ashx?metodo=getpsalmacen&cveps=' + id,
|
||||
type: 'get',
|
||||
beforeSend: function () {
|
||||
console.log("procesando.....");
|
||||
},
|
||||
success: function (response) {
|
||||
var obj = JSON.parse(response);
|
||||
MostarTablaSucursales(obj, ps);
|
||||
}
|
||||
});
|
||||
}
|
||||
function MostarTablaSucursales(almacenes, ps) {
|
||||
var div = $('<div class="select2anothertable"></div>');
|
||||
|
||||
var table = $('<table style="width: 401px;"></table>');
|
||||
var tbody = $('<tbody></tbody>'); table.append(tbody);
|
||||
|
||||
//div.append(table);
|
||||
|
||||
var indexd = 0;
|
||||
almacenes.forEach(function (item) {
|
||||
if (indexd == 0) {
|
||||
var tr = $('<tr></tr>'); tbody.append(tr);
|
||||
var td1 = $('<th style="font-weight: bold; width: 347px; text-align: center;">Almacen</th>');
|
||||
var td2 = $('<th style="font-weight: bold; width: 181px; text-align: center;">Existencia</th>');
|
||||
tr.append(td1);
|
||||
tr.append(td2);
|
||||
}
|
||||
|
||||
var tr = $('<tr style="text-align: left;"></tr>'); tbody.append(tr);
|
||||
|
||||
for (var key in item) {
|
||||
if (!(key == "almacen" || key == "id")) {
|
||||
var td1 = $('<td style="width: 347px;">' + item["almacen"] + '</td>'); tr.append(td1);
|
||||
var td2 = $('<td style="font-weight: bold; width: 181px; text-align: center;"' + ((item["existencia"] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item["existencia"] + '</td>'); tr.append(td2);
|
||||
}
|
||||
}
|
||||
indexd += 1;
|
||||
});
|
||||
|
||||
if (almacenes.length > 0) {
|
||||
TbExistenciasPS.innerHTML = table.html();
|
||||
hPS.innerText = "Existencias: " + ps;
|
||||
$("#DivModalExistencias").modal("show");
|
||||
} else {
|
||||
alert("No hay existencias en otros almacenes");
|
||||
indexd += 1;
|
||||
});
|
||||
}
|
||||
function CargaExistenciasSucursales(id, ps) {
|
||||
$.ajax({
|
||||
url: '/Ashx/SIGWeb.ashx?metodo=getpsalmacen&cveps=' + id,
|
||||
type: 'get',
|
||||
beforeSend: function () {
|
||||
console.log("procesando.....");
|
||||
},
|
||||
success: function (response) {
|
||||
var obj = JSON.parse(response);
|
||||
MostarTablaSucursales(obj, ps);
|
||||
}
|
||||
});
|
||||
}
|
||||
function MostarTablaSucursales(almacenes, ps) {
|
||||
var div = $('<div class="select2anothertable"></div>');
|
||||
|
||||
}
|
||||
var table = $('<table style="width: 401px;"></table>');
|
||||
var tbody = $('<tbody></tbody>'); table.append(tbody);
|
||||
|
||||
function ADSReady() {
|
||||
//MakeSortable();
|
||||
}
|
||||
|
||||
var indices;
|
||||
var oldIndex;
|
||||
function MakeSortable() {
|
||||
$('#C_Tab_TabGenerales_GvPS').sortable({
|
||||
containerSelector: 'table',
|
||||
itemPath: '> tbody',
|
||||
itemSelector: 'tr',
|
||||
placeholder: '<tr class="placeholder"/>'
|
||||
});
|
||||
|
||||
// Sortable column heads
|
||||
$('#C_Tab_TabGenerales_GvPS tr').sortable({
|
||||
containerSelector: 'tr',
|
||||
itemSelector: 'th',
|
||||
placeholder: '<th class="placeholder"/>',
|
||||
vertical: false,
|
||||
onDragStart: function ($item, container, _super) {
|
||||
oldIndex = $item.index();
|
||||
$item.appendTo($item.parent());
|
||||
_super($item, container);
|
||||
},
|
||||
onDrop: function ($item, container, _super) {
|
||||
var field,
|
||||
newIndex = $item.index();
|
||||
|
||||
if (newIndex != oldIndex) {
|
||||
$item.closest('table').find('tbody tr').each(function (i, row) {
|
||||
row = $(row);
|
||||
if (newIndex < oldIndex) {
|
||||
row.children().eq(newIndex).before(row.children()[oldIndex]);
|
||||
} else if (newIndex > oldIndex) {
|
||||
row.children().eq(newIndex).after(row.children()[oldIndex]);
|
||||
}
|
||||
});
|
||||
//div.append(table);
|
||||
|
||||
var indexd = 0;
|
||||
almacenes.forEach(function (item) {
|
||||
if (indexd == 0) {
|
||||
var tr = $('<tr></tr>'); tbody.append(tr);
|
||||
var td1 = $('<th style="font-weight: bold; width: 347px; text-align: center;">Almacen</th>');
|
||||
var td2 = $('<th style="font-weight: bold; width: 181px; text-align: center;">Existencia</th>');
|
||||
tr.append(td1);
|
||||
tr.append(td2);
|
||||
}
|
||||
|
||||
_super($item, container);
|
||||
},
|
||||
var tr = $('<tr style="text-align: left;"></tr>'); tbody.append(tr);
|
||||
|
||||
for (var key in item) {
|
||||
if (!(key == "almacen" || key == "id")) {
|
||||
var td1 = $('<td style="width: 347px;">' + item["almacen"] + '</td>'); tr.append(td1);
|
||||
var td2 = $('<td style="font-weight: bold; width: 181px; text-align: center;"' + ((item["existencia"] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item["existencia"] + '</td>'); tr.append(td2);
|
||||
}
|
||||
}
|
||||
indexd += 1;
|
||||
});
|
||||
|
||||
});
|
||||
if (almacenes.length > 0) {
|
||||
TbExistenciasPS.innerHTML = table.html();
|
||||
hPS.innerText = "Existencias: " + ps;
|
||||
$("#DivModalExistencias").modal("show");
|
||||
} else {
|
||||
alert("No hay existencias en otros almacenes");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function CallFunc() {
|
||||
//var AR = $("#C_Tab_TabGenerales_GvPS").find("tr")
|
||||
//indices = ""
|
||||
//for (i = 1; i < AR.length; i++) {
|
||||
// indices = indices + AR[i].id + ";"
|
||||
//}
|
||||
//$("#HdnIndices").val(indices);
|
||||
//$("#BtnReordenar").click()
|
||||
}
|
||||
|
||||
function playsonidito(NomArchivo) {
|
||||
var URL = /Sonidos/ + NomArchivo
|
||||
var snd = new Audio(URL);
|
||||
snd.play();
|
||||
snd.currentTime = 0;
|
||||
}
|
||||
|
||||
function ConvertirDllsPesos() {
|
||||
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) * ToDouble($get('TxtTipoCambio').value), 2)
|
||||
$('#<%= LtlTotalConvertido.ClientID %>').text(totalPesos);
|
||||
$("#TrConversionPesosTexto").show();
|
||||
}
|
||||
|
||||
function ConvertirPesos(ChkConvertirDoctoPesos) {
|
||||
//LIMPIA
|
||||
$('#<%= LtlTotalConvertido.ClientID %>').text('');
|
||||
$("#TrConversionPesosTexto").hide();
|
||||
|
||||
//CALCULA
|
||||
if (ChkConvertirDoctoPesos.checked) {
|
||||
ConvertirDllsPesos();
|
||||
}
|
||||
}
|
||||
|
||||
function ConvertirPesosDlls() {
|
||||
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
|
||||
$('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
|
||||
$("#TrConversionDolaresTexto").show();
|
||||
}
|
||||
function ADSReady() {
|
||||
//MakeSortable();
|
||||
}
|
||||
|
||||
function ConvertirDolares(ChkConvertirDolares) {
|
||||
//LIMPIA
|
||||
$('#<%= LblDolaresConvertidos.ClientID %>').text('');
|
||||
var indices;
|
||||
var oldIndex;
|
||||
function MakeSortable() {
|
||||
$('#C_Tab_TabGenerales_GvPS').sortable({
|
||||
containerSelector: 'table',
|
||||
itemPath: '> tbody',
|
||||
itemSelector: 'tr',
|
||||
placeholder: '<tr class="placeholder"/>'
|
||||
});
|
||||
|
||||
// Sortable column heads
|
||||
$('#C_Tab_TabGenerales_GvPS tr').sortable({
|
||||
containerSelector: 'tr',
|
||||
itemSelector: 'th',
|
||||
placeholder: '<th class="placeholder"/>',
|
||||
vertical: false,
|
||||
onDragStart: function ($item, container, _super) {
|
||||
oldIndex = $item.index();
|
||||
$item.appendTo($item.parent());
|
||||
_super($item, container);
|
||||
},
|
||||
onDrop: function ($item, container, _super) {
|
||||
var field,
|
||||
newIndex = $item.index();
|
||||
|
||||
if (newIndex != oldIndex) {
|
||||
$item.closest('table').find('tbody tr').each(function (i, row) {
|
||||
row = $(row);
|
||||
if (newIndex < oldIndex) {
|
||||
row.children().eq(newIndex).before(row.children()[oldIndex]);
|
||||
} else if (newIndex > oldIndex) {
|
||||
row.children().eq(newIndex).after(row.children()[oldIndex]);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
_super($item, container);
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CallFunc() {
|
||||
//var AR = $("#C_Tab_TabGenerales_GvPS").find("tr")
|
||||
//indices = ""
|
||||
//for (i = 1; i < AR.length; i++) {
|
||||
// indices = indices + AR[i].id + ";"
|
||||
//}
|
||||
//$("#HdnIndices").val(indices);
|
||||
//$("#BtnReordenar").click()
|
||||
}
|
||||
|
||||
function playsonidito(NomArchivo) {
|
||||
var URL = /Sonidos/ + NomArchivo
|
||||
var snd = new Audio(URL);
|
||||
snd.play();
|
||||
snd.currentTime = 0;
|
||||
}
|
||||
|
||||
function ConvertirDllsPesos() {
|
||||
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) * ToDouble($get('TxtTipoCambio').value), 2)
|
||||
$('#<%= LtlTotalConvertido.ClientID %>').text(totalPesos);
|
||||
$("#TrConversionPesosTexto").show();
|
||||
}
|
||||
|
||||
function ConvertirPesos(ChkConvertirDoctoPesos) {
|
||||
//LIMPIA
|
||||
$('#<%= LtlTotalConvertido.ClientID %>').text('');
|
||||
$("#TrConversionPesosTexto").hide();
|
||||
|
||||
//CALCULA
|
||||
if (ChkConvertirDoctoPesos.checked) {
|
||||
ConvertirDllsPesos();
|
||||
}
|
||||
}
|
||||
|
||||
function ConvertirPesosDlls() {
|
||||
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
|
||||
$('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
|
||||
$("#TrConversionDolaresTexto").show();
|
||||
}
|
||||
|
||||
function ConvertirDolares(ChkConvertirDolares) {
|
||||
//LIMPIA
|
||||
$('#<%= LblDolaresConvertidos.ClientID %>').text('');
|
||||
$("#TrConversionDolaresTexto").hide();
|
||||
|
||||
//CALCULA
|
||||
@@ -8381,33 +8435,33 @@
|
||||
|
||||
function showDivEC() {
|
||||
$('#<%= TxtRFCCliente.ClientID %>').val('');
|
||||
$('#<%= TxtNombreCliente.ClientID %>').val('');
|
||||
$('#<%= TxtDireccionCliente.ClientID %>').val('');
|
||||
$('#<%= TxtNumExtCliente.ClientID %>').val('');
|
||||
$('#<%= TxtNumIntCliente.ClientID %>').val('');
|
||||
$('#<%= TxtCPCliente.ClientID %>').val('');
|
||||
$('#<%= TxtColoniaCliente.ClientID %>').val('');
|
||||
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
|
||||
$('#<%= TxtCiudadCliente.ClientID %>').val('');
|
||||
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
|
||||
$('#<%= DdlSATPais.ClientID %>').val('');
|
||||
$('#<%= DdlEstadoSAT.ClientID %>').val('');
|
||||
$('#<%= TxtCorreoCliente.ClientID %>').val('');
|
||||
$('#<%= TxtNombreCliente.ClientID %>').val('');
|
||||
$('#<%= TxtDireccionCliente.ClientID %>').val('');
|
||||
$('#<%= TxtNumExtCliente.ClientID %>').val('');
|
||||
$('#<%= TxtNumIntCliente.ClientID %>').val('');
|
||||
$('#<%= TxtCPCliente.ClientID %>').val('');
|
||||
$('#<%= TxtColoniaCliente.ClientID %>').val('');
|
||||
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
|
||||
$('#<%= TxtCiudadCliente.ClientID %>').val('');
|
||||
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
|
||||
$('#<%= DdlSATPais.ClientID %>').val('');
|
||||
$('#<%= DdlEstadoSAT.ClientID %>').val('');
|
||||
$('#<%= TxtCorreoCliente.ClientID %>').val('');
|
||||
|
||||
$('#divAgregarCliente').modal();
|
||||
}
|
||||
$('#divAgregarCliente').modal();
|
||||
}
|
||||
|
||||
function hideDivEC() {
|
||||
$('#divAgregarCliente').modal('hide');
|
||||
}
|
||||
function hideDivEC() {
|
||||
$('#divAgregarCliente').modal('hide');
|
||||
}
|
||||
|
||||
var ValidarRNC = false;
|
||||
function AplicarValidarRNC(Valor) {
|
||||
ValidarRNC = Valor;
|
||||
}
|
||||
function CompararNC() {
|
||||
if (ValidarRNC) {
|
||||
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
|
||||
var ValidarRNC = false;
|
||||
function AplicarValidarRNC(Valor) {
|
||||
ValidarRNC = Valor;
|
||||
}
|
||||
function CompararNC() {
|
||||
if (ValidarRNC) {
|
||||
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
|
||||
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
|
||||
|
||||
if (TotalRem == TotalNC) {
|
||||
@@ -8436,22 +8490,22 @@
|
||||
var verficaRNC = function () {
|
||||
var total = 0;
|
||||
if ('<%= UsuarioActual.CveEmpresa %>' == '140') {
|
||||
$(".ChkAplicaRNC > input").each(function () {
|
||||
if (this.checked) {
|
||||
total = total + 1;
|
||||
}
|
||||
if (total == 2) {
|
||||
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
|
||||
this.checked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(".ChkAplicaRNC > input").each(function () {
|
||||
if (this.checked) {
|
||||
total = total + 1;
|
||||
}
|
||||
if (total == 2) {
|
||||
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
|
||||
this.checked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function showDivAgregarSucursal() {
|
||||
function showDivAgregarSucursal() {
|
||||
|
||||
$('#<%= TxtNombreSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtNombreSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtDireccionSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtNumExtSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtNumIntSucursal.ClientID %>').val('');
|
||||
|
||||
@@ -1893,6 +1893,26 @@ Partial Class Ventas
|
||||
ViewState("AplicaRNCXDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property AplicaRelacionManual As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("AplicaRelacionManual"), "False", ViewState("AplicaRelacionManual")))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("AplicaRelacionManual") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TmpDTFacturasRelacionadas As DataTable
|
||||
Get
|
||||
If ViewState("TmpDTFacturasRelacionadas") IsNot Nothing Then
|
||||
Return CType(ViewState("TmpDTFacturasRelacionadas"), DataTable)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDTFacturasRelacionadas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -2055,7 +2075,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
|
||||
|
||||
@@ -2253,6 +2273,10 @@ Partial Class Ventas
|
||||
CargaOrdenProduccion()
|
||||
End If
|
||||
|
||||
'MUESTRA EL MODAL PARA PODER RELACIONAR FACTURAS
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
HlFacturasRelaciondas.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
'Carga Venta
|
||||
@@ -2260,6 +2284,9 @@ Partial Class Ventas
|
||||
ViewState("CveVenta") = Request("CveVenta")
|
||||
|
||||
If CargaVenta() Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
CargaRelacionadasPendientes()
|
||||
End If
|
||||
|
||||
'DdlSucursal.Enabled = False
|
||||
DdlSubProyectoDatos.Enabled = False
|
||||
@@ -2842,13 +2869,13 @@ Partial Class Ventas
|
||||
BloqueaClasificaciones()
|
||||
|
||||
'NO PERMITIR AGREGAR PS DESDE VENTAS EN ECONOLLANTAS
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
BtnModalAddPS.Enabled = False
|
||||
End If
|
||||
MostrarOpcioensPaqueteria()
|
||||
End Sub
|
||||
Private Sub BloqueaClasificaciones()
|
||||
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
DdlClasificacion.Enabled = False
|
||||
DdlUnidadMedida.Enabled = False
|
||||
End If
|
||||
@@ -4136,6 +4163,8 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
DdlTipoRelacionARelacionar.SelectedValueExist(DbRowVenta("CveTipoRelacion").ToString())
|
||||
|
||||
'contado 0, credito 1, terminal 2
|
||||
If DbRowVenta("CondicionesPago").ToString().ToEntero() = 1 Then
|
||||
RBLPago.SelectedValue = "1"
|
||||
@@ -5096,8 +5125,13 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Private Sub CargaTiposRelacion()
|
||||
DdlTiposRelacion.DataSource = GlobalDTVtaTiposRelacion
|
||||
DdlTipoRelacionARelacionar.DataSource = GlobalDTVtaTiposRelacion
|
||||
|
||||
DdlTiposRelacion.DataBind()
|
||||
DdlTipoRelacionARelacionar.DataBind()
|
||||
|
||||
DdlTiposRelacion.Items.Insert(0, New ListItem("-", "-1"))
|
||||
DdlTipoRelacionARelacionar.Items.Insert(0, New ListItem("-", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaFormaEntrega()
|
||||
TrFormaEntrega.Visible = True
|
||||
@@ -5141,40 +5175,44 @@ Partial Class Ventas
|
||||
|
||||
End Function
|
||||
Private Sub CargarAlmacenes()
|
||||
If UsuarioActual.Empresa.UsaInventarios Then
|
||||
If (CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot") AndAlso Not (UsuarioActual.Empresa.Funcionalidad(558) = "1" 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()
|
||||
@@ -5520,7 +5558,7 @@ Partial Class Ventas
|
||||
DdlSucursalCliente.DataBind()
|
||||
|
||||
'SI UTILIZA EL RFC GENERICO PERMITE FACTURAR SUCURSAL
|
||||
If (Not UsuarioActual.CveEmpresa.Contiene(141)) AndAlso (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then
|
||||
If (Not UsuarioActual.Empresa.Funcionalidad(558) = "1") AndAlso (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then
|
||||
HabilitarFacturacionSucursal()
|
||||
End If
|
||||
|
||||
@@ -5625,6 +5663,8 @@ Partial Class Ventas
|
||||
CargaPorcentajeMarcas()
|
||||
End If
|
||||
|
||||
CargaFacturasARelacionar()
|
||||
|
||||
UpFacturar.Update()
|
||||
UpEstatus.Update()
|
||||
UpPS.Update()
|
||||
@@ -5662,6 +5702,8 @@ Partial Class Ventas
|
||||
UpModalRemisionesNC.Update()
|
||||
End If
|
||||
|
||||
CargaFacturasARelacionar()
|
||||
|
||||
If RequiereOC Then
|
||||
Dim Documentacion As String = ""
|
||||
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
|
||||
@@ -5693,6 +5735,138 @@ Partial Class Ventas
|
||||
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaRelacionadasPendientes()
|
||||
|
||||
If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
|
||||
Me.TmpDTFacturasRelacionadas = New DataTable()
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("FolioFiscal", GetType(String)))
|
||||
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
'SI LA FACTURA NO SE TIMBRO QUE VUELVA A INTENTAR FACTURAR
|
||||
If LblSeTimbro.Text = "No" Then
|
||||
Me.AplicaRelacionManual = True
|
||||
End If
|
||||
|
||||
For Each RowRelacionada As DataRow In ObjVentas.DtResultados.Rows
|
||||
Dim Row As DataRow = TmpDTFacturasRelacionadas.NewRow()
|
||||
Row("CveVenta") = RowRelacionada("CveVentaRelacionada").ToString().ToEntero()
|
||||
Row("SerieFolio") = RowRelacionada("SerieFolio").ToString()
|
||||
Row("FolioFiscal") = RowRelacionada("FolioFiscal").ToString()
|
||||
|
||||
Me.TmpDTFacturasRelacionadas.Rows.Add(Row)
|
||||
Next
|
||||
End If
|
||||
End Using
|
||||
|
||||
DivDdlFacturaRela.Visible = False
|
||||
BtnAgregarFacturasRelaciondas.Visible = False
|
||||
DdlTipoRelacionARelacionar.Enabled = False
|
||||
|
||||
GvFacturasRelacionadas.Columns(2).Visible = False
|
||||
|
||||
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
|
||||
GvFacturasRelacionadas.DataBind()
|
||||
|
||||
UpFacturasRelacionadas.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaFacturasARelacionar()
|
||||
Using ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetHistorialVentas(Me.CveCliente, TipoDocto:="Ing") Then
|
||||
DdlFacturaARelacionar.DataSource = ObjClientes.DtResultados
|
||||
End If
|
||||
End Using
|
||||
DdlFacturaARelacionar.DataBind()
|
||||
|
||||
If Not DdlFacturaARelacionar.Items.Contains(New ListItem("Seleccione", "-1")) Then
|
||||
DdlFacturaARelacionar.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
UpFacturasRelacionadas.Update()
|
||||
End Sub
|
||||
Protected Sub CreaTmpFacturasRelacionadas()
|
||||
If CveVenta <= 0 Then
|
||||
Me.TmpDTFacturasRelacionadas = New DataTable()
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("CveVenta", GetType(Integer)))
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("SerieFolio", GetType(String)))
|
||||
Me.TmpDTFacturasRelacionadas.Columns.Add(New DataColumn("FolioFiscal", GetType(String)))
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LnkAgregarFacturaRelacionada_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta <= 0 Then
|
||||
If Me.TmpDTFacturasRelacionadas Is Nothing Then
|
||||
CreaTmpFacturasRelacionadas()
|
||||
End If
|
||||
|
||||
If TmpDTFacturasRelacionadas.COUNT("CveVenta", $"CveVenta ={DdlFacturaARelacionar.SelectedValue.ToEntero()}") > 0 Then
|
||||
Alert("La factura ya fue agregada", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Row As DataRow = TmpDTFacturasRelacionadas.NewRow()
|
||||
Row("CveVenta") = DdlFacturaARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Using ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(DdlFacturaARelacionar.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
Row("SerieFolio") = ObjVentas.DtResultados(0)("SerieFolio").ToString()
|
||||
Row("FolioFiscal") = ObjVentas.DtResultados(0)("FolioFiscal").ToString()
|
||||
End If
|
||||
End Using
|
||||
|
||||
Me.TmpDTFacturasRelacionadas.Rows.Add(Row)
|
||||
|
||||
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
|
||||
GvFacturasRelacionadas.DataBind()
|
||||
|
||||
UpFacturasRelacionadas.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnAgregarFacturasRelaciondas_Click(sender As Object, e As EventArgs)
|
||||
If CveVenta <= 0 Then
|
||||
If Me.TmpDTFacturasRelacionadas Is Nothing OrElse Me.TmpDTFacturasRelacionadas.Rows.Count = 0 Then
|
||||
Me.AplicaRelacionManual = False
|
||||
Alert("No hay facturas para relacionar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlTipoRelacionARelacionar.SelectedValue.ToEntero() <= 0 Then
|
||||
Me.AplicaRelacionManual = False
|
||||
Alert("Debe seleccionar un tipo de relación", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Me.AplicaRelacionManual = True
|
||||
RegistraScript("$('#DivFacturasRelaciondas').modal('hide');", "R1")
|
||||
Alert("Las facturas seleccionadas se relacionaran con la factura nueva")
|
||||
End If
|
||||
|
||||
UpFacturasRelacionadas.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminarFacturaRelacionada_Click(sender As Object, e As EventArgs)
|
||||
Dim lnkRemove As LinkButton = DirectCast(sender, LinkButton)
|
||||
|
||||
If Me.TmpDTFacturasRelacionadas.Rows.Count > 0 And lnkRemove.CommandArgument.ToString.Length > 0 Then
|
||||
Dim CveVenta As Integer = lnkRemove.CommandArgument.ToString.ToEntero
|
||||
Dim Drs As DataRow() = Me.TmpDTFacturasRelacionadas.Select(String.Format("CveVenta = {0}", CveVenta))
|
||||
If Drs.Count > 0 Then
|
||||
Drs(0).Delete()
|
||||
End If
|
||||
Me.TmpDTFacturasRelacionadas.AcceptChanges()
|
||||
End If
|
||||
|
||||
GvFacturasRelacionadas.EditIndex = -1
|
||||
|
||||
GvFacturasRelacionadas.DataSource = Me.TmpDTFacturasRelacionadas
|
||||
GvFacturasRelacionadas.DataBind()
|
||||
|
||||
UpFacturasRelacionadas.Update()
|
||||
End Sub
|
||||
Private Sub CargaRestriccionesCreditoCliente(Optional Alertas As Boolean = False, Optional CveVenta As Integer = -1)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1 Then
|
||||
@@ -5951,7 +6125,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SI EL CLIENTE TIENE RFC GENERICO Y LA SUCURSAL TIENE RFC DEBE FACTURAR LA SUCURSAL
|
||||
If (Not UsuarioActual.CveEmpresa.Contiene(141)) AndAlso LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then
|
||||
If (Not UsuarioActual.Empresa.Funcionalidad(558) = "1") AndAlso LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then
|
||||
Me.FacturarSucursal = True
|
||||
|
||||
LtlTitleRFCSucursal.Text = "RFC:"
|
||||
@@ -6110,7 +6284,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
Dim cvesubproyecto As String = DdlSubProyectoDatos.SelectedValue
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
cvesubproyecto = "-1"
|
||||
End If
|
||||
|
||||
@@ -6436,7 +6610,7 @@ Partial Class Ventas
|
||||
GvPS.DataSource = TmpDT
|
||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
GvPS.DataBind()
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlUnidadMedida").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlClasificacion").Enabled = False
|
||||
End If
|
||||
@@ -6457,7 +6631,7 @@ Partial Class Ventas
|
||||
ObjDescuento.ImporteDescuento = (GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal).RoundSQL(NumeroDecimales)
|
||||
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
|
||||
|
||||
If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then
|
||||
If PU <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -6820,7 +6994,7 @@ Partial Class Ventas
|
||||
'SI DEBE HACER SALIDA DIRECTA DE ALMACEN DEBE ESTAR SELECCIONADO SIEMPRE
|
||||
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
|
||||
e.Row.FCCheckBox("cbInv").Checked = True
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
End If
|
||||
End If
|
||||
@@ -6832,7 +7006,7 @@ Partial Class Ventas
|
||||
e.Row.FCCheckBox("cbInv").Visible = False
|
||||
End If
|
||||
|
||||
If (CveVenta > 0 AndAlso EsCreaApartirDe AndAlso UsuarioActual.CveEmpresa = 141) Then
|
||||
If (CveVenta > 0 AndAlso EsCreaApartirDe AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1") Then
|
||||
e.Row.FCCheckBox("cbInv").Visible = True
|
||||
End If
|
||||
|
||||
@@ -7983,7 +8157,7 @@ Partial Class Ventas
|
||||
If CveVenta > 0 Then MensajeAlert = New StringBuilder
|
||||
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
If Opcion = "Cot" And UsuarioActual.CveEmpresa = 141 Then
|
||||
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
|
||||
End If
|
||||
|
||||
@@ -9774,16 +9948,11 @@ Partial Class Ventas
|
||||
Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
|
||||
Timbre.Comprobante.Total = Obj.Total
|
||||
|
||||
'Try
|
||||
'Obj.SetSubProyecto(Me)
|
||||
Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||
If Timbre.Comprobante.LugarExpedicion = "" Then
|
||||
Dim aa As String = "no se guardo lugar de expedicion"
|
||||
aa.GuardaLog()
|
||||
End If
|
||||
'Catch ex As Exception
|
||||
|
||||
'End Try
|
||||
|
||||
Timbre.Comprobante.Confirmacion = ""
|
||||
|
||||
@@ -9866,6 +10035,26 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" AndAlso Me.AplicaRelacionManual AndAlso DdlTipoRelacionARelacionar.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Dim CveTipoRelacion As Integer = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Obj.CveTipoRelacion = DdlTipoRelacionARelacionar.SelectedValue.ToEntero()
|
||||
|
||||
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}")
|
||||
|
||||
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
|
||||
For Each GvRow As GridViewRow In GvFacturasRelacionadas.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
Timbre.CFDIRelacionados.UUID.Add(GvRow.DataKey("FolioFiscal").Replace("test", ""))
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
Dim totIVA As Decimal = Obj.IVA
|
||||
@@ -10461,7 +10650,18 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(592) = "1" AndAlso Me.AplicaRelacionManual Then
|
||||
For Each GvRow As GridViewRow In GvFacturasRelacionadas.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
If Not ObjVentas.AddVentasRelacionadas(ObjVentas.CveVenta, GvRow.DataKey("CveVenta").ToEntero()) Then
|
||||
ErrorList.Add("Ocurrió un error al relacionar las ventas entre si comuníquese a Soporte Técnico")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
'LO LIMPIA PARA QUE NO VUELVA A APLICAR
|
||||
Me.AplicaRelacionManual = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(280) = "1" And RblPaqueteria.SelectedValue = "1" And Not factura.TipoDocto.Contiene("Rem", "Ped") Then
|
||||
@@ -12414,7 +12614,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'EN ECONOLLANTAS DEBE REALIZAR SIEMPRE LA SALIDA DE ALMACEN
|
||||
If UsuarioActual.CveEmpresa = 141 AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
|
||||
For Each GvRow As GridViewRow In GvInv.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
GvRow.FCCheckBox("cbInv").Checked = True
|
||||
@@ -12593,7 +12793,7 @@ Partial Class Ventas
|
||||
|
||||
Dim DebeGenerarMovimiento As Boolean = TmpDT.COUNT("CvePS", "CveTipoPS = 2") > 0
|
||||
'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN
|
||||
If DebeGenerarMovimiento AndAlso UsuarioActual.CveEmpresa = 141 AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
|
||||
If DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
|
||||
If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
@@ -13355,7 +13555,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnAceptarAnticipos_Click(sender As Object, e As System.EventArgs) Handles BtnAceptarAnticipos.Click
|
||||
Anticipos()
|
||||
@@ -15675,7 +15875,7 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
If PU <= 0 AndAlso UsuarioActual.CveEmpresa = 141 Then
|
||||
If PU <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
@@ -17078,7 +17278,7 @@ Partial Class Ventas
|
||||
GvPS.DataBind()
|
||||
|
||||
'RECARGA GV INVENTARIO
|
||||
If (Not CveVenta > 0 Or DdlTipoComprobante.SelectedValue = "Cot") OrElse (UsuarioActual.CveEmpresa = 141 AndAlso EsCreaApartirDe) Then
|
||||
If (Not CveVenta > 0 Or DdlTipoComprobante.SelectedValue = "Cot") OrElse (UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso EsCreaApartirDe) Then
|
||||
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||
CargaGVInv(DtInv)
|
||||
End If
|
||||
@@ -18025,7 +18225,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
|
||||
@@ -18366,20 +18566,20 @@ Partial Class Ventas
|
||||
|
||||
|
||||
If Con.GetEstimacionesPorFacturar(-1, CveCliente, DdlContrato.SelectedValue.ToEntero(), 0, UsuarioActual.CveEmpresa) Then
|
||||
GvEst.DataSource = Con.DtResultados
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
'BtnEstimacion.Visible = True
|
||||
DdlContrato.Items.Clear()
|
||||
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlContrato.DataSource = Con.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
End If
|
||||
GvEst.DataSource = Con.DtResultados
|
||||
If Con.DtResultados.Rows.Count > 0 Then
|
||||
'BtnEstimacion.Visible = True
|
||||
DdlContrato.Items.Clear()
|
||||
DdlContrato.Items.Add(New ListItem("Todos", "-1"))
|
||||
DdlContrato.DataSource = Con.DtResultados.FiltraParametros("CveContrato > 0", "NumeroContrato", DistinctColumns:={"CveContrato", "NumeroContrato"})
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
UPEstimaciones.Update()
|
||||
Con.Dispose()
|
||||
DdlContrato.DataBind()
|
||||
GvEst.DataBind()
|
||||
UPEstimaciones.Update()
|
||||
Con.Dispose()
|
||||
DdlContrato.DataBind()
|
||||
GvEst.DataBind()
|
||||
|
||||
|
||||
|
||||
@@ -19592,7 +19792,7 @@ Partial Class Ventas
|
||||
Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0
|
||||
|
||||
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
|
||||
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
|
||||
If Not PermiteCredito AndAlso Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -19619,7 +19819,7 @@ Partial Class Ventas
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
|
||||
|
||||
If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
|
||||
@@ -20890,7 +21090,7 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
Else
|
||||
CancelarDocumento()
|
||||
CancelarDocumento()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -24019,11 +24219,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAplicaNuevaNC_Click(sender As Object, e As EventArgs) Handles BtnAplicaNuevaNC.Click
|
||||
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
|
||||
AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
|
||||
Else
|
||||
Alert("No ha seleccionado ninguna remisión de nota de crédito", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
|
||||
End Sub
|
||||
|
||||
Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
|
||||
@@ -27097,7 +27293,7 @@ Partial Class Ventas
|
||||
CargaAnticipos(CveCliente)
|
||||
CargaRestriccionesCreditoCliente(CveVenta:=-1)
|
||||
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
TabAlmacen.Visible = True
|
||||
DivAlmacen.Visible = True
|
||||
CargaGVInv(TmpDT.FiltraParametros("CveTipoPS = 2"))
|
||||
@@ -27160,7 +27356,7 @@ Partial Class Ventas
|
||||
Private Function ValidaFacturarCotizacion() As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
|
||||
|
||||
Dim AmortizacionNC As Decimal = 0
|
||||
@@ -28530,4 +28726,7 @@ Partial Class Ventas
|
||||
Public ImporteBonificacion As Decimal = 0
|
||||
Public IVABonificacion As Decimal = 0
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user