Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2117,6 +2117,26 @@ Public Class ClsCompras
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function CancelarCompraOC(CveCompra As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Comp_CancelarCompraOC")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al desvincular la oc de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -3,7 +3,6 @@ Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Web
|
||||
Imports Extensiones
|
||||
|
||||
Public Class ClsContabilidad
|
||||
@@ -6416,6 +6415,47 @@ Public Class ClsContabilidad
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function ValidacionesPrePoliza(CvePrePoliza As Integer, Opcion As Integer, ByRef UsuarioActual As Usuario, Optional CveVenta As Integer = -1, Optional AutoConta As Boolean = True) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_PrePolizasValidacion")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = UsuarioActual.CveEmpresa
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@AutoConta", SqlDbType.Int).Value = If(AutoConta, 1, 0)
|
||||
.Add("@Valor", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@MsgSalida", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output
|
||||
.Add("@MsgPrePolizaSalida", SqlDbType.VarChar, 8000).Direction = ParameterDirection.Output
|
||||
.Add("@Diferencia", SqlDbType.Float).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
ValorPolizaDescuadre = SqlAdapter.SelectCommand.Parameters("@Valor").Value.ToString.ToEntero
|
||||
MensajePolizaDescuadre = SqlAdapter.SelectCommand.Parameters("@MsgSalida").Value.ToString
|
||||
ValorDiferencia = SqlAdapter.SelectCommand.Parameters("@Diferencia").Value.ToString
|
||||
Dim MsgPrePoliza As String = SqlAdapter.SelectCommand.Parameters("@MsgPrePolizaSalida").Value.ToString
|
||||
If MsgPrePoliza <> "" Then MsgPrePoliza.GuardaLogAD("LogPrePoliza")
|
||||
|
||||
If MensajePolizaDescuadre = "" AndAlso AutoConta Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then ' eltipocontabilidad deberá activarse en el PA
|
||||
If Not ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
MensajePolizaDescuadre = Mensaje.ToString ' regresa el mensaje de contabilización
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al validar la PrePoliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "AUXILIAR PREPOLIZAS"
|
||||
|
||||
@@ -4311,6 +4311,11 @@ Public Class ClsPaginas
|
||||
' Response.Redirect("/Sistemas/PopUpSeleccionarEmpresa.aspx")
|
||||
' 'Alert(Request.ServerVariables("URL"))
|
||||
'End If
|
||||
''codigo temporal
|
||||
If EsProduccion Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 166) Then System.Threading.Thread.Sleep(750)
|
||||
End If
|
||||
|
||||
Dim i As Integer = Obt_ClavePagina(Request.ServerVariables("URL"))
|
||||
Dim FailURL As String = $"{FormsAuthentication.DefaultUrl}?ADCod={Encripta($"CveModulo={i}")}"
|
||||
'si es <0 la página es sin restricciones
|
||||
|
||||
@@ -1556,7 +1556,7 @@ Partial Class Bancos_PopIECompras
|
||||
Pago.CveIE = rw.DataKey("CveIE").ToEntero
|
||||
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
|
||||
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
|
||||
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
|
||||
Pago.TCPago = If(Pago.CveMonedaPago <> 1, TxtTipoCambio.Text.ToDecimal, 1)
|
||||
Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero
|
||||
Pago.TipoPago = "Egsc"
|
||||
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then
|
||||
|
||||
@@ -13963,6 +13963,12 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If Not ObjCompras.CancelarCompraOC(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'CANCELA COMPRA
|
||||
If Not ErrorCancelar Then
|
||||
|
||||
Reference in New Issue
Block a user