diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index ef3b2d0a4..ea02be437 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2856,17 +2856,35 @@ Public Class ClsPaginas
End Set
End Property
- Property GlobalDTRHPersonal(CveEmpresa As Integer) As DataTable
+ Property GlobalDTRHPersonal(CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As DataTable
+
Get
- Dim ObjPersonal As New ClsRH
- ObjPersonal.GetPersonal(-1, CveEmpresa)
- GlobalDTRHPersonal = ObjPersonal.DtResultados
- ObjPersonal.Dispose()
+ Dim AppNombre As String = String.Format("GlobalDTRHPersonal{0}", CveEmpresa)
+ 'sino existe, recarga los datos
+ If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
+ Dim ObjPersonal As New ClsRH
+ If ObjPersonal.GetPersonal(-1, CveEmpresa) Then Application(AppNombre) = ObjPersonal.DtResultados
+ ObjPersonal.Dispose()
+ End If
+
+ If CveEmpresa <> -1 Or CvePersonal <> -1 Then
+ Dim Str As StringBuilder = New StringBuilder()
+ If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
+ If CvePersonal <> -1 Then Str.AppendFormat(" {0} CvePersonal = {1}", If(Str.Length > 0, "AND", ""), CvePersonal)
+
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
+ GlobalDTRHPersonal = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTRHPersonal = DirectCast(Application(AppNombre), DataTable)
+ End If
End Get
Set(value As DataTable)
- Application("GlobalDTRHPersonal") = value
- End Set
+ Dim AppNombre As String = String.Format("GlobalDTRHPersonal{0}", CveEmpresa)
+ Application(AppNombre) = value
+ End Set
+
End Property
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 5e5e7fc56..9a0fd3c83 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -417,7 +417,7 @@ Public Class ClsVentas
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") And Ex1.Message.Contains("UK_Ventas_TipoDocto_Serie_Folio_CveSubProyecto") Then
Alert(String.Format("el Folio '{0}' ya se encuentra registrado", FolioFact), TipoMensaje.MsgAdvertencia)
- GuardaLog(String.Format("el folio ya se encuentra registrado {0}", Ex1.Message))
+ GuardaLog(String.Format("el folio ya se encuentra registrado {0} {1}", Ex1.Message, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
Else
Me.OnError("Ocurrió un error al Guardar la Venta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb
index db600b31e..1a77fd005 100644
--- a/Bancos/PopIEVentas.aspx.vb
+++ b/Bancos/PopIEVentas.aspx.vb
@@ -2305,7 +2305,8 @@ Partial Class Bancos_PopIEVentas
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = tipoCambioPago
CveSubProyectoContabilizar = CveSubProyectoVenta
-
+ Dim Id As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal).FiltroPrimeroValor("IdCtaContPersonal").ToEntero
+ IdCtaContable =
Else
ImporteMovimiento = 0
End If
diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx
index fc548e4f3..353a1cc8d 100644
--- a/Inventarios/RecepcionUsados.aspx
+++ b/Inventarios/RecepcionUsados.aspx
@@ -138,10 +138,8 @@
+
+
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 34968bd47..9746d17c4 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -191,6 +191,11 @@ Partial Class Inventarios_TraspasoAlmacen
Folio = 0
CveMovimientoTimbrado = -1
+ If UsuarioActual.CveEmpresa = 119 Then
+ divGastoIndirecto.Visible = False
+ divResponsable.Visible = False
+ End If
+
CargaCombos()
CreaDT()
@@ -211,7 +216,7 @@ Partial Class Inventarios_TraspasoAlmacen
End If
If ChkTransitorio.Checked Then RegistraScript("$('#DivTransitorio').show(0);$('#DivGastoIndirecto').show(0);$('#DivDocChofer').show(0);")
- If UsuarioActual.CveEmpresa.Contiene(1, 119) Then DivEmiirTimbrado.Visible = True
+ If UsuarioActual.CveEmpresa.Contiene(1, 119) Then DivEmitirTimbrado.Visible = True
CantidadTotal = 0
IndexSeccionAlmacen = 0
@@ -387,11 +392,11 @@ Partial Class Inventarios_TraspasoAlmacen
'Llena Choferes
Dim ObjAcar As New ClsAcarreos()
If ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1) Then
- DldChofer.DataSource = ObjAcar.DtResultados
- DldChofer.DataBind()
+ DdlChofer.DataSource = ObjAcar.DtResultados
+ DdlChofer.DataBind()
End If
ObjAcar.Dispose()
- DldChofer.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ DdlChofer.Items.Insert(0, New ListItem("Seleccione", "-1"))
TxtFechaEntrega.Text = Now.ToShortDateString
'Llena Responsables Transitorio
@@ -766,7 +771,7 @@ Partial Class Inventarios_TraspasoAlmacen
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
CveAlmacenDestino:=DdlAlmacenDestino.SelectedValue.ToEntero, GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble,
- CveChofer:=If(ChkTransitorio.Checked, DldChofer.SelectedValue.ToEntero, -1), Placa:=If(ChkTransitorio.Checked, TxtPlaca.Text.Trim, "-1"), FechaEntrega:=If(ChkTransitorio.Checked, TxtFechaEntrega.Text.Trim.ToDateTime.ToString("dd/MM/yyyy"), "-1"), EspecifUnidad:=If(ChkTransitorio.Checked, TxtEspecifUnidad.Text.Trim, "-1"),
+ CveChofer:=If(ChkTransitorio.Checked, DdlChofer.SelectedValue.ToEntero, -1), Placa:=If(ChkTransitorio.Checked, TxtPlaca.Text.Trim, "-1"), FechaEntrega:=If(ChkTransitorio.Checked, TxtFechaEntrega.Text.Trim.ToDateTime.ToString("dd/MM/yyyy"), "-1"), EspecifUnidad:=If(ChkTransitorio.Checked, TxtEspecifUnidad.Text.Trim, "-1"),
ResponsableCarga:=If(ChkTransitorio.Checked, TxtResponsableCarga.Text.Trim, "-1"), ResponsableRecibio:=If(ChkTransitorio.Checked, TxtResponsableRecibio.Text.Trim, "-1"), Identificacion:=If(ChkTransitorio.Checked, TxtIdentificacion.Text.Trim, "-1"), Domicilio:=If(ChkTransitorio.Checked, TxtDomicilio.Text.Trim, "-1"),
Telefono:=If(ChkTransitorio.Checked, TxtTelefono.Text.Trim, "-1"), Ciudad:=If(ChkTransitorio.Checked, TxtCiudad.Text.Trim, "-1"), Licencia:=If(ChkTransitorio.Checked, TxtLicencia.Text.Trim, "-1"), Modulo:="TA/G")
FolioSalida = ObjInventario.Folio
@@ -2550,9 +2555,10 @@ Partial Class Inventarios_TraspasoAlmacen
Protected Sub DldChofer_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjAcar As New ClsAcarreos()
- If ObjAcar.GetChofer(DldChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1, -1) Then
+ If ObjAcar.GetChofer(DdlChofer.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1, -1) Then
Dim dr As DataRow = ObjAcar.DtResultados.Rows(0)
If dr IsNot Nothing Then
+ TxtResponsableRecibio.Text = dr("Chofer").ToString
TxtIdentificacion.Text = dr("Identificacion").ToString
TxtDomicilio.Text = dr("Domicilio").ToString
TxtTelefono.Text = dr("Telefono").ToString
@@ -2780,11 +2786,13 @@ Partial Class Inventarios_TraspasoAlmacen
End Function
Public Sub CargarCamiones()
+ DdlUnidadCamion.Items.Clear
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
DdlUnidadCamion.DataSource = ObjInventarios.DtResultados
End If
ObjInventarios.Dispose()
+ DdlUnidadCamion.Items.Insert(0, New ListItem("Otro", "-1"))
DdlUnidadCamion.DataBind()
End Sub
Public Sub BtnAgregarCamion_Click(sender As Object, e As EventArgs) Handles BtnAgregarCamion.Click
@@ -2797,4 +2805,14 @@ Partial Class Inventarios_TraspasoAlmacen
End If
ObjInventarios.Dispose()
End Sub
+
+ Private Sub DdlUnidadCamion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlUnidadCamion.SelectedIndexChanged
+ If DdlUnidadCamion.SelectedValue = "-1" Then
+ divPlacaEspecificacion.Visible = True
+ Else
+ divPlacaEspecificacion.Visible = False
+ TxtPlaca.Text = ""
+ TxtEspecifUnidad.Text = ""
+ End If
+ End Sub
End Class
diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb
index ea507a6fc..cdd548637 100644
--- a/Sistemas/CatSesiones.aspx.vb
+++ b/Sistemas/CatSesiones.aspx.vb
@@ -114,7 +114,7 @@ Partial Class Sistemas_CatSesiones
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, -1) Then Application("GlobalDTContratos") = ObjContratos.DtResultados Else Application("GlobalDTContratos") = Nothing
If ObjContratos.GetSecciones() Then Application("GlobalDTContratosSecciones") = ObjContratos.DtResultados Else Application("GlobalDTContratosSecciones") = Nothing
- If ObjContratos.GetContratosTipos() Then Application("GlobalDTContratosTipos") = ObjContratos.DtResultados Else Application("GlobalDTContratosTipos") = Nothing
+ 'If ObjContratos.GetContratosTipos() Then Application("GlobalDTContratosTipos") = ObjContratos.DtResultados Else Application("GlobalDTContratosTipos") = Nothing
ObjContratos.Dispose()
End Sub
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index fd3dfa963..08654a17d 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -3489,7 +3489,7 @@ Partial Class PV
Return Retorno
End Function
- Private Function ValidaAgregarPS(CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer) As Boolean 'NO TOCAR - IPP
+ Private Function ValidaAgregarPS(CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, Cantidad As Decimal) As Boolean 'NO TOCAR - IPP
'VALIDA PARAMETROS
If CvePS <= 0 Or CveUM <= 0 Then
@@ -3540,7 +3540,7 @@ Partial Class PV
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DTTamanios.Rows.Count > 0 And DTTamanios IsNot Nothing And DrPS("CveTamaño").ToString.ToEntero > 0 Then
- Vendido = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { DrPS("CveTamaño") }").ToDecimal
+ Vendido = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { DrPS("CveTamaño") }").ToDecimal * Cantidad
End If
If Entregado > Vendido Then
@@ -3772,7 +3772,7 @@ Partial Class PV
CvePS = DdlPS.SelectedValue.ToEntero
'End If
- If ValidaAgregarPS(CvePS, DdlUnidadMedida.SelectedValue.ToEntero, TxtPrecio.Text.Trim.ToDouble, HdnTipoPS.Value.ToEntero) Then
+ If ValidaAgregarPS(CvePS, DdlUnidadMedida.SelectedValue.ToEntero, TxtPrecio.Text.Trim.ToDouble, HdnTipoPS.Value.ToEntero, TxtCantidad.Text.ToDecimal) Then
If UsuarioActual.Empresa.Funcionalidad(507) = DdlPS.SelectedValue Then
CvePSAmortizacion = DdlPS.SelectedValue.ToEntero.ToEntero
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 0aa1188a9..2b27161f4 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5798,9 +5798,9 @@ Partial Class Ventas
Dim objPS As New ClsProductosServicios
If objPS.GetPSSucursalesALL(CvePS, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then
PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal
- If PrecioMinimo > 0 Then
- Costo = PrecioMinimo
- End If
+ 'If PrecioMinimo > 0 Then
+ ' Costo = PrecioMinimo
+ 'End If
End If
objPS.Dispose()
@@ -5827,12 +5827,18 @@ Partial Class Ventas
'PRECIO MINIMO
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
- CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
- If PrecioMinimo > 0 Then CostoMenor = PrecioMinimo
-
- 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
- If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
- EsValido = True
+ '' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo
+ If PrecioMinimo > 0 Then
+ 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ If PU >= PrecioMinimo Then ' aqui se comparar los importes directos, sin el TC
+ EsValido = True
+ End If
+ Else
+ CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
+ 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
+ EsValido = True
+ End If
End If
Else
EsValido = True
@@ -6414,21 +6420,28 @@ Partial Class Ventas
Dim objPS As New ClsProductosServicios
If objPS.GetPSSucursalesALL(dr("CvePS").ToString.ToEntero, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then
PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal
- If PrecioMinimo > 0 Then
- Costo = PrecioMinimo
- End If
+ 'If PrecioMinimo > 0 Then
+ ' Costo = PrecioMinimo
+ 'End If
End If
objPS.Dispose()
End If
- 'COSTO ALMACEN
+ 'PRECIO MINIMO
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
- CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
- 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
- If PrecioMinimo > 0 Then CostoMenor = PrecioMinimo
- If Math.Round(PU, 4) >= Math.Round(CostoMenor, 4) Then
- EsValido = True
+ '' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo
+ If PrecioMinimo > 0 Then
+ 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ If PU >= PrecioMinimo Then ' aqui se comparar los importes directos, sin el TC
+ EsValido = True
+ End If
+ Else
+ CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
+ 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
+ EsValido = True
+ End If
End If
Else
EsValido = True
@@ -13760,9 +13773,9 @@ Partial Class Ventas
Dim objPS As New ClsProductosServicios
If objPS.GetPSSucursalesALL(CvePS, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Then
PrecioMinimo = objPS.DtResultados.FiltroPrimeroValor("PrecioMinimo", "").ToDecimal
- If PrecioMinimo > 0 Then
- Costo = PrecioMinimo
- End If
+ 'If PrecioMinimo > 0 Then
+ ' Costo = PrecioMinimo
+ 'End If
End If
objPS.Dispose()
@@ -13784,17 +13797,23 @@ Partial Class Ventas
'BANDERAS PARA VALIDACIONES
Dim EsValido = False
Dim EsValidoMayor = False
- Dim CostoMenor = 0.0D
- Dim CostoMayor = 0.0D
+ Dim CostoMenor As Decimal = 0.0D
+ Dim CostoMayor As Decimal = 0.0D
'PRECIO MINIMO
If UsuarioActual.Empresa.Funcionalidad(129).ToEntero > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
- CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
- If PrecioMinimo > 0 Then CostoMenor = PrecioMinimo
-
- 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
- If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
- EsValido = True
+ '' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo
+ If PrecioMinimo > 0 Then
+ 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ If PU >= PrecioMinimo Then ' aqui se comparar los importes directos, sin el TC
+ EsValido = True
+ End If
+ Else
+ CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo)
+ 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ If PU * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then
+ EsValido = True
+ End If
End If
Else
EsValido = True