diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 75aaea0c6..6d374654f 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -4653,7 +4653,11 @@ Public Class ClsContabilidad Retorno = SqlAdapter.SelectCommand.Parameters("@CveCuenta").Value.ToString.ToEntero 'Retorno = If(Data IsNot Nothing AndAlso Data.Rows.Count > 0, Data.Rows(0)("CveCuenta").ToString.ToEntero, 0) Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + If Ex1.Message.Contains("IND_Conta_Cuentas_Codigo_CveEmpresa") Then + Me.OnError("No se puede registrar una cuenta ya existente", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al Guardar la cuenta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If Catch ex As Exception Me.OnError("Ocurrió un error al Guardar la cuenta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 92a134d6d..51ea90d65 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -3,6 +3,112 @@ + @@ -40,7 +146,7 @@
TC:
- +
@@ -59,6 +165,62 @@ + + +
+
+
+

PÉRDIDA

+
+ +
+ MXN + + + +
+
+
+
+
+
+

GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+

PÉRDIDA O GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+
@@ -81,6 +243,62 @@
+ + +
+
+
+

PÉRDIDA

+
+ +
+ MXN + + + +
+
+
+
+
+
+

GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+

PÉRDIDA O GANANCIA

+
+ +
+
+
+ MXN + + + +
+
+
+
+
+
+
+
+
@@ -115,9 +333,9 @@ EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - - - + + + @@ -140,10 +358,10 @@ + CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + @@ -152,7 +370,7 @@
-
+
@@ -187,7 +405,7 @@ CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> - + diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index ad9f24a9d..e6f1bf0f3 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -71,6 +71,20 @@ 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 PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") + + Dim Final As Double = GanaciaAux - PerdidaAux + + IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + + LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero + LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero + LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero + LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else GvCompras.DataSource = Nothing @@ -78,6 +92,7 @@ Partial Class Bancos_FluctuacionCambiaria End If ObjBancos.Dispose() GvCompras.DataBind() + UpIndicadores.Visible = True If GvCompras.Rows.Count > 0 Then GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2" End If @@ -88,7 +103,24 @@ Partial Class Bancos_FluctuacionCambiaria LblTotalVentas.Text = "0.00" If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then GvVentas.DataSource = ObjBancos.DtResultados + + 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 Final As Double = GanaciaAux - PerdidaAux + + IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + + LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero + LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero + LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero + LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + + UpIndicadoresVentas.Visible = True Else GvVentas.DataSource = Nothing Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)