This commit is contained in:
2022-03-20 07:24:46 -07:00
24 changed files with 570 additions and 40 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()

Binary file not shown.

View File

@@ -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

View File

@@ -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 = $"<a class='Texto' target='_blank' href='/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?ID={e.Row.DBCampo("IdCuenta").ToEntero}&FI{TxtFechaDel.Text}&FF={TxtFechaAl.Text}&IdSegNeg={ Dr("id").ToString}'>{e.Row.Cells(IndexGV).Text }</a>"
IndexActual = IndexActual + 1
If IndexGV >= 200 Then
Exit For
End If
Next
End If
End Sub
#End Region

View File

@@ -83,9 +83,15 @@
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<label class="col-md-2" style="margin-left:10px; width: 90px;">Moneda:</label>
<label class="col-md-1" style="margin-left:10px; width: 90px;">Moneda:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlMoneda" CssClass="form-control input-sm" runat="server" DataTextField="Moneda" DataValueField="CveMoneda" TabIndex="5" ClientIDMode="Static" style="margin-top:10%; width:140%">
<asp:DropDownList ID="DdlMoneda" CssClass="form-control input-sm" runat="server" DataTextField="Moneda" DataValueField="CveMoneda" TabIndex="5" ClientIDMode="Static" style="margin-top:10%">
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="width: 90px; padding-right: 2px;">Segmento de negocio</label>
<div class="col-md-2">
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlSegmentoNegocio" runat="server" DataTextField="Nombre" DataValueField="Id" Width="100%">
</asp:DropDownList>
</div>
</div>

View File

@@ -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()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Documentacion/140/LTH.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -120,6 +120,8 @@
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
@@ -275,6 +277,8 @@
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="portlet light calendar ">
@@ -484,6 +488,152 @@
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6" runat="server" id="DVDescargasBDH" visible="false">
<div class="portlet light ">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-file-text-o font-red-sunglo"></i>
<span class="caption-subject font-red-sunglo bold uppercase">Documentos</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="reload" data-original-title="" title=""></a>
<a href="#" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel runat="server" ID="UpDocumentos" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc1" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="AMERICA.pdf"><i class="fa fa-download" aria-hidden="true"></i> AMERICA.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc1" NavigateUrl="~/Documentacion/140/AMERICA.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> AMERICA.pdf</asp:HyperLink>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc2" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="CRONOS.pdf"><i class="fa fa-download" aria-hidden="true"></i> CRONOS.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc2" NavigateUrl="~/Documentacion/140/CRONOS.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> CRONOS.pdf</asp:HyperLink>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc3" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="DIENER.pdf"><i class="fa fa-download" aria-hidden="true"></i> DIENER.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc3" NavigateUrl="~/Documentacion/140/DIENER.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> DIENER.pdf</asp:HyperLink>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc4" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="FULLPOWER.pdf"><i class="fa fa-download" aria-hidden="true"></i> FULL POWER.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc4" NavigateUrl="~/Documentacion/140/FULLPOWER.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> FULL POWER.pdf</asp:HyperLink>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc5" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHAGM.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH AGM.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc5" NavigateUrl="~/Documentacion/140/LTHAGM.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH AGM.pdf</asp:HyperLink>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc6" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHESPECIALES.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH ESPECIALES.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc6" NavigateUrl="~/Documentacion/140/LTHESPECIALES.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH ESPECIALES.pdf</asp:HyperLink>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc7" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHHEAVYDUTY.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH HEAVY DUTY.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc7" NavigateUrl="~/Documentacion/140/LTHHEAVYDUTY.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH HEAVY DUTY.pdf</asp:HyperLink>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc8" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHHI-TEC.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH HI-TEC.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc8" NavigateUrl="~/Documentacion/140/LTHHI-TEC.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH HI-TEC.pdf</asp:HyperLink>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc9" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHSUV-VAN-MINIVAN.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH SUV-VAN-MINIVAN.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc9" NavigateUrl="~/Documentacion/140/LTHSUV-VAN-MINIVAN.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH SUV-VAN-MINIVAN.pdf</asp:HyperLink>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc10" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHTAXI.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH TAXI.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc10" NavigateUrl="~/Documentacion/140/LTHTAXI.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH TAXI.pdf</asp:HyperLink>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc11" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTH.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTH.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc11" NavigateUrl="~/Documentacion/140/LTH.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTH.pdf</asp:HyperLink>
</div>
</div>
<div class="col-md-6">
<div class="well well-sm">
<%--<asp:LinkButton ID="LnkDoc12" runat="server" OnClick="LnkDecargaDoc_Click" NombreArchivo="LTHAGM.pdf"><i class="fa fa-download" aria-hidden="true"></i> LTHAGM.pdf</asp:LinkButton>--%>
<asp:HyperLink ID="LnkDoc12" NavigateUrl="~/Documentacion/140/LTHAGM.pdf" runat="server" Target="_blank"><i class="fa fa-download" aria-hidden="true"></i> LTHAGM.pdf</asp:HyperLink>
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<%-- <asp:PostBackTrigger ControlID="LnkDoc1" />
<asp:PostBackTrigger ControlID="LnkDoc2" />
<asp:PostBackTrigger ControlID="LnkDoc3" />
<asp:PostBackTrigger ControlID="LnkDoc4" />
<asp:PostBackTrigger ControlID="LnkDoc5" />
<asp:PostBackTrigger ControlID="LnkDoc6" />
<asp:PostBackTrigger ControlID="LnkDoc7" />
<asp:PostBackTrigger ControlID="LnkDoc8" />
<asp:PostBackTrigger ControlID="LnkDoc9" />
<asp:PostBackTrigger ControlID="LnkDoc10" />
<asp:PostBackTrigger ControlID="LnkDoc11" />
<asp:PostBackTrigger ControlID="LnkDoc12" />--%>
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>

View File

@@ -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

View File

@@ -52,8 +52,8 @@
<div class="row" style="margin-left: 0px; margin-right: 0px;">
<div class="col-md-6">
<div class="portlet xspadding light bordered infomov">
<div class="col-md-6" runat="server" >
<div class="portlet xspadding light bordered infomov" >
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
@@ -377,7 +377,7 @@
</div>
</div>
</div>
<div class="portlet-body">
<div class="portlet-body" >
<div class="row">
<div class="col-md-1" style="max-width: 100px">Fecha</div>
<div class="col-md-2">
@@ -409,7 +409,7 @@
<div class="row" style="margin-left: 0px; margin-right: 0px;">
<div class="col-md-6">
<div class="portlet smmallpadding light bordered infomov">
<div class="portlet smmallpadding light bordered infomov" runat="server" id ="DVInformacionMoviminetoLiberacion" >
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
@@ -494,7 +494,7 @@
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtLote" Width="80px" class="form-control input-sm" runat="server" Visible="false"></asp:TextBox>
</ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
<ItemTemplate>

View File

@@ -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