-- desaplicar NC, compras
This commit is contained in:
@@ -219,6 +219,16 @@ Partial Class PopUpAuxiliar
|
|||||||
Else
|
Else
|
||||||
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveVentaAmortizacion"), e.Row.DBCampo("CveVenta"))
|
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveVentaAmortizacion"), e.Row.DBCampo("CveVenta"))
|
||||||
End If
|
End If
|
||||||
|
ElseIf e.Row.DBCampo("CveConceptoContable").Contiene("60", "272") Then 'desaplicar NC Compra
|
||||||
|
|
||||||
|
e.Row.FCLinkButton("LnkDesAplicar").Visible = True
|
||||||
|
e.Row.FCLinkButton("LnkDesAplicar").CommandName = "DesAplicarCompra"
|
||||||
|
e.Row.FCLinkButton("imgD").Visible = False
|
||||||
|
If e.Row.DBCampo("CveConceptoContable").Contiene("272") Then
|
||||||
|
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompra"), e.Row.DBCampo("CveCompraAmortizacion"))
|
||||||
|
Else
|
||||||
|
e.Row.FCLinkButton("LnkDesAplicar").CommandArgument = String.Format("{0}|{1}|{2}", e.Row.DBCampo("CvePrePoliza"), e.Row.DBCampo("CveCompraAmortizacion"), e.Row.DBCampo("CveCompra"))
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
|
If e.Row.DBCampo("TipoReferencia").ToEntero = 1 Then
|
||||||
@@ -387,7 +397,6 @@ Partial Class PopUpAuxiliar
|
|||||||
Else
|
Else
|
||||||
Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
|
Return ViewState("CvePrePolizaNegativa").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
ViewState("CvePrePolizaNegativa") = value
|
ViewState("CvePrePolizaNegativa") = value
|
||||||
@@ -395,7 +404,6 @@ Partial Class PopUpAuxiliar
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub AgregaPolizaNegativo(CvePrePoliza As Integer)
|
Private Sub AgregaPolizaNegativo(CvePrePoliza As Integer)
|
||||||
|
|
||||||
Dim ObjContabilidad As New ClsContabilidad
|
Dim ObjContabilidad As New ClsContabilidad
|
||||||
@@ -405,8 +413,6 @@ Partial Class PopUpAuxiliar
|
|||||||
Dim CvePrePolizaNueva As Integer = ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate)
|
Dim CvePrePolizaNueva As Integer = ObjContabilidad.AddPrePolizasNegativa(CvePrePoliza, UsuarioActual.CveUsuario, TxtConceptoCancelacion.Text, UsuarioActual.CveEmpresa, TxtFechaCancelacion.Text.ToDate)
|
||||||
|
|
||||||
If Not CvePrePolizaNueva > 0 Then
|
If Not CvePrePolizaNueva > 0 Then
|
||||||
|
|
||||||
|
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -482,6 +488,40 @@ Partial Class PopUpAuxiliar
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If e.CommandName = "DesAplicarCompra" Then
|
||||||
|
|
||||||
|
Dim CvePrePoliza, CveCompra, CveCompraAmortizacion As Integer
|
||||||
|
Dim TieneError = False
|
||||||
|
|
||||||
|
Dim St As String() = e.CommandArgument.ToString.Split("|"c)
|
||||||
|
If St.Length > 0 Then
|
||||||
|
CvePrePoliza = St(0).ToEntero
|
||||||
|
CveCompra = St(1).ToEntero
|
||||||
|
CveCompraAmortizacion = St(2).ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CvePrePoliza > 0 Then
|
||||||
|
Dim Conta As New ClsContabilidad()
|
||||||
|
Conta.IniciaTransacSQL()
|
||||||
|
|
||||||
|
If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not TieneError AndAlso Not Conta.DesAplicarPago(CvePrePoliza, 272, CveCompra, CveCompraAmortizacion) Then
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not TieneError Then
|
||||||
|
Conta.Commit()
|
||||||
|
Alert("Pago Desaplicado.", TipoMensaje.ToastInformacion)
|
||||||
|
Else
|
||||||
|
Conta.RollBack()
|
||||||
|
Alert("Pago no fue desaplicado.", TipoMensaje.ToastError)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user