This commit is contained in:
rrene
2020-10-08 18:20:31 -07:00
parent 9086d7ac28
commit df8932c7e7

View File

@@ -20,7 +20,7 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyecto, "")
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "")
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "")
@@ -342,31 +342,31 @@ Partial Class Bancos_FluctuacionCambiaria
Dim CveConconceptoCliente As Integer = 203
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvVentas.Rows
Total = -gvr.DataKey("Fluctuacion").ToDecimal
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
CveConconceptoCliente = 226
Else
CveConconceptoCliente = 203
End If
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
Next
If Not ErrorRegistrar Then
Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvVentas.Rows
Total = -gvr.DataKey("Fluctuacion").ToDecimal
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
CveConconceptoCliente = 226
Else
Conta.RollBack()
CveConconceptoCliente = 203
End If
Conta.Dispose()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
Next
If Not ErrorRegistrar Then
Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
End If
Conta.Dispose()
End Sub
#End Region