@@ -673,7 +676,7 @@
+ DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen,Codigo" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" >
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index e92fc2ad2..23e2e03a7 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -507,10 +507,55 @@ Partial Class Inventarios_EntradasSalidas
'ImgFecha.Visible = True
End If
+
+ If CveMovimiento > 0 And CveConcepto.Contiene(8) And UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
+ ValidaUsaConsola()
+ End If
+
End If
End Sub
+ Property Consola As String
+ Get
+ If ViewState("Consola") Is Nothing Then
+ ViewState("Consola") = ""
+ End If
+ Return ViewState("Consola").ToString
+ End Get
+ Set(value As String)
+ ViewState("Consola") = value
+ End Set
+ End Property
+
+ Private Function ValidaUsaConsola() As Boolean
+ Consola = ""
+ Dim Respuesta As Boolean = False
+
+ For Each gvRow As GridViewRow In GvM.Rows
+ If gvRow.DataKey("Codigo").Contiene("404Q2", "404Q3", "405Q2", "405Q3", "306Q1", "306Q2") Then
+ Consola = "ARS600"
+ Respuesta = True
+ HplImprimirConsola.Visible = True
+ Exit For
+ End If
+ If gvRow.DataKey("Codigo").Contiene("106Q1A", "106Q2A", "106Q3", "106Q3WT", "106Q4", "106Q4A", "106Q5A", "106Q6A", "106Q7A") Then
+ Consola = "ARS800"
+ Respuesta = True
+ HplImprimirConsola.Visible = True
+ Exit For
+ End If
+ Next
+
+ If Respuesta Then
+ HplImprimirConsola.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola)))
+ End If
+
+ Return Respuesta
+
+
+ End Function
+
#Region " PERMISOS PAGINAS "
Private Function PermiteGuardar() As Boolean
Return If(UsuarioActual.TienePermisoProceso(181) Or EsConsumoInterno, True, False)
@@ -909,9 +954,12 @@ Partial Class Inventarios_EntradasSalidas
HplImprimirResumen.Visible = True
HplImprimirResumen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Almr&CveMovimiento={0}", CveMovimiento)))
+
CveCompra = Mov.CveCompra
CveConcepto = Mov.CveConcepto
+
+
If drM("CveEstatusTimbrado").ToString.ToEntero > 0 Then
HplDescargaXml.Visible = True
HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", drM("TimbreSerieFolio"), drM("TimbreTipoDocto"))))
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index f0d83d50d..a0e274ecf 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -4,6 +4,7 @@ Option Explicit On
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
+Imports System.Web.Management
Imports Extensiones
Imports Microsoft.Reporting.WebForms
@@ -1847,10 +1848,13 @@ Partial Class Inventarios_EntregaAlmacen
Private Sub GuardaVenta()
-
- '' INICIA: VALIDACIONES
-
- 'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE!
+ ValidaUsaConsola()
+
+
+
+ '' INICIA: VALIDACIONES
+
+ 'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE!
Dim ObjVentaInv As New ClsInventarios
If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then
TipoEstatus = ObjVentaInv.TipoEstatus
@@ -3112,6 +3116,9 @@ Partial Class Inventarios_EntregaAlmacen
Msg.AppendFormat("Movimiento {2}: {1}", CveMovimiento, Folio, If(TipoMovimiento = 1, "Salida", "Entrada"))
Msg.AppendFormat(" Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
+ If Consola.Trim.Length > 0 Then
+ Msg.AppendFormat(" Consola ", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola)))
+ End If
If CveMovimientoEntrada > 0 Then
Msg.AppendFormat("
Movimiento Entrada (Traspaso): {1}", CveMovimientoEntrada, FolioEntrada)
@@ -3160,8 +3167,10 @@ Partial Class Inventarios_EntregaAlmacen
'SI NO ES GARANTIA MANDA A RECIBIR AL USADO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDocto.Contiene("Rem", "Ped") AndAlso CveMovimientoGarantia <= 0 Then
Msg.AppendFormat("
Recibir Usado: Ir a Recepción de Usados", CveVentaSurtir)
- End If
-
+ End If
+
+
+
Alert(Msg.ToString(), TipoMensaje.MsgInformacion)
Limpia()
@@ -4408,6 +4417,47 @@ Partial Class Inventarios_EntregaAlmacen
Return Cancelar
+ End Function
+
+ Property Consola As String
+ Get
+ If ViewState("Consola") Is Nothing Then
+ ViewState("Consola") = ""
+ End If
+ Return ViewState("Consola").ToString
+ End Get
+ Set(value As String)
+ ViewState("Consola") = value
+ End Set
+ End Property
+
+ Private Function ValidaUsaConsola() As Boolean
+ Consola = ""
+ Dim Respuesta As Boolean = False
+
+ For Each gvRow As GridViewRow In GvDatos.Rows
+
+ If gvRow.FCCheckBox("cbInv").Checked AndAlso gvRow.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
+
+ If gvRow.DataKey("Codigo").Contiene("404Q2", "404Q3", "405Q2", "405Q3", "306Q1", "306Q2") Then
+ Consola = "ARS600"
+ Respuesta = True
+ Exit For
+ End If
+
+ If gvRow.DataKey("Codigo").Contiene("106Q1A", "106Q2A", "106Q3", "106Q3WT", "106Q4", "106Q4A", "106Q5A", "106Q6A", "106Q7A") Then
+ Consola = "ARS800"
+ Respuesta = True
+ Exit For
+ End If
+
+ End If
+
+ Next
+
+ Return Respuesta
+
+
End Function
End Class
diff --git a/Inventarios/RepNotasSinAlmacen.aspx.vb b/Inventarios/RepNotasSinAlmacen.aspx.vb
index 65770e8de..55a9eb262 100644
--- a/Inventarios/RepNotasSinAlmacen.aspx.vb
+++ b/Inventarios/RepNotasSinAlmacen.aspx.vb
@@ -65,13 +65,16 @@ Partial Class RepNotasSinAlmacen
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
- If Not IsPostBack Then
-
+ If Not IsPostBack Then
+
CargaCombos()
'CargaDatos()
CargaPermisos()
End If
- End Sub
+ End Sub
+
+
+
Private Sub CargaPermisos()
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
Dim TienePermisoDesmarcar As Boolean = UsuarioActual.TienePermisoProceso(278)
@@ -88,6 +91,9 @@ Partial Class RepNotasSinAlmacen
GvVentas.Columns(8).Visible = True
TxtFechaF.Text = NowADS.AddDays(3).ToShortDateString
+ GvVentas.Columns(4).Visible = False
+ GvCompras.Columns(4).Visible = False
+
GvVentas.Columns(0).ItemStyle.Width = Unit.Pixel(120)
'CType(GvVentas.Columns(2), Literal).DataFormatString = "{0:dd/MM/yyyy HH:mm}"
'CType(GvVentas.Columns(2), Literal).ItemStyle.Width = Unit.Pixel(120)
diff --git a/OS/Asignaciones.aspx b/OS/Asignaciones.aspx
index add8f193f..de229e14f 100644
--- a/OS/Asignaciones.aspx
+++ b/OS/Asignaciones.aspx
@@ -200,10 +200,15 @@
+
+
+
+
+
>
diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb
index bbee6bbff..19d9044ad 100644
--- a/OS/Asignaciones.aspx.vb
+++ b/OS/Asignaciones.aspx.vb
@@ -40,16 +40,13 @@ Partial Class OS_Asignaciones
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
+ GvNA_ConfiguraColumnas()
CargaEstatusOS()
'CargaUsuarios()
CargaClientes()
CargaSubProyecto()
- If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
- GvNA.Columns(2).HeaderText = "Hospital"
- GvNA.Columns(7).HeaderText = "Fecha Cirugía"
- GvNA.Columns(8).HeaderText = "Hora Cirugía"
- End If
+
If UsuarioActual.TienePermisoProceso(171) Then
CargaOrdenesServiciosAsignadasXPersona()
@@ -75,6 +72,9 @@ Partial Class OS_Asignaciones
End If
ObjEstatusPermisos.Dispose()
+
+
+
End If
RegistraScript("
@@ -90,6 +90,26 @@ Partial Class OS_Asignaciones
")
End Sub
+ Private Sub GvNA_ConfiguraColumnas()
+
+ If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
+ GvNA.Columns(3).Visible = False
+ GvNA.Columns(4).Visible = False
+ GvNA.Columns(5).Visible = False
+ GvNA.Columns(6).Visible = False
+
+ GvNA.Columns(7).Visible = True
+ GvNA.Columns(8).Visible = True
+
+
+ GvNA.Columns(2).HeaderText = "Hospital"
+ GvNA.Columns(9).HeaderText = "Fecha Cirugía"
+ GvNA.Columns(10).HeaderText = "Hora Cirugía"
+ End If
+
+
+ End Sub
+
#Region "C A R G A S "
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
@@ -184,7 +204,7 @@ Partial Class OS_Asignaciones
Dim TecnicosResultado As New DataTable
If ObjOS.GetSubProyectosEstatusInicial(-1, 3, UsuarioActual.CveEmpresa) Then
- TecnicosSubProyectos = ObjOS.DtResultados
+ TecnicosSubProyectos = ObjOS.DtResultados.FiltraParametros(" Estatus = 'True' ")
End If
If DtOSSubProyectos IsNot Nothing Then
diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx
index 3a694320d..98bab92bd 100644
--- a/OS/OrdenesServicios.aspx
+++ b/OS/OrdenesServicios.aspx
@@ -1308,9 +1308,7 @@
-
-
+
diff --git a/Transportes/Boletos.aspx b/Transportes/Boletos.aspx
index 254e8184c..011e520a4 100644
--- a/Transportes/Boletos.aspx
+++ b/Transportes/Boletos.aspx
@@ -33,11 +33,6 @@
color: #fff;
}
- {
- background-color: #45b6af;
- color: #fff;
- }
-
.nodisponible {
display: inline-block;
width: 45px;
@@ -74,8 +69,9 @@
-
+
+ <%-- Datos de cliente y su viaje --%>
+
+
+
diff --git a/Transportes/CatRutas.aspx.vb b/Transportes/CatRutas.aspx.vb
new file mode 100644
index 000000000..3745008d9
--- /dev/null
+++ b/Transportes/CatRutas.aspx.vb
@@ -0,0 +1,291 @@
+Option Explicit On
+Option Strict On
+Imports ADSNetLibrary.SIGAPI.Helpers
+Imports Extensiones
+Imports Extensiones.ModExtensiones
+
+Partial Class CatRutas
+ Inherits ClsPaginas
+
+ Private Property Cve As Integer
+ Get
+ Return ViewState("Cve").ToString().ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("Cve") = value
+ End Set
+ End Property
+ Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+ ViewState("Cve") = 0
+ InicializarCombos()
+ CargaDatos()
+ End If
+
+ End Sub
+ Private Sub CargaDatos()
+ 'Lista Rutas'
+ Dim ObjRutas As New ClsTransportes()
+ If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
+
+ If ObjRutas.DtResultados.Rows.Count > 0 Then
+ GvRutas.DataSource = ObjRutas.DtResultados
+ GvRutas.DataBind()
+ End If
+ End If
+ 'Lista Destinos'
+ If ObjRutas.GetDestinos() Then
+
+ If ObjRutas.DtResultados.Rows.Count > 0 Then
+ GvDestinos.DataSource = ObjRutas.DtResultados
+ GvDestinos.DataBind()
+ End If
+ End If
+ 'Lista Importes'
+ If ObjRutas.GetDestinosTarifas(-1, -1) Then
+ If ObjRutas.DtResultados.Rows.Count > 0 Then
+ GvImportes.DataSource = ObjRutas.DtResultados
+ GvImportes.DataBind()
+ End If
+ End If
+
+ UpPanel.Update()
+
+ End Sub
+
+ Private Sub InicializarCombos()
+ Dim ObjDestinos As New ClsTransportes()
+
+ If ObjDestinos.GetDestinos() Then
+
+ If ObjDestinos.DtResultados.Rows.Count > 0 Then
+
+ DdlOrigen.DataSource = ObjDestinos.DtResultados
+ DdlOrigen.DataBind()
+ DdlOrigen.Items.Insert(0, New ListItem("Seleccione Partida", ""))
+
+ DdlFinal.DataSource = ObjDestinos.DtResultados
+ DdlFinal.DataBind()
+ DdlFinal.Items.Insert(0, New ListItem("Seleccione Destino", ""))
+ End If
+ End If
+ ObjDestinos.Dispose()
+
+
+ Dim ObjRutas As New ClsTransportes()
+ If ObjRutas.GetRutas(-1, -1, -1, "", True, DateTime.Now) Then
+
+ If ObjRutas.DtResultados.Rows.Count > 0 Then
+ DdlRutas.DataSource = ObjRutas.DtResultados
+ DdlRutas.DataBind()
+ DdlRutas.Items.Insert(0, New ListItem("Seleccione Ruta", ""))
+ End If
+ End If
+ End Sub
+
+ Protected Sub MostrarModal(sender As Object, e As EventArgs)
+ TxtRuta.Text = ""
+ DdlRutaEstatus.SelectedValue = ""
+ TxtDestino.Text = ""
+ DdlEsNacional.SelectedValue = ""
+ DdlDestinoEstatus.SelectedValue = ""
+ DdlOrigen.SelectedValue = ""
+ DdlFinal.SelectedValue = ""
+ TxtImporte.Text = ""
+ BtnAddRuta.Visible = False
+ BtnAddDestino.Visible = False
+ BtnAddImporte.Visible = False
+ PnRuta.Visible = False
+ PnDestino.Visible = False
+ PnImporte.Visible = False
+ Dim id As String = DirectCast(sender, LinkButton).ID
+
+ If id.Contains("Editar") Then
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ Select Case id
+ Case "BtnEditarRuta"
+ ModalLabel.Text = "Editar Ruta"
+ PnRuta.Visible = True
+ TxtRuta.Text = GvRow.DataKey("Ruta")
+ DdlRutaEstatus.SelectedValue = GvRow.DataKey("Estatus")
+ BtnAddRuta.Visible = True
+ BtnAddRuta.Text = "Editar"
+ ViewState("Cve") = GvRow.DataKey("CveRuta").ToEntero
+
+
+ Case "BtnEditarDestino"
+ ModalLabel.Text = "Editar Destino"
+ TxtDestino.Text = GvRow.DataKey("Destino")
+ DdlEsNacional.SelectedValue = GvRow.DataKey("EsNacional")
+ DdlDestinoEstatus.SelectedValue = GvRow.DataKey("Estatus")
+ PnDestino.Visible = True
+ BtnAddDestino.Visible = True
+ BtnAddDestino.Text = "Editar"
+ ViewState("Cve") = GvRow.DataKey("CveDestino").ToEntero
+
+
+ Case "BtnEditarImporte"
+ ModalLabel.Text = "Editar Importe"
+ DdlRutas.SelectedValue = GvRow.DataKey("CveRuta")
+ DdlOrigen.SelectedValue = GvRow.DataKey("CveDestinoOrigen")
+ DdlFinal.SelectedValue = GvRow.DataKey("CveDestinoFinal")
+ TxtImporte.Text = GvRow.DataKey("Importe")
+ PnImporte.Visible = True
+ BtnAddImporte.Visible = True
+ BtnAddImporte.Text = "Editar"
+ ViewState("Cve") = GvRow.DataKey("CveDestinoTarifa").ToEntero
+
+
+ End Select
+ End If
+
+ If id.Contains("Agregar") Then
+ Select Case id
+ Case "BtnAgregarRuta"
+ ModalLabel.Text = "Agregar Ruta"
+ PnRuta.Visible = True
+ BtnAddRuta.Visible = True
+ BtnAddRuta.Text = "Guardar"
+ Case "BtnAgregarDestino"
+ ModalLabel.Text = "Agregar Destino"
+ PnDestino.Visible = True
+ BtnAddDestino.Visible = True
+ BtnAddDestino.Text = "Guardar"
+ Case "BtnAgregarImporte"
+ ModalLabel.Text = "Agregar Importe"
+ PnImporte.Visible = True
+ BtnAddImporte.Visible = True
+ BtnAddImporte.Text = "Guardar"
+
+ End Select
+ End If
+ UpModal.Update()
+ RegistraScript(String.Format("$('#{0}').modal('show');", "Modal"))
+ End Sub
+
+
+#Region "Rutas"
+ Protected Sub AddRuta(sender As Object, e As EventArgs)
+
+ Dim ObjRuta As New ClsTransportes
+ ObjRuta.IniciaTransacSQL()
+ Try
+ If BtnAddRuta.Text = "Guardar" Then
+ If ObjRuta.AddRuta(TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then
+ ObjRuta.Commit()
+ Alert("Ruta Agregada Correctamente.")
+ End If
+ End If
+
+ If BtnAddRuta.Text = "Editar" Then
+ If ObjRuta.UpdateRuta(Cve, TxtRuta.Text, DdlRutaEstatus.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ ObjRuta.Commit()
+ Alert("Ruta Actualizada Correctamente.")
+ End If
+ End If
+ Catch ex As Exception
+ ObjRuta.RollBack()
+ Finally
+ CargaDatos()
+ ObjRuta.Dispose()
+ End Try
+
+
+ End Sub
+ Protected Sub RemoveRuta(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim ObjRuta As New ClsTransportes
+
+ If ObjRuta.RemoveRuta(GvRow.DataKey("CveRuta").ToEntero) Then
+ Alert("Ruta eliminada correctamente")
+ CargaDatos()
+ End If
+
+ ObjRuta.Dispose()
+ End Sub
+#End Region
+
+#Region "Destinos"
+ Protected Sub AddDestino(sender As Object, e As EventArgs)
+
+ Dim ObjDestino As New ClsTransportes
+ ObjDestino.IniciaTransacSQL()
+ Try
+ If BtnAddDestino.Text = "Guardar" Then
+ If ObjDestino.AddDestino(TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 1 Then
+ ObjDestino.Commit()
+ Alert("Destino agregado correctamente.")
+ End If
+ End If
+
+ If BtnAddDestino.Text = "Editar" Then
+ If ObjDestino.UpdateDestino(Cve, TxtDestino.Text, DdlDestinoEstatus.SelectedValue, DdlEsNacional.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ ObjDestino.Commit()
+ Alert("Destino actualizado correctamente.")
+ End If
+ End If
+ Catch ex As Exception
+ ObjDestino.RollBack()
+ Finally
+ CargaDatos()
+ ObjDestino.Dispose()
+ End Try
+
+
+ End Sub
+ Protected Sub RemoveDestino(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim ObjDestino As New ClsTransportes
+
+ If ObjDestino.RemoveDestino(GvRow.DataKey("CveDestino").ToEntero) Then
+ Alert("Destino eliminado correctamente")
+ CargaDatos()
+ End If
+
+ ObjDestino.Dispose()
+ End Sub
+#End Region
+
+#Region "Importes"
+ Protected Sub AddImporte(sender As Object, e As EventArgs)
+
+ Dim ObjImporte As New ClsTransportes
+ ObjImporte.IniciaTransacSQL()
+ Try
+ If BtnAddImporte.Text = "Guardar" Then
+ If ObjImporte.AddDestinosTarifas(DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) > 1 Then
+ ObjImporte.Commit()
+ Alert("Importe agregado correctamente.")
+ End If
+ End If
+
+ If BtnAddImporte.Text = "Editar" Then
+ If ObjImporte.UpdateDestinosTarifas(Cve, DdlRutas.SelectedValue, DdlOrigen.SelectedValue, DdlFinal.SelectedValue, TxtImporte.Text) Then
+ ObjImporte.Commit()
+ Alert("Importe actualizado correctamente.")
+ End If
+ End If
+ Catch ex As Exception
+ ObjImporte.RollBack()
+ Finally
+ CargaDatos()
+ ObjImporte.Dispose()
+ End Try
+
+
+ End Sub
+ Protected Sub RemoveImporte(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim ObjImporte As New ClsTransportes
+
+ If ObjImporte.RemoveDestinosTarifas(GvRow.DataKey("CveDestinoTarifa").ToEntero) Then
+ Alert("Importe eliminada correctamente")
+ CargaDatos()
+ End If
+
+ ObjImporte.Dispose()
+ End Sub
+#End Region
+
+End Class
diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx
index 043705da3..a5c307b84 100644
--- a/Transportes/RepContratos.aspx
+++ b/Transportes/RepContratos.aspx
@@ -3,7 +3,7 @@
CodeFile="RepContratos.aspx.vb"
Inherits="ListadoContratos" %>
-
+
Listado de Contratos
@@ -30,41 +30,155 @@
.boton {
background: red;
}
+
+ .consulta {
+ padding: 1rem 2rem;
+ background-color: #95A5A6;
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+ margin-bottom:1rem;
+ }
+
+ .consulta_campo {
+ display: flex;
+ gap: 1rem;
+ align-items: center;
+ width:100%;
+ }
+
+ .consulta_campo label {
+ color: white;
+ font-weight: bold;
+ }
-
-
-
+
+
+
diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb
index 3a0ab654b..251793fff 100644
--- a/Transportes/RepContratosCalendario.aspx.vb
+++ b/Transportes/RepContratosCalendario.aspx.vb
@@ -1,5 +1,6 @@
Option Explicit On
Option Strict On
+Imports System.Data.SqlClient
Imports ADSNetLibrary.SIGAPI.Helpers
Imports Extensiones.ModExtensiones
@@ -52,11 +53,53 @@ Partial Class RepContratosCalendario
End Sub
+ Private Sub OnRowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratos.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ Dim estatusContrato As String = DataBinder.Eval(e.Row.DataItem, "EstatusContrato").ToString()
+
+ Select Case estatusContrato
+ Case "1"
+ e.Row.BackColor = Drawing.Color.FromArgb(0, 165, 106)
+ Case "2"
+ e.Row.BackColor = Drawing.Color.FromArgb(43, 79, 214)
+ Case "3"
+ e.Row.BackColor = Drawing.Color.FromArgb(238, 96, 46)
+ End Select
+ End If
+ End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
RegistraScript("$('#ModalActualizar').modal('show');")
-
End Sub
+ Protected Sub Consultar(sender As Object, e As EventArgs)
+ If DdlClientesConsulta.SelectedValue = "" Then
+ Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim cliente As Integer = DdlClientesConsulta.SelectedValue.ToEntero
+ Dim estatus As Integer = DdlEstatusConsulta.SelectedValue.ToEntero
+ Dim fechaInicial As DateTime = txtFechaI.Text.ToDate
+ Dim fechaFinal As DateTime = txtFechaF.Text.ToDate
+
+ Dim query As String = "SELECT *, ISNULL(Cli.NombreComercial,'') AS NombreComercial, RH.NombreCompleto AS NombreCompleto FROM Con_Contratos C LEFT JOIN Clientes Cli with(nolock) ON Cli.CveCliente = C.CveCliente LEFT JOIN RH_Personal RH with(nolock) ON C.CveChofer = RH.CvePersonal WHERE C.CveCliente = @Cliente AND EstatusContrato = @Estatus AND FechaInicial BETWEEN @FechaInicial AND @FechaFinal"
+
+ Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
+ Using command As New SqlCommand(query, connection)
+ command.Parameters.AddWithValue("@Cliente", cliente)
+ command.Parameters.AddWithValue("@Estatus", estatus)
+ command.Parameters.AddWithValue("@FechaInicial", fechaInicial)
+ command.Parameters.AddWithValue("@FechaFinal", fechaFinal)
+
+ connection.Open()
+ Dim reader As SqlDataReader = command.ExecuteReader()
+ GvContratos.DataSource = reader
+ GvContratos.DataBind()
+ End Using
+ End Using
+
+ UpTitulos.Update()
+ End Sub
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
'If DdlClientes.SelectedValue = "" Then
@@ -68,16 +111,28 @@ Partial Class RepContratosCalendario
ObjContratos.IniciaTransacSQL()
If ObjContratos.UpdateContratoAF(CveContrato.Value.ToEntero, DdlAF.SelectedValue.ToEntero, DdlChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
- ObjContratos.Commit()
- Alert("Actualizado Correctamente.")
- Else
- ObjContratos.RollBack()
- End If
+ ObjContratos.Commit()
+ Alert("Actualizado Correctamente.")
+ Else
+ ObjContratos.RollBack()
+ End If
- ObjContratos.Dispose()
- CargaDatos()
+ ObjContratos.Dispose()
+ CargaDatos()
+ Protected Sub UpdateModal(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ TxtObservaciones.Text = GvRow.DataKey("Observaciones")
+ TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
+ TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
+ TxtFechaSalida.Text = GvRow.DataKey("FechaInicial").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
+ TxtFechaRegreso.Text = GvRow.DataKey("FechaFinal").ToDateTime.ToString("yyyy-MM-dd HH:mm:ss").Replace(" ", "T")
+ DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
+ DdlAF.SelectedValue = GvRow.DataKey("CveAF")
+ DdlChofer.SelectedValue = GvRow.DataKey("CveChofer")
+
+ UpModal.Update()
+ RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
-
-
End Class
diff --git a/asmx/WS_PuntoVenta.asmx b/asmx/WS_PuntoVenta.asmx
index dc43bc5de..4ca18c926 100644
--- a/asmx/WS_PuntoVenta.asmx
+++ b/asmx/WS_PuntoVenta.asmx
@@ -439,8 +439,30 @@ Public Class WS_PuntoVenta
objProyecto.Dispose()
Return Respuesta
- End Function
-
+ End Function
+
+
+
+ Public Function GetSucursales(CveEmpresa As Integer) As RespuestaWS
+ Dim objProyecto As New ClsSubProyectos
+ Dim Respuesta As New RespuestaWS
+
+ If objProyecto.GetSubProyectos(CveEmpresa) Then
+ Respuesta.Datos = objProyecto.DtResultados
+
+ Respuesta.Datos.Columns(2).ColumnName = "CveSucursal"
+ Respuesta.Datos.Columns(3).ColumnName = "Sucursal"
+ Respuesta.Datos.TableName = "Resultados"
+ Respuesta.HuboError = False
+ Else
+ Respuesta.Descripcion = "HUBO UN ERROR"
+ End If
+
+ objProyecto.Dispose()
+ Return Respuesta
+ End Function
+
+
Public Function GetClientes(CveEmpresa As Integer) As RespuestaWS
Dim objClientes As New ClsClientes
@@ -546,14 +568,15 @@ Public Class WS_PuntoVenta
#Region "ProductosServicios"
- Public Function GetProductosServicios(CvePS As Integer, CveClasificacion As Integer, Codigo As String, PS As String, CveEmpresa As Integer, CveSubProyecto As Integer) As RespuestaWS
+ Public Function GetProductosServicios(CvePS As Integer, CveClasificacion As Integer, Codigo As String, PS As String, CveEmpresa As Integer, CveSucursal As Integer) As RespuestaWS
Dim objPS As New ClsProductosServicios
Dim Respuesta As New RespuestaWS
- If objPS.GetPS(CvePS, CveClasificacion, CveEmpresa, Codigo, PS, CveSubProyecto:=CveSubProyecto, pAplicaParaVenta:=1, pEstado:=1) Then
+ If objPS.GetPS(CvePS, CveClasificacion, CveEmpresa, Codigo, PS:=PS, CveSubProyecto:=CveSucursal, pAplicaParaVenta:=1, pEstado:=1) Then
Respuesta.Datos = objPS.DtResultados
Respuesta.Datos.TableName = "Resultados"
- Respuesta.HuboError = False
+ Respuesta.HuboError = False
+ GuardaLog($"CvePS: {CvePS}, CveClasificacion: {CveClasificacion}, CveEmpresa: {CveEmpresa}, Codigo: {Codigo}, PS: {PS}, CveSubProyecto: {CveSucursal}, pAplicaParaVenta: {1}, pEstado: {1}")
Else
Respuesta.Descripcion = "HUBO UN ERROR"
End If
@@ -847,17 +870,35 @@ Public Class WS_PuntoVenta
CvePrePoliza = ObjConta.AddPrePolizas("Vta", 4, objVenta.Total, objVenta.Total, objVenta.CveMoneda, objVenta.Fecha, "Punto de Venta addVenta", objVenta.CveUsuario, objVenta.CveEmpresa)
- If objVentas.DtResultados.Rows.Count = 0 Then
+ If objVentas.DtResultados.Rows.Count = 0 Then
+
+ If objVenta.CveEmpresa = 1 Then
+ If objVenta.CveSubProyecto <= 0 Then
+ objVenta.CveSubProyecto = 10430
+ End If
+
+ If objVenta.FolioFact.ToString.Contiene("", "-1", "0") Then
+ objVenta.FolioFact = getFolio("Rem", objVenta.CveEmpresa, objVenta.CveSubProyecto).ToEntero
+ End If
+ End If
+
+
+
If objVentas.AddVenta(objVenta.TipoDocto, objVenta.FolioFact, objVenta.CveCliente, objVenta.CveClienteSucursal,
objVenta.SubTotal, objVenta.Descuento, objVenta.Amortizacion, objVenta.IVA, objVenta.RetIVA, objVenta.RetISR,
objVenta.Total, objVenta.CveMoneda, objVenta.TipoCambio, objVenta.CveMetodoPago, objVenta.CondicionesPago,
- objVenta.FormaPago, ClsPaginas.NowADS(), objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, objVenta.FechaEjecucion,
+ objVenta.FormaPago, ClsPaginas.NowADS(), objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, If(objVenta.FechaEjecucion < MinFecha, Now, objVenta.FechaEjecucion),
objVenta.CveVendedor, If(objVenta.Alfa1 IsNot Nothing, objVenta.Alfa1, ""), If(objVenta.Alfa2 IsNot Nothing, objVenta.Alfa2, ""), If(objVenta.Alfa3 IsNot Nothing, objVenta.Alfa3, ""), objVenta.Num1,
- objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza, objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal, CveSubProyecto:=objVenta.CveSubProyecto, CveSubProyectoEjecucion:=objVenta.CveSubProyecto) Then
- objVenta.CveVenta = objVentas.CveVenta
- 'Ingresar los detalles
+ objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza,
+ objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal, CveSubProyecto:=objVenta.CveSubProyecto, CveSubProyectoEjecucion:=objVenta.CveSubProyecto, Vigencia:=Now) Then
+ objVenta.CveVenta = objVentas.CveVenta
+ 'Ingresar los detalles
+
+ If objVenta.CveEmpresa = 1 Then
+ GuardaLog($"objVenta.Detalle {objVenta.Detalle.Count}")
+ End If
For Each Detalle As ClsVentaWS.ClsVentaDetalleWS In objVenta.Detalle
- If objVentas.AddVentaDetalle(objVentas.CveVenta, Detalle.CvePS, Detalle.Cantidad, Detalle.CveUnidadMedida, Detalle.PU, Detalle.IVA, Detalle.Total, Detalle.Observaciones, Detalle.Descuento, Detalle.TipoDescuento, Detalle.CveSubProyecto, -1) Then
+ If objVentas.AddVentaDetalle(objVentas.CveVenta, Detalle.CvePS, Detalle.Cantidad, Detalle.CveUnidadMedida, Detalle.PU, Detalle.IVA, Detalle.Total, Detalle.Observaciones, Detalle.Descuento, Detalle.TipoDescuento, Detalle.CveSubProyecto, -1, IEPS:=0) Then
'Ingresar las caracteristicas del detalle de la venta
For Each Caracteristica As ClsVentaWS.ClsVentaDetalleCaracteristicaWS In Detalle.Caracteristicas
If objVentas.AddVentaDetalleCaracteristica(objVentas.CveVentaDetalle, Caracteristica.CvePS, Caracteristica.CveOpcion) = False Then
@@ -954,50 +995,57 @@ Public Class WS_PuntoVenta
'Se agrega movimiento separado por la cuenta de ventas (ER)
' For Each Row As DataRow In DT.Rows
ImporteMov = objVenta.SubTotal
- Dim CveClasificacion_04 As Integer = -1
- If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoVenta, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, CveSubProyecto:=objVenta.CveSubProyecto, CveClasificacion:=CveClasificacion_04) Then
- ErrorMovtosVentas = True
- End If
- End If
- ' Next
-
- 'Se agregan los DSV DESCUENTOS
- ImporteMov = objVenta.Descuento
- If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoDSV, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
- ErrorMovtosDSV = True
- End If
- End If
- 'End If
-
- 'Se agregan las CxC
- ImporteMov = objVenta.Total - TotalPagado
- If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoAfectacion, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
- ErrorMovtosCxC = True
- End If
- End If
-
- 'Si hubo un pago agregarlo
- ImporteMov = TotalPagado
- If ImporteMov <> 0 Then
-
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, 2, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
- ErrorMovtosCxC = True
- End If
- End If
- 'Se agregan el Traslado de IVA
- ImporteMov = objVenta.IVA
- If ImporteMov <> 0 Then
- Dim PorcentajeImpuesto As Decimal = 0
- If objVenta.SubTotal > 0 Then
- PorcentajeImpuesto = (objVenta.IVA / objVenta.SubTotal)
- End If
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoIVA, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, PorcentajeImpuesto:=PorcentajeImpuesto) Then
- ErrorMovtosTrasladoIVA = True
- End If
- End If
+
+
+
+
+
+ ' FIXME OIC
+ 'Dim CveClasificacion_04 As Integer = -1
+ 'If ImporteMov <> 0 Then
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoVenta, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, CveSubProyecto:=objVenta.CveSubProyecto, CveClasificacion:=CveClasificacion_04) Then
+ ' ErrorMovtosVentas = True
+ ' End If
+ 'End If
+ '' Next
+
+ ''Se agregan los DSV DESCUENTOS
+ 'ImporteMov = objVenta.Descuento
+ 'If ImporteMov <> 0 Then
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoDSV, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ ' ErrorMovtosDSV = True
+ ' End If
+ 'End If
+ ''End If
+
+ ''Se agregan las CxC
+ 'ImporteMov = objVenta.Total - TotalPagado
+ 'If ImporteMov <> 0 Then
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoAfectacion, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ ' ErrorMovtosCxC = True
+ ' End If
+ 'End If
+
+ ''Si hubo un pago agregarlo
+ 'ImporteMov = TotalPagado
+ 'If ImporteMov <> 0 Then
+
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, ImporteMov, 2, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ ' ErrorMovtosCxC = True
+ ' End If
+ 'End If
+ ''Se agregan el Traslado de IVA
+ 'ImporteMov = objVenta.IVA
+ 'If ImporteMov <> 0 Then
+ ' Dim PorcentajeImpuesto As Decimal = 0
+ ' If objVenta.SubTotal > 0 Then
+ ' PorcentajeImpuesto = (objVenta.IVA / objVenta.SubTotal)
+ ' End If
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, ImporteMov, CveConceptoIVA, " ", " ", CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, PorcentajeImpuesto:=PorcentajeImpuesto) Then
+ ' ErrorMovtosTrasladoIVA = True
+ ' End If
+ 'End If
+
End If
End If
Else
@@ -1051,6 +1099,37 @@ Public Class WS_PuntoVenta
Return CveVentas
End Function
+
+
+ Private Function getFolio(TipoDoctoConsulta As String, CveEmpresa As Integer, CvesubProyecto As Integer) As String
+ Dim Respuesta As String = "-1"
+ Dim ObjFolios As New ClsGralFolios()
+
+
+
+
+
+ If ObjFolios.GetFolios(TipoDoctoConsulta, CveEmpresa) Then
+ GuardaLog($" GetFolios ok {ObjFolios.DtResultados.Rows.Count} . CvesubProyecto = {CvesubProyecto} .")
+ Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", CvesubProyecto))
+ If DT.Rows.Count > 0 Then
+
+ Respuesta = DT.Rows(0)("FActual").ToString()
+
+
+
+ End If
+ DT.Dispose()
+
+ End If
+
+ ObjFolios.Dispose()
+
+ GuardaLog($" Folio Rem {Respuesta} .")
+ Return Respuesta
+
+ End Function
+
#End Region