Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -485,7 +485,7 @@ Public Class ClsAcumuladores
|
|||||||
|
|
||||||
#Region " FOLIOS GARANTÍA "
|
#Region " FOLIOS GARANTÍA "
|
||||||
|
|
||||||
Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional TipoFolio As String = "-1", Optional Area As Integer = 1) As Boolean
|
Public Function FoliosGarantiaGet(CveFolioGarantia As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional TipoFolio As String = "-1", Optional Area As Integer = 1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
'Data = New DataTable
|
'Data = New DataTable
|
||||||
|
|
||||||
@@ -495,6 +495,7 @@ Public Class ClsAcumuladores
|
|||||||
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
|
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
|
||||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||||
.Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio
|
.Add("@tipoFolio", SqlDbType.VarChar).Value = TipoFolio
|
||||||
.Add("@Area", SqlDbType.Int).Value = Area
|
.Add("@Area", SqlDbType.Int).Value = Area
|
||||||
End With
|
End With
|
||||||
|
|||||||
@@ -1029,6 +1029,24 @@ Public Class ClsClientes
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function GetListaSucursales(RFC As String, CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_ClientesSucursalesGet")
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@RFC", SqlDbType.VarChar).Value = RFC
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el las Sucursales del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
'Public Function GetEstados(Optional ClaveSATPais As String = "-1") As Boolean
|
'Public Function GetEstados(Optional ClaveSATPais As String = "-1") As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
|
|||||||
@@ -5444,13 +5444,13 @@ Public Class ClsPaginas
|
|||||||
''' <param name="NombreArchivo">Opcional Nombre del archivo que se descarga</param>
|
''' <param name="NombreArchivo">Opcional Nombre del archivo que se descarga</param>
|
||||||
''' <param name="Formato">Optional, Formato de Generacion PDF o Excel</param>
|
''' <param name="Formato">Optional, Formato de Generacion PDF o Excel</param>
|
||||||
''' <remarks></remarks>
|
''' <remarks></remarks>
|
||||||
Public Sub ImprimirPDF(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing)
|
Public Sub ImprimirPDF(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing, Optional Content_Disposition As String = "attachment")
|
||||||
Dim lrds As New List(Of ReportDataSource)
|
Dim lrds As New List(Of ReportDataSource)
|
||||||
Dim rds As New ReportDataSource
|
Dim rds As New ReportDataSource
|
||||||
rds.Name = RDSName
|
rds.Name = RDSName
|
||||||
rds.Value = DtDatos
|
rds.Value = DtDatos
|
||||||
lrds.Add(rds)
|
lrds.Add(rds)
|
||||||
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR)
|
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR, Content_Disposition)
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub ImprimirPDFMultiDS(RutaReporte As String, lrds As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing)
|
Public Sub ImprimirPDFMultiDS(RutaReporte As String, lrds As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing)
|
||||||
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR)
|
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR)
|
||||||
@@ -5465,9 +5465,9 @@ Public Class ClsPaginas
|
|||||||
''' <param name="NombreArchivo">Opcional Nombre del archivo que se descarga</param>
|
''' <param name="NombreArchivo">Opcional Nombre del archivo que se descarga</param>
|
||||||
''' <param name="Formato">Optional, Formato de Generacion PDF o Excel</param>
|
''' <param name="Formato">Optional, Formato de Generacion PDF o Excel</param>
|
||||||
''' <remarks></remarks>
|
''' <remarks></remarks>
|
||||||
Public Sub ImprimirPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing)
|
Public Sub ImprimirPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing, Optional Content_Disposition As String = "attachment")
|
||||||
'limpio ReportViwer
|
'limpio ReportViwer
|
||||||
ImprimirbytesPDF(StreamPDF(RutaReporte, DataSource, Parametros, NombreArchivo, Formato, MR), NombreArchivo, Formato)
|
ImprimirbytesPDF(StreamPDF(RutaReporte, DataSource, Parametros, NombreArchivo, Formato, MR), NombreArchivo, Formato, Content_Disposition:=Content_Disposition)
|
||||||
End Sub
|
End Sub
|
||||||
Public Function StreamPDF(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing) As Byte()
|
Public Function StreamPDF(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing) As Byte()
|
||||||
Dim lrds As New List(Of ReportDataSource)
|
Dim lrds As New List(Of ReportDataSource)
|
||||||
@@ -5857,7 +5857,7 @@ Public Class ClsPaginas
|
|||||||
''' <param name="NombreArchivo"></param>
|
''' <param name="NombreArchivo"></param>
|
||||||
''' <param name="Formato"></param>
|
''' <param name="Formato"></param>
|
||||||
''' <remarks></remarks>
|
''' <remarks></remarks>
|
||||||
Public Sub ImprimirbytesPDF(bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False)
|
Public Sub ImprimirbytesPDF(bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False, Optional Content_Disposition As String = "attachment")
|
||||||
'limpio ReportViwer
|
'limpio ReportViwer
|
||||||
Dim mimeType As String = Nothing
|
Dim mimeType As String = Nothing
|
||||||
Dim extension As String = Nothing
|
Dim extension As String = Nothing
|
||||||
@@ -5880,7 +5880,7 @@ Public Class ClsPaginas
|
|||||||
Response.Buffer = True
|
Response.Buffer = True
|
||||||
Response.Clear()
|
Response.Clear()
|
||||||
Response.ContentType = mimeType
|
Response.ContentType = mimeType
|
||||||
Response.AddHeader("content-disposition", String.Format("attachment; filename={0}.{1}", NombreArchivo, If(Formato = "PDF", "pdf", "xls")))
|
Response.AddHeader("content-disposition", String.Format("{0}; filename={1}.{2}", Content_Disposition, NombreArchivo, If(Formato = "PDF", "pdf", "xls")))
|
||||||
Response.BinaryWrite(bytes) ' create the file
|
Response.BinaryWrite(bytes) ' create the file
|
||||||
Response.Flush() ' send it to the client to download
|
Response.Flush() ' send it to the client to download
|
||||||
HttpContext.Current.Response.SuppressContent = True
|
HttpContext.Current.Response.SuppressContent = True
|
||||||
@@ -6624,6 +6624,13 @@ Public Class ClsPaginas
|
|||||||
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
||||||
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
||||||
End If
|
End If
|
||||||
|
If Vta.CveEmpresaCRM.ToEntero > 0 Then
|
||||||
|
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
|
||||||
|
params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre))
|
||||||
|
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
|
||||||
|
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
|
||||||
|
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
|
||||||
|
End If
|
||||||
|
|
||||||
'TOTALES
|
'TOTALES
|
||||||
params.Add(New ReportParameter("SubTotal", Vta.SubTotal.ToString.FormatoNumero(2)))
|
params.Add(New ReportParameter("SubTotal", Vta.SubTotal.ToString.FormatoNumero(2)))
|
||||||
|
|||||||
@@ -969,24 +969,24 @@ Namespace Extensiones
|
|||||||
|
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Function RoundAD(Valor As Double, Optional Decimales As Integer = 2) As Double
|
Public Function RoundAD(Valor As Double, Optional Decimales As Integer = 2) As Double
|
||||||
Return Math.Round(Valor, Decimales)
|
Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
|
||||||
End Function
|
End Function
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Function RoundAD(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal
|
Public Function RoundAD(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal
|
||||||
Return Math.Round(Valor, Decimales)
|
Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Function RoundSQL(Valor As Double, Optional Decimales As Integer = 2) As Double
|
Public Function RoundSQL(Valor As Double, Optional Decimales As Integer = 2) As Double
|
||||||
'Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
|
'Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
|
||||||
'primero, se redondea a 4, para que concuerde al redondeo de sql, si se redondea a 2 decimales por ejemplo
|
'primero, se redondea a 4, para que concuerde al redondeo de sql, si se redondea a 2 decimales por ejemplo
|
||||||
Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero))
|
Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Function RoundSQL(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal
|
Public Function RoundSQL(Valor As Decimal, Optional Decimales As Integer = 2) As Decimal
|
||||||
'primero, se redondea a 4, para que concuerde al redondeo de sql
|
'primero, se redondea a 4, para que concuerde al redondeo de sql
|
||||||
Return If(Decimales < 4, Math.Round(Math.Round(Valor, 4, MidpointRounding.AwayFromZero), Decimales, MidpointRounding.AwayFromZero), Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero))
|
Return Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)
|
||||||
End Function
|
End Function
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Function Abs(Valor As Double) As Double
|
Public Function Abs(Valor As Double) As Double
|
||||||
|
|||||||
315
Ashx/E141.ashx
315
Ashx/E141.ashx
@@ -4,6 +4,7 @@ Option Strict On
|
|||||||
Option Explicit On
|
Option Explicit On
|
||||||
|
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
|
Imports System.IO
|
||||||
Imports System.Net.Http
|
Imports System.Net.Http
|
||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
@@ -66,6 +67,42 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
#Region "GLOBAL DT"
|
||||||
|
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
|
||||||
|
Get
|
||||||
|
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
|
||||||
|
'sino existe, recarga los datos
|
||||||
|
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
|
||||||
|
Dim P As New ClsSubProyectos
|
||||||
|
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
|
||||||
|
P.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
|
||||||
|
Dim StrSQL As New StringBuilder
|
||||||
|
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
|
||||||
|
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
|
||||||
|
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
|
||||||
|
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
|
||||||
|
|
||||||
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
|
||||||
|
GlobalDTSubProyectos = Dv.ToTable
|
||||||
|
Dv.Dispose()
|
||||||
|
|
||||||
|
Else
|
||||||
|
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(ByVal value As DataTable)
|
||||||
|
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
|
||||||
|
HttpContext.Current.Application(AppNombre) = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||||
Dim retorno As String = ""
|
Dim retorno As String = ""
|
||||||
Try
|
Try
|
||||||
@@ -88,7 +125,56 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
|
|
||||||
Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString())
|
Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString())
|
||||||
retorno = GetExistencia(context, Codigo)
|
retorno = GetExistencia(context, Codigo)
|
||||||
|
ElseIf Metodo = "ConsultarRFC" Then
|
||||||
|
context.Response.ContentType = "application/json"
|
||||||
|
Dim Auth = ValidarSolicitud(context)
|
||||||
|
|
||||||
|
If Auth.IsSucces Then
|
||||||
|
retorno = ConsultaRFC(context)
|
||||||
|
Else
|
||||||
|
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf Metodo = "ValidarCarrito" Then
|
||||||
|
context.Response.ContentType = "application/json"
|
||||||
|
Dim Auth = ValidarSolicitud(context)
|
||||||
|
|
||||||
|
If Auth.IsSucces Then
|
||||||
|
retorno = ValidarCarrito(context)
|
||||||
|
Else
|
||||||
|
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf Metodo = "RegistrarPedido" Then
|
||||||
|
context.Response.ContentType = "application/json"
|
||||||
|
Dim Auth = ValidarSolicitud(context)
|
||||||
|
|
||||||
|
If Auth.IsSucces Then
|
||||||
|
retorno = RegistrarPedido(context)
|
||||||
|
Else
|
||||||
|
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf Metodo = "RegistrarCotizacion" Then
|
||||||
|
context.Response.ContentType = "application/json"
|
||||||
|
Dim Auth = ValidarSolicitud(context)
|
||||||
|
|
||||||
|
If Auth.IsSucces Then
|
||||||
|
retorno = RegistrarCotizacion(context)
|
||||||
|
Else
|
||||||
|
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf Metodo = "GetSucursales" Then
|
||||||
|
context.Response.ContentType = "application/json"
|
||||||
|
Dim Auth = ValidarSolicitud(context)
|
||||||
|
|
||||||
|
If Auth.IsSucces Then
|
||||||
|
retorno = GetSucursales(context)
|
||||||
|
Else
|
||||||
|
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
|
||||||
|
End If
|
||||||
|
context.Response.StatusCode = Auth.StatusCode
|
||||||
Else
|
Else
|
||||||
context.Response.ContentType = "text/html"
|
context.Response.ContentType = "text/html"
|
||||||
|
|
||||||
@@ -132,11 +218,219 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function ValidarSolicitud(ByVal context As HttpContext) As AuthMessage
|
||||||
|
Dim unauthorized As Boolean = True
|
||||||
|
Dim respuesta As New AuthMessage
|
||||||
|
|
||||||
|
Dim authHeader = context.Request.Headers("Authorization")
|
||||||
|
If authHeader IsNot Nothing Then
|
||||||
|
Dim basicAuth As String = authHeader.Replace("Basic ", "")
|
||||||
|
|
||||||
|
Dim usernamePasswordArray = Encoding.UTF8.GetString(Convert.FromBase64String(basicAuth)).Split(":"c)
|
||||||
|
|
||||||
|
Dim userName = usernamePasswordArray(0)
|
||||||
|
Dim password = usernamePasswordArray(1)
|
||||||
|
unauthorized = Not (userName = Me.UsuarioWSE141 AndAlso password = Me.PasswordWSE141)
|
||||||
|
|
||||||
|
Else
|
||||||
|
respuesta.ErrorMessage = New FidelityAppsResponseError() With {.message = "el usuario y/o contraseña son requeridos"}
|
||||||
|
respuesta.IsSucces = False
|
||||||
|
respuesta.StatusCode = 401
|
||||||
|
|
||||||
|
Return respuesta
|
||||||
|
End If
|
||||||
|
|
||||||
|
If unauthorized Then
|
||||||
|
respuesta.ErrorMessage = New FidelityAppsResponseError() With {.message = "el usuario y/o contraseña no son validos"}
|
||||||
|
respuesta.IsSucces = False
|
||||||
|
respuesta.StatusCode = 401
|
||||||
|
|
||||||
|
Return respuesta
|
||||||
|
Else
|
||||||
|
respuesta.ErrorMessage = Nothing
|
||||||
|
respuesta.IsSucces = True
|
||||||
|
respuesta.StatusCode = 200
|
||||||
|
|
||||||
|
Return respuesta
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function ConsultaRFC(ByVal context As HttpContext) As String
|
||||||
|
Dim Respuesta As New FidelityAppsResponse
|
||||||
|
Dim RespuestaError As New FidelityAppsResponseError
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
Dim JsonRequest As JObject = Nothing
|
||||||
|
|
||||||
|
If context.Request.InputStream IsNot Nothing Then
|
||||||
|
Using reader As New StreamReader(context.Request.InputStream)
|
||||||
|
Dim json = reader.ReadToEnd
|
||||||
|
|
||||||
|
If Not String.IsNullOrEmpty(json) Then
|
||||||
|
JsonRequest = JObject.Parse(json)
|
||||||
|
If JsonRequest Is Nothing Then
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Using
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not TieneError AndAlso Not String.IsNullOrEmpty(JsonRequest("rfc").ToString().Trim()) Then
|
||||||
|
|
||||||
|
Dim data As New JArray
|
||||||
|
Dim Nombre As String = "-1"
|
||||||
|
Dim Codigo As String = "-1"
|
||||||
|
Dim NombreCorto As String = "-1"
|
||||||
|
Dim RFC As String = JsonRequest("rfc").ToString()
|
||||||
|
Dim Telefono As String = "-1"
|
||||||
|
Dim Mail As String = "-1"
|
||||||
|
|
||||||
|
Dim DtSucursales As DataTable = Nothing
|
||||||
|
|
||||||
|
Using ObjClientes As New ClsClientes
|
||||||
|
If ObjClientes.GetListaSucursales(RFC, CveEmpresa) Then
|
||||||
|
DtSucursales = ObjClientes.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtSucursales IsNot Nothing Then
|
||||||
|
Try
|
||||||
|
For Each Row As DataRow In DtSucursales.Rows
|
||||||
|
Dim objSucursal As New JObject(
|
||||||
|
New JProperty("Id", Row("CveCliente")),
|
||||||
|
New JProperty("rfc", Row("RFC")),
|
||||||
|
New JProperty("name", Row("SucursalCliente")),
|
||||||
|
New JProperty("phone", Row("Telefono")),
|
||||||
|
New JProperty("email", Row("Correo")),
|
||||||
|
New JProperty("address", Row("Direccion")),
|
||||||
|
New JProperty("int_number", Row("NoInt")),
|
||||||
|
New JProperty("ext_number", Row("NoExt")),
|
||||||
|
New JProperty("street", Row("Direccion")),
|
||||||
|
New JProperty("between_streets", ""),
|
||||||
|
New JProperty("city", Row("Localidad")),
|
||||||
|
New JProperty("state", Row("Estado")),
|
||||||
|
New JProperty("zip_code", Row("CP")),
|
||||||
|
New JProperty("reference", ""),
|
||||||
|
New JProperty("Branch_office_code", ""),
|
||||||
|
New JProperty("Branch_office_name", ""),
|
||||||
|
New JProperty("Branch_office_id", "")
|
||||||
|
)
|
||||||
|
data.Add(objSucursal)
|
||||||
|
Next
|
||||||
|
Catch ex As Exception
|
||||||
|
TieneError = True
|
||||||
|
RespuestaError.message = "Ocurrió un error al obtener la sucursales"
|
||||||
|
End Try
|
||||||
|
DtSucursales.Dispose()
|
||||||
|
Else
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If data.Count > 0 Then
|
||||||
|
Respuesta.data = data
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
Else
|
||||||
|
Return JsonConvert.SerializeObject(Respuesta)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function ValidarCarrito(ByVal context As HttpContext) As String
|
||||||
|
Dim Respuesta As New FidelityAppsResponse
|
||||||
|
Dim RespuestaError As New FidelityAppsResponseError
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
Else
|
||||||
|
Return JsonConvert.SerializeObject(Respuesta)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function RegistrarPedido(ByVal context As HttpContext) As String
|
||||||
|
Dim Respuesta As New FidelityAppsResponse
|
||||||
|
Dim RespuestaError As New FidelityAppsResponseError
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
Else
|
||||||
|
Return JsonConvert.SerializeObject(Respuesta)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function RegistrarCotizacion(ByVal context As HttpContext) As String
|
||||||
|
Dim Respuesta As New FidelityAppsResponse
|
||||||
|
Dim RespuestaError As New FidelityAppsResponseError
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
Else
|
||||||
|
Return JsonConvert.SerializeObject(Respuesta)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function GetSucursales(ByVal context As HttpContext) As String
|
||||||
|
Dim Respuesta As New FidelityAppsResponse
|
||||||
|
Dim RespuestaError As New FidelityAppsResponseError
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
Dim data As New JArray
|
||||||
|
|
||||||
|
Dim DtSucursales As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltraParametros("EsSucursal = True")
|
||||||
|
If DtSucursales IsNot Nothing Then
|
||||||
|
Try
|
||||||
|
For Each Row As DataRow In DtSucursales.Rows
|
||||||
|
Dim objSucursal As New JObject(
|
||||||
|
New JProperty("code", Row("CveSubProyecto")),
|
||||||
|
New JProperty("name", Row("SubProyecto")),
|
||||||
|
New JProperty("street", Row("Calle")),
|
||||||
|
New JProperty("no_ext", Row("NoExt")),
|
||||||
|
New JProperty("no_int", Row("NoInt")),
|
||||||
|
New JProperty("zip", Row("CP")),
|
||||||
|
New JProperty("neighborhood", Row("Colonia")),
|
||||||
|
New JProperty("city", Row("Municipio")),
|
||||||
|
New JProperty("phone", Row("Telefono")),
|
||||||
|
New JProperty("email", Row("Correo")),
|
||||||
|
New JProperty("geo_lat", ""),
|
||||||
|
New JProperty("geo_lng", ""),
|
||||||
|
New JProperty("image", "")
|
||||||
|
)
|
||||||
|
data.Add(objSucursal)
|
||||||
|
Next
|
||||||
|
Catch ex As Exception
|
||||||
|
TieneError = True
|
||||||
|
RespuestaError.message = "Ocurrió un error al obtener la sucursales"
|
||||||
|
End Try
|
||||||
|
DtSucursales.Dispose()
|
||||||
|
Else
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If data.Count > 0 Then
|
||||||
|
Respuesta.data = data
|
||||||
|
End If
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
Return JsonConvert.SerializeObject(RespuestaError)
|
||||||
|
Else
|
||||||
|
Return JsonConvert.SerializeObject(Respuesta)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function GetExistencia(ByVal context As HttpContext, Codigo As String) As String
|
Private Function GetExistencia(ByVal context As HttpContext, Codigo As String) As String
|
||||||
Dim respuesta = New With {.isSuccess = False, .message = "", .products = New JArray}
|
Dim respuesta = New With {.isSuccess = False, .message = "", .products = New JArray}
|
||||||
If String.IsNullOrEmpty(Codigo) OrElse Codigo = "-1" Then
|
If String.IsNullOrEmpty(Codigo) OrElse Codigo = "-1" Then
|
||||||
respuesta.message = "el parametro 'Sku' es invalido"
|
respuesta.message = "el parametro 'Sku' es invalido"
|
||||||
respuesta.isSuccess = False
|
Respuesta.isSuccess = False
|
||||||
|
|
||||||
Return JsonConvert.SerializeObject(respuesta)
|
Return JsonConvert.SerializeObject(respuesta)
|
||||||
End If
|
End If
|
||||||
@@ -735,4 +1029,23 @@ Public Class E141 : Implements IHttpHandler
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Class FidelityAppsResponse
|
||||||
|
Public Property status As String
|
||||||
|
Public Property data As Object
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Private Class FidelityAppsResponseError
|
||||||
|
Sub New()
|
||||||
|
status = "error"
|
||||||
|
End Sub
|
||||||
|
Public Property status As String
|
||||||
|
Public Property message As String
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Private Class AuthMessage
|
||||||
|
Public Property IsSucces As Boolean
|
||||||
|
Public Property ErrorMessage As FidelityAppsResponseError
|
||||||
|
Public Property StatusCode As Integer
|
||||||
|
End Class
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -114,9 +114,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
|
|||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
UsaComplementaria = false;
|
UsaComplementaria = true;
|
||||||
CveMonedaCuentaPago = 0;
|
CveMonedaCuentaPago = 0;
|
||||||
if (UsuarioActual.CveEmpresa.Contiene(1, 119)) { UsaComplementaria = true; }
|
|
||||||
rowComisiones.Visible = UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122);
|
rowComisiones.Visible = UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 126, 119, 122);
|
||||||
|
|
||||||
CargaTipoTransaccion();
|
CargaTipoTransaccion();
|
||||||
|
|||||||
@@ -4696,7 +4696,7 @@ Partial Class PopUpVerFactura
|
|||||||
params.Add(New ReportParameter("LogoPath", ""))
|
params.Add(New ReportParameter("LogoPath", ""))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
|
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF", Content_Disposition:="inline")
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim UsaSimplificacionCajaChica As Boolean = False
|
Dim UsaSimplificacionCajaChica As Boolean = False
|
||||||
If UsuarioActual.CveEmpresa = 119 Then UsaSimplificacionCajaChica = True
|
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaSimplificacionCajaChica = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -446,7 +446,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
|||||||
CveIERegistrado = DDlCheques.SelectedValue.ToEntero
|
CveIERegistrado = DDlCheques.SelectedValue.ToEntero
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(119) Then
|
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then
|
||||||
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones1", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones1", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
If CveCajaChica > 0 Then
|
If CveCajaChica > 0 Then
|
||||||
@@ -710,7 +710,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
|||||||
|
|
||||||
If gvr.DataKey("Original").ToDecimal > 0 Then PorcentajePago = (ImporteMovto / gvr.DataKey("Original").ToDecimal) Else PorcentajePago = 1
|
If gvr.DataKey("Original").ToDecimal > 0 Then PorcentajePago = (ImporteMovto / gvr.DataKey("Original").ToDecimal) Else PorcentajePago = 1
|
||||||
|
|
||||||
If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119)) Then
|
If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119, 158)) Then
|
||||||
'Si es caja chica metemos el concepto 30, si es funcionario metemos 29
|
'Si es caja chica metemos el concepto 30, si es funcionario metemos 29
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then
|
||||||
MsgError = "Detalle"
|
MsgError = "Detalle"
|
||||||
|
|||||||
@@ -693,7 +693,7 @@ Partial Class Contratos_Default
|
|||||||
CargaConvenioPrecioFijo()
|
CargaConvenioPrecioFijo()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 72 And DdlTipoContrato.SelectedValue.Contiene("7", "8", "10", "13", "28") Then
|
If UsuarioActual.CveEmpresa = 72 And DdlTipoContrato.SelectedValue.Contiene("7", "8", "9", "10", "13", "28") Then
|
||||||
GetNoContratoNuevo()
|
GetNoContratoNuevo()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -84,16 +84,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<asp:GridView ID="GVGeoreferencias" runat="server" GridLines="None" data-height="200" DataKeyNames="Coordenadas,CveGeoReferencia,GeoReferencia, CveDispositivo,Tipo,Color,Estatus,FechaInicio,FechaFin,AplicaLunes,AplicaMartes,AplicaMiercoles,AplicaJueves,AplicaViernes,AplicaSabado,AplicaDomingo, HoraInicio, HoraFin, Tolerancia" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
<asp:GridView ID="GVGeoreferencias" runat="server" PageSize="300" GridLines="None" data-height="200" DataKeyNames="Coordenadas,CveGeoReferencia,GeoReferencia, CveDispositivo,Tipo,Color,Estatus,FechaInicio,FechaFin,AplicaLunes,AplicaMartes,AplicaMiercoles,AplicaJueves,AplicaViernes,AplicaSabado,AplicaDomingo, HoraInicio, HoraFin, Tolerancia" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:CheckBox runat="server" ID="chkGR" />
|
<asp:CheckBox runat="server" ID="chkGR" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField DataField="Tipo" ItemStyle-Width="20%" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="Tipo" ItemStyle-Width="10%" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="20%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="50%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:TemplateField HeaderText="Color" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Color" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgColor" HeaderText="Color" runat="server" Style="height: 20px;" Enabled="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" />
|
<asp:LinkButton ID="imgColor" HeaderText="Color" runat="server" Style="height: 20px;" Enabled="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
@@ -115,6 +115,16 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
<div id="DivPaginacion" runat="server" visible="false" class="row">
|
||||||
|
<div class="col-md-8">
|
||||||
|
<asp:Label ID="LblRegistros" runat="server" Style="display: inline-block;"></asp:Label>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4" style="display: inline-block; position: relative; text-align:end">
|
||||||
|
<asp:HiddenField ID="HdnIndexPage" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
|
<asp:LinkButton ID="btnPagePrev" runat="server" Style="vertical-align: top;" Text="<i class='fa fa-angle-left' style='font-size:24px' aria-hidden='true'></i> Anterior" OnClick="btnPagePrev_Click" Enabled="false" />
|
||||||
|
<asp:LinkButton ID="btnPageNext" runat="server" Style="vertical-align: top;" Text="Siguiente <i class='fa fa-angle-right' aria-hidden='true' style='font-size:24px'></i>" OnClick="btnPageNext_Click" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<asp:UpdatePanel runat="server" ID="UpUp" UpdateMode="Conditional">
|
<asp:UpdatePanel runat="server" ID="UpUp" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="form-group form-md-line-input input-iconright v-center">
|
<div class="form-group form-md-line-input input-iconright v-center">
|
||||||
@@ -190,24 +200,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||||
<li>Fecha I.:
|
<li>Fecha I.:
|
||||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
|
||||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||||
<span class="input-group-btn ">
|
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<span class="input-group-btn ">
|
||||||
</span>
|
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
</div>
|
</span>
|
||||||
|
</div>
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
</li>
|
</li>
|
||||||
<li>Fecha F.:
|
<li>Fecha F.:
|
||||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
|
||||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||||
<span class="input-group-btn ">
|
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<span class="input-group-btn ">
|
||||||
</span>
|
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
</div>
|
</span>
|
||||||
|
</div>
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ Partial Class GPS_RepGeoReferencias
|
|||||||
ViewState("CveGeoReferencia") = value
|
ViewState("CveGeoReferencia") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Private Property DtGeoReferencias As DataTable
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("DtGeoReferencias"), DataTable)
|
||||||
|
End Get
|
||||||
|
Set(value As DataTable)
|
||||||
|
ViewState("DtGeoReferencias") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Private Property DtPosiciones As DataTable
|
Private Property DtPosiciones As DataTable
|
||||||
Get
|
Get
|
||||||
Return CType(ViewState("DtPosiciones"), DataTable)
|
Return CType(ViewState("DtPosiciones"), DataTable)
|
||||||
@@ -49,13 +57,27 @@ Partial Class GPS_RepGeoReferencias
|
|||||||
|
|
||||||
Private Sub CargaGeoReferencias()
|
Private Sub CargaGeoReferencias()
|
||||||
Dim Estatus = If(ChkEstatusGeocerca.Checked, 1, 0)
|
Dim Estatus = If(ChkEstatusGeocerca.Checked, 1, 0)
|
||||||
Dim GPS As New ClsGPS
|
|
||||||
If GPS.GeoReferenciaGet(-1, Estatus, "-1", UsuarioActual.CveCliente) Then
|
Using GPS As New ClsGPS
|
||||||
GVGeoreferencias.DataSource = GPS.DtResultados
|
If GPS.GeoReferenciaGet(-1, Estatus, "-1", UsuarioActual.CveCliente) Then
|
||||||
|
DtGeoReferencias = GPS.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
If DtGeoReferencias IsNot Nothing Then
|
||||||
|
Dim TotalRegistros As Integer = DtGeoReferencias.Rows.Count
|
||||||
|
Dim TotalRowsPage As Integer = GVGeoreferencias.PageSize
|
||||||
|
If TotalRegistros > TotalRowsPage Then
|
||||||
|
GVGeoreferencias.DataSource = DtGeoReferencias.FiltraPorIndices(0, TotalRowsPage - 1)
|
||||||
|
DivPaginacion.Visible = True
|
||||||
|
LblRegistros.Text = $"Distribución de datos desde 0 hasta {TotalRowsPage.ToString().ToDecimal().FormatoNumero(0)}. Total de registros: {TotalRegistros.ToString().ToDecimal().FormatoNumero(0)}"
|
||||||
|
Else
|
||||||
|
GVGeoreferencias.DataSource = DtGeoReferencias
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
GVGeoreferencias.DataSource = Nothing
|
GVGeoreferencias.DataSource = DtGeoReferencias
|
||||||
End If
|
End If
|
||||||
GPS.Dispose()
|
|
||||||
GVGeoreferencias.DataBind()
|
GVGeoreferencias.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDispositivos()
|
Private Sub CargaDispositivos()
|
||||||
@@ -191,15 +213,10 @@ Partial Class GPS_RepGeoReferencias
|
|||||||
|
|
||||||
Using ObjGPS As New ClsGPS
|
Using ObjGPS As New ClsGPS
|
||||||
If ObjGPS.GetReferenciaDetalle(-1, CveGeoReferencia, -1, UsuarioActual.CveCliente) Then
|
If ObjGPS.GetReferenciaDetalle(-1, CveGeoReferencia, -1, UsuarioActual.CveCliente) Then
|
||||||
If ObjGPS.DtResultados.Rows.Count > 0 Then
|
DtDetalle = ObjGPS.DtResultados.Copy()
|
||||||
DtDetalle = ObjGPS.DtResultados
|
DtDetalleEliminar = ObjGPS.DtResultados.Copy()
|
||||||
GvEquiposDetalle.DataSource = DtDetalle
|
|
||||||
Else
|
|
||||||
DtDetalle = Nothing
|
|
||||||
DtDetalleEliminar = Nothing
|
|
||||||
GvEquiposDetalle.DataSource = Nothing
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
GvEquiposDetalle.DataSource = DtDetalle
|
||||||
End If
|
End If
|
||||||
End Using
|
End Using
|
||||||
GvEquiposDetalle.DataBind()
|
GvEquiposDetalle.DataBind()
|
||||||
@@ -240,26 +257,21 @@ Partial Class GPS_RepGeoReferencias
|
|||||||
|
|
||||||
If ObjGPS.GeoReferenciaUpdate(CveGeoReferencia, TxtNombre.Text, -1, chkEstatus.Checked, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, chkLunes.Checked, chkMartes.Checked, chkMiercoles.Checked, chkJueves.Checked, chkViernes.Checked,
|
If ObjGPS.GeoReferenciaUpdate(CveGeoReferencia, TxtNombre.Text, -1, chkEstatus.Checked, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, chkLunes.Checked, chkMartes.Checked, chkMiercoles.Checked, chkJueves.Checked, chkViernes.Checked,
|
||||||
chkSabado.Checked, chkDomingo.Checked, HoraI, HoraF, TxtTolerancia.Text.ToEntero, UsuarioActual.CveCliente) Then
|
chkSabado.Checked, chkDomingo.Checked, HoraI, HoraF, TxtTolerancia.Text.ToEntero, UsuarioActual.CveCliente) Then
|
||||||
|
|
||||||
For Each Dr As DataRow In DtDetalle.Rows
|
|
||||||
Dim CveGeoReferenciaDetalle = Dr("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero
|
|
||||||
If CveGeoReferenciaDetalle > 0 Then
|
|
||||||
If Not ObjGPS.UpdateReferenciaDetalle(CveGeoReferenciaDetalle, CveGeoReferencia, Dr("CveDispositivo").ToString.ToEntero) Then
|
|
||||||
TieneError = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
If Not ObjGPS.AddGeoReferenciaDetalle(CveGeoReferencia, Dr("CveDispositivo").ToString.ToEntero) Then
|
|
||||||
TieneError = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
If Not TieneError Then
|
If Not TieneError Then
|
||||||
For Each DrE As DataRow In DtDetalleEliminar.Rows
|
For Each DrE As DataRow In DtDetalleEliminar.Rows
|
||||||
TieneError = Not ObjGPS.RemoveferenciaDetalle(DrE("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero)
|
If DrE("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero > 0 Then
|
||||||
|
TieneError = Not ObjGPS.RemoveferenciaDetalle(DrE("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
For Each Dr As DataRow In DtDetalle.Rows
|
||||||
|
If Not ObjGPS.AddGeoReferenciaDetalle(CveGeoReferencia, Dr("CveDispositivo").ToString.ToEntero) Then
|
||||||
|
TieneError = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
Else
|
Else
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
@@ -336,13 +348,14 @@ Partial Class GPS_RepGeoReferencias
|
|||||||
Dim Dr As DataRow = DtDetalle.Rows(e.RowIndex)
|
Dim Dr As DataRow = DtDetalle.Rows(e.RowIndex)
|
||||||
Dim CveGeoReferenciaDetalle = Dr("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero
|
Dim CveGeoReferenciaDetalle = Dr("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero
|
||||||
If CveGeoReferenciaDetalle > 0 Then
|
If CveGeoReferenciaDetalle > 0 Then
|
||||||
|
If DtDetalleEliminar.COUNT("CveDispositivo", $"CveDispositivoGeoreferenciaDetalle={CveGeoReferenciaDetalle}") <= 0 Then
|
||||||
Dim DrEliminar = DtDetalleEliminar.NewRow
|
Dim DrEliminar = DtDetalleEliminar.NewRow
|
||||||
DrEliminar("CveDispositivoGeoreferenciaDetalle") = CveGeoReferenciaDetalle
|
DrEliminar("CveDispositivoGeoreferenciaDetalle") = CveGeoReferenciaDetalle
|
||||||
DrEliminar("CveDispositivo") = Dr("CveDispositivo").ToString.ToEntero
|
DrEliminar("CveDispositivo") = Dr("CveDispositivo").ToString.ToEntero
|
||||||
DrEliminar("NoEconomico") = Dr("NoEconomico").ToString
|
DrEliminar("NoEconomico") = Dr("NoEconomico").ToString
|
||||||
DtDetalleEliminar.Rows.Add(DrEliminar)
|
DtDetalleEliminar.Rows.Add(DrEliminar)
|
||||||
DtDetalleEliminar.AcceptChanges()
|
DtDetalleEliminar.AcceptChanges()
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
DtDetalle.Rows.RemoveAt(e.RowIndex)
|
DtDetalle.Rows.RemoveAt(e.RowIndex)
|
||||||
@@ -416,4 +429,62 @@ Partial Class GPS_RepGeoReferencias
|
|||||||
Protected Sub ChkEstatusGeocerca_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkEstatusGeocerca_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
CargaGeoReferencias()
|
CargaGeoReferencias()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub btnPagePrev_Click(sender As Object, e As EventArgs)
|
||||||
|
Dim TotalRegistros As Integer = DtGeoReferencias.Rows.Count
|
||||||
|
Dim TotalRowsPage As Integer = GVGeoreferencias.PageSize
|
||||||
|
Dim PrevIndex As Integer = HdnIndexPage.Value.ToEntero - 1
|
||||||
|
Dim CurrentIndex As Integer = PrevIndex + 1
|
||||||
|
|
||||||
|
Dim PrevIndexDT As Integer = (TotalRowsPage) * PrevIndex
|
||||||
|
Dim CurrentIndexDT As Integer = (TotalRowsPage) * CurrentIndex
|
||||||
|
|
||||||
|
HdnIndexPage.Value = PrevIndex.ToString
|
||||||
|
|
||||||
|
If Not btnPageNext.Enabled Then
|
||||||
|
btnPageNext.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If PrevIndexDT <= 0 Then
|
||||||
|
btnPagePrev.Enabled = False
|
||||||
|
GVGeoreferencias.DataSource = DtGeoReferencias.FiltraPorIndices(0, CurrentIndexDT)
|
||||||
|
LblRegistros.Text = $"Distribución de datos desde 0 hasta {CurrentIndexDT.ToString.FormatoNumero(0)}. Total de registros: {DtGeoReferencias.Rows.Count.ToString.FormatoNumero(0)}"
|
||||||
|
Else
|
||||||
|
LblRegistros.Text = $"Distribución de datos desde {PrevIndexDT.ToString.FormatoNumero(0)} hasta {CurrentIndexDT.ToString.FormatoNumero(0)}. Total de registros: {DtGeoReferencias.Rows.Count.ToString.FormatoNumero(0)}"
|
||||||
|
GVGeoreferencias.DataSource = DtGeoReferencias.FiltraPorIndices(PrevIndexDT, CurrentIndexDT)
|
||||||
|
End If
|
||||||
|
|
||||||
|
GVGeoreferencias.DataBind()
|
||||||
|
UPGV.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub btnPageNext_Click(sender As Object, e As EventArgs)
|
||||||
|
Dim TotalRegistros As Integer = DtGeoReferencias.Rows.Count
|
||||||
|
Dim TotalRowsPage As Integer = GVGeoreferencias.PageSize
|
||||||
|
Dim Index As Integer = HdnIndexPage.Value.ToEntero + 1
|
||||||
|
Dim NextIndex As Integer = Index + 1
|
||||||
|
|
||||||
|
Dim CurrentIndexDT As Integer = (TotalRowsPage) * Index
|
||||||
|
Dim NextIndexDT As Integer = (TotalRowsPage) * NextIndex
|
||||||
|
|
||||||
|
HdnIndexPage.Value = Index.ToString
|
||||||
|
|
||||||
|
If Not btnPagePrev.Enabled Then
|
||||||
|
btnPagePrev.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If NextIndexDT >= TotalRegistros Then
|
||||||
|
btnPageNext.Enabled = False
|
||||||
|
GVGeoreferencias.DataSource = DtGeoReferencias.FiltraPorIndices(CurrentIndexDT, TotalRegistros - 1)
|
||||||
|
LblRegistros.Text = $"Distribución de datos desde {CurrentIndexDT.ToString.FormatoNumero(0)} hasta {DtGeoReferencias.Rows.Count.ToString.FormatoNumero(0)}. Total de registros: {DtGeoReferencias.Rows.Count.ToString.FormatoNumero(0)}"
|
||||||
|
Else
|
||||||
|
GVGeoreferencias.DataSource = DtGeoReferencias.FiltraPorIndices(CurrentIndexDT, NextIndexDT)
|
||||||
|
LblRegistros.Text = $"Distribución de datos desde {CurrentIndexDT.ToString.FormatoNumero(0)} hasta {NextIndexDT.ToString.FormatoNumero(0)}. Total de registros: {DtGeoReferencias.Rows.Count.ToString.FormatoNumero(0)}"
|
||||||
|
End If
|
||||||
|
|
||||||
|
GVGeoreferencias.DataBind()
|
||||||
|
UPGV.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -1398,7 +1398,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
|
|
||||||
'If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For
|
'If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For
|
||||||
TipoDocto = IIf(TipoDocto.Contiene("INGRESO", "INGRESOS"), "Ing", IIf(TipoDocto.Contiene("EGRESO", "EGRESOS"), "Egs", "Rem")).ToString
|
TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESO", "INGRESOS", "ING"), "Ing", IIf(TipoDocto.ToUpper.Contiene("EGRESO", "EGRESOS", "EGS"), "Egs", "Rem")).ToString
|
||||||
'PrePóliza
|
'PrePóliza
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoInicial", 1, Total, Total, 1, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoInicial", 1, Total, Total, 1, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
|||||||
@@ -608,12 +608,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
If Existencia > 0 Then
|
If Existencia > 0 Then
|
||||||
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
||||||
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||||
If (FechaCaducidad > MinFecha OrElse Serie <> "" OrElse Lote <> "") Then
|
If (FechaCaducidad > MinFecha OrElse Not Serie.Contiene("", "-1") OrElse Not Lote.Contiene("", "-1")) Then
|
||||||
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||||
Dim StrB As New stringbuilder
|
Dim StrB As New stringbuilder
|
||||||
StrB.appendformat("CvePS = {0} AND CveUM = {1} ", CvePS, CveUnidadMedida)
|
StrB.appendformat("CvePS = {0} AND CveUM = {1} ", CvePS, CveUnidadMedida)
|
||||||
If Serie <> "" Then StrB.appendformat(" AND Serie = '{0}' ", Serie)
|
If Not Serie.Contiene("", "-1") Then StrB.appendformat(" AND Serie = '{0}' ", Serie)
|
||||||
If Lote <> "" Then StrB.appendformat(" AND Lote = '{0}' ", Lote)
|
If Not Lote.Contiene("", "-1") Then StrB.appendformat(" AND Lote = '{0}' ", Lote)
|
||||||
If FechaCaducidad.ToDate > MinFecha Then StrB.appendformat(" AND FechaCaducidad = '{0}' ", FechaCaducidad.ToShortDateString)
|
If FechaCaducidad.ToDate > MinFecha Then StrB.appendformat(" AND FechaCaducidad = '{0}' ", FechaCaducidad.ToShortDateString)
|
||||||
Dim CantidadEspecificaEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", StrB.tostring)
|
Dim CantidadEspecificaEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", StrB.tostring)
|
||||||
|
|
||||||
@@ -2891,23 +2891,21 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
|
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
|
||||||
Dim Serie As String = RowExcel("Serie").ToString()
|
Dim Serie As String = RowExcel("Serie").ToString()
|
||||||
Dim Lote As String = If(RowExcel("Lote").ToString() = "", "-1", RowExcel("Lote").ToString())
|
Dim Lote As String = RowExcel("Lote").ToString()
|
||||||
Dim FechaCaducidad As Date = If(RowExcel("FechaCaducidad").ToString <> "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate)
|
Dim FechaCaducidad As Date = If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate)
|
||||||
Dim Observaciones As String = RowExcel("Observaciones").ToString()
|
Dim Observaciones As String = RowExcel("Observaciones").ToString()
|
||||||
|
|
||||||
If CveProducto > 0 Then
|
If CveProducto > 0 Then
|
||||||
|
|
||||||
Dim Valido As Boolean = True
|
Dim Valido As Boolean = True
|
||||||
|
|
||||||
Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero()
|
If RowPS("AplicaSerie").ToString() = "True" And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
|
||||||
|
|
||||||
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
|
|
||||||
Valido = False
|
Valido = False
|
||||||
Alert($"El producto '{RowPS("PS")}' requiere 'Serie'", TipoMensaje.MsgAdvertencia)
|
Alert($"El producto '{RowPS("PS")}' requiere 'Serie'", TipoMensaje.MsgAdvertencia)
|
||||||
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
|
ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveMetodoInventario = 5 AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
|
If RowPS("AplicaSerie").ToString() = "True" AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
|
||||||
NoPSConSerie = NoPSConSerie + 1
|
NoPSConSerie = NoPSConSerie + 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2919,7 +2917,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Valido Then
|
If Valido Then
|
||||||
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(Serie), Serie, "-1"), Lote, FechaCaducidad)
|
Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, -1, If(Not String.IsNullOrEmpty(Serie), Serie, "-1"), If(Not String.IsNullOrEmpty(Lote), Lote, "-1"), FechaCaducidad)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Valido Then
|
If Valido Then
|
||||||
|
|||||||
@@ -6263,6 +6263,13 @@
|
|||||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function httpGet() {
|
||||||
|
var xmlHttp = new XMLHttpRequest();
|
||||||
|
xmlHttp.open("GET", "http://localhost:85/ashx/SIGWeb.ashx?metodo=GetTokenAngular", false); // false for synchronous request
|
||||||
|
xmlHttp.send(null);
|
||||||
|
return xmlHttp.responseText;
|
||||||
|
}
|
||||||
|
|
||||||
function CargaGraficaCompratamientoSaldoMensual(data, graph) {
|
function CargaGraficaCompratamientoSaldoMensual(data, graph) {
|
||||||
var chart = AmCharts.makeChart("chartdiv4", {
|
var chart = AmCharts.makeChart("chartdiv4", {
|
||||||
"type": "serial",
|
"type": "serial",
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ Imports System.IO
|
|||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.Net.Http
|
||||||
|
Imports Newtonsoft.Json
|
||||||
|
Imports System.Threading.Tasks
|
||||||
|
Imports Newtonsoft.Json.Linq
|
||||||
|
Imports System.Net
|
||||||
|
Imports System.Collections.Generic
|
||||||
|
Imports Newtonsoft.Json.Serialization
|
||||||
|
|
||||||
Partial Class Clientes
|
Partial Class Clientes
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -1813,6 +1820,11 @@ Partial Class Clientes
|
|||||||
End If
|
End If
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
GVHistorial.DataBind()
|
GVHistorial.DataBind()
|
||||||
|
|
||||||
|
'DTHistorialVentas = ConsultarHistorial()
|
||||||
|
'GVHistorial.DataSource = DTHistorialVentas
|
||||||
|
'GVHistorial.DataBind()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Function CargaCxC(Optional CveClienteSucursal As Integer = -1) As Boolean
|
Private Function CargaCxC(Optional CveClienteSucursal As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
@@ -10348,5 +10360,125 @@ Partial Class Clientes
|
|||||||
End If
|
End If
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Function ConsultarHistorial2(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) As DataTable
|
||||||
|
Dim retorno As DataTable = Nothing
|
||||||
|
|
||||||
|
Using cliente As New HttpClient()
|
||||||
|
cliente.Timeout = New TimeSpan(0, 0, 15)
|
||||||
|
cliente.DefaultRequestHeaders.Add("Accept", "application/json")
|
||||||
|
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim Parametros As JObject = New JObject(
|
||||||
|
New JProperty("CveCliente", CveCliente),
|
||||||
|
New JProperty("SelectTop", SelectTop),
|
||||||
|
New JProperty("CveClienteSucursal", CveClienteSucursal),
|
||||||
|
New JProperty("TipoDocto", "-1")
|
||||||
|
)
|
||||||
|
|
||||||
|
Dim Url = New Uri(String.Format("{0}api/cliente/GetHistorialVentas?CveCliente={1}&SelectTop={2}&CveClienteSucursal={3}&TipoDocto={4}", "https://localhost:5001/", CveCliente, SelectTop, CveClienteSucursal, "-1"))
|
||||||
|
|
||||||
|
Dim response = cliente.GetAsync(Url).Result
|
||||||
|
|
||||||
|
If response.StatusCode = 200 Then
|
||||||
|
Dim json = response.Content.ReadAsStringAsync().Result
|
||||||
|
retorno = Newtonsoft.Json.JsonConvert.DeserializeObject(Of DataTable)(json)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Url = Nothing
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el historial de ventas", ex)
|
||||||
|
End Try
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
Public Function ConsultarHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) As DataTable
|
||||||
|
Dim retorno As DataTable = Nothing
|
||||||
|
|
||||||
|
Using cliente As New HttpClient()
|
||||||
|
cliente.Timeout = New TimeSpan(0, 0, 15)
|
||||||
|
cliente.DefaultRequestHeaders.Add("Authorization", String.Format("Bearer {0}", GetTokenAngular()))
|
||||||
|
Try
|
||||||
|
|
||||||
|
Dim Parametros As JObject = New JObject(
|
||||||
|
New JProperty("CveCliente", CveCliente),
|
||||||
|
New JProperty("SelectTop", SelectTop),
|
||||||
|
New JProperty("CveClienteSucursal", CveClienteSucursal),
|
||||||
|
New JProperty("TipoDocto", "-1")
|
||||||
|
)
|
||||||
|
System.Net.ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)
|
||||||
|
|
||||||
|
Dim Url = New Uri(String.Format("{0}api/cliente/GetHistorialVentas", "http://localhost:5000/"))
|
||||||
|
|
||||||
|
Dim response = cliente.PostAsync(Url, New StringContent(Parametros.ToString(), Encoding.UTF8, "application/json")).Result
|
||||||
|
|
||||||
|
If response.StatusCode = 200 Then
|
||||||
|
Dim json = response.Content.ReadAsStringAsync().Result
|
||||||
|
|
||||||
|
Dim result = JsonConvert.DeserializeObject(Of MResult)(json)
|
||||||
|
|
||||||
|
If result.isSuccess Then
|
||||||
|
|
||||||
|
'Dim contractResolver = New DefaultContractResolver With
|
||||||
|
'{
|
||||||
|
' .NamingStrategy = New KebabCaseNamingStrategy()
|
||||||
|
'}
|
||||||
|
'Dim options = New JsonSerializerSettings() With
|
||||||
|
'{
|
||||||
|
' .ContractResolver = contractResolver,
|
||||||
|
' .Formatting = Formatting.Indented
|
||||||
|
'}
|
||||||
|
|
||||||
|
retorno = JsonConvert.DeserializeObject(Of DataTable)(result.result.ToString())
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
response.Dispose()
|
||||||
|
|
||||||
|
Url = Nothing
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el historial de ventas", ex)
|
||||||
|
End Try
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Property Token As String = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDdmVQbGF0YWZvcm1hIjoiMSIsIkN2ZVVzdWFyaW8iOiIxNTM4IiwiQ3ZlRW1wcmVzYSI6IjIiLCJDdmVSb2wiOiIxIiwiRmVjaGEiOiJzw6FiYWRvLCAyMCBkZSBtYXJ6byBkZSAyMDIxIiwibmJmIjoxNjE2MjYzMzg2LCJleHAiOjE2MTYyNzQxODYsImlhdCI6MTYxNjI2MzM4Nn0.N_4yHZ0J41GgcXbAFfvyLvXiV-U8nRm85LoZhG1riNc"
|
||||||
|
|
||||||
|
Public Class MResult
|
||||||
|
Public Property isSuccess As Boolean
|
||||||
|
Public Property message As String
|
||||||
|
Public Property result As JArray
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Function GetTokenAngular() As String
|
||||||
|
Dim retorno As String = ""
|
||||||
|
|
||||||
|
Using cliente As New HttpClient()
|
||||||
|
|
||||||
|
cliente.Timeout = New TimeSpan(0, 0, 15)
|
||||||
|
cliente.DefaultRequestHeaders.Add("Accept", "text/json")
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim Url = New Uri(String.Format("{0}ashx/SIGWeb.ashx?metodo=GetTokenAngular", "http://localhost:85/"))
|
||||||
|
|
||||||
|
Dim response = cliente.GetAsync(Url).Result
|
||||||
|
|
||||||
|
If response.StatusCode = 200 Then
|
||||||
|
retorno = response.Content.ReadAsStringAsync().Result
|
||||||
|
End If
|
||||||
|
|
||||||
|
Url = Nothing
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el token", ex)
|
||||||
|
End Try
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -1950,14 +1950,13 @@
|
|||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
||||||
</td>
|
</td>
|
||||||
<td colspan="1">
|
<td colspan="1" style="text-align:center">
|
||||||
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password"></asp:TextBox>
|
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1"> </td>
|
<td colspan="2" > <span class='has-error'><span id='username-error' class='help-block'><asp:Literal ID="LtlMensajeBloqueo" runat="server" Text=""></asp:Literal></span></span></td>
|
||||||
<td colspan="1"> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
|
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
|
||||||
|
|||||||
@@ -1017,15 +1017,16 @@ Partial Class PV
|
|||||||
DivBloqueo.Visible = False
|
DivBloqueo.Visible = False
|
||||||
Dim strScript As New StringBuilder
|
Dim strScript As New StringBuilder
|
||||||
strScript.Append("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueo"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); ")
|
strScript.Append("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueo"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); ")
|
||||||
'If UsuarioActual.ErrorDesbloqueo Then
|
If UsuarioActual.ErrorDesbloqueo Then
|
||||||
|
LtlMensajeBloqueo.Text = UsuarioActual.MsgErrorDesbloqueo
|
||||||
'strScript.AppendFormat("alert('{0}');", UsuarioActual.MsgErrorDesbloqueo)
|
'strScript.AppendFormat("alert('{0}');", UsuarioActual.MsgErrorDesbloqueo)
|
||||||
'End If
|
End If
|
||||||
strScript.Append("}, 500); }")
|
strScript.Append("}, 500); }")
|
||||||
RegistraScript(strScript.ToString())
|
RegistraScript(strScript.ToString())
|
||||||
|
|
||||||
UsuarioActual.SesionBloqueada = True
|
UsuarioActual.SesionBloqueada = True
|
||||||
'UsuarioActual.ErrorDesbloqueo = False
|
UsuarioActual.ErrorDesbloqueo = False
|
||||||
'UsuarioActual.MsgErrorDesbloqueo = ""
|
UsuarioActual.MsgErrorDesbloqueo = ""
|
||||||
|
|
||||||
BtnEmitirImprimir.Visible = False
|
BtnEmitirImprimir.Visible = False
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -7449,13 +7450,13 @@ Partial Class PV
|
|||||||
End Sub
|
End Sub
|
||||||
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
'UsuarioActual.ErrorDesbloqueo = False
|
UsuarioActual.ErrorDesbloqueo = False
|
||||||
'UsuarioActual.MsgErrorDesbloqueo = ""
|
UsuarioActual.MsgErrorDesbloqueo = ""
|
||||||
|
|
||||||
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
|
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
|
||||||
UsuarioActual.SesionBloqueada = True
|
UsuarioActual.SesionBloqueada = True
|
||||||
'UsuarioActual.ErrorDesbloqueo = True
|
UsuarioActual.ErrorDesbloqueo = True
|
||||||
'UsuarioActual.MsgErrorDesbloqueo = "Es necesario un código de acceso"
|
UsuarioActual.MsgErrorDesbloqueo = "Es necesario un código de acceso"
|
||||||
|
|
||||||
Response.Redirect($"~/Ventas/PV.aspx")
|
Response.Redirect($"~/Ventas/PV.aspx")
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -7527,8 +7528,8 @@ Partial Class PV
|
|||||||
Response.Redirect($"~/Ventas/PV.aspx")
|
Response.Redirect($"~/Ventas/PV.aspx")
|
||||||
Else
|
Else
|
||||||
UsuarioActual.SesionBloqueada = True
|
UsuarioActual.SesionBloqueada = True
|
||||||
'UsuarioActual.ErrorDesbloqueo = True
|
UsuarioActual.ErrorDesbloqueo = True
|
||||||
'UsuarioActual.MsgErrorDesbloqueo = "El código de acceso no es correcto"
|
UsuarioActual.MsgErrorDesbloqueo = "El código de acceso no es correcto"
|
||||||
|
|
||||||
Response.Redirect($"~/Ventas/PV.aspx")
|
Response.Redirect($"~/Ventas/PV.aspx")
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ Partial Class Ventas_RepVentas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'SI ES EL USUARIO SISTEMA MOSTRAR LA MODALIDAD CONTABLE (TEMPORAL)
|
'SI ES EL USUARIO SISTEMA MOSTRAR LA MODALIDAD CONTABLE (TEMPORAL)
|
||||||
If UsuarioActual.CveUsuario = 100 Then
|
'If UsuarioActual.CveUsuario = 100 Then
|
||||||
divModalidadcontable.Visible = True
|
divModalidadcontable.Visible = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
'Modalidad Cotizacion
|
'Modalidad Cotizacion
|
||||||
If Opcion = "Cot" Then
|
If Opcion = "Cot" Then
|
||||||
|
|||||||
@@ -3946,7 +3946,7 @@ Partial Class Ventas
|
|||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
Dim ObjUsados As New ClsVentas
|
Dim ObjUsados As New ClsVentas
|
||||||
|
|
||||||
If ObjUsados.GetVentasUsados(CveVenta, DdlSubProyectoDatos.SelectedValue.ToEntero(), DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||||
DtUsados = ObjUsados.DtResultados
|
DtUsados = ObjUsados.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjUsados.Dispose()
|
ObjUsados.Dispose()
|
||||||
@@ -11299,6 +11299,9 @@ Partial Class Ventas
|
|||||||
Dim CveCuentaIVAxTrasladar As Integer = 0
|
Dim CveCuentaIVAxTrasladar As Integer = 0
|
||||||
Dim CveCuentaIVATrasladado As Integer = 0
|
Dim CveCuentaIVATrasladado As Integer = 0
|
||||||
Dim SeContabiliza As Boolean = True
|
Dim SeContabiliza As Boolean = True
|
||||||
|
|
||||||
|
Dim SimplificarPrePoliza As Boolean = False
|
||||||
|
|
||||||
If (UsuarioActual.Empresa.Funcionalidad(343) = "1" AndAlso ObjFactura.TipoDocto = "Ant") Or (ChkAntEspecial.Checked AndAlso ObjFactura.TipoDocto = "Ant") Then
|
If (UsuarioActual.Empresa.Funcionalidad(343) = "1" AndAlso ObjFactura.TipoDocto = "Ant") Or (ChkAntEspecial.Checked AndAlso ObjFactura.TipoDocto = "Ant") Then
|
||||||
SeContabiliza = False
|
SeContabiliza = False
|
||||||
End If
|
End If
|
||||||
@@ -12614,7 +12617,7 @@ Partial Class Ventas
|
|||||||
If CveIEPago > 0 Then
|
If CveIEPago > 0 Then
|
||||||
|
|
||||||
importeMovimiento = DrPago("Importe").ToString().ToDecimal * ValorMultiplicador
|
importeMovimiento = DrPago("Importe").ToString().ToDecimal * ValorMultiplicador
|
||||||
importeMX = importeMovimiento * tipoCambio * Multiplicador
|
importeMX = (importeMovimiento * tipoCambio * Multiplicador).RoundSQL
|
||||||
IdCtaContable = 0
|
IdCtaContable = 0
|
||||||
CveCuenta = 0
|
CveCuenta = 0
|
||||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||||
@@ -12633,20 +12636,61 @@ Partial Class Ventas
|
|||||||
' CuentasContablesInvalidasSIG.AppendFormat("<br> {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("NumCuentaMoneda").ToString().ToEntero())
|
' CuentasContablesInvalidasSIG.AppendFormat("<br> {0}", GlobalDTBancosCuentas(UsuarioActual.CveUsuario, DrPago("CveCuenta").ToString().ToEntero()).Rows(0)("NumCuentaMoneda").ToString().ToEntero())
|
||||||
' CveCuentaContabilizacion = 0
|
' CveCuentaContabilizacion = 0
|
||||||
'End If
|
'End If
|
||||||
|
'MONEDA EXTRANJERA
|
||||||
|
If ObjFactura.CveMoneda > 1 Then
|
||||||
|
'BANCOS
|
||||||
|
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
'BANCOS COMPLEMENTARIA
|
||||||
|
If UsaComplementariaClientes Then
|
||||||
|
Dim ImporteComplementaria As Decimal = ((importeMovimiento * tipoCambio) - importeMovimiento).RoundSQL
|
||||||
|
|
||||||
|
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 204, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 204, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEPago, ImporteMX:=ImporteComplementaria, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, TipoCambioPago:=tipoCambio, CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'PAGO CLIENTES
|
||||||
|
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 2, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
'PAGO CLIENTES COMPLEMENTARIA
|
||||||
|
If UsaComplementariaClientes Then
|
||||||
|
Dim ImporteComplementaria As Decimal = ((importeMovimiento * tipoCambio) - importeMovimiento).RoundSQL
|
||||||
|
|
||||||
|
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 207, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, 0, Referencia, 207, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEPago, ImporteMX:=ImporteComplementaria, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, TipoCambioPago:=tipoCambio, CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
SimplificarPrePoliza = True
|
||||||
|
|
||||||
|
Else
|
||||||
|
'BANCOS
|
||||||
|
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
'PAGO CLIENTES
|
||||||
|
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 2, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
'BANCOS
|
|
||||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 30, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta) Then
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'CLIENTES
|
|
||||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 2, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 2, Concepto, Fecha, IdCtaContableCliente, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuentaCliente, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
|
||||||
ErrorPrepoliza = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If ObjFactura.IVA <> 0 Then
|
If ObjFactura.IVA <> 0 Then
|
||||||
@@ -12795,7 +12839,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'Simplificacion de PrePolizas
|
'Simplificacion de PrePolizas
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") OrElse SimplificarPrePoliza Then
|
||||||
If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
@@ -27328,11 +27372,29 @@ Partial Class Ventas
|
|||||||
|
|
||||||
RemisionesLista.Clear()
|
RemisionesLista.Clear()
|
||||||
|
|
||||||
|
Dim MsgUsados As New StringBuilder
|
||||||
|
Dim UsadosValidados As Boolean = True
|
||||||
|
|
||||||
If dtSeleccionadas.Rows.Count > 0 Then
|
If dtSeleccionadas.Rows.Count > 0 Then
|
||||||
Select Case RblTipo.SelectedValue
|
Select Case RblTipo.SelectedValue
|
||||||
Case "1" 'T O T A L G E N E R A L
|
Case "1" 'T O T A L G E N E R A L
|
||||||
For Each row As DataRow In dtSeleccionadas.Rows
|
For Each row As DataRow In dtSeleccionadas.Rows
|
||||||
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
Using ObjUsados As New ClsVentas
|
||||||
|
If ObjUsados.GetVentasUsados(row("CveVenta").ToString().ToEntero(), -1, row("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjUsados.DtResultados.Rows.Count > 0 Then
|
||||||
|
UsadosValidados = False
|
||||||
|
MsgUsados.AppendFormat("{0},", row("Folio").ToString())
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsadosValidados Then
|
||||||
|
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
IsTotalxConcepto = False
|
IsTotalxConcepto = False
|
||||||
Dim PU As Decimal = dtSeleccionadas.SUM("SubTotal").ToDecimal
|
Dim PU As Decimal = dtSeleccionadas.SUM("SubTotal").ToDecimal
|
||||||
@@ -27347,7 +27409,22 @@ Partial Class Ventas
|
|||||||
CalculaTotalesVenta()
|
CalculaTotalesVenta()
|
||||||
Case "2" 'T O T A L X R E M I S I O N
|
Case "2" 'T O T A L X R E M I S I O N
|
||||||
For Each row As DataRow In dtSeleccionadas.Rows
|
For Each row As DataRow In dtSeleccionadas.Rows
|
||||||
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
Using ObjUsados As New ClsVentas
|
||||||
|
If ObjUsados.GetVentasUsados(row("CveVenta").ToString().ToEntero(), -1, row("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjUsados.DtResultados.Rows.Count > 0 Then
|
||||||
|
UsadosValidados = False
|
||||||
|
MsgUsados.AppendFormat("{0},", row("Folio").ToString())
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsadosValidados Then
|
||||||
|
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa)(0)
|
Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa)(0)
|
||||||
Dim rowSP As DataRow = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)(0)
|
Dim rowSP As DataRow = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)(0)
|
||||||
@@ -27368,17 +27445,51 @@ Partial Class Ventas
|
|||||||
For Each row As DataRow In dtSeleccionadas.Rows
|
For Each row As DataRow In dtSeleccionadas.Rows
|
||||||
sb.Append($"{row("CveVentaDetalle").ToString()},")
|
sb.Append($"{row("CveVentaDetalle").ToString()},")
|
||||||
Next
|
Next
|
||||||
For Each row As DataRow In dtSeleccionadas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
|
For Each row As DataRow In dtSeleccionadas.FiltraParametros("", DistinctColumns:={"CveVenta", "Fecha", "Folio"}).Rows
|
||||||
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
Using ObjUsados As New ClsVentas
|
||||||
|
If ObjUsados.GetVentasUsados(row("CveVenta").ToString().ToEntero(), -1, row("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjUsados.DtResultados.Rows.Count > 0 Then
|
||||||
|
UsadosValidados = False
|
||||||
|
MsgUsados.AppendFormat("{0},", row("Folio").ToString())
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsadosValidados Then
|
||||||
|
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
For Each row As DataRow In dtSeleccionadas.Rows
|
For Each row As DataRow In dtSeleccionadas.Rows
|
||||||
sb.Append($"{row("CveVenta").ToString()},")
|
sb.Append($"{row("CveVenta").ToString()},")
|
||||||
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
|
Using ObjUsados As New ClsVentas
|
||||||
|
If ObjUsados.GetVentasUsados(row("CveVenta").ToString().ToEntero(), -1, row("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjUsados.DtResultados.Rows.Count > 0 Then
|
||||||
|
UsadosValidados = False
|
||||||
|
MsgUsados.AppendFormat("{0},", row("Folio").ToString())
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsadosValidados Then
|
||||||
|
RemisionesLista.Add(row("CveVenta").ToString().ToEntero())
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
sb.Remove(sb.Length - 1, 1)
|
sb.Remove(sb.Length - 1, 1)
|
||||||
CargaConceptosRemisionPorFacturar(sb.ToString(), If(ChkRemProductos.Checked, 2, 1))
|
|
||||||
|
If UsadosValidados Then
|
||||||
|
CargaConceptosRemisionPorFacturar(sb.ToString(), If(ChkRemProductos.Checked, 2, 1))
|
||||||
|
End If
|
||||||
|
|
||||||
sb.Clear()
|
sb.Clear()
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
@@ -27430,6 +27541,15 @@ Partial Class Ventas
|
|||||||
ObsPedido.Clear()
|
ObsPedido.Clear()
|
||||||
ObsInv.Clear()
|
ObsInv.Clear()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsadosValidados Then
|
||||||
|
If MsgUsados.Length > 0 Then
|
||||||
|
MsgUsados.Remove(MsgUsados.Length - 1, 1)
|
||||||
|
End If
|
||||||
|
Alert($"Las siguientes remisiones no se pueden facturar porque no se ha recibido el usado correspondiente:<br/><b>{MsgUsados.ToString()}<b/>", TipoMensaje.MsgAdvertencia)
|
||||||
|
BtnEmitirImprimir.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
|
TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
|
||||||
@@ -28570,7 +28690,10 @@ Partial Class Ventas
|
|||||||
Else
|
Else
|
||||||
Row("PorcentajeIVA") = DrPS("IVA")
|
Row("PorcentajeIVA") = DrPS("IVA")
|
||||||
End If
|
End If
|
||||||
Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal) - Row("Descuento").ToString().ToDecimal
|
|
||||||
|
Dim PU = Row("PU").ToString().ToDecimal().RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||||
|
|
||||||
|
Dim TotalCalculableImpuestos As Decimal = (Row("Cantidad").ToString().ToDecimal * PU) - Row("Descuento").ToString().ToDecimal
|
||||||
Dim TotalCalculableImpuestosIVA As Decimal = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString().ToDecimal)
|
Dim TotalCalculableImpuestosIVA As Decimal = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString().ToDecimal)
|
||||||
|
|
||||||
Row("IVA") = Row("PorcentajeIVA").ToString().ToDouble
|
Row("IVA") = Row("PorcentajeIVA").ToString().ToDouble
|
||||||
|
|||||||
Reference in New Issue
Block a user