From 8f3526d742afcc76b1f99df51f3cd37e60ab9d27 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 3 Feb 2022 08:32:30 -0700 Subject: [PATCH] Rep Entradas Salidas Almacenes, Compras desvincular AF --- App_Code/ClsAF.vb | 3 +- App_Code/ClsInventarios.vb | 4 +- Compras/Compras.aspx | 9 +- Compras/Compras.aspx.vb | 63 ++++++++ Empresas/152/Formatos/Factura.rdlc | 191 ++++++++++++++++------- Inventarios/RepEntradasSalidas.aspx | 4 +- Inventarios/RepEntradasSalidas.aspx.vb | 14 ++ Inventarios/RepExistenciasCostos.aspx.vb | 4 +- 8 files changed, 227 insertions(+), 65 deletions(-) diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index 1ddd0ed3a..ad8c046c4 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -530,7 +530,7 @@ Public Class ClsAF Return Retorno End Function - Public Function UpdateActivosFijosCompra(CveActivoFijo As Integer, CveCompraDetalle As Integer, TipoAF As Integer, ValorCompra As Double, FechaCompra As Date) As Boolean + Public Function UpdateActivosFijosCompra(CveActivoFijo As Integer, CveCompraDetalle As Integer, TipoAF As Integer, ValorCompra As Double, FechaCompra As Date, Optional Opcion As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_ActivosFijosCompraUpdate") @@ -541,6 +541,7 @@ Public Class ClsAF .Add("@TipoAF", SqlDbType.Int).Value = TipoAF .Add("@ValorCompra", SqlDbType.Float).Value = ValorCompra .Add("@FechaCompra", SqlDbType.Date).Value = FechaCompra + .Add("@Opcion", SqlDbType.Int).Value = Opcion ' Opcion 1 es la actualiacion normal , opcion 2 Desvicula los AF en base a la CveComrpaDetalle(en tabla AF_ActivosFijos pone el campo CveComrpaDetalle en null en base a CveComrpaDetalle ) End With Try diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 80f566d0c..2fcd6752f 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1702,7 +1702,7 @@ Public Class ClsInventarios #Region " INVENTARIOS - REPORTES " - Public Function RepExistenciasCostos(FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProveedores As Integer, CveConcepto As Integer, CvePS As Integer, CveEmpresa As Integer, CveAlmacen As Integer, CveUsuario As Integer, Optional CveClasificacion As Integer = -1, Optional CvePersonal As Integer = -1) As Boolean + Public Function RepExistenciasCostos(FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProveedores As Integer, CveConcepto As Integer, CvePS As Integer, CveEmpresa As Integer, CveAlmacen As String, CveUsuario As Integer, Optional CveClasificacion As Integer = -1, Optional CvePersonal As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_RepExistenciasCostosGet") With SqlAdapter.SelectCommand.Parameters @@ -1710,7 +1710,7 @@ Public Class ClsInventarios .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@CvePS", SqlDbType.Int).Value = CvePS - .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveAlmacen", SqlDbType.VarChar).Value = CveAlmacen .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 209f43a40..413febe66 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -734,7 +734,7 @@ - + <%-- 0 --%> @@ -4476,6 +4476,13 @@ +
+
+ + +
+
+ diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 291b351fa..6865b06b2 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1778,6 +1778,7 @@ Partial Class Compras_Compras If ObjeFacturas.GetFacturasComparacionXML(Version, Xml.ToString, UsuarioActual.CveEmpresa) Then TmpDT = ObjeFacturas.DtResultados TmpDT.Columns.Add("CveSATPSActualizado") + 'TmpDT.Columns.Add("RetIVAPorcentaje") 'TmpDT.Columns.Add("RetISRPorcentaje") 'TmpDT.Columns.Add("IEPSPSPorcentaje") @@ -9929,6 +9930,22 @@ Partial Class Compras_Compras + + If Not TmpDT.Columns.Contains("DesvicularAF") Then + TmpDT.Columns.Add("DesvicularAF", GetType(Boolean)) + End If + + For Each drowAF As DataRow In TmpDT.Rows + If drowAF("DesvicularAF").ToString <> "" AndAlso Boolean.Parse(drowAF("DesvicularAF").ToString) Then + If Not ObjAF.UpdateActivosFijosCompra(-1, drowAF("CveCompraDetalle").ToString.ToEntero, -1, 0, Now, Opcion:=2) Then + Retorno = False + End If + End If + Next + + + + 'If UsuarioActual.Empresa.Funcionalidad(207) = "1" Then If Not ActualizarPrePoliza(ObjContabilidad, ObjCompra) Then Retorno = False @@ -10513,6 +10530,9 @@ Partial Class Compras_Compras tipoCambioPago = 1 End If + + + If ObjConta.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPrePoliza) Then For Each Row As DataRow In ObjConta.DtResultados.Rows @@ -17900,6 +17920,17 @@ Partial Class Compras_Compras ChkAgregar.Checked = False divagregrarotrops.Visible = False + DVModalAddPSChkDesvincularAF.Visible = False + + + Dim TipoAF As Integer = GvRow.DataKey("TipoAF").ToEntero + ChkModalDesvincularAF.Checked = False + + If CveCompra > 0 AndAlso TipoAF = 2 Then + DVModalAddPSChkDesvincularAF.Visible = True + End If + + UpPSS.Update() RegistraScript("$('#divAddProducto').modal('show');") End Sub @@ -18297,6 +18328,38 @@ Partial Class Compras_Compras GuardaAC() End If + + + + + If CveCompra > 0 AndAlso ChkModalDesvincularAF.Checked Then + + + If Not TmpDT.Columns.Contains("DesvicularAF") Then + TmpDT.Columns.Add("DesvicularAF", GetType(Boolean)) + End If + + Dim CveCompraDetalleDesvicnualarAF As Integer = TmpDT.FiltroPrimeroValor("CveCompraDetalle", $"Consec={Index}").ToEntero + 'If ObjAF.UpdateActivosFijosCompra(-1, CveCompraDetalleDesvicnualarAF, -1, 0, Now, Opcion:=2) Then + + For Each dRow As DataRow In TmpDT.Rows + + If dRow("CveCompraDetalle").ToString.ToEntero = CveCompraDetalleDesvicnualarAF Then + dRow("TipoAF") = 0 + dRow("CveActivoFijo") = 0 + dRow("DesvicularAF") = True + + End If + + Next + TmpDT.AcceptChanges() + 'Else + ' Retorno = False + 'End If + + + End If + UpPS.Update() CargaGvPersonal() diff --git a/Empresas/152/Formatos/Factura.rdlc b/Empresas/152/Formatos/Factura.rdlc index 64dfe394e..7716e04b4 100644 --- a/Empresas/152/Formatos/Factura.rdlc +++ b/Empresas/152/Formatos/Factura.rdlc @@ -477,7 +477,7 @@ true - 6.39118in + 6.74118in 0.06752in 1.60919in 8.23953in @@ -2187,7 +2187,7 @@ Textbox5 - 13.24259cm + 14.13159cm 0.24983cm 0.05496cm 20.88652cm @@ -2408,7 +2408,7 @@ Textbox4 - 13.40338cm + 14.29238cm 0.16383cm 2.44366cm 15.5106cm @@ -2443,7 +2443,7 @@ Textbox19 - 5.26303in + 5.61303in 6.21617in 0.17708in 0.94607in @@ -2478,7 +2478,7 @@ Textbox19 - 5.4555in + 5.8055in 6.21616in 0.17966in 0.94607in @@ -2513,7 +2513,7 @@ Textbox19 - 5.65449in + 6.00449in 6.21616in 0.18819in 0.94607in @@ -2548,7 +2548,7 @@ Textbox19 - 5.86074in + 6.21074in 6.22658in 0.17119in 0.94607in @@ -2584,7 +2584,7 @@ Textbox19 - 6.05137in + 6.40137in 6.237in 0.19596in 0.94607in @@ -2620,7 +2620,7 @@ Textbox42 - 5.28803in + 5.61303in 7.16224in 0.17708in 0.98426in @@ -2655,7 +2655,7 @@ Textbox42 - 5.4805in + 5.8055in 7.16224in 0.17966in 0.98425in @@ -2690,7 +2690,7 @@ Textbox42 - 5.67949in + 6.00449in 7.17266in 0.18819in 0.98425in @@ -2726,7 +2726,7 @@ Textbox42 - 5.88574in + 6.21074in 7.17266in 0.17119in 0.98425in @@ -2762,7 +2762,7 @@ Textbox42 - 6.07637in + 6.40137in 7.18308in 0.19596in 0.98425in @@ -2792,7 +2792,7 @@ Textbox5 - 16.1081cm + 16.9971cm 0.10579cm 0.05496cm 20.88652cm @@ -2808,44 +2808,6 @@ 2pt - - true - true - true - - - - - < ** Toda corrección de los datos del comprobante debera efectuarse a más tardar tres dias despues de su expedición. ** > - - - - - - 2pt - 2pt - 2pt - 2pt - - Embedded ID2 @@ -2854,7 +2816,7 @@ 1.15361cm 2.413cm 2.75323cm - 29 + 28 @@ -2911,7 +2873,7 @@ 1.16095cm 0.62233cm 9.17089cm - 30 + 29 @@ -2952,7 +2914,7 @@ 10.47295cm 0.64039cm 9.53276cm - 31 + 30 =IIF((Sum(IIF(UCase(Fields!Clasificacion.Value) = "AJUSTE" , 1, 0), "DsOC") > 0),false,true) @@ -3001,7 +2963,7 @@ 1.15361cm 1.32415cm 19.15078cm - 32 + 31 =IIF((Sum(IIF(Fields!CveClasificacion.Value = 20775,1,0), "DsOC") = 0) and (Sum(IIF(Fields!CveClasificacion.Value = 20774,1,0), "DsOC") > 0),false,true) @@ -3043,7 +3005,7 @@ 1.15361cm 1.05791cm 19.15078cm - 33 + 32 =IIF((Sum(IIF(Fields!CveClasificacion.Value = 20775,1,0), "DsOC") > 0),false,true) @@ -3057,8 +3019,61 @@ 2pt + + true + true + true + + + + + < ** Toda corrección de los datos del comprobante debera efectuarse a más tardar tres dias despues de su expedición. ** > + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + LogoLlantas1 + FitProportional + 12.6957cm + 0.1589cm + 0.85359cm + 20.86494cm + 34 + + + + - 20.32094cm + 21.20994cm