diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 64f7f20dc..a8263551a 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -1140,7 +1140,9 @@ Public Class ClsContabilidad
Optional ObjConta As ClsContPAQi = Nothing, Optional pIDPoliza As Integer = -1) As Boolean
Dim StrLog As New StringBuilder
Dim Retorno As Boolean = False
- StrLog.AppendFormat("CvePrep:{0} - Inicio", CvePrePoliza)
+ Dim OcurrioError As Boolean = False
+
+ StrLog.AppendFormat("CvePrep:{0} - Inicio -", CvePrePoliza)
If Empresa.TipoContabilizacion = 1 Then ' contabilidad en SIG
@@ -1154,7 +1156,7 @@ Public Class ClsContabilidad
If CvePrePoliza <= 0 Then Return False
- Dim OcurrioError As Boolean = False
+
Dim ContaCompartida As Boolean = False
If ObjConta Is Nothing Then
@@ -1263,6 +1265,7 @@ Public Class ClsContabilidad
If Not ObjConta.AddMovimiento(tIdPoliza, dr("IdCtaContable").ToString.ToEntero, tipoMovimiento,
dr("ImporteMN").ToString.ToDecimal, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegmentoNegocio").ToString.ToEntero, Fecha, SigReferencia, dr("CvePrePolizaDetalle").ToString.ToEntero, ImporteMonedaExtranjera:=dr("ImporteME").ToString.ToDecimal) Then
OcurrioError = True
+ StrLog.AppendFormat(" Error 1.1 - ")
Exit For
End If
@@ -1271,6 +1274,7 @@ Public Class ClsContabilidad
If Not ObjConta.AddMovimiento(tIdPoliza, dr("IdCtaContable").ToString.ToEntero, tipoMovimiento,
dr("Importe").ToString.ToDecimal, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegmentoNegocio").ToString.ToEntero, Fecha, SigReferencia, dr("CvePrePolizaDetalle").ToString.ToEntero, ImporteMonedaExtranjera:=dr("ImporteME").ToString.ToDecimal) Then
OcurrioError = True
+ StrLog.AppendFormat(" Error 1.2 - ")
Exit For
End If
@@ -1279,6 +1283,7 @@ Public Class ClsContabilidad
End If
Else
OcurrioError = True
+ StrLog.AppendFormat(" Error 1.3 - ")
Mensaje.Append(String.Format("
La cuenta contable {0} es invalida", dr("ConceptoContable")))
Exit For
End If
@@ -1298,6 +1303,7 @@ Public Class ClsContabilidad
dr("ISRRetenido").ToString.ToDecimal,
dr("IVARetenido").ToString.ToDecimal, False) Then
OcurrioError = True
+ StrLog.AppendFormat(" Error 1.4 - ")
End If
End If
@@ -1347,6 +1353,7 @@ Public Class ClsContabilidad
IdProveedor = ObjConta.AddProveedor(IdCtaContProveedores, RFC, RazonSocial, "")
If IdProveedor <= 0 Then
OcurrioError = True
+ StrLog.AppendFormat(" Error 1.5 - ")
End If
End If
@@ -1364,6 +1371,7 @@ Public Class ClsContabilidad
dr("Serie").ToString.ToString,
dr("Folio").ToString.StrToNum, dr("FolioFiscal").ToString, Empresa.CveEmpresa) Then
OcurrioError = True
+ StrLog.AppendFormat(" Error 1.6 - ")
Mensaje.Append("La Poliza o la Cuenta no son válidas ")
End If
@@ -1377,12 +1385,14 @@ Public Class ClsContabilidad
If Not OcurrioError Then
If Not UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then
+ StrLog.AppendFormat(" Error 2.1 - ")
OcurrioError = True
End If
End If
If Not OcurrioError Then
If Not UpdatePrePoliza(Fecha, ObjConta.Folio, CveTipoPoliza, tIdPoliza, CvePrePoliza, Empresa.CveEmpresa, CveUsuarioModifico:=CveUsuario) Then
+ StrLog.AppendFormat(" Error 2.2 - ")
OcurrioError = True
End If
End If
@@ -1404,11 +1414,13 @@ Public Class ClsContabilidad
Else
OcurrioError = True
+ StrLog.AppendFormat(" Error 3.1 - ")
End If
Catch ex As Exception
+ StrLog.AppendFormat(" Error 4.1 - ")
If Not ContaCompartida Then ObjConta.RollBack()
OnError("Ocurrió un error al intentar contabilizar la PrePoliza", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
'Alert("Ocurrió un error al guardar la póliza", TipoMensaje.MsgAdvertencia)
@@ -1417,8 +1429,9 @@ Public Class ClsContabilidad
If Not ContaCompartida Then ObjConta.Dispose()
End If
+ StrLog.AppendFormat(" - Con Retorno ({0}) - OcurrioError ({1} ", Retorno, OcurrioError)
StrLog.AppendFormat(" - Fin")
- StrLog.ToString.GuardaLogAD("LogContabilidazacion")
+ StrLog.ToString.GuardaLogAD("LogContabilizacion")
Return Retorno
End Function
diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb
index 30857a704..88cfc8e83 100644
--- a/App_Code/ClsContratos.vb
+++ b/App_Code/ClsContratos.vb
@@ -34,11 +34,17 @@ Public Class ClsContratos
End Property
Public Property NotificarAvanceAlcanzado As Boolean
- Public Property CveContratoGasto As Integer
-
-
+ Public Property CveContratoGasto As Integer
+
+ Public Property NumeroEstimacionNueva As Integer
+ Public Property CveEstimacionNueva As Integer
+
+
+
+
+
#End Region
-
+
#Region "T R A N S A C C I O N E S"
Public Function IniciaTransacSQL() As SqlTransaction
If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
@@ -1102,6 +1108,61 @@ Public Class ClsContratos
Return Retorno
End Function
+
+ Public Function AddContratosAvanceEstimacion(CveContrato As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno = False
+
+ NumeroEstimacionNueva = -1
+ CveEstimacionNueva = -1
+
+ DataAdapter("PA_Con_ContratosEstimacionAdd")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@NumeroEstimacion", SqlDbType.Int).Direction = ParameterDirection.Output
+ .Add("@CveEstimacion", SqlDbType.Int).Direction = ParameterDirection.Output
+ End With
+
+ Try
+
+ SqlAdapter.Fill(Data)
+ NumeroEstimacionNueva = SqlAdapter.SelectCommand.Parameters("@NumeroEstimacion").Value.ToString.ToEntero
+ CveEstimacionNueva = SqlAdapter.SelectCommand.Parameters("@CveEstimacion").Value.ToString.ToEntero
+
+ Retorno = True
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la estimación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+ Public Function UpdateContratosAvanceEstimacion(CveContratoAvance As Integer, CveEstimacion As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno = False
+
+ DataAdapter("PA_Con_ContratosAvanceEstimacionUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveContratoAvance", SqlDbType.Int).Value = CveContratoAvance
+ .Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion
+ .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 avance.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
#End Region
#Region " S E C C I O N E S "
diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb
index 78af613be..fe7fee68d 100644
--- a/App_Code/ClsOIEventos.vb
+++ b/App_Code/ClsOIEventos.vb
@@ -745,7 +745,7 @@ Public Class ClsOIEventos
OnError("Ocurrió un error al actualizar la relación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
- End Function
+ End Function
Public Function UPEventosVinculo(CveEvento As Integer, CveTipoRelacion As Integer, CveRelacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_OI_EventosVinculoUP", CommandType.StoredProcedure)
diff --git a/App_Code/WS_PuntoVenta.vb b/App_Code/WS_PuntoVenta.vb
index ee2e087e2..602e52a5b 100644
--- a/App_Code/WS_PuntoVenta.vb
+++ b/App_Code/WS_PuntoVenta.vb
@@ -850,7 +850,7 @@ Public Class WS_PuntoVenta
If objVentas.GetVentaTerminal(objVenta.CveVentaTerminal, objVenta.Fecha, objVenta.CveSubProyecto, objVenta.CveEmpresa) Then
- CvePrePoliza = ObjConta.AddPrePolizas("Vta", 4, objVenta.Total, objVenta.Total, objVenta.CveMoneda, objVenta.Fecha, "", objVenta.CveUsuario, objVenta.CveEmpresa)
+ CvePrePoliza = ObjConta.AddPrePolizas("Vta", 4, objVenta.Total, objVenta.Total, objVenta.CveMoneda, objVenta.Fecha, "Punto de Venta addVenta", objVenta.CveUsuario, objVenta.CveEmpresa)
If objVentas.DtResultados.Rows.Count = 0 Then
If objVentas.AddVenta(objVenta.TipoDocto, objVenta.FolioFact, objVenta.CveCliente, objVenta.CveClienteSucursal,
@@ -858,7 +858,7 @@ Public Class WS_PuntoVenta
objVenta.Total, objVenta.CveMoneda, objVenta.TipoCambio, objVenta.CveMetodoPago, objVenta.CondicionesPago,
objVenta.FormaPago, Now, objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, objVenta.FechaEjecucion,
objVenta.CveVendedor, If(objVenta.Alfa1 IsNot Nothing, objVenta.Alfa1, ""), If(objVenta.Alfa2 IsNot Nothing, objVenta.Alfa2, ""), If(objVenta.Alfa3 IsNot Nothing, objVenta.Alfa3, ""), objVenta.Num1,
- objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, objVenta.CveMesa, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza, objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal) Then
+ objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, objVenta.CveMesa, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza, objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal, CveSubProyecto:=objVenta.CveSubProyecto, CveSubProyectoEjecucion:=objVenta.CveSubProyecto) Then
objVenta.CveVenta = objVentas.CveVenta
'Ingresar los detalles
For Each Detalle As ClsVentaWS.ClsVentaDetalleWS In objVenta.Detalle
@@ -979,8 +979,9 @@ Public Class WS_PuntoVenta
'Se agrega movimiento separado por la cuenta de ventas (ER)
' For Each Row As DataRow In DT.Rows
ImporteMov = objVenta.SubTotal ' TmpDT.SUM("Total", "IdCtaContVentas = '" & Row("IdCtaContVentas").ToString & "'")
+ Dim CveClasificacion_04 = -1
If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, " ", CveConceptoVenta, " ", objVenta.Fecha, -1, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, " ", CveConceptoVenta, " ", objVenta.Fecha, -1, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, ImporteMX:=ImporteMov, CveSubProyecto:=objVenta.CveSubProyecto, CveClasificacion:=CveClasificacion_04) Then
ErrorMovtosVentas = True
End If
End If
@@ -989,7 +990,7 @@ Public Class WS_PuntoVenta
'Se agregan los DSV DESCUENTOS
ImporteMov = objVenta.Descuento
If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, " ", CveConceptoDSV, " ", objVenta.Fecha, IdCtaContDSV, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, " ", CveConceptoDSV, " ", objVenta.Fecha, IdCtaContDSV, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, ImporteMX:=ImporteMov) Then
ErrorMovtosDSV = True
End If
End If
@@ -998,7 +999,7 @@ Public Class WS_PuntoVenta
'Se agregan las CxC
ImporteMov = objVenta.Total - TotalPagado
If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, " ", CveConceptoAfectacion, " ", objVenta.Fecha, IdCtaContClientes, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, " ", CveConceptoAfectacion, " ", objVenta.Fecha, IdCtaContClientes, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, ImporteMX:=ImporteMov) Then
ErrorMovtosCxC = True
End If
End If
@@ -1006,7 +1007,8 @@ Public Class WS_PuntoVenta
'Si hubo un pago agregarlo
ImporteMov = TotalPagado
If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, " ", 2, " ", objVenta.Fecha, IdCtaContClientes, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimientoVenta, ImporteMov, " ", 2, " ", objVenta.Fecha, IdCtaContClientes, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, ImporteMX:=ImporteMov) Then
ErrorMovtosCxC = True
End If
End If
@@ -1014,7 +1016,11 @@ Public Class WS_PuntoVenta
'Se agregan el Traslado de IVA
ImporteMov = objVenta.IVA
If ImporteMov <> 0 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, " ", CveConceptoIVA, " ", objVenta.Fecha, 0, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE) Then
+ Dim PorcentajeImpuesto = 0
+ If objVenta.SubTotal > 0 Then
+ PorcentajeImpuesto = (objVenta.IVA / objVenta.SubTotal)
+ End If
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimientoVenta, ImporteMov, " ", CveConceptoIVA, " ", objVenta.Fecha, 0, -1, CveVenta:=objVenta.CveVenta, CveCliente:=objVenta.CveCliente, CveIE:=CveIE, ImporteMX:=ImporteMov, PorcentajeImpuesto:=PorcentajeImpuesto) Then
ErrorMovtosTrasladoIVA = True
End If
End If
@@ -1238,7 +1244,7 @@ Public Class WS_PuntoVenta
Try
- CvePrePoliza = ObjMov.AddPrePolizas("Banc", CvePlantillaPoliza, Importe, Importe, Moneda, Fecha, "", CveUsuario, CveEmpresa)
+ CvePrePoliza = ObjMov.AddPrePolizas("Banc", CvePlantillaPoliza, Importe, Importe, Moneda, Fecha, "Punto de venta IE", CveUsuario, CveEmpresa)
'valida prepoliza
If CvePrePoliza > 0 Then
@@ -1252,9 +1258,9 @@ Public Class WS_PuntoVenta
If CveIE > 0 Then
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", CveConceptoContable, " ", Now, 0, -1, CveIE) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", CveConceptoContable, " ", Now, 0, -1, CveIE, ImporteMX:=Importe) Then
Dim IVA As Double = 0
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe - IVA - CIF, "", CveConceptoCompra, " ", Now, 0, -1, CveIE) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe - IVA - CIF, "", CveConceptoCompra, " ", Now, 0, -1, CveIE, ImporteMX:=Importe - IVA - CIF) Then
Else
MsgError = "no se pudo insertar el detalle de la póliza2"
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index eb6cd7d95..92c7de325 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -53,13 +53,36 @@ 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)
End Try
End Sub
+ Private Function GetTokenAngular(context As HttpContext) As String
+ Dim usuario As Usuario = UsuarioActual(context)
+ Dim tokenDescriptor = New Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor With {
+ .Subject = New System.Security.Claims.ClaimsIdentity(New System.Security.Claims.Claim() {New System.Security.Claims.Claim("CvePlataforma", usuario.CvePlataforma.ToString()),
+ New System.Security.Claims.Claim("CveUsuario", usuario.CveUsuario.ToString()), New System.Security.Claims.Claim("CveEmpresa", usuario.CveEmpresa.ToString()),
+ New System.Security.Claims.Claim("CveRol", usuario.CveRol.ToString()), New System.Security.Claims.Claim("Fecha", Date.Now.ToLongDateString())}),
+ .Expires = Date.UtcNow.AddHours(3),
+ .SigningCredentials = New Microsoft.IdentityModel.Tokens.SigningCredentials(
+ New Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(Encoding.ASCII.GetBytes("*_AsistenciaDesarrolloSistemas-SIGAPI_*17-06-2020")),
+ 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
+ End Function
Private Function sendMailLPM(context As HttpContext) As String
Dim retorno As String = "true"
Dim nombre As String = ""
diff --git a/Bin/ClosedXML.dll b/Bin/ClosedXML.dll
index e945f5d26..4065a321f 100644
Binary files a/Bin/ClosedXML.dll and b/Bin/ClosedXML.dll differ
diff --git a/Bin/DocumentFormat.OpenXml.dll b/Bin/DocumentFormat.OpenXml.dll
index 53241bd1c..1698758e5 100644
Binary files a/Bin/DocumentFormat.OpenXml.dll and b/Bin/DocumentFormat.OpenXml.dll differ
diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx
index 68f11940b..6644f7db1 100644
--- a/Compras/eFacturas.aspx
+++ b/Compras/eFacturas.aspx
@@ -570,6 +570,13 @@