diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 81d5750b4..ba54c7715 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -933,6 +933,22 @@ Public Class ClsContabilidad Return Retorno End Function + Public Function UpdatePrePolizasDetalleBloquear(CvePrePoliza As Integer, Bloquear As Boolean) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Conta_PrePolizasDetalleBloquearUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza + .Add("@Bloquear", SqlDbType.Bit).Value = Bloquear + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al bloquear o desbloquear las prepolizas detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function ContabilizarPrePoliza(CvePrePoliza As Integer, CveUsuario As Integer, Empresa As Empresa, Optional Fecha As Date = MinFecha, Optional Concepto As String = "", @@ -981,6 +997,8 @@ Public Class ClsContabilidad End If + + Dim tIdPoliza As Integer Dim CveTipoPoliza, FolioFijo As Integer Dim Cargos As Decimal @@ -1260,6 +1278,12 @@ Public Class ClsContabilidad End If End If + If Not OcurrioError Then + If Not UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then + OcurrioError = True + End If + End If + 'If Empresa.Funcionalidad(522).ToString = "1" And Empresa.UsaContabilidad Then ' Dim CodigoPersona As String = "" diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 3c602a3b3..565044422 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -1712,6 +1712,13 @@ Partial Class RegPoliza ErrorTrans = True End If + If Not ErrorTrans Then + If Not ObjMov.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + ErrorTrans = True + End If + End If + + If Not ErrorTrans Then ObjConta.Commit() ObjMov.Commit()