From 7107f9420c8bff9ed2c11817997792bf4248bd1a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 8 Feb 2025 19:11:18 -0700 Subject: [PATCH] =?UTF-8?q?--2=20JP=20Replicaci=C3=B3n=20Biosistemas(herma?= =?UTF-8?q?na=20E201),=20PS=20y=20UM=20=20(=20aplica=20lote/cad)=20y=20env?= =?UTF-8?q?iar=20PA=20(5=20lugares),=20=20-=20logo=20OC=20Biosistemas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 5 ++-- Compras/Compras.aspx.vb | 36 ++++++++++++++++++++++++++++ Compras/PopUpVerFactura.aspx.vb | 6 ++--- Inventarios/EntradasSalidas.aspx.vb | 9 +++++++ Inventarios/EntregaAlmacen.aspx.vb | 9 +++++++ Inventarios/RecepcionAlmacen.aspx.vb | 10 ++++++++ Ventas/Ventas.aspx.vb | 16 +++++++++++++ 7 files changed, 86 insertions(+), 5 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e28b5a3b7..07fa440e7 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -6405,20 +6405,21 @@ Public Class ClsInventarios End Function - Public Function ReplicarMovtoEmpresa(CveEmpresa As Integer, CveMovimiento As Integer) As Boolean + Public Function ReplicarMovtoEmpresa(CveEmpresa As Integer, CveMovimiento As Integer, Optional CveMovimientoSecundario As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ReplicaMovtoInterEmpresa") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + .Add("@CveMovimientoSecundario", SqlDbType.Int).Value = CveMovimientoSecundario End With Try SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al consultar los productos por ultimo costo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al replicar el movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a761d1938..908a8771d 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -5883,6 +5883,15 @@ Partial Class Compras_Compras ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 68, ObjInventario.Folio.ToString, ObjInventario.Folio.ToString, CveMovimientoAlmacen:=CveMovimientoInventario) End If + If Not ErrorMovInv Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimientoInventario > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimientoInventario) Then + ErrorMovInv = True + End If + End If + End If + End If Next End If @@ -13910,6 +13919,15 @@ Partial Class Compras_Compras End If Next End If + + If Not ErrorMovInv Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimientoEntrada > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimientoEntrada) Then + ErrorMovInv = True + End If + End If + End If Else ErrorMovInv = True Alert("El Total de la NC debe ser igual al total de la devolucion", TipoMensaje.MsgAdvertencia) @@ -14587,6 +14605,15 @@ Partial Class Compras_Compras End If End If + + If Not ErrorCancelar Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimientoEntrada > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimientoEntrada) Then + ErrorCancelar = True + End If + End If + End If Next End If @@ -19414,6 +19441,15 @@ Partial Class Compras_Compras Respuesta = False End If + If Not Respuesta Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimientoSalida > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimientoSalida) Then + Respuesta = False + End If + End If + End If + End If If Respuesta Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index de7484148..cc779f1fa 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -3163,7 +3163,7 @@ Partial Class PopUpVerFactura If UsuarioActual.CveEmpresa.Contiene(4, 145) Then params.Add(New ReportParameter("FacturadoA", If(CveCompra > 0, dr("RazonSocial").ToString, ""))) End If - If UsuarioActual.CveEmpresa = 119 Then + If UsuarioActual.CveEmpresa.Contiene(119, 199, 201) Then params.Add(New ReportParameter("LogoPath", RutaImagenLogo)) params.Add(New ReportParameter("RazonSocialOC", RazonSocialOC)) @@ -3181,7 +3181,7 @@ Partial Class PopUpVerFactura If CveConcepto = 33 Then ConceptoFormato = "ENTRADA MANUAL" 'IMPRESION ESPECIAL SALIDA DE COMPUPROVEEDORES y VSH - If UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 4, 145, 146, 186, 193, 189) Then + If UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 4, 145, 146, 186, 193, 189, 199, 201) Then params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Concepto", ConceptoFormato)) params.Add(New ReportParameter("Almacen", Almacen)) @@ -3394,7 +3394,7 @@ Partial Class PopUpVerFactura If Archivo.Exists Then 'IMPRESION ESPECIAL SALIDA DE COMPUPROVEEDORES y VSH - If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 4, 145, 146, 186) Then + If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 4, 145, 146, 186, 199, 201) Then Dim CiudadSucursal As String = "" Dim DomicilioSucursal As String = "" Dim DomicilioCliente As String = String.Format("{0} #{1}, {2}, Col. {3}, CP: {4}, {5}, {6}", DtMovimientos(0)("SucClienteDireccion").ToString, DtMovimientos(0)("SucClienteNoExt").ToString, DtMovimientos(0)("SucClienteNoInt").ToString, DtMovimientos(0)("SucClienteColonia"), DtMovimientos(0)("SucClienteCP").ToString, DtMovimientos(0)("SucClienteCiudad"), DtMovimientos(0)("SucClientePais").ToString) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index d6672b5bb..d9d4fac80 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -2306,6 +2306,15 @@ Partial Class Inventarios_EntradasSalidas End If End If + 'REPLICAR MOVTO EN EMPRESA + If Not ErrorMovInv Then + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimiento > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimiento) Then + ErrorMovInv = True + End If + End If + End If + If Not ErrorAC And Not ErrorMovInv Then Dim Msg As New StringBuilder diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 859f7fd37..0ebc61b54 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3380,6 +3380,15 @@ Partial Class Inventarios_EntregaAlmacen End If End If + If Not ErrorMovInv Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimiento > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimiento) Then + ErrorMovInv = True + End If + End If + End If + If Not ErrorMovInv Then ObjInventario.Commit() diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 216ace50e..bd1291701 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2842,6 +2842,16 @@ Partial Class Inventarios_RecepcionAlmacen 'Next End If + + If Not ErrorMovInv Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimiento > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimiento) Then + ErrorMovInv = True + End If + End If + End If + Else ErrorMovInv = True End If diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 10e91c7d3..314e5dcb4 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -16893,6 +16893,13 @@ Partial Class Ventas factura.Inv_ValorInventario = ValorInventario End If + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso factura.Inv_CveMovimiento > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, factura.Inv_CveMovimiento) Then + ErrorList.Add("Ocurrió un error al replicar el movimiento.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") + End If + End If + End If 'DEBE GENERAR MOVIMIENTO SI SE FACTURARON PRODUCTOS, O NO SE REALIZA UNA REFACTURACION @@ -16989,6 +16996,15 @@ Partial Class Ventas End If End If + If Not OcurrioError Then + 'REPLICAR MOVTO GENERADO + If UsuarioActual.CveEmpresa = 199 AndAlso CveMovimientoSalidaPorTraspaso > 0 Then + If Not ObjInventario.ReplicarMovtoEmpresa(UsuarioActual.CveEmpresa, CveMovimientoSalidaPorTraspaso) Then + ErrorList.Add("Ocurrió un error al replicar el movimiento.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") + End If + End If + End If + End If End If