- cmabios fluctuaci[on
- cxc, guarde sesion sucursal
This commit is contained in:
@@ -71,8 +71,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then
|
||||
GvCompras.DataSource = ObjBancos.DtResultados
|
||||
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
|
||||
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("GananciaPerdida = 'PERDIDA' AND TipoRow = 2")
|
||||
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("GananciaPerdida = 'GANANCIA' AND TipoRow = 2")
|
||||
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
|
||||
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ")
|
||||
|
||||
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs
|
||||
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
|
||||
@@ -84,6 +84,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero
|
||||
LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero
|
||||
LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
|
||||
LblComprasPerdidaGanancia.Text = If(Final > 0, "Ganancia", "Pérdida")
|
||||
|
||||
LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
|
||||
Else
|
||||
@@ -107,8 +108,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
|
||||
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0")
|
||||
|
||||
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs
|
||||
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
|
||||
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs
|
||||
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0")
|
||||
|
||||
Dim Final As Double = GanaciaAux - PerdidaAux
|
||||
|
||||
@@ -250,10 +251,12 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
CveConceptoContable = 64
|
||||
CveCuenta = CveCuentaGanancia
|
||||
idCta = IdCtaGanancia
|
||||
TipoMovto = True
|
||||
Else
|
||||
CveConceptoContable = 65
|
||||
CveCuenta = CveCuentaPerdida
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
ErrorRegistrar = True
|
||||
@@ -267,7 +270,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -275,7 +278,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion)
|
||||
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
|
||||
@@ -308,7 +312,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
|
||||
|
||||
Total = LblTotalVentas.Text.ToDecimal
|
||||
If Total < 0 Then
|
||||
If Total > 0 Then
|
||||
CveConceptoContable = 64
|
||||
CveCuenta = CveCuentaGanancia
|
||||
TipoMovto = True
|
||||
@@ -327,7 +331,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
'saco las cuentas de pérdida y ganancia
|
||||
For Each gvr As GridViewRow In GvVentas.Rows
|
||||
Total = gvr.DataKey("Fluctuacion").ToDecimal
|
||||
Total = -gvr.DataKey("Fluctuacion").ToDecimal
|
||||
|
||||
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
|
||||
CveConconceptoCliente = 226
|
||||
@@ -336,7 +340,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
End If
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, 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
|
||||
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
|
||||
@@ -344,7 +348,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
If Not ErrorRegistrar Then
|
||||
Conta.Commit()
|
||||
Alert("La Fluctuación se ha generado", TipoMensaje.MsgInformacion)
|
||||
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
|
||||
@@ -432,7 +437,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
If Not ErrorRegistrar And SeContabilizo Then
|
||||
|
||||
Conta.Commit()
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
CargaDatosCuentas()
|
||||
Else
|
||||
Conta.RollBack()
|
||||
@@ -624,8 +629,8 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Dim idCtaPerdida, IdCtaGanancia As Integer
|
||||
Dim TipoMovto As Boolean = False
|
||||
Dim CveConceptoContable As Integer = 0
|
||||
Dim CveCuentaComplementaria As Integer = 0
|
||||
Dim IdCtaComplementaria As Integer = 0
|
||||
Dim CveCuentaComplementaria As Integer = 55206
|
||||
Dim IdCtaComplementaria As Integer = 1081
|
||||
Dim ErrorRegistrar As Boolean = False
|
||||
|
||||
CveCuentaPerdida = 0 '55379
|
||||
@@ -640,10 +645,12 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
CveConceptoContable = 64
|
||||
CveCuenta = CveCuentaGanancia
|
||||
idCta = IdCtaGanancia
|
||||
TipoMovto = True
|
||||
Else
|
||||
CveConceptoContable = 65
|
||||
CveCuenta = CveCuentaPerdida
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
ErrorRegistrar = True
|
||||
@@ -657,7 +664,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
|
||||
'movimiento de complementaria
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
|
||||
ErrorRegistrar = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user