From 4eaab553d4373889dd1a06d3fb31d35de211a564 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 28 May 2020 13:50:20 -0700 Subject: [PATCH 1/4] - permiso proceso 68, bloqueo de txtprecio --- App_Code/ClsBancos.vb | 9 ++++++--- App_Code/ClsCompras.vb | 6 ++++-- Ventas/Ventas.aspx.vb | 4 ++++ vwd.webinfo | 4 ++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 7ac9a2082..64e685e71 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -26,6 +26,9 @@ Public Class ClsBancos 'Atributos de la clase Private disposedValue As Boolean = False ' Para detectar llamadas redundantes + 'CONTROL DE LA CONEXION + Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region @@ -50,8 +53,7 @@ Public Class ClsBancos Public Property FechaIngCancelacion As Date Public Property FechaCancelacion As Date - 'CONTROL DE LA CONEXION - Private CveConexion As Integer = 0 + #End Region #Region " P R O P I E D A D E S - B A N C O S - I E" @@ -189,6 +191,7 @@ Public Class ClsBancos Else SqlConexion = TransaccionCompartida.Connection SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlCommand = New SqlCommand("", SqlConexion) @@ -209,7 +212,7 @@ Public Class ClsBancos #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index b7a1e8828..7f1873b42 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -22,6 +22,7 @@ Public Class ClsCompras Private disposedValue As Boolean = False ' Para detectar llamadas redundantes 'REGISTRAR CONEXIONES ABIERTAS Private CveConexion As Integer = 0 + Private EsTransaccionCompartida As Boolean = False #End Region @@ -62,7 +63,8 @@ Public Class ClsCompras End Try Else SqlConexion = TransaccionCompartida.Connection - SqlTransacc = TransaccionCompartida + SqlTransacc = TransaccionCompartida + EsTransaccionCompartida = True End If SqlAdapter = New SqlDataAdapter("", SqlConexion) @@ -83,7 +85,7 @@ Public Class ClsCompras #Region "Conexiones" Private Sub ConexionAdd() - If ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then + If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then Try DataAdapter("PA_Sis_RegistrarConexion") With SqlAdapter.SelectCommand.Parameters diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 17ef65fca..7e88fa978 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5728,6 +5728,8 @@ Partial Class Ventas End If + If UsuarioActual.TienePermisoProceso(68) Then e.Row.FCTextBox("TxtPrecio").Enabled = False + 'Si es una devolucion If NuevaFactura = 0 Then e.Row.FCDropDownList("DdlUnidadMedida").Enabled = False @@ -13727,6 +13729,8 @@ Partial Class Ventas TxtPrecio.Enabled = True End If + If UsuarioActual.TienePermisoProceso(68) Then TxtPrecio.Enabled = False + If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString()) CambiaMoneda() diff --git a/vwd.webinfo b/vwd.webinfo index 7db700c64..c8632d677 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -60,6 +60,10 @@ + + + + From 99b731ec4dd9178d9f5d5f6206a5214abf400832 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 28 May 2020 17:15:53 -0700 Subject: [PATCH 2/4] =?UTF-8?q?Surtir=20refacturaci=C3=B3n=20parcial=20o?= =?UTF-8?q?=20total?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 36 +++++++++++++++++++++++++++ App_Code/Modelos.vb | 16 ++++++++++-- Ventas/Ventas.aspx.vb | 50 ++++++++++++++++++++++---------------- 3 files changed, 79 insertions(+), 23 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index ffbec5e23..c3e594665 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2942,6 +2942,24 @@ Public Class ClsInventarios Return Retorno End Function + Public Function UpdateEstatusAlmacen(CveVentaDetalle As Integer, Valor As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("Vta_UpdateDevolucionVentaDetalle") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVenta + .Add("@Valor", SqlDbType.Int).Value = Valor + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la devolucion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function LimpiaEntregaDirecta(CveMovimiento As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_LimpiaEntregaDirecta") @@ -3062,6 +3080,24 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetSaldoVentaDetalle(CveVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentaDetalleSaldo") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener datos de almacen por detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function GetMovimientosDevoluciones(CveVenta As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentaDetalleAlmacenDevolucion") diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index c3c7db3ce..4fae8a392 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -3201,12 +3201,12 @@ Namespace Modelos End If 'Factura - If Not ObjEventos.AddEventoBitacora($"Sustituye a: Folio Factura", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then + If Not ObjEventos.AddEventoBitacora($"Remisión facturada: Folio Factura", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then ErrorPrepoliza = True End If 'Remision - If Not ObjEventos.AddEventoBitacora($"Refacturacion en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then + If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then ErrorPrepoliza = True End If @@ -4269,6 +4269,18 @@ Namespace Modelos Dim ObjE As New ClsOIEventos() ObjE.AddEventoBitacora(msgBitacora, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) ObjE.Dispose() + Else + + If CveEstatus = 5 Then + Dim ObjE As New ClsOIEventos() + ObjE.AddEventoBitacora("La cancelación de la factura fue aceptada en el SAT", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) + ObjE.Dispose() + ElseIf CveEstatus = 4 Then + Dim ObjE As New ClsOIEventos() + ObjE.AddEventoBitacora("No se pudo comprobar el estatus de factura ante el SAT, solo sera cancelada en el sistema", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) + ObjE.Dispose() + End If + End If 'SI ES CANCELACION EN PROCESO CANCELA EL PROCESO DE LAS REMISIONES diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b775018f3..8e596627b 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -7003,28 +7003,36 @@ Partial Class Ventas Dim ObjNC As List(Of Object) = Nothing If ErrorList.Count = 0 Then If NuevaFactura = 1 Then - 'Si directamente como cancelada sin aceptación, debe de generar la cancelacion aquí - 'If Me.CveEstatusRefacturacion = 0 Then ' cuando es refacturación sin aceptación debe de cancelar y reducir saldo - ' ObjNC = generaNC(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, ObjEventos) - ' If ObjNC Is Nothing Then - ' ErrorList.Add("No se pudo Cancelar la Factura") - ' End If - 'End If - 'Esquema viejo, evitamos que aparezca por surtir - If ErrorList.Count = 0 Then - 'MARCAR VENTA ANTERIOR - If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then + 'SI YA ESTA MARCADA LA VENTA ANTERIOR + If DevolucionAlmacenNC = 2 Then + If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") End If - - 'MARCAR VENTA ANTERIOR - If VentaSaldoAlmacenNC <> 0 OrElse DevolucionAlmacenNC = 2 Then - If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then - ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") - End If - End If - End If + + 'MARCAR VENTA ANTERIOR + If Not ObjInventario.ActualizarEsDevolucionVenta(CveDevolucion, 2) Then + ErrorList.Add("No se pudo Cancelar el movimiento de almacen de la Factura") + End If + + 'MARCA LO PENDIENTE A NIVEL DETALLE + Dim DtMovDetalles As DataTable = Nothing + If ObjInventario.GetSaldoVentaDetalle(ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then + DtMovDetalles = ObjInventario.DtResultados.Copy() + End If + + If DtMovDetalles IsNot Nothing Then + For Each Row As DataRow In DtMovDetalles.Rows + Dim SaldoAlmacen As Decimal = Row("SaldoAlmacen").ToString().ToEntero() + If SaldoAlmacen < 0 Then + ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalle").ToString().ToEntero(), 1) + ElseIf SaldoAlmacen = 0 Then + ObjInventario.UpdateEstatusAlmacen(Row("CveVentaDetalle").ToString().ToEntero(), 0) + End If + Next + End If + + DtMovDetalles.Dispose() End If End If @@ -11104,12 +11112,12 @@ Partial Class Ventas End If 'Factura - If Not ObjEventos.AddEventoBitacora($"Sustituye a: Folio Factura", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then + If Not ObjEventos.AddEventoBitacora($"Remisión facturada : {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then ErrorPrepoliza = True End If 'Remision - If Not ObjEventos.AddEventoBitacora($"Refacturacion en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then + If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: {ObjFactura.Folio}", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then ErrorPrepoliza = True End If Next From 9f802a230b8045cb5ad356f858a572e82c8b1597 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 28 May 2020 17:16:33 -0700 Subject: [PATCH 3/4] Columna "Cantidad" en execel de seccion almacen --- Inventarios/AjustesSeccionAlmacen.aspx | 4 +- Inventarios/AjustesSeccionAlmacen.aspx.vb | 117 ++++++++++++---------- 2 files changed, 67 insertions(+), 54 deletions(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx b/Inventarios/AjustesSeccionAlmacen.aspx index 795fb5427..c54c8728c 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx +++ b/Inventarios/AjustesSeccionAlmacen.aspx @@ -60,7 +60,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index db2791104..ec0aeb1f9 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -184,28 +184,32 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim ErrorArchivo = False If Not ErrorArchivo AndAlso DtExcel IsNot Nothing Then - If Not DtExcel.Columns(0).ColumnName = "Código" Then + If Not DtExcel.Columns(0).ColumnName = "Cantidad" Then + Alert("El nombre de la primera columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + If Not DtExcel.Columns(1).ColumnName = "Código" Then Alert("El nombre de la segunda columna debe ser 'Código'.Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If - If Not DtExcel.Columns(1).ColumnName = "Producto/Servicio" Then - Alert("El nombre de la cuarta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError) + If Not DtExcel.Columns(2).ColumnName = "Producto/Servicio" Then + Alert("El nombre de la tercera columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If - If Not DtExcel.Columns(2).ColumnName = "SeccionAlmacen" Then - Alert("El nombre de la quinta columna debe ser 'SeccionAlmacen'. Favor de corregirlo", TipoMensaje.MsgError) + If Not DtExcel.Columns(3).ColumnName = "SeccionAlmacen" Then + Alert("El nombre de la cuarta columna debe ser 'SeccionAlmacen'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If - If Not DtExcel.Columns(3).ColumnName = "Serie" Then - Alert("El nombre de la sexta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError) + If Not DtExcel.Columns(4).ColumnName = "Serie" Then + Alert("El nombre de la quinta columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If - If Not DtExcel.Columns(4).ColumnName = "Lote" Then - Alert("El nombre de la séptima columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError) + If Not DtExcel.Columns(5).ColumnName = "Lote" Then + Alert("El nombre de la sexta columna debe ser 'Lote'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If - If Not DtExcel.Columns(5).ColumnName = "FechaCaducidad" Then - Alert("El nombre de la octava columna debe ser 'FechaCaducidad'. Favor de corregirlo", TipoMensaje.MsgError) + If Not DtExcel.Columns(6).ColumnName = "FechaCaducidad" Then + Alert("El nombre de la séptima columna debe ser 'FechaCaducidad'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If @@ -239,17 +243,21 @@ Partial Class Inventarios_AjustesSeccionAlmacen For Each RowExcel As DataRow In DtExcel.Rows - Dim Codigo As String = RowExcel("Código").ToString.Trim - Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).Rows(0) + Dim Codigo As String = RowExcel("Código").ToString.Trim() + Dim PS As String = RowExcel("Producto/Servicio").ToString().Trim() + + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Codigo).FiltroPrimero($"PS='{PS}'") If DrPS IsNot Nothing Then If Not ErrorMovInv Then + + Dim CantidadEntrada As Decimal = RowExcel("Cantidad").ToString().ToDecimal() + Dim CvePS As Integer = DrPS("CvePS").ToString().ToEntero() Dim CveUM As Integer = DrPS("CveUM").ToString().ToEntero() - Dim ProductoServicio As String = RowExcel("Producto/Servicio").ToString.Trim Dim SeccionAlmacen As String = RowExcel("SeccionAlmacen").ToString.Trim - Dim CveSeccionAlmacen As Integer = dtSecciones.FiltroPrimeroValor("CveSeccion", $"AlmacenSeccion='{SeccionAlmacen}'") + Dim CveSeccionAlmacen As Integer = dtSecciones.FiltroPrimeroValor("CveSeccion", $"SeccionAlmacen='{SeccionAlmacen}'") Dim Serie As String = RowExcel("Serie").ToString() Dim Lote As String = RowExcel("Lote").ToString() @@ -257,47 +265,52 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS}") - Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() - Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal() - Dim SerieSalida As String = RowExistencia("Serie").ToString() - Dim LoteSalida As String = RowExistencia("Lote").ToString() - Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate - Dim PUSalida As Decimal = RowExistencia("PU").ToString() + If RowExistencia IsNot Nothing Then + Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero() + Dim CantidadSalida As Decimal = RowExistencia("Existencia").ToString().ToDecimal() + Dim SerieSalida As String = RowExistencia("Serie").ToString() + Dim LoteSalida As String = RowExistencia("Lote").ToString() + Dim FechaCaducidadSalida As Date = IfNull(RowExistencia("FechaCaducidad"), MinFecha).ToString.ToDate + Dim PUSalida As Decimal = RowExistencia("PU").ToString() - '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 - Exit For - End If - - Dim CveMovimientoDetalleSalida As Integer = ObjInventario.CveMovimientoDetalle - - ErrorMovInv = CveMovimientoDetalleSalida <= 0 - - 'GENERA LA ENTRADA DE LOS PRODUCTOS QUE SE DIERON ENTRADA - If Not ErrorMovInv Then - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa, CveMovimientoDetalle:=CveMovimientoDetalleSalida) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0) - - Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero() - Dim CantidadEntrada As Decimal = RowEntrada("Cantidad").ToString().ToDecimal() - Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal() - Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero() - - Dim CostoIndirecto As Decimal = RowEntrada("CostoIndirecto").ToString().ToDecimal() - - 'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION - ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True) - - 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 - Exit For - End If - - Else + '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 + Exit For End If + + Dim CveMovimientoDetalleSalida As Integer = ObjInventario.CveMovimientoDetalle + + ErrorMovInv = CveMovimientoDetalleSalida <= 0 + + 'GENERA LA ENTRADA DE LOS PRODUCTOS QUE SE DIERON ENTRADA + If Not ErrorMovInv Then + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa, CveMovimientoDetalle:=CveMovimientoDetalleSalida) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then + Dim RowEntrada As DataRow = ObjInventario.DtResultados.Rows(0) + + Dim CvePSEntrada = RowEntrada("CvePS").ToString().ToEntero() + Dim PUEntrada As Decimal = RowEntrada("PUOriginal").ToString().ToDecimal() + Dim CveUMEntrada As Integer = RowEntrada("CveUM").ToString().ToEntero() + + Dim CostoIndirecto As Decimal = RowEntrada("CostoIndirecto").ToString().ToDecimal() + + 'ACTUALIZAMOS EL PS, PARA QUE TENGA EL APLICA SECCION + ErrorMovInv = Not ObjPS.UpdateAplicaSeccionAlmacen(CvePS, UsuarioActual.CveEmpresa, True) + + 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 + Exit For + End If + + Else + ErrorMovInv = True + End If + End If + Else + ErrorMovInv = True + RowNoEncontrados.AppendFormat("{0},", Codigo) End If + End If Else ErrorMovInv = True From bfc72f7078fca646a79605bf4ea163bd061af6f0 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 28 May 2020 17:16:53 -0700 Subject: [PATCH 4/4] Campo EsInterno en movimiento de salida --- Inventarios/EntregaAlmacen.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d67ae98cc..251fa5deb 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -1980,7 +1980,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)) 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("CveSeccion").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