-
+
diff --git a/AF/TipoOrdenTrabajo.aspx.vb b/AF/TipoOrdenTrabajo.aspx.vb
index 71b84d52f..f559d1da8 100644
--- a/AF/TipoOrdenTrabajo.aspx.vb
+++ b/AF/TipoOrdenTrabajo.aspx.vb
@@ -12,20 +12,59 @@ Partial Class AF_TipoOrdenTrabajo
#Region " PROPIEDADES"
- Property CveOrdenTrabajo As Integer
+ Property CveTipoServicio As Integer
Get
- If ViewState("CveOrdenTrabajo") Is Nothing Then
+ If ViewState("CveTipoServicio") Is Nothing Then
Return -1
Else
- Return ViewState("CveOrdenTrabajo").ToString.ToEntero
+ Return ViewState("CveTipoServicio").ToString.ToEntero
End If
End Get
Set(value As Integer)
- ViewState("CveOrdenTrabajo") = value
+ ViewState("CveTipoServicio") = value
+ End Set
+ End Property
+
+ Property DTMateriales As DataTable
+ Get
+ If ViewState("DTMateriales") Is Nothing Then
+ Return New DataTable
+ Else
+ Return DirectCast(ViewState("DTMateriales"), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ ViewState("DTMateriales") = value
End Set
End Property
+ Property DTActividades As DataTable
+ Get
+ If ViewState("DTActividades") Is Nothing Then
+ Return New DataTable
+ Else
+ Return DirectCast(ViewState("DTActividades"), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ ViewState("DTActividades") = value
+ End Set
+ End Property
+
+
+ Property DTACheckList As DataTable
+ Get
+ If ViewState("DTACheckList") Is Nothing Then
+ Return New DataTable
+ Else
+ Return DirectCast(ViewState("DTACheckList"), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ ViewState("DTACheckList") = value
+ End Set
+ End Property
#End Region
@@ -34,8 +73,12 @@ Partial Class AF_TipoOrdenTrabajo
If Not Page.IsPostBack Then
- If Request("CveOrdenTrabajo") IsNot Nothing Then
- CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero
+ If Request("CveTipoServicio") IsNot Nothing Then
+ CveTipoServicio = Request("CveTipoServicio").ToEntero
+ End If
+
+ If CveTipoServicio = -1 Then
+ CrearTablas()
End If
CargaCombos()
@@ -43,11 +86,57 @@ Partial Class AF_TipoOrdenTrabajo
End Sub
+
+ Property IndexMaterial As Integer
+ Get
+ If ViewState("IndexMaterial") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("IndexMaterial").ToString.ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("IndexMaterial") = value
+ End Set
+ End Property
+
+
+
+ Property IndexActividades As Integer
+ Get
+ If ViewState("IndexActividades") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("IndexActividades").ToString.ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("IndexActividades") = value
+ End Set
+ End Property
+
+ Property IndexCheckList As Integer
+ Get
+ If ViewState("IndexCheckList") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("IndexCheckList").ToString.ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("IndexCheckList") = value
+ End Set
+ End Property
+
+
+
+
#Region " CARGA PARAMETROS "
#End Region
#Region " CARGA COMBOS "
+
Protected Sub CargaCombos()
Dim ObjAF As New ClsAF
@@ -65,6 +154,52 @@ Partial Class AF_TipoOrdenTrabajo
UpFiltro.Update()
+ DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
+
+
+ If CveTipoServicio <= 0 Then
+ CargaActividades()
+
+ End If
+
+ End Sub
+
+
+
+
+
+#End Region
+
+#Region "CREAR TABLAS"
+
+ Private Sub CrearTablas()
+ 'CveTipoServicioMaterial CveTipoServicio Cantidad CveUM CvePS Tipo
+
+ Dim DtTempMaterial As New DataTable
+ Dim DtTempActividades As New DataTable
+
+ DtTempMaterial.Columns.Add("CveTipoServicioMaterial", GetType(Integer))
+ DtTempMaterial.Columns.Add("CveTipoServicio", GetType(Integer))
+ DtTempMaterial.Columns.Add("Cantidad", GetType(Decimal))
+ DtTempMaterial.Columns.Add("CveUM", GetType(Integer))
+ DtTempMaterial.Columns.Add("CvePS", GetType(Integer))
+ DtTempMaterial.Columns.Add("Tipo", GetType(Integer))
+ DtTempMaterial.Columns.Add("PS", GetType(String))
+ DtTempMaterial.Columns.Add("Abreviatura", GetType(String))
+ DtTempMaterial.AcceptChanges()
+
+ DTMateriales = DtTempMaterial
+
+
+ 'CveTipoServicioActividad CveActividad Duracion Observaciones
+
+ DtTempActividades.Columns.Add("CveTipoServicioActividad", GetType(String))
+ DtTempActividades.Columns.Add("CveActividad", GetType(String))
+ DtTempActividades.Columns.Add("Duracion", GetType(Decimal))
+ DtTempActividades.Columns.Add("Observaciones", GetType(String))
+ DtTempActividades.AcceptChanges()
+
+ DTActividades = DtTempActividades
End Sub
@@ -72,6 +207,7 @@ Partial Class AF_TipoOrdenTrabajo
#End Region
+
#Region " CARGA DATOS "
'Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs)
' CargaDatos()
@@ -85,6 +221,61 @@ Partial Class AF_TipoOrdenTrabajo
Private Sub CargaDatos()
+ CargaMateriales()
+ CargaActividades()
+ CargaCheckList()
+
+ End Sub
+
+ Private Sub CargaMateriales()
+
+ If CveTipoServicio > 0 Then
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio) Then
+ GvMaterial.DataSource = DTMateriales
+
+ Else
+ GvMaterial = Nothing
+ End If
+
+ ObjAF.Dispose()
+
+ GvMaterial.DataBind()
+ Else
+ GvMaterial.DataSource = DTMateriales
+ GvMaterial.DataBind()
+ End If
+
+ UpGvMaterial.Update()
+
+ End Sub
+
+ Private Sub CargaActividades()
+
+ Dim ObjAF As New ClsAF
+
+ If CveTipoServicio <= 0 Then
+
+ If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then
+ GvActividades.DataSource = ObjAF.DtResultados
+ Else
+ GvActividades.DataSource = Nothing
+ End If
+
+ End If
+
+ ObjAF.Dispose()
+
+ GvActividades.DataBind()
+
+ UpGvActividades.Update()
+
+ End Sub
+
+ Private Sub CargaCheckList()
+
Dim ObjAF As New ClsAF
@@ -94,7 +285,6 @@ Partial Class AF_TipoOrdenTrabajo
End Sub
-
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -110,9 +300,6 @@ Partial Class AF_TipoOrdenTrabajo
- Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
-
- End Sub
@@ -277,4 +464,154 @@ Partial Class AF_TipoOrdenTrabajo
+ Protected Sub LnkAgregarMaterial_Click(sender As Object, e As EventArgs)
+
+ RegistraScript("$('#ModalMateriales').modal('show');")
+ ResetModalMaterial()
+ End Sub
+
+ Private Sub ResetModalMaterial()
+
+ DdlPS.txtValue.Value = ""
+ DdlPS.txtText.Value = ""
+ TxtCantidad.Text = ""
+
+ UpModalMaterialesBody.Update()
+
+ End Sub
+
+
+
+
+ Protected Sub BtnGuardarMaterial_Click(sender As Object, e As EventArgs)
+
+ If DdlPS.txtValue.Value.ToString.ToEntero <= 0 Then
+ Alert("Debe seleccionar un producto o servicio", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim CveUnidadMedida As Integer = -1
+ Dim CvePS As Integer = DdlPS.txtValue.Value.ToEntero
+ Dim Tipo As Integer = -1
+ Dim UMAbreviatura As String = ""
+
+ Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
+ CveUnidadMedida = drPS("CveUM").ToString.ToEntero
+ Tipo = drPS("CveTipoPS").ToString.ToEntero
+ UMAbreviatura = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Abreviatura", $"CveUnidadMedida = {CveUnidadMedida}")
+
+ If CveTipoServicio > 0 Then
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.AddTiposServiciosMaterial(CveTipoServicio, TxtCantidad.Text.ToDecimal, CveUnidadMedida, CvePS, Tipo) Then
+ Alert("Material agregado correctamente")
+ End If
+
+ ObjAF.Dispose()
+
+ Else
+
+ Dim nRow As DataRow = DTMateriales.NewRow
+
+ nRow("CveTipoServicioMaterial") = -1
+ nRow("CveTipoServicio") = -1
+ nRow("Cantidad") = TxtCantidad.Text.ToEntero
+ nRow("CveUM") = CveUnidadMedida
+ nRow("CvePS") = DdlPS.txtValue.Value.ToEntero
+ nRow("Tipo") = Tipo
+ nRow("Abreviatura") = UMAbreviatura
+ nRow("PS") = DdlPS.txtText.Value
+
+ DTMateriales.Rows.Add(nRow)
+ Alert("Material agregado correctamente")
+
+ End If
+
+ CargaMateriales()
+
+ ResetModalMaterial()
+
+ RegistraScript("$('#ModalMateriales').modal('hide');")
+
+ End Sub
+
+ Protected Sub LnkEliminarMaterial_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
+ If CveTipoServicio > 0 Then
+
+
+ Dim CveTipoServicioMaterial As Integer = GvRow.DataKey("CveTipoServicioMaterial").ToEntero
+
+ Dim ObjAF As New ClsAF
+ If ObjAF.DeleteTiposServiciosMaterial(CveTipoServicioMaterial, UsuarioActual.CveEmpresa) Then
+ Alert("Material agregado correctamente")
+ End If
+ ObjAF.Dispose()
+ Else
+
+
+ Dim dr As DataRow = DTMateriales.Rows(GvRow.RowIndex)
+ dr.Delete()
+ DTMateriales.AcceptChanges()
+ Alert("Material agregado correctamente")
+ End If
+
+ CargaMateriales()
+
+ End Sub
+
+ Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
+
+ Dim ObjAF As New ClsAF
+ Dim ErrorProceso As Boolean = False
+ Dim SBError As New StringBuilder
+
+ ObjAF.IniciaTransacSQL()
+
+ 'validacion?
+
+
+
+ If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+
+
+ CveTipoServicio = ObjAF.CveTipoServicio
+
+ For Each GvRow As GridViewRow In GvMaterial.Rows
+
+ If Not ObjAF.AddTiposServiciosMaterial(CveTipoServicio, GvRow.DataKey("Cantidad").ToDecimal, GvRow.DataKey("CveUM").ToEntero, GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("Tipo").ToEntero) Then
+ ErrorProceso = True
+ Exit For
+ End If
+
+ Next
+
+ For Each GvRow As GridViewRow In GvActividades.Rows
+
+ Dim Chk As CheckBox = GvRow.FCCheckBox("Chk")
+ Dim Horas As Decimal = GvRow.FCTextBox("").Text.ToDecimal
+
+
+ If ObjAF.AddTiposServiciosActividades(GvRow.DataKey("").ToEntero) Then
+
+ Next
+
+
+ End If
+
+
+ If ErrorProceso Then
+ ObjAF.RollBack()
+ Else
+ ObjAF.Commit()
+ Alert("Tipo servicio guardado correctamente.", TipoMensaje.MsgInformacion)
+ End If
+
+
+ ObjAF.Dispose()
+
+ End Sub
+
End Class
diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb
index c8f341270..c66beb356 100644
--- a/App_Code/ClsAF.vb
+++ b/App_Code/ClsAF.vb
@@ -89,10 +89,12 @@ Public Class ClsAF
Public Property CveGrupoAF As Integer
Public Property CveAFPadre As Integer
Public Property CveDispositivo As Integer
- Public Property MedidaVehicular As Integer
-
+ Public Property MedidaVehicular As Integer
+ Public Property CveTipoServicio As Integer
+
+
#End Region
-
+
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
If TransaccionCompartida Is Nothing Then
@@ -3502,7 +3504,7 @@ Public Class ClsAF
Public Function AddTiposServicios(Nombre As String, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
-
+ CveTipoServicio = -1
DataAdapter("PA_AF_TiposServicioAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -3510,10 +3512,16 @@ Public Class ClsAF
.Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveTipoServicio", SqlDbType.Int).Direction = ParameterDirection.Output
+
+
End With
Try
SqlAdapter.Fill(Data)
+
+ CveTipoServicio = SqlAdapter.SelectCommand.Parameters("@CveTipoServicio").Value.ToString.ToEntero
+
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
@@ -3715,13 +3723,15 @@ Public Class ClsAF
Return Retorno
End Function
- Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer) As Boolean
+ Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosMaterialDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
End With
Try
@@ -3995,6 +4005,167 @@ Public Class ClsAF
Return Retorno
End Function
+ Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListActividadGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
+ .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddCheckListActividad(CheckListActividad As String, CveCheckListActividadGrupo As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListActividadAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CheckListActividad", SqlDbType.NVarChar).Value = CheckListActividad
+ .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateCheckListActividad(CveCheckListActividad As Integer, CheckListActividad As String, CveCheckListActividadGrupo As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListActividadUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
+ .Add("@CheckListActividad", SqlDbType.NVarChar).Value = CheckListActividad
+ .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function DeleteCheckListActividad(CveCheckListActividad As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListActividadDelete")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar las actividades de CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList
+ .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
+ .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddCheckList(CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
+ .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList
+ .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
+ .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function DeleteCheckList(CveCheckList As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_CheckListDelete")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el CheckList", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
#End Region
diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb
index 7532b38b7..388666a47 100644
--- a/App_Code/ClsCompProveedores.vb
+++ b/App_Code/ClsCompProveedores.vb
@@ -1785,6 +1785,27 @@ Public Class ClsCompProveedores
End Function
+ Public Function GetContratoProvedores(CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Prov_SAT_ContratosProveedoresGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al Obtener los contratos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
Public Function RemoveContrato(CveContrato As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1812,7 +1833,7 @@ Public Class ClsCompProveedores
- Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Public Function AddRePresentanteLegal(RepresentanteLegal As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1822,6 +1843,7 @@ Public Class ClsCompProveedores
.Add("@RepresentanteLegal", SqlDbType.VarChar).Value = RepresentanteLegal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
End With
Try
diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb
index 878dbc95b..b06f629cf 100644
--- a/App_Code/ClsEdocumentacion.vb
+++ b/App_Code/ClsEdocumentacion.vb
@@ -458,7 +458,8 @@ Public Class ClsEdocumentacion
Return Retorno
End Function
- Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1) As Boolean
+ Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1, Optional CveSubProyecto As Integer = -1,
+ Optional CveTipoContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Edoc_DocumentacionElectronicaAuditoriaGet")
@@ -471,6 +472,8 @@ Public Class ClsEdocumentacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Modulo", SqlDbType.Int).Value = Modulo
.Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
End With
Try
diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb
index 4a1cd26ba..b12725805 100644
--- a/App_Code/ClsOC.vb
+++ b/App_Code/ClsOC.vb
@@ -1729,9 +1729,11 @@ Public Class ClsOC
'End Function
#End Region
- Public Function GetOrdenesCompraRep(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveEstatus As Integer,
- FechaInicio As Date, FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", Optional CveActivoFijo As Integer = -1,
- Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean
+ Public Function GetOrdenesCompraRep(Tipo As String, CveProyecto As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveEstatus As Integer, FechaInicio As Date,
+ FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer,
+ CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1",
+ Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1,
+ Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraRep")
@@ -1757,6 +1759,8 @@ Public Class ClsOC
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@SoloSubProyectosConPermiso", SqlDbType.Bit).Value = SoloSubProyectosConPermiso
.Add("@CveUsuarioAutorizo", SqlDbType.Int).Value = CveUsuarioAutorizo
+ .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado
+ .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
End With
@@ -1863,7 +1867,7 @@ Public Class ClsOC
End Function
Public Function GetOrdenesPendientes(pTipo As String, pTipoBusqueda As Integer, pCveEmpresa As Integer, pCveProyecto As Integer, pCveSubProyecto As Integer, pCveEstatusCompra As Integer,
- pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False) As Boolean
+ pCveUsuario As Integer, CveCliente As Integer, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraPendientes")
@@ -1878,6 +1882,8 @@ Public Class ClsOC
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@TipoBusqueda", SqlDbType.Int).Value = pTipoBusqueda
.Add("@SoloSubProyectosConPermiso", SqlDbType.Bit).Value = SoloSubProyectosConPermiso
+ .Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado
+ .Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta
End With
Try
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index ddee3fb68..1e93bc42a 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -3958,6 +3958,8 @@ Public Class ClsPaginas
PaginaDict.Add("/AF/CatActividades.aspx".ToUpper(), 768)
PaginaDict.Add("/AF/CatCheckListActividadesGrupos.aspx".ToUpper(), 769)
PaginaDict.Add("/AF/CatCheckListTipo.aspx".ToUpper(), 770)
+ PaginaDict.Add("/AF/CatCheckListActividades.aspx".ToUpper(), 771)
+ PaginaDict.Add("/AF/CatCheckList.aspx".ToUpper(), 772)
PaginaDict.Add("/AF/TipoOrdenTrabajo.aspx".ToUpper(), -1)
PaginaDict.Add("/AF/OrdenTrabajo.aspx".ToUpper(), -1)
diff --git a/App_Code/DtDatos.xsd b/App_Code/DtDatos.xsd
index f4839bec3..f64700eb6 100644
--- a/App_Code/DtDatos.xsd
+++ b/App_Code/DtDatos.xsd
@@ -12,7 +12,7 @@
-
+
@@ -28,7 +28,7 @@
-
+
@@ -46,7 +46,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -111,7 +111,7 @@
-
+
@@ -137,7 +137,7 @@
-
+
@@ -153,7 +153,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
@@ -179,7 +179,7 @@
-
+
@@ -215,7 +215,7 @@
-
+
@@ -235,12 +235,12 @@
-
+
-
+
@@ -256,7 +256,7 @@
-
+
diff --git a/App_Code/DtDatos.xss b/App_Code/DtDatos.xss
index 3d21fe6c6..e0a664890 100644
--- a/App_Code/DtDatos.xss
+++ b/App_Code/DtDatos.xss
@@ -4,7 +4,7 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
-->
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index a58e8d78b..2fc14f0ad 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -467,6 +467,7 @@
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 51c1fb889..a28d0e56b 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -2986,10 +2986,17 @@ Partial Class Compras_Compras
'ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2)") 'solo muestra tipo material y herramientas
'ddlAlmacen.DataBind()
- ddlAlmacenAdd.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") 'solo muestra tipo material y herramientas
- ddlAlmacenAdd.DataBind()
+ Dim DtAlmacenes = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)")
- DdlAlmacenDevolucion.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") 'solo muestra tipo material y herramientas
+ If DdlTipoCompra.SelectedValue = "10" Then
+ ddlAlmacenAdd.DataSource = DtAlmacenes.FiltraParametros("Modalidad = 0")
+ DdlAlmacenDevolucion.DataSource = DtAlmacenes.FiltraParametros("Modalidad = 0")
+ Else
+ ddlAlmacenAdd.DataSource = DtAlmacenes
+ DdlAlmacenDevolucion.DataSource = DtAlmacenes
+ End If
+
+ ddlAlmacenAdd.DataBind()
DdlAlmacenDevolucion.DataBind()
DdlAlmacenDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -6411,6 +6418,13 @@ Partial Class Compras_Compras
idCuentaContabilizacion = 0
End If
+ 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
+ If DdlTipoCompra.SelectedValue = "10" Then
+ SeContabiliza = False
+ IdCtaContable = 0
+ CveCuenta = 0
+ End If
+
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
@@ -6611,6 +6625,13 @@ Partial Class Compras_Compras
idCuentaContabilizacion = 0
End If
+ 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
+ If DdlTipoCompra.SelectedValue = "10" AndAlso ConceptoContabilizacionNC = 68 Then
+ SeContabiliza = False
+ IdCtaContable = 0
+ CveCuenta = 0
+ End If
+
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
@@ -10117,9 +10138,18 @@ Partial Class Compras_Compras
End If
End If
If importeMovimiento <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta) Then
+ Dim SeContabiliza As Boolean = True
+ 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
+ If DdlTipoCompra.SelectedValue = "10" Then
+ SeContabiliza = False
+ IdCtaContable = 0
+ CveCuenta = 0
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 68, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
+
End If
Next
End If
@@ -11589,6 +11619,10 @@ Partial Class Compras_Compras
StrAlmacenes = "CveTipoAlmacen IN (21)"
End If
+ If DdlTipoCompra.SelectedValue.ToEntero = 10 Then
+ StrAlmacenes = $"Modalidad = 0"
+ End If
+
e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlAlmacen").DataBind()
@@ -18715,7 +18749,12 @@ Partial Class Compras_Compras
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
End If
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 68, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveMovimientoAlmacen:=Row("CveMovimiento").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(TipoCambioActual = 1, 0, ImporteMovimiento), CveCuenta:=Row("CveCuenta").ToString.ToEntero) Then
+ Dim SeContabiliza As Boolean = True
+ 'SI ES GASTO DE ALMACEN NO DEBE CONTABILIZAR CONCEPTO 68
+ If DdlTipoCompra.SelectedValue = "10" Then
+ SeContabiliza = False
+ End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Concepto, 68, Concepto, FechaMovimiento, Row("IdCtaContable").ToString.ToEntero, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveMovimientoAlmacen:=Row("CveMovimiento").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(TipoCambioActual = 1, 0, ImporteMovimiento), CveCuenta:=Row("CveCuenta").ToString.ToEntero, Contabilizable:=SeContabiliza) Then
TieneError = True
Exit For
End If
@@ -19625,7 +19664,7 @@ Partial Class Compras_Compras
Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs)
- If DdlTipoCompra.SelectedValue.ToEntero = 9 Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
+ If DdlTipoCompra.SelectedValue.ToEntero.Contiene(9, 10) Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
CargaGvInv()
End If
diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx
index c1496d8c6..7cd807988 100644
--- a/Compras/Proveedores.aspx
+++ b/Compras/Proveedores.aspx
@@ -604,11 +604,11 @@