diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index 7a14674f8..9435c83d1 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -525,7 +525,7 @@ Public Class ClsClientes
'SqlAdapter.Dispose()
Return Retorno
End Function
- Public Function GetHistorialVentas(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional TipoDocto As String = "-1") As Boolean
+ Public Function GetHistorialVentas(CveCliente As Integer, Optional SelectTop As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional TipoDocto As String = "-1", Optional CveEstatusFactura As Integer = -1, Optional FechaI As DateTime = ModExtensiones.MinFecha, Optional FechaF As DateTime = ModExtensiones.MaxFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ClienteHistorialVentas")
@@ -533,6 +533,9 @@ Public Class ClsClientes
SqlAdapter.SelectCommand.Parameters.Add("@SelectTop", SqlDbType.Int).Value = SelectTop
SqlAdapter.SelectCommand.Parameters.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
SqlAdapter.SelectCommand.Parameters.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
+ SqlAdapter.SelectCommand.Parameters.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
+ SqlAdapter.SelectCommand.Parameters.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
+ SqlAdapter.SelectCommand.Parameters.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb
index 88fb94258..33dc7e050 100644
--- a/App_Code/ClsCompras.vb
+++ b/App_Code/ClsCompras.vb
@@ -2239,11 +2239,11 @@ Public Class ClsCompras
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "TIPOS DE GASTOS"
-
+
Public Function GetTipoGasto(CveTipoGasto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_TiposGastosGet")
@@ -2261,50 +2261,113 @@ Public Class ClsCompras
End Try
Return Retorno
- End Function
+ End Function
+
+ Public Function AddTipoGasto(TipoGasto As String, Estatus As Boolean, FechaIng As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Comp_TiposGastosAdd")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
+ .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 agregar el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateTipoGasto(CveTipoGasto As Integer, TipoGasto As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Comp_TiposGastosUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
+ .Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .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 tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemoveTipoGasto(CveTipoGasto As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Comp_TiposGastosRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
#End Region
-
+
#Region "VINCULAR PAGO"
- 'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean
- ' Dim Retorno As Boolean = False
- ' DataAdapter("PA_Comp_VincularPagoGet")
- ' With SqlAdapter.SelectCommand.Parameters
- ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
- ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
- ' .Add("@Tipo", SqlDbType.Int).Value = Tipo
- ' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
- ' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
- ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- ' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
- ' End With
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As Exception
- ' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- ' End Try
- ' Return Retorno
- 'End Function
-
- 'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean
- ' Dim Retorno As Boolean = False
- ' DataAdapter("PA_Comp_VincularComplementoPagoGet")
- ' With SqlAdapter.SelectCommand.Parameters
- ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
- ' .Add("@Monto", SqlDbType.Float).Value = Monto
- ' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos
- ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- ' End With
- ' Try
- ' SqlAdapter.Fill(Data)
- ' Retorno = True
- ' Catch ex As Exception
- ' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- ' End Try
- ' Return Retorno
- 'End Function
-
+ 'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' DataAdapter("PA_Comp_VincularPagoGet")
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ ' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
+ ' .Add("@Tipo", SqlDbType.Int).Value = Tipo
+ ' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ ' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+ ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ ' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
+ ' End With
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' End Try
+ ' Return Retorno
+ 'End Function
+
+ 'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean
+ ' Dim Retorno As Boolean = False
+ ' DataAdapter("PA_Comp_VincularComplementoPagoGet")
+ ' With SqlAdapter.SelectCommand.Parameters
+ ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ ' .Add("@Monto", SqlDbType.Float).Value = Monto
+ ' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos
+ ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ ' End With
+ ' Try
+ ' SqlAdapter.Fill(Data)
+ ' Retorno = True
+ ' Catch ex As Exception
+ ' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ' End Try
+ ' Return Retorno
+ 'End Function
+
Public Function AddComplementoPago(CveIE As Integer, CveCompra As Integer, Importe As Decimal, CvePrePolizaDetalle As Integer, CveFactura As Integer) As Integer
Dim Retorno As Integer = 0
DataAdapter("PA_Comp_ComplementoPagoAdd")
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 531cadc14..9a4c0c915 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4100,6 +4100,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OI/Circular.aspx".ToUpper(), 756)
PaginaDict.Add("/OI/CircularDetalle.aspx".ToUpper(), 757)
PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 757)
+ PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759)
#End Region
diff --git a/App_Code/ClsValidaCFDi.vb b/App_Code/ClsValidaCFDi.vb
index 59aebfc3a..02031dff8 100644
--- a/App_Code/ClsValidaCFDi.vb
+++ b/App_Code/ClsValidaCFDi.vb
@@ -102,8 +102,35 @@ Public Class ClsValidaCFDi
EsValida = 2
End If
- Catch ex As Exception
+ 'SI NO PUEDE ENCONTRAR EL ESTATUS UTILIZA EL SERVICIO PARA ESTATUS DE CANCELACION
+ If EsValida = 0 Then
+
+ Dim Vigencia = Timbrado.VerificarVigenciaSAT(LFolioFiscal.ToUpper, LRFCEmisor, LRFCReceptor, Importe, True)
+
+ If Vigencia IsNot Nothing Then
+ If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
+ EsValida = 1
+ End If
+ If Vigencia.Estado.ToUpper().Contains("CANCELADO") Then
+ EsValida = 2
+ ElseIf Vigencia.Estado.ToUpper().Contains("VIGENTE") Then
+ If Vigencia.EstatusCancelacion.ToUpper() = "EN PROCESO" Then
+ EsValida = 1
+ ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE CON ACEPTACIÓN" Then
+ EsValida = 1
+ ElseIf Vigencia.EsCancelable.ToUpper() = "CANCELABLE SIN ACEPTACIÓN" Then
+ EsValida = 1
+ End If
+ Else
+ EsValida = 0
+ End If
+ Else
+ EsValida = 0
+ End If
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al consultar la vigencia ante el SAT", ex)
End Try
End Sub
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 5e08bcb3a..9e1941e5c 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -4265,6 +4265,14 @@ Namespace Modelos
Return Retorno
End If
+ 'VALIDACION DE PEDIDOS: SI ESTA ENTEGADO NO SE PUEDA CANCELAR
+ If ObjFactura.TipoDocto = "Pd2" AndAlso TieneAlmacen AndAlso ObjFactura.SaldoAlmacen <> 0 Then
+ Retorno.Mensaje = "El pedido no se puede cancelar debido ha que ya fue entregado."
+ Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
+
+ Return Retorno
+ End If
+
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx
new file mode 100644
index 000000000..f930bc624
--- /dev/null
+++ b/Compras/CatTipoGasto.aspx
@@ -0,0 +1,76 @@
+<%@ Page Title="Compras - Catálogo de Tipos de Gasto" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTipoGasto.aspx.cs" Inherits="Compras_CatTipoGasto" %>
+
+<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
+
+
+
+
+
+
+
+
");
strBody.Append("
");
strBody.Append(" Gracias por realizar pedido
");
- strBody.Append(" Compuproveedores");
+ //strBody.Append(" Compuproveedores");
strBody.Append("
");
strBody.Append(" Sigue disfrutando de nuestros productos y servicios
");
- strBody.Append(" www.compuproveedores.com");
+ //strBody.Append(" www.compuproveedores.com");
strBody.Append("");
strBody.Append("