diff --git a/AF/CatTiposServiciosActividades.aspx.cs b/AF/CatTiposServiciosActividades.aspx.cs index 80f1e0df3..1c4801f17 100644 --- a/AF/CatTiposServiciosActividades.aspx.cs +++ b/AF/CatTiposServiciosActividades.aspx.cs @@ -33,7 +33,7 @@ public partial class AF_CatTiposServiciosActividades : ClsPaginas private void CargaDatos() { ClsAF ObjAF = new ClsAF(); - if (ObjAF.GetTiposServiciosActividades(-1, -1)) + if (ObjAF.GetTiposServiciosActividades(-1, -1,-1)) { GvDatos.DataSource = ObjAF.DtResultados; GvDatos.DataBind(); @@ -74,7 +74,7 @@ public partial class AF_CatTiposServiciosActividades : ClsPaginas GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); CveTipoServicioActividad = GvRow.DataKey("CveTipoServicioActividad").ToEntero(); ClsAF ObjAF = new ClsAF(); - if (ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad)) + if (ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad, UsuarioActual.CveEmpresa)) { CargaDatos(); UpDatos.Update(); @@ -89,14 +89,14 @@ public partial class AF_CatTiposServiciosActividades : ClsPaginas ClsAF ObjAF = new ClsAF(); if (BtnAgregarTipoServicio.Text == "Agregar") { - if (ObjAF.AddTiposServiciosActividades(DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) + if (ObjAF.AddTiposServiciosActividades(DdlActividades.SelectedValue.ToEntero(),-1,TxtDuracion.Text.ToDecimal(),TxtObservaciones.Text)) { Alert("Se agregó la Actividad del Tipo de Servicio correctamente"); } } else { - if (ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad,DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) + if (ObjAF.UpdateActividades(DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) { Alert("Se actualizó la Actividad del Tipo de Servicio correctamente"); } diff --git a/AF/OrdenTrabajo.aspx b/AF/OrdenTrabajo.aspx index 6128ed0b5..9756fc76c 100644 --- a/AF/OrdenTrabajo.aspx +++ b/AF/OrdenTrabajo.aspx @@ -137,67 +137,91 @@
+ +
+
+
+ + -
- -
+
+
+
+
+ + + +
+
+ +
+ +
- + Baja Media Alta -
- - -
- - -
- - - - -
- - - - - - - -
- -
- -
- - - - -
- - - <%----%> - - <%----%> -
-
- +
+
+
+ + +
+ + + + +
+ + + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + <%----%> + + <%----%> + +
+ +
+
+ +
+ +
+ +
@@ -235,7 +259,7 @@ @@ -248,7 +272,7 @@ - + @@ -256,15 +280,25 @@ - - Faltante - + Faltante - + + + +
+
+ +
+
+ +
+
+ +
- + +
diff --git a/AF/OrdenTrabajo.aspx.vb b/AF/OrdenTrabajo.aspx.vb index 522701bf7..f0bfa4347 100644 --- a/AF/OrdenTrabajo.aspx.vb +++ b/AF/OrdenTrabajo.aspx.vb @@ -50,12 +50,16 @@ Partial Class AF_OrdenTrabajo If Request("CveOrdenTrabajo") IsNot Nothing Then CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero - DVFechaFin.Visible = True - Tab.Visible = True + If CveOrdenTrabajo > 0 Then - CargaDatos() + DVFechaFin.Visible = True + DVFolioAsignado.Visible = True + DVEstatus.Visible = True + Tab.Visible = True + CargaDatos() + End If End If @@ -78,7 +82,7 @@ Partial Class AF_OrdenTrabajo DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) DdlAF.DataBind() - + DdlAF.Items.Insert(0, New ListItem("Seleccione uno", "-1")) Dim ObjAF As New ClsAF @@ -127,7 +131,8 @@ Partial Class AF_OrdenTrabajo If ObjAF.DtResultados IsNot Nothing AndAlso ObjAF.DtResultados.Rows.Count > 0 Then - LblFolio.Text = $"Folio OT: {ObjAF.DtResultados(0)("Folio").ToString}" + LblFolio.Text = ObjAF.DtResultados(0)("Folio").ToString + LblAsiganado.Text = ObjAF.DtResultados(0)("NombreCompleto").ToString DdlSubProyecto.SelectedValueExist(ObjAF.DtResultados(0)("CveSubProyecto").ToString) DdlAF.SelectedValueExist(ObjAF.DtResultados(0)("CveAF").ToString) @@ -197,6 +202,16 @@ Partial Class AF_OrdenTrabajo Else + If DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero = 3 Then + If txtFechaF.Text.Length = 0 Then + Alert("La fecha fin es requerida.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + + + Dim ObjAF As New ClsAF ObjAF.IniciaTransacSQL() Dim ErrorProceso As Boolean = False @@ -210,7 +225,7 @@ Partial Class AF_OrdenTrabajo FechaFinal = txtFechaF.Text.ToDate End If - If Not ObjAF.UpdateOrdenesTrabajo(CveOrdenTrabajo, DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, FechaFinal, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If Not ObjAF.UpdateOrdenesTrabajo(CveOrdenTrabajo, DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, FechaFinal, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then ErrorProceso = True End If @@ -394,12 +409,16 @@ Partial Class AF_OrdenTrabajo Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.Header Then + If e.Row.RowType = DataControlRowType.DataRow Then If GvMaterial.Columns(4).Visible Then - Dim HLOC As HyperLink = e.Row.FCHyperLink("HLOC") - HLOC.NavigateUrl = $"../OC/OC.aspx?CveOrdenTrabajo={CveOrdenTrabajo}" + If e.Row.DataKey("Faltante").ToDecimal > 0 Then + Dim HLOC As HyperLink = e.Row.FCHyperLink("HLOC") + HLOC.Visible = True + HLOC.NavigateUrl = $"../OC/OC.aspx?CveOrdenTrabajo={CveOrdenTrabajo}" + End If + End If diff --git a/AF/OrdenTrabajoAsignacion.aspx b/AF/OrdenTrabajoAsignacion.aspx new file mode 100644 index 000000000..7253a443f --- /dev/null +++ b/AF/OrdenTrabajoAsignacion.aspx @@ -0,0 +1,237 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="OrdenTrabajoAsignacion.aspx.vb" Inherits="AF_OrdenTrabajoAsignacion" %> + + + + + + + + + + + + Ordenes de trabajo Asignación + + + + + + + + +
+
+
+ + + + + + +
+
+ +
+ + +
+ : +
+
+ +
+ +
Activo Fijo:
+
+ +
+ +
Tipo Servicio:
+
+ +
+ + +
Fecha Inicio:
+
+
+ + + + +
+ + + <%-- + --%> +
+ + +
Fecha Fin:
+
+ + +
+ + + + +
+ + + +
+ + +
+ + +
+
+
+
+
Prioridad:
+
+ + Todas + Baja + Media + Alta + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + +
+
+ + +
+ + + + + + diff --git a/AF/OrdenTrabajoAsignacion.aspx.vb b/AF/OrdenTrabajoAsignacion.aspx.vb new file mode 100644 index 000000000..9bcbb867a --- /dev/null +++ b/AF/OrdenTrabajoAsignacion.aspx.vb @@ -0,0 +1,227 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class AF_OrdenTrabajoAsignacion + Inherits ClsPaginas + +#Region " PROPIEDADES" + + Property DT_Cabeceras As DataTable + Get + + If ViewState("DT_Cabeceras") Is Nothing Then + + Return New DataTable + Else + Return DirectCast(ViewState("DT_Cabeceras"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Cabeceras") = value + End Set + End Property + + + Property DT_Datos As DataTable + Get + + If ViewState("DT_Datos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DT_Datos"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Datos") = value + End Set + End Property + +#End Region + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + CargaCombos() + CargaDatos() + + Dim FechaActual As Date = Now + + + 'TxtFechaF.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + TxtFechaF.Text = "" + FechaActual = FechaActual.AddDays(-30) + TxtFechaI.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + + End If + End Sub + + +#Region " CARGA PARAMETROS " + +#End Region + +#Region " CARGA COMBOS " + Protected Sub CargaCombos() + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) + DdlAF.DataBind() + + DdlAF.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjAF As New ClsAF + + If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then + DdlTipoServicio.DataSource = ObjAF.DtResultados + Else + DdlTipoServicio.DataSource = Nothing + End If + + ObjAF.Dispose() + DdlTipoServicio.DataBind() + DdlTipoServicio.Items.Insert(0, New ListItem("Todos", "-1")) + + UpFiltro.Update() + + + End Sub + + +#End Region + +#Region " CARGA DATOS " + Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) + CargaDatos() + + End Sub + + +#End Region + +#Region " GV DATOS " + + Private Sub CargaDatos() + + Dim FechaInicio, FechaFin As Date + + FechaInicio = TxtFechaI.Text.ToDate + + + FechaFin = MaxFecha + If TxtFechaF.Text.Length = 10 Then + FechaFin = TxtFechaF.Text.ToDate + End If + + + Dim ObjAF As New ClsAF + + If ObjAF.GetOrdenesTrabajo(-1, DdlTipoServicio.SelectedValue.ToEntero, -1, DdlAF.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, MaxFecha, -1, UsuarioActual.CveEmpresa) Then + + GvDatos.DataSource = ObjAF.DtResultados + + If ObjAF.DtResultados.Rows.Count > 0 Then + BtnGuardar.Enabled = True + Else + BtnGuardar.Enabled = False + End If + + Else + GvDatos.DataSource = Nothing + BtnGuardar.Enabled = False + End If + + ObjAF.Dispose() + + GvDatos.DataBind() + UpDatos.Update() + + End Sub + + + + + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim CvePersonal As Integer = e.Row.DataKey("CvePersonal").ToEntero + Dim DdlPersonal As DropDownList = e.Row.FCDropDownList("DdlPersonal") + + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, -1).FiltraParametros("CveEstatusPersonal = 1") + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + + DdlPersonal.SelectedValueExist(CvePersonal) + + + End If + + End Sub + +#End Region + + + + + Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs) + + End Sub + + + + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + + + Dim ObjAf As New ClsAF + Dim ErrorProceso As Boolean = False + Dim CountAsiganados As Integer = 0 + + + ObjAf.IniciaTransacSQL() + + For Each GvRow As GridViewRow In GvDatos.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + + Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero + Dim DdlPersonal As DropDownList = GvRow.FCDropDownList("DdlPersonal") + Dim CveOrdenTrabajo As Integer = GvRow.DataKey("CveOrdenTrabajo").ToEntero + + If DdlPersonal.SelectedValue.ToEntero > 0 AndAlso (DdlPersonal.SelectedValue.ToEntero <> CvePersonal) Then + + If Not ObjAf.UpdateOrdenesTrabajo(CveOrdenTrabajo, -1, -1, "-1", -1, -1, MinFecha, MaxFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, DdlPersonal.SelectedValue.ToEntero) Then + ErrorProceso = True + Else + CountAsiganados = CountAsiganados + 1 + End If + + End If + + End If + Next + + If Not ErrorProceso Then + + ObjAf.Commit() + + If CountAsiganados > 0 Then + Alert($"{CountAsiganados} ordenes de trabajo asignadas.") + Else + Alert($"No se asigno ninguna orden de trabajo.", TipoMensaje.MsgAdvertencia) + End If + + Else + ObjAf.RollBack() + End If + + ObjAf.Dispose() + + + End Sub +End Class diff --git a/AF/RepOrdenTrabajo.aspx b/AF/RepOrdenTrabajo.aspx new file mode 100644 index 000000000..de459d883 --- /dev/null +++ b/AF/RepOrdenTrabajo.aspx @@ -0,0 +1,248 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOrdenTrabajo.aspx.vb" Inherits="AF_RepOrdenTrabajo" %> + + + + + + + + + + + + Reporte ordenes de trabajo + + + + + + + + +
+
+
+ + + + + + +
+
+ +
+ +
+ Folio: +
+
+ +
+ +
+ : +
+
+ +
+ +
Activo Fijo:
+
+ +
+ +
Tipo Servicio:
+
+ +
+ + + +
+ + +
+
+
+
+ + +
Personal:
+
+ +
+ + + +
Fecha Inicio:
+
+
+ + + + +
+ + + <%-- + --%> +
+ + +
Fecha Fin:
+
+ + +
+ + + + +
+ + + +
+ +
Estatus:
+
+ + +
+ + +
Prioridad:
+
+ + Todas + Baja + Media + Alta + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + diff --git a/AF/RepOrdenTrabajo.aspx.vb b/AF/RepOrdenTrabajo.aspx.vb new file mode 100644 index 000000000..d4be6f652 --- /dev/null +++ b/AF/RepOrdenTrabajo.aspx.vb @@ -0,0 +1,187 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class AF_RepOrdenTrabajo + Inherits ClsPaginas + +#Region " PROPIEDADES" + + Property DT_Cabeceras As DataTable + Get + + If ViewState("DT_Cabeceras") Is Nothing Then + + Return New DataTable + Else + Return DirectCast(ViewState("DT_Cabeceras"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Cabeceras") = value + End Set + End Property + + + Property DT_Datos As DataTable + Get + + If ViewState("DT_Datos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DT_Datos"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Datos") = value + End Set + End Property + +#End Region + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + CargaCombos() + CargaDatos() + + Dim FechaActual As Date = Now + + + 'TxtFechaF.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + TxtFechaF.Text = "" + FechaActual = FechaActual.AddDays(-30) + TxtFechaI.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + + End If + End Sub + + +#Region " CARGA PARAMETROS " + +#End Region + +#Region " CARGA COMBOS " + Protected Sub CargaCombos() + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) + DdlAF.DataBind() + + DdlAF.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjAF As New ClsAF + + If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then + DdlTipoServicio.DataSource = ObjAF.DtResultados + Else + DdlTipoServicio.DataSource = Nothing + End If + + If ObjAF.GetOrdenesTrabajoEstatus(UsuarioActual.CveEmpresa) Then + DdlOrdenesTrabajoEstatus.DataSource = ObjAF.DtResultados + Else + DdlOrdenesTrabajoEstatus.DataSource = Nothing + End If + + ObjAF.Dispose() + + DdlTipoServicio.DataBind() + DdlTipoServicio.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlOrdenesTrabajoEstatus.DataBind() + DdlOrdenesTrabajoEstatus.Items.Insert(0, New ListItem("Todos", "-1")) + + + + + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, -1).FiltraParametros("CveEstatusPersonal = 1") + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem("Todos", "-1")) + + + UpFiltro.Update() + + + End Sub + + +#End Region + +#Region " CARGA DATOS " + Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) + CargaDatos() + + End Sub + + +#End Region + +#Region " GV DATOS " + + Private Sub CargaDatos() + + + Dim FechaInicio, FechaFin As Date + Dim Folio As Integer = If(TxtFolio.Text.ToEntero > 0, TxtFolio.Text.ToEntero, -1) + FechaInicio = TxtFechaI.Text.ToDate + + + If DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero = 3 AndAlso TxtFechaF.Text.Trim.Length = 0 Then + FechaFin = MaxFecha.AddDays(1) + Else + FechaFin = MaxFecha + End If + + + If TxtFechaF.Text.Length = 10 Then + FechaFin = TxtFechaF.Text.ToDate + End If + + + Dim ObjAF As New ClsAF + + If ObjAF.GetOrdenesTrabajo(-1, DdlTipoServicio.SelectedValue.ToEntero, Folio, DdlAF.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjAF.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjAF.Dispose() + + GvDatos.DataBind() + UpDatos.Update() + + End Sub + + + + + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + + End Sub + +#End Region + + + + + Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs) + + End Sub + + + + + +End Class diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index c70e0c563..274b51195 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -4239,6 +4239,40 @@ Public Class ClsAF End Function + 'Public Function GetOrdenesTrabajoAsignacion(CveSubProyecto As Integer, CveAF As Integer, CveTipoServicio As Integer, FechaInicio As Date, FechaFin As Date, Prioridad As Integer, CveEmpresa As Integer) As Boolean + + ' Dim Retorno As Boolean = False + + ' DataAdapter("PA_AF_OrdenesTrabajoAsignacionGet") + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + ' .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + + ' .Add("@CveAF", SqlDbType.Int).Value = CveAF + ' .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + ' .Add("@Prioridad", SqlDbType.Int).Value = Prioridad + ' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + '' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + + ' End With + + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar las ordenes de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + + ' Return Retorno + + 'End Function + + Public Function AddOrdenesTrabajo(CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -4279,7 +4313,7 @@ Public Class ClsAF - Public Function UpdateOrdenesTrabajo(CveOrdenTrabajo As Integer, CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean + Public Function UpdateOrdenesTrabajo(CveOrdenTrabajo As Integer, CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer, CvePersonal As Integer) As Boolean Dim Retorno As Boolean = False @@ -4299,6 +4333,7 @@ Public Class ClsAF .Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal .Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal End With diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index af063505a..1ed92ca05 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4723,7 +4723,7 @@ Public Class ClsBancos strBody.AppendFormat(" ") - For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17,312) AND CveCompra > 0").Rows + For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17,312,308) AND CveCompra > 0").Rows strBody.AppendFormat(" ") strBody.AppendFormat(" {0}", dr("Fecha").ToString.ToDate.ToShortDateString()) strBody.AppendFormat(" {0}", dr("SerieFolio").ToString) diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index 860bd5889..aaa18df7f 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -6231,7 +6231,7 @@ Public Class ClsContPAQi With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.Date).Value = FechaI - .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@FechaF", SqlDbType.DateTime).Value = String.Format("{0} 23:59:59", FechaF.ToShortDateString).ToDateTime .Add("@IdCuentaPadre", SqlDbType.Int).Value = IdCuenta .Add("@OpcionCuentas", SqlDbType.Int).Value = OpcionCuentas .Add("@Tipo", SqlDbType.Int).Value = TipoMovtos @@ -10585,7 +10585,7 @@ Public Class ClsContPAQi StrSQL.Append(" ( ") StrSQL.Append(" @IdCtaSup INT, ") StrSQL.Append(" @FechaI DATE, ") - StrSQL.Append(" @FechaF DATE, ") + StrSQL.Append(" @FechaF DATETIME, ") StrSQL.Append(" @Tipo INT, ") StrSQL.Append(" @SegmentoNegocio INT = -1 ") StrSQL.Append(" ) ") @@ -10776,7 +10776,7 @@ Public Class ClsContPAQi StrSQL.Append(" ( ") StrSQL.Append(" @IdCtaSup INT, ") StrSQL.Append(" @FechaI DATE, ") - StrSQL.Append(" @FechaF DATE, ") + StrSQL.Append(" @FechaF DATETIME, ") StrSQL.Append(" @Tipo INT, ") StrSQL.Append(" @SegmentoNegocio INT = -1 ") StrSQL.Append(" ) ") @@ -10883,7 +10883,7 @@ Public Class ClsContPAQi StrSQL.Append(" ( ") StrSQL.Append(" @IdCtaSup INT, ") StrSQL.Append(" @FechaI DATE, ") - StrSQL.Append(" @FechaF DATE, ") + StrSQL.Append(" @FechaF DATETIME, ") StrSQL.Append(" @Tipo INT, ") StrSQL.Append(" @SegmentoNegocio INT = -1 ") StrSQL.Append(" ) ") @@ -11140,7 +11140,7 @@ Public Class ClsContPAQi StrSQL.Append(" ( ") StrSQL.Append(" @IdCtaSup INT, ") StrSQL.Append(" @FechaI DATE, ") - StrSQL.Append(" @FechaF DATE, ") + StrSQL.Append(" @FechaF DATETIME, ") StrSQL.Append(" @CveMoneda INT = 1 ") StrSQL.Append(" ) ") StrSQL.Append(" RETURNS FLOAT ") diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e9188b31e..d7c9a2928 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5542,6 +5542,27 @@ Public Class ClsContabilidad Return Retorno End Function + + Public Function GetRepIVAComparativo(FechaInicio As Date, FechaFin As Date, CveUsuarioConsulta As Integer, Conciliado As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Conta_ImpuestosComparativo") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@Conciliado", SqlDbType.Int).Value = Conciliado + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de IVA Comparativo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetRepIVAAcumulado(FechaInicio As Date, FechaFin As Date, Conciliado As Integer, TipoImpuesto As Integer, CveUsuarioConsulta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_IVAAcumulado") diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 35bf0d9b8..e124244e4 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -192,20 +192,34 @@ Public Class ClsPaginas Application("GlobalDTNomConceptos") = value End Set End Property - Property GlobalDTTiposGastos(CveEmpresa As Integer) As DataTable + Property GlobalDTTiposGastos(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable Get + Dim AppNombre As String = String.Format("GlobalDTTiposGastos-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjCompra As New ClsCompras() + If ObjCompra.GetTipoGasto(-1, -1) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing + ObjCompra.Dispose() + End If + If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTTiposGastos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) + + Dim StrSQL As New StringBuilder + StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) + If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", Estatus) + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) GlobalDTTiposGastos = Dv.ToTable Dv.Dispose() Else - GlobalDTTiposGastos = DirectCast(Application("GlobalDTTiposGastos"), DataTable) + GlobalDTTiposGastos = DirectCast(Application(AppNombre), DataTable) End If - End Get Set(value As DataTable) - Application("GlobalDTTiposGastos") = value + Dim AppNombre As String = String.Format("GlobalDTTiposGastos-{0}", CveEmpresa) + Application(AppNombre) = value End Set + End Property Property GlobalDTMFActividad(CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional CveActividad As Integer = -1) As DataTable Get @@ -3964,6 +3978,11 @@ Public Class ClsPaginas PaginaDict.Add("/AF/TipoOrdenTrabajo.aspx".ToUpper(), -1) PaginaDict.Add("/AF/OrdenTrabajo.aspx".ToUpper(), -1) PaginaDict.Add("/AF/RepOrdenTrabajo.aspx".ToUpper(), -1) + PaginaDict.Add("/AF/OrdenTrabajoAsignacion.aspx".ToUpper(), -1) + + + + #End Region 'AIMMGM diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index e53a90a5f..af213df24 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -620,7 +620,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'verifica existencias - If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152) Then + If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153) Then UsaGlobal = False Dim objInv As New ClsInventarios diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index b305df95f..a2dc11030 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -1415,6 +1415,12 @@ Partial Class Bancos_PopIECompras CveConcepto2 = 41 CveProveedor2 = DdlAcreedor.SelectedValue.ToEntero CveIE = -1 + 'verifica que se halla selccionado algun acreedor + If DdlAcreedor.SelectedValue.ToEntero <= 0 Then + Inserta = False + Alert("Debe especificar el Acreedor.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If Case "6" 'Ventas ImportePagado = TxtImporte.Text.Trim.ToDecimal CveProveedor2 = CveProveedor @@ -3312,18 +3318,18 @@ Partial Class Bancos_PopIECompras ImporteMovimiento = 0 End Select - If ImporteMovimiento <> 0 Then + If ImporteMovimiento <> 0 AndAlso MsgError = "" Then 'Conta ContPAQ If IdCtaContable = 0 Then CuentasContablesInvalidas.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) idCuentaContabilizacion = 0 End If - 'Conta SIG - If CveCuenta = 0 Then - CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) - CveCuentaContabilizacion = 0 - End If + ''Conta SIG + 'If CveCuenta = 0 Then + ' CuentasContablesInvalidasSIG.Append("
" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) + ' CveCuentaContabilizacion = 0 + 'End If If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then MsgError = "No se pudo insertar la póliza" @@ -3333,7 +3339,7 @@ Partial Class Bancos_PopIECompras Next - If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then + If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If ObjMov.ValorPolizaDescuadre > 0 Then MsgError = ObjMov.MensajePolizaDescuadre GuardaLogAD($"Bancos/PopIECompras | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs index da4c4276b..a30f0486c 100644 --- a/Compras/CatTipoGasto.aspx.cs +++ b/Compras/CatTipoGasto.aspx.cs @@ -33,7 +33,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas private void CargaDatos() { ClsCompras ObjCompras = new ClsCompras(); - if (ObjCompras.GetTipoGasto(-1,UsuarioActual.CveEmpresa)) + if (ObjCompras.GetTipoGasto(-1, UsuarioActual.CveEmpresa)) { GvDatos.DataSource = ObjCompras.DtResultados; GvDatos.DataBind(); @@ -96,9 +96,10 @@ public partial class Compras_CatTipoGasto : ClsPaginas { Alert("Se agregó el Tipo de Gasto correctamente"); } - }else + } + else { - if (ObjCompras.UpdateTipoGasto(CveTipoGasto,TxtTipoGasto.Text,ChkEstatus.Checked,-1,-1)) + if (ObjCompras.UpdateTipoGasto(CveTipoGasto, TxtTipoGasto.Text, ChkEstatus.Checked, -1, -1)) { Alert("Se actualizó el Tipo de Gasto correctamente"); } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index e07c1e675..6c267c75d 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1332,6 +1332,10 @@ Partial Class Compras_Compras End If + If DdlTipoComprobante.SelectedValue = "DEV" Then + InicializaAplicaNCFact() + End If + If UsuarioActual.Empresa.UsaAC Then @@ -16930,8 +16934,9 @@ Partial Class Compras_Compras CargaRetISRConcepto() - - + If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then + InicializaAplicaNCFact() + End If End Sub Private Sub OriginalesVisible(Accion As Boolean) diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 7cd807988..9cfbdc5f5 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -824,6 +824,17 @@
+ + + + + diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index dae766096..969d38b25 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -332,6 +332,27 @@ public partial class Contabilidad_RepIVA : ClsPaginas Response.End(); } + + + protected void LnkModalCompara_Click(object sender, EventArgs e) + { + + ClsContabilidad Objconta = new ClsContabilidad(); + + int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); + + if (Objconta.GetRepIVAComparativo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa )) + { + GvCompara.DataSource = Objconta.DtResultados; + } + + Objconta.Dispose(); + GvCompara.DataBind(); + RegistraScript("$('#ModalCompara').modal('show')"); + UpCompara.Update(); + } + + protected string LV(string Valor) { return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : ""; diff --git a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt index af959d4b5..4b5e50a9b 100644 Binary files a/Empresas/Grales/Formatos/RepIVAAcreditable.rpt and b/Empresas/Grales/Formatos/RepIVAAcreditable.rpt differ diff --git a/GPS/Shipments.aspx b/GPS/Shipments.aspx index 4dd237032..a7276eda6 100644 --- a/GPS/Shipments.aspx +++ b/GPS/Shipments.aspx @@ -731,6 +731,6 @@ } - + diff --git a/Global.asax b/Global.asax index 86b5d58d8..857349e12 100644 --- a/Global.asax +++ b/Global.asax @@ -138,10 +138,10 @@ GuardaLogAsax(String.Format("Globalasax 7:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 'C A R G A - T I P O G A S T O S - Using ObjCompra As New ClsCompras() - If ObjCompra.GetTipoGasto(-1, -1) Then Application("GlobalDTTiposGastos") = ObjCompra.DtResultados Else Application("GlobalDTTiposGastos") = Nothing - End Using + ''C A R G A - T I P O G A S T O S + 'Using ObjCompra As New ClsCompras() + ' If ObjCompra.GetTipoGasto(-1, -1) Then Application("GlobalDTTiposGastos") = ObjCompra.DtResultados Else Application("GlobalDTTiposGastos") = Nothing + 'End Using GuardaLogAsax(String.Format("Globalasax 8:{0}", DateTime.Now)) '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx index 6dc8dfaf9..766adc971 100644 --- a/Inventarios/Kardex.aspx +++ b/Inventarios/Kardex.aspx @@ -125,7 +125,7 @@ Generar Excel
  • - Series + Series Disponibles
  •   @@ -501,7 +501,7 @@