Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -8821,7 +8821,7 @@ Partial Class Ventas
|
||||
|
||||
|
||||
'CONTABILIDAD AUTOMATICA Y AC
|
||||
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjContPaq.IniciaTransacSQL()
|
||||
End If
|
||||
@@ -19734,46 +19734,53 @@ Partial Class Ventas
|
||||
|
||||
End Sub
|
||||
Private Sub EliminaPoliza()
|
||||
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
ObjConta.IniciaTransacSQL()
|
||||
|
||||
Dim ErrorMovimiento = False
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
|
||||
'Elimina la poliza
|
||||
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IdPoliza > 0 Then
|
||||
If Not ObjAC.RemovePoliza(IdPoliza) Then
|
||||
ErrorMovimiento = True
|
||||
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
ObjConta.IniciaTransacSQL()
|
||||
|
||||
Dim ErrorMovimiento = False
|
||||
|
||||
'Elimina la poliza
|
||||
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IdPoliza > 0 Then
|
||||
If Not ObjAC.RemovePoliza(IdPoliza) Then
|
||||
ErrorMovimiento = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'Desasocia la poliza
|
||||
If Not ErrorMovimiento Then
|
||||
If Not ObjConta.DesasociarPoliza(IdPoliza, UsuarioActual.CveEmpresa) Then
|
||||
ErrorMovimiento = True
|
||||
'Desasocia la poliza
|
||||
If Not ErrorMovimiento Then
|
||||
If Not ObjConta.DesasociarPoliza(IdPoliza, UsuarioActual.CveEmpresa) Then
|
||||
ErrorMovimiento = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorMovimiento Then
|
||||
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||
ErrorMovimiento = True
|
||||
If Not ErrorMovimiento Then
|
||||
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||
ErrorMovimiento = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ErrorMovimiento Then
|
||||
Alert("La póliza ha sido desvinculada y eliminada con éxito.", TipoMensaje.MsgInformacion)
|
||||
ObjAC.Commit()
|
||||
ObjConta.Commit()
|
||||
BtnDescontabilizar.Visible = False
|
||||
Else
|
||||
Alert("Ocurrió un error al desvincular y/o eliminar la póliza. Por favor intente de nuevo ", TipoMensaje.MsgError)
|
||||
ObjAC.RollBack()
|
||||
ObjConta.RollBack()
|
||||
End If
|
||||
|
||||
ObjAC.Dispose()
|
||||
ObjConta.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If Not ErrorMovimiento Then
|
||||
Alert("La póliza ha sido desvinculada y eliminada con éxito.", TipoMensaje.MsgInformacion)
|
||||
ObjAC.Commit()
|
||||
ObjConta.Commit()
|
||||
BtnDescontabilizar.Visible = False
|
||||
Else
|
||||
Alert("Ocurrió un error al desvincular y/o eliminar la póliza. Por favor intente de nuevo ", TipoMensaje.MsgError)
|
||||
ObjAC.RollBack()
|
||||
ObjConta.RollBack()
|
||||
End If
|
||||
|
||||
ObjAC.Dispose()
|
||||
ObjConta.Dispose()
|
||||
|
||||
End Sub
|
||||
Protected Sub DdlPS_SelectedIndexChanged1(sender As Object, e As EventArgs)
|
||||
@@ -22674,7 +22681,7 @@ Partial Class Ventas
|
||||
|
||||
CreaObjetosVenta()
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
|
||||
@@ -34070,7 +34077,7 @@ Partial Class Ventas
|
||||
DVRegimenSociedad.Visible = False
|
||||
DivRazonSocial2.Attributes.Add("class", "col-md-12")
|
||||
|
||||
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
|
||||
|
||||
DivRazonSocial2.Attributes.Add("class", "col-md-8")
|
||||
DVRegimenSociedad.Visible = True
|
||||
@@ -34534,35 +34541,42 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub BtnGenerarPoliza_Click(sender As Object, e As EventArgs)
|
||||
CreaObjetosVenta()
|
||||
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
Dim Msgok As New StringBuilder
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
|
||||
|
||||
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFactura)
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
|
||||
If IDPoliza.IdPoliza > 0 Then
|
||||
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
Dim Msgok As New StringBuilder
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFactura)
|
||||
|
||||
If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, CvePrePoliza, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
If IDPoliza.IdPoliza > 0 Then
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, CvePrePoliza, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
'Si se facturó la cotización hay que vincular la venta
|
||||
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'Si se facturó la cotización hay que vincular la venta
|
||||
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
|
||||
|
||||
Else
|
||||
ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
'Si se facturó la cotización hay que vincular la venta
|
||||
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
|
||||
|
||||
Else
|
||||
ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
|
||||
End If
|
||||
ObjAC.Dispose()
|
||||
|
||||
Else
|
||||
Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
|
||||
End If
|
||||
ObjAC.dispose
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user