This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2021-03-29 07:32:37 -07:00
32 changed files with 9837 additions and 8008 deletions

View File

@@ -70,14 +70,17 @@ Partial Class Acumuladores_RepEntradasUsados
Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1) Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1)
Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today)) Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Day(Today), Mes, Year(Today))
Dim Direccion As String = String.Format("{0} {1}", UsuarioActual.Empresa.Direccion.ToString, UsuarioActual.Empresa.NoExt.ToString)
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Direccion", "dirección")) params.Add(New ReportParameter("Direccion", Direccion))
params.Add(New ReportParameter("FechaConFormato", FechaConFormato)) params.Add(New ReportParameter("FechaConFormato", Date.Now.ToString))
params.Add(New ReportParameter("FechaInicial", txtFechaI.Text)) params.Add(New ReportParameter("FechaInicial", txtFechaI.Text))
params.Add(New ReportParameter("FechaFinal", txtFechaF.Text)) params.Add(New ReportParameter("FechaFinal", txtFechaF.Text))
params.Add(New ReportParameter("Sucursal", "Sucursal")) params.Add(New ReportParameter("Sucursal", "Sucursal"))
params.Add(New ReportParameter("Almacen", DdlAlmacenes.SelectedItem.ToString))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsados} Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsados}

View File

@@ -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

View File

@@ -1026,6 +1026,24 @@ Public Class ClsClientes
OnError("Ocurrió un error al obtener el las Sucursales del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al obtener el las Sucursales del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try
Return Retorno
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 Return Retorno
End Function End Function

View File

@@ -1660,6 +1660,28 @@ Public Class ClsInventarios
End Function End Function
Public Function GetExistenciasSucursales(PSRequest As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ExistenciasSucursalesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@PSRequest", SqlDbType.VarChar).Value = PSRequest
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al obtener las existencias.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region #End Region
#Region " INVENTARIOS - REPORTES " #Region " INVENTARIOS - REPORTES "

View File

@@ -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
@@ -6617,13 +6617,20 @@ Public Class ClsPaginas
'CLIENTE 'CLIENTE
If Vta.CveCliente.ToEntero > 0 Then If Vta.CveCliente.ToEntero > 0 Or Vta.CveEmpresaCRM.ToEntero > 0 Then
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo)) params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre)))) params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion)) params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
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)))

View File

@@ -1214,6 +1214,43 @@ Namespace Modelos
Return File Return File
End Function End Function
Public Function TimbrarFactura() As Boolean
Dim SeTimbro As Boolean = False
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
If (TipoDoctoDevolucion = "" OrElse Not TipoDoctoDevolucion.Contiene("Rem", "Cot", "Ped", "DPe", "PA", "Pd2")) Then
Dim DebeTimbrar As Boolean = True
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
'si tiene anticipos seleccionados y el total es cero, que no se timbre(previo empresa72)
If Me.Amortizacion > 0 And Me.Total <= 0 Then
DebeTimbrar = False
End If
End If
If Me.TipoDocto.Contiene("Ing", "Egs", "Ant", "Dev") Then
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" Then
If Me.FemsaFactura IsNot Nothing Then
'FACTURA INGRESO/EGRESO
Dim ObjTimbrado As New Timbrado
'DOCUMENTO ACTUAL
If DebeTimbrar Then
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, Me)
If Not SeTimbro Then
ErrorList.Add(ObjTimbrado.MensajeErrorCFDI)
End If
End If
End If
End If
End If
End If
Return SeTimbro
End Function
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO " #Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO "
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
Dim ProcesoCorrecto As Boolean = True Dim ProcesoCorrecto As Boolean = True
@@ -3668,141 +3705,28 @@ Namespace Modelos
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
If factura.CveAlmacen > 0 AndAlso DtInventario.Rows.Count > 0 Then
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(factura.CveAlmacen, 3, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Mod/E5")
If CveMovimientoInventario <= 0 Then If factura.GenerarSalidaAlmacen AndAlso factura.CveAlmacen > 0 AndAlso DtInventario.Rows.Count > 0 Then
Dim CveMovimientoInventario As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, factura.DtInventario, factura.CveAlmacen, 3, factura.CveMoneda, factura.CveVenta, "Modelos/SA", MovimientoPrePoliza:=True, ObjConta:=ObjConta)
If Not CveMovimientoInventario > 0 Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") End If
Else End If
Dim Mensaje As String = ""
Dim i As Integer = 0
Dim Cantidad As Double
Dim CveUnidad As Integer
Dim CveProducto As Integer
Dim Existencia As Double
'Dim Pu As Double
'DtInv.Clone()
Dim DtEquivalencias As DataTable If factura.CveAlmacen > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") AndAlso RemisionesLista.Count > 0 Then
For Each Dr As DataRow In DtInventario.Rows For Each CveRemision As Integer In RemisionesLista
CveProducto = Dr("CvePS").ToString.ToEntero 'El almacen general es el Primer Almacen de Material en la Sucursal
CveUnidad = Dr("CveUM").ToString.ToEntero If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then
Cantidad = Dr("Cantidad").ToString.ToDouble OcurrioError = True
Exit For
If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then
OcurrioError = True
ErrorList.Add("Se deben especificar las Series de los productos de almacén")
Exit For
End If
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then
OcurrioError = True
ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
Exit For
End If
End If
If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
If CveUnidadBase <> CveUnidad Then
' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble
CveUnidad = CveUnidadBase
End If
End If
If CveProducto > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, -1, Serie:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For
End If
Else
OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For
End If
i = i + 1
Next
'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN
If Not OcurrioError Then
Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0
Dim TotalCosto As Decimal = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados
TotalCosto = DtCostos.SUMD("Total").RoundSQL()
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
If tmpCostos.Rows.Count > 0 Then
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
'Se agrega movimiento separado por la cuenta de ventas (ER)
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
TotalCostoAcumulado += ValorInventario
'cuando es el último movimiento y hay diferencias en los importes
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString)
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, False, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
OcurrioError = True
End If
End If
cont += 1
Next
End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero
If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, True, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
OcurrioError = True
End If
End If
factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario
End If
End If End If
Next
End If
If RemisionesLista.Count > 0 Then
For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, CveRemision, ObjConta, True, 9) Then
OcurrioError = True
Exit For
End If
Next
End If
End If End If
If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1") Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1")
If CveMovimientoSalida > 0 Then If CveMovimientoSalida > 0 Then
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
OcurrioError = True OcurrioError = True
End If End If
Else Else
@@ -4079,7 +4003,7 @@ Namespace Modelos
End Function End Function
Private Function GenerarMovimientoAlmacenServicioDomicilio(ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura, DtInventario As DataTable, CveAlmacen As Integer, CveConcepto As Integer, CveMoneda As Integer, CveVenta As Integer, Modulo As String, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1) As Integer Private Function GenerarMovimientoAlmacenServicioDomicilio(ByRef ObjInventario As ClsInventarios, ByRef factura As Modelos.Factura, DtInventario As DataTable, CveAlmacen As Integer, CveConcepto As Integer, CveMoneda As Integer, CveVenta As Integer, Modulo As String, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1) As Integer
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConcepto, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:=Modulo, CveMovimientoRelacionado:=CveMovimientoRelacionado) Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConcepto, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:=Modulo, CveMovimientoRelacionado:=CveMovimientoRelacionado)
@@ -4167,9 +4091,18 @@ Namespace Modelos
Dim DtCostos As DataTable = Nothing Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0 Dim ValorInventario As Decimal = 0
Dim TotalCosto As Decimal = 0 Dim TotalCosto As Decimal = 0
Dim TipoMovto68 As Boolean = True
Dim TipoMovto69 As Boolean = False
If CveConcepto.Contiene(18) Then
TipoMovto68 = False
TipoMovto69 = True
End If
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados DtCostos = ObjInventario.DtResultados
TotalCosto = DtCostos.SUMD("Total").RoundSQL() TotalCosto = DtCostos.SUMD("Total").RoundSQL
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0 Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0 Dim CveCuenta As Integer = 0
@@ -4178,39 +4111,41 @@ Namespace Modelos
Dim cont As Integer = 1 Dim cont As Integer = 1
'Se agrega movimiento separado por la cuenta de ventas (ER) 'Se agrega movimiento separado por la cuenta de ventas (ER)
For Each RowInv As DataRow In tmpCostos.Rows For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL() ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
TotalCostoAcumulado += ValorInventario TotalCostoAcumulado += ValorInventario
'cuando es el último movimiento y hay diferencias en los importes 'cuando es el último movimiento y hay diferencias en los importes
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then If cont = tmpCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado) ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If End If
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString) 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero 'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
If ValorInventario <> 0 Then 'If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, False, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
OcurrioError = True OcurrioError = True
End If
End If End If
'End If
cont += 1 cont += 1
Next Next
End If End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
If TotalCosto <> 0 Then 'If TotalCosto <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, True, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
End If
End If End If
'End If
factura.Inv_CveMovimiento = CveMovimientoInventario Else
factura.Inv_ValorInventario = ValorInventario OcurrioError = True
End If End If
factura.Inv_CveMovimiento = CveMovimientoInventario
factura.Inv_ValorInventario = ValorInventario
End If End If
End If End If
Return CveMovimientoInventario Return CveMovimientoInventario
@@ -5516,7 +5451,7 @@ Namespace Modelos
'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If
@@ -5986,6 +5921,7 @@ Namespace Modelos
Public Property CveAnticipo As Integer Public Property CveAnticipo As Integer
Public Property RemisionesLista As List(Of Integer) Public Property RemisionesLista As List(Of Integer)
Public Property CveAlmacen As Integer Public Property CveAlmacen As Integer
Public Property GenerarSalidaAlmacen As Boolean = False
Public Property CveConceptoMovimiento As Integer Public Property CveConceptoMovimiento As Integer
Public Property ObservacionesMovimiento As String Public Property ObservacionesMovimiento As String
Public Property DtMovimientosUsados As DataTable Public Property DtMovimientosUsados As DataTable

View File

@@ -968,25 +968,25 @@ 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

File diff suppressed because it is too large Load Diff

View File

@@ -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();

View File

@@ -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

View File

@@ -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"

View File

@@ -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
@@ -4446,8 +4446,8 @@ Partial Class Contratos_Default
Dim TipoContrato As Integer = DdlTipoContrato.SelectedValue.ToEntero() Dim TipoContrato As Integer = DdlTipoContrato.SelectedValue.ToEntero()
Dim SufijoContrato As String = "" Dim SufijoContrato As String = ""
Select Case TipoContrato Select Case TipoContrato
Case 7 'Contrato Comodato Case 7 'Contrato Comodato
SufijoContrato = "COMODATO" SufijoContrato = "COMODATO"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -120,7 +120,7 @@
<TablixBody> <TablixBody>
<TablixColumns> <TablixColumns>
<TablixColumn> <TablixColumn>
<Width>4.91744cm</Width> <Width>3.06478cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>4.73895cm</Width> <Width>4.73895cm</Width>
@@ -129,7 +129,7 @@
<Width>2.5cm</Width> <Width>2.5cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>3.44027cm</Width> <Width>3.18387cm</Width>
</TablixColumn> </TablixColumn>
<TablixColumn> <TablixColumn>
<Width>2.14434cm</Width> <Width>2.14434cm</Width>
@@ -787,60 +787,24 @@
<RepeatColumnHeaders>true</RepeatColumnHeaders> <RepeatColumnHeaders>true</RepeatColumnHeaders>
<FixedColumnHeaders>true</FixedColumnHeaders> <FixedColumnHeaders>true</FixedColumnHeaders>
<DataSetName>DataSet1</DataSetName> <DataSetName>DataSet1</DataSetName>
<Top>0.82931cm</Top> <Top>0.10583cm</Top>
<Left>0.06614cm</Left> <Left>0.03086cm</Left>
<Height>0.93542cm</Height> <Height>0.93542cm</Height>
<Width>23.14606cm</Width> <Width>21.037cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
</Border> </Border>
</Style> </Style>
</Tablix> </Tablix>
<Textbox Name="Textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!AgrupadoPor.Value</Value>
<MarkupType>HTML</MarkupType>
<Style>
<FontSize>9pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>0.07056cm</Top>
<Left>0.06614cm</Left>
<Height>0.58236cm</Height>
<Width>19.58715cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Height>0.79506in</Height> <Height>0.45131in</Height>
<Style /> <Style />
</Body> </Body>
<Width>9.13866in</Width> <Width>8.30832in</Width>
<Page> <Page>
<PageHeader> <PageHeader>
<Height>2.22362cm</Height> <Height>3.01737cm</Height>
<PrintOnFirstPage>true</PrintOnFirstPage> <PrintOnFirstPage>true</PrintOnFirstPage>
<ReportItems> <ReportItems>
<Textbox Name="Textbox1"> <Textbox Name="Textbox1">
@@ -864,7 +828,7 @@
<rd:DefaultName>Textbox1</rd:DefaultName> <rd:DefaultName>Textbox1</rd:DefaultName>
<Left>2.43857cm</Left> <Left>2.43857cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>14.68354cm</Width> <Width>15.66659cm</Width>
<Style> <Style>
<Border> <Border>
<Style>None</Style> <Style>None</Style>
@@ -912,7 +876,7 @@
<Top>0.63528cm</Top> <Top>0.63528cm</Top>
<Left>2.40329cm</Left> <Left>2.40329cm</Left>
<Height>0.52945cm</Height> <Height>0.52945cm</Height>
<Width>14.68354cm</Width> <Width>15.70187cm</Width>
<ZIndex>1</ZIndex> <ZIndex>1</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -938,6 +902,42 @@
</Border> </Border>
</Style> </Style>
</Image> </Image>
<Textbox Name="Textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!AgrupadoPor.Value</Value>
<MarkupType>HTML</MarkupType>
<Style>
<FontSize>9pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Top>2.31154cm</Top>
<Left>0.06614cm</Left>
<Height>0.6cm</Height>
<Width>18.03902cm</Width>
<ZIndex>3</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Style> <Style>
<Border> <Border>
@@ -969,7 +969,7 @@
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName> <rd:DefaultName>Textbox31</rd:DefaultName>
<Top>0.40041cm</Top> <Top>0.40041cm</Top>
<Left>16.97887cm</Left> <Left>16.97887cm</Left>
<Height>0.68085cm</Height> <Height>0.68085cm</Height>

View File

@@ -143,7 +143,7 @@
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places"></script> <script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.ModExtensiones.GOOGLE_MAPS_API_KEY) %>"></script>
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script> <script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
<script> <script>
var image = '/Imagenes/rsz_11rsz_car.png'; var image = '/Imagenes/rsz_11rsz_car.png';

View File

@@ -1,8 +1,8 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RepGeoReferencias.aspx.vb" Inherits="GPS_RepGeoReferencias" %> <%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RepGeoReferencias.aspx.vb" Inherits="GPS_RepGeoReferencias" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style type="text/css"> <style type="text/css">
html, body { html, body {
width: 100%; width: 100%;
@@ -44,292 +44,304 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server"> <asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
<li> <li>
<a id="BtnDir" onclick="$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });CargaPickers();NuevaConsulta();"> <a id="BtnDir" onclick="$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });CargaPickers();NuevaConsulta();">
<i class='fa fa-exchange'></i><span>Volver a Consultar</span> <i class='fa fa-exchange'></i><span>Volver a Consultar</span>
</a> </a>
</li> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<div id="map"></div> <div id="map"></div>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPModalBusqueda"> <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPModalBusqueda">
<ContentTemplate> <ContentTemplate>
<div id="dvConsulta" class="modal ADS fade" role="dialog"> <div id="dvConsulta" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="myModalLabel2" runat="server">Consulta de GeoReferencias</h4> <h4 class="modal-title" id="myModalLabel2" runat="server">Consulta de GeoReferencias</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalBody" UpdateMode="conditional"> <asp:UpdatePanel runat="server" ID="UpModalBody" UpdateMode="conditional">
<ContentTemplate> <ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-8 v-center"> <div class="col-md-8 v-center">
<lable>Estatus: &nbsp;</lable> <lable>Estatus: &nbsp;</lable>
<asp:CheckBox runat="server" ID="ChkEstatusGeocerca" AutoPostBack="true" CssClass="chksino" Checked="true" Text=" " OnCheckedChanged="ChkEstatusGeocerca_CheckedChanged" /> <asp:CheckBox runat="server" ID="ChkEstatusGeocerca" AutoPostBack="true" CssClass="chksino" Checked="true" Text=" " OnCheckedChanged="ChkEstatusGeocerca_CheckedChanged" />
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left"> <div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px"> <div style="margin-right: 15px">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVGeoreferencias.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVGeoreferencias.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVGeoreferencias.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVGeoreferencias.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
</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>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%" HeaderText="Estatus"> <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%" HeaderText="Estatus">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label> <asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgE" HeaderText="Eliminar" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="imgE" HeaderText="Eliminar" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" /> <asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<asp:UpdatePanel runat="server" ID="UpUp" UpdateMode="Conditional"> <div id="DivPaginacion" runat="server" visible="false" class="row">
<ContentTemplate> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright v-center"> <asp:Label ID="LblRegistros" runat="server" Style="display: inline-block;"></asp:Label>
<label>Ver Posición Dispositivos:&nbsp;</label> </div>
<asp:CheckBox ID="chkUp" onchange="DisplayGV();" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox> <div class="col-md-4" style="display: inline-block; position: relative; text-align:end">
</div> <asp:HiddenField ID="HdnIndexPage" runat="server" ClientIDMode="Static" Value="0" />
<div id="dvDispositivos" style="display: none"> <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" />
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left"> &nbsp;<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 style="margin-right: 15px"> </div>
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> </div>
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <asp:UpdatePanel runat="server" ID="UpUp" UpdateMode="Conditional">
</div> <ContentTemplate>
</div> <div class="form-group form-md-line-input input-iconright v-center">
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-height="120.8" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros"> <label>Ver Posición Dispositivos:&nbsp;</label>
<Columns> <asp:CheckBox ID="chkUp" onchange="DisplayGV();" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%"> </div>
<ItemTemplate> <div id="dvDispositivos" style="display: none">
<asp:CheckBox runat="server" ID="chkDis" /> <div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
</ItemTemplate> <div style="margin-right: 15px">
</asp:TemplateField> <input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" /> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
<asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="25%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" /> </div>
<asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="15%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" /> </div>
<asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="25%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" /> <asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-height="120.8" 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:GridView> <ItemTemplate>
</div> <asp:CheckBox runat="server" ID="chkDis" />
</ContentTemplate> </ItemTemplate>
</asp:UpdatePanel> </asp:TemplateField>
</ContentTemplate> <asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
</asp:UpdatePanel> <asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="25%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
</div> <asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="15%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" />
<div class="modal-footer"> <asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="25%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" />
<asp:LinkButton ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-primary"></asp:LinkButton>
<button data-dismiss="modal" class="btn btn-default">Cancelar</button> </Columns>
</div> </asp:GridView>
</ContentTemplate> </div>
</asp:UpdatePanel> </ContentTemplate>
</div> </asp:UpdatePanel>
</div> </ContentTemplate>
</ContentTemplate> </asp:UpdatePanel>
</asp:UpdatePanel> </div>
<div id="dvEditar" class="modal ADS fade" role="dialog"> <div class="modal-footer">
<div class="modal-dialog"> <asp:LinkButton ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-primary"></asp:LinkButton>
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <button data-dismiss="modal" class="btn btn-default">Cancelar</button>
<ContentTemplate> </div>
<div class="modal-header"> </ContentTemplate>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> </asp:UpdatePanel>
<span aria-hidden="true">&times;</span> </div>
</button> </div>
<h4 class="modal-title" id="myModalLabel">Editar Georeferencia</h4> </ContentTemplate>
</div> </asp:UpdatePanel>
<div class="modal-body"> <div id="dvEditar" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpBodyGeoReferencia" UpdateMode="Conditional" runat="server"> <div class="modal-dialog">
<ContentTemplate> <asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<div class="form-group form-md-line-input input-iconright"> <ContentTemplate>
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox> <div class="modal-header">
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<label for="<%= TxtNombre.ClientID.ToString()%>">Nombre Geocerca:</label> <span aria-hidden="true">&times;</span>
</div> </button>
<h4 class="modal-title" id="myModalLabel">Editar Georeferencia</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyGeoReferencia" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtNombre.ClientID.ToString()%>">Nombre Geocerca:</label>
</div>
<%--<div class="form-group form-md-line-input input-iconright"> <%--<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEquipo" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me"> <asp:DropDownList ID="DdlEquipo" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlEquipo.ClientID.ToString()%>">Equipo:</label> <label for="<%= DdlEquipo.ClientID.ToString()%>">Equipo:</label>
</div>--%> </div>--%>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTolerancia" runat="server" Style="width: 50%; display: inline-block" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server" Text="mts"></asp:Literal> <asp:TextBox ID="TxtTolerancia" runat="server" Style="width: 50%; display: inline-block" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server" Text="mts"></asp:Literal>
<asp:RequiredFieldValidator ID="RFVTxtTolerancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTolerancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tolerancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVTxtTolerancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTolerancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tolerancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<ajax:FilteredTextBoxExtender ID="FTBSerie" runat="server" TargetControlID="TxtTolerancia" FilterType="Numbers" /> <ajax:FilteredTextBoxExtender ID="FTBSerie" runat="server" TargetControlID="TxtTolerancia" FilterType="Numbers" />
<label for="<%= TxtTolerancia.ClientID.ToString()%>" style="width: 50%">Tolerancia:</label> <label for="<%= TxtTolerancia.ClientID.ToString()%>" style="width: 50%">Tolerancia:</label>
</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>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> </div>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<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:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender> <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>
</li> <ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</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>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> </div>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<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> <ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender> <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>
</li> <ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</ul> </li>
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;"> </ul>
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
<li>Aplica Días: <li>Aplica Días:
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="L" ID="chkLunes" /> <asp:CheckBox runat="server" Text="L" ID="chkLunes" />
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="M" ID="chkMartes" /> <asp:CheckBox runat="server" Text="M" ID="chkMartes" />
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="M" ID="chkMiercoles" /> <asp:CheckBox runat="server" Text="M" ID="chkMiercoles" />
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="J" ID="chkJueves" /> <asp:CheckBox runat="server" Text="J" ID="chkJueves" />
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="V" ID="chkViernes" /> <asp:CheckBox runat="server" Text="V" ID="chkViernes" />
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="S" ID="chkSabado" /> <asp:CheckBox runat="server" Text="S" ID="chkSabado" />
</li> </li>
<li> <li>
<asp:CheckBox runat="server" Text="D" ID="chkDomingo" /> <asp:CheckBox runat="server" Text="D" ID="chkDomingo" />
</li> </li>
</ul> </ul>
<div class="row" style="margin-top: 10px; margin-bottom: 20px;"> <div class="row" style="margin-top: 10px; margin-bottom: 20px;">
<div class="col-md-1">Hora Inicio:</div> <div class="col-md-1">Hora Inicio:</div>
<div class="col-md-2"> <div class="col-md-2">
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;"> <div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
<asp:TextBox ID="TxtHoraI" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px"></asp:TextBox> <asp:TextBox ID="TxtHoraI" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px"></asp:TextBox>
</div> </div>
</div> </div>
<div class="col-md-1">Hora Fin:</div> <div class="col-md-1">Hora Fin:</div>
<div class="col-md-2"> <div class="col-md-2">
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;"> <div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
<asp:TextBox ID="TxtHoraF" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px "></asp:TextBox> <asp:TextBox ID="TxtHoraF" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px "></asp:TextBox>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<label>Activo: </label> <label>Activo: </label>
<br /> <br />
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox> <asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlGrupo" Width="230px" runat="server" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control select2me"> <asp:DropDownList ID="DdlGrupo" Width="230px" runat="server" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control select2me">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlGrupo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarGrupo"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlGrupo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarGrupo"></asp:RequiredFieldValidator>
<label for="<%= DdlGrupo.ClientID.ToString()%>">Grupo:</label> <label for="<%= DdlGrupo.ClientID.ToString()%>">Grupo:</label>
</div> </div>
</div> </div>
<div class="col-md-3" style="margin-top: 12px; text-align: right;"> <div class="col-md-3" style="margin-top: 12px; text-align: right;">
<asp:LinkButton ID="LnkAgregarGrupo" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarGrupo_Click" ValidationGroup="GrpAgregarGrupo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton> <asp:LinkButton ID="LnkAgregarGrupo" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarGrupo_Click" ValidationGroup="GrpAgregarGrupo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEquipoD" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control select2me"> <asp:DropDownList ID="DdlEquipoD" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control select2me">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEquipoD" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipoD" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarVehiculo"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVEquipoD" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipoD" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarVehiculo"></asp:RequiredFieldValidator>
<label for="<%= DdlEquipoD.ClientID.ToString()%>">Equipo:</label> <label for="<%= DdlEquipoD.ClientID.ToString()%>">Equipo:</label>
</div> </div>
</div> </div>
<div class="col-md-3" style="margin-top: 12px; text-align: right;"> <div class="col-md-3" style="margin-top: 12px; text-align: right;">
<asp:LinkButton ID="LnkAgregarDisp" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarDisp_Click" ValidationGroup="GrpAgregarVehiculo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton> <asp:LinkButton ID="LnkAgregarDisp" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarDisp_Click" ValidationGroup="GrpAgregarVehiculo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton>
</div> </div>
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvEquiposDetalle" runat="server" GridLines="None" data-height="200" DataKeyNames="CveDispositivo, NoEconomico,CveDispositivoGeoreferenciaDetalle" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" OnRowDeleting="GvEquiposDetalle_RowDeleting" EmptyDataText="Seleccione el vehiculo y presione agregar."> <asp:GridView ID="GvEquiposDetalle" runat="server" GridLines="None" data-height="200" DataKeyNames="CveDispositivo, NoEconomico,CveDispositivoGeoreferenciaDetalle" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" OnRowDeleting="GvEquiposDetalle_RowDeleting" EmptyDataText="Seleccione el vehiculo y presione agregar.">
<Columns> <Columns>
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="20%" HeaderText="NoEconomico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="NoEconomico" ItemStyle-Width="20%" HeaderText="NoEconomico" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Acciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Acciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="BtnBorrarDispositivo" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este dispositivo?" data-btn-ok-label="si" /> <asp:LinkButton ID="BtnBorrarDispositivo" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este dispositivo?" data-btn-ok-label="si" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:LinkButton ID="BtnActualizarGeoreferencia" OnClick="BtnActualizarGeoreferencia_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio">Actualizar</asp:LinkButton> <asp:LinkButton ID="BtnActualizarGeoreferencia" OnClick="BtnActualizarGeoreferencia_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio">Actualizar</asp:LinkButton>
<button id="btnCancelarTE" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar</button> <button id="btnCancelarTE" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar</button>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<div class="modal fade bottom in" style="bottom: unset" id="h"> <div class="modal fade bottom in" style="bottom: unset" id="h">
<div class="modal-dialog" style="position: fixed; bottom: 0; margin: 0px,0px,0px,0px; width: 100%; padding: 0px, 0px, 0px, 0px; border-style: solid; border-color: rgb(68, 77, 88); z-index: 539;"> <div class="modal-dialog" style="position: fixed; bottom: 0; margin: 0px,0px,0px,0px; width: 100%; padding: 0px, 0px, 0px, 0px; border-style: solid; border-color: rgb(68, 77, 88); z-index: 539;">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body" style="padding: 5px;"> <div class="modal-body" style="padding: 5px;">
<asp:UpdatePanel runat="server" ID="UPGV" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UPGV" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvBarra" runat="server" GridLines="None" data-height="200" DataKeyNames="Nombre, Posicion" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros"> <asp:GridView ID="GvBarra" runat="server" GridLines="None" data-height="200" DataKeyNames="Nombre, Posicion" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns> <Columns>
<asp:BoundField DataField="Nombre" ItemStyle-Width="100%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Nombre" ItemStyle-Width="100%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
<!-- /.modal-content --> <!-- /.modal-content -->
</div> </div>
<!-- /.modal-dialog --> <!-- /.modal-dialog -->
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server">
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script> <script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
<script> <script>
var map; var map;
function initMap() { function initMap() {
@@ -622,7 +634,7 @@
</script> </script>
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script> <script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
</asp:Content> </asp:Content>

View File

@@ -12,6 +12,14 @@ Partial Class GPS_RepGeoReferencias
Set(value As Integer) Set(value As Integer)
ViewState("CveGeoReferencia") = value ViewState("CveGeoReferencia") = value
End Set End Set
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 End Property
Private Property DtPosiciones As DataTable Private Property DtPosiciones As DataTable
Get Get
@@ -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
Else DtGeoReferencias = GPS.DtResultados.Copy()
GVGeoreferencias.DataSource = Nothing 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
GVGeoreferencias.DataSource = DtGeoReferencias
End If End If
GPS.Dispose()
GVGeoreferencias.DataBind() GVGeoreferencias.DataBind()
End Sub End Sub
Private Sub CargaDispositivos() Private Sub CargaDispositivos()
@@ -190,16 +212,11 @@ Partial Class GPS_RepGeoReferencias
TxtHoraF.Text = GvRow.DataKey("HoraFin").ToString.ToDateTime.ToString("HH:mm") TxtHoraF.Text = GvRow.DataKey("HoraFin").ToString.ToDateTime.ToString("HH:mm")
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 GvEquiposDetalle.DataSource = DtDetalle
DtDetalle = Nothing
DtDetalleEliminar = Nothing
GvEquiposDetalle.DataSource = Nothing
End If
End If End If
End Using End Using
GvEquiposDetalle.DataBind() GvEquiposDetalle.DataBind()
@@ -239,27 +256,22 @@ Partial Class GPS_RepGeoReferencias
Dim HoraF As Date = ($"{Date.Now.ToString("dd/MM/yyyy")} {TxtHoraF.Text}").ToDate Dim HoraF As Date = ($"{Date.Now.ToString("dd/MM/yyyy")} {TxtHoraF.Text}").ToDate
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,14 +348,15 @@ 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)
@@ -415,5 +428,63 @@ 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
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 Sub
End Class End Class

View File

@@ -37,8 +37,8 @@
</div> </div>
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<asp:RadioButtonList runat="server" ID="RblFormato"> <asp:RadioButtonList runat="server" ID="RblFormato">
<asp:ListItem Value="1" Text="Compras - Proveedor" Selected="True"></asp:ListItem> <asp:ListItem Value="1" Text="Proveedores" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="Ventas - Cliente"></asp:ListItem> <asp:ListItem Value="2" Text="Clientes"></asp:ListItem>
<asp:ListItem Value="3" Text="Factura - Proveedor"></asp:ListItem> <asp:ListItem Value="3" Text="Factura - Proveedor"></asp:ListItem>
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem> <asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
<asp:ListItem Value="5" Text="Productos y Sevicios" ></asp:ListItem> <asp:ListItem Value="5" Text="Productos y Sevicios" ></asp:ListItem>

View File

@@ -72,7 +72,7 @@ Partial Class General_SaldosIniciales
'Conexion.Close() 'Conexion.Close()
If Not ErrorArchivo Then If Not ErrorArchivo Then
If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then If RblFormato.SelectedValue = "1" Then
If Not dt.Columns(0).ColumnName = "Codigo" Then If Not dt.Columns(0).ColumnName = "Codigo" Then
Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError) Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -215,18 +215,18 @@ Partial Class General_SaldosIniciales
End If End If
If Not dt.Columns(14).ColumnName = "Vendedor" Then 'If Not dt.Columns(14).ColumnName = "Vendedor" Then
Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) ' Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If 'End If
If Not dt.Columns(15).ColumnName = "Clasificación" Then 'If Not dt.Columns(15).ColumnName = "Clasificación" Then
Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) ' Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If 'End If
If Not dt.Columns(16).ColumnName = "Es distribuidor" Then 'If Not dt.Columns(16).ColumnName = "Es distribuidor" Then
Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError) ' Alert("El nombre de la catorceava columna debe ser 'Es distribuidor'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If 'End If
@@ -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)

View File

@@ -483,7 +483,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4 col-sm-4"> <%--<div class="col-md-4 col-sm-4">
<asp:UpdatePanel ID="UPPTareas" runat="server" RenderMode="Inline" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPTareas" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -534,7 +534,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>--%>
<%-- <div class="col-md-2 col-sm-2"> <%-- <div class="col-md-2 col-sm-2">
<div class="portlet light "> <div class="portlet light ">
<div class="portlet-title"> <div class="portlet-title">

View File

@@ -178,7 +178,7 @@ Partial Class Inicio
CargaGraficas() CargaGraficas()
End If End If
CargaTareas() 'CargaTareas()
If UsuarioActual.CveRol = 1 Then If UsuarioActual.CveRol = 1 Then
divInd.Visible = True divInd.Visible = True
CargaSubProyectos() CargaSubProyectos()
@@ -463,39 +463,39 @@ Partial Class Inicio
End Sub End Sub
Private Sub CargaTareas() 'Private Sub CargaTareas()
Dim ObjProspectos As New ClsOIEventos ' Dim ObjProspectos As New ClsOIEventos
Dim FechaI, FechaF As DateTime ' Dim FechaI, FechaF As DateTime
Dim CveEventoEstatus As Integer = -1 ' Dim CveEventoEstatus As Integer = -1
FechaI = Now.AddDays(-180) ' FechaI = Now.AddDays(-180)
FechaF = Now ' FechaF = Now
If ObjProspectos.GetRepEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, 1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF) Then ' If ObjProspectos.GetRepEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, 1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
Dim DT As DataTable = ObjProspectos.DtResultados.Clone ' Dim DT As DataTable = ObjProspectos.DtResultados.Clone
If ChkOIPorHacer.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioPara = {0} ", UsuarioActual.CveUsuario))) ' If ChkOIPorHacer.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioPara = {0} ", UsuarioActual.CveUsuario)))
If ChkOIAsigne.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioDe = {0} ", UsuarioActual.CveUsuario))) ' If ChkOIAsigne.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioDe = {0} ", UsuarioActual.CveUsuario)))
GvT.DataSource = DT ' GvT.DataSource = DT
End If ' End If
ObjProspectos.Dispose() ' ObjProspectos.Dispose()
GvT.DataBind() ' GvT.DataBind()
End Sub 'End Sub
Protected Sub GvT_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvT.RowDataBound 'Protected Sub GvT_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvT.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then ' If e.Row.RowType = DataControlRowType.DataRow Then
Select Case UsuarioActual.CveUsuario.ToString ' Select Case UsuarioActual.CveUsuario.ToString
Case e.Row.DBCampo("CveUsuarioPara") ' Case e.Row.DBCampo("CveUsuarioPara")
'etiqueta de 'asignado' ' 'etiqueta de 'asignado'
e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-warning " ' e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-warning "
e.Row.FCLabel("LblTipo").Text = "por hacer <i class='fa fa-share'></i>" ' e.Row.FCLabel("LblTipo").Text = "por hacer <i class='fa fa-share'></i>"
Case e.Row.DBCampo("CveUsuarioDe") ' Case e.Row.DBCampo("CveUsuarioDe")
e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-success" ' e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-success"
e.Row.FCLabel("LblTipo").Text = "Asigné" ' e.Row.FCLabel("LblTipo").Text = "Asigné"
End Select ' End Select
End If ' End If
End Sub 'End Sub
Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String, Link As String, TitleComentario As String) Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String, Link As String, TitleComentario As String)
Dim htmldiv As New StringBuilder Dim htmldiv As New StringBuilder
htmldiv.AppendFormat("{0}<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12'><div class='dashboard-stat {1}'><div class='visual'><i class='{2}' '=''></i></div>", DIV.InnerHtml, Color, Icono) htmldiv.AppendFormat("{0}<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12'><div class='dashboard-stat {1}'><div class='visual'><i class='{2}' '=''></i></div>", DIV.InnerHtml, Color, Icono)
@@ -844,9 +844,9 @@ Partial Class Inicio
End Sub End Sub
#End Region #End Region
Protected Sub ChkOIAsigne_CheckedChanged(sender As Object, e As EventArgs) Handles ChkOIAsigne.CheckedChanged, ChkOIPorHacer.CheckedChanged 'Protected Sub ChkOIAsigne_CheckedChanged(sender As Object, e As EventArgs) Handles ChkOIAsigne.CheckedChanged, ChkOIPorHacer.CheckedChanged
CargaTareas() ' CargaTareas()
End Sub 'End Sub
Protected Sub DdlFiltroIndicador_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlFiltroIndicador_SelectedIndexChanged(sender As Object, e As EventArgs)
End Sub End Sub

View File

@@ -412,6 +412,15 @@ Partial Class Inventarios_RecepcionAlmacen
End Set End Set
End Property End Property
Private Property ValidarRecepcionUsados As Boolean
Get
Return If(IsNothing(ViewState("ValidarRecepcionUsados")), False, CBool(ViewState("ValidarRecepcionUsados")))
End Get
Set
ViewState("ValidarRecepcionUsados") = Value
End Set
End Property
'Private Property DtDocumentos As DataTable 'Private Property DtDocumentos As DataTable
' Get ' Get
' Return CType(ViewState("DtDocumentos"), DataTable) ' Return CType(ViewState("DtDocumentos"), DataTable)
@@ -871,6 +880,7 @@ Partial Class Inventarios_RecepcionAlmacen
RealizarTraspasoAlmacenDevolucion = False RealizarTraspasoAlmacenDevolucion = False
RealizarMovimientoVirtual = False RealizarMovimientoVirtual = False
SumarImporteUsados = False SumarImporteUsados = False
ValidarRecepcionUsados = False
BtnGuardar.Enabled = True BtnGuardar.Enabled = True
CargaAlmacenes(-1) CargaAlmacenes(-1)
@@ -925,6 +935,7 @@ Partial Class Inventarios_RecepcionAlmacen
RealizarTraspasoAlmacenDevolucion = False RealizarTraspasoAlmacenDevolucion = False
RealizarMovimientoVirtual = False RealizarMovimientoVirtual = False
SumarImporteUsados = False SumarImporteUsados = False
ValidarRecepcionUsados = False
CveAlmacenDevolucionProveedor = -1 CveAlmacenDevolucionProveedor = -1
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras
@@ -981,10 +992,12 @@ Partial Class Inventarios_RecepcionAlmacen
If NumProductos > 0 AndAlso NumUsados > 0 Then If NumProductos > 0 AndAlso NumUsados > 0 Then
DtRecepcion = ObjInventario.DtResultados.FiltraParametros("EsUsado = False") DtRecepcion = ObjInventario.DtResultados.FiltraParametros("EsUsado = False")
SumarImporteUsados = True SumarImporteUsados = True
ValidarRecepcionUsados = True
'SI LA COMPRA TIENE PUROS USADOS, MOSTRAR LOS USADOS Y CARGAR LOS ALMACENES 'SI LA COMPRA TIENE PUROS USADOS, MOSTRAR LOS USADOS Y CARGAR LOS ALMACENES
ElseIf NumProductos = 0 AndAlso NumUsados > 0 Then ElseIf NumProductos = 0 AndAlso NumUsados > 0 Then
CargaSoloUsados = True CargaSoloUsados = True
SumarImporteUsados = True SumarImporteUsados = True
ValidarRecepcionUsados = True
DtRecepcion = ObjInventario.DtResultados.Copy() DtRecepcion = ObjInventario.DtResultados.Copy()
If TipoMovimiento <> 3 Then 'sino es devolucion/NC If TipoMovimiento <> 3 Then 'sino es devolucion/NC
CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra) CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra)
@@ -997,8 +1010,10 @@ Partial Class Inventarios_RecepcionAlmacen
If ObjCompras.GetCompraDetalle(pCveCompra) Then If ObjCompras.GetCompraDetalle(pCveCompra) Then
If ObjCompras.DtResultados.COUNT("Cantidad", "CveClasificacion=20519") > 0 Then If ObjCompras.DtResultados.COUNT("Cantidad", "CveClasificacion=20519") > 0 Then
SumarImporteUsados = True SumarImporteUsados = True
ValidarRecepcionUsados = True
Else Else
SumarImporteUsados = False SumarImporteUsados = False
ValidarRecepcionUsados = False
End If End If
End If End If
@@ -2403,6 +2418,20 @@ Partial Class Inventarios_RecepcionAlmacen
Dim CvePrePoliza = -1 Dim CvePrePoliza = -1
Dim MensajeContabilidad = "" Dim MensajeContabilidad = ""
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
'VALIDA SI SE VAN A RECIBIR TODOS LOS PRODUCTOS
If ValidarRecepcionUsados Then
For Each gvr As GridViewRow In GvInv.Rows
If gvr.FCTextBox("TbCantidadF").Text.ToDecimal() <> gvr.DataKey("CantidadC").ToDecimal() Then
ValidarRecepcionUsados = False
Exit For
End If
Next
End If
End If
Try Try
'RECARGA TC CUANDO ES RECEPCION CON OC Y DOLARES 'RECARGA TC CUANDO ES RECEPCION CON OC Y DOLARES
If CveOCSurtir > 0 And CveMoneda <> 1 Then If CveOCSurtir > 0 And CveMoneda <> 1 Then
@@ -2825,7 +2854,7 @@ Partial Class Inventarios_RecepcionAlmacen
'VERIFICA SI TIENE ALMACEN VIRTUAL 'VERIFICA SI TIENE ALMACEN VIRTUAL
If CveAlmacenVirtual > 0 Then If CveAlmacenVirtual > 0 Then
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveCompra:=CveCompraSurtir, ValidaUsadosCompra:=SumarImporteUsados) Then If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveCompra:=CveCompraSurtir, ValidaUsadosCompra:=ValidarRecepcionUsados) Then
DtPSVirtual = ObjInventario.DtResultados DtPSVirtual = ObjInventario.DtResultados
End If End If
@@ -3020,7 +3049,7 @@ Partial Class Inventarios_RecepcionAlmacen
CveMovimientoRef = CveMovimiento CveMovimientoRef = CveMovimiento
End If End If
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoRef, UsuarioActual.CveEmpresa, CveCompra:=CveCompraSurtir, ValidaUsadosCompra:=SumarImporteUsados) Then If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoRef, UsuarioActual.CveEmpresa, CveCompra:=CveCompraSurtir, ValidaUsadosCompra:=ValidarRecepcionUsados) Then
DtPSVirtual = ObjInventario.DtResultados DtPSVirtual = ObjInventario.DtResultados
End If End If

View File

@@ -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

View File

@@ -161,7 +161,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
String FechaF; String FechaF;
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = ""; } else { FechaF = $"&emsp;<b>Fecha Final:</b> {txtFechaF.Text}"; } if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = ""; } else { FechaF = $"&emsp;<b>Fecha Final:</b> {txtFechaF.Text}"; }
String Proveedor; String Proveedor;
if (DdlProveedores.SelectedValue != "-1") { Proveedor = $"&emsp;<b>Proveedor:</b> {DdlProveedores.ddl.SelectedItem.Text}"; } else { Proveedor = ""; } if (DdlProveedores.SelectedValue != "-1") { Proveedor = $"&emsp;<b>Proveedor:</b> {DdlProveedores.SelectedText}"; } else { Proveedor = ""; }
String Estatus; String Estatus;
if (DdlEstatus.SelectedValue != "1") { Estatus = $"&emsp;<b>Estatus:</b> {DdlEstatus.SelectedItem.Text}"; } else { Estatus = ""; } if (DdlEstatus.SelectedValue != "1") { Estatus = $"&emsp;<b>Estatus:</b> {DdlEstatus.SelectedItem.Text}"; } else { Estatus = ""; }
String Usuario; String Usuario;
@@ -178,7 +178,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("Estatus", DdlEstatus.SelectedValue)); para.Add(new ReportParameter("Estatus", DdlEstatus.SelectedValue));
String Agrupadores = $"{Proveedor}{FechaI}{FechaF}{Estatus}{Usuario}{SubProyectos}"; String Agrupadores = $"{Proveedor}{FechaI}{FechaF}{Estatus}{Usuario}{SubProyectos}";
para.Add(new ReportParameter("AgrupadoPor", (Agrupadores == "" ? "": $"<b>Agrupado Por:</b> {Agrupadores}"))); para.Add(new ReportParameter("AgrupadoPor", (Agrupadores == "" ? "": $" {Agrupadores}")));
if (Imagen.Exists) if (Imagen.Exists)
{ {
para.Add(new ReportParameter("LogoPath", logouri)); para.Add(new ReportParameter("LogoPath", logouri));

View File

@@ -139,7 +139,7 @@ public partial class OI_TareaDetalle : ClsPaginas
} }
private void Setpermisos() private void Setpermisos()
{ {
bool permisedestatus = (CveEventoEstatus > 1 && CveEventoEstatus < 4); bool permisedestatus = (CveEventoEstatus < 4);
bool esmiembro = UsuarioActual.CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>()); bool esmiembro = UsuarioActual.CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>());
bool esdeel = UsuarioActual.CveUsuario == CveUsuarioDe; bool esdeel = UsuarioActual.CveUsuario == CveUsuarioDe;
bool esPara = UsuarioActual.CveUsuario == CveUsuarioPara; bool esPara = UsuarioActual.CveUsuario == CveUsuarioPara;
@@ -467,7 +467,7 @@ public partial class OI_TareaDetalle : ClsPaginas
int CveOS = drow["CveOS"].ToString().ToEntero(); int CveOS = drow["CveOS"].ToString().ToEntero();
int CveOC = drow["CveOC"].ToString().ToEntero(); int CveOC = drow["CveOC"].ToString().ToEntero();
int CveContrato = drow["CveContrato"].ToString().ToEntero(); int CveContrato = drow["CveContrato"].ToString().ToEntero();
//int CveSubProyecto = drow["CveSubProyecto"].ToString().ToEntero(); int CveSubProyecto = drow["CveSubProyecto"].ToString().ToEntero();
int CveMovimientoAlmacen = drow["CveMovimientoAlmacen"].ToString().ToEntero(); int CveMovimientoAlmacen = drow["CveMovimientoAlmacen"].ToString().ToEntero();
//int = drow[""].ToString().ToEntero(); //int = drow[""].ToString().ToEntero();
@@ -534,11 +534,11 @@ public partial class OI_TareaDetalle : ClsPaginas
titulo = "Contrato"; titulo = "Contrato";
link = string.Format("<a href=\"/Contratos/Contrato.aspx?CveContrato={1}\" class=\"linkCorreo\">{0} </a>", drow["Contrato"], CveContrato); link = string.Format("<a href=\"/Contratos/Contrato.aspx?CveContrato={1}\" class=\"linkCorreo\">{0} </a>", drow["Contrato"], CveContrato);
} }
//else if (CveSubProyecto > 0) else if (CveSubProyecto > 0)
//{ {
// titulo = "Sub Proyecto"; titulo = "Sub Proyecto";
// link = string.Format("<a href=\"/?={1}\" class=\"linkCorreo\">{0} </a>", drow["SubProyecto"], CveSubProyecto); link = string.Format("<a href=\"/?={1}\" class=\"linkCorreo\">{0} </a>", drow["SubProyecto"], CveSubProyecto);
//} }
else if (CveMovimientoAlmacen > 0) else if (CveMovimientoAlmacen > 0)
{ {
titulo = "Almacen"; titulo = "Almacen";

View File

@@ -4787,7 +4787,7 @@
<ajax:MaskedEditExtender ID="mskTelefono" runat="server" TargetControlID="TxtTelefonoSucursal" ClearMaskOnLostFocus="false" MaskType="None" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="mskTelefono" runat="server" TargetControlID="TxtTelefonoSucursal" ClearMaskOnLostFocus="false" MaskType="None" Mask="(999) 999-9999" MessageValidatorTip="true" InputDirection="LeftToRight" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
<label for="<%= TxtTelefonoSucursal.ClientID.ToString()%>">Teléfono:</label> <label for="<%= TxtTelefonoSucursal.ClientID.ToString()%>">Teléfono:</label>
</div> </div>
<div id="DivRFCSucursal" visible="false" runat="server" class="form-group form-md-line-input input-iconright col-xs-8"> <div id="DivRFCSucursal" runat="server" class="form-group form-md-line-input input-iconright col-xs-8">
<asp:TextBox ID="TxtRFCSucursal" Style="text-transform: uppercase;" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtRFCSucursal" Style="text-transform: uppercase;" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVRFCSucursal" runat="server" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardarSucursal" ControlToValidate="TxtRFCSucursal" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator> <asp:RegularExpressionValidator ID="REVRFCSucursal" runat="server" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardarSucursal" ControlToValidate="TxtRFCSucursal" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
<label for="<%= TxtRFCSucursal.ClientID.ToString()%>">RFC:</label> <label for="<%= TxtRFCSucursal.ClientID.ToString()%>">RFC:</label>
@@ -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",

View File

@@ -7,7 +7,14 @@ 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
@@ -1797,22 +1804,27 @@ Partial Class Clientes
Return Retorno Return Retorno
End Function End Function
Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1)
Dim ObjClientes As New ClsClientes() Dim ObjClientes As New ClsClientes()
If ObjClientes.GetHistorialVentas(CveCliente, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then If ObjClientes.GetHistorialVentas(CveCliente, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then If ObjClientes.DtResultados.Rows.Count > 0 Then
'Carga Grid 'Carga Grid
DTHistorialVentas = ObjClientes.DtResultados DTHistorialVentas = ObjClientes.DtResultados
GVHistorial.DataSource = ObjClientes.DtResultados GVHistorial.DataSource = ObjClientes.DtResultados
Else Else
GVHistorial.DataSource = Nothing GVHistorial.DataSource = Nothing
End If End If
Else Else
GVHistorial.DataSource = Nothing GVHistorial.DataSource = Nothing
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
@@ -3036,7 +3048,7 @@ Partial Class Clientes
If ObjCliente.UpdateSucursal(TxtNombreSucursal.Text.Trim, Estatus, CveCliente, CveClienteSuc, TxtCiudadSucursal.Text.Trim, TxtColoniaSucursal.Text.Trim, TxtCPSucursal.Text.Trim, TxtDireccionSucursal.Text.Trim, TxtEstadoSucursal.Text.Trim, TxtLocalidadSucursal.Text.Trim, TxtPaisSucursal.Text.Trim, TxtNumExtSucursal.Text.Trim, TxtNumIntSucursal.Text.Trim, If ObjCliente.UpdateSucursal(TxtNombreSucursal.Text.Trim, Estatus, CveCliente, CveClienteSuc, TxtCiudadSucursal.Text.Trim, TxtColoniaSucursal.Text.Trim, TxtCPSucursal.Text.Trim, TxtDireccionSucursal.Text.Trim, TxtEstadoSucursal.Text.Trim, TxtLocalidadSucursal.Text.Trim, TxtPaisSucursal.Text.Trim, TxtNumExtSucursal.Text.Trim, TxtNumIntSucursal.Text.Trim,
TxtTelefonoSucursal.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), TxtCorreoSucursal.Text.Trim, TxtCorreoSucursalCotizacion.Text.Trim, TxtContactoSucursal.Text.Trim, DdlVendedorSucursal.SelectedValue.ToEntero(), TxtNumeroCuenta.Text, DdlMetodoPagoSucursal.SelectedValue.ToEntero(), TxtLimiteCreditoSucursal.Text.ToDecimal(), DdlResponsableSucursal.SelectedValue.ToEntero(), TxtTelefonoSucursal.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), TxtCorreoSucursal.Text.Trim, TxtCorreoSucursalCotizacion.Text.Trim, TxtContactoSucursal.Text.Trim, DdlVendedorSucursal.SelectedValue.ToEntero(), TxtNumeroCuenta.Text, DdlMetodoPagoSucursal.SelectedValue.ToEntero(), TxtLimiteCreditoSucursal.Text.ToDecimal(), DdlResponsableSucursal.SelectedValue.ToEntero(),
DdlSucursalUsoCFDI.SelectedValue.ToEntero(), DdlSucursalFormaPago33.SelectedValue.ToEntero(), DdlSucursalMetodoPago33.SelectedValue.ToEntero(), LT:=LT, LG:=LG) Then DdlSucursalUsoCFDI.SelectedValue.ToEntero(), DdlSucursalFormaPago33.SelectedValue.ToEntero(), DdlSucursalMetodoPago33.SelectedValue.ToEntero(), LT:=LT, LG:=LG, RFC:=RFC) Then
GVSucursales.EditIndex = -1 GVSucursales.EditIndex = -1
ViewState("DTSucursalesCliente") = ObjCliente.DtResultados ViewState("DTSucursalesCliente") = ObjCliente.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
@@ -3052,7 +3064,7 @@ Partial Class Clientes
Else Else
If ObjCliente.AddSucursal(CveCliente, TxtNombreSucursal.Text.Trim, UsuarioActual.CveUsuario, TxtCiudadSucursal.Text.Trim, TxtColoniaSucursal.Text.Trim, TxtCPSucursal.Text.Trim, TxtDireccionSucursal.Text.Trim, TxtEstadoSucursal.Text.Trim, TxtLocalidadSucursal.Text.Trim, TxtPaisSucursal.Text.Trim, TxtNumExtSucursal.Text.Trim, TxtNumIntSucursal.Text.Trim, TxtTelefonoSucursal.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", ""), TxtCorreoSucursal.Text.Trim, TxtCorreoSucursalCotizacion.Text.Trim, TxtContactoSucursal.Text.Trim, If ObjCliente.AddSucursal(CveCliente, TxtNombreSucursal.Text.Trim, UsuarioActual.CveUsuario, TxtCiudadSucursal.Text.Trim, TxtColoniaSucursal.Text.Trim, TxtCPSucursal.Text.Trim, TxtDireccionSucursal.Text.Trim, TxtEstadoSucursal.Text.Trim, TxtLocalidadSucursal.Text.Trim, TxtPaisSucursal.Text.Trim, TxtNumExtSucursal.Text.Trim, TxtNumIntSucursal.Text.Trim, TxtTelefonoSucursal.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", ""), TxtCorreoSucursal.Text.Trim, TxtCorreoSucursalCotizacion.Text.Trim, TxtContactoSucursal.Text.Trim,
DdlVendedorSucursal.SelectedValue.ToEntero(), TxtNumeroCuenta.Text, DdlMetodoPagoSucursal.SelectedValue.ToEntero(), TxtLimiteCreditoSucursal.Text.ToDecimal(), DdlResponsableSucursal.SelectedValue.ToEntero(), DdlVendedorSucursal.SelectedValue.ToEntero(), TxtNumeroCuenta.Text, DdlMetodoPagoSucursal.SelectedValue.ToEntero(), TxtLimiteCreditoSucursal.Text.ToDecimal(), DdlResponsableSucursal.SelectedValue.ToEntero(),
DdlSucursalUsoCFDI.SelectedValue.ToEntero(), DdlSucursalFormaPago33.SelectedValue.ToEntero(), DdlSucursalMetodoPago33.SelectedValue.ToEntero(), LT:=LT, LG:=LG) Then DdlSucursalUsoCFDI.SelectedValue.ToEntero(), DdlSucursalFormaPago33.SelectedValue.ToEntero(), DdlSucursalMetodoPago33.SelectedValue.ToEntero(), LT:=LT, LG:=LG, RFC:=RFC) Then
TxtNombreSucursal.Text = "" TxtNombreSucursal.Text = ""
TxtCiudadSucursal.Text = "" TxtCiudadSucursal.Text = ""
TxtColoniaSucursal.Text = "" TxtColoniaSucursal.Text = ""
@@ -3175,7 +3187,7 @@ Partial Class Clientes
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GVSucursales.RowEditing Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GVSucursales.RowEditing
Me.Actualizar = True Me.Actualizar = True
Me.DivRFCSucursal.Visible = False 'Me.DivRFCSucursal.Visible = False
Me.CveClienteSuc = GVSucursales.DataKeys(e.NewEditIndex).Value.ToString().ToEntero() Me.CveClienteSuc = GVSucursales.DataKeys(e.NewEditIndex).Value.ToString().ToEntero()
@@ -3197,7 +3209,7 @@ Partial Class Clientes
TxtNumIntSucursal.Text = ObjCliente.DtResultados.Rows(0)("NoInt").ToString() TxtNumIntSucursal.Text = ObjCliente.DtResultados.Rows(0)("NoInt").ToString()
TxtTelefonoSucursal.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString() TxtTelefonoSucursal.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString()
TxtRFCSucursal.Text = ObjCliente.DtResultados.Rows(0)("RFC").ToString() TxtRFCSucursal.Text = ObjCliente.DtResultados.Rows(0)("RFC").ToString()
DivRFCSucursal.Visible = Not String.IsNullOrEmpty(TxtRFCSucursal.Text.Trim()) 'DivRFCSucursal.Visible = Not String.IsNullOrEmpty(TxtRFCSucursal.Text.Trim())
TxtCorreoSucursal.Text = ObjCliente.DtResultados.Rows(0)("Correo").ToString() TxtCorreoSucursal.Text = ObjCliente.DtResultados.Rows(0)("Correo").ToString()
TxtCorreoSucursalCotizacion.Text = ObjCliente.DtResultados(0)("CorreoCotizacion").ToString() TxtCorreoSucursalCotizacion.Text = ObjCliente.DtResultados(0)("CorreoCotizacion").ToString()
TxtContactoSucursal.Text = ObjCliente.DtResultados.Rows(0)("Contacto").ToString() TxtContactoSucursal.Text = ObjCliente.DtResultados.Rows(0)("Contacto").ToString()
@@ -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

View File

@@ -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">&nbsp;</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">&nbsp;</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" />
@@ -2944,7 +2943,7 @@
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%" AutoPostBack="true"> <asp:DropDownList ID="DdlFolioGarantia" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="FolioGarantia" DataValueField="CveFolioGarantia" Width="100%" AutoPostBack="true">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVFolioGarantia" runat="server" ControlToValidate="DdlFolioGarantia" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVFolioGarantia" runat="server" ControlToValidate="DdlFolioGarantia" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFolioGarantia" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolioGarantia"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEFolioGarantia" runat="server" HighlightCssClass="vco" TargetControlID="RFVFolioGarantia"></ajax:ValidatorCalloutExtender>
@@ -3163,7 +3162,7 @@
//MARCA OPTIMA //MARCA OPTIMA
if (CveMarca == "1086") { if (CveMarca == "1086") {
var regex = new RegExp("^\d{4}$|^[A-L][0-9][1-9A-Z][A-HJ-M]$"); var regex = new RegExp("[0-9]{4}");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
//MARCA MOTOBATERIAS //MARCA MOTOBATERIAS

View File

@@ -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
@@ -3953,6 +3954,19 @@ Partial Class PV
End Sub End Sub
Private Sub DdlSubProyectoDatos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyectoDatos.SelectedIndexChanged Private Sub DdlSubProyectoDatos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyectoDatos.SelectedIndexChanged
CambiaSucursalGeneral() CambiaSucursalGeneral()
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa, Estatus:=1, Area:=1) Then
DdlFolioGarantia.DataSource = ObjAcum.DtResultados.FiltraParametros($"CveSubProyecto={DdlSubProyectoDatos.SelectedValue}")
End If
ObjAcum.Dispose()
DdlFolioGarantia.DataBind()
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
UpAjuste.Update()
UpModalVenta.Update()
End Sub End Sub
Private Sub CambiaSucursalGeneral() Private Sub CambiaSucursalGeneral()
Dim ObjSubProyectos As New ClsSubProyectos Dim ObjSubProyectos As New ClsSubProyectos
@@ -6227,10 +6241,12 @@ Partial Class PV
Private Sub CargaAjuste() Private Sub CargaAjuste()
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa, Estatus:=1, Area:=1) Then If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa, Estatus:=1, Area:=1) Then
DdlFolioGarantia.DataSource = ObjAcum.DtResultados DdlFolioGarantia.DataSource = ObjAcum.DtResultados.Copy().FiltraParametros($"CveSubProyecto={DdlSubProyectoDatos.SelectedValue}")
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If End If
ObjAcum.Dispose() ObjAcum.Dispose()
DdlFolioGarantia.DataBind()
DdlFolioGarantia.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlFacturas.Items.Insert(0, New ListItem("Sin Factura", "-1")) DdlFacturas.Items.Insert(0, New ListItem("Sin Factura", "-1"))
@@ -6263,6 +6279,8 @@ Partial Class PV
DdlDistribuidor.setEsWebService(True) DdlDistribuidor.setEsWebService(True)
DivChkAjuste.Visible = True DivChkAjuste.Visible = True
UpAjuste.Update()
UpModalVenta.Update()
End Sub End Sub
Private Sub CargaModelos() Private Sub CargaModelos()
@@ -6535,6 +6553,13 @@ Partial Class PV
HdnPSAjusteMarca.Value = CveMarca.ToString() HdnPSAjusteMarca.Value = CveMarca.ToString()
HdnPSAjusteClasificacion.Value = CveClasificacion.ToString() HdnPSAjusteClasificacion.Value = CveClasificacion.ToString()
'MARCA OPTIMA
If CveMarca = 1086 Then
TxtCodInspeccion.MaxLength = 4
Else
TxtCodInspeccion.MaxLength = 50
End If
End If End If
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
@@ -6800,26 +6825,29 @@ Partial Class PV
End Sub End Sub
Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFolioGarantia.SelectedIndexChanged Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFolioGarantia.SelectedIndexChanged
Dim ObjAcumuladores As New ClsAcumuladores If DdlFolioGarantia.SelectedValue.ToEntero > 0 Then
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then Dim ObjAcumuladores As New ClsAcumuladores
Dim resultado As Integer = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo").ToEntero If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
If ObjAcumuladores.FoliosGarantiaGet(DdlFolioGarantia.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then Dim resultado As Integer = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo").ToEntero
Dim Limite As Integer = If(ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite") IsNot Nothing, ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite").ToEntero, 0) 'ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite").ToEntero If ObjAcumuladores.FoliosGarantiaGet(DdlFolioGarantia.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If resultado < Limite Or Limite = 0 Then Dim Limite As Integer = If(ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite") IsNot Nothing, ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite").ToEntero, 0) 'ObjAcumuladores.DtResultados.FiltroPrimeroValor("Limite").ToEntero
TxtConsecutivoAjuste.Text = (resultado + 1).ToString If resultado < Limite Or Limite = 0 Then
Else TxtConsecutivoAjuste.Text = (resultado + 1).ToString
Alert("limite de folios alcanzado") Else
Alert("limite de folios alcanzado")
End If
End If End If
UpAjuste.Update()
End If End If
UpAjuste.Update() ObjAcumuladores.Dispose()
End If
ObjAcumuladores.Dispose()
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero()) Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia) Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
End If
End If End If
End Sub End Sub
#End Region #End Region
@@ -7449,13 +7477,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 +7555,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

View File

@@ -96,12 +96,12 @@ Partial Class Ventas_RepVentas
If UsuarioActual.CveEmpresa = 72 AndAlso UsuarioActual.CveUsuario.Contiene(100, 1614, 1517) Then If UsuarioActual.CveEmpresa = 72 AndAlso UsuarioActual.CveUsuario.Contiene(100, 1614, 1517) Then
liRepHP.Visible = True liRepHP.Visible = True
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

View File

@@ -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()
@@ -4308,7 +4308,7 @@ Partial Class Ventas
End If End If
If CveEmpresaCRM > 0 Then If CveEmpresaCRM > 0 And Not CveCliente > 0 Then
CargaEmpresaCRM(CveEmpresaCRM) CargaEmpresaCRM(CveEmpresaCRM)
Else Else
CveEmpresaCRM = IIf(CveEmpresaCRM > 0, CveEmpresaCRM, 0).ToString().ToEntero() CveEmpresaCRM = IIf(CveEmpresaCRM > 0, CveEmpresaCRM, 0).ToString().ToEntero()
@@ -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
@@ -16686,6 +16730,7 @@ Partial Class Ventas
Dim TotalCalculableImpuestos As Decimal = 0 Dim TotalCalculableImpuestos As Decimal = 0
Dim TotalCalculableImpuestosIVA As Decimal = 0 Dim TotalCalculableImpuestosIVA As Decimal = 0
PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
Descuento = Descuento.RoundSQL(NumeroDecimales)
If Not TmpDT.Columns.Contains("RetIVA") Then If Not TmpDT.Columns.Contains("RetIVA") Then
TmpDT.Columns.Add("RetIVA", GetType(Decimal)) TmpDT.Columns.Add("RetIVA", GetType(Decimal))
@@ -16950,7 +16995,7 @@ Partial Class Ventas
If PrecioSugerido > 0 Then If PrecioSugerido > 0 Then
PU = PrecioSugerido PU = PrecioSugerido
End If End If
PU = Math.Round(PU, 6) PU = PU.RoundSQL(6)
DrPoliza("PU") = PU DrPoliza("PU") = PU
TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString().ToDecimal * (PU)) TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString().ToDecimal * (PU))
@@ -16960,18 +17005,18 @@ Partial Class Ventas
DrPoliza("PorcentajeIVA") = DrPSAdicional("IVA") DrPoliza("PorcentajeIVA") = DrPSAdicional("IVA")
End If End If
DrPoliza("IVA") = DrPoliza("PorcentajeIVA") DrPoliza("IVA") = DrPoliza("PorcentajeIVA")
DrPoliza("ImporteIVA") = Math.Round(DrPoliza("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestos, NumeroDecimales) DrPoliza("ImporteIVA") = (DrPoliza("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
DrPoliza("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales) DrPoliza("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
DrPoliza("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales) DrPoliza("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
DrPoliza("PorcentajeRetIVA") = ClienteRetIVA DrPoliza("PorcentajeRetIVA") = ClienteRetIVA
DrPoliza("PorcentajeRetISR") = ClienteRetISR DrPoliza("PorcentajeRetISR") = ClienteRetISR
DrPoliza("PorcentajeIEPS") = DrPSAdicional("IEPSPorcentaje") DrPoliza("PorcentajeIEPS") = DrPSAdicional("IEPSPorcentaje")
DrPoliza("ImporteIEPS") = Math.Round(DrPSAdicional("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos, NumeroDecimales) DrPoliza("ImporteIEPS") = (DrPSAdicional("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
DrPoliza("IEPS") = DrPoliza("ImporteIEPS") DrPoliza("IEPS") = DrPoliza("ImporteIEPS")
DrPoliza("Descuento") = 0 ' Descuento DrPoliza("Descuento") = 0 ' Descuento
DrPoliza("TipoDescuento") = HdnTipoDescuento.Value DrPoliza("TipoDescuento") = HdnTipoDescuento.Value
DrPoliza("Total") = (DrPoliza("Cantidad").ToString().ToDecimal * PU) DrPoliza("Total") = (DrPoliza("Cantidad").ToString().ToDecimal * PU)
DrPoliza("TotalImporte") = Math.Round(DrPoliza("Cantidad").ToString().ToDecimal * PU, NumeroDecimales) DrPoliza("TotalImporte") = (DrPoliza("Cantidad").ToString().ToDecimal * PU).RoundSQL(NumeroDecimales)
DrPoliza("SATClaveProdServ") = DrPSAdicional("SATClavePS") DrPoliza("SATClaveProdServ") = DrPSAdicional("SATClavePS")
DrPoliza("SATClaveUM") = DrPSAdicional("SATClaveUnidadMedida") DrPoliza("SATClaveUM") = DrPSAdicional("SATClaveUnidadMedida")
@@ -17510,13 +17555,13 @@ Partial Class Ventas
End Sub End Sub
Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False) Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False)
Dim TotalSubTotal As Decimal = TmpDT.SUM("TotalImporte").ToDecimal Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte")
Dim TotalDescuentos As Decimal = TmpDT.SUM("Descuento").ToDecimal Dim TotalDescuentos As Decimal = TmpDT.SUMD("Descuento")
Dim TotalAmortizacion As Decimal = LblAmortizacion.Text.ToDecimal Dim TotalAmortizacion As Decimal = LblAmortizacion.Text.ToDecimal
Dim TotalIVA As Decimal = TmpDT.SUM("ImporteIVA").ToDecimal Dim TotalIVA As Decimal = TmpDT.SUMD("ImporteIVA")
Dim TotalIEPS As Decimal = TmpDT.SUM("ImporteIEPS").ToDecimal Dim TotalIEPS As Decimal = TmpDT.SUMD("ImporteIEPS")
Dim TotalRetIVA As Decimal = TmpDT.SUM("ImporteRetIVA").ToDecimal Dim TotalRetIVA As Decimal = TmpDT.SUMD("ImporteRetIVA")
Dim TotalRetISR As Decimal = TmpDT.SUM("ImporteRetISR").ToDecimal Dim TotalRetISR As Decimal = TmpDT.SUMD("ImporteRetISR")
Dim Total As Decimal = 0 Dim Total As Decimal = 0
Dim TotalImpuestosLocales As Decimal = 0 Dim TotalImpuestosLocales As Decimal = 0
@@ -17536,11 +17581,11 @@ Partial Class Ventas
End If End If
TmpDT.AcceptChanges() TmpDT.AcceptChanges()
TotalIVA = TmpDT.SUM("ImporteIVA").ToDecimal TotalIVA = TmpDT.SUMD("ImporteIVA")
TotalIEPS = TmpDT.SUM("ImporteIEPS").ToDecimal TotalIEPS = TmpDT.SUMD("ImporteIEPS")
TotalRetIVA = TmpDT.SUM("ImporteRetIVA").ToDecimal TotalRetIVA = TmpDT.SUMD("ImporteRetIVA")
TotalRetISR = TmpDT.SUM("ImporteRetISR").ToDecimal TotalRetISR = TmpDT.SUMD("ImporteRetISR")
TotalImpuestosLocales = TmpDTImpuestos.SUM("Importe").ToDecimal TotalImpuestosLocales = TmpDTImpuestos.SUMD("Importe")
End If End If
End If End If
@@ -19405,17 +19450,28 @@ Partial Class Ventas
ViewState("CveClienteAnterior") = CveCliente ViewState("CveClienteAnterior") = CveCliente
'SI EL DETALLE NO TIENE MOVIMIENTOS DE INVENTARIO ES VISIBLE
Dim CantidadFacturadaRemision = 0.0 Dim CantidadFacturadaRemision = 0.0
For Each Gvr As GridViewRow In GvPS.Rows
Gvr.FCLinkButton("imgE").Visible = Not Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble > 0 'EN BDH NO DEBE PERMITIR EDITAR EL PU
Gvr.FCLinkButton("imgD").Visible = Not Gvr.DataKey("CantidadInventario").ToString().ToDouble > 0 If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble For Each Gvr As GridViewRow In GvPS.Rows
'If GvInv.Rows.Count > 0 Then Gvr.FCLinkButton("imgE").Visible = False
' Gvr.FCLinkButton("imgE").Enabled = False Gvr.FCLinkButton("imgD").Visible = False
' Gvr.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen." CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble
'End If Next
Next Else
'SI EL DETALLE NO TIENE MOVIMIENTOS DE INVENTARIO ES VISIBLE
For Each Gvr As GridViewRow In GvPS.Rows
Gvr.FCLinkButton("imgE").Visible = Not Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble > 0
Gvr.FCLinkButton("imgD").Visible = Not Gvr.DataKey("CantidadInventario").ToString().ToDouble > 0
CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble
'If GvInv.Rows.Count > 0 Then
' Gvr.FCLinkButton("imgE").Enabled = False
' Gvr.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
'End If
Next
End If
'ACTIVA CAMBIO DE CLIENTE - SI NO TIENE NADA FACTURADO 'ACTIVA CAMBIO DE CLIENTE - SI NO TIENE NADA FACTURADO
If Not CantidadFacturadaRemision > 0 AndAlso UsuarioActual.TienePermisoProceso(284) Then If Not CantidadFacturadaRemision > 0 AndAlso UsuarioActual.TienePermisoProceso(284) Then
@@ -25074,8 +25130,8 @@ Partial Class Ventas
For Each Dr As DataRow In DtImpuestos.Rows For Each Dr As DataRow In DtImpuestos.Rows
AgregaTempDT(TmpDTDescNC, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(), AgregaTempDT(TmpDTDescNC, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString().ToDecimal, Dr("PorcentajeIVA").ToString().ToDecimal, Dr("ImporteIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("ImporteRetIVA").ToString().ToDecimal, TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("ImporteRetIVA").ToString().ToDecimal,
Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("ImporteRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("ImporteIEPS").ToString().ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString().ToDecimal, "", "", -1, -1, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("ImporteRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("ImporteIEPS").ToString().ToDecimal, -1, 0, Dr("ImporteTotal").ToString().ToDecimal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1)
Next Next
End If End If
@@ -25134,7 +25190,7 @@ Partial Class Ventas
AgregaTempDT(TmpDT, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(), AgregaTempDT(TmpDT, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString().ToDecimal + Ajuste, Dr("PorcentajeIVA").ToString().ToDecimal, Dr("ImporteIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("ImporteRetIVA").ToString().ToDecimal, TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString().ToDecimal + Ajuste, Dr("PorcentajeIVA").ToString().ToDecimal, Dr("ImporteIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("ImporteRetIVA").ToString().ToDecimal,
Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("ImporteRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("ImporteIEPS").ToString().ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString().ToDecimal(), "", "", -1, -1, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("ImporteRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("ImporteIEPS").ToString().ToDecimal, -1, 0, Dr("ImporteTotal").ToString().ToDecimal(), "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1)
Next Next
@@ -25247,7 +25303,7 @@ Partial Class Ventas
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(), AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero()) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero())
If Terminar Then If Terminar Then
@@ -25330,7 +25386,7 @@ Partial Class Ventas
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(), AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA, Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
0, ImporteRetISR, 0, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, 0, ImporteRetISR, 0, ImporteIEPS, -1, 0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero()) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero())
If Terminar Then If Terminar Then
@@ -25419,7 +25475,7 @@ Partial Class Ventas
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(), AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
RowCargo("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowCargo("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowCargo("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowCargo("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1)
Next Next
@@ -25536,9 +25592,9 @@ Partial Class Ventas
End Function End Function
Private Sub AgregaTempDT(ByRef TmpDT As DataTable, CvePS As Integer, PS As String, Codigo As String, CodigoPS As String, CveTipoPS As Integer, CveTipoInvPS As Integer, CveUM As Integer, UM As String, Private Sub AgregaTempDT(ByRef TmpDT As DataTable, CvePS As Integer, PS As String, Codigo As String, CodigoPS As String, CveTipoPS As Integer, CveTipoInvPS As Integer, CveUM As Integer, UM As String,
CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
Obs As String, Cantidad As Double, PU As Double, PorcentajeIVA As Double, ImporteIVA As Double, PorcentajeRetIVA As Double, ImporteRetIVA As Double, Obs As String, Cantidad As Decimal, PU As Decimal, PorcentajeIVA As Decimal, ImporteIVA As Decimal, PorcentajeRetIVA As Decimal, ImporteRetIVA As Decimal,
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double, PorcentajeRetISR As Decimal, ImporteRetISR As Decimal, PorcentajeIEPS As Decimal, ImporteIEPS As Decimal, TipoDescuento As Integer, Descuento As Decimal,
Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String, Total As Decimal, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer, SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1, Optional CveVentaDetalleRNC As Integer = -1) CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1, Optional CveVentaDetalleRNC As Integer = -1)
@@ -25567,7 +25623,7 @@ Partial Class Ventas
Row("Obs") = Obs Row("Obs") = Obs
Row("Cantidad") = Cantidad Row("Cantidad") = Cantidad
Row("PU") = Math.Round(PU, 6) Row("PU") = PU.RoundSQL(6)
Row("PorcentajeIVA") = PorcentajeIVA Row("PorcentajeIVA") = PorcentajeIVA
Row("IVA") = PorcentajeIVA Row("IVA") = PorcentajeIVA
Row("ImporteIVA") = Math.Round(ImporteIVA, NumeroDecimales) Row("ImporteIVA") = Math.Round(ImporteIVA, NumeroDecimales)
@@ -27328,11 +27384,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 +27421,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 +27457,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 +27553,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 +28702,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