diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index 97ce501d7..cbbcfb90e 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -6603,18 +6603,18 @@ Public Class ClsContPAQi #End Region #Region "M O V I M I E N T O S - A U X I L I A R E S - C A T A L O G O" - Public Function GetMovimientosAuxiliaresCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer) As Boolean + Public Function GetMovimientosAuxiliaresCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, Optional IdSegNeg As Integer = -1) As Boolean Dim Retorno = False - If Not FNC_Total() Then + If Not FNC_Total_Segmento() Then Return Retorno End If - If Not FNC_Cargos() Then + If Not FNC_Cargos_Segmento() Then Return Retorno End If - If Not FNC_Abonos() Then + If Not FNC_Abonos_Segmento() Then Return Retorno End If @@ -6659,12 +6659,12 @@ Public Class ClsContPAQi StrSQL.Append(" ) ") StrSQL.Append(" INSERT INTO #TEMP ") 'StrSQL.AppendLine(" -- SE LLENA LA TABLA TEMPORAL CON EL ARBOL DEL WITH CON JOINS DE CUENTAS SUPERIORES ") - StrSQL.Append(" SELECT T.*, ISNULL (dbo.FNC_Total(T.Id, CAST('1900-01-01' AS DATE),@FechaF,@CveMoneda), 0) AS SaldoActual ") '-- CASE WHEN Tipo IN ('A','B') THEN ISNULL(T.SaldoInicial + T.Cargos - T.Abonos,0) ELSE ISNULL(T.SaldoInicial + T.Abonos - T.Cargos,0) END AS SaldoActual + StrSQL.Append(" SELECT T.*, ISNULL (dbo.FNC_Total_Segmento(T.Id, CAST('1900-01-01' AS DATE),@FechaF,@CveMoneda,@IdSegNeg), 0) As SaldoActual ") '-- CASE WHEN Tipo IN ('A','B') THEN ISNULL(T.SaldoInicial + T.Cargos - T.Abonos,0) ELSE ISNULL(T.SaldoInicial + T.Abonos - T.Cargos,0) END AS SaldoActual StrSQL.Append(" FROM (") - StrSQL.Append(" SELECT C.Id, C.Nombre, C.Tipo, C.CtaMayor, '' AS Clasificacion, Orden,") - StrSQL.Append(" ISNULL (dbo.FNC_Total(c.Id, CAST('1900-01-01' AS DATE),EOMONTH(@FechaI, -1 ),@CveMoneda), 0) AS SaldoInicial,") - StrSQL.Append(" ISNULL (dbo.FNC_Cargos(c.Id, @FechaI, @FechaF,@CveMoneda), 0) AS Cargos,") - StrSQL.Append(" ISNULL (dbo.FNC_Abonos(c.Id, @FechaI, @FechaF,@CveMoneda), 0) AS Abonos,") + StrSQL.Append(" Select C.Id, C.Nombre, C.Tipo, C.CtaMayor, '' AS Clasificacion, Orden,") + StrSQL.Append(" ISNULL (dbo.FNC_Total_Segmento(c.Id, CAST('1900-01-01' AS DATE),EOMONTH(@FechaI, -1 ),@CveMoneda,@IdSegNeg), 0) AS SaldoInicial,") + StrSQL.Append(" ISNULL (dbo.FNC_Cargos_Segmento(c.Id, @FechaI, @FechaF,@CveMoneda,@IdSegNeg), 0) AS Cargos,") + StrSQL.Append(" ISNULL (dbo.FNC_Abonos_Segmento(c.Id, @FechaI, @FechaF,@CveMoneda,@IdSegNeg), 0) AS Abonos,") StrSQL.Append(" Level as Nivel,") StrSQL.Append(" CASE WHEN ISNUMERIC (C.Codigo) = 1 THEN FORMAT (CAST (C.Codigo AS FLOAT), (SELECT REPLACE (Mascarilla, 'X', '0') FROM Parametros)) ELSE C.Codigo END AS Codigo,") StrSQL.Append(" CASE WHEN ISNUMERIC (CT.Codigo) = 1 THEN FORMAT (CAST (CT.Codigo AS FLOAT), (SELECT REPLACE (Mascarilla, 'X', '0') FROM Parametros)) ELSE CT.Codigo END AS CodigoSup, Ct.Nombre as Sup,") @@ -6743,12 +6743,18 @@ Public Class ClsContPAQi StrSQL.Append(" LEFT JOIN MovimientosPoliza MP ON T.ID = MP.IdCuenta AND MP.Fecha < CAST('0001-01-01' AS DATE)") StrSQL.Append(" LEFT JOIN TiposPolizas TP ON MP.TipoPol = TP.Codigo") StrSQL.Append(" LEFT JOIN Polizas P ON MP.IdPoliza = P.Id") + StrSQL.Append(" WHERE (MP.IdSegNeg = @IdSegNeg OR ( @IdSegNeg =-1 OR MP.IdSegNeg IS NULL)) ") + + StrSQL.Append(" UNION") StrSQL.AppendFormat(" SELECT T.*, MP.Concepto, MP.Fecha, TP.Nombre AS TipoPoliza, MP.Folio, MP.Id AS IdMovimientoPoliza, MP.Referencia, CASE WHEN MP.TipoMovto = 0 THEN MP.{0} ELSE 0 END, CASE WHEN MP.TipoMovto = 1 THEN MP.{0} ELSE 0 END, MP.IdPoliza, P.Concepto AS ConceptoPadre", If(CveMoneda = 1, "Importe", "ImporteME")) StrSQL.Append(" FROM #TEMP T") StrSQL.Append(" LEFT JOIN MovimientosPoliza MP ON T.ID = MP.IdCuenta AND CAST(MP.Fecha AS DATE) BETWEEN @FechaI AND @FechaF") StrSQL.Append(" LEFT JOIN TiposPolizas TP ON MP.TipoPol = TP.Codigo") StrSQL.Append(" LEFT JOIN Polizas P ON MP.IdPoliza = P.Id") + StrSQL.Append(" WHERE (MP.IdSegNeg = @IdSegNeg OR ( @IdSegNeg =-1 OR MP.IdSegNeg IS NULL)) ") + + StrSQL.Append(" ) AS T") StrSQL.Append(" ) TT") 'StrSQL.AppendLine(" --PRIMER GROUPING SON LAS CABECERAS Y TOTALES DE LAS CUENTAS, SEGUNDO GROUPING SON LOS MOVIMIENTOS DE LAS CUENTAS") @@ -6777,6 +6783,7 @@ Public Class ClsContPAQi .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@IdCuentaPadre", SqlDbType.Int).Value = IdCuenta .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda + .Add("@IdSegNeg", SqlDbType.Int).Value = IdSegNeg End With Try @@ -11035,7 +11042,7 @@ Public Class ClsContPAQi StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ") StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ") StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ") - StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ") + StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ") StrSQL.Append(" RETURN @Total; ") StrSQL.Append(" END; ") @@ -11104,7 +11111,7 @@ Public Class ClsContPAQi StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ") StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ") StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ") - StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ") + StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ") StrSQL.Append(" RETURN @Total; ") StrSQL.Append(" END; ") @@ -11198,6 +11205,233 @@ Public Class ClsContPAQi #End Region +#Region "Funciones con Segmento" + + + Public Function FNC_Total_Segmento() As Boolean + + Dim Retorno = False + StrSQL.Clear() + StrSQL.Append(" IF OBJECT_ID ('FNC_Total_Segmento') IS NOT NULL DROP FUNCTION FNC_Total_Segmento") + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + + Try + SqlAdapter.SelectCommand.ExecuteNonQuery() + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar la funcion FNC_Total_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + + StrSQL.Clear() + StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_Total_Segmento] ") + StrSQL.Append(" ( ") + StrSQL.Append(" @IdCtaSup INT, ") + StrSQL.Append(" @FechaI DATE, ") + StrSQL.Append(" @FechaF DATE, ") + StrSQL.Append(" @CveMoneda INT = 1, ") + StrSQL.Append(" @IdSegNeg INT =-1 ") + StrSQL.Append(" ) ") + StrSQL.Append(" RETURNS FLOAT ") + StrSQL.Append(" AS ") + StrSQL.Append(" BEGIN ") + StrSQL.Append(" ") + StrSQL.Append(" DECLARE ") + StrSQL.Append(" @Total FLOAT, ") + StrSQL.Append(" @TipoCuenta VARCHAR(1), ") + StrSQL.Append(" @FechaFF DATE; ") + StrSQL.Append(" ") + StrSQL.Append(" SET @TipoCuenta = (SELECT Tipo FROM Cuentas WHERE id = @IdCtaSup); ") + StrSQL.Append(" ") + StrSQL.Append(" WITH Estructura(IdCtaSup, IdSubCtade) AS ") + StrSQL.Append(" ( ") + StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ") + StrSQL.Append(" FROM Asociaciones a ") + StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ") + StrSQL.Append(" WHERE a.IdSubCtade = @IdCtaSup ") + StrSQL.Append(" ") + StrSQL.Append(" UNION ALL ") + StrSQL.Append(" ") + StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ") + StrSQL.Append(" FROM Asociaciones a ") + StrSQL.Append(" INNER JOIN Estructura e ON a.IdCtaSup = e.IdSubCtade ") + StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ") + StrSQL.Append(" ) ") + StrSQL.Append(" SELECT @Total = SUM (CASE ") + StrSQL.Append(" WHEN @TipoCuenta IN ('A', 'B', 'E', 'G') THEN CASE WHEN p.TipoMovto = 1 THEN CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) * -1 ELSE CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) END ") + StrSQL.Append(" WHEN @TipoCuenta IN ('B', 'D', 'F', 'H', 'C') THEN CASE WHEN p.TipoMovto = 0 THEN CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) * -1 ELSE CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) END ") + StrSQL.Append(" ELSE 0 ") + StrSQL.Append(" END ") + StrSQL.Append(" ) ") + StrSQL.Append(" FROM Estructura e ") + StrSQL.Append(" INNER JOIN Asociaciones a ON e.IdSubCtade = a.IdSubCtade ") + StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ") + StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ") + StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ") + StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF AND (@IdSegNeg = -1 OR p.IdSegNeg = @IdSegNeg); ") + StrSQL.Append(" RETURN @Total; ") + StrSQL.Append(" END; ") + + + + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + + Try + SqlAdapter.SelectCommand.ExecuteNonQuery() + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al crear la funcion FNC_Total_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function FNC_Cargos_Segmento() As Boolean + + Dim Retorno = False + StrSQL.Clear() + StrSQL.Append(" IF OBJECT_ID ('FNC_Cargos_Segmento') IS NOT NULL DROP FUNCTION FNC_Cargos_Segmento") + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + + Try + SqlAdapter.SelectCommand.ExecuteNonQuery() + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar la funcion FNC_Cargos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + + StrSQL.Clear() + StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_Cargos_Segmento] ") + StrSQL.Append(" ( ") + StrSQL.Append(" @IdCtaSup INT, ") + StrSQL.Append(" @FechaI DATE, ") + StrSQL.Append(" @FechaF DATE, ") + StrSQL.Append(" @CveMoneda INT = 1, ") + StrSQL.Append(" @IdSegNeg INT =-1 ") + StrSQL.Append(" ) ") + StrSQL.Append(" RETURNS FLOAT ") + StrSQL.Append(" AS ") + StrSQL.Append(" BEGIN ") + StrSQL.Append(" ") + StrSQL.Append(" DECLARE @Total FLOAT; ") + StrSQL.Append(" DECLARE @TipoCuenta VARCHAR(1); ") + StrSQL.Append(" SET @TipoCuenta = (SELECT Tipo FROM Cuentas WHERE id = @IdCtaSup); ") + StrSQL.Append(" ") + StrSQL.Append(" WITH Estructura(IdCtaSup, IdSubCtade) AS ") + StrSQL.Append(" ( ") + StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ") + StrSQL.Append(" FROM Asociaciones a ") + StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ") + StrSQL.Append(" WHERE a.IdSubCtade = @IdCtaSup ") + StrSQL.Append(" ") + StrSQL.Append(" UNION ALL ") + StrSQL.Append(" ") + StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ") + StrSQL.Append(" FROM Asociaciones a ") + StrSQL.Append(" INNER JOIN Estructura e ON a.IdCtaSup = e.IdSubCtade ") + StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ") + StrSQL.Append(" ) ") + StrSQL.Append(" SELECT @Total = SUM (CASE WHEN p.TipoMovto = 0 THEN CAST (ISNULL (CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY), 0)AS MONEY) ELSE 0 END) ") + StrSQL.Append(" FROM Estructura e ") + StrSQL.Append(" INNER JOIN Asociaciones a ON e.IdSubCtade = a.IdSubCtade ") + StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ") + StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ") + StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ") + StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF AND (@IdSegNeg = -1 OR p.IdSegNeg = @IdSegNeg); ") + StrSQL.Append(" RETURN @Total; ") + StrSQL.Append(" END; ") + + + + + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + + Try + SqlAdapter.SelectCommand.ExecuteNonQuery() + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al crear la funcion FNC_Cargos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function FNC_Abonos_Segmento() As Boolean + + Dim Retorno = False + StrSQL.Clear() + StrSQL.Append(" IF OBJECT_ID ('FNC_Abonos_Segmento') IS NOT NULL DROP FUNCTION FNC_Abonos_Segmento") + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + + Try + SqlAdapter.SelectCommand.ExecuteNonQuery() + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar la funcion FNC_Abonos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + + StrSQL.Clear() + StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_Abonos_Segmento] ") + StrSQL.Append(" ( ") + StrSQL.Append(" @IdCtaSup INT, ") + StrSQL.Append(" @FechaI DATE, ") + StrSQL.Append(" @FechaF DATETIME, ") + StrSQL.Append(" @CveMoneda INT = 1 , ") + StrSQL.Append(" @IdSegNeg INT =-1 ") + StrSQL.Append(" ) ") + StrSQL.Append(" RETURNS FLOAT ") + StrSQL.Append(" AS ") + StrSQL.Append(" BEGIN ") + StrSQL.Append(" ") + StrSQL.Append(" DECLARE @Total FLOAT; ") + StrSQL.Append(" DECLARE @TipoCuenta VARCHAR(1); ") + StrSQL.Append(" SET @TipoCuenta = (SELECT Tipo FROM Cuentas WHERE id = @IdCtaSup); ") + StrSQL.Append(" ") + StrSQL.Append(" WITH Estructura(IdCtaSup, IdSubCtade) AS ") + StrSQL.Append(" ( ") + StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ") + StrSQL.Append(" FROM Asociaciones a ") + StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ") + StrSQL.Append(" WHERE a.IdSubCtade = @IdCtaSup ") + StrSQL.Append(" ") + StrSQL.Append(" UNION ALL ") + StrSQL.Append(" ") + StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ") + StrSQL.Append(" FROM Asociaciones a ") + StrSQL.Append(" INNER JOIN Estructura e ON a.IdCtaSup = e.IdSubCtade ") + StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ") + StrSQL.Append(" ) ") + StrSQL.Append(" SELECT @Total = SUM (CASE WHEN p.TipoMovto = 1 THEN CAST (ISNULL (CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY), 0)AS MONEY) ELSE 0 END) ") + StrSQL.Append(" FROM Estructura e ") + StrSQL.Append(" INNER JOIN Asociaciones a ON e.IdSubCtade = a.IdSubCtade ") + StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ") + StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ") + StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ") + StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF AND (@IdSegNeg = -1 OR p.IdSegNeg = @IdSegNeg); ") + StrSQL.Append(" RETURN @Total; ") + StrSQL.Append(" END; ") + + + + + + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + + Try + SqlAdapter.SelectCommand.ExecuteNonQuery() + Retorno = True + Catch ex As Exception + Me.OnError("Ocurrió un error al crear la funcion FNC_Abonos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + +#End Region + + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index e5d8cb414..77de3378d 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -869,7 +869,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetMovimientosDetallePorPersonal(CvePersonal As Integer, CveAlmacen As Integer, CveCliente As Integer, CveProveedor As Integer) As Boolean + Public Function GetMovimientosDetallePorPersonal(CvePersonal As Integer, CveAlmacen As Integer, CveCliente As Integer, CveProveedor As Integer, Optional Tipo As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_MovimientosPorPersonalGet") @@ -879,6 +879,7 @@ Public Class ClsInventarios .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@Tipo", SqlDbType.Int).Value = Tipo End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 0bcf64bbb..e5b7003f2 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -3425,10 +3425,11 @@ Public Class Timbrado swmili = sw.ElapsedMilliseconds sw.Start() + Me.UUID = FolioFiscal If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then 'Actualiza Estatus Factura - If Ventas.CveVenta > 0 Then + If Ventas.CveVenta > 0 Then Using ObjVentas As New ClsVentas() diff --git a/Bin/ADSNetLibrary.dll b/Bin/ADSNetLibrary.dll index 562d17536..bffa74fee 100644 Binary files a/Bin/ADSNetLibrary.dll and b/Bin/ADSNetLibrary.dll differ diff --git a/Contabilidad/RepAnexoCatalogo.aspx.vb b/Contabilidad/RepAnexoCatalogo.aspx.vb index bb8aba1fe..3cd3a76cd 100644 --- a/Contabilidad/RepAnexoCatalogo.aspx.vb +++ b/Contabilidad/RepAnexoCatalogo.aspx.vb @@ -282,7 +282,7 @@ Partial Class AC_RepAnexoCatalogo e.Row.FCHyperLink("HLSaldoActual").ForeColor = Drawing.Color.Red End If - e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?ID={0}&FI={1}&FF={2}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString) + e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?ID={0}&FI={1}&FF={2}&IdSegNeg={3}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, DdlSegmentoNegocio.SelectedValue.ToEntero) End If End Sub #End Region diff --git a/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb b/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb index 30f7d6f89..2e02836e7 100644 --- a/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb +++ b/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb @@ -18,6 +18,20 @@ Partial Class AC_RepAnexoCatalogoSegmento ViewState("DtDatos") = value End Set End Property + + Private Property DTCabeceras As DataTable + Get + DTCabeceras = DirectCast(ViewState("DTCabeceras"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DTCabeceras") = value + End Set + End Property + + + + Private Property FechaInicio As Date Get FechaInicio = ViewState("FechaInicio").ToString.ToDate @@ -225,7 +239,7 @@ Partial Class AC_RepAnexoCatalogoSegmento Private Sub CargaDatos() Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - Dim DTCabeceras As New DataTable + 'Dim DTCabeceras As New DataTable TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero) If ObjConta.GetEstadoActividadesSegmentoDetalle(FechaInicio, FechaFin, IdCuenta, Segmentos) Then @@ -250,17 +264,15 @@ Partial Class AC_RepAnexoCatalogoSegmento CType(GvDatos.Columns(IndexGV), BoundField).DataField = Dr("id").ToString GvDatos.Columns(IndexGV).HeaderText = Dr("Nombre").ToString - GvDatos.Columns(IndexGV).Visible = True CType(GvDatos.Columns(IndexGV), BoundField).DataField = Dr("id").ToString GvDatos.Columns(IndexGV).HeaderText = Dr("Nombre").ToString - - IndexActual = IndexActual + 1 If IndexGV >= 200 Then Exit For End If + Next @@ -292,6 +304,25 @@ Partial Class AC_RepAnexoCatalogoSegmento End If + Dim IndexActual As Integer = 0 + For Each Dr As DataRow In DTCabeceras.Rows + + Dim IndexGV As Integer = 3 + IndexActual + + + + e.Row.Cells(IndexGV).Text = $"{e.Row.Cells(IndexGV).Text }" + + + + IndexActual = IndexActual + 1 + If IndexGV >= 200 Then + Exit For + End If + + Next + + End If End Sub #End Region diff --git a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx index 8dec8d81c..eb419142f 100644 --- a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx +++ b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx @@ -83,9 +83,15 @@
>
- +
- + + +
+ + +
+
diff --git a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb index e9dbdeb0f..937506849 100644 --- a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb +++ b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb @@ -52,6 +52,21 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo ViewState("IdCuenta") = value End Set End Property + + Private Property IdSegNeg As Integer + Get + If ViewState("IdSegNeg") Is Nothing Then + ViewState("IdSegNeg") = -1 + End If + + Return ViewState("IdSegNeg").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("IdSegNeg") = value + End Set + End Property + + Private Property TotalPadre As Boolean Get TotalPadre = CBool(ViewState("TotalPadre")) @@ -78,14 +93,19 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo Dim ErrorParametros = True CargaTipoCuentas() + CargaMoneda() + CargaSegmentosNegocio() + TxtCuenta.Enabled = False - DdlMoneda.DataSource = GlobalDTMonedas - DdlMoneda.DataBind() If Request("ID") IsNot Nothing AndAlso IsNumeric(Request("ID")) AndAlso Request("ID").ToEntero > 0 Then If Request("FF") IsNot Nothing AndAlso Request("FF").ToString.Length = 10 AndAlso Request("FF").ToDate > "01/01/1000".ToDate Then + IdCuenta = Request("ID").ToEntero + + IdSegNeg = If(Request("IdSegNeg") IsNot Nothing AndAlso Request("IdSegNeg").ToString.ToEntero > 0, Request("IdSegNeg").ToString.ToEntero, -1) + HdnCveCuenta.Value = IdCuenta.ToString FechaFin = Request("FF").ToDate @@ -113,6 +133,8 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo End If End If + DdlSegmentoNegocio.SelectedValueExist(IdSegNeg) + End If End If @@ -128,6 +150,27 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo End If End Sub + + Private Sub CargaSegmentosNegocio() + Dim ObjContpaq As New ClsContPAQi(UsuarioActual.Empresa) + Dim strGlobal As String = "" + + If ObjContpaq.GetSegmentosNegocio(-1, "-1") Then + DdlSegmentoNegocio.DataSource = ObjContpaq.DtResultados + DdlSegmentoNegocio.DataBind() + End If + ObjContpaq.Dispose() + DdlSegmentoNegocio.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSegmentoNegocio.SelectedValue = "-1" + End Sub + + + Private Sub CargaMoneda() + DdlMoneda.DataSource = GlobalDTMonedas + DdlMoneda.DataBind() + + End Sub + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) @@ -178,7 +221,7 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo Private Sub CargaDatos() Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa, 60) - If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero) Then + If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero, DdlSegmentoNegocio.SelectedValue.ToEntero) Then 'DtTotales = DtDatos.Clone DtDatos = ObjConta.DtResultados CargaGrid() diff --git a/Documentacion/140/AMERICA.pdf b/Documentacion/140/AMERICA.pdf new file mode 100644 index 000000000..fd43b3696 Binary files /dev/null and b/Documentacion/140/AMERICA.pdf differ diff --git a/Documentacion/140/CRONOS.pdf b/Documentacion/140/CRONOS.pdf new file mode 100644 index 000000000..d97ffe789 Binary files /dev/null and b/Documentacion/140/CRONOS.pdf differ diff --git a/Documentacion/140/DIENER.pdf b/Documentacion/140/DIENER.pdf new file mode 100644 index 000000000..a3209f924 Binary files /dev/null and b/Documentacion/140/DIENER.pdf differ diff --git a/Documentacion/140/FULLPOWER.pdf b/Documentacion/140/FULLPOWER.pdf new file mode 100644 index 000000000..5dcfc215c Binary files /dev/null and b/Documentacion/140/FULLPOWER.pdf differ diff --git a/Documentacion/140/LTH.pdf b/Documentacion/140/LTH.pdf new file mode 100644 index 000000000..407672e33 Binary files /dev/null and b/Documentacion/140/LTH.pdf differ diff --git a/Documentacion/140/LTHAGM.pdf b/Documentacion/140/LTHAGM.pdf new file mode 100644 index 000000000..9738ec723 Binary files /dev/null and b/Documentacion/140/LTHAGM.pdf differ diff --git a/Documentacion/140/LTHESPECIALES.pdf b/Documentacion/140/LTHESPECIALES.pdf new file mode 100644 index 000000000..1fc905bcf Binary files /dev/null and b/Documentacion/140/LTHESPECIALES.pdf differ diff --git a/Documentacion/140/LTHHEAVYDUTY.pdf b/Documentacion/140/LTHHEAVYDUTY.pdf new file mode 100644 index 000000000..848db14c3 Binary files /dev/null and b/Documentacion/140/LTHHEAVYDUTY.pdf differ diff --git a/Documentacion/140/LTHHI-TEC.pdf b/Documentacion/140/LTHHI-TEC.pdf new file mode 100644 index 000000000..9e0248d11 Binary files /dev/null and b/Documentacion/140/LTHHI-TEC.pdf differ diff --git a/Documentacion/140/LTHSUV-VAN-MINIVAN.pdf b/Documentacion/140/LTHSUV-VAN-MINIVAN.pdf new file mode 100644 index 000000000..b7f657762 Binary files /dev/null and b/Documentacion/140/LTHSUV-VAN-MINIVAN.pdf differ diff --git a/Documentacion/140/LTHTAXI.pdf b/Documentacion/140/LTHTAXI.pdf new file mode 100644 index 000000000..54dcd8f98 Binary files /dev/null and b/Documentacion/140/LTHTAXI.pdf differ diff --git a/Documentacion/140/OPTIMA.pdf b/Documentacion/140/OPTIMA.pdf new file mode 100644 index 000000000..000f1e014 Binary files /dev/null and b/Documentacion/140/OPTIMA.pdf differ diff --git a/Inicio.aspx b/Inicio.aspx index cb04ab6a4..75c1944f3 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -120,6 +120,8 @@ } + + @@ -275,6 +277,8 @@
+ +
@@ -484,6 +488,152 @@
+
+
+ + +
+ + + +
+
+
+ + Documentos +
+
+ + + + +
+
+
+ + + + + + +
+
+
+ <%-- AMERICA.pdf--%> + AMERICA.pdf +
+
+
+
+ <%-- CRONOS.pdf--%> + CRONOS.pdf +
+
+
+ +
+
+
+ <%-- DIENER.pdf--%> + DIENER.pdf +
+
+
+
+ <%-- FULL POWER.pdf--%> + FULL POWER.pdf +
+
+
+ + +
+
+
+ <%-- LTH AGM.pdf--%> + LTH AGM.pdf +
+
+
+
+ <%-- LTH ESPECIALES.pdf--%> + LTH ESPECIALES.pdf +
+
+
+ +
+
+
+ <%-- LTH HEAVY DUTY.pdf--%> + LTH HEAVY DUTY.pdf +
+
+
+
+ <%-- LTH HI-TEC.pdf--%> + LTH HI-TEC.pdf +
+
+
+ + +
+
+
+ <%-- LTH SUV-VAN-MINIVAN.pdf--%> + LTH SUV-VAN-MINIVAN.pdf +
+
+
+
+ <%-- LTH TAXI.pdf--%> + LTH TAXI.pdf +
+
+
+ +
+
+
+ <%-- LTH.pdf--%> + LTH.pdf +
+
+
+
+ <%-- LTHAGM.pdf--%> + LTHAGM.pdf +
+
+
+ + +
+ + <%-- + + + + + + + + + + + --%> + + + + + +
+ + + + +
diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index 243cb6959..c81970688 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -231,6 +231,11 @@ Partial Class Inicio 'Evaluacion del proveedor CargaEvaluacionProveedor() + + If UsuarioActual.CveEmpresa = 140 Then + DVDescargasBDH.Visible = True + End If + End If End Sub @@ -1245,4 +1250,38 @@ Partial Class Inicio End If RegistraScript("$('#DvUnoaUno').modal('hide')") End Sub + + 'Protected Sub LnkDecargaDoc_Click(sender As Object, e As EventArgs) + + ' Dim NombreArchivo As String = DirectCast(sender, LinkButton).Attributes("NombreArchivo") + ' Dim filePath As String = $"{Server.MapPath("~")}\Documentacion\140\{DirectCast(sender, LinkButton).Attributes("NombreArchivo")}" + + + ' Dim Archivo As New System.IO.FileInfo(filePath) + + + ' Dim mimeType As String = Nothing + + ' If Archivo.Exists Then + + ' HttpContext.Current.Response.Buffer = True + ' HttpContext.Current.Response.Clear() + ' HttpContext.Current.Response.ClearContent() + ' HttpContext.Current.Response.ContentType = mimeType + ' HttpContext.Current.Response.AppendHeader("Content-disposition", "inline; filename=" & NombreArchivo) + ' HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + ' HttpContext.Current.Response.TransmitFile(filePath) + ' HttpContext.Current.Response.Flush() + ' HttpContext.Current.Response.SuppressContent = True + ' HttpContext.Current.ApplicationInstance.CompleteRequest() + ' HttpContext.Current.Response.End() + + ' Archivo = Nothing + ' End If + + + + + 'End Sub + End Class diff --git a/Inventarios/ResguardoMaterial.aspx b/Inventarios/ResguardoMaterial.aspx index c5ed23c79..8230a66f5 100644 --- a/Inventarios/ResguardoMaterial.aspx +++ b/Inventarios/ResguardoMaterial.aspx @@ -52,8 +52,8 @@
-
-
+
+
"> @@ -377,7 +377,7 @@
-
+
Fecha
@@ -409,7 +409,7 @@
-
+
"> @@ -494,7 +494,7 @@ - + diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index a03b30b6c..f8c75cb27 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -635,29 +635,54 @@ Partial Class Inventarios_ResguardoMaterial #Region " CARGA RESGUARDOS PARA LIBERACION " Protected Sub BtnVerificarExistencias_Click(sender As Object, e As EventArgs) - If Not DdlProveedorLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 3 Then - Alert("Tiene que seleccionar un proveedor.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - If Not DdlPersonalLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 1 Then - Alert("Tiene que seleccionar un personal.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - If Not DdlClienteLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 2 Then - Alert("Tiene que seleccionar un cliente.", TipoMensaje.MsgAdvertencia) - Exit Sub + + If UsuarioActual.CveEmpresa <> 140 Then + + + If Not DdlProveedorLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 3 Then + Alert("Tiene que seleccionar un proveedor.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If Not DdlPersonalLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 1 Then + Alert("Tiene que seleccionar un personal.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If Not DdlClienteLiberacion.SelectedValue.ToEntero > 0 AndAlso DdlTipo.SelectedValue.ToEntero = 2 Then + Alert("Tiene que seleccionar un cliente.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If CargaResguardos() + + + If UsuarioActual.CveEmpresa = 140 Then + + If (DdlTipo.SelectedValue.ToEntero = 1 And DdlPersonalLiberacion.SelectedValue.ToEntero <= 0) Or (DdlTipo.SelectedValue.ToEntero = 2 And DdlClienteLiberacion.SelectedValue.ToEntero <= 0) Or (DdlTipo.SelectedValue.ToEntero = 3 And DdlProveedorLiberacion.SelectedValue.ToEntero <= 0) Then + + DVInformacionMoviminetoLiberacion.Visible = False + BtnGuardarLiberacion.Visible = False + Else + DVInformacionMoviminetoLiberacion.Visible = True + BtnGuardarLiberacion.Visible = True + End If + + UpGenerales.Update() + End If + + End Sub Private Sub CargaResguardos() Dim ObjInventario As New ClsInventarios() Dim Existencias As Double = 0 - If ObjInventario.GetMovimientosDetallePorPersonal(DdlPersonalLiberacion.SelectedValue.ToEntero, DdlAlmacenLiberacion.SelectedValue.ToEntero, DdlClienteLiberacion.SelectedValue.ToEntero, DdlProveedorLiberacion.SelectedValue.ToEntero) Then + If ObjInventario.GetMovimientosDetallePorPersonal(DdlPersonalLiberacion.SelectedValue.ToEntero, DdlAlmacenLiberacion.SelectedValue.ToEntero, DdlClienteLiberacion.SelectedValue.ToEntero, DdlProveedorLiberacion.SelectedValue.ToEntero, DdlTipo.SelectedValue.ToEntero) Then DtMovimientosLiberacion = ObjInventario.DtResultados DtMovimientosLiberacion.Columns("No").AutoIncrement = True