+
+
+
+
+
@@ -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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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("
", 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éditosAcreedoresCaja Chica
- Viaticos
+ ViáticosDeudores
@@ -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 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -1149,7 +1160,7 @@
-
+
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index 0a6a13107..435d893c5 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -852,6 +852,15 @@ Partial Class Compras_Proveedores
DdlDIOTPais.SelectedValueExist(ObjProveedor.DIOTCvePais)
TxtDIOTNacionalidad.Text = ObjProveedor.DIOTNacionalidad
+ If UsuarioActual.Empresa.Funcionalidad(300) = "1" Then
+ CargaCuentasConceptos()
+ divCuentas.Visible = True
+ divCuentasContp.Visible = False
+ Else
+ divCuentas.Visible = False
+ divCuentasContp.Visible = True
+ End If
+
'Contable
If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaContabilidadSIG Then
DdlCtaContAcreedores.AutoPostBack = True
@@ -1010,6 +1019,16 @@ Partial Class Compras_Proveedores
DdlUsuarioEvaluador.DataBind()
End Sub
+ Private Sub CargaCuentasConceptos()
+ Dim ObjConta As New ClsContabilidad
+ If ObjConta.GetCuentasConceptos(1, UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) Then
+ GvCta.DataSource = ObjConta.DtResultados
+ End If
+ ObjConta.Dispose()
+ GvCta.DataBind()
+
+ End Sub
+
Private Sub CargaContactos(ByRef ObjProveedor As ClsCompProveedores)
'TRAE CONTACTOS GENERALES Y POR SUCURSAL
If ObjProveedor.GetProveedoresContactos(-1, CveProveedor, -1) Then
diff --git a/Compras/RepComprasDetalle.aspx b/Compras/RepComprasDetalle.aspx
index a2cbbff15..6eb03716b 100644
--- a/Compras/RepComprasDetalle.aspx
+++ b/Compras/RepComprasDetalle.aspx
@@ -401,6 +401,15 @@
+
+
+ Observaciones
+
+
+
+
+
+
@@ -464,24 +473,29 @@
+
+
+
+
+
diff --git a/Compras/RepComprasDetalle.aspx.vb b/Compras/RepComprasDetalle.aspx.vb
index d1c57402a..6c9f43f77 100644
--- a/Compras/RepComprasDetalle.aspx.vb
+++ b/Compras/RepComprasDetalle.aspx.vb
@@ -168,6 +168,7 @@ Partial Class Compras_RepComprasDetalle
ChkRazon.Checked = True
ChkFolio.Checked = True
ChkFecha.Checked = True
+ ChkObs.Checked = True
End Sub
@@ -597,54 +598,15 @@ Partial Class Compras_RepComprasDetalle
#End Region
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
- If ChkIVA.Checked Then
- GvDatos.Columns(4).Visible = True
- Else
- GvDatos.Columns(4).Visible = False
- End If
-
- If ChkIEPS.Checked Then
- GvDatos.Columns(5).Visible = True
- Else
- GvDatos.Columns(5).Visible = False
- End If
-
- If ChkDesc.Checked Then
- GvDatos.Columns(6).Visible = True
- Else
- GvDatos.Columns(6).Visible = False
- End If
-
- If ChkTotal.Checked Then
- GvDatos.Columns(7).Visible = True
- Else
- GvDatos.Columns(7).Visible = False
- End If
-
- If ChkAbre.Checked Then
- GvDatos.Columns(8).Visible = True
- Else
- GvDatos.Columns(8).Visible = False
- End If
-
- If ChkRazon.Checked Then
- GvDatos.Columns(9).Visible = True
- Else
- GvDatos.Columns(9).Visible = False
- End If
-
- If ChkFolio.Checked Then
- GvDatos.Columns(10).Visible = True
- Else
- GvDatos.Columns(10).Visible = False
- End If
-
- If ChkFecha.Checked Then
- GvDatos.Columns(11).Visible = True
- Else
- GvDatos.Columns(11).Visible = False
- End If
-
+ GvDatos.Columns(4).Visible = ChkIVA.Checked
+ GvDatos.Columns(5).Visible = ChkIEPS.Checked
+ GvDatos.Columns(6).Visible = ChkDesc.Checked
+ GvDatos.Columns(7).Visible = ChkTotal.Checked
+ GvDatos.Columns(8).Visible = ChkAbre.Checked
+ GvDatos.Columns(9).Visible = ChkRazon.Checked
+ GvDatos.Columns(10).Visible = ChkFolio.Checked
+ GvDatos.Columns(11).Visible = ChkFecha.Checked
+ GvDatos.Columns(12).Visible = ChkObs.Checked
UPDatos.Update()
End Sub
diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx
index f6675b947..74f71680a 100644
--- a/Compras/eFacturas.aspx
+++ b/Compras/eFacturas.aspx
@@ -66,6 +66,9 @@
Bitácora Facturas
+
+ Vinculación Masiva Complementos
+
@@ -374,7 +377,7 @@
-
+
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index f59eed405..64b14396c 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -2770,23 +2770,7 @@ Partial Class Compras_eFacturas
Next
Next
- 'ImportePago
- 'For Each node As XmlNode In nodePago
- ' Dim Nrow As DataRow = DTDocumentosRelacionados.NewRow
-
- ' Nrow("Serie") = ValorXML(node, "Serie")
- ' Nrow("Folio") = ValorXML(node, "Folio").ToEntero
- ' Nrow("SerieFolio") = ValorXML(node, "Serie") & "-" & ValorXML(node, "Folio").ToEntero
- ' Nrow("IdDocumento") = ValorXML(node, "IdDocumento")
- ' Nrow("MonedaDR") = ValorXML(node, "MonedaDR")
- ' Nrow("MetodoDePagoDR") = ValorXML(node, "MetodoDePagoDR")
- ' Nrow("ImpPagado") = ValorXML(node, "ImpPagado").ToDecimal
- ' Nrow("Fecha") = FechaPago
-
- ' DTDocumentosRelacionados.Rows.Add(Nrow)
- ' StrUUID.AppendFormat("'{0}',", ValorXML(node, "IdDocumento").Replace("'", ""))
- 'Next
Dim ObjCompraFolios As New ClsCompras
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=2) Then
@@ -3031,12 +3015,10 @@ Partial Class Compras_eFacturas
If HdnCveIE.Value.ToEntero > 0 Then
-
For Each dRow As DataRow In DT_ComprasSinIE.Rows
objEventos.AddEventoBitacora($"Complemento { dRow("SerieFolioPago").ToString } vinculado manualmente a compra {dRow("SerieFolioCompra").ToString}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=dRow("CveCompra").ToString.ToEntero)
Next
-
End If
@@ -3452,4 +3434,361 @@ Partial Class Compras_eFacturas
Alert("no se pudo procesar el archivo xml")
End If
End Sub
+
+
+ Private Sub VinculacionMasivaComplementos()
+
+ Dim CountVinculados As Integer = 0
+ Dim ValidadoSAT As Boolean = False
+ Dim VinculacionValida As Boolean = False
+
+ For Each gvRow As GridViewRow In GvPagos.Rows
+
+ Dim DTDocumentosRelacionados As New DataTable
+ Dim DTVinculacion As New DataTable
+
+ Dim ObjValidacion As New ClsValidaCFDi(gvRow.DataKey("UUID"), gvRow.DataKey("RFCDe"), gvRow.DataKey("RFCPara"), 0)
+
+ If ObjValidacion.EsValida > 0 Then
+
+ If ObjValidacion.EsValida = 2 Then
+ ValidadoSAT = False
+ Else
+ Dim ObjDatos As New ClsCompras
+ ValidadoSAT = ObjDatos.UpdateEstatus(ObjValidacion.EsValida, gvRow.DataKey("CveFactura").ToEntero)
+ ObjDatos.Dispose()
+ End If
+
+ Else
+ ValidadoSAT = False
+ End If
+ ObjValidacion.Dispose()
+
+ If Not ValidadoSAT Then
+ Continue For
+ End If
+
+ Dim sbSinIE As New StringBuilder
+
+ HdnCveIE.Value = ""
+ MSGComplemento = ""
+ ViculacionConPUE = False
+ ListaComprasPUE.Clear()
+ ComplementoConPUE = ""
+
+ DT_ComprasSinIE = New DataTable
+
+ Dim ListaComprasPUEInterna As New List(Of Integer)
+
+ Dim CveComplementoPagoCompra As Integer = gvRow.DataKey("CveComplementoPagoCompra").ToString.ToEntero
+
+ If CveComplementoPagoCompra > 0 Then
+ Continue For
+ End If
+
+ Dim SerieFolioIE As String = ""
+ Dim UUIDPago As String = ""
+ 'Dim ImportePago As Decimal = 0
+ Dim StrUUID As New StringBuilder
+ Dim Monto As Decimal = 0
+ Dim nodePagos As XmlNode = Nothing
+ Dim nodePagos2 As XmlNode = Nothing
+ Dim nodeComp As XmlNode = Nothing
+ Dim nodeaGral As XmlNode = Nothing
+ Dim nodeTFD As XmlNode = Nothing
+ Dim ImporteIES As Double = 0
+ Dim DiferenciaImportes As Double = 0
+ Dim TextoDiferenciaImporte As String = ""
+ Dim FechaPago As Date
+ Dim PagosCantidad As Integer = 0
+
+
+
+ Dim XMLDoc As New XmlDocument
+ Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
+ If IO.File.Exists(Archivo) Then
+
+
+ Dim SXML As String = File.ReadAllText(Archivo).Replace(vbLf, " ").Replace(vbCrLf, " ")
+
+ SXML = SXML.Trim((Convert.ToChar(0)))
+
+ XMLDoc.LoadXml(SXML)
+
+ Dim Xml As New StringBuilder
+ Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
+
+ namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
+ namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
+ namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
+ nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
+
+ nodeaGral = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", XMLDoc.DocumentElement.Prefix), namespaces)
+
+ nodeTFD = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
+ nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", "pago10"), namespaces)
+ nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", "pago10"), namespaces)
+ 'Monto = ValorXML(nodePagos, "Monto").ToDecimal
+
+ Dim nodePago As XmlNodeList = nodePagos.SelectNodes(String.Format("//{0}:DoctoRelacionado", "pago10"), namespaces)
+
+ SeriePago = ValorXML(nodeaGral, "Serie")
+ FolioPago = ValorXML(nodeaGral, "Folio")
+
+ UUIDPago = ValorXML(nodeTFD, "UUID")
+ LblUUID.Text = UUIDPago
+
+
+ DTDocumentosRelacionados.Columns.Add("Serie")
+ DTDocumentosRelacionados.Columns.Add("SerieFolio")
+
+ DTDocumentosRelacionados.Columns.Add("IdDocumento")
+ DTDocumentosRelacionados.Columns.Add("Folio", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("MonedaDR")
+ DTDocumentosRelacionados.Columns.Add("MetodoDePagoDR")
+ DTDocumentosRelacionados.Columns.Add("ImpPagado", GetType(Decimal))
+
+ DTDocumentosRelacionados.Columns.Add("CveFactura", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("CveCompra", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("CveIE", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("Fecha", GetType(Date))
+
+ DTDocumentosRelacionados.Columns.Add("FolioPago")
+ DTDocumentosRelacionados.Columns.Add("ImportePago", GetType(Decimal))
+ DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date))
+ DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer))
+ DTDocumentosRelacionados.Columns.Add("SerieFolioCompra")
+
+
+
+ Dim nodePagosN As XmlNodeList
+ nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", "pago10"), namespaces)
+
+
+
+ For Each NodosPagos As XmlNode In nodePagosN
+ For Each innernode As XmlNode In NodosPagos
+
+ FechaPago = ValorXML(innernode, "FechaPago").ToDate
+ PagosCantidad = PagosCantidad + 1
+
+ For Each node As XmlNode In innernode
+
+ Dim Nrow As DataRow = DTDocumentosRelacionados.NewRow
+
+ Nrow("Serie") = ValorXML(node, "Serie")
+ Nrow("Folio") = ValorXML(node, "Folio").ToEntero
+ Nrow("SerieFolio") = ValorXML(node, "Serie") & "-" & ValorXML(node, "Folio").ToEntero
+ Nrow("IdDocumento") = ValorXML(node, "IdDocumento")
+ Nrow("MonedaDR") = ValorXML(node, "MonedaDR")
+ Nrow("MetodoDePagoDR") = ValorXML(node, "MetodoDePagoDR")
+
+ Monto = Monto + ValorXML(node, "ImpPagado").ToDecimal
+
+ Nrow("ImpPagado") = ValorXML(node, "ImpPagado").ToDecimal
+ Nrow("Fecha") = FechaPago
+
+ DTDocumentosRelacionados.Rows.Add(Nrow)
+ StrUUID.AppendFormat("'{0}',", ValorXML(node, "IdDocumento").Replace("'", ""))
+ Next
+
+ Next
+ Next
+
+
+
+ Dim ObjCompraFolios As New ClsCompras
+ If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=2) Then
+ '
+ '.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
+ If ObjCompraFolios.DtResultados.Rows.Count > 0 Then
+ For Each drow As DataRow In ObjCompraFolios.DtResultados.Rows
+
+ For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows
+
+ If dRow2("IdDocumento").ToString.ToUpper = drow("IdDocumento").ToString.ToUpper Then
+
+ dRow2("CveCompra") = drow("CveCompra").ToString.ToEntero
+ dRow2("CveFactura") = drow("CveFactura").ToString.ToEntero
+ dRow2("CveMetodoPago") = drow("CveMetodoPago").ToString.ToEntero
+ dRow2("SerieFolioCompra") = drow("SerieFolioCompra").ToString
+
+
+ If drow("CveIE").ToString.ToEntero > 0 Then
+
+ dRow2("CveIE") = drow("CveIE").ToString.ToEntero
+ dRow2("ImportePago") = drow("Importe").ToString.ToDecimal
+
+
+ End If
+
+ dRow2("FolioPago") = drow("FolioIE")
+ dRow2("FechaPago") = drow("FechaDocumento")
+
+
+
+
+ End If
+ Next
+ Next
+ End If
+ End If
+
+ ObjCompraFolios.Dispose()
+
+ 'GVPDocumentosRelacionadosPagos.DataSource = DTDocumentosRelacionados
+ 'GVPDocumentosRelacionadosPagos.DataBind()
+
+
+ For Each dRow2 As DataRow In DTDocumentosRelacionados.Rows
+ If dRow2("CveMetodoPago").ToString.ToEntero > 0 Then
+ If dRow2("CveMetodoPago").ToString.ToEntero = 1 Then
+ MSGComplemento = MSGComplemento & $" Compra {dRow2("SerieFolioCompra").ToString } bloqueado Tipo ""PUE"". "
+
+ ListaComprasPUEInterna.Add(dRow2("CveCompra").ToString.ToEntero)
+
+ ComplementoConPUE = $"{SeriePago}-{FolioPago}"
+
+ End If
+ End If
+ Next
+
+
+ DT_ComprasSinIE.Columns.Add("CveCompra", GetType(Integer))
+ DT_ComprasSinIE.Columns.Add("CveFactura", GetType(Integer))
+ DT_ComprasSinIE.Columns.Add("SerieFolioPago")
+ DT_ComprasSinIE.Columns.Add("SerieFolioCompra")
+
+ For Each dRow As DataRow In DTDocumentosRelacionados.Rows
+ Dim nRow As DataRow = DT_ComprasSinIE.NewRow
+ nRow("CveCompra") = dRow("CveCompra").ToString.ToEntero
+ ' nRow("CveFactura") = dRow("CveFactura").ToString.ToEntero
+ nRow("SerieFolioPago") = $"{SeriePago}-{FolioPago}"
+ nRow("SerieFolioCompra") = dRow("SerieFolioCompra").ToString
+
+ DT_ComprasSinIE.Rows.Add(nRow)
+
+
+ Next
+
+
+
+ Else
+ VinculacionValida = False
+ End If
+
+ CveFacturaPago = gvRow.DataKey("CveFactura").ToEntero
+ CveProveedor = gvRow.DataKey("CveProveedor").ToEntero
+ Dim ObjCompras As New ClsCompras
+
+
+ Dim TieneRegistros As Boolean = False
+
+ If ObjCompras.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
+ ' GvVincularPago.DataSource = ObjCompras.DtResultados
+ DTVinculacion = ObjCompras.DtResultados
+ If ObjCompras.DtResultados.Rows.Count > 0 Then
+ SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString
+ 'DivVincularPagoManualmente.Visible = False
+ VinculacionValida = True
+ TieneRegistros = True
+ Else
+ 'DivVincularPagoManualmente.Visible = True
+ VinculacionValida = False
+ End If
+ 'ImportePago = ObjCompras.DtResultados.SUMD("Monto")
+ Else
+ 'DivVincularPagoManualmente.Visible = False
+ VinculacionValida = False
+ End If
+
+
+ For Each dRow As DataRow In DTDocumentosRelacionados.Rows
+
+ Dim FechaDocumento As Date = dRow("FechaPago").ToString.ToDate
+ Dim FechaDoRecibo As Date = dRow("Fecha").ToString.ToDate
+ Dim CveIEDocumento As Integer = dRow("CveIE").ToString.ToEntero
+
+ If CveIEDocumento > 0 And FechaDocumento > New Date(1, 1, 1) Then
+
+ Dim FT1 As Date = FechaDocumento
+
+ If FechaDocumento <> New Date(1, 1, 1) Then
+ FT1 = FechaDocumento.AddDays(-6)
+ End If
+
+ Dim FT2 As Date = FechaDocumento.AddDays(7)
+
+ If Not (FechaDoRecibo >= FT1 And FechaDoRecibo < FT2) Then
+
+ VinculacionValida = False
+ 'MSGComplemento = MSGComplemento & " Existen mas de 3 días de diferencia entre la fecha del documento y la fecha de complemento. "
+ Exit For
+
+ End If
+
+ End If
+
+ Next
+
+ ObjCompras.Dispose()
+
+
+
+ If VinculacionValida Then
+
+ Dim TieneError = False
+ Dim ObjCompra As New ClsCompras
+ ObjCompra.IniciaTransacSQL()
+
+
+ For Each DTRow As DataRow In DTVinculacion.Rows
+
+ If Not ObjCompra.AddComplementoPago(DTRow("CveIE").ToString.ToEntero, DTRow("CveCompra").ToString.ToEntero, DTRow("Monto").ToString.ToDecimal, DTRow("CvePrePolizaDetalle").ToString.ToEntero, CveFacturaPago) > 0 Then
+ TieneError = True
+ End If
+
+
+ Next
+
+ If Not TieneError AndAlso Not ObjCompra.AddVincularPago(CveFacturaPago) Then
+ TieneError = True
+ Else
+ CountVinculados = CountVinculados + 1
+ End If
+
+
+ If Not TieneError Then
+ ObjCompra.Commit()
+ Else
+ ObjCompra.RollBack()
+ End If
+
+ ObjCompra.Dispose()
+
+
+
+ End If
+
+
+ Next
+
+
+ If CountVinculados > 0 Then
+
+ Alert($"Se vincularon {CountVinculados} complementos")
+ CargaDatos()
+
+ End If
+
+
+
+ End Sub
+
+
+ Protected Sub LnkVinculacionMasivaComplementos_Click(sender As Object, e As EventArgs)
+ VinculacionMasivaComplementos()
+ End Sub
+
+
End Class
\ No newline at end of file
diff --git a/Contabilidad/RepAnexoCatalogo.aspx.vb b/Contabilidad/RepAnexoCatalogo.aspx.vb
index e33be02b4..bb8aba1fe 100644
--- a/Contabilidad/RepAnexoCatalogo.aspx.vb
+++ b/Contabilidad/RepAnexoCatalogo.aspx.vb
@@ -26,7 +26,7 @@ Partial Class AC_RepAnexoCatalogo
ViewState("FechaInicio") = value
End Set
End Property
- Private Property FechaFin As Date
+ Private Property FechaFin As DateTime
Get
FechaFin = ViewState("FechaFin").ToString.ToDate
End Get
diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx
index 5e60f096a..df71f1fcc 100644
--- a/Contabilidad/RepIVA.aspx
+++ b/Contabilidad/RepIVA.aspx
@@ -40,6 +40,13 @@