option strict on
This commit is contained in:
@@ -15936,7 +15936,6 @@ Partial Class Ventas
|
||||
Dim ObjVenta As New ClsVentas(ObjConta.IniciaTransacSQL())
|
||||
Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL())
|
||||
Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL())
|
||||
Dim ObjContpaq As ClsContPAQi = Nothing
|
||||
|
||||
Dim CvePrePoliza As Integer
|
||||
Dim ErrorConta As Boolean
|
||||
@@ -16157,7 +16156,6 @@ Partial Class Ventas
|
||||
If ErrorConta Then
|
||||
Alert("Ocurrió un error al amortizar el documento. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgError)
|
||||
ObjConta.RollBack()
|
||||
If ObjContpaq IsNot Nothing Then ObjContpaq.RollBack()
|
||||
Else
|
||||
Dim Msg As New StringBuilder
|
||||
Msg.Append("Se ha amortizado correctamente")
|
||||
@@ -16169,11 +16167,7 @@ Partial Class Ventas
|
||||
|
||||
ObjConta.Commit()
|
||||
BtnAceptarAnticipos.Enabled = False
|
||||
If ObjContpaq IsNot Nothing Then
|
||||
|
||||
ObjContpaq.AjustaPoliza(ContaIdPoliza)
|
||||
ObjContpaq.Commit()
|
||||
End If
|
||||
Alert(Msg.ToString(), TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
@@ -19842,50 +19836,50 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Private Sub EliminaPoliza()
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
'If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||
|
||||
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjAC.IniciaTransacSQL()
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
ObjConta.IniciaTransacSQL()
|
||||
' Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
' ObjAC.IniciaTransacSQL()
|
||||
' Dim ObjConta As New ClsContabilidad
|
||||
' ObjConta.IniciaTransacSQL()
|
||||
|
||||
Dim ErrorMovimiento = False
|
||||
' Dim ErrorMovimiento = False
|
||||
|
||||
'Elimina la poliza
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IdPoliza > 0 Then
|
||||
If Not ObjAC.RemovePoliza(IdPoliza) Then
|
||||
ErrorMovimiento = True
|
||||
End If
|
||||
End If
|
||||
' 'Elimina la poliza
|
||||
' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.UsaContabilidad) AndAlso IdPoliza > 0 Then
|
||||
' If Not ObjAC.RemovePoliza(IdPoliza) Then
|
||||
' ErrorMovimiento = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
'Desasocia la poliza
|
||||
If Not ErrorMovimiento Then
|
||||
If Not ObjConta.DesasociarPoliza(IdPoliza, UsuarioActual.CveEmpresa) Then
|
||||
ErrorMovimiento = True
|
||||
End If
|
||||
End If
|
||||
' 'Desasocia la poliza
|
||||
' If Not ErrorMovimiento Then
|
||||
' If Not ObjConta.DesasociarPoliza(IdPoliza, UsuarioActual.CveEmpresa) Then
|
||||
' ErrorMovimiento = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
If Not ErrorMovimiento Then
|
||||
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||
ErrorMovimiento = True
|
||||
End If
|
||||
End If
|
||||
' 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
|
||||
' 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()
|
||||
' ObjAC.Dispose()
|
||||
' ObjConta.Dispose()
|
||||
|
||||
End If
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
@@ -20196,7 +20190,7 @@ Partial Class Ventas
|
||||
Return Not OcurrioError
|
||||
End Function
|
||||
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = True,
|
||||
Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing,
|
||||
Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False,
|
||||
Optional CveAlmacenDestino As Integer = -1) As Integer
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim ContadorMovtosDetalles = 0
|
||||
@@ -21491,7 +21485,6 @@ Partial Class Ventas
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
|
||||
Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero()
|
||||
Dim TipoCambio As Double = TxtTipoCambio.Text.ToDouble
|
||||
@@ -21649,7 +21642,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
If RegeneracionPolizas(ObjVentas, ObjAC, ObjConta, ObjBancos) Then
|
||||
If RegeneracionPolizas(ObjVentas, ObjConta, ObjBancos) Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
@@ -21673,14 +21666,12 @@ Partial Class Ventas
|
||||
Alert("Ocurrió un error al guardar los cambios. Por favor intente de nuevo.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjVentas.Commit()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjBancos.Dispose()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
|
||||
'REGENERAR EL PDF
|
||||
If Not OcurrioError Then
|
||||
@@ -23050,16 +23041,16 @@ Partial Class Ventas
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos) As Boolean
|
||||
Private Function RegeneracionPolizas(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos) As Boolean
|
||||
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
Dim Mensaje As String = ""
|
||||
|
||||
CreaObjetosVenta()
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
|
||||
' ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
'End If
|
||||
|
||||
'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
|
||||
ErrorCancelar = Not ObjConta.RemovePrePolizasDetalle(CvePrePoliza, -1, CveVenta, 2)
|
||||
|
||||
Reference in New Issue
Block a user