diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb
index c74216334..b5e500e31 100644
--- a/AF/CatAF.aspx.vb
+++ b/AF/CatAF.aspx.vb
@@ -87,8 +87,8 @@ Partial Class AF_CatAF
DdlEstatus.DataSource = GlobalDTEstadoActivoFijo
DdlEstatus.DataBind()
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
-
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto)
+ GvDatos.Columns(7).HeaderText = LblSubProyecto.Text
DivProyecto.Visible = LblProyecto.Visible
DivProyectoDdl.Visible = LblProyecto.Visible
'DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.CveEmpresa)
diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb
index 551593b30..6abe367d1 100644
--- a/App_Code/ClsOIEventos.vb
+++ b/App_Code/ClsOIEventos.vb
@@ -2743,8 +2743,355 @@ Public Class ClsOIEventos
Return Retorno
End Function
+
+
#End Region
+#Region "OI_Documentos"
+
+#Region "OI_DocumentosCategorias"
+ Public Function GetDocumentoCategoria(Optional CveCategoria As Integer = -1, Optional Categoria As String = "-1") As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosCategoriasGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
+ .Add("@Categoria", SqlDbType.NVarChar).Value = Categoria
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddDocumentoCategoria(Categoria As String, Estado As Boolean) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosCategoriasAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Categoria", SqlDbType.NVarChar).Value = Categoria
+ .Add("@Estado", SqlDbType.Bit).Value = Estado
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateDocumentoCategoria(CveCategoria As Integer, Categoria As String, Estado As Boolean) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosCategoriasUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
+ .Add("@Categoria", SqlDbType.NVarChar).Value = Categoria
+ .Add("@Estado", SqlDbType.Bit).Value = Estado
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemoveDocumentoCategoria(CveCategoria As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosCategoriasRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCategoria", SqlDbType.NVarChar).Value = CveCategoria
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "OI_DocumentosSubCategoria"
+ Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1") As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosSubCategoriasGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
+ .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddDocumentoSubCategoria(SubCategoria As String, CveCategoria As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosSubCategoriasAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria
+ .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateDocumentoSubCategoria(CveSubCategoria As Integer, SubCategoria As String, CveCategoria As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosSubCategoriasUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
+ .Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria
+ .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemoveDocumentoSubCategoria(CveSubCategoria As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosSubCategoriasRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveSubCategoria", SqlDbType.NVarChar).Value = CveSubCategoria
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "Documentos"
+ Public Function ListadoDocumentos(CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_ListarDocumentos")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el listado de documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetDocumento(CveDocumento As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
+ .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 documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddDocumento(CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String,
+ Responsable As String, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Integer
+
+ Dim Retorno As Integer = -1
+
+ DataAdapter("PA_OI_DocumentosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
+ .Add("@Descripcion", SqlDbType.NVarChar).Value = Descripcion
+ .Add("@Observacion", SqlDbType.NVarChar).Value = Observacion
+ .Add("@Version", SqlDbType.NVarChar).Value = Version
+ .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
+ .Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico
+ .Add("@Responsable", SqlDbType.NVarChar).Value = Responsable
+ .Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveDocumento", SqlDbType.Int).Direction = ParameterDirection.Output
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = SqlAdapter.SelectCommand.Parameters("@CveDocumento").Value.ToString().ToEntero()
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateDocumento(CveDocumento As Integer, CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String,
+ Responsable As String, FechaAprobacion As Date, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
+ .Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
+ .Add("@Descripcion", SqlDbType.NVarChar).Value = Descripcion
+ .Add("@Observacion", SqlDbType.NVarChar).Value = Observacion
+ .Add("@Version", SqlDbType.NVarChar).Value = Version
+ .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
+ .Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico
+ .Add("@Responsable", SqlDbType.NVarChar).Value = Responsable
+ .Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion
+ .Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .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 Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemoveDocumento(CveDocumento As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "OI_DocumentosAutorizacion"
+ Public Function AddDocumentoAutorizacion(CveDocumento As Integer, CveUsuario As Integer, Adjunto As String) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("OI_DocumentosAutorizacionesAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Adjunto", SqlDbType.NVarChar).Value = Adjunto
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el usuario para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetDocumentoAutorizacion(CveDocumento As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_OI_DocumentosAutorizacionesGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el usuario o usuarios para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+#End Region
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 283b294c0..b9cd948c1 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4590,6 +4590,10 @@ Public Class ClsPaginas
PaginaDict.Add("/OI/RepDesarrollo.aspx".ToUpper(), 475)
PaginaDict.Add("/OI/DesarrolloWizard.aspx".ToUpper(), 474)
PaginaDict.Add("/OI/SubidasADS.aspx".ToUpper(), 476)
+ PaginaDict.Add("/OI/CatDocumentoCategoria.aspx".ToUpper(), 760)
+ PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), 761)
+ PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), 762)
+ PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), 763)
#End Region
#Region "Planeacion"
'PLANEACIÓN
diff --git a/Bancos/RepProgramarRecursos.aspx b/Bancos/RepProgramarRecursos.aspx
index e7232caa1..e458a4947 100644
--- a/Bancos/RepProgramarRecursos.aspx
+++ b/Bancos/RepProgramarRecursos.aspx
@@ -118,7 +118,7 @@
Proyecto:
-
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 1ae19bf47..7537d835a 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -682,7 +682,7 @@
-
+
<%-- 0 --%>
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index e8d8ba33a..7fce911ba 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1511,6 +1511,8 @@ Partial Class Compras_Compras
CargaFletesAgregados()
End If
+
+
InicializaOC()
'Valida si el IVA del XML es está bien calculado
@@ -2396,6 +2398,8 @@ Partial Class Compras_Compras
EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero
DdlTipoCompra.SelectedValueExist(dr("CveTipoCompra"))
CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero
+
+ ChkEsNoDeducible.Checked = Boolean.Parse(dr("NoDeducible").ToString)
'Select Case dr("PorcentajeIVA").ToString.ToDouble
' Case 0
' DdlIVA.SelectedValue = "1"
@@ -2620,6 +2624,7 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveContrato", GetType(Integer))
+ TmpDT.Columns.Add("DifPSSat", GetType(Integer))
@@ -3612,6 +3617,7 @@ Partial Class Compras_Compras
tPSCodigo = String.Format("{1} - {0}", ValorXML(node, "descripcion").ToUpper.Trim.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace("'", "''"), ValorXML(node, "noIdentificacion").Trim)
End If
+ 'Alert(ValorXML(node, "ClaveProdServ").Trim)
If Version = "3.3" Then
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
@@ -3721,6 +3727,8 @@ Partial Class Compras_Compras
'AGREGA A TMPDT
AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS)
+
+
Next
End If
@@ -4484,6 +4492,17 @@ Partial Class Compras_Compras
'si el registro es manual, toma el mismo dato
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
+ For Each GvRow As GridViewRow In GvPS.Rows
+ If GvRow.RowType = DataControlRowType.DataRow Then
+
+ If GvRow.FCCheckBox("ChkEsNoDeduciblePS").Checked = False Then
+ EsNoDeducible = False
+ Exit For
+ End If
+
+ End If
+ Next
+
'Compra
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
@@ -10755,6 +10774,14 @@ Partial Class Compras_Compras
End If
+
+ If e.Row.DataKey("DifPSSat").ToEntero = 1 Then
+ '#e35b5a
+ e.Row.BackColor = Drawing.Color.FromArgb(1, 227, 91, 90)
+ e.Row.Attributes.Add("data-toggle", "tooltip")
+ e.Row.Attributes.Add("title", "El código del producto del SAT no es igual al código del producto registrado.")
+ End If
+
End If
End Sub
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
@@ -11018,6 +11045,8 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("ImporteConImpuestos", GetType(Double))
TmpDT.Columns.Add("NoDeducible", GetType(Boolean))
+ TmpDT.Columns.Add("DifPSSat", GetType(Integer))
+
TmpDTOriginal = New DataTable
TmpDTOriginal.Columns.Add("Consec", GetType(Integer))
TmpDTOriginal.Columns.Add("Cantidad", GetType(Decimal))
diff --git a/OI/CatDocumentoCategoria.aspx b/OI/CatDocumentoCategoria.aspx
new file mode 100644
index 000000000..e935eec64
--- /dev/null
+++ b/OI/CatDocumentoCategoria.aspx
@@ -0,0 +1,76 @@
+<%@ Page Title="OI - Catálogo de Categorías de Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatDocumentoCategoria.aspx.cs" Inherits="OI_CatDocumentoCategoria" %>
+
+<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
+
+
+
+
+
+
+
+ Catálogo de Categorías de Documentos
+
+
+
+
+