-
This commit is contained in:
@@ -171,7 +171,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
||||||
Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS"))
|
Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -190,14 +190,17 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
|
|
||||||
Dim dt As DataTable = Nothing
|
Dim dt As DataTable = Nothing
|
||||||
' If UsuarioActual.Empresa.UsaContabilidad Then
|
' If UsuarioActual.Empresa.UsaContabilidad Then
|
||||||
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
|
Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
|
||||||
If Conta.GetCuentas(-1, "-1", 1) Then
|
If Conta.GetCuentas(-1, "-1", 1) Then
|
||||||
dt = Conta.DtResultados
|
dt = Conta.DtResultados
|
||||||
DtCuentasContables = Conta.DtResultados
|
DtCuentasContables = Conta.DtResultados
|
||||||
Session("DtCuentas") = Conta.DtResultados
|
Session("DtCuentas") = Conta.DtResultados
|
||||||
|
End If
|
||||||
|
Conta.Dispose()
|
||||||
End If
|
End If
|
||||||
Conta.Dispose()
|
|
||||||
|
|
||||||
If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then
|
If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then
|
||||||
DivTipoGasto.Visible = True
|
DivTipoGasto.Visible = True
|
||||||
@@ -949,24 +952,9 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
'El movimiento 2 es el de Pago
|
|
||||||
If ChkAutoConta.Checked AndAlso MsgError = "" Or UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
|
|
||||||
If idCuentaContabilizacion > 0 Then
|
|
||||||
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
|
||||||
|
|
||||||
'MENSAJE PRINCIPAL
|
|
||||||
MensajeAlert.AppendFormat("<br/><br/>Folio de Salida: <b><a href = ""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
|
|
||||||
MensajeAlert.AppendFormat("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, ObjMov.ContaFolio)
|
|
||||||
'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion)
|
|
||||||
Else
|
|
||||||
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas")
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If CvePeriodo > 0 Then
|
If CvePeriodo > 0 Then
|
||||||
If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
MsgError = "No se pudo actualizar el periodo de la nómina"
|
MsgError = "No se pudo actualizar el periodo de la nómina"
|
||||||
@@ -978,6 +966,23 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
MsgError = ObjMov.MensajePolizaDescuadre & "-"
|
MsgError = ObjMov.MensajePolizaDescuadre & "-"
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'El movimiento 2 es el de Pago
|
||||||
|
If ChkAutoConta.Checked AndAlso MsgError = "" Or UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
|
||||||
|
If idCuentaContabilizacion > 0 Then
|
||||||
|
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||||
|
|
||||||
|
'MENSAJE PRINCIPAL
|
||||||
|
MensajeAlert.AppendFormat("<br/><br/>Folio de Póliza: <b><a href = ""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
|
||||||
|
MensajeAlert.AppendFormat("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, ObjMov.ContaFolio)
|
||||||
|
'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion)
|
||||||
|
Else
|
||||||
|
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -1003,14 +1008,16 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
'TxtFecha.Text = ""
|
'TxtFecha.Text = ""
|
||||||
'TxtObservaciones.Text = ""
|
'TxtObservaciones.Text = ""
|
||||||
Else
|
Else
|
||||||
|
MsgError.GuardaLogAD()
|
||||||
ObjIE.RollBack()
|
ObjIE.RollBack()
|
||||||
If Conta IsNot Nothing Then Conta.RollBack()
|
If Conta IsNot Nothing Then Conta.RollBack()
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
ex.GuardaLog(ex.Message)
|
||||||
ObjIE.RollBack()
|
ObjIE.RollBack()
|
||||||
If Conta IsNot Nothing Then Conta.RollBack()
|
If Conta IsNot Nothing Then Conta.RollBack()
|
||||||
Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgInformacion)
|
Alert("Ocurrio un error al registrar el movimiento", TipoMensaje.MsgInformacion)
|
||||||
ex.GuardaLog(ex.Message)
|
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user