-- cambios de SeccionesAlmacen, Serie,Lote,Caducidad

This commit is contained in:
rrene
2020-05-13 12:38:46 -07:00
parent f60e230d98
commit 055db33c9c
9 changed files with 144 additions and 119 deletions

View File

@@ -1177,11 +1177,11 @@ Public Class ClsPaginas
' Application("GlobalDTProductosServicios") = value ' Application("GlobalDTProductosServicios") = value
' End Set ' End Set
'End Property 'End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1) As DataTable ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1) As DataTable
Get Get
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta) Then If ObjPS.GetPS(CvePS, -1, CveEmpresa, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then
GlobalDTPS = ObjPS.DtResultados GlobalDTPS = ObjPS.DtResultados
Else Else
GlobalDTPS = Nothing GlobalDTPS = Nothing
@@ -1630,7 +1630,7 @@ Public Class ClsPaginas
Application("GlobalDTClientesCorporativo") = value Application("GlobalDTClientesCorporativo") = value
End Set End Set
End Property End Property
Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable Property GlobalDTCompProveedores(CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTCompProveedores-{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTCompProveedores-{0}", CveEmpresa)
'sino existe, recarga los datos 'sino existe, recarga los datos
@@ -1641,7 +1641,11 @@ Public Class ClsPaginas
End If End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCompProveedores = Dv.ToTable GlobalDTCompProveedores = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1726,10 +1730,21 @@ Public Class ClsPaginas
Application("GlobalDTInvConceptos") = value Application("GlobalDTInvConceptos") = value
End Set End Set
End Property End Property
Property GlobalDTSeccionAlmacen(CveEmpresa As Integer) As DataTable Property GlobalDTSeccionAlmacen(CveEmpresa As Integer, CveAlmacen As Integer) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTSeccionAlmacen-{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjInv As New ClsInventarios
If ObjInv.GetSeccionesAlmacenes(CveEmpresa, -1) Then Application(AppNombre) = ObjInv.DtResultados
ObjInv.Dispose()
End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTSeccionAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) Dim Str As New StringBuilder
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTSeccionAlmacen = Dv.ToTable GlobalDTSeccionAlmacen = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1738,7 +1753,8 @@ Public Class ClsPaginas
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTSeccionAlmacen") = value Dim AppNombre As String = String.Format("GlobalDTSeccionAlmacen-{0}", CveEmpresa)
Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1) As DataTable
@@ -4288,7 +4304,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/RepConsignaciones.aspx".ToUpper(), 364) PaginaDict.Add("/Inventarios/RepConsignaciones.aspx".ToUpper(), 364)
PaginaDict.Add("/Inventarios/RepAlmacenCompras.aspx".ToUpper(), 375) PaginaDict.Add("/Inventarios/RepAlmacenCompras.aspx".ToUpper(), 375)
PaginaDict.Add("/Inventarios/RepAlmacen.aspx".ToUpper(), 376) PaginaDict.Add("/Inventarios/RepAlmacen.aspx".ToUpper(), 376)
PaginaDict.Add("/Inventarios/RecepcionEntrega.aspx".ToUpper(), 387) PaginaDict.Add("/Inventarios/EntregaAlmacen.aspx".ToUpper(), 387)
PaginaDict.Add("/Inventarios/RepUMEquivalencia.aspx".ToUpper(), 399) PaginaDict.Add("/Inventarios/RepUMEquivalencia.aspx".ToUpper(), 399)
PaginaDict.Add("/Inventarios/ResguardoMaterial.aspx".ToUpper(), 562) PaginaDict.Add("/Inventarios/ResguardoMaterial.aspx".ToUpper(), 562)
PaginaDict.Add("/Inventarios/RepMaximoMinimo.aspx".ToUpper(), 389) PaginaDict.Add("/Inventarios/RepMaximoMinimo.aspx".ToUpper(), 389)
@@ -4331,7 +4347,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/RepEntradasSalidas2.aspx".ToUpper(), -1) PaginaDict.Add("/Inventarios/RepEntradasSalidas2.aspx".ToUpper(), -1)
' PaginaDict.Add("/Inventarios/RecepcionUsados.aspx".ToUpper(), 1202) ' PaginaDict.Add("/Inventarios/RecepcionUsados.aspx".ToUpper(), 1202)
PaginaDict.Add("/Inventarios/RepTraspasoEmitido.aspx".ToUpper(), 891) PaginaDict.Add("/Inventarios/RepTraspasoEmitido.aspx".ToUpper(), 891)
PaginaDict.Add("/Inventarios/KardexSeccionAlmacen.aspx".ToUpper(), 892) PaginaDict.Add("/Inventarios/AjustesSeccionAlmacen.aspx".ToUpper(), 892)
PaginaDict.Add("/Inventarios/RepTraspasoAlmacen.aspx".ToUpper(), 688) PaginaDict.Add("/Inventarios/RepTraspasoAlmacen.aspx".ToUpper(), 688)
#End Region #End Region

View File

@@ -1796,12 +1796,12 @@ Namespace Modelos
If Dr("CveTipoInvPS").ToString.ToEntero = 5 Then If Dr("CveTipoInvPS").ToString.ToEntero = 5 Then
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, Me.CveEmpresa, CveAlmacenExistenciasContrato, SerieLote:=Dr2("Serie").ToString, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=Me.CveSubProyecto, ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, Me.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=Me.CveSubProyecto, ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < 1 Then If Existencia < 1 Then
Return False Return False
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, SerieLote:=Dr2("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
Return False Return False
End If End If
Next Next
@@ -1826,7 +1826,7 @@ Namespace Modelos
If CveMovimientoEntradaGeneral > 0 Then If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
Return False Return False
End If End If
Next Next
@@ -1840,7 +1840,7 @@ Namespace Modelos
If CveMovimientoEntradaGeneral > 0 Then If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
Return False Return False
End If End If
Next Next
@@ -3399,7 +3399,7 @@ Namespace Modelos
End If End If
If CveProducto > 0 Then If CveProducto > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, -1, SerieLote:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, -1, Serie:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />") ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For Exit For
@@ -3672,7 +3672,7 @@ Namespace Modelos
Exit For Exit For
End If End If
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle) Then If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Lote:=SerieLote, CveVentaDetalle:=CveVentaDetalle) Then
ContadorMovtosDetalles += 1 ContadorMovtosDetalles += 1
Else Else
OcurrioError = True OcurrioError = True
@@ -4436,7 +4436,7 @@ Namespace Modelos
If CveMovimientoDevolucion > 0 Then If CveMovimientoDevolucion > 0 Then
For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, SerieLote:=Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For Exit For
@@ -4932,7 +4932,7 @@ Namespace Modelos
End If End If
For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If
@@ -4950,7 +4950,7 @@ Namespace Modelos
'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If
@@ -5014,7 +5014,7 @@ Namespace Modelos
Exit For Exit For
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, DrRem("CveActivoFijo").ToString.ToEntero, -1, DrRem("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=DrRem("Lote").ToString, Batch:=DrRem("Batch").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, DrRem("CveActivoFijo").ToString.ToEntero, -1, DrRem("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=DrRem("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If
@@ -5029,7 +5029,7 @@ Namespace Modelos
If Not ErrorCancelar Then If Not ErrorCancelar Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If
@@ -5084,7 +5084,7 @@ Namespace Modelos
Exit For Exit For
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If
@@ -5107,7 +5107,7 @@ Namespace Modelos
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
ErrorCancelar = True ErrorCancelar = True
Exit For Exit For
End If End If

View File

@@ -613,7 +613,7 @@ Partial Class Compras_Compras
'Private ReadOnly Property Ruta As String 'Private ReadOnly Property Ruta As String
' Get ' Get
' Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\" ' Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
' End Get ' End Get
'End Property 'End Property
@@ -1624,6 +1624,8 @@ Partial Class Compras_Compras
'LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveCompra:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveCompra)
End If End If
@@ -1702,7 +1704,7 @@ Partial Class Compras_Compras
Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
Dim XMLDoc As New XmlDocument Dim XMLDoc As New XmlDocument
Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, dr("RFCDe"), dr("XML")) Dim Archivo As String = String.Format("{0}\Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, dr("RFCDe"), dr("XML"))
If IO.File.Exists(Archivo) Then If IO.File.Exists(Archivo) Then
Dim Validada As Boolean = True Dim Validada As Boolean = True
@@ -5275,7 +5277,7 @@ Partial Class Compras_Compras
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS"))) DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("CvePS = {0}", Dr("CvePS")))
If DtDetalle.Rows.Count > 0 Then If DtDetalle.Rows.Count > 0 Then
For Each drr As DataRow In DtDetalle.Rows For Each drr As DataRow In DtDetalle.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, SerieLote:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=drr("Serie").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CostoIndirecto:=Dr("CostoIndirectoAlmacen").ToString.ToDecimal, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True ErrorMovInv = True
Exit For Exit For
End If End If
@@ -5809,11 +5811,7 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
End If End If
Next Next
@@ -6390,6 +6388,7 @@ Partial Class Compras_Compras
Case 6 'Compra Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
If RBLPago.SelectedValue.ToEntero = 4 Then If RBLPago.SelectedValue.ToEntero = 4 Then
@@ -6416,11 +6415,7 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 49))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Row2("CodAF").ToString, 49, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveActivoFijo:=Row2("CveActivoFijo").ToString.ToEntero, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Row2("CodAF").ToString, 49, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveActivoFijo:=Row2("CveActivoFijo").ToString.ToEntero, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
@@ -6620,6 +6615,13 @@ Partial Class Compras_Compras
'falta el registro de la NC cuando es 'falta el registro de la NC cuando es
Dim RegistroCuentaPuente As Boolean = False Dim RegistroCuentaPuente As Boolean = False
'NC CON PRODUCTOS - CUENTA PUENTE 'NC CON PRODUCTOS - CUENTA PUENTE
If DdlTipoComprobante.SelectedValue = "NC" And DdlTipoCompra.SelectedValue.ToEntero = 9 Then
RegistraConcepto225 = True
End If
If RegistraConcepto225 Then If RegistraConcepto225 Then
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal
@@ -6728,7 +6730,7 @@ Partial Class Compras_Compras
importeMN = importeMovimiento * tipoCambioActual * Multiplicador '[IPP] EL 6 DEBE SER POSITIVO 27/AGOSTO/2018 importeMN = importeMovimiento * tipoCambioActual * Multiplicador '[IPP] EL 6 DEBE SER POSITIVO 27/AGOSTO/2018
'CLASIFICACION 'CLASIFICACION
If Row2("CveClasificacion").ToString.ToEntero > 0 AndAlso DdlTipoComprobante.SelectedValue = "FAC" Then If Row2("CveClasificacion").ToString.ToEntero > 0 AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then
If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then
@@ -6739,9 +6741,13 @@ Partial Class Compras_Compras
' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero ' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToString.ToEntero
End If End If
End If End If
'Conta ContPAQ
End If End If
'If IdCtaContable = 0 AndAlso DdlTipoComprobante.SelectedValue = "Fac" Then
' CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
' idCuentaContabilizacion = 0
'End If
'SEGMENTO DE NEGOCIO 'SEGMENTO DE NEGOCIO
@@ -6753,16 +6759,6 @@ Partial Class Compras_Compras
'AGREGA MOVIMIENTO 'AGREGA MOVIMIENTO
If importeMovimiento.RoundSQL <> 0 Then If importeMovimiento.RoundSQL <> 0 Then
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 6))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
Dim tcvecon As Integer = 6 Dim tcvecon As Integer = 6
Dim tidctacon As Integer = 6 Dim tidctacon As Integer = 6
@@ -6800,9 +6796,6 @@ Partial Class Compras_Compras
End If End If
End If End If
Next Next
@@ -6880,11 +6873,6 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=rw.DataKey("CveIE").ToString.ToEntero, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
@@ -6922,6 +6910,12 @@ Partial Class Compras_Compras
CveCuenta = CveCuentaProveedorAcreedores CveCuenta = CveCuentaProveedorAcreedores
Case 18 'NC - Notas de Credito Case 18 'NC - Notas de Credito
importeMovimiento = importeNC importeMovimiento = importeNC
importeMN = importeMovimiento * tipoCambioActual * Multiplicador importeMN = importeMovimiento * tipoCambioActual * Multiplicador
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}" If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
@@ -7134,11 +7128,6 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'AMORTIZACIÓN NC ESPECIAL COMPLEMENTARIA 'AMORTIZACIÓN NC ESPECIAL COMPLEMENTARIA
If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then If ConceptoContableAnticipo.Contiene(60) And DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
@@ -7469,11 +7458,6 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If End If
'COnta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
@@ -9114,11 +9098,6 @@ Partial Class Compras_Compras
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0 idCuentaContabilizacion = 0
End If End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaNueva, TipoMovimiento, ImporteMovimiento, Concepto, ConceptoContable, Concepto, Fecha, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=If(tipoCambio = 1, 0, ImporteMovimiento), CveCuenta:=CveCuenta, PorcentajeImpuesto:=PorcentajeImpuesto) Then
ErrorMovtosCxP = 1 ErrorMovtosCxP = 1
@@ -11509,7 +11488,7 @@ Partial Class Compras_Compras
e.Row.FCCheckBox("cbInv").Enabled = False e.Row.FCCheckBox("cbInv").Enabled = False
End If End If
e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2,7,14,19)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("ddlEAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(If(DdlTipoCompra.SelectedValue.ToEntero = 9, "CveTipoAlmacen IN (21)", "CveTipoAlmacen IN (1,2,7,14,19)")) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlEAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlEAlmacen").DataBind() e.Row.FCDropDownList("ddlEAlmacen").DataBind()
'e.Row.FCDropDownList("ddlEAlmacen").SelectedValue = If(e.Row.DBCampo("CveAlmacen").ToEntero <= 0, "-1", e.Row.DBCampo("CveAlmacen")) 'e.Row.FCDropDownList("ddlEAlmacen").SelectedValue = If(e.Row.DBCampo("CveAlmacen").ToEntero <= 0, "-1", e.Row.DBCampo("CveAlmacen"))
@@ -11598,6 +11577,12 @@ Partial Class Compras_Compras
If UsuarioActual.CveUsuario.Contiene(1397, 1517, 1565) Then ' iliana, horacio, marco, RMF. 2017.03.13 If UsuarioActual.CveUsuario.Contiene(1397, 1517, 1565) Then ' iliana, horacio, marco, RMF. 2017.03.13
StrAlmacenes = "CveTipoAlmacen IN (1,2,7,14,12,19)" StrAlmacenes = "CveTipoAlmacen IN (1,2,7,14,12,19)"
End If End If
If DdlTipoCompra.SelectedValue.ToEntero = 9 Then
StrAlmacenes = "CveTipoAlmacen IN (21)"
End If
e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) e.Row.FCDropDownList("ddlAlmacen").DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1")) e.Row.FCDropDownList("ddlAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
e.Row.FCDropDownList("ddlAlmacen").DataBind() e.Row.FCDropDownList("ddlAlmacen").DataBind()
@@ -19619,6 +19604,10 @@ Partial Class Compras_Compras
Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlTipoCompra_SelectedIndexChanged(sender As Object, e As EventArgs)
If DdlTipoCompra.SelectedValue.ToEntero = 9 Then 'Al seleccionar apoyo logístico se cargan los amancenes de devoculcion proveedor para dar entrada
CargaGvInv()
End If
End Sub End Sub
#End Region #End Region

View File

@@ -1380,7 +1380,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Serie" DataField="SerieLote" ItemStyle-Width="10%" Visible="false" /> <asp:BoundField HeaderText="Serie" DataField="SerieLote" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="10%" Visible="false" /> <asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="10%" Visible="false" />
<asp:BoundField HeaderText="Batch" DataField="Batch" ItemStyle-Width="10%" Visible="false" /> <asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="10%" Visible="false" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -2841,7 +2841,7 @@ Partial Class OC
Dim CveMovimientoEntradaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OC/G") Dim CveMovimientoEntradaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OC/G")
If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventarios.DtResultados.Rows For Each Dr As DataRow In ObjInventarios.DtResultados.Rows
If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
TieneError = True TieneError = True
Exit For Exit For
End If End If
@@ -6346,7 +6346,7 @@ Partial Class OC
Private Function GetPS(Opt As String, Valor As String) As String Private Function GetPS(Opt As String, Valor As String) As String
Dim StrReturn As String = String.Empty Dim StrReturn As String = String.Empty
Dim CvePS As Integer = 0 Dim CvePS As Integer = 0
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Opt & " = '" & Valor & "'").ToString.ToEntero CvePS = GlobalDTPS(UsuarioActual.CveEmpresa, Estatus:=1).FiltroPrimeroValor("CvePS", Opt & " = '" & Valor & "'").ToString.ToEntero
If CvePS > 0 Then If CvePS > 0 Then
StrReturn = "True|" & CvePS.ToString StrReturn = "True|" & CvePS.ToString
Else Else
@@ -6819,7 +6819,7 @@ Partial Class OC
GVInv.Columns(4).Visible = True GVInv.Columns(4).Visible = True
End If End If
If e.Row.DBCampo("Batch") <> "" Then If e.Row.DBCampo("FechaCaducidad") <> "" Then
GVInv.Columns(4).Visible = True GVInv.Columns(4).Visible = True
End If End If

View File

@@ -945,7 +945,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Lote" HeaderText="Lote" /> <asp:BoundField DataField="Lote" HeaderText="Lote" />
<asp:BoundField DataField="Batch" HeaderText="Batch" /> <asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -2849,13 +2849,13 @@ Partial Class PV
DtTemporal.Columns.Add("Lote", Type.GetType("System.String")) DtTemporal.Columns.Add("Lote", Type.GetType("System.String"))
End If End If
If Not DtTemporal.Columns.Contains("Batch") Then If Not DtTemporal.Columns.Contains("FechaCaducidad") Then
DtTemporal.Columns.Add("Batch", Type.GetType("System.String")) DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
End If End If
GvInv.Columns(4).Visible = DtTemporal.MAX("SerieLote", "SerieLote <> ''") <> "" Or CveVenta <= 0 GvInv.Columns(4).Visible = DtTemporal.MAX("SerieLote", "SerieLote <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> "" GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
GvInv.Columns(6).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> "" GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad", "FechaCaducidad <> ''") <> ""
GvInv.DataSource = DtTemporal GvInv.DataSource = DtTemporal
GvInv.DataBind() GvInv.DataBind()

View File

@@ -1614,7 +1614,7 @@
Almacén: Almacén:
<asp:DropDownList ID="ddlAlmacen" AppendDataBoundItems="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="select2me" Width="200px"></asp:DropDownList> <asp:DropDownList ID="ddlAlmacen" AppendDataBoundItems="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="select2me" Width="200px"></asp:DropDownList>
</div> </div>
<div class=" col-sm-8"> <div class=" col-sm-10">
<div class="Widthall" style="overflow-x: auto;"> <div class="Widthall" style="overflow-x: auto;">
<asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None"> <asp:GridView ID="GvInv" runat="server" AutoGenerateColumns="false" DataKeyNames="Origen" EmptyDataText="Aun no hay registros." ShowHeaderWhenEmpty="True" Width="100%" HeaderStyle-CssClass="Titulos" CssClass="table table-striped table-hover" Style="text-align: center;" GridLines="None">
<Columns> <Columns>
@@ -1655,7 +1655,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Lote" HeaderText="Lote" /> <asp:BoundField DataField="Lote" HeaderText="Lote" />
<asp:BoundField DataField="Batch" HeaderText="Batch" /> <asp:BoundField DataField="FechaCaducidad" HeaderText="FechaCaducidad" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -9503,8 +9503,11 @@ Partial Class Ventas
TmpDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle TmpDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle
Try Try
Dim InvDr As DataRow = DtInv.Select($"Consec = {Row("Consec").ToString}")(0) If DtInv IsNot Nothing Then
InvDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle Dim InvDr As DataRow = DtInv.Select($"Consec = {Row("Consec").ToString}")(0)
InvDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle
End If
Catch ex As Exception Catch ex As Exception
End Try End Try
@@ -11175,7 +11178,7 @@ Partial Class Ventas
CveConceptoAlmacen = 18 CveConceptoAlmacen = 18
End If End If
Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEnteroca Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1") Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E1")
If CveMovimientoInventario <= 0 Then If CveMovimientoInventario <= 0 Then
@@ -11239,7 +11242,7 @@ Partial Class Ventas
End If End If
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, Serie:=Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />") ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
Exit For Exit For
@@ -13246,7 +13249,7 @@ Partial Class Ventas
Protected Function CancelarMovimientoInventario(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, CveVentaNueva As Integer, CveVentaVieja As Integer) As Boolean Protected Function CancelarMovimientoInventario(ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, CveVentaNueva As Integer, CveVentaVieja As Integer) As Boolean
'SI YA ESTA QUEMADA DE ALMACEN LA VENTA, NO SE CANCELAN LOS MOVIMIENTOS DE INVENTARIO 'SI YA ESTA QUEMADA DE ALMACEN LA VENTA, NO SE CANCELAN LOS MOVIMIENTOS DE INVENTARIO
If ObjInventario.GetEstatusVentaPorSurir(CveVentaVieja) Then If ObjInventario.GetEstatusVentaPorSurtir(CveVentaVieja) Then
If ObjInventario.EsDevolucionVenta = 2 Then If ObjInventario.EsDevolucionVenta = 2 Then
Return True Return True
End If End If
@@ -13285,12 +13288,12 @@ Partial Class Ventas
Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero
Dim PU As Decimal = MovDet("PU").ToString.ToDecimal Dim PU As Decimal = MovDet("PU").ToString.ToDecimal
Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero
Dim SerieLote As String = MovDet("SerieLote").ToString Dim Serie As String = MovDet("Serie").ToString
Dim CveVentaDetalle = MovDet("CveVentaDetalle").ToString.ToEntero Dim CveVentaDetalle = MovDet("CveVentaDetalle").ToString.ToEntero
'Entrada 'Entrada
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioEntrada, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioEntrada, Cantidad, CveUnidad, CveProducto, PU, Serie:=Serie, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -13298,7 +13301,7 @@ Partial Class Ventas
'Salida 'Salida
CveVentaDetalle = ObjInventario.VentaDetallePadreGet(CveVentaDetalle).ToString.ToEntero CveVentaDetalle = ObjInventario.VentaDetallePadreGet(CveVentaDetalle).ToString.ToEntero
If CveVentaDetalle > 0 Then If CveVentaDetalle > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioSalida, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventarioSalida, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -16223,7 +16226,7 @@ Partial Class Ventas
Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero
Dim PU As Decimal = MovDet("PU").ToString.ToDecimal Dim PU As Decimal = MovDet("PU").ToString.ToDecimal
Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero
Dim SerieLote As String = MovDet("SerieLote").ToString Dim Serie As String = MovDet("Serie").ToString
Dim Consec As Integer = DtRemisionesTmpDT.FiltroPrimeroValor("Consec", $"CveVentaDetalle = {MovDet("CveVentaDetalle").ToString}").ToEntero Dim Consec As Integer = DtRemisionesTmpDT.FiltroPrimeroValor("Consec", $"CveVentaDetalle = {MovDet("CveVentaDetalle").ToString}").ToEntero
'COMIENZA: VENTADETALLE 'COMIENZA: VENTADETALLE
@@ -16249,7 +16252,7 @@ Partial Class Ventas
CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString.ToEntero CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString.ToEntero
End If End If
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
ContadorMovtosDetalles += 1 ContadorMovtosDetalles += 1
Else Else
OcurrioError = True OcurrioError = True
@@ -17364,7 +17367,7 @@ Partial Class Ventas
Dim DrProducto As DataRow = Nothing Dim DrProducto As DataRow = Nothing
If TxtCantidad.Text.Trim.ToDouble <= 0 Then TxtCantidad.Text = "1" If TxtCantidad.Text.Trim.ToDouble <= 0 Then TxtCantidad.Text = "1"
Dim SerieLote As String = "" Dim Serie As String = ""
Dim CodigoBarras As String = "" Dim CodigoBarras As String = ""
Dim CvePS As Integer Dim CvePS As Integer
@@ -17373,10 +17376,10 @@ Partial Class Ventas
'BUSCA POR SERIE E IGNORA CODIGO DE BARRAS (LIMPIA) 'BUSCA POR SERIE E IGNORA CODIGO DE BARRAS (LIMPIA)
If TxtCodigoSerie.Text.Trim <> "" Then If TxtCodigoSerie.Text.Trim <> "" Then
SerieLote = TxtCodigoSerie.Text.Trim().ToUpper() Serie = TxtCodigoSerie.Text.Trim().ToUpper()
Dim Objinventarios As New ClsInventarios Dim Objinventarios As New ClsInventarios
Dim Existencia = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, SerieLote:=SerieLote, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero) Dim Existencia = Objinventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, -1, Serie:=Serie, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero)
Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", SerieLote)) Dim ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Serie))
CvePS = Objinventarios.CvePS CvePS = Objinventarios.CvePS
Objinventarios.Dispose() Objinventarios.Dispose()
@@ -17387,11 +17390,11 @@ Partial Class Ventas
HdnCvePS.Value = CvePS.ToString HdnCvePS.Value = CvePS.ToString
TxtCantidad.Text = "1" TxtCantidad.Text = "1"
Else Else
Alert($"No se encontró un producto con la serie: <b>{SerieLote}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia) Alert($"No se encontró un producto con la serie: <b>{Serie}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia)
End If End If
End If End If
Else Else
Alert(String.Format("No hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", SerieLote), TipoMensaje.MsgAdvertencia) Alert(String.Format("No hay existencia suficiente del producto con la Serie: <b>{0}</b>. Por favor rectifique y vuelva a intentar", Serie), TipoMensaje.MsgAdvertencia)
TxtCodigoSerie.Focus() TxtCodigoSerie.Focus()
RegistraScript($"$('#{TxtCodigoSerie.ClientID}').select();") RegistraScript($"$('#{TxtCodigoSerie.ClientID}').select();")
Exit Sub Exit Sub
@@ -17404,7 +17407,7 @@ Partial Class Ventas
CodigoBarras = TxtCodigoBarras.Text.Trim() CodigoBarras = TxtCodigoBarras.Text.Trim()
DrProducto = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}'") DrProducto = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras = '{CodigoBarras}'")
If DrProducto IsNot Nothing Then If DrProducto IsNot Nothing Then
If DrProducto("Inv_CveMetodoInventario").ToString = "5" Then 'si es serielote If DrProducto("Inv_CveMetodoInventario").ToString = "5" Then 'si es serie
TxtCodigoSerie.Focus() TxtCodigoSerie.Focus()
Exit Sub Exit Sub
Else Else
@@ -17414,7 +17417,7 @@ Partial Class Ventas
Else Else
TxtCodigoBarras.Focus() TxtCodigoBarras.Focus()
RegistraScript($"$('#{TxtCodigoBarras.ClientID}').select();") RegistraScript($"$('#{TxtCodigoBarras.ClientID}').select();")
Alert($"No se encontró un producto con el código de barras: <b>{SerieLote}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia) Alert($"No se encontró un producto con el código de barras: <b>{Serie}</b>. Por favor verifique y vuelva a intentar ", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
End If End If
@@ -18031,8 +18034,8 @@ Partial Class Ventas
'SIN EXISTENCIA 'SIN EXISTENCIA
If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then If Gvr.FCTextBox("TxtSerie").Visible = True And Gvr.FCTextBox("TxtSerie").Text.Trim <> "" Then
Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero, SerieLote:=Gvr.FCTextBox("TxtSerie").Text.ToString, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventarios.GetExistenciasPS(-1, -1, UsuarioActual.CveEmpresa, ddlAlmacen.SelectedValue.ToEntero, Serie:=Gvr.FCTextBox("TxtSerie").Text.ToString, ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
ExistenciaActual = DtInv.SUM("Cantidad", String.Format("SerieLote = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim)) ExistenciaActual = DtInv.SUM("Cantidad", String.Format("Serie = '{0}'", Gvr.FCTextBox("TxtSerie").Text.Trim))
'Valida Existencia 'Valida Existencia
If Existencia - ExistenciaActual < 0 Then If Existencia - ExistenciaActual < 0 Then
@@ -18230,13 +18233,13 @@ Partial Class Ventas
DtTemporal.Columns.Add("Lote", Type.GetType("System.String")) DtTemporal.Columns.Add("Lote", Type.GetType("System.String"))
End If End If
If Not DtTemporal.Columns.Contains("Batch") Then If Not DtTemporal.Columns.Contains("FechaCaducidad") Then
DtTemporal.Columns.Add("Batch", Type.GetType("System.String")) DtTemporal.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
End If End If
GvInv.Columns(4).Visible = DtTemporal.MAX("SerieLote", "SerieLote <> ''") <> "" Or CveVenta <= 0 GvInv.Columns(4).Visible = DtTemporal.MAX("SerieLote", "SerieLote <> ''") <> "" Or CveVenta <= 0
GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> "" GvInv.Columns(5).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> ""
GvInv.Columns(6).Visible = DtTemporal.MAX("Lote", "Lote <> ''") <> "" GvInv.Columns(6).Visible = DtTemporal.MAX("FechaCaducidad", "FechaCaducidad <> ''") <> ""
GvInv.DataSource = DtTemporal GvInv.DataSource = DtTemporal
GvInv.DataBind() GvInv.DataBind()
@@ -19926,7 +19929,7 @@ Partial Class Ventas
End If End If
For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros($"ExistenciaPedido > 0 {Filtro}").Rows For Each dr As DataRow In ObjInventarios.DtResultados.FiltraParametros($"ExistenciaPedido > 0 {Filtro}").Rows
AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UnidadMedida").ToString, dr("CveClasificacion").ToString.ToEntero, dr("Clasificacion").ToString, AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UnidadMedida").ToString, dr("CveClasificacion").ToString.ToEntero, dr("Clasificacion").ToString,
dr("CvePS").ToString.ToEntero, dr("PS").ToString, dr("SerieLote").ToString, dr("PU").ToString.ToDecimal, 0.0D, dr("CvePS").ToString.ToEntero, dr("PS").ToString, dr("Serie").ToString, dr("PU").ToString.ToDecimal, 0.0D,
dr("CveProyecto").ToString.ToEntero, dr("Proyecto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("SubProyecto").ToString, dr("CveProyecto").ToString.ToEntero, dr("Proyecto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("SubProyecto").ToString,
CveMovimientoDetallePedido:=dr("CveMovimientoDetalle").ToString.ToEntero) CveMovimientoDetallePedido:=dr("CveMovimientoDetalle").ToString.ToEntero)
Next Next
@@ -20432,12 +20435,12 @@ Partial Class Ventas
If Dr("CveTipoInvPS").ToString.ToEntero = 5 Then If Dr("CveTipoInvPS").ToString.ToEntero = 5 Then
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, SerieLote:=Dr2("Serie").ToString, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1) Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < 1 Then If Existencia < 1 Then
Return False Return False
End If End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, SerieLote:=Dr2("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
Return False Return False
End If End If
Next Next
@@ -20462,7 +20465,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
Return False Return False
End If End If
Next Next
@@ -20476,7 +20479,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
Return False Return False
End If End If
Next Next
@@ -20612,7 +20615,7 @@ Partial Class Ventas
End If End If
'VERIFICA EXISTENCIAS 'VERIFICA EXISTENCIAS
Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieRow) Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=SerieRow)
If Existencia < 1 Then If Existencia < 1 Then
MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>") MensajeSinExistencias.Append($"Serie: <b>{SerieRow}</b>. <br/>")
Continue For Continue For
@@ -20952,6 +20955,7 @@ Partial Class Ventas
Count = +1 Count = +1
Next Next
End If End If
DtDocumentacionCliente(IndexDocumentoCliente)("RutaArchivo") = fileItem.FileUrl DtDocumentacionCliente(IndexDocumentoCliente)("RutaArchivo") = fileItem.FileUrl
DtDocumentacionCliente(IndexDocumentoCliente)("UpArchivo") = "1" DtDocumentacionCliente(IndexDocumentoCliente)("UpArchivo") = "1"
@@ -21989,6 +21993,7 @@ Partial Class Ventas
End If End If
End If End If
Dim ImpuestoTolerancia As Decimal = 0.01D ' SI EXCEDE ESA DIFERENCIA, AJUSTA EL IMPUESTO
Dim query = From dr In DtImpuestos Dim query = From dr In DtImpuestos
Group By PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal, Group By PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal,
@@ -21999,14 +22004,29 @@ Partial Class Ventas
Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal), Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal),
ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal), ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal),
ImporteIVA = x.Sum(Function(s) (s("ImporteIVA").ToString.ToDecimal)).RoundSQL(2), ' Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA, ImporteIVA = x.Sum(Function(s) (s("ImporteIVA").ToString.ToDecimal)).RoundSQL(2), ' Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA,
ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImporteRetIVA").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA, ImporteIVACalculado = (x.Sum(Function(s) (s("ImportePU").ToString.ToDecimal) * PorcentajeIVA)).RoundSQL(2),
ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImporteRetISR").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR, ImporteRetIVA = x.Sum(Function(s) s("ImporteRetIVA").ToString.ToDecimal).RoundSQL(2),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA,
ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImporteIEPS").ToString.ToDecimal, 2)), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS, ImporteRetISR = x.Sum(Function(s) s("ImporteRetISR").ToString.ToDecimal).RoundSQL(2),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR,
ImporteIEPS = x.Sum(Function(s) s("ImporteIEPS").ToString.ToDecimal).RoundSQL(2), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS,
ImporteIEPSCalculado = (x.Sum(Function(s) s("ImportePU").ToString.ToDecimal) * PorcentajeIEPS).RoundSQL(2), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS,
PorcentajeIVA = PorcentajeIVA, PorcentajeIVA = PorcentajeIVA,
PorcentajeRetIVA = PorcentajeRetIVA, PorcentajeRetIVA = PorcentajeRetIVA,
PorcentajeRetISR = PorcentajeRetISR, PorcentajeRetISR = PorcentajeRetISR,
PorcentajeIEPS = PorcentajeIEPS PorcentajeIEPS = PorcentajeIEPS
'(1 + DrPS("IEPSPorcentaje").ToString.ToDecimal) 'codigo para ajustar tolerancia.
Dim Impuesto = From dd In query
Select PorcentajeIEPS = dd.PorcentajeIEPS,
PorcentajeIVA = dd.PorcentajeIVA,
PorcentajeRetISR = dd.PorcentajeRetISR,
PorcentajeRetIVA = dd.PorcentajeRetIVA,
ImportePU = dd.ImportePU,
ImporteTotal = dd.ImporteTotal,
ImporteIVA = If((dd.ImporteIVA - dd.ImporteIVACalculado).Abs >= ImpuestoTolerancia, dd.ImporteIVACalculado, dd.ImporteIVA),
ImporteRetIVA = dd.ImporteRetIVA,
ImporteRetISR = dd.ImporteRetISR,
ImporteIEPS = If((dd.ImporteIEPS - dd.ImporteIEPSCalculado).Abs >= ImpuestoTolerancia, dd.ImporteIEPSCalculado, dd.ImporteIEPS)
Order By PorcentajeIVA, PorcentajeIEPS
'hay una condicion de verificacion arriba, en la que checa si la diferencia en ieps, es menor a 3 centavos, toma el valor recalculado
Dim DrSubProyecto = GlobalDTSubProyectos(-1, TmpDT.FiltroPrimeroValor("CveSubProyecto", "", "ImporteTotal DESC").ToEntero, UsuarioActual.CveEmpresa, -1).FiltroPrimero("") Dim DrSubProyecto = GlobalDTSubProyectos(-1, TmpDT.FiltroPrimeroValor("CveSubProyecto", "", "ImporteTotal DESC").ToEntero, UsuarioActual.CveEmpresa, -1).FiltroPrimero("")
If DrSubProyecto Is Nothing Then If DrSubProyecto Is Nothing Then
@@ -22014,7 +22034,7 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
DtImpuestos = query.QueryToDataTable(False) DtImpuestos = Impuesto.QueryToDataTable(False)
If Not NCDescuento Then If Not NCDescuento Then
LimpiaDocumentoNC() LimpiaDocumentoNC()
@@ -22035,7 +22055,7 @@ Partial Class Ventas
AgregaTempDT(TmpDTDescNC, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero, AgregaTempDT(TmpDTDescNC, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal, TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal,
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImportePU").ToString.ToDecimal, "", "", -1, -1,
DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1)
Next Next
@@ -22149,8 +22169,8 @@ Partial Class Ventas
End If End If
For Each Dr As DataRow In DtImpuestosLocal.Rows For Each Dr As DataRow In DtImpuestosLocal.Rows
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto")) FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA"), Dr("PorcentajeRetIVA"), Dr("PorcentajeRetISR"), Dr("PorcentajeIEPS"), Dr("CveSubProyecto"))
importePuTemp = (Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr).ToDecimal() - TmpDT.SUM("Descuento", FiltroStr).ToDecimal())) importePuTemp = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr)))
If Not AplicaImpuestosLocales Then If Not AplicaImpuestosLocales Then
importePuTemp = importePuTemp - TotalImpuestosLocales importePuTemp = importePuTemp - TotalImpuestosLocales