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 d11bfb317..9756fc76c 100644 --- a/AF/OrdenTrabajo.aspx +++ b/AF/OrdenTrabajo.aspx @@ -137,64 +137,91 @@
+ +
+
+
+ + +
+
+
+
+ + + +
+
+ +
+ +
- + Baja Media Alta -
- - -
- - -
- - - - -
- - - - - - - -
- -
- -
- - - - -
- - - <%----%> - - <%----%> -
-
- +
+
+
+ + +
+ + + + +
+ + + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + <%----%> + + <%----%> + +
+ +
+
+ +
+ +
+ +
@@ -232,24 +259,46 @@ + - + + + + Faltante + + + + + +
+
+ +
+
+ +
+
+ + +
+
+
@@ -289,7 +338,7 @@ - + @@ -317,7 +366,7 @@ diff --git a/AF/OrdenTrabajo.aspx.vb b/AF/OrdenTrabajo.aspx.vb index 17c74f7c4..f0bfa4347 100644 --- a/AF/OrdenTrabajo.aspx.vb +++ b/AF/OrdenTrabajo.aspx.vb @@ -25,6 +25,18 @@ Partial Class AF_OrdenTrabajo End Set End Property + Property CveOrdenCompra As Integer + Get + If ViewState("CveOrdenCompra") Is Nothing Then + Return -1 + Else + Return ViewState("CveOrdenCompra").ToString.ToEntero + End If + End Get + Set(value As Integer) + ViewState("CveOrdenCompra") = value + End Set + End Property @@ -33,14 +45,25 @@ Partial Class AF_OrdenTrabajo Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then + CargaCombos() If Request("CveOrdenTrabajo") IsNot Nothing Then CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero - Tab.Visible = True - CargaDatos() + + If CveOrdenTrabajo > 0 Then + + DVFechaFin.Visible = True + DVFolioAsignado.Visible = True + DVEstatus.Visible = True + + Tab.Visible = True + CargaDatos() + + End If + End If - CargaCombos() + End If End Sub @@ -59,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 @@ -94,19 +117,46 @@ Partial Class AF_OrdenTrabajo #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 ObjAF As New ClsAF + + If ObjAF.GetOrdenesTrabajo(CveOrdenTrabajo, -1, -1, -1, -1, -1, MinFecha, MaxFecha, Nothing, -1, UsuarioActual.CveEmpresa) Then + + If ObjAF.DtResultados IsNot Nothing AndAlso ObjAF.DtResultados.Rows.Count > 0 Then + + 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) + DdlTipoServicio.SelectedValueExist(ObjAF.DtResultados(0)("CveTipoServicio").ToString) + TxtServicio.Text = ObjAF.DtResultados(0)("Servicio").ToString + DdlPrioridad.SelectedValueExist(ObjAF.DtResultados(0)("Prioridad").ToString) + txtFechaI.Text = ObjAF.DtResultados(0)("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy") + + CveOrdenCompra = ObjAF.DtResultados(0)("CveOrdenCompra").ToString.ToEntero + + If ObjAF.DtResultados(0)("FechaFin").ToString.Length > 0 Then + txtFechaF.Text = ObjAF.DtResultados(0)("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + 'txtFechaFinReal.Text "" + DdlOrdenesTrabajoEstatus.SelectedValueExist(ObjAF.DtResultados(0)("CveEstatusOT").ToString) + Else + Alert("No se encontro la orden de trabajo", TipoMensaje.MsgAdvertencia) + End If + End If + + ObjAF.Dispose() + + CargaMaterial() CargaActividades() CargaCheckList() @@ -152,6 +202,81 @@ 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 + + + Dim FechaFinal As Date = MaxFecha + Dim FechaFinReal As Date = MaxFecha + + + If txtFechaF.Text.ToDate > MinFecha Then + 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, -1) Then + ErrorProceso = True + End If + + If Not ErrorProceso Then + For Each GvRow As GridViewRow In GvActividades.Rows + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim TxtObservaciones As TextBox = GvRow.FCTextBox("TxtObservaciones") + Dim CveOrdenTrabajoActividad As Integer = GvRow.DataKey("CveOrdenTrabajoActividad").ToEntero + + If Not ObjAF.UpdateOrdenesTrabajoActividades(CveOrdenTrabajoActividad, "-1", If(Chk.Checked, 1, 0), TxtObservaciones.Text, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + Exit For + End If + + Next + End If + + + If Not ErrorProceso Then + For Each GvRow As GridViewRow In GvCheckList.Rows + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim TxtObservaciones As TextBox = GvRow.FCTextBox("TxtObservaciones") + Dim CveOrdenTrabajoCheckList As Integer = GvRow.DataKey("CveOrdenTrabajoCheckList").ToEntero + Dim RBL As RadioButtonList = GvRow.FCRadioButtonList("RDLSINOND") + Dim Estatus As Integer = 0 + + If RBL.SelectedValue.ToEntero > 0 Then + Estatus = RBL.SelectedValue.ToEntero + End If + + If CveOrdenTrabajoCheckList > 0 Then + + If Not ObjAF.UpdateOrdenesTrabajoCheckList(CveOrdenTrabajoCheckList, "-1", If(Chk.Checked, 1, 0), TxtObservaciones.Text, Estatus, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + Exit For + End If + + End If + Next + End If + + + If Not ErrorProceso Then + ObjAF.Commit() + Alert($"Orden de trabajo actualizada correctamente.") + Else + ObjAF.RollBack() + End If + End If @@ -161,165 +286,6 @@ Partial Class AF_OrdenTrabajo -#Region "DESCARGA EXCEL" - - 'Public Sub ExportToExcelG(Gv1 As GridView, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional filtros As String = "") - - - - ' For Each GvRow As GridViewRow In Gv1.Rows - - ' Dim IDX_LIMPIAR As Integer = 1 - - ' For IDX_LIMPIAR = 1 To 15 - ' GvRow.Cells(IDX_LIMPIAR).Text = GvRow.FCTextBox($"TxtMetrica{IDX_LIMPIAR}").Text - ' Next - - ' If GvRow.FCDropDownList("DDLPersonal").SelectedValue.ToEntero > 0 Then - ' GvRow.Cells(16).Text = GvRow.FCDropDownList("DDLPersonal").SelectedItem.Text - ' Else - ' GvRow.Cells(16).Text = "" - ' End If - - ' Next - - - - ' Dim sw1 As New StringWriter() - ' Dim htw1 As New HtmlTextWriter(sw1) - ' Gv1.RenderControl(htw1) - - ' Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault - ' Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString())) - - ' htmlStream1.Position = 0 - ' Dim sr1 As New StreamReader(htmlStream1) - ' Dim myStr1 = sr1.ReadToEnd() - - ' sr1.Dispose() - ' htmlStream1.Dispose() - ' sw1.Dispose() - - ' Dim HtmlCompleto As String = myStr1 - - - ' HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "") - - ' Dim asd As String = "" - - - ' Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto)) - - ' GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet()) - - ' Dim excel As GemBox.Spreadsheet.ExcelFile - - ' excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options) - - ' If Usuario IsNot Nothing Then - ' Dim TotalRowHeader As Integer = 8 - ' Dim TotalRowFooter As Integer = 2 - - ' Dim worksheet = excel.Worksheets(0) - ' worksheet.Rows.InsertEmpty(0, TotalRowHeader) - ' Dim celdasConTexto = worksheet.GetUsedCellRange(True) - ' celdasConTexto.Style.Font.Name = "Calibri Light" - - ' Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) - ' RangoNombreEmpresa.Merged = True - ' RangoNombreEmpresa.Value = Usuario.Empresa.Empresa - ' RangoNombreEmpresa.Style.Font.Size = 18 * 20 - ' RangoNombreEmpresa.Style.Font.Name = "Calibri Light" - ' RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - ' RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - - ' Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex) - ' RangoFiltros.Merged = True - ' RangoFiltros.Value = filtros - ' RangoFiltros.Style.Font.Size = 15 * 20 - ' RangoFiltros.Style.Font.Name = "Calibri Light" - ' RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left - ' RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - - ' Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) - ' RangoTitulo.Merged = True - ' RangoTitulo.Value = Titulo - ' RangoTitulo.Style.Font.Size = 20 * 20 - ' RangoTitulo.Style.Font.Name = "Calibri Light" - ' RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - ' RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - ' For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - ' worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20 - ' worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - ' worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - ' worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - ' worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - - - - - ' If i > 0 Then - ' Try - ' worksheet.Columns(i).AutoFit(1) - ' Catch ex As Exception - ' End Try - ' End If - - ' Next - - ' Dim IndexEndTable As Integer = Gv1.Rows.Count + 4 + TotalRowHeader + TotalRowFooter - - ' worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió" - ' worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre - - ' worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión" - ' worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy") - - ' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) - - ' If Imagen.Exists Then - ' Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta) - ' Using sr As New StreamReader(Ruta) - ' Dim ms As New MemoryStream() - ' sr.BaseStream.CopyTo(ms) - ' worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) - ' End Using - ' End If - - ' End If - - - - - ' Dim memoryStream As New MemoryStream() - ' excel.Save(memoryStream, SaveOptions.XlsxDefault) - ' ReporteBytes = memoryStream.ToArray() - ' memoryStream.Dispose() - - 'End Sub - - - 'Protected Sub LnkDescargaReporte_Click(sender As Object, e As EventArgs) - - - ' Response.ContentType = "application/force-download" - ' Response.AppendHeader("Content-Disposition", $"attachment;filename=RegistroRevision{Now.ToString("yyyyMMddmmss")}.xlsx") - ' Response.BinaryWrite(ReporteBytes) - ' Response.End() - - 'End Sub - - - 'Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) - 'End Sub - -#End Region - - #Region "FOLIOS" @@ -377,16 +343,27 @@ Partial Class AF_OrdenTrabajo Private Sub CargaMaterial() Dim ObjAF As New ClsAF + Dim MaterialFaltante As Decimal = 0 If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then GvMaterial.DataSource = ObjAF.DtResultados + MaterialFaltante = ObjAF.DtResultados.SUMD("Faltante") Else GvMaterial.DataSource = Nothing End If ObjAF.Dispose() + + + + If MaterialFaltante > 0 AndAlso CveOrdenCompra <= 0 Then + + GvMaterial.Columns(4).Visible = True + End If + GvMaterial.DataBind() + UpGvMaterial.Update() End Sub @@ -432,9 +409,35 @@ Partial Class AF_OrdenTrabajo Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + If GvMaterial.Columns(4).Visible Then + + 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 + + End If + End Sub Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + Dim Chk As CheckBox = e.Row.FCCheckBox("Chk") + + If Boolean.Parse(e.Row.DataKey("Terminado")) Then + Chk.Checked = True + Else + Chk.Checked = False + End If + End If + + End Sub Protected Sub GvCheckList_RowDataBound(sender As Object, e As GridViewRowEventArgs) @@ -447,13 +450,15 @@ Partial Class AF_OrdenTrabajo If e.Row.DataKey("CveOrdenTrabajoCheckList").ToEntero = 0 Then e.Row.FCLiteral("LtlNROW").Text = e.Row.DataKey("CheckListActividadGrupo").ToString - e.Row.Attributes.Add("style", "background-color:#DDD") Chk.Visible = False RDLSINOND.Visible = False TxtObservaciones.Visible = False Else + Dim Estatus As String = e.Row.DataKey("Estatus") + + RDLSINOND.SelectedValuesIfExist(Estatus) If Boolean.Parse(e.Row.DataKey("Terminado")) Then Chk.Checked = True @@ -464,9 +469,6 @@ Partial Class AF_OrdenTrabajo End If - - - End If End Sub 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 09c6e2dce..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,6 +4313,67 @@ 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, CvePersonal As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoUpdate") + + With SqlAdapter.SelectCommand.Parameters + + + .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@Servicio", SqlDbType.VarChar).Value = Servicio + .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("@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 + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + + Public Function UpdateOrdenesTrabajoOC(CveOrdenTrabajo As Integer, CveOrdenCompra As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoOCUpdate") + + With SqlAdapter.SelectCommand.Parameters + + + .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + .Add("@CveOrdenCompra", SqlDbType.Int).Value = CveOrdenCompra + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function Public Function GetOrdenesTrabajoMateriales(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean @@ -4330,6 +4425,35 @@ Public Class ClsAF End Function + + Public Function UpdateOrdenesTrabajoActividades(CveOrdenTrabajoActividad As Integer, Valor As String, Terminado As Integer, Observaciones As String, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoActividadesUpdate") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveOrdenTrabajoActividad", SqlDbType.Int).Value = CveOrdenTrabajoActividad + .Add("@Valor", SqlDbType.VarChar).Value = Valor + .Add("@Terminado", SqlDbType.Int).Value = Terminado + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar las actividades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + Public Function GetOrdenesTrabajoCheckList(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -4355,6 +4479,35 @@ Public Class ClsAF End Function + Public Function UpdateOrdenesTrabajoCheckList(CveOrdenTrabajoCheckList As Integer, Valor As String, Terminado As Integer, Observaciones As String, Estatus As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoCheckListUpdate") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveOrdenTrabajoCheckList", SqlDbType.Int).Value = CveOrdenTrabajoCheckList + .Add("@Valor", SqlDbType.VarChar).Value = Valor + .Add("@Terminado", SqlDbType.Int).Value = Terminado + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el check list", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + #End Region #End Region diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index b9f29edb9..1ed92ca05 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -3130,7 +3130,7 @@ Public Class ClsBancos Retorno = True Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 2627;") Then + If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then Alert("Ya existe un registro con el mismo Folio", TipoMensaje.MsgAdvertencia) Else Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) @@ -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 0fa040293..911f89a07 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1562,6 +1562,30 @@ Public Class ClsContabilidad #End Region + + Public Function GetCuentasConceptos(CveTipoSaldo As Integer, CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveCuentaBancos As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Conta_CuentasConceptosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoSaldo", SqlDbType.Int).Value = CveTipoSaldo + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveCuentaBancos", SqlDbType.Int).Value = CveCuentaBancos + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener lod datos de Concepto Contables.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + #Region " C O N T A B I L I D A D - T I P O - P O L I Z A " Public Function GetConta_TiposPoliza(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -4174,7 +4198,7 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, Periodo As Integer) As Boolean + Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, Periodo As Integer, CveUsuario As Integer ) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoCCGet") @@ -4579,22 +4603,22 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetCuentasyConceptos(CveCliente As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Conta_GetCuentasyConceptos") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - End With + 'Public Function GetCuentasyConceptos(CveCliente As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Conta_GetCuentasyConceptos") + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + ' End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al consultar las cuentas y conceptos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar las cuentas y conceptos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try - Return Retorno - End Function + ' Return Retorno + 'End Function Public Function UpdateCuentaCompaq(CveCuenta As Integer, IdCompaq As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -5518,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/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 7b066db54..da45dd81c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1551,6 +1551,33 @@ Public Class ClsInventarios End Function + Public Function GetExistenciasProductoSerie(CvePS As Integer, CveAlmacen As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_ExistenciaPSSeriesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + + Me.OnError("Ocurrió un error al obtener el kardex de almacen.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al obtener el kardex de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + #End Region #Region " INVENTARIOS - REPORTES " 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/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 197f40b86..b4e247486 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -1683,13 +1683,13 @@ Public Class ClsProductosServicios End Try Return Retorno - End Function + End Function #End Region - - + + #Region "Precios Lista" Public Function GetPSPreciosLista(CveEmpresa As Integer, CvePrecioLista As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1, - Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1") As Boolean + Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PSPrecioListaGet") With SqlAdapter.SelectCommand.Parameters @@ -1700,6 +1700,7 @@ Public Class ClsProductosServicios .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@Estado", SqlDbType.Int).Value = Estado .Add("@Marcas", SqlDbType.VarChar).Value = Marcas + .Add("@CveModelo", SqlDbType.Int).Value = CveModelo End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/DtDatos.xsd b/App_Code/DtDatos.xsd index f64700eb6..1a5c1befa 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 @@ - + @@ -240,7 +240,7 @@ - + @@ -256,7 +256,7 @@ - + @@ -294,6 +294,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/App_Code/DtDatos.xss b/App_Code/DtDatos.xss index e0a664890..7c380feb0 100644 --- a/App_Code/DtDatos.xss +++ b/App_Code/DtDatos.xss @@ -4,21 +4,23 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 1ea810334..45ff1f778 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4645,7 +4645,7 @@ Namespace Modelos Dim TotalCostoAcumulado As Decimal = 0 Dim cont As Integer = 1 - Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Inventario/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) 'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER) For Each RowInv As DataRow In tmpCostos.Rows ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL() @@ -5350,7 +5350,7 @@ Namespace Modelos End If - CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, Me.Total, Me.Total, Me.CveMoneda, Now, Me.Cliente.NombreComercial, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CvePrePoliza = ObjConta.AddPrePolizas("Modelos/GuardaEstatus", CvePlantillaPoliza, Me.Total, Me.Total, Me.CveMoneda, Now, Me.Cliente.NombreComercial, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) FacturaDevolucion.CveVenta = CveVenta FacturaDevolucion.CvePrePoliza = CvePrePoliza 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/IE.aspx.vb b/Bancos/IE.aspx.vb index 7b3891368..83ede0055 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -761,7 +761,7 @@ Partial Class Bancos_IE End If InicializaSolicitudAnticipoOC() - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT") AndAlso UsuarioActual.CveEmpresa = 119 Then + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT") AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then RBL.Items.Add(New ListItem("Acreedores Diversos", "AC")) End If @@ -974,17 +974,25 @@ Partial Class Bancos_IE LnkEliminar.OnClientClick = "return confirm('¿Está seguro de eliminar el documento y su póliza?');" EstaContabilizado = True + + TxtFechaDocumento.Enabled = False + ImgCalendario.Visible = False + + Else BtnContabilizar.Visible = True BtnDescontabilizar.Visible = False HplIrPoliza.Visible = False - EstaContabilizado = False + + 'TxtFechaDocumento.Enabled = True + 'ImgCalendario.Visible = True + End If UPPDesContabilizar.Update() 'ImgImprimir.Visible = True - LblRegistroFecha.Text = ObjIE.FechaIng.ToShortDateString + LblRegistroFecha.Text = ObjIE.FechaIng.ToString LblRegistroUsuario.Text = ObjIE.Usuario CveEstatusIE = ObjIE.CveEstatusIE @@ -2669,8 +2677,8 @@ Partial Class Bancos_IE Dim FolioFijo As Integer = 0 Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero - Dim tImporteMonedaExtranjera As Decimal = 0 - If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal + Dim tImporteMonedaExtranjera As Decimal = TxtImporte.Text.ToDecimal + If tCveMoneda <> 1 Then tImporteMonedaExtranjera = (TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal).RoundSQL Dim PagueseA = "" If HdnCveCliente.Value.ToEntero > 0 Then @@ -2778,7 +2786,7 @@ Partial Class Bancos_IE Else If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario) Then MsgError = "no se pudo insertar el detalle de la póliza 2" End If Else @@ -3575,7 +3583,10 @@ Partial Class Bancos_IE importeMovimiento = TxtImporte.Text.ToDecimal importeMX = importeMovimiento - + If tCveMoneda > 1 Then + importeMovimiento = TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal + importeMX = importeMovimiento + End If Case 46 @@ -3617,7 +3628,7 @@ Partial Class Bancos_IE 'MOVIMIENTOS EGRESOS If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaConta, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveCuenta:=CveCuentaBeneficiario, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then MsgError = "Detalle" End If 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 4ffb4c9b7..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(); @@ -41,6 +41,16 @@ public partial class Compras_CatTipoGasto : ClsPaginas ObjCompras.Dispose(); } + private void RecargarGlobal() + { + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.GetTipoGasto(-1, -1)) + { + set_GlobalDTTiposGastos(UsuarioActual.CveEmpresa, ObjCompras.DtResultados); + } + ObjCompras.Dispose(); + } + protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e) { BtnAgregarTipoGasto.Text = "Agregar"; @@ -74,6 +84,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas Alert("Se eliminó el Tipo de Gasto correctamente"); } ObjCompras.Dispose(); + RecargarGlobal(); } protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e) @@ -82,22 +93,21 @@ public partial class Compras_CatTipoGasto : ClsPaginas if (BtnAgregarTipoGasto.Text == "Agregar") { if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa)) - { - CargaDatos(); - UpDatos.Update(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + { 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)) { - CargaDatos(); - UpDatos.Update(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); Alert("Se actualizó el Tipo de Gasto correctamente"); } } ObjCompras.Dispose(); + CargaDatos(); + RecargarGlobal(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); } } \ No newline at end of file diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 2fc14f0ad..be8eb8dba 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -3903,7 +3903,7 @@ Créditos Acreedores Caja Chica - Viaticos + Viáticos Deudores @@ -3911,7 +3911,7 @@
- +

@@ -3971,7 +3971,7 @@
- +
@@ -4000,7 +4000,7 @@
-
+
@@ -4029,11 +4029,12 @@
+
- +
@@ -4052,7 +4053,7 @@
-
+
@@ -4070,16 +4071,18 @@
+
- +
+
- +
@@ -4105,7 +4108,7 @@
-
+
@@ -4119,15 +4122,17 @@
+
- +
+
- + D.D @@ -4235,7 +4240,7 @@ - +
@@ -4267,10 +4272,11 @@
+
- +
@@ -4295,7 +4301,7 @@
-
+
@@ -4308,6 +4314,7 @@
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index d096c8df3..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 @@ -12838,6 +12842,7 @@ Partial Class Compras_Compras End Sub Protected Sub RBLContado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLContado.SelectedIndexChanged + LblCheq.Text = RBLContado.SelectedItem.Text CargaContado() End Sub Private Sub RBLTipoDeudor_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLTipoDeudor.SelectedIndexChanged @@ -16929,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) @@ -18001,8 +18007,13 @@ Partial Class Compras_Compras Private Sub ReclasificaSubProyecto() If Not GvPS.Rows.Count > 0 Then - Alert("No hay partidas para reclasificar el SubProyecto", TipoMensaje.MsgAdvertencia) - Exit Sub + + If CveCompra <> Nothing And CveCompra > 0 Then + Alert("No hay partidas para reclasificar el SubProyecto", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If If Not DdlAsignaSubProyecto.SelectedValue.ToEntero > 0 Then 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 @@