diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 49c81b77f..b4ce6e00d 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -1453,9 +1453,11 @@ Public Class ClsBancos
_Folio = SqlAdapter.SelectCommand.Parameters("@FolioRegistro").Value.ToString
Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then
+ If Ex1.Message.Contains("Número: 2627;") Then
Me.OnError("Ocurrió un error al Guardar el Movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ ElseIf Ex1.Message.Contains("Número: 2601;") Then
Alert("Ya existe un movimiento bancario con el mismo Folio: " & Folio & ".", TipoMensaje.MsgAdvertencia)
+ Me.OnError("Ocurrió un error al Guardar el Movimiento. Ya existe un movimiento bancario con el mismo Folio: " & Folio & ".", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al Guardar el Movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 826659d4d..283b294c0 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -1460,7 +1460,13 @@ Public Class ClsPaginas
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentasUsuarios(-1) Then
- Application(AppNombre) = ObjBancos.DtResultados
+
+ If CveEmpresa > 0 Then
+ Application(AppNombre) = ObjBancos.DtResultados.FiltraParametros($"CveEmpresa = { CveEmpresa }")
+ Else
+ Application(AppNombre) = ObjBancos.DtResultados
+ End If
+
Else
Application(AppNombre) = Nothing
End If
@@ -8073,7 +8079,7 @@ Public Class ClsPaginas
End Sub
#End Region
- Public Sub CargarCentrosDeCosto(DdlProyecto As DropDownList, DdlSubProyecto As DropDownList, LthProyectoP As Label, LblSubProyecto As Label)
+ Public Sub CargarCentrosDeCosto(DdlProyecto As DropDownList, DdlSubProyecto As DropDownList, LthProyectoP As Label, LblSubProyecto As Label, Optional AplicaTodos As String = "Todos")
Select Case UsuarioActual.Empresa.Tipo_CentroCosto
Case 1
If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False
@@ -8096,15 +8102,15 @@ Public Class ClsPaginas
End Select
If DdlProyecto IsNot Nothing Then
- DdlProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}))
+ DdlProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1).FiltraParametros("", "", {"CveProyecto", "Proyecto"}))
DdlProyecto.DataBind()
- DdlProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ If AplicaTodos <> "" Then DdlProyecto.Items.Insert(0, New ListItem(AplicaTodos, "-1"))
End If
If DdlSubProyecto IsNot Nothing Then
- DdlSubProyecto.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
+ DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
DdlSubProyecto.DataBind()
- DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ If AplicaTodos <> "" Then DdlSubProyecto.Items.Insert(0, New ListItem(AplicaTodos, "-1"))
End If
End Sub
End Class
diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx
index f930bc624..c1f4a738e 100644
--- a/Compras/CatTipoGasto.aspx
+++ b/Compras/CatTipoGasto.aspx
@@ -8,7 +8,7 @@
- Catálogo de Tipo Gastos de Rechazo de Paquetes
+ Catálogo de Tipo Gasto
@@ -23,11 +23,11 @@
-
+
-
-
+
+
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index ded4e0c6f..1ae19bf47 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -2338,7 +2338,7 @@
@@ -82,6 +82,10 @@
+
+
+
+
diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx
index dde09a6a1..4fc1c050d 100644
--- a/Inventarios/AjustesSeccionAlmacen.aspx
+++ b/Inventarios/AjustesSeccionAlmacen.aspx
@@ -56,7 +56,8 @@
-
+
+
diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb
index 478c321f9..726db4464 100644
--- a/Inventarios/AjustesSeccionAlmacen.aspx.vb
+++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb
@@ -76,6 +76,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim CveMovimientoDetalleEntrada As Integer = 0
Dim Cont As Integer = 0
+ Dim Lista As New Hashtable
For Each gvr As GridViewRow In GvD.Rows
'que este seleccionado y que tenga diferente seccion
@@ -83,7 +84,10 @@ Partial Class Inventarios_AjustesSeccionAlmacen
If gvr.DataKey("CveSeccionAlmacen").ToEntero > 0 Then
ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True)
+ Else
+ ObjPS.UpdateAplicaSeccionAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False)
End If
+ If Not Lista.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then Lista.Add(gvr.DataKey("CvePS").ToEntero, gvr.FCDropDownList("DDlS").SelectedValue.ToEntero) 'guardo que dato le corresponde
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.DataKey("Existencia").ToDecimal, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, 0, -1, CveSeccionAlmacen:=gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=gvr.DataKey("Serie"), Lote:=gvr.DataKey("Lote"), FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate) Then
ErrorMovInv = True
@@ -108,7 +112,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim Cantidad As Decimal = Row("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = Row("PUOriginal").ToString().ToDecimal()
Dim CveUM As Integer = Row("CveUM").ToString().ToEntero()
- Dim CveSeccionAlmacen As Integer = GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
+ Dim CveSeccionAlmacen As Integer = Lista(Row("CvePS").ToString().ToEntero()) 'GvD.Rows(ind).FCDropDownList("DDlS").SelectedValue.ToEntero ' IfNull(Row("CveSeccionAlmacen"), "-1").ToString().ToEntero()
Dim CostoIndirecto As Decimal = Row("CostoIndirecto").ToString().ToDecimal()
Dim Serie As String = Row("Serie").ToString()
Dim Lote As String = Row("Lote").ToString()
@@ -117,6 +121,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen
'actualizamos el PS, para que tenga el aplica seccion
ObjPS.UpdateAplicaSeccionAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True)
+ If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then
+ ErrorMovInv = True
+ End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
@@ -132,11 +139,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
End If
End If
-
+ Lista = Nothing
End If
If Not ErrorMovInv Then
ObjInventario.Commit()
+ GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, -1, -1) = Nothing
CargaDatos()
Alert("El Movimiento quede registrado correctamente", TipoMensaje.MsgInformacion)
Else
@@ -318,11 +326,11 @@ Partial Class Inventarios_AjustesSeccionAlmacen
CveSeccionAlmacen = DrSeccion("CveSeccion").ToString().ToEntero()
End If
- Dim Serie As String = RowExcel("Serie").ToString()
+ Dim Serie As String = RowExcel("Serie").ToString().Trim
Dim Lote As String = RowExcel("Lote").ToString()
Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate
- Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}")
+ Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'")
If RowExistencia IsNot Nothing AndAlso CveSeccionAlmacen > 0 Then
Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()
@@ -332,6 +340,13 @@ Partial Class Inventarios_AjustesSeccionAlmacen
Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate
Dim PUSalida As Decimal = RowExistencia("PU").ToString()
+ 'condicion para ajustar la seccion y permita hacer los cambios en el trigger
+ If CveSeccionAlmacenSalida > 0 Then
+ ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True)
+ Else
+ ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, False)
+ End If
+
'GENERA LA SALIDA DE LOS PRODUCTOS QUE VIENEN EN EL EXCEL
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadSalida, CveUM, CvePS, PUSalida, CveSeccionAlmacen:=CveSeccionAlmacenSalida, Serie:=SerieSalida, Lote:=LoteSalida, FechaCaducidad:=FechaCaducidadSalida, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
@@ -355,6 +370,9 @@ Partial Class Inventarios_AjustesSeccionAlmacen
'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION
ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True)
+ If Not ObjInventario.AddProductosServiciosAlmacenSeccion(CvePS, CveAlmacen, CveSeccionAlmacen) Then
+ ErrorMovInv = True
+ End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, CantidadEntrada, CveUMEntrada, CvePSEntrada, PUEntrada, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
@@ -370,7 +388,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
End If
If RowExistencia Is Nothing Then
- ExistenciasNoEncontradas.AppendFormat("{0},", SeccionAlmacen)
+ ExistenciasNoEncontradas.AppendFormat("{0} - S:{1} ", Codigo, Serie)
ErrorMovInv = True
End If
diff --git a/Inventarios/Apartados.aspx b/Inventarios/Apartados.aspx
index 36a17a7c0..b146d2360 100644
--- a/Inventarios/Apartados.aspx
+++ b/Inventarios/Apartados.aspx
@@ -227,7 +227,7 @@
-
+
@@ -403,7 +403,7 @@
-
+
@@ -418,7 +418,7 @@
-
+
diff --git a/Inventarios/Apartados.aspx.vb b/Inventarios/Apartados.aspx.vb
index f48ad283d..21708ab8a 100644
--- a/Inventarios/Apartados.aspx.vb
+++ b/Inventarios/Apartados.aspx.vb
@@ -805,10 +805,14 @@ Partial Class Inventarios_Apartados
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", String.Format("ValidaCantidad(this,{0})", e.Row.DBCampo("Cantidad")))
If CBool(e.Row.DBCampo("AplicaSeccion")) AndAlso DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero > 0 Then
+ Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
- e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoDesapartado.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
+ e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
- e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
+ If dtt.Rows.Count = 0 Then
+ e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End If
+ dtt.Dispose()
End If
End If
diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx
index 6114ccac7..c1fabff01 100644
--- a/Inventarios/EntradasSalidas.aspx
+++ b/Inventarios/EntradasSalidas.aspx
@@ -1049,7 +1049,9 @@
-
+
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index e914638ac..1e73a6744 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -2217,6 +2217,7 @@ Partial Class Inventarios_EntradasSalidas
'PERMISO SOLO PARA EDITAR SERIELOTE
If UsuarioActual.TienePermisoProceso(245) Then
GvM.Columns(9).Visible = True
+ TxtnSerie.Visible = True
End If
TxtnLote.Visible = False
@@ -2294,7 +2295,6 @@ Partial Class Inventarios_EntradasSalidas
e.Row.FCTextBox("LblEditCodigo").Enabled = False
e.Row.FCTextBox("TxtSerie").Enabled = False
e.Row.FCTextBox("TxtLote").Enabled = False
- e.Row.FCTextBox("TxtBatch").Enabled = False
e.Row.FCDropDownList("DdlSeccionAlmacen").Enabled = False
End If
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index 8dff1f8c8..7ef8db2d1 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -2,6 +2,7 @@
Option Explicit On
Imports System.Data
+Imports System.Data.Entity.Core.Common.CommandTrees
Imports System.IO
Imports Extensiones
@@ -655,7 +656,7 @@ Partial Class Inventarios_EntregaAlmacen
Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString
Case "Ing", "Ped"
Filtro = "CveConcepto IN (3,40)"
- Case "Dev"
+ Case "Dev", "dPe"
'cuand es devolucionventa=1, es cancelación de la devolución
If EsDevolucionVenta = 1 Then Filtro = "CveConcepto = 18" Else Filtro = "CveConcepto IN (3,40)"
Case Else
@@ -2180,7 +2181,7 @@ Partial Class Inventarios_EntregaAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
- If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccionAlmacen").ToString.ToEntero, -1)) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
@@ -2339,7 +2340,7 @@ Partial Class Inventarios_EntregaAlmacen
End If
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
- If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1), EsInterno:=EsInterno) Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccionAlmacen").ToString.ToEntero, -1), EsInterno:=EsInterno) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx
index c702804ee..48a1e6086 100644
--- a/Inventarios/InventarioFisicoDetalle.aspx
+++ b/Inventarios/InventarioFisicoDetalle.aspx
@@ -240,23 +240,23 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -325,7 +325,7 @@
-
+
@@ -349,7 +349,7 @@
-
+
diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb
index 208728062..3bfb676f9 100644
--- a/Inventarios/InventarioFisicoDetalle.aspx.vb
+++ b/Inventarios/InventarioFisicoDetalle.aspx.vb
@@ -88,10 +88,8 @@ Partial Class Inventarios_InventarioFisicoDetalle
#Region " CARGA DATOS "
Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1)
- Dim ObjInventario As New ClsInventarios
- DdlSeccionAlmacen.DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
- DdlSeccionAlmacen.DataBind()
- DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ Dim ObjInventario As New ClsInventarios
+
If ObjInventario.GetInventarioFisico(CveInventarioFisico, CveEmpresa, -1, -1) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim CveEstatus = ObjInventario.DtResultados.FiltroPrimeroValor("CveEstatus")
Select Case CveEstatus
@@ -230,9 +228,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim Inventario As New ClsInventarios
If Inventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue.ToString.ToEntero) Then
If Inventario.DtResultados.Rows.Count > 0 Then
- GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen") > 0
+ GvIFD.Columns(4).Visible = Inventario.DtResultados.MAX("CveSeccionAlmacen", "CveSeccionAlmacen IS NOT NULL").ToEntero > 0
GvIFD.Columns(6).Visible = Inventario.DtResultados.MAX("Lote") <> ""
- GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
+ GvIFD.Columns(7).Visible = Inventario.DtResultados.MAX("FechaCaducidad", "FechaCaducidad IS NOT NULL").ToDate > MinFecha
GvIFD.DataSource = Inventario.DtResultados '.AsEnumerable.OrderByDescending(Function(k) k!CveInventarioFisicoDetalle).Take(500).CopyToDataTable
Else
GvIFD.DataSource = Nothing
@@ -259,48 +257,83 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim CveUnidadMedida As Integer
Dim Codigo As String = If(TxtCodigo.Text.Trim <> "", TxtCodigo.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
- Dim SeccionAlmacen As String = If(DdlSeccionAlmacen.SelectedValue.ToEntero > -1, DdlSeccionAlmacen.SelectedItem.Text, "")
- Dim CveSeccionAlmacen As Integer = If(DdlSeccionAlmacen.SelectedValue.ToEntero > 0, DdlSeccionAlmacen.SelectedValue.ToEntero, -1)
- Dim SerieLote As String = TxtCodigoSerie.Text.Trim
+ Dim Serie As String = TxtCodigoSerie.Text.Trim
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
- Dim FechaCaducidad As String = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
- Dim CveMetodoInv As Integer = -1
+ Dim FechaCaducidad As String=MinFecha.ToString
+ Dim CveSeccionAlmacen As Integer = -1
+
Dim Cantidad = TxtCantidadProducto.Text.ToDouble
Dim dr As DataRow
- dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ")
-
- If dr IsNot Nothing Then
- CveMetodoInv = dr("Inv_CveMetodoInventario").ToString.ToEntero
+ 'dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}' ")
+ dr = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}' OR Codigo = '{Codigo}'")
+
+
+
+ If dr IsNot Nothing Then
+
CveProducto = dr("CvePS").ToString.ToEntero
- CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero
+ CveUnidadMedida = dr("CveUnidadMedida").ToString.ToEntero
+ 'Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
+ Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
+ Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
+ Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
+
+ 'divSeccionAlmacen.Visible = AplicaSeccion
+ divLote.Visible = AplicaLote
+ divFechaCaducidad.Visible = AplicaCaducidad
+ divSerie.Visible = AplicaSerie
+ UPAgregarPro.Update()
- If CveMetodoInv = 5 And SerieLote = "" Then
+ If AplicaSerie And Serie = "" Then
RFVSerie.Enabled = True
RFVSerie.Visible = True
RFVSerie.SetFocusOnError = True
RFVSerie.Validate()
RFVSerie.ValidationGroup = " "
Exit Sub
+ End If
+ If AplicaLote And Lote = "" Then
+ RFVLote.Enabled = True
+ RFVLote.Visible = True
+ RFVLote.SetFocusOnError = True
+ RFVLote.Validate()
+ RFVLote.ValidationGroup = " "
+ Exit Sub
End If
+ If AplicaCaducidad Then
+ If TxtFechaCaducidad.Text.Trim = "" Then
+ RFVCaducidad.Enabled = True
+ RFVCaducidad.Visible = True
+ RFVCaducidad.SetFocusOnError = True
+ RFVCaducidad.Validate()
+ RFVCaducidad.ValidationGroup = " "
+ Exit Sub
+ End If
+ FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
+ End If
RFVSerie.ValidationGroup = "GrpIngresar"
RFVSerie.Enabled = False
-
- 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
- If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
- Alert($"La serie indicada {SerieLote} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ RFVLote.ValidationGroup = "GrpIngresar"
+ RFVLote.Enabled = False
+ RFVCaducidad.ValidationGroup = "GrpIngresar"
+ RFVCaducidad.Enabled = False
+
+ 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
+ If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
+ Alert($"La serie indicada {Serie} coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Consulto As Boolean = False
Using Inventarios As New ClsInventarios
- If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(CveMetodoInv = 5, 1, Cantidad), SerieLote, UsuarioActual.CveUsuario,
- CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
+ If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
+ CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
- GvIFDUltimoRegistrado.Columns(5).Visible = SerieLote <> "-1"
+ GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "-1"
GvIFDUltimoRegistrado.Columns(6).Visible = Lote <> "-1"
GvIFDUltimoRegistrado.Columns(7).Visible = FechaCaducidad <> "01/01/1900"
@@ -310,7 +343,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PS").ToString
- GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
+ GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = ""
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
@@ -332,9 +365,11 @@ Partial Class Inventarios_InventarioFisicoDetalle
TxtCodigoSerie.Text = ""
TxtCodigo.Text = ""
TxtCantidadProducto.Text = "1"
- DdlSeccionAlmacen.SelectedValue = "-1"
TxtLote.Text = ""
TxtFechaCaducidad.Text = ""
+ divLote.Visible = False
+ divFechaCaducidad.Visible = False
+ divSerie.Visible = False
RegistraScript("playsonidito('beep-07.wav')")
Else
TxtCodigoSerie.Text = ""
@@ -346,8 +381,10 @@ Partial Class Inventarios_InventarioFisicoDetalle
Else
TxtCodigoBarras.Text = ""
TxtCodigoSerie.Text = ""
- TxtCodigo.Text = ""
- DdlSeccionAlmacen.SelectedValue = "-1"
+ TxtCodigo.Text = ""
+ divLote.Visible = False
+ divFechaCaducidad.Visible = False
+ divSerie.Visible = False
TxtLote.Text = ""
TxtFechaCaducidad.Text = ""
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)
@@ -530,7 +567,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim AplicaLote As Boolean = Producto("AplicaLote") = "1"
Dim AplicaSerie As Boolean = Producto("AplicaSerie") = "1"
- divSeccionAlmacen.Visible = AplicaSeccion
+ 'divSeccionAlmacen.Visible = AplicaSeccion
divLote.Visible = AplicaLote
divFechaCaducidad.Visible = AplicaCaducidad
divSerie.Visible = AplicaSerie
diff --git a/Inventarios/RepAnomalias.aspx b/Inventarios/RepAnomalias.aspx
index 8d3185711..3751b969e 100644
--- a/Inventarios/RepAnomalias.aspx
+++ b/Inventarios/RepAnomalias.aspx
@@ -200,7 +200,7 @@
-
+
@@ -234,7 +234,7 @@
-
+
diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb
index a239ccbab..a71900ab2 100644
--- a/Inventarios/RepAnomalias.aspx.vb
+++ b/Inventarios/RepAnomalias.aspx.vb
@@ -275,7 +275,7 @@ Partial Class Inventarios_RepAnomalias
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
Gv.Columns(4).Visible = resultado.MAX("Serie") <> ""
Gv.Columns(5).Visible = resultado.MAX("Lote") <> ""
- Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad") <> ""
+ Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
End Sub
End Class
diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx
index afd3762fe..3801b68c5 100644
--- a/TareasProgramadas/Tareas119.ashx
+++ b/TareasProgramadas/Tareas119.ashx
@@ -63,8 +63,36 @@ public class TareasJam : IHttpHandler
string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
+ try
+ {
+ if (File.Exists(RutaProductos))
+ {
+ File.Delete(RutaProductos);
+ }
- //"ftp://us2.hostedftp.com/", "agrojam", "A12345678";
+ if (File.Exists(RutaVentas))
+ {
+ File.Delete(RutaVentas);
+ }
+
+ if (File.Exists(RutaClientes))
+ {
+ File.Delete(RutaClientes);
+ }
+
+ if (File.Exists(RutaAlmacenes))
+ {
+ File.Delete(RutaAlmacenes);
+ }
+
+ }
+ catch (Exception ex) {
+ SBLog.AppendLine("Error al eliminar archivos");
+ }
+
+
+
+ ////"ftp://us2.hostedftp.com/", "agrojam", "A12345678";
//string FTPServer = "ftp://127.0.0.1/";
//string TFPUsr = "Toor";
//string FTPPass = "agj-3500";
@@ -148,18 +176,27 @@ public class TareasJam : IHttpHandler
DTClientes.Columns[11].ColumnName = "phone.areaCode";
DTClientes.Columns[12].ColumnName = "phone.number";
- DTClientes.Columns.RemoveAt(12);
- DTClientes.Columns.RemoveAt(11);
- DTClientes.Columns.RemoveAt(10);
- DTClientes.Columns.RemoveAt(8);
- DTClientes.Columns.RemoveAt(7);
+ //DTClientes.Columns.RemoveAt(12);
+ //DTClientes.Columns.RemoveAt(11);
+ //DTClientes.Columns.RemoveAt(10);
+ //DTClientes.Columns.RemoveAt(8);
+ //DTClientes.Columns.RemoveAt(7);
DTClientes.AcceptChanges();
DTVentas.Columns.RemoveAt(7);
- DTVentas.Columns.RemoveAt(6);
+ //DTVentas.Columns.RemoveAt(6);
+
+ DTVentas.Columns[3].ColumnName = "Sale Date";
+ DTVentas.Columns[6].ColumnName = "Transaction ID";
DTVentas.AcceptChanges();
+
+ DTAlmacenes.Columns[2].ColumnName = "Description";
+ DTAlmacenes.Columns[3].ColumnName = "Stock Date";
+ DTAlmacenes.AcceptChanges();
+
+
DataTable dtCloned = DTVentas.Clone();
dtCloned.Columns[3].DataType = typeof(string);
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index bfca81a44..294572c12 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2451,8 +2451,8 @@ Partial Class Ventas
CargaFletes()
- CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto)
- CargarCentrosDeCosto(DdlProyectoPyME, DdlSubProyectoPyME, LblProyectoPyME, LblSubProyectoPyME)
+ CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto, AplicaTodos:="")
+ CargarCentrosDeCosto(DdlProyectoPyME, DdlSubProyectoPyME, LblProyectoPyME, LblSubProyectoPyME, AplicaTodos:="")
BrSubProyecto.Visible = DdlProyecto.Visible
divProyectoPyME.Visible = DdlProyecto.Visible
@@ -14418,8 +14418,8 @@ Partial Class Ventas
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = DTSucursal
- DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
- DdlSubProyecto.SelectedValue = "-1"
+ 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ 'DdlSubProyecto.SelectedValue = "-1"
DdlSubProyecto.DataBind()
DdlSubProyecto.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
CambiaSucursal()
@@ -22424,13 +22424,30 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValue = "Egs"
Dim AplicaImpuestosLocales As Boolean = False
- Dim ObjCliente As New ClsClientes
- If ObjCliente.GetClienteImpuestosLocales(CveCliente) Then
- 'se cargan impuestos locales
- Dim DtClienteImpuesto As DataTable = ObjCliente.DtResultados.FiltraParametros("Seleccionado = 1", "Orden")
- AplicaImpuestosLocales = (DtClienteImpuesto IsNot Nothing AndAlso DtClienteImpuesto.Rows.Count > 0)
+ 'Dim ObjCliente As New ClsClientes
+ 'If ObjCliente.GetClienteImpuestosLocales(CveCliente) Then
+ ' 'se cargan impuestos locales
+ ' Dim DtClienteImpuesto As DataTable = ObjCliente.DtResultados.FiltraParametros("Seleccionado = 1", "Orden")
+ ' AplicaImpuestosLocales = (DtClienteImpuesto IsNot Nothing AndAlso DtClienteImpuesto.Rows.Count > 0)
+ 'End If
+ 'ObjCliente.Dispose()
+
+ 'CARGA IMPUESTOS LOCALES
+ Dim ObjVentas As New ClsVentas()
+ If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+ AplicaImpuestosLocales = True
+
+ TrOtros.Visible = True
+ TmpDTImpuestos = ObjVentas.DtResultados
+ GvImpuestosLocales2.DataSource = ObjVentas.DtResultados
+ GvImpuestosLocales2.DataBind()
+
+ GvImpuestosLocales2.Enabled = False
+ GvImpuestosLocales2.Visible = True
+ End If
End If
- ObjCliente.Dispose()
+ ObjVentas.Dispose()
AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento)