diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 91681aa05..e9c1cd5c0 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -343,60 +343,6 @@ Public Class ClsContabilidad - Public Function UpdatePrePolizasDetalleContrato(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1, - Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1, - Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1, Optional CveIE As Integer = -1, - Optional TipoCambio As Decimal = -1, Optional CveClasificacion As Integer = -1, Optional ImporteME As Decimal = -1) As Boolean - Dim Retorno As Boolean = False - - DataAdapter("PA_Conta_PrePolizasDetalleContratoUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CvePrePolizaDetalle", SqlDbType.Int).Value = CvePrePolizaDetalle - .Add("@Concepto", SqlDbType.VarChar).Value = Concepto - .Add("@Referencia", SqlDbType.VarChar).Value = Referencia - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable - .Add("@TipoMovto", SqlDbType.Bit).Value = TipoMovto - .Add("@TipoCambio", SqlDbType.Decimal).Value = TipoCambio - .Add("@ImporteMN", SqlDbType.Money).Value = ImporteMN - .Add("@Importe", SqlDbType.Money).Value = Importe - .Add("@ImporteME", SqlDbType.Money).Value = ImporteME - .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto - .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@CveCompra", SqlDbType.Int).Value = CveCompra - .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal - .Add("@CveCliente", SqlDbType.Int).Value = CveCliente - .Add("@CveVenta", SqlDbType.Int).Value = CveVenta - .Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto - .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico - .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta - .Add("@CveIE", SqlDbType.Int).Value = CveIE - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - If ex.Message.Contains("CuentasResultados_SubProyectos") Then - OnError("El concepto requiere que se le especifique centro de costo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ElseIf ex.Message.Contains("50015") Then - OnError("No se puede eliminar una póliza en un ejercicio Cerrado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - If ex.Message.Contains("concepto de bancos con un importe diferente") Then - OnError("No se puede editar el valor del bancos con un valor diferente a movimiento registrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - Else - OnError("Ocurrió un error al Actualizar la Prepoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If - End If - - End Try - - Return Retorno - End Function - - Public Function AddPrePolizasNegativa(CvePrePoliza As Integer, CveUsuario As Integer, Concepto As String, CveEmpresa As Integer, Fecha As Date) As Integer diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/E194.ashx similarity index 97% rename from Ashx/SIGFacturacion.ashx rename to Ashx/E194.ashx index c0a122085..34a2d2c9d 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/E194.ashx @@ -1,22 +1,27 @@ -<%@ WebHandler Language="VB" Class="SIGFacturacion" %> +<%@ WebHandler Language="VB" Class="E194" %> + +Option Strict On +Option Explicit On -Imports System -Imports System.Web -Imports System.Net.Http -Imports System.Web.Http Imports System.Data +Imports System.IO +Imports System.Net.Http Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports Extensiones -Imports System.IO -Imports Modelos -Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState +Public Class E194 : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState + + Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable + Get + Return False + End Get + End Property Private Property CveEmpresaFacturar As Integer = 194 Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest - context.Response.ContentType = "text/plain" + context.Response.ContentType = "text/html" Dim Retorno As Boolean = False Try @@ -38,6 +43,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ex.GuardaLog(ex.Message) End Try + context.Response.StatusCode = 200 If Retorno Then context.Response.Write("True") Else @@ -46,12 +52,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState End Sub - Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable - Get - Return False - End Get - End Property - Private Function IniciaFacturacionMasiva(pCveEmpresa As String, pFechaI As String, pFechaF As String) As Boolean Dim Retorno As Boolean = True Dim JsonRetorno As New JObject() @@ -278,7 +278,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ObjFactura.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.TextoLimpio ObjFactura.Serie = Serie ObjFactura.Folio = Folio.ToEntero() - ObjFactura.TipoMensajeRespuesta = TipoMensajeRespuesta.TextoLimpio + ObjFactura.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.TextoLimpio ObjFactura.Version = "4.0" ObjFactura.FolioFiscal = "" ObjFactura.CveUsuario = UsuarioActual.CveUsuario @@ -315,8 +315,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ObjFactura.CveSubProyecto = CveSubProyecto ObjFactura.CveSubProyectoCobranza = CveSubProyecto ObjFactura.CveSubProyectoEjecucion = CveSubProyecto - ObjFactura.SubProyecto = New SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto))) - ObjFactura.SubProyectoMatriz = New SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=-1 ).FiltroPrimero("TipoSucursal=1")) + ObjFactura.SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto))) + ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=-1).FiltroPrimero("TipoSucursal=1")) + ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveSubProyecto:=-1).FiltroPrimero("TipoSucursal=1")) 'CLIENTE ObjFactura.CveCliente = CveCliente @@ -426,7 +427,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT - Timbre.Comprobante.Subtotal = Obj.SubTotal + Timbre.Comprobante.SubTotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento Timbre.Comprobante.Moneda = Obj.MonedaSAT Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString) @@ -909,7 +910,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10) strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString) Try - ArchivoW = New StreamWriter(String.Format("{0}\Log\LogFacturacion.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) + ArchivoW = New StreamWriter(String.Format("{0}\Log\LogE194.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8) Catch ex As UnauthorizedAccessException 'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError) Exit Sub @@ -926,7 +927,4 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState ArchivoW.Dispose() End Sub - - - End Class \ No newline at end of file diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index eb35a01ad..c15d7f9b8 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -3208,7 +3208,13 @@ Partial Class Inventarios_RecepcionUsados CveMarca = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero - Dim dtt As DataTable = GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) + Dim DtAcumMeses As DataTable = GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) + Dim Dtt As DataTable = Nothing + If DtAcumMeses IsNot Nothing Then + ''obtener siempre y cuando la fecha de inicio sea mayor + Dim strDate As Date = ($"20{TxtEtiqueta.Text.Substring(2, 2)}/{TxtEtiqueta.Text.Substring(0, 2)}/01").ToDate + Dtt = DtAcumMeses.FiltraParametros($" #{strDate.ToString("yyyy/MM/dd")}# >= FechaInicioVigencia ", "FechaInicioVigencia DESC") + End If If dtt IsNot Nothing Then If dtt.Rows.Count > 0 Then diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx index 41ed03331..050d5191a 100644 --- a/Transportes/RepContratoDetalle.aspx +++ b/Transportes/RepContratoDetalle.aspx @@ -15,10 +15,18 @@