From 5f07f30873ed03c66cc4b2d139f233a3ddaee462 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 3 Nov 2020 20:35:09 -0700 Subject: [PATCH 1/6] -- log error contabilizar --- App_Code/ClsContabilidad.vb | 2 +- Inventarios/TraspasoAlmacen.aspx.vb | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index a8263551a..39fd883db 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1429,7 +1429,7 @@ Public Class ClsContabilidad If Not ContaCompartida Then ObjConta.Dispose() End If - StrLog.AppendFormat(" - Con Retorno ({0}) - OcurrioError ({1} ", Retorno, OcurrioError) + StrLog.AppendFormat(" - Con Retorno ({0}) - OcurrioError ({1}) ", Retorno, OcurrioError) StrLog.AppendFormat(" - Fin") StrLog.ToString.GuardaLogAD("LogContabilizacion") Return Retorno diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 2c26b3865..8f0dc0e82 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1054,7 +1054,7 @@ Partial Class Inventarios_TraspasoAlmacen 'DdlClasificacion.SelectedValue = "-1" 'DdlClasificacion_SelectedIndexChanged(DdlClasificacion, EventArgs.Empty) - If ChkEmitirTimbrado.Checked Then CveMovimientoTimbrado = CveMovimientoSalida : Timbrar() + If ChkEmitirTimbrado.Checked AndAlso ChkTransitorio.Checked Then CveMovimientoTimbrado = CveMovimientoSalida : Timbrar() Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion, "") @@ -1072,21 +1072,21 @@ Partial Class Inventarios_TraspasoAlmacen LimpiaMovimiento() - Else + Else ObjInventario.RollBack() Alert(TextoError, TipoMensaje.MsgError) RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')") - End If + End If - ' If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose() + ' If ObjContaAC IsNot Nothing Then ObjContaAC.Dispose() - 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR - If ErrorExistencia Then - CargaGvDatos() - End If - ObjConta.Dispose() - ObjInventario.Dispose() - End Sub + 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR + If ErrorExistencia Then + CargaGvDatos() + End If + ObjConta.Dispose() + ObjInventario.Dispose() + End Sub Function ConsumoInterno(TipoAlmacenOrigen As Integer, TipoAlmacenDestino As Integer) As Boolean Dim Retorno As Boolean = False From 01ed661a250bc000a6843e200ce1446004728fe2 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Nov 2020 18:52:02 -0700 Subject: [PATCH 2/6] - parametro de cuenta --- App_Code/ClsContabilidad.vb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 39fd883db..e9b5be573 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5538,7 +5538,7 @@ Public Class ClsContabilidad End Function #Region "IVAS" - Public Function GetRepIVA(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveUsuarioConsulta As Integer, Conciliado As Integer, CveEmpresa As Integer, TipoCambio As Integer, TCEspecifico As Double) As Boolean + Public Function GetRepIVA(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveUsuarioConsulta As Integer, CveCuentaBancaria As Integer, Conciliado As Integer, CveEmpresa As Integer, TipoCambio As Integer, TCEspecifico As Double) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_RepIVA") With SqlAdapter.SelectCommand.Parameters @@ -5546,6 +5546,7 @@ Public Class ClsContabilidad .Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@CveCuentaBancaria", SqlDbType.Int).Value = CveCuentaBancaria .Add("@Conciliado", SqlDbType.Int).Value = Conciliado .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio @@ -5582,13 +5583,14 @@ Public Class ClsContabilidad End Function - Public Function GetRepIVAComparativo(FechaInicio As Date, FechaFin As Date, CveUsuarioConsulta As Integer, Conciliado As Integer, CveEmpresa As Integer) As Boolean + Public Function GetRepIVAComparativo(FechaInicio As Date, FechaFin As Date, CveUsuarioConsulta As Integer, CveCuentaBancaria 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("@CveCuentaBancaria", SqlDbType.Int).Value = CveCuentaBancaria .Add("@Conciliado", SqlDbType.Int).Value = Conciliado .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -5602,7 +5604,7 @@ Public Class ClsContabilidad 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 + Public Function GetRepIVAAcumulado(FechaInicio As Date, FechaFin As Date, Conciliado As Integer, TipoImpuesto As Integer, CveCuentaBancaria As Integer, CveUsuarioConsulta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_IVAAcumulado") With SqlAdapter.SelectCommand.Parameters @@ -5610,6 +5612,7 @@ Public Class ClsContabilidad .Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@CveCuentaBancaria", SqlDbType.Int).Value = CveCuentaBancaria .Add("@Conciliado", SqlDbType.Int).Value = Conciliado .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa From 5d7ff8e51f77edc7d60e84827f5fd408409468e3 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Nov 2020 18:52:49 -0700 Subject: [PATCH 3/6] -contabilidad de traspaso de almacen --- App_Code/modExtensiones.vb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index b236d68a4..da8ccef26 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -2921,6 +2921,24 @@ Namespace Extensiones Return Retorno End Function + + Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean) As Integer + Dim Retorno As Integer = -1 + Dim ErrorMovInv As Boolean = False + + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 53, 0, 0, 1, Fecha, Concepto, CveUsuario, CveEmpresa) + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv Then Retorno = CvePrePoliza + + Return Retorno + End Function #End Region #Region "GPS" From 84f0d2c2f84719fd7d2f4ca4c16ab34b2b3b9489 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Nov 2020 18:53:12 -0700 Subject: [PATCH 4/6] -- parametros de cuentas --- Contabilidad/RepIVA.aspx.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index 7593aa05d..63ead6a25 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -75,24 +75,24 @@ public partial class Contabilidad_RepIVA : ClsPaginas LblMsgAcreditable.Text = ""; // lbl de mensajes de negativos ClsContabilidad ObjCont = new ClsContabilidad(); - if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) + if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) { GvT.DataSource = ObjCont.DtResultados; DtIVATrasladado = ObjCont.DtResultados; - if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { GvIEPSA.DataSource = ObjCont.DtResultados; DtIEPSA = ObjCont.DtResultados; } - if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 2, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { GvIVAA.DataSource = ObjCont.DtResultados; DtIVAA = ObjCont.DtResultados; } } - if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) + if (ObjCont.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) { GvA.DataSource = ObjCont.DtResultados; DtIVAAcreditable = ObjCont.DtResultados; @@ -102,7 +102,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas } - if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { GvIVA2.DataSource = ObjCont.DtResultados; } @@ -276,7 +276,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas StringBuilder SBDIOT = new StringBuilder(); int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); - if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) + if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) { foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0) @@ -352,7 +352,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); - if (Objconta.GetRepIVAComparativo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveUsuario, Conciliado, UsuarioActual.CveEmpresa )) + if (Objconta.GetRepIVAComparativo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa )) { GvCompara.DataSource = Objconta.DtResultados; } From c077d3082df4677029524fd53b629b9e2e65f5b0 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 5 Nov 2020 18:54:11 -0700 Subject: [PATCH 5/6] - entrada por oc, sin servicio y venia en la factura. --- Compras/Compras.aspx.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 36819bc16..0268da558 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6698,8 +6698,15 @@ Partial Class Compras_Compras End If Next + 'obtengo si hay servicios + Dim CostosIndirectosTardados As Decimal = TmpDT.SUMD("Total", "ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 1") + 'consideracion, si la oc, se le agrego un servicio y este no se cargo en la entrada al almacen. + If CostoIndirectoAcum176 = 0 AndAlso CostosIndirectosTardados > 0 Then + CostosIndirectosTardados = CostosIndirectosTardados * TCO + End If + 'calcula la diferencia entre lo recibido por la OC, considerando costos indirectos y lo que se ingresaria en la compra - SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * TCO).RoundSQL 'sumatoria de la factura + SumatoriaOCINV = SumatoriaInventario - (TmpDT.SUMD("Total") * TCO).RoundSQL + CostosIndirectosTardados 'sumatoria de la factura If SumatoriaOCINV.RoundSQL <> 0 Then ' se abona el costo, cambiamos su naturaleza 'SumatoriaOCINV = -SumatoriaOCINV From 954146dcad5643b5c2242562bbfad9c8b1f47925 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Fri, 6 Nov 2020 03:03:37 -0700 Subject: [PATCH 6/6] --- Ashx/SIGWeb.ashx | 31 +++++++++++++++++++++---------- vwd.webinfo | 4 ++++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 92c7de325..3c0189d72 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -10,7 +10,27 @@ Imports System.IO Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest - context.Response.ContentType = "text/plain" + If context.Request("metodo").ToString() = "GetTokenAngular" Then + 'context.Response.ContentType = "application/json; charset=utf-8" + + context.Response.ContentType = "text/json" + Dim origin As String = context.Request.UrlReferrer.ToString() + context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1)) + 'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200") + 'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST") + context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept") + context.Response.AddHeader("Access-Control-Allow-Credentials", "true") + context.Response.StatusCode = 200 + Dim key As String = GetTokenAngular(context) + Dim json As String = JsonConvert.SerializeObject(key) + context.Response.Write(json) + context.Response.Flush() + context.Response.Close() + context.Response.End() + Else + context.Response.ContentType = "text/plain" + End If + Try Select Case context.Request("metodo") Case "getps" @@ -53,10 +73,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState context.Response.Write(sendMail(context)) Case "sendMailLPM" context.Response.Write(sendMailLPM(context)) - Case "GetTokenAngular" - context.Response.Write(GetTokenAngular(context)) - context.Response.End() - End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -74,11 +90,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Microsoft.IdentityModel.Tokens.SecurityAlgorithms.HmacSha256Signature)} Dim tokenHandler = New System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler() Dim newtoken = tokenHandler.CreateToken(tokenDescriptor) - 'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200") - 'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST") - 'context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept") - context.Response.AddHeader("Access-Control-Allow-Credentials", true ) - context.Response.StatusCode = 200 Dim stokenn As String = tokenHandler.WriteToken(newtoken) Return stokenn diff --git a/vwd.webinfo b/vwd.webinfo index 821cf7887..58b25d2ef 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -126,6 +126,10 @@ + + + +