diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb
index e2b64d68d..ad11b7002 100644
--- a/Acumuladores/CatFoliosGarantia.aspx.vb
+++ b/Acumuladores/CatFoliosGarantia.aspx.vb
@@ -98,19 +98,20 @@ Partial Class Acumuladores_CatFoliosGarantia
End Sub
- Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click
-
- Dim ObjAcum As New ClsAcumuladores
-
- 'Dim Cargo, Bonificacion, Compra, Puntos As Decimal
-
- 'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1)
- 'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1)
- 'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1)
- 'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1)
-
-
- If Not Actualizar Then
+ Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click
+
+
+
+ 'Dim Cargo, Bonificacion, Compra, Puntos As Decimal
+
+ 'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1)
+ 'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1)
+ 'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1)
+ 'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1)
+
+
+ If Not Actualizar Then
+ Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then
TxtFolioGarantia.Text = ""
@@ -128,8 +129,16 @@ Partial Class Acumuladores_CatFoliosGarantia
Alert("Folio de Garantía Agregado Correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError)
- End If
- Else
+ End If
+ ObjAcum.Dispose()
+ Else
+ 'si se marca como enviado, debe de revisar que tenga el movto de traslado
+ If HdnCveMovimientoSalida.Value = "" AndAlso DdlEstatusEditar.SelectedValue = "2" Then
+ Alert("No se ha realizado la salida del almacen de garantía, al de 'devolución al proveedor'. Favor de aplicar la salida y luego cambiar el estatus a enviado. ", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero,
DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then
@@ -149,14 +158,15 @@ Partial Class Acumuladores_CatFoliosGarantia
Alert("Folio de Garantía Actualizado Correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al Actualizar el Folio de Garantía", TipoMensaje.MsgError)
- End If
+ End If
+ ObjAcum.Dispose()
End If
CveFolioGarantia = -1
- Actualizar = False
-
- ObjAcum.Dispose()
-
+ Actualizar = False
+
+
+
End Sub
Public Sub Remove_ClickFolioGarantia(sender As Object, e As EventArgs)
@@ -188,6 +198,7 @@ Partial Class Acumuladores_CatFoliosGarantia
TxtLimite.Text = GvRow.DataKey("Limite")
DdlTipoFolioModal.SelectedValue = GvRow.DataKey("tipoFolio")
DdlArea.SelectedValue = GvRow.DataKey("Area")
+ HdnCveMovimientoSalida.Value = GvRow.DataKey("CveMovimiento")
'TxtCargo.Text = GvRow.DataKey("Cargo").ToDecimal.ToString("###,###,###.00")
'TxtBonificacion.Text = GvRow.DataKey("Bonificacion").ToDecimal.ToString("###,###,###.00")
'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00")
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 966e36d81..59a28d0d3 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -6320,6 +6320,27 @@ Public Class ClsInventarios
#End Region
+
+ Public Function GetValidaFechaAlmacen(CveEmpresa As Integer, CveAlmacen As Integer, CvePS As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Inv_ValidaFechaAlmacenGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al consultar los productos por fechas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
#Region " IDisposable Support "
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
@@ -6352,6 +6373,8 @@ Public Class ClsInventarios
+
+
#End Region
End Class
diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb
index a9c72b31a..312701d11 100644
--- a/App_Code/ClsOC.vb
+++ b/App_Code/ClsOC.vb
@@ -1745,6 +1745,39 @@ Public Class ClsOC
Return Retorno
End Function
+ Public Function GetOrdenesCompraVinculacion(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveEstatus As Integer, FechaInicio As Date,
+ FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuario As Integer,
+ CveEmpresa As Integer, Optional Serie As String = "-1") As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OC_OrdenesCompraVinculacion")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Tipo", SqlDbType.VarChar).Value = Tipo
+ .Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Folio", SqlDbType.Int).Value = Folio
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Serie", SqlDbType.VarChar).Value = Serie
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener Ordenes de Compras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function GetOrdenesCompraCorreo(CveCompra As Integer, Optional CveMovimiento As Integer = -1) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb
index 43dadaa3d..3f57aef6b 100644
--- a/App_Code/ClsOIEventos.vb
+++ b/App_Code/ClsOIEventos.vb
@@ -2493,13 +2493,14 @@ Public Class ClsOIEventos
Optional RecurrenciaTipo As Integer = -1, Optional Frecuencia As Integer = -1, Optional DiasSemana As String = "-1", Optional Dia As Integer = -1, Optional Mes As Integer = -1,
Optional RecurrenciaFin As String = "-1", Optional CveTipoEvento As Integer = 2, Optional Importe As Double = -1,
Optional CveEmpresaCRM As Integer = -1, Optional CveContactoCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional CveTipoProcesoCRM As Integer = -1, Optional CveEtapaProcesoCRM As Integer = -1,
- Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1) As Boolean
+ Optional CveSubProyecto As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveMovimiento As Integer = -1,
+ Optional CveContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
Retorno = AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioPara, CveUsuarioIng, FechaInicio, FechaFin, -1, -1, "-1", CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC,
CvePersonal, CveProveedor, CveEventoPadre:=CveEventoPadre, RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dia, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, Importe:=Importe,
CveEmpresaCRM:=CveEmpresaCRM, CveContactoCRM:=CveContactoCRM, CveAcercamientoCRM:=CveAcercamientoCRM, CveTipoProcesoCRM:=CveTipoProcesoCRM, CveEtapaProcesoCRM:=CveEtapaProcesoCRM, CveSubProyecto:=CveSubProyecto, CveCompra:=CveCompra,
- CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento)
+ CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, CveContrato:=CveContrato)
Return Retorno
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index b85352d4c..2cfcde5e5 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2248,15 +2248,25 @@ Public Class ClsPaginas
'Fin Bancos
'Fin EstadoCIvil
'TipoPerioso
- Property GlobalDTTipoPeriodo() As DataTable
+ Property GlobalDTTipoPeriodo(Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = "GlobalDTTipoPeriodo"
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjNom As New ClsNominas()
- If ObjNom.GetTiposPeriodos() Then Application(AppNombre) = ObjNom.DtResultados
+ If ObjNom.GetTiposPeriodos(-1) Then Application(AppNombre) = ObjNom.DtResultados
End Using
End If
- GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ Dim filtros As New List(Of String)
+ If Estatus <> -1 Then filtros.Add($"CveEstatus = {Estatus}")
+
+ If filtros.Count > 0 Then
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
+ GlobalDTTipoPeriodo = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTTipoPeriodo = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+
End Get
Set(value As DataTable)
@@ -9272,7 +9282,7 @@ Public Class ClsPaginas
Select Case CveMoneda
Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 17, 308)
- If TipoAplicacionPago.Contiene("NC", "DEV", "RNC") Then Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 22, 363) 'pago nota de crédito
+ If TipoAplicacionPago.Contiene("NC", "DEV", "RNC") Then Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 272, 363) 'pago nota de crédito
Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 312, 309)
If TipoAplicacionPago.Contiene("NC", "DEV", "RNC") Then Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 304, 364) 'pago nota de crédito ME
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 767ffd089..58e6691f6 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -783,6 +783,24 @@ Public Class ClsVentas
Return Retorno
End Function
+ Public Function UpdateVentaRemisionEspecial(CveVenta As Integer, Num2 As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_VentasRemisionEspecialUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
+ .Add("@Num2", SqlDbType.Int).Value = Num2
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la venta como remision especial.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
Public Function UpdateVentaAnticipoAutorizado(CveVenta As Integer, Autorizado As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaAnticipoAutorizadoUpdate")
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 5132a9e44..77dfe290f 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -4481,6 +4481,10 @@ Partial Class Compras_Compras
End If
End If
End If
+
+ If Not ValidaFechaDeAlamacen() Then
+ Exit Sub
+ End If
End If
If UsuarioActual.Empresa.Funcionalidad(538) = "1" Then
@@ -7803,6 +7807,54 @@ Partial Class Compras_Compras
End If
End Sub
+ Private Function ValidaFechaDeAlamacen() As Boolean
+ Dim respuesta As Boolean = False
+
+
+
+ Dim objInventario As New ClsInventarios
+ Dim MovimientosError As Boolean = False
+
+ 'Dim SB As New StringBuilder
+ 'Dim FechaCompra As DateTime = TxtFecha.Text.ToDate
+ 'FechaCompra
+ Dim FechaMinima As DateTime = TxtFecha.Text.ToDate
+
+ If DtInv IsNot Nothing Then
+ For Each Dr As DataRow In TmpDT.Rows
+
+ Dim CveTipoPS As Integer = Dr("CveTipoPS").ToString.ToEntero
+
+ If CveTipoPS = 2 Then
+ If objInventario.GetValidaFechaAlmacen(CveEmpresa:=UsuarioActual.CveEmpresa, CveAlmacen:=ddlAlmacenAdd.SelectedValue.ToEntero, CvePS:=Dr("CvePS").ToString.ToEntero) Then
+
+ If objInventario.DtResultados IsNot Nothing AndAlso objInventario.DtResultados.Rows.Count > 0 Then
+ Dim FechamoMovimiento As DateTime = objInventario.DtResultados(0)("FechaMovto").ToString.ToDate
+ If FechamoMovimiento > FechaMinima Then
+ FechaMinima = FechamoMovimiento
+ End If
+
+ End If
+
+ End If
+ End If
+
+ Next
+ End If
+
+ objInventario.Dispose()
+
+ If FechaMinima > TxtFecha.Text.ToDate Then
+ Alert($"Los productos tienen movientos, la fecha minima que se puede aplicar es {FechaMinima.ToString("dd/MM/yyyy HH:mm")}", TipoMensaje.MsgAdvertencia)
+ respuesta = False
+ Else
+ respuesta = True
+ End If
+
+ Return respuesta
+
+ End Function
+
Private Function GeneraStrinDoctosRelacionados() As String
Dim DoctosRelacionados As String = "-1"
@@ -14424,7 +14476,9 @@ Partial Class Compras_Compras
If PopUpOC Then
Dim ArrayCveOC As String() = CvesOC.Split(New Char() {","c})
For i As Integer = 0 To ArrayCveOC.Count - 1
- If OC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, ArrayCveOC(i).ToEntero, tCveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
+ 'GetOrdenesCompraVinculacion
+ 'If OC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, ArrayCveOC(i).ToEntero, tCveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
+ If OC.GetOrdenesCompraVinculacion("OC", -1, -1, -1, MinFecha, MaxFecha, ArrayCveOC(i).ToEntero, tCveProveedor, -1, -1, UsuarioActual.CveEmpresa) Then
If OC.DtResultados.FiltraParametros("TipoTermino = 3").Rows.Count = 1 Or DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
HdnVCveOC.Value += String.Format("{0}{1}", If(HdnVCveOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveOrdenCompra").ToString)
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
@@ -14438,7 +14492,8 @@ Partial Class Compras_Compras
Dim TextoErrorOC As String = ""
Dim ArrayCveOC As String() = TxtOC.Text.Split(New Char() {","c})
For i As Integer = 0 To ArrayCveOC.Count - 1
- If OC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, CveProveedor, ArrayCveOC(i).ToEntero, -1, -1, UsuarioActual.CveEmpresa, -1) Then
+ 'If OC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, CveProveedor, ArrayCveOC(i).ToEntero, -1, -1, UsuarioActual.CveEmpresa, -1) Then
+ If OC.GetOrdenesCompraVinculacion("OC", -1, -1, -1, MinFecha, MaxFecha, -1, tCveProveedor, ArrayCveOC(i).ToEntero, -1, UsuarioActual.CveEmpresa) Then
If OC.DtResultados.Rows.Count > 1 Then
TextoErrorOC += $" El folio {ArrayCveOC(i).ToEntero} no se pudo identificar."
End If
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 279619e3a..75a18080d 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -107,6 +107,32 @@ Partial Class PopUpVerFactura
ImprimeFormatoCartaPorteTimbrado(Request("CVETIMBRE").ToString.ToEntero)
End If
+ If Request("ArchivoContrato") IsNot Nothing AndAlso Request("ArchivoContrato") IsNot Nothing Then
+
+ Dim ArchivoContrato As String = Decripta(Request("ArchivoContrato"))
+ Dim File As New FileInfo(ArchivoContrato)
+
+ If File.Exists Then 'set appropriate headers
+
+ Response.Clear()
+ Response.ClearHeaders()
+ Response.ClearContent()
+ Response.AddHeader("Content-Disposition", "inline; filename=" & $"{File.Name}")
+ Response.AddHeader("Content-Length", File.Length.ToString())
+ 'Response.ContentType = "text/plain"
+ Response.ContentType = "application/octet-stream"
+ Response.Flush()
+ ' Response.TransmitFile(File.FullName)
+ Response.WriteFile(File.FullName)
+ Response.End()
+
+ Else
+
+ Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
+
+ End If
+ End If
+
If Request("RFC") IsNot Nothing AndAlso Request("File") IsNot Nothing Then
Dim Path As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), Request("File"))
Dim Archivo As New System.IO.FileInfo(Path)
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index 94837b32c..031d3d505 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -9036,16 +9036,23 @@ Namespace ADS.eFacturas
Try
Dim listaDS As New List(Of ReportDataSource)
Dim rdsTotales As New ReportDataSource()
- Dim ltotales As New List(Of utilValores)()
+ 'Dim ltotales As New List(Of utilValores)()
Dim DTTotales As New DataTable
DTTotales.TableName = "DTTotales"
DTTotales.Columns.Add("Nombre")
DTTotales.Columns.Add("Valor")
- ltotales.Add(New utilValores("Subtotal", objxml.comprobante.SubTotal.ToString("N2")))
+ Dim nRowSubtotales As DataRow = DTTotales.NewRow
+ nRowSubtotales("Nombre") = "Subtotal"
+ nRowSubtotales("Valor") = objxml.comprobante.SubTotal.ToString("N2")
+ DTTotales.Rows.Add(nRowSubtotales)
+
If objxml.comprobante.Descuento > 0 Then
- ltotales.Add(New utilValores("Descuento", objxml.comprobante.Descuento.ToString("N2")))
+ Dim nRowDescuento As DataRow = DTTotales.NewRow
+ nRowDescuento("Nombre") = "Descuento"
+ nRowDescuento("Valor") = objxml.comprobante.Descuento.ToString("N2")
+ DTTotales.Rows.Add(nRowDescuento)
End If
For Each item As CFDIImpuesto In objxml.Impuestos
@@ -9053,8 +9060,6 @@ Namespace ADS.eFacturas
If item.Importe > 0 Then
Dim TasaOCuota As Decimal = 0
Decimal.TryParse(item.TasaOCuota, TasaOCuota)
- ltotales.Add(New utilValores($"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}", item.Importe.ToString("N2")))
-
nRow("Nombre") = $"Impuestos {item.Tipo} {item.ImpuestoTexto} {(If(item.TipoFactor = "Tasa", (TasaOCuota * 100).ToString("N4"), item.TasaOCuota))} {(If(item.TipoFactor = "Tasa", "%", ""))}"
nRow("Valor") = item.Importe.ToString("N2")
DTTotales.Rows.Add(nRow)
@@ -9062,7 +9067,11 @@ Namespace ADS.eFacturas
End If
Next
- ltotales.Add(New utilValores("Total", objxml.comprobante.Total.ToString("N2")))
+ Dim nRowTotal As DataRow = DTTotales.NewRow
+ nRowTotal("Nombre") = "Subtotal"
+ nRowTotal("Valor") = objxml.comprobante.Total.ToString("N2")
+ DTTotales.Rows.Add(nRowTotal)
+
rdsTotales.Name = "dsTotales"
rdsTotales.Value = DTTotales 'ltotales.ToDataTable
listaDS.Add(rdsTotales)
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index 073f60a19..b04588b00 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -3061,15 +3061,14 @@ Partial Class General_SaldosIniciales
If AgrupadoresSAT.Rows.Count > 0 Then
-
For Each Row As DataRow In dt.Rows
Dim Cuenta As String = Row("Cuenta").ToString().Trim.Replace("-", "")
If Cuenta <> "" Then
NombreCuenta = Row("NombreCuenta").ToString().Trim
CuentaPadre = Row("CuentaPadre").ToString().Trim.Replace("-", "")
- CodigoVinculacion = Row("CodigoVinculacion").ToString().Trim
+ CodigoVinculacion = If(dt.Columns.Contains("CodigoVinculacion"), Row("CodigoVinculacion").ToString().Trim, "")
- Dim TipoCuenta As String = Row("TipoCuenta").ToString().Trim
+ Dim TipoCuenta As String = Row("TipoCuenta").ToString().Trim.ToUpper
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString().Trim
Dim CveCuentaPadre As Integer = -1
Dim CveAgrupadorSAT As Integer = If(AgrupadorSAT = "0", -1, AgrupadoresSAT.FiltroPrimeroValor("CveAgrupadorSAT", String.Format("CodigoNombre LIKE '%{0}%'", AgrupadorSAT)).ToEntero())
diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx
index b8eeeb2b6..704ef64f1 100644
--- a/Inventarios/EntregaAlmacen.aspx
+++ b/Inventarios/EntregaAlmacen.aspx
@@ -144,7 +144,7 @@
-
Registró:
+
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index 249f4d0c8..dcb6e6ec1 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -689,6 +689,15 @@ Partial Class Inventarios_EntregaAlmacen
HLFolio.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={CveVenta}"
End If
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then '' pendiente de mejorar
+ LtlRegistro.Text = "Vendedor:"
+ Dim objV As New ClsVentas
+ If objV.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
+ LtlRegistra.Text = objV.DtResultados.FiltroPrimeroValor("VendedorNombre")
+ End If
+ objV.Dispose()
+ End If
+
'filtra los Almacenes de domicilio
If DtDatos.Rows(0)("ServicioDomicilio").ToString() = "True" Then
StrAlmacenes = "CveTipoAlmacen = 29"
diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb
index 61a191dec..7547ddfe2 100644
--- a/Inventarios/KardexAlmacenHorizontal.aspx.vb
+++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb
@@ -158,10 +158,15 @@ Partial Class Inventarios_KardexAlmacenHorizontal
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), IncluyeTransitorios,
DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue.ToEntero,
Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO, CodigoPS:=TxtPS.Text) Then
+ Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201) '.limitar los importes
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn)
+ If Not TienePermisoImportes Then
+ dt.Columns.RemoveAt(dt.Columns.Count - 1) 'CP-quito columna de importe total
+ dt.Columns.RemoveAt(dt.Columns.Count - 1) 'Valor-quito columna de importe total
+ End If
For index As Integer = 3 To dt.Columns.Count - 1
Dim TotColumna As Double = 0
For Each Dr As DataRow In dt.Rows
@@ -170,6 +175,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
If Not TotColumna > 0 Then
ListaBorrar.Add(dt.Columns(index))
End If
+
Next
For Each item As DataColumn In ListaBorrar
dt.Columns().Remove(item)
@@ -187,13 +193,12 @@ Partial Class Inventarios_KardexAlmacenHorizontal
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
Exit Sub
End If
-
-
GvDatos.DataBind()
For index = 4 To GvDatos.Rows(0).Cells.Count - 1
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|"c)(0)
Next
+
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx
index 569ec3073..a5e9cf36c 100644
--- a/Inventarios/RecepcionAlmacen.aspx
+++ b/Inventarios/RecepcionAlmacen.aspx
@@ -545,7 +545,7 @@
-
+
diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs
index f1ab82199..fee5884ef 100644
--- a/Nomina/Aguinaldo.aspx.cs
+++ b/Nomina/Aguinaldo.aspx.cs
@@ -55,7 +55,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
}
catch (Exception) { }
- DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo' AND CveTipoPeriodo <>-1");
+ DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo().FiltraParametros(" CveTipoPeriodo <> -1");
DdlTipoPeriodo.DataBind();
DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
if (DdlTipoPeriodo.Items.Count > 0)
@@ -125,7 +125,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
DdlTipoPeriodoB.ClearSelection();
DdlTipoPeriodoB.Items.Clear();
- DdlTipoPeriodoB.DataSource = GlobalDTTipoPeriodo.FiltraParametros(string.Format("CveTipoPeriodo=6 OR CveTipoPeriodo={0}", DdlTipoPeriodo.SelectedValue));
+ DdlTipoPeriodoB.DataSource = get_GlobalDTTipoPeriodo().FiltraParametros(string.Format("CveTipoPeriodo=6 OR CveTipoPeriodo={0}", DdlTipoPeriodo.SelectedValue));
DdlTipoPeriodoB.DataBind();
CargaPeriodos();
diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb
index 6a5f39df1..320e9fcb9 100644
--- a/Nomina/CatPeriodos.aspx.vb
+++ b/Nomina/CatPeriodos.aspx.vb
@@ -40,8 +40,7 @@ Partial Class Nomina_CatPeriodos
Public Sub CargaDatos()
Dim ObjNom_Periodos As New ClsNominas
If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero(), -1, -1, DdlEstatus.SelectedValue.ToEntero()) Then
- ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
-
+ ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
@@ -58,15 +57,13 @@ Partial Class Nomina_CatPeriodos
#Region " C O M B O S"
Private Sub CargaTipoPeriodo()
- DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
- DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo
- DdlTipoPeriodoCM.DataSource = GlobalDTTipoPeriodo
+ DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo(-1)
+ DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo(-1)
+ DdlTipoPeriodoCM.DataSource = GlobalDTTipoPeriodo(-1)
DdlTipoPeriodo.DataBind()
DdlTipoPeriodoAdd.DataBind()
DdlTipoPeriodoCM.DataBind()
-
-
End Sub
Private Sub cargaEjercicios()
diff --git a/Nomina/ChecadorAsistencia.aspx.cs b/Nomina/ChecadorAsistencia.aspx.cs
index 44b5ab34a..bb6838006 100644
--- a/Nomina/ChecadorAsistencia.aspx.cs
+++ b/Nomina/ChecadorAsistencia.aspx.cs
@@ -60,7 +60,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
}
private void CargaTiposPeriodo()
{
- DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
+ DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo();
DdlTipoPeriodo.DataBind();
DdlTipoPeriodo.Items.Insert(0, new ListItem("Todos", "-1"));
if (DdlTipoPeriodo.Items.Count > 0)
diff --git a/Nomina/MovimientosSUA.aspx.cs b/Nomina/MovimientosSUA.aspx.cs
index dca56c321..0baa2250b 100644
--- a/Nomina/MovimientosSUA.aspx.cs
+++ b/Nomina/MovimientosSUA.aspx.cs
@@ -56,7 +56,7 @@ public partial class Nomina_MovimientosSUA : ClsPaginas
private void CargaTiposPeriodo()
{
- DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
+ DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo();
DdlTipoPeriodo.DataBind();
DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1"));
if (DdlTipoPeriodo.Items.Count > 0)
diff --git a/Nomina/ReportedeAcumulados.aspx.cs b/Nomina/ReportedeAcumulados.aspx.cs
index 44eeb98ea..46c7eaf91 100644
--- a/Nomina/ReportedeAcumulados.aspx.cs
+++ b/Nomina/ReportedeAcumulados.aspx.cs
@@ -157,7 +157,7 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas
}
private void CargaTiposPeriodo()
{
- DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'");
+ DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodo();
DdlTipoPeriodo.DataBind();
DdlTipoPeriodo.Items.Insert(0, new ListItem("Todos", "-1"));
if (DdlTipoPeriodo.Items.Count > 0)
@@ -167,7 +167,6 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas
}
-
public void cargaDatos()
{
int CveEmpresa = UsuarioActual.CveEmpresa;
diff --git a/OC/PopUpBuscarReq.aspx b/OC/PopUpBuscarReq.aspx
index ad7f39e32..eefd2aa26 100644
--- a/OC/PopUpBuscarReq.aspx
+++ b/OC/PopUpBuscarReq.aspx
@@ -139,7 +139,7 @@
-
+
diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb
index 64e17073b..b547f75b3 100644
--- a/OC/PopUpBuscarReq.aspx.vb
+++ b/OC/PopUpBuscarReq.aspx.vb
@@ -145,8 +145,8 @@ Partial Class OC_PopUpBuscarReq
End If
'Cargar Datos
Dim ObjOC As New ClsOC
- ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, tCveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1)
- Dim DtOC As Data.DataTable = ObjOC.DtResultados.FiltraParametros("TipoTermino = 3") ' tipotermino, esattus inicial
+ ObjOC.GetOrdenesCompraVinculacion("OC", -1, -1, -1, MinFecha, MaxFecha, -1, tCveProveedor, -1, -1, UsuarioActual.CveEmpresa)
+ Dim DtOC As Data.DataTable = ObjOC.DtResultados
ObjOC.Dispose()
If DtOC.Rows.Count > 0 Then ' tipotermino, esattus inicial
@@ -154,7 +154,7 @@ Partial Class OC_PopUpBuscarReq
End If
'SOLO CARGAMOS OC'S QUE ESTEN PENDIENTES POR SURTIR
- GV.DataSource = DtOC.FiltraParametros("CveOrdenCompraDisponible > 0")
+ GV.DataSource = DtOC
GV.DataBind()
LblTotalRegistros.Text = "Número de registros: " & GV.Rows.Count.ToString
diff --git a/OI/PopUpAgenda.aspx.vb b/OI/PopUpAgenda.aspx.vb
index 07487ed21..1d516cda5 100644
--- a/OI/PopUpAgenda.aspx.vb
+++ b/OI/PopUpAgenda.aspx.vb
@@ -716,6 +716,12 @@ Partial Class OI_PopUpAgenda
CveMovimiento = Request("CveMovimiento").ToEntero
End If
+ Dim CveContrato As Integer = -1
+ If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then
+ CveContrato = Request("CveContrato").ToEntero
+ End If
+
+
'------------------------------------------
'Recorrro Grid para obtener el usuario PARA
For Each RowPara As GridViewRow In GVUsuarios.Rows
@@ -741,7 +747,7 @@ Partial Class OI_PopUpAgenda
Alert("La Nueva Tarea se guardó correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf CveTipoEvento = 2 Then
- If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra, CveVenta:=CveVenta, CveMovimiento:=CveMovimiento) Then
+ If ObjEventos.AddEventoAgenda(CveAgendaTipo, Asunto, Descripcion, Prioridad, FechaInicio.ToDateTime, FechaFin.ToDateTime, CveUsuarioIng, CveEmpresa, CveActivoFijo, CveIE, CveProspecto, CveCliente, CveOS, CveOC, CvePersonal, CveProveedor, CveCompra:=CveCompra, CveVenta:=CveVenta, CveMovimiento:=CveMovimiento, CveContrato:=CveContrato) Then
Alert("La Nueva Agenda se guardó correctamente.", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
End If
ElseIf CveTipoEvento = 3 Then
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb
index bba66e78a..6fa45cfb1 100644
--- a/RH/Personal.aspx.vb
+++ b/RH/Personal.aspx.vb
@@ -1539,8 +1539,18 @@ Partial Class RH_Personal
Private Sub CargaOutSourcing()
+ Dim DtModulosEmpresa As New DataTable
+ Dim ObjEmpresas As New ClsSisEmpresas
+ If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
+ DtModulosEmpresa = ObjEmpresas.DtResultados
+ Else
+ DtModulosEmpresa = Nothing
+ End If
+ ObjEmpresas.Dispose()
+
+
If UsuarioActual.CveEmpresa = 7 Then
- DdlEmpresaAsignada.DataSource = GlobalDTEmpresas.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)")
+ DdlEmpresaAsignada.DataSource = DtModulosEmpresa.FiltraParametros("CveEmpresa in (7,11,12,122,145,113)")
DdlEmpresaAsignada.DataBind()
DvOutsourcing.Visible = True
End If
diff --git a/Sistemas/EmpresasModulos.aspx b/Sistemas/EmpresasModulos.aspx
index 3d1e9ed6e..d0933aa2b 100644
--- a/Sistemas/EmpresasModulos.aspx
+++ b/Sistemas/EmpresasModulos.aspx
@@ -20,7 +20,10 @@
Empresa:
-
+
diff --git a/Sistemas/EmpresasModulos.aspx.vb b/Sistemas/EmpresasModulos.aspx.vb
index 6d95e141b..1100a4a46 100644
--- a/Sistemas/EmpresasModulos.aspx.vb
+++ b/Sistemas/EmpresasModulos.aspx.vb
@@ -47,14 +47,23 @@ Partial Class Sistemas_EmpresasModulos
UpDatos.Update()
End Sub
Private Sub CargarEmpresa()
+
+ Dim DTEmpresas As New DataTable
+
+ Using ObjEmpresas As New ClsSisEmpresas()
+ If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
+ DTEmpresas = ObjEmpresas.DtResultados
+ End If
+ End Using
+
If UsuarioActual.CveRol <> 1 Then
- DdlEmpresa.DataSource = GlobalDTEmpresas
+ DdlEmpresa.DataSource = DTEmpresas
DdlEmpresa.Enabled = False
Else
- DdlEmpresa.DataSource = GlobalDTEmpresas
+ DdlEmpresa.DataSource = DTEmpresas
End If
- DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
+ DdlEmpresa.SelectedValueExist(UsuarioActual.CveEmpresa.ToString)
DdlEmpresa.DataBind()
End Sub
Private Sub CargaModulosEmpresa()
@@ -71,7 +80,13 @@ Partial Class Sistemas_EmpresasModulos
End Sub
Private Sub CargaModulosDisponible()
- Dim DtModulosDisponible As DataTable = GlobalDTModulos().FiltraParametros("Liga <> ''")
+ Dim DtModulosDisponible As New DataTable '= GlobalDTModulos().FiltraParametros("Liga <> ''")
+
+ Using ObjModulos As New ClsModulos
+ If ObjModulos.GetModulos(-1, -1, "-1", "-1") Then
+ DtModulosDisponible = ObjModulos.DtResultados
+ End If
+ End Using
Dim rowsToDelete = From r1 In DtModulosDisponible.AsEnumerable()
Join r2 In DtModulosEmpresa.AsEnumerable() On r1.Field(Of Integer)("CveModulo") Equals r2.Field(Of Integer)("CveModulo")
@@ -150,4 +165,8 @@ Partial Class Sistemas_EmpresasModulos
#End Region
+
+ Protected Sub DdlEmpresa_SelectedIndexChanged(sender As Object, e As EventArgs)
+ consultar_Click(Nothing, Nothing)
+ End Sub
End Class
diff --git a/SqlServerTypes/readme.htm b/SqlServerTypes/readme.htm
deleted file mode 100644
index 02d9ac8ce..000000000
--- a/SqlServerTypes/readme.htm
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
- Microsoft.SqlServer.Types
-
-
-
-
-
Action required to load native assemblies
-
- To deploy an application that uses spatial data types to a machine that does not have 'System CLR Types for SQL Server' installed you also need to deploy the native assembly SqlServerSpatial140.dll. Both x86 (32 bit) and x64 (64 bit) versions of this assembly have been added to your project under the SqlServerTypes\x86 and SqlServerTypes\x64 subdirectories. The native assembly msvcr120.dll is also included in case the C++ runtime is not installed.
-
-
- You need to add code to load the correct one of these assemblies at runtime (depending on the current architecture).
-
-
ASP.NET Web Sites
-
- For ASP.NET Web Sites, add the following block of code to the code behind file of the Web Form where you have added Report Viewer Control:
-
diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb
index 62b6ad38d..4031cc1dc 100644
--- a/Transportes/RepContratoDetalle.aspx.vb
+++ b/Transportes/RepContratoDetalle.aspx.vb
@@ -201,6 +201,22 @@ Partial Class RepContratoDetalle
End Set
End Property
+ Private Property TotalPagos As Decimal
+ Get
+ If ViewState("TotalPagos") Is Nothing Then
+ ViewState("TotalPagos") = 0
+ End If
+
+ Return ViewState("TotalPagos").ToString.ToDecimal
+
+ End Get
+ Set(value As Decimal)
+ ViewState("TotalPagos") = value
+ End Set
+ End Property
+
+
+
@@ -209,20 +225,42 @@ Partial Class RepContratoDetalle
#Region "Carga Página"
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+
+
If Request("CveContrato") Is Nothing Then
Response.Redirect($"~/Transportes/RepContratos.aspx")
End If
+
CveContrato = Request("CveContrato").ToEntero
+
If Not IsPostBack Then
+
InicializaCombos()
CargaDatos()
+ CargaAuxiliarClienteCxC(DdlClientes.SelectedValue.ToEntero, CveVentaRemision)
AsientoSeleccionado = ""
CveViajePasajero = 0
Session("FileExtension") = ""
ArchivoUpdate = ""
CargaGvBitacora()
+ If CveContrato > 0 Then
+ HlEvento.Visible = True
+ HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveContrato=" & CveContrato & "&TB_iframe=true&height=370&width=600;"
+ ImgAddObs.Visible = True
+ LtlTareaNueva.Text = String.Format(" Tarea", CveContrato)
+ CargaEventoBitacora()
+ End If
+
+ If CveVentaRemision > 0 Then
+ DVFactura.Visible = True
+ End If
+
End If
+
+
+
+
End Sub
Private Sub InicializaCombos()
'Lista Tipo AF
@@ -297,6 +335,14 @@ Partial Class RepContratoDetalle
If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
BtnDescargar.Visible = True
+
+ Dim File As New FileInfo(ViewState("FUrl").ToString)
+ BtnDescargar.NavigateUrl = $"~/Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
+ 'If File.Exists Then
+ ' RegistraScript($"window.open({Url}, ""_blank"");")
+ 'End If
+
+
Else
BtnDescargar.Visible = False
A1.Visible = True
@@ -313,13 +359,13 @@ Partial Class RepContratoDetalle
ObjTransportes.Dispose()
GvViajesPasajeros.DataBind()
End If
- 'Bitácora
- Dim ObjEventoBitacora As New ClsOIEventos
- If ObjEventoBitacora.GetEventos(-1, -1, -1, "-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, CveContrato:=CveContrato) Then
- GvEventosBitacora.DataSource = ObjEventoBitacora.DtResultados
- GvEventosBitacora.DataBind()
- End If
- ObjEventoBitacora.Dispose()
+ ''Bitácora
+ 'Dim ObjEventoBitacora As New ClsOIEventos
+ 'If ObjEventoBitacora.GetEventos(-1, -1, -1, "-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, CveContrato:=CveContrato) Then
+ ' GvEB.DataSource = ObjEventoBitacora.DtResultados
+ ' GvEB.DataBind()
+ 'End If
+ 'ObjEventoBitacora.Dispose()
End If
Else
@@ -332,8 +378,113 @@ Partial Class RepContratoDetalle
End Sub
#End Region
+
+#Region "Bitacora"
+ Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.RowIndex = 0 Then
+ e.Row.Cells(0).Width = Unit.Pixel(200)
+ e.Row.Cells(1).Width = Unit.Pixel(200)
+ e.Row.Cells(2).Width = Unit.Pixel(100)
+ e.Row.Cells(3).Width = Unit.Pixel(500)
+ End If
+
+ If e.Row.DBCampo("Archivo").ToString <> "" Then
+ e.Row.FCLinkButton("LinkArchivo").Visible = True
+ e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
+ End If
+
+ e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
+
+ End If
+ End Sub
+
+ Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
+ Dim ObjEventoBitacora As New ClsOIEventos
+
+ Dim FileExtension As String = "-1"
+ Dim Filesgral As List(Of Archivo) = AnexoBit.getfiles().Archivos
+ Dim Filename As String = ""
+ For Each fileItem As Archivo In Filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ Filename = fileItem.filename
+ Next
+
+
+
+ If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
+ If Filename <> "" Then
+ Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
+ End If
+
+ GvEB.DataSource = ObjEventoBitacora.DtResultados
+ TxtEventoDescripcion.Text = ""
+ AnexoBit.Text = "[]"
+ Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
+ RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
+
+ End If
+ ObjEventoBitacora.Dispose()
+ GvEB.DataBind()
+
+ UPEventoBitacora.Update()
+ CargaEventoBitacora()
+ UPAddEventoBitacora.Update()
+ End Sub
+
+ Private Sub CargaEventoBitacora()
+
+ If CveContrato > 0 Then
+ Dim ObjEventoBitacora As New ClsOIEventos()
+ If ObjEventoBitacora.GetAgendaBitacora(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveContrato:=CveContrato) Then
+ GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
+ Else
+ GvEB.DataSource = Nothing
+ End If
+ ObjEventoBitacora.Dispose()
+ GvEB.DataBind()
+ UPEventoBitacora.Update()
+ End If
+
+ End Sub
+
+ 'Protected Sub CargarArchivo(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
+ ' If AFU.HasFile Then
+
+
+ ' Dim UploadFolder As String = String.Format("{0}\Temp\", UsuarioActual.Empresa.Ruta)
+ ' UploadFolder.DirectoryExistsCreate()
+ ' Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
+
+ ' If File.Exists(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension)) Then File.Delete(String.Format("{0}{1}{2}", UploadFolder, UsuarioActual.CveUsuario.ToString, Extension))
+
+ ' AFU.SaveAs(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension)
+ ' Session("FileUpload") = UploadFolder & UsuarioActual.CveUsuario.ToString & Extension
+ ' Session("FileExtension") = Extension
+ ' Session("FileFolder") = UploadFolder
+ ' End If
+ 'End Sub
+ Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
+ Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
+ Dim Archivo As New System.IO.FileInfo(filePath)
+
+ HttpContext.Current.Response.Clear()
+ HttpContext.Current.Response.ClearContent()
+ HttpContext.Current.Response.ContentType = "application/octet-stream"
+ HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
+ HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
+ HttpContext.Current.Response.TransmitFile(filePath)
+ HttpContext.Current.Response.Flush()
+ HttpContext.Current.Response.End()
+
+ Archivo = Nothing
+ End Sub
+#End Region
+
#Region "Información General"
Protected Sub BtnGuardarArchivo_Click1(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click
+
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Extensiones.Archivo) = Anexo.getfiles().Archivos
Dim Filename As String = ""
@@ -375,32 +526,61 @@ Partial Class RepContratoDetalle
BtnDescargar.Visible = True
End If
End Sub
- Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
- DescargarArchivo()
- End Sub
- Private Sub DescargarArchivo()
- Dim File As New FileInfo(ViewState("FUrl").ToString)
+ 'Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
+ ' Dim File As New FileInfo(ViewState("FUrl").ToString)
+ ' Dim Url As String = $"{ObtenerUrlCompleta()}Compras/PopUpVerFactura.aspx?ArchivoContrato={Encripta(File.FullName)}"
+ ' If File.Exists Then
+ ' RegistraScript($"window.open({Url}, ""_blank"");")
+ ' End If
- If File.Exists Then 'set appropriate headers
- Response.Clear()
- Response.ClearHeaders()
- Response.ClearContent()
- Response.AddHeader("Content-Disposition", "attachment; filename=" & TxtFolio.Text & $"{File.Extension}")
- Response.AddHeader("Content-Length", File.Length.ToString())
- 'Response.ContentType = "text/plain"
- Response.ContentType = "application/octet-stream"
- Response.Flush()
- ' Response.TransmitFile(File.FullName)
- Response.WriteFile(File.FullName)
- Response.End()
- 'if file does not exist
- Alert("Descargado Correctamente.", TipoMensaje.MsgInformacion)
- Else
- Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
+ 'End Sub
+
+ Public Function ObtenerUrlCompleta() As String
+
+ Dim Solicitud As HttpRequest = HttpContext.Current.Request
+ Dim url As String = Solicitud.Url.Scheme & "://" & Solicitud.Url.Host
+
+ If (Solicitud.Url.Port <> 80 AndAlso Solicitud.Url.Port <> 443) Then
+ url &= ":" & Solicitud.Url.Port
+ End If
+
+
+ url &= Solicitud.ApplicationPath
+
+ If Not url.EndsWith("/") Then
+ url &= "/"
+ End If
+
+ Return url
+
+ End Function
+ 'Private Sub DescargaArchivo(urlArchivo As String)
+
+ ' Dim File As New FileInfo(urlArchivo)
+
+ ' If File.Exists Then 'set appropriate headers
+
+ ' Response.Clear()
+ ' Response.ClearHeaders()
+ ' Response.ClearContent()
+ ' Response.AddHeader("Content-Disposition", "inline; filename=" & TxtFolio.Text & $"{File.Extension}")
+ ' Response.AddHeader("Content-Length", File.Length.ToString())
+ ' 'Response.ContentType = "text/plain"
+ ' Response.ContentType = "application/octet-stream"
+ ' Response.Flush()
+ ' ' Response.TransmitFile(File.FullName)
+ ' Response.WriteFile(File.FullName)
+ ' Response.End()
+
+ ' Else
+
+ ' Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
+
+ ' End If
+
+ 'End Sub
- End If 'nothing in the URL as HTTP GET
- End Sub
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim ArchivoUpdate As String = "-1"
Dim ErrorProceso As Boolean = False
@@ -886,6 +1066,52 @@ Partial Class RepContratoDetalle
GvBitacora.DataBind()
End Sub
#End Region
+
+#Region "PAGOS"
+ Private Sub CargaAuxiliarClienteCxC(CveCliente As Integer, CveRemision As Integer)
+
+ If CveRemision > 0 Then
+ Dim ObjMovtos As New ClsMovimientos()
+
+ If ObjMovtos.GetCxCClienteAuxiliar(CveCliente, CveRemision) Then
+
+ Dim dtTemp As New DataTable
+ dtTemp = ObjMovtos.DtResultados.FiltraParametros(" Conceptocontable = 'Pago del Cliente' ")
+ TotalPagos = dtTemp.SUM("Abono")
+ GVAuxiliar.DataSource = dtTemp
+
+ Else
+ GVAuxiliar.DataSource = Nothing
+ End If
+
+ ObjMovtos.Dispose()
+ GVAuxiliar.DataBind()
+ UpPagos.Update()
+ End If
+
+ End Sub
+
+ Protected Sub GVAuxiliar_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.DataKey("TipoReferencia").ToEntero = 1 Then
+ e.Row.FCHyperLink("HplReferencia").NavigateUrl = $"/Bancos/IE.aspx?CveIE={e.Row.DataKey("CveReferencia").ToEntero}"
+ End If
+ End If
+ If e.Row.RowType = DataControlRowType.Footer Then
+ e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
+ e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Right
+ e.Row.Cells(1).Text = "Total"
+ e.Row.FCLabel("Lbltotal").Text = TotalPagos.ToString("###,###,###.00")
+ End If
+
+ End Sub
+
+#End Region
+
+
+
+
End Class
diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx
index 865151ea5..4878f656f 100644
--- a/Transportes/RepContratos.aspx
+++ b/Transportes/RepContratos.aspx
@@ -392,9 +392,10 @@
-
+
diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb
index 3fecb240d..3572a912e 100644
--- a/Transportes/RepContratos.aspx.vb
+++ b/Transportes/RepContratos.aspx.vb
@@ -102,6 +102,10 @@ Partial Class ListadoContratos
End Sub
Protected Sub AddContrato(sender As Object, e As EventArgs)
+ If Not VallidaCantidadPasajeros(DdlTipoAF.SelectedValue.ToEntero, TxtCantidadPasajeros.Text.ToEntero) Then
+ Exit Sub
+ End If
+
Dim ErrorProceso As Boolean = False
Dim CveContrato As Integer = -1
@@ -221,6 +225,22 @@ Partial Class ListadoContratos
RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
End Sub
+ Private Function VallidaCantidadPasajeros(CveTipoAF As Integer, Cantidad As Integer) As Boolean
+
+ Dim Respuesta As Boolean = True
+
+ If CveTipoAF = 181 And Cantidad < 30 Then 'autobus
+ Respuesta = False
+ Alert("El tipo unidad autobus debe de tener un minimo de 30 pasajeros.", TipoMensaje.MsgAdvertencia)
+ ElseIf CveTipoAF = 184 And Cantidad > 21 Then 'sprinter
+ Respuesta = False
+ Alert("El tipo de unidad sprinter no puede tener más de 21 pasajeros.", TipoMensaje.MsgAdvertencia)
+ End If
+
+ Return Respuesta
+
+ End Function
+
Protected Sub ResetModal()
'Reiniciamos modal
TxtDescripcion.Text = ""
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 1d42ac048..ddb9c41b5 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -862,7 +862,7 @@
-
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 5ea06358e..dc5de3c80 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5247,24 +5247,17 @@ Partial Class Ventas
EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString())
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
- If DbRowVenta("Num2").ToString().ToEntero() = 2000 Then
+ If DbRowVenta("Num2").ToString = "2000" Then
ChkRemEspecial.Checked = True
ChkRemEspecial.Enabled = False
TxtFech2.Text = DbRowVenta("Fech2").ToString()
- TrRemEspecial.Visible = UsuarioActual.TienePermisoProceso(390)
+ End If
+ If UsuarioActual.TienePermisoProceso(390) Then
+ TrRemEspecial.Visible = True
+ ChkRemEspecial.Enabled = True
End If
End If
- 'If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
- ' Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
- ' If TienePermiso <> "" Then ' si tiene acceso en el subproyecto
- ' 'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175)
- ' If UsuarioActual.TienePermisoProceso(264) Then
- ' InicializaAplicaRNCDevolucion(TmpDT)
- ' End If
- ' End If
- 'End If
-
Case "RNC"
Trsaldo.Visible = True
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
@@ -10760,13 +10753,17 @@ Partial Class Ventas
CveVentaRelacionada = CveAnticipoPadre
End If
+ Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
+ If UsuarioActual.CveEmpresa = 119 Then AutoConta = False
+ If UsuarioActual.CveEmpresa = 140 Then AutoConta = True
+
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse (ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) Then
CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento)
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, ObjFacturaDevolucion, ObjBancos, Nothing,
Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDesc, IndexNC:=(If(DtVentasNC IsNot Nothing, DtVentasNC.Rows.Count - 1, 0))) Then
ListaNotasCreditoGeneradas.Add(ObjFacturaDevolucion)
If ObjFacturaDevolucion.CvePrePoliza > 0 Then
- If ObjConta.ValidacionesPrePoliza(ObjFacturaDevolucion.CvePrePoliza, UsuarioActual, Opcion:=5, AutoConta:=False) Then
+ If ObjConta.ValidacionesPrePoliza(ObjFacturaDevolucion.CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=ObjFacturaDevolucion.CveVenta, AutoConta:=AutoConta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
@@ -10786,9 +10783,9 @@ Partial Class Ventas
Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCBonificacion, IndexNC:=(DtVentasNC.Rows.Count - 1)) Then
ListaNotasCreditoGeneradas.Add(ObjFacturaBonificacion)
If ObjFacturaBonificacion.CvePrePoliza > 0 Then
- If ObjConta.ValidacionesPrePoliza(ObjFacturaBonificacion.CvePrePoliza, UsuarioActual, Opcion:=5, AutoConta:=False) Then
+ If ObjConta.ValidacionesPrePoliza(ObjFacturaBonificacion.CvePrePoliza, UsuarioActual, Opcion:=5, CveVenta:=ObjFacturaBonificacion.CveVenta, AutoConta:=AutoConta) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
- GuardaLogAD($"Ventas/Ventas-NCGeneradas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ GuardaLogAD($"Ventas/Ventas-NCGeneradas2 | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If
End If
End If
@@ -39793,5 +39790,13 @@ Partial Class Ventas
' End Sub
'End Class
+
+ Protected Sub ChkRemEspecial_CheckedChanged(sender As Object, e As EventArgs)
+ Dim objV As New ClsVentas
+ If objV.UpdateVentaRemisionEspecial(CveVenta, If(ChkRemEspecial.Checked, 2000, 0), Now.AddDays(7), UsuarioActual.CveEmpresa) Then
+ Alert("Se aplicó el cambio", TipoMensaje.ToastInformacion)
+ End If
+ objV.Dispose()
+ End Sub
End Class