@@ -313,8 +314,9 @@
-
-
+
+
+
@@ -363,6 +365,7 @@
+
@@ -385,8 +388,10 @@
+
+
diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb
index e6f1bf0f3..1855b24b4 100644
--- a/Bancos/FluctuacionCambiaria.aspx.vb
+++ b/Bancos/FluctuacionCambiaria.aspx.vb
@@ -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
@@ -117,6 +118,7 @@ Partial Class Bancos_FluctuacionCambiaria
LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero
LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero
LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero
+ LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia")
LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
@@ -249,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
@@ -266,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
@@ -274,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
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+
Else
Conta.RollBack()
End If
@@ -307,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
@@ -326,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
@@ -335,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
@@ -343,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
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+
Else
Conta.RollBack()
End If
@@ -431,7 +437,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar And SeContabilizo Then
Conta.Commit()
- Alert(String.Format("La Fluctuación se ha generado
Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion)
+ Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion)
CargaDatosCuentas()
Else
Conta.RollBack()
@@ -623,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
@@ -639,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
@@ -656,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
diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb
index 7539c52c7..c10e276d1 100644
--- a/Bancos/RepCxCCliente.aspx.vb
+++ b/Bancos/RepCxCCliente.aspx.vb
@@ -34,6 +34,7 @@ Partial Class Bancos_RepCxCCliente
'DdlSubProyecto.SelectedValueExist(UsuarioActual.CveSucursal.ToString)
'[IPP] 8 Enero 2018 - Se quito por que sera reemplazado al cargar solo los subproyectos del usuario
'If UsuarioActual.TienePermisoProceso(152) Then DdlSubProyecto.Enabled = False
+ If UsuarioActual.Sesion("CobroCliente-Sucursal").ToString <> "" Then DdlSubProyecto.SelectedValueExist(UsuarioActual.Sesion("CobroCliente-Sucursal").ToString.Trim)
InicializaPersonalizarColumnas()
@@ -57,6 +58,7 @@ Partial Class Bancos_RepCxCCliente
If Mov.GetCxCCliente(CveCliente, FechaI, FechaF, DdlMoneda.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
GvCxC.DataSource = Mov.DtResultados
End If
+ UsuarioActual.Sesion("CobroCliente-Sucursal") = DdlSubProyecto.SelectedValue
Mov.Dispose()
GvCxC.DataBind()
diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb
index 6d89b4c77..bde535395 100644
--- a/Compras/ReembolsosComprobaciones.aspx.vb
+++ b/Compras/ReembolsosComprobaciones.aspx.vb
@@ -517,7 +517,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
- CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
+ CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
'AGREGO PREPOLIZA IE BANCOS
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaIERegistrado, True, TxtImporte.Text.ToDecimal, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), 30, TxtObservaciones.Text, TxtFechaDocumento.Text.ToDate, IdCuentaBancaria, -1, CveIE:=CveIECajaChica, ImporteME:=If(tipoCambio = 1, 0, TxtImporte.Text.ToDecimal), ImporteMX:=TxtImporte.Text.ToDecimal * tipoCambio) Then
MsgError = "Error al registrar detalle de concepto bancario"
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
index c2f15499c..a3b1a02d3 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb
@@ -89,11 +89,17 @@ Partial Class Inventarios_Default
If dr IsNot Nothing Then
LtPs.Text = $"Producto:
{dr("PSCodigo").ToString}"
+ Dim CvePrecioLista As Integer = -1
+ If Not UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'sino manneja precios de lista
+ CvePrecioLista = -2
+ End If
+
Dim ObjVta As New ClsVentas
Dim objPS As New ClsProductosServicios
If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then
If ObjVta.DtResultados.Rows.Count > 0 Then
- If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero, -1, DDlPS.SelectedValue.ToEntero) Then
+ If CvePrecioLista = -1 Then CvePrecioLista = ObjVta.DtResultados.Rows(0)("CvePrecioLista").ToString.ToEntero
+ If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, -1, DDlPS.SelectedValue.ToEntero) Then
If objPS.DtResultados.Rows.Count > 0 Then
LtPrecioPS.Text = $"Precio de venta:
$: {objPS.DtResultados.Rows(0)("PrecioLista").ToString.FormatoNumero} {dr("Abreviatura").ToString}"
End If
diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx
index 71ed5c269..631f1dc2d 100644
--- a/Inventarios/RecepcionUsados.aspx
+++ b/Inventarios/RecepcionUsados.aspx
@@ -314,7 +314,7 @@