From fcd51bd06e4c9c94f127a7dfab178007003704e6 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 16 Dec 2019 13:29:45 -0700 Subject: [PATCH 1/2] Entradas Salidas Redireccionar al generar Prepoliza --- Inventarios/EntradasSalidas.aspx.vb | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 285af40ba..0282b33e1 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3270,6 +3270,9 @@ Partial Class Inventarios_EntradasSalidas Dim ValorInventario As Decimal = 0 Dim ValorInventarioME As Decimal = 0 + Dim CvePrePolizaRegistrada As Integer = -1 + + ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) Dim CveVenta As Integer = ObjInventario.CveVenta Dim MovAlmacen As Boolean = True @@ -3287,6 +3290,7 @@ Partial Class Inventarios_EntradasSalidas If tmpCostos.Rows.Count > 0 Then Dim Concepto As String = If(TxtObservaciones.Text = "", ConceptoPoliza, $" {TxtObservaciones.Text}") Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv_EntradaSalida", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + CvePrePolizaRegistrada = CvePrePoliza If HdnCveOrdenCompra.Value.ToEntero > 0 Then MovAlmacen = False @@ -3362,11 +3366,24 @@ Partial Class Inventarios_EntradasSalidas End If If ErrorMovInv = False Then - ObjInventario.Commit() + ObjInventario.Commit() + ObjInventario.Dispose() + ObjConta.Dispose() + + If CvePrePolizaRegistrada > 0 Then + Response.Redirect($"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaRegistrada}", True) + End If + + + Else + + + ObjInventario.Dispose() + ObjConta.Dispose() + End If - ObjInventario.Dispose() - ObjConta.Dispose() + End Sub From e9f030ba80c874a1312dab986f3f1a2dad1e8042 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 16 Dec 2019 15:25:45 -0700 Subject: [PATCH 2/2] =?UTF-8?q?correcciones=20en=20kardex=20e=20inventario?= =?UTF-8?q?=20detalle,=20peque=C3=B1a=20funcionalidad=20agregada=20al=20pu?= =?UTF-8?q?nto=20de=20venta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsAcumuladores.vb | 21 +++++++++-- Inventarios/InventarioFisicoDetalle.aspx | 39 +++++++++++++-------- Inventarios/InventarioFisicoDetalle.aspx.vb | 4 +-- Inventarios/Kardex.aspx.vb | 7 +++- Ventas/PV.aspx | 2 +- Ventas/PV.aspx.vb | 10 ++++++ 6 files changed, 61 insertions(+), 22 deletions(-) diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index c8917cf1b..593569762 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -583,12 +583,27 @@ Public Class ClsAcumuladores End Try Return Retorno - End Function + End Function + + Public Function GetNuevoConsecutivoFolio(CveFolioGarantia As Integer) As Boolean + Dim Retorno As Boolean = False + SqlDataAdapter(String.Format("SELECT MAX(Consecutivo) + 1 AS NuevoConsecutivo FROM Acum_GarantiasDetalle d WHERE d.CveFolioGarantia = {0}", CveFolioGarantia), CommandType.Text) + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError(String.Format("Ocurrió un error al consultar un nuevo consecutivo para el folio {0}", CveFolioGarantia), ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + #End Region - + #Region " GARANTÍAS MESES " - + Public Function GarantiasMesesGet(CveGarantiaMes As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveTipoUso As Integer = -1, Optional Mes As Integer = -1) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable diff --git a/Inventarios/InventarioFisicoDetalle.aspx b/Inventarios/InventarioFisicoDetalle.aspx index 2a55c0a31..5499ab0b4 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx +++ b/Inventarios/InventarioFisicoDetalle.aspx @@ -89,21 +89,30 @@ -
  • - -
  • -
  • - -
  • -
  • - Imprimir PDF -
  • -
  • - Imprimir PDF Resumido -
  • -
  • - Imprimir EXCEL -
  • + + +
  • + +
  • +
  • + +
  • +
  • + Imprimir PDF +
  • +
  • + Imprimir PDF Resumido +
  • +
  • + Imprimir EXCEL +
  • +
    + + + + + +
    diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index 33153f984..c07b9ca77 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -432,8 +432,8 @@ Partial Class Inventarios_InventarioFisicoDetalle Protected Sub Impimir(Optional Formato As String = "PDF", Optional Agrupar As Boolean = False) Dim DtDatos As New DataTable Dim ObjInventario As New ClsInventarios() - If ObjInventario.GetInventarioFisicoDetalle(CveInventarioFisico, UsuarioActual.CveUsuario, Agrupar:=Agrupar) Then - DtDatos = ObjInventario.DtResultados + If ObjInventario.GetInventarioFisicoDetalle(CveInventarioFisico, ddlUsuario.SelectedValue, Agrupar:=Agrupar) Then + DtDatos = ObjInventario.DtResultados.Copy End If ObjInventario.Dispose() diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 2f9fdb888..b6fe14ec1 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -343,11 +343,16 @@ Partial Class Inventarios_Kardex EntradaSalida = " Solo Salidas" End If + Dim CveTiposAlmacen = "" + For Each item As ListItem In CBLTiposAlmacen.Items + CveTiposAlmacen += If(item.Selected, $"{item.Value},", "") + Next + Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1") Dim SerieAgrupado As String = If(TxtSerie.Text = "", "", $"Existencia y costos calculada por numero de serie: {TxtSerie.Text} ") - If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, "1", DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then + If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index a763ee493..f2660bbdf 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2840,7 +2840,7 @@
    - + diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index eb7260310..1ea131f5e 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -5427,6 +5427,16 @@ Partial Class PV RegistraScript("Recalcula();", "Recalcula") End Sub + Protected Sub DdlFolioGarantia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFolioGarantia.SelectedIndexChanged + Dim ObjAcumuladores As New ClsAcumuladores + If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then + Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo") + TxtConsecutivoAjuste.Text = resultado + UpAjuste.Update() + End If + ObjAcumuladores.Dispose() + End Sub + #End Region #Region "U S A D O S"