This commit is contained in:
Oscar Irigoyen
2022-11-17 08:34:37 -07:00
34 changed files with 1205 additions and 413 deletions

2
.gitignore vendored
View File

@@ -280,3 +280,5 @@ vwd.webinfo
/Bin.rar
/Ashx/sigfox.ashx
/BinOLD
/App_Data/PublishProfiles/FolderProfile.pubxml
/vwd.webinfo

View File

@@ -1072,7 +1072,7 @@ Public Class ClsContPAQi
StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ")
StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ")
StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ")
StrSQL.AppendLine(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.AppendLine(" LEFT JOIN [192.168.0.2].Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ")
StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ")
StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ")
@@ -5263,7 +5263,7 @@ Public Class ClsContPAQi
Return Retorno
End Function
Public Function GetEstadoResultadosMensual(ANO As Integer, TipoMovtos As Integer) As Boolean
Public Function GetEstadoResultadosMensual(ANO As Integer, TipoMovtos As Integer, Optional IdSegNeg As Integer = -1) As Boolean
Dim Retorno = False
If Not FNC_TotalMensual() Then
@@ -5323,27 +5323,27 @@ Public Class ClsContPAQi
INSERT INTO @Temp
SELECT C.Id, C.Codigo, C.Nombre, C.Tipo, C.CtaMayor, '' AS Clasificacion, Ct.Nombre as Sup, Orden, IIF(LEN(Orden)=11,2,1) as IntSubOrden,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 1, @Tipo), 0) AS Enero,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 2, @Tipo), 0) AS Febrero,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 3, @Tipo), 0) AS Marzo,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 4, @Tipo), 0) AS Abril,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 5, @Tipo), 0) AS Mayo,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 6, @Tipo), 0) AS Junio,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 7, @Tipo), 0) AS Julio,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 8, @Tipo), 0) AS Agosto,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 9, @Tipo), 0) AS Septiembre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 10, @Tipo), 0) AS Octubre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 11, @Tipo), 0) AS Noviembre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 12, @Tipo), 0) AS Diciembre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 1, @Tipo, @IdSegNeg), 0) AS Enero,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 2, @Tipo, @IdSegNeg), 0) AS Febrero,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 3, @Tipo, @IdSegNeg), 0) AS Marzo,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 4, @Tipo, @IdSegNeg), 0) AS Abril,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 5, @Tipo, @IdSegNeg), 0) AS Mayo,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 6, @Tipo, @IdSegNeg), 0) AS Junio,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 7, @Tipo, @IdSegNeg), 0) AS Julio,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 8, @Tipo, @IdSegNeg), 0) AS Agosto,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 9, @Tipo, @IdSegNeg), 0) AS Septiembre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 10, @Tipo, @IdSegNeg), 0) AS Octubre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 11, @Tipo, @IdSegNeg), 0) AS Noviembre,
ISNULL (dbo.FNC_TotalMensual(c.Id, @ANO, 12, @Tipo, @IdSegNeg), 0) AS Diciembre,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 1, 3, @Tipo), 0) Trimestral1,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 4, 6, @Tipo), 0) Trimestral2,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 5, 9, @Tipo), 0) Trimestral3,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 10, 12, @Tipo), 0) Trimestral4,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 1, 3, @Tipo, @IdSegNeg), 0) Trimestral1,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 4, 6, @Tipo, @IdSegNeg), 0) Trimestral2,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 5, 9, @Tipo, @IdSegNeg), 0) Trimestral3,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 10, 12, @Tipo, @IdSegNeg), 0) Trimestral4,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 1, 4, @Tipo), 0) Cuatrimestral1,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 5, 8, @Tipo), 0) Cuatrimestral2,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 9, 12, @Tipo), 0) Cuatrimestral3
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 1, 4, @Tipo, @IdSegNeg), 0) Cuatrimestral1,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 5, 8, @Tipo, @IdSegNeg), 0) Cuatrimestral2,
ISNULL (dbo.FNC_TotalMensualERSubTotales(c.Id, @ANO, 9, 12, @Tipo, @IdSegNeg), 0) Cuatrimestral3
FROM Rec D
INNER JOIN Cuentas C ON D.IdSubCtade = C.Id
INNER JOIN Cuentas CT ON D.CtaSup = CT.Codigo
@@ -5543,6 +5543,7 @@ Public Class ClsContPAQi
With SqlAdapter.SelectCommand.Parameters
.Add("@ANO", SqlDbType.Int).Value = ANO
.Add("@Tipo", SqlDbType.Int).Value = TipoMovtos
.Add("@IdSegNeg", SqlDbType.Int).Value = IdSegNeg
End With
Try
@@ -5833,7 +5834,7 @@ Public Class ClsContPAQi
' Return Retorno
'End Function
Public Function GetEstadoResultadosAnual(ANO As Integer, TipoMovtos As Integer) As Boolean
Public Function GetEstadoResultadosAnual(ANO As Integer, TipoMovtos As Integer, Optional IdSegNeg As Integer = -1) As Boolean
Dim Retorno = False
If Not FNC_TotalAnual() Then
@@ -5885,26 +5886,26 @@ Public Class ClsContPAQi
StrSQL.Append(" INSERT INTO @Temp ")
StrSQL.Append(" SELECT C.Id, C.Codigo, C.Nombre, C.Tipo, C.CtaMayor, '' AS Clasificacion, Ct.Nombre as Sup, Orden, ")
StrSQL.Append(" ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 0, @Tipo), 0) ELSE 0 END AS Ano1, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 1, @Tipo), 0) ELSE 0 END AS Ano2, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 2, @Tipo), 0) ELSE 0 END AS Ano3, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 3, @Tipo), 0) ELSE 0 END AS Ano4, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 4, @Tipo), 0) ELSE 0 END AS Ano5, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 5, @Tipo), 0) ELSE 0 END AS Ano6, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 6, @Tipo), 0) ELSE 0 END AS Ano7, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 7, @Tipo), 0) ELSE 0 END AS Ano8, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 8, @Tipo), 0) ELSE 0 END AS Ano9, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 9, @Tipo), 0) ELSE 0 END AS Ano10, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 10, @Tipo), 0) ELSE 0 END AS Ano11, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 11, @Tipo), 0) ELSE 0 END AS Ano12, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 12, @Tipo), 0) ELSE 0 END AS Ano13, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 13, @Tipo), 0) ELSE 0 END AS Ano14, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 14, @Tipo), 0) ELSE 0 END AS Ano15, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 15, @Tipo), 0) ELSE 0 END AS Ano16, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 16, @Tipo), 0) ELSE 0 END AS Ano17, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 17, @Tipo), 0) ELSE 0 END AS Ano18, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 18, @Tipo), 0) ELSE 0 END AS Ano19, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 19, @Tipo), 0) ELSE 0 END AS Ano20 ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 0, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano1, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 1, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano2, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 2, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano3, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 3, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano4, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 4, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano5, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 5, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano6, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 6, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano7, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 7, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano8, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 8, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano9, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 9, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano10, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 10, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano11, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 11, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano12, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 12, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano13, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 13, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano14, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 14, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano15, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 15, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano16, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 16, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano17, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 17, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano18, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 18, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano19, ")
StrSQL.Append(" CASE WHEN @ANO + 0 <= YEAR(GETDATE()) THEN ISNULL (dbo.FNC_TotalAnual(c.Id, @ANO + 19, @Tipo, @IdSegNeg), 0) ELSE 0 END AS Ano20 ")
StrSQL.Append(" FROM Rec D ")
StrSQL.Append(" INNER JOIN Cuentas C ON D.IdSubCtade = C.Id ")
StrSQL.Append(" INNER JOIN Cuentas CT ON D.CtaSup = CT.Codigo ")
@@ -6087,6 +6088,7 @@ Public Class ClsContPAQi
With SqlAdapter.SelectCommand.Parameters
.Add("@ANO", SqlDbType.Int).Value = ANO
.Add("@Tipo", SqlDbType.Int).Value = TipoMovtos
.Add("@IdSegNeg", SqlDbType.Int).Value = IdSegNeg
End With
Try
@@ -10194,9 +10196,10 @@ Public Class ClsContPAQi
StrSQL.Clear()
StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_TotalAnual] ")
StrSQL.Append(" ( ")
StrSQL.Append(" @IdCtaSup INT, ")
StrSQL.Append(" @Ano INT, ")
StrSQL.Append(" @Tipo INT ")
StrSQL.Append(" @IdCtaSup INT, ")
StrSQL.Append(" @Ano INT, ")
StrSQL.Append(" @Tipo INT, ")
StrSQL.Append(" @SegmentoNegocio INT = -1 ")
StrSQL.Append(" ) ")
StrSQL.Append(" RETURNS FLOAT ")
StrSQL.Append(" AS ")
@@ -10238,6 +10241,7 @@ Public Class ClsContPAQi
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM MovimientosPoliza MP ")
StrSQL.Append(" INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano ")
StrSQL.Append(" WHERE (@SegmentoNegocio = -1 OR MP.IdSegNeg = @SegmentoNegocio) ")
StrSQL.Append(" END ")
StrSQL.Append(" ")
StrSQL.Append(" IF @Tipo = 2 ")
@@ -10252,7 +10256,8 @@ Public Class ClsContPAQi
StrSQL.Append(" BEGIN ")
StrSQL.Append(" INSERT INTO @TempMovtos ")
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM MovimientosPoliza MP INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano ")
StrSQL.Append(" FROM MovimientosPoliza MP INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano ")
StrSQL.Append(" WHERE (@SegmentoNegocio = -1 OR MP.IdSegNeg = @SegmentoNegocio) ")
StrSQL.Append(" UNION ALL ")
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM Vw_PolizasComplementarias MP INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano ")
@@ -10405,7 +10410,8 @@ Public Class ClsContPAQi
StrSQL.Append(" @IdCtaSup INT, ")
StrSQL.Append(" @Ano INT, ")
StrSQL.Append(" @Mes INT, ")
StrSQL.Append(" @Tipo INT ")
StrSQL.Append(" @Tipo INT, ")
StrSQL.Append(" @SegmentoNegocio INT = -1 ")
StrSQL.Append(" ) ")
StrSQL.Append(" RETURNS FLOAT ")
StrSQL.Append(" AS ")
@@ -10444,6 +10450,7 @@ Public Class ClsContPAQi
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM MovimientosPoliza MP ")
StrSQL.Append(" INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano AND MP.Periodo = @Mes ")
StrSQL.Append(" WHERE (@SegmentoNegocio = -1 OR MP.IdSegNeg = @SegmentoNegocio) ")
StrSQL.Append(" END ")
StrSQL.Append(" ")
StrSQL.Append(" IF @Tipo = 2 ")
@@ -10460,10 +10467,12 @@ Public Class ClsContPAQi
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM MovimientosPoliza MP ")
StrSQL.Append(" WHERE MP.Ejercicio = @Ano AND MP.Periodo = @Mes ")
StrSQL.Append(" AND (@SegmentoNegocio = -1 OR MP.IdSegNeg = @SegmentoNegocio) ")
StrSQL.Append(" UNION ALL ")
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM Vw_PolizasComplementarias MP ")
StrSQL.Append(" INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano AND MP.Periodo = @Mes ")
StrSQL.Append(" INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano AND MP.Periodo = @Mes ")
StrSQL.Append(" END ")
StrSQL.Append(" ")
StrSQL.Append(" ")
@@ -10516,7 +10525,8 @@ Public Class ClsContPAQi
StrSQL.Append(" @Ano INT, ")
StrSQL.Append(" @Mes INT, ")
StrSQL.Append(" @Mes2 INT, ")
StrSQL.Append(" @Tipo INT ")
StrSQL.Append(" @Tipo INT, ")
StrSQL.Append(" @SegmentoNegocio INT = -1 ")
StrSQL.Append(" ) ")
StrSQL.Append(" RETURNS FLOAT ")
StrSQL.Append(" AS ")
@@ -10557,6 +10567,7 @@ Public Class ClsContPAQi
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM MovimientosPoliza MP ")
StrSQL.Append(" INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano AND MP.Periodo >= @Mes AND MP.Periodo <= @Mes2 ")
StrSQL.Append(" WHERE (@SegmentoNegocio = -1 OR MP.IdSegNeg = @SegmentoNegocio) ")
StrSQL.Append(" END ")
StrSQL.Append(" ")
StrSQL.Append(" IF @Tipo = 2 ")
@@ -10573,6 +10584,7 @@ Public Class ClsContPAQi
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM MovimientosPoliza MP ")
StrSQL.Append(" INNER JOIN @TempCuentas C ON C.IdCuenta = MP.IdCuenta AND MP.Ejercicio = @Ano AND MP.Periodo >= @Mes AND MP.Periodo <= @Mes2 ")
StrSQL.Append(" WHERE (@SegmentoNegocio = -1 OR MP.IdSegNeg = @SegmentoNegocio) ")
StrSQL.Append(" UNION ALL ")
StrSQL.Append(" SELECT MP.IdCuenta, TipoMovto, Importe, Fecha ")
StrSQL.Append(" FROM Vw_PolizasComplementarias MP ")

View File

@@ -110,28 +110,28 @@ Public Class ClsMovimientos
Public Sub Commit()
SqlTransacc.Commit()
End Sub
End Sub
#Region "CxC"
'Public Function GetCxCCliente(CveCliente As Integer) As Boolean
' Dim Retorno As Boolean = False
' 'Data = New DataTable
' 'SqlAdapter = New SqlDataAdapter("PA_ClienteCxC", SqlConexion)
' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
' DataAdapter("PA_ClienteCxC")
' SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As SqlException
' OnError("Ocurrió un error al consultar las CxC del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
' End Try
' Return Retorno
'End Function
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1", Optional FechaCorte As Date = MaxFecha, Optional CveIESustitucion As Integer = -1, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha) As Boolean
'Public Function GetCxCCliente(CveCliente As Integer) As Boolean
' Dim Retorno As Boolean = False
' 'Data = New DataTable
' 'SqlAdapter = New SqlDataAdapter("PA_ClienteCxC", SqlConexion)
' 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
' DataAdapter("PA_ClienteCxC")
' SqlAdapter.SelectCommand.Parameters.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As SqlException
' OnError("Ocurrió un error al consultar las CxC del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
' End Try
' Return Retorno
'End Function
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1", Optional FechaCorte As Date = MaxFecha, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha) As Boolean
Dim Retorno As Boolean = False
FechaCorte = IIf(FechaCorte = Nothing, Date.Now.AddYears(1), FechaCorte).ToString.ToDate
@@ -146,8 +146,7 @@ Public Class ClsMovimientos
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte
.Add("@CveIESustitucion", SqlDbType.Int).Value = CveIESustitucion
.Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte
.Add("@FechaVencimientoI", SqlDbType.Date).Value = FechaVencimientoI
.Add("@FechaVencimientoF", SqlDbType.Date).Value = FechaVencimientoF
End With

View File

@@ -2593,7 +2593,7 @@ Public Class ClsNominas
Return retorno
End Function
#End Region
Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String) As Boolean
Public Function GetCalculoSBC(CveEmpresa As Integer, Tipo As Integer, FechaCalculo As String, Optional CveRegistroPatronal As Integer = -1) As Boolean
Dim retorno As Boolean = False
Try
DTSet = New DataSet()
@@ -2601,6 +2601,7 @@ Public Class ClsNominas
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = Tipo
.Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal
.Add("@Fecha", SqlDbType.Date).Value = FechaCalculo
End With
SqlAdapter.Fill(DTSet)

View File

@@ -1375,7 +1375,7 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function AddPSAlias(PS As String, CvePS As Integer, Flexible As Boolean, CveUsuarioModifico As Integer) As Boolean
Public Function AddPSAlias(PS As String, CvePS As Integer, Flexible As Boolean, CveUsuarioModifico As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosAliasAdd")
@@ -1384,6 +1384,7 @@ Public Class ClsProductosServicios
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Flexible", SqlDbType.Bit).Value = If(Flexible, 1, 0)
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try

View File

@@ -7089,15 +7089,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End If
ListaTagsDocumentost.Add(New TagsDocumentos("{Sexo}", DtResultados(0)("Genero").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{NombreEmpresa}", DtResultados(0)("Empresa").ToString))
Dim SalarioDiarioTag As String = DtResultados(0)("SalarioDiario").ToString.ToDouble.Texto2Letras()
ListaTagsDocumentost.Add(New TagsDocumentos("{Sueldo}", DtResultados(0)("SalarioDiario").ToString.ToDouble.ToString("###,###,###.00")))
ListaTagsDocumentost.Add(New TagsDocumentos("{SueldoLetra}", SalarioDiarioTag))
ListaTagsDocumentost.Add(New TagsDocumentos("{Nacionalidad}", DtResultados(0)("ClaveSATPaisDescripcion").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{Nacionalidad}", DtResultados(0)("ClaveSATPaisDescripcion").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{EmpresaNombre}", DtResultados(0)("Empresa").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{EmpresaDireccion}", DtResultados(0)("EmpresaDireccion").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{EmpresaCiudad}", DtResultados(0)("EmpresaCiudad").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{EmpresaRFC}", DtResultados(0)("EmpresaRFC").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{EmpresaRepresentante}", DtResultados(0)("EmpresaRepresentante").ToString))
End If

View File

@@ -19,7 +19,7 @@ Public Class LogicNominas
sw.Start()
End If
Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False, CvePAC) 'CvePersonal, CvePeriodo,
Dim cfdi As CFDITimbre = PreTimbrar(CveNomina, UsuarioActual, False) 'CvePersonal, CvePeriodo,
If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then
If Not cfdi.Timbrado Then
Dim ObjTimbrado As New Timbrado
@@ -81,7 +81,7 @@ Public Class LogicNominas
Return Retorno
End Function
Dim hasfiniquito As Boolean
Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean, Optional CvePAC As Integer = 4) As CFDITimbre
Public Function PreTimbrar(CveNomina As Integer, UsuarioActual As Usuario, TimbreIndemnizacion As Boolean) As CFDITimbre
Dim continuar As Boolean = True
hasfiniquito = False
Dim CvePersonal As Integer = -1
@@ -439,7 +439,7 @@ Public Class LogicNominas
cfdi.Comprobante.TipoComprobante = "N"
cfdi.Comprobante.TipoDocto = "Egs"
cfdi.Comprobante.MetodoPago = "PUE"
cfdi.Comprobante.CondicionesdePago = If(CvePAC < 4, "CONTADO", "") '"" '""
cfdi.Comprobante.CondicionesdePago = "" '"CONTADO"
cfdi.Comprobante.FormadePago = If(UsuarioActual.Empresa.Funcionalidad(350).Contiene("1"), "", "99")
cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString() ' AHORITA SOLO SE REQUIERE ESPECIFICAR EL CODIGO POSTAL
cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta

View File

@@ -2415,31 +2415,83 @@ Namespace Modelos
Select Case ConceptoContable
Case 1 'Cliente
If Not ObjFactura.TipoDocto.Contiene("Egs", "Rem", "RNC") Then
Dim TCCliente As Decimal = tipoCambio
Dim TCFluctuacion As Decimal = tipoCambio
'TOMA EL TC DE LA ULTIMA FLUCTUACION
If ValorMultiplicador = -1 AndAlso UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso ObjFactura.CveMoneda = 2 Then
Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= Now Then
TCCliente = UltimaFluctuacion.TCFluctuacion
TCFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
End If
If ObjFactura.CveMoneda > 1 Then ConceptoContable = 291
importeMovimiento = (ObjFactura.Total - TotalOtrosConceptos) * ValorMultiplicador
importeMX = importeMovimiento * tipoCambio * Multiplicador
importeMX = importeMovimiento * TCCliente * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
CveSubProyectoContabilizar = CveSubProyectoVenta
'If ObjFactura.TipoDocto.Contiene("Ant") Then
' TipoMovimiento = Not TipoMovimiento 'lo contrario a ingreso, en este caso es anticipo
'End If
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
If TCCliente > 1 Then Concepto += $" TC:{TCCliente} ${importeMovimiento.FormatoNumero(2)}"
If tipoCambio = 1 Then
If TCCliente = 1 Then
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
Else
IdCtaContable = ObjFactura.Cliente.IdCtaContComplementaria
If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then
importeMX = importeMovimiento
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=Math.Round(importeMovimiento * tipoCambio - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=Math.Round(importeMovimiento * TCCliente - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=If(TCCliente = 1, 0, importeMovimiento), TipoCambio:=TCCliente, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
'CONSIDERO FLUCTUACIÓN.
If ValorMultiplicador = -1 AndAlso tipoCambio <> TCFluctuacion AndAlso TCFluctuacion > 1 AndAlso tipoCambio > 1 Then
Dim difFluctuacion As Decimal = tipoCambio - TCFluctuacion
Dim CveConceptoFluctua As Integer = 64 '64.ganacia, 65.perdida
Dim TipoMovtoFluctua As Boolean = True
Dim IdCtaContableFluctua As Integer
If difFluctuacion < 0 Then
CveConceptoFluctua = 65
TipoMovtoFluctua = False
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
Else
CveConceptoFluctua = 64
TipoMovtoFluctua = True
IdCtaContableFluctua = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
End If
Dim ImporteFluctuacion As Decimal = Math.Abs((importeMovimiento * difFluctuacion).RoundSQL)
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovtoFluctua, ImporteFluctuacion, Referencia, CveConceptoFluctua, Concepto, FechaMovimiento, IdCtaContableFluctua, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteFluctuacion, ImporteME:=ImporteFluctuacion, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio, TipoCambioPago:=TCCliente) Then
ErrorPrepoliza = True
Exit For
End If
End If
End If
IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera
End If
IdCtaContableCliente = IdCtaContable
If ValorMultiplicador = -1 AndAlso ConceptoContable = 291 Then
If IdCtaContable <= 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 291, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(TCCliente = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCCliente, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
End If
importeMovimiento = 0
End If
End If
Case 3 'Cliente
@@ -2801,7 +2853,7 @@ Namespace Modelos
End If
Case 136 'Otros Conceptos Dinamicos
Case 136 'Otros Conceptos Dinamicos
If ObjFactura.DtOtrosConceptos IsNot Nothing Then
For Each row2 As DataRow In ObjFactura.DtOtrosConceptos.Rows
If row2("Importe").ToString().ToDecimal > 0 Then
@@ -4953,7 +5005,7 @@ Namespace Modelos
CveEstatusRefacturacion = 0
End If
Dim CancelacionFecha As Date
Dim CancelacionFecha As Date = MinFecha
Dim FolioFiscal As String = ObjFactura.FolioFiscal
Dim SolicitudCancelacionAcuse As String = ""
Dim CancelacionAcuse As String = ""
@@ -6319,9 +6371,13 @@ Namespace Modelos
Dim CveVentaDetalleRem = DrRem("CveVentaDetalleRemision").ToString.ToEntero
Dim CantidadRem = DrRem("Cantidad").ToString.ToDecimal
'SI NO UTILIZA EL CAMPO DEBE TOMAR DE LA VENTA
If Not CveVentaDetalleRem > 0 Then
ErrorCancelar = True
Exit For
CveVentaDetalleRem = DrRem("CveVentaDetalle").ToString.ToEntero
If Not CveVentaDetalleRem > 0 Then
ErrorCancelar = True
Exit For
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, DrRem("Cantidad").ToString.ToDecimal, DrRem("CveUM").ToString.ToEntero, DrRem("CvePS").ToString.ToEntero, DrRem("PU").ToString.ToDecimal, CveAF:=DrRem("CveActivoFijo").ToString.ToEntero, Serie:=DrRem("Serie").ToString, Lote:=DrRem("Lote").ToString, FechaCaducidad:=DrRem("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=CveVentaDetalleRem, CveMovimientoDetalleEntrada:=DrRem("CveMovimientoDetalle").ToString().ToEntero(), CveSeccionAlmacen:=-3) Then
@@ -8794,6 +8850,42 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTTiposDocumentos") = value
End Set
End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As ClsPaginas.MTipoCambioFluctuacion
Get
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
Dim fluctuacion = New ClsPaginas.MTipoCambioFluctuacion() With {
.TCFluctuacion = 0,
.FechaFluctuacion = MinFecha
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha <= '{0}'", Fecha), Orderby:="Fecha DESC")
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()
End If
Return fluctuacion
Else
Return fluctuacion
End If
End Get
End Property
Property GlobalDTCobranzaEstatus(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then

View File

@@ -71,7 +71,7 @@ Namespace Extensiones
Dim dataTable As DataTable = New DataTable()
Dim worksheet As GemBox.Spreadsheet.ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
For cols = 0 To worksheet.Rows(curRow).AllocatedCells.Count - 1
If firstRowHasHeaders Then
@@ -81,12 +81,13 @@ Namespace Extensiones
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
If firstRowHasHeaders Then
curRow = curRow + 1
End If
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
@@ -2155,6 +2156,7 @@ Namespace Extensiones
Dim worksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
If celdasConTexto Is Nothing Then Exit Sub 'No se recuperaron datos, salir de sin guardar porque soltará error
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)

View File

@@ -142,8 +142,8 @@ Partial Class Bancos_DepositoTerminal
IdCuentaBancaria = 0
IdCuentaBancariaComplementaria = 0
CveCuentaBancaria = 0
CveCuentaBancariaComplementaria = 0
'CveCuentaBancaria = 0
'CveCuentaBancariaComplementaria = 0
End If
If UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then
@@ -259,7 +259,7 @@ Partial Class Bancos_DepositoTerminal
ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR
IdCuentaBancaria = 0
CveCuentaBancaria = 0
'CveCuentaBancaria = 0
End If
If gvr.DataKey("CveMoneda").ToEntero = 2 Then
@@ -436,14 +436,14 @@ Partial Class Bancos_DepositoTerminal
Next
If IdCuentaBancariaComplementaria > 0 Then
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtImporte.Text.ToDecimal, "", 30, "", TxtFecha.Text.ToDate, IdCuentaBancaria, -1, CveIE, -1, -1, -1, -1, ImporteMX:=TxtImporte.Text.ToDecimal, CveCuenta:=CveCuentaBancaria) Then
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtImporte.Text.ToDecimal, "", 30, "", TxtFecha.Text.ToDate, IdCuentaBancaria, -1, CveIE, -1, -1, -1, -1, ImporteMX:=TxtImporte.Text.ToDecimal) Then
MsgError = "No se pudo insertar la póliza"
End If
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtImporte.Text.ToDecimal, "", 30, "", TxtFecha.Text.ToDate, IdCuentaBancariaComplementaria, -1, CveIE, -1, -1, -1, -1, ImporteMX:=TxtImporte.Text.ToDecimal, CveCuenta:=CveCuentaBancariaComplementaria) Then
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtImporte.Text.ToDecimal, "", 30, "", TxtFecha.Text.ToDate, IdCuentaBancariaComplementaria, -1, CveIE, -1, -1, -1, -1, ImporteMX:=TxtImporte.Text.ToDecimal) Then
MsgError = "No se pudo insertar la póliza"
End If
Else
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtImporte.Text.ToDecimal, "", 30, "", TxtFecha.Text.ToDate, IdCuentaBancaria, -1, CveIE, -1, -1, -1, -1, ImporteMX:=TxtImporte.Text.ToDecimal, CveCuenta:=CveCuentaBancaria) Then
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TxtImporte.Text.ToDecimal, "", 30, "", TxtFecha.Text.ToDate, IdCuentaBancaria, -1, CveIE, -1, -1, -1, -1, ImporteMX:=TxtImporte.Text.ToDecimal) Then
MsgError = "No se pudo insertar la póliza"
End If
End If

View File

@@ -46,6 +46,7 @@ Partial Class Bancos_DepositosCaja
'código temporal, para claudia y toñita, monge, anadelia, alba,patricia
If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897, 2560) Then
DdlCajaChica.Items.Add(New ListItem("Todas", "-1"))
DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Solidaridad", "7850"))
divFolio.Visible = True
End If

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FluctuacionCambiaria.aspx.vb" Inherits="Bancos_FluctuacionCambiaria" %>
<%@ Page Title="" Language="VB" EnableEventValidation="false" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FluctuacionCambiaria.aspx.vb" Inherits="Bancos_FluctuacionCambiaria" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>

View File

@@ -1285,25 +1285,32 @@ Partial Class Bancos_FluctuacionCambiaria
#Region " EXPORTA EXCEL "
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim StrFiltro As New StringBuilder
'If DdlProveedor.SelectedValue.ToEntero > 0 Then
StrFiltro.AppendFormat("Filtro: ", DdlMes.SelectedItem.ToString)
StrFiltro.AppendFormat("{0} ", DdlMes.SelectedItem.ToString)
StrFiltro.AppendFormat("{0} ", DdlAnio.SelectedValue)
StrFiltro.AppendFormat("TC: {0}", LtTipoCambioActual.Text)
If (T.ActiveTabIndex = 0) Then
'GvProveedores.ExportToExcelGembox("FluctuacionCambiariaProveedores_" & Now.ToShortDateString)
ExportToExcelGembox(GvProveedores, "FluctuacionCambiariaProveedores_" & Now.ToShortDateString, UsuarioActual, "Fluctuaciones cambairasi proveedor")
GvProveedores.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Proveedores", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 1) Then
GvProveedoresAnt.ExportToExcel("FluctuacionCambiariaProveedoresAnt_" & Now.ToShortDateString)
GvProveedoresAnt.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Proveedores Anticipos", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 2) Then
GvVentas.ExportToExcel("FluctuacionCambiariaClientes_" & Now.ToShortDateString)
GvVentas.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Clientes", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 3) Then
GvClientesAnt.ExportToExcel("FluctuacionCambiariaClientesAnt_" & Now.ToShortDateString)
GvClientesAnt.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Clientes Anticipos", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 4) Then
GvAcreedores.ExportToExcel("FluctuacionCambiariaComprasAcreedores_" & Now.ToShortDateString)
GvAcreedores.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Compras Acreedores", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 5) Then
GvAcreedoresAnt.ExportToExcel("FluctuacionCambiariaAcreedoresAnt_" & Now.ToShortDateString)
GvAcreedoresAnt.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Acreedores Anticipos", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 6) Then
GvCuentas.ExportToExcel("FluctuacionCambiariaBancos_" & Now.ToShortDateString)
GvCuentas.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Bancos", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 7) Then
GvFiliales.ExportToExcel("FluctuacionCambiariaFilial_" & Now.ToShortDateString)
GvFiliales.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Filiales", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 8) Then
GvDeudores.ExportToExcel("FluctuacionCambiariaDeudores_" & Now.ToShortDateString)
GvDeudores.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Deudores", DatosFiltros:=StrFiltro.ToString())
End If
' ImprimirReportePdf("Excel")

View File

@@ -900,7 +900,7 @@ Partial Class Bancos_ProveedoresAbonar
Else
If Not UsaComplementariaBancos Then tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL
If Not UsaComplementariaBancos And Pago.CveMonedaPago = 2 Then tImporteMN = (tImporteMN * Pago.TCPago).RoundSQL
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, tImporteMN, 30, Referencia, ConceptoMovimiento, IdCuenta, CveIE:=CveIE, CveProveedor:=CveProveedor, TipoCambio:=Pago.TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "No se pudo insertar la póliza"

Binary file not shown.

View File

@@ -392,7 +392,7 @@ Partial Class Compras_RepComprasAFDetalle
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
If Imagen.Exists Then
pparams.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If

View File

@@ -457,7 +457,7 @@
</tr>
</table>
<asp:GridView ID="GvTraslados" runat="server" Width="100%" AutoGenerateColumns="False" DataKeyNames="CveFactura,CveCompra,CveProveedor,SerieFolio,NombreProveedor,UUID,RFCDe,RFCPara,TipoFactura,FueValidado,TipoComprobante,Version,RFCde,XML,CveComplementoTraslado,PDF,SerieFolioVinculado,CveCompraTraslado"
<asp:GridView ID="GvTraslados" runat="server" Width="100%" AutoGenerateColumns="False" DataKeyNames="CveFactura,CveCompra,CveProveedor,SerieFolio,NombreProveedor,UUID,RFCDe,RFCPara,TipoFactura,FueValidado,TipoComprobante,Version,RFCde,XML,PDF "
EmptyDataText="No se encontraron Registros con el filtro actual" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Tipo">
@@ -520,6 +520,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Agregar">
<ItemTemplate>
<asp:HyperLink ID="HplAgregar" runat="server" CssClass="btn btn-circle btn-sm green" Visible='<%# Eval("CveProveedor").ToString <> "" %>' data-toggle="tooltip" title="Agregar Factura" rel="opener" Target="_blank" ><i class="fa fa-plus"></i></asp:HyperLink>
<asp:HyperLink ID="HplAgregarT" runat="server" CssClass="btn btn-circle btn-sm green" Visible='<%# Eval("CveProveedor").ToString <> "" %>' data-toggle="tooltip" title="Agregar Factura" Target="_blank" rel="opener"><i class="fa fa-plus"></i></asp:HyperLink>
<asp:LinkButton ID="LnkAgregarTraslado" runat="server" OnClick="LnkAgregarTraslado_Click" CssClass="btn btn-sm blue" Visible="false" data-toggle="tooltip" ></asp:LinkButton>
</ItemTemplate>

View File

@@ -835,13 +835,14 @@ Partial Class Compras_eFacturas
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
TabTraslados.Visible = True
If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa, Opcion:=2) Then
'If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa, Opcion:=2) Then
If ObjDatos.DtResultados.Rows.Count > 0 Then
DTTraslados = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'")
End If
' If ObjDatos.DtResultados.Rows.Count > 0 Then
' DTTraslados = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'")
' End If
End If
'End If
DTTraslados = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'")
End If
LblTotalTraslados.Text = String.Format("{0} Traslados", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'").Rows.Count.ToString("N0"))
@@ -905,9 +906,6 @@ Partial Class Compras_eFacturas
Dim msgs As String() = Mensajes.Split("|"c)
Dim NFacturas As Integer = 0
If msgs.Length >= 2 Then
Try
NFacturas = msgs(0).ToEntero
@@ -921,11 +919,8 @@ Partial Class Compras_eFacturas
Mensajes = "La actualización se realizó correctamente"
End If
LnkNoRecibidas_Click(LnkNoRecibias, EventArgs.Empty, ValidaRowCount:=ValidaRowCount)
'Else
' Dim Str As New StringBuilder
' Dim conta As Integer = 1
@@ -4706,12 +4701,7 @@ Partial Class Compras_eFacturas
End If
ObjCompra.Dispose()
End If
Next
@@ -4734,8 +4724,6 @@ Partial Class Compras_eFacturas
Protected Sub GvTraslados_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTraslados.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("TipoComprobante") = "T" Then
@@ -4752,7 +4740,10 @@ Partial Class Compras_eFacturas
If File.Exists(String.Format("{0}{1}\{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("XML"))) Then
e.Row.FCLiteral("LtlXML").Text = String.Format("<a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?RFC={0}&File={1}"">Ver</a>", HttpUtility.UrlEncode(e.Row.DBCampo("RFCDe")), HttpUtility.UrlEncode(e.Row.DBCampo("XML")))
If e.Row.DBCampo("TipoComprobante") = "T" And e.Row.DBCampo("FueValidado") = "1" Then
e.Row.FCLinkButton("LnkAgregarTraslado").Visible = True
' e.Row.FCLinkButton("LnkAgregarTraslado").Visible = True
e.Row.FCHyperLink("HplAgregar").NavigateUrl = String.Format("/Compras/Compras.aspx?CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo("RFCDe"))
End If
Else
e.Row.FCLiteral("LtlXML").Text = "N/D" ' String.Format("{0}{1}\{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("XML")) '
@@ -4808,18 +4799,18 @@ Partial Class Compras_eFacturas
End If
Dim CveComplementoTraslado As Integer = e.Row.DataKey("CveComplementoTraslado").ToString.ToEntero
'Dim CveComplementoTraslado As Integer = e.Row.DataKey("CveComplementoTraslado").ToString.ToEntero
If CveComplementoTraslado > 0 Then
e.Row.FCLinkButton("LnkAgregarTraslado").CssClass = "btn btn-sm green"
e.Row.FCLinkButton("LnkAgregarTraslado").Text = "<i class='fa fa-info' ></i>"
e.Row.FCLinkButton("LnkAgregarTraslado").Attributes.Add("Title", "Ver vinculación")
Else
e.Row.FCLinkButton("LnkAgregarTraslado").CssClass = "btn btn-sm blue"
e.Row.FCLinkButton("LnkAgregarTraslado").Text = "<i class='fa fa-check'></i>"
e.Row.FCLinkButton("LnkAgregarTraslado").Attributes.Add("Title", "Vincular Traslado")
End If
'If CveComplementoTraslado > 0 Then
' e.Row.FCLinkButton("LnkAgregarTraslado").CssClass = "btn btn-sm green"
' e.Row.FCLinkButton("LnkAgregarTraslado").Text = "<i class='fa fa-info' ></i>"
' e.Row.FCLinkButton("LnkAgregarTraslado").Attributes.Add("Title", "Ver vinculación")
'Else
' e.Row.FCLinkButton("LnkAgregarTraslado").CssClass = "btn btn-sm blue"
' e.Row.FCLinkButton("LnkAgregarTraslado").Text = "<i class='fa fa-check'></i>"
' e.Row.FCLinkButton("LnkAgregarTraslado").Attributes.Add("Title", "Vincular Traslado")
'End If
End If

View File

@@ -2360,7 +2360,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim ErrorArchivo = False
Dim ErrorExcel = False
DdlPlantilla.SelectedValue = DdlPlantilla2.SelectedValue
dt = ReadExcelFile(Ruta + FileName, True)
dt = ReadExcelFile(Ruta + FileName, True, 0)
If Not ErrorArchivo Then

View File

@@ -441,7 +441,7 @@ Partial Class Contabilidad_RepEstadoResultados
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
If ObjConta.GetEstadoResultadosMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte) Then
If ObjConta.GetEstadoResultadosMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, DdlSegmentoNegocio.SelectedValue.ToEntero) Then
DtDatosMensual = ObjConta.DtResultados
Else
DtDatosMensual = Nothing
@@ -818,7 +818,7 @@ Partial Class Contabilidad_RepEstadoResultados
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
If ObjConta.GetEstadoResultadosAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte) Then
If ObjConta.GetEstadoResultadosAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, DdlSegmentoNegocio.SelectedValue.ToEntero) Then
DtDatosAnual = ObjConta.DtResultados
Else
DtDatosAnual = Nothing

View File

@@ -1606,7 +1606,7 @@ KM12 HERMOSILLO, SONORA</Value>
<Height>5.84433in</Height>
<Style />
</Body>
<Width>5.09083in</Width>
<Width>4.93458in</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Linq;
using System.Web;
@@ -75,11 +76,33 @@ public partial class Nomina_Finiquito : ClsPaginas
set { ViewState["dtempleados"] = value; }
}
private HybridDictionary EmpresasFuncionalidades
{
get
{
if (ViewState["EmpresasFuncionalidades"] == null) { return null; }
else { return (HybridDictionary)ViewState["EmpresasFuncionalidades"]; }
}
set { ViewState["EmpresasFuncionalidades"] = value; }
}
private HybridDictionary EmpresasFuncionalidadesnoV4
{
get
{
if (ViewState["EmpresasFuncionalidadesnoV4"] == null) { return null; }
else { return (HybridDictionary)ViewState["EmpresasFuncionalidadesnoV4"]; }
}
set { ViewState["EmpresasFuncionalidadesnoV4"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
CreaObjetoEmpresa(UsuarioActual);
GvFinOrdinario.DataSource = new DataTable();
GVFinIndemnizacion.DataSource = new DataTable();
GvFinOrdinario.DataBind();
@@ -529,6 +552,109 @@ public partial class Nomina_Finiquito : ClsPaginas
// }
//}
private void CreaObjetoEmpresa(Usuario UsuarioActual)
{
ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas();
if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1"))
{
if (ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa))
{
System.Data.DataTable dttmp = ObjEmpresa.DtResultados;
EmpresasFuncionalidades = new HybridDictionary();
EmpresasFuncionalidadesnoV4 = new HybridDictionary();
foreach (System.Data.DataRow Row in dttmp.Rows)
{
if (Convert.ToInt32(Row["CveFuncionalidad"]) != 350)
{
EmpresasFuncionalidadesnoV4.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
}
EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
}
//ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
}
UsuarioActual.Empresa = ObjEmpresa.Empresa;
}
else
{
}
ObjEmpresa.Dispose();
}
public string TimbrarNominaV3_3(int CveNomina, int CvePersonal, int CvePeriodo, Usuario UsuarioActual, int CvePAC = 4)
{
LogicNominas lnom = new LogicNominas();
string Retorno = "";
string GetError = ""; // Le reasigno el current error a nulo
//System.Diagnostics.Stopwatch sw = null;
bool hasfiniquito = false;
UsuarioActual.Empresa.SetFuncionalidades(EmpresasFuncionalidadesnoV4);
//if (guardarLogTimbrado)
//{
// sw = new System.Diagnostics.Stopwatch();
// sw.Start();
//}
CFDITimbre cfdi = lnom.PreTimbrar(CveNomina, UsuarioActual, false); // CvePersonal, CvePeriodo,
cfdi.Comprobante.CondicionesdePago = "";
if (cfdi != null && cfdi.Mensaje == "")
{
if (!cfdi.Timbrado)
{
Timbrado ObjTimbrado = new Timbrado();
Modelos.Factura ObjFactura = new Modelos.Factura();
ObjFactura.TipoDocto = "Nomina";
ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero();
ObjFactura.Serie = cfdi.Comprobante.Serie;
ObjFactura.Timbre = cfdi;
if (!ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC))
Retorno = ObjTimbrado.MensajeErrorCFDI;
}
if (Retorno != "")
Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}";
else if (hasfiniquito)
{
cfdi = lnom.PreTimbrar(CveNomina, UsuarioActual, true); // CvePersonal, CvePeriodo,
if (cfdi != null && cfdi.Mensaje == "")
{
if (!cfdi.Timbrado)
{
Timbrado ObjTimbrado = new Timbrado();
Modelos.Factura ObjFactura = new Modelos.Factura();
ObjFactura.TipoDocto = "Nomina";
ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero();
ObjFactura.Serie = cfdi.Comprobante.Serie;
ObjFactura.Timbre = cfdi;
if (!ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC))
Retorno = ObjTimbrado.MensajeErrorCFDI;
if (Retorno != "")
Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}";
else
{
}
}
}
else if (cfdi == null)
Retorno = $"No se pudo generar el pretimbre(GetError): <br/> {GetError}";
else
Retorno = $"No se pudo generar el pretimbre: <br/> {cfdi.Mensaje}";
}
}
else if (cfdi == null)
Retorno = $"No se pudo generar el pretimbre(GetError): <br/> {GetError}";
else
Retorno = $"No se pudo generar el pretimbre: <br/> {cfdi.Mensaje}";
//if (guardarLogTimbrado)
//{
// sw.Stop();
// GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString(), UsuarioActual.Empresa.CvePAC, "Nomina");
//}
UsuarioActual.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
return Retorno;
}
protected void LnkTimbrar_Click(object sender, EventArgs e)
{
int CvePeriodo = CvePeriodoFiniquito;
@@ -539,7 +665,16 @@ public partial class Nomina_Finiquito : ClsPaginas
int CveNomina = dtr.Rows[0]["CveNomina"].ToString().ToEntero();
LogicNominas lognom = new LogicNominas();
string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
string Msg = "";
if (UsuarioActual.CveEmpresa == 119)
{
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
}
else
{
Msg = TimbrarNominaV3_3(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
}
if (Msg != null && Msg.Length > 0)
{ Alert(Msg, TipoMensaje.MsgAdvertencia); }
else
@@ -547,7 +682,7 @@ public partial class Nomina_Finiquito : ClsPaginas
using (ClsNominas ObjPeriodo = new ClsNominas())
{
ObjPeriodo.CambiaEstatusPeriodo(CvePeriodo, (int)enumNominasEstatus.Timbrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
//ObjPeriodo.CambiaEstatusPeriodo(CvePeriodo, (int)enumNominasEstatus.Timbrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
loadsobrerecibo(ObjPeriodo);
}
//ObjPeriodo.Dispose();

View File

@@ -4060,7 +4060,7 @@
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RetiroSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>showResult
</Columns>
</asp:GridView>--%>
</div>

View File

@@ -97,11 +97,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
get
{
if (ViewState["dtempleados"] == null) { return null; }
else { return (DataTable)ViewState["dtempleados"]; }
if (ViewState["DtSuaProcesado"] == null) { return null; }
else { return (DataTable)ViewState["DtSuaProcesado"]; }
}
set { ViewState["dtempleados"] = value; }
set { ViewState["DtSuaProcesado"] = value; }
}
protected bool PermisoCancelarEmitido
@@ -206,12 +206,37 @@ public partial class Nomina_Nomina2 : ClsPaginas
set { ViewState["FiltAgrupador"] = value; }
}
private HybridDictionary EmpresasFuncionalidades
{
get
{
if (ViewState["EmpresasFuncionalidades"] == null) { return null; }
else { return (HybridDictionary)ViewState["EmpresasFuncionalidades"]; }
}
set { ViewState["EmpresasFuncionalidades"] = value; }
}
private HybridDictionary EmpresasFuncionalidadesnoV4
{
get
{
if (ViewState["EmpresasFuncionalidadesnoV4"] == null) { return null; }
else { return (HybridDictionary)ViewState["EmpresasFuncionalidadesnoV4"]; }
}
set { ViewState["EmpresasFuncionalidadesnoV4"] = value; }
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CreaObjetoEmpresa(UsuarioActual);
DataTable dtperinc = null;
using (ClsNominas objnom = new ClsNominas())
{
@@ -1185,7 +1210,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
Alert("se reenviaron los recibos timbrados");
}
public string msgCorregidoSat(string msg, int CvePersonal, string RFC, string CURP)
{
string retorno = msg;
@@ -1255,7 +1280,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
LogicNominas lognom = new LogicNominas();
string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
string Msg = "";
if (UsuarioActual.CveEmpresa == 119)
{
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
}
else
{
Msg = TimbrarNominaV3_3(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
}
if (Msg != null && Msg.Length > 0)
{
Msg = msgCorregidoSat(Msg, CvePersonal, RFC, CURP);
@@ -1311,7 +1344,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
UpDatos.Update();
}
private void CreaObjetoEmpresa(ref Usuario UsuarioActual)
private void CreaObjetoEmpresa(Usuario UsuarioActual)
{
ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas();
if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1"))
@@ -1320,10 +1353,17 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
System.Data.DataTable dttmp = ObjEmpresa.DtResultados;
HybridDictionary EmpresasFuncionalidades = new HybridDictionary();
EmpresasFuncionalidades = new HybridDictionary();
EmpresasFuncionalidadesnoV4 = new HybridDictionary();
foreach (System.Data.DataRow Row in dttmp.Rows)
{
if (Convert.ToInt32(Row["CveFuncionalidad"]) != 350)
{
EmpresasFuncionalidadesnoV4.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
}
EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString());
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
}
//ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
}
UsuarioActual.Empresa = ObjEmpresa.Empresa;
@@ -1427,7 +1467,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
UsuarioActual = this.UsuarioActual;
}*/
string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual,(UsuarioActual.CveUsuario==100?4:4));
string Msg = "";// lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, (UsuarioActual.CveUsuario == 100 ? 4 : 4));
if (UsuarioActual.CveEmpresa == 119)
{
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
}
else
{
Msg = TimbrarNominaV3_3(CveNomina, CvePersonal, CvePeriodo, UsuarioActual);
}
if (Msg != null && Msg.Length > 0)
{ Alert(string.Format("El empleado no se pudo timbrar, el sat nos devolvio el siguiente mensaje:<br/>{0}", Msg), TipoMensaje.MsgAdvertencia); }
else
@@ -2562,12 +2610,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
DdlFormapagovacaciones_SelectedIndexChanged(null, null);
ChkVacPrimaVacacional.Checked = true;
ChkVacCobrarIMSS.Checked = true;
using(ClsNominas objnom = new ClsNominas())
using (ClsNominas objnom = new ClsNominas())
{
if(objnom.GETPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, SRCvePersonal))
if (objnom.GETPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, SRCvePersonal))
{
DataRow drow = objnom.DtResultados.FiltroPrimero("Selected =1");
if(drow != null)
if (drow != null)
{
DdlVacPeriodo.SelectedValueExist(drow["Ejercicio"].ToString());
@@ -7364,7 +7412,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
TxtSRINCfolio.Text = "";
TxtSRINCfechaInicio.Text = "";
TxtSRINCdiasAutorizados.Text = "";
TxtDiasPagoEmpresa.Text = UsuarioActual.CveEmpresa ==141?"3":"";
TxtDiasPagoEmpresa.Text = UsuarioActual.CveEmpresa == 141 ? "3" : "";
DdlSRINCcveTipodeIncidencia.SelectedValue = "-1";
DdlSRINCcveRamoSeguro.SelectedValue = "-1";
DdlSRINCcveTipoRiesgo.SelectedValue = "-1";
@@ -8070,7 +8118,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
using (ClsNominas nom = new ClsNominas())
{
if (nom.GetPeriodos(-1,UsuarioActual.CveEmpresa,-1,-1, DdlPeriodo.SelectedValue.ToEntero(),-1) && (nom.DtResultados.Rows.Count>0))
if (nom.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodoSeleccionado, -1) && (nom.DtResultados.Rows.Count > 0))
{
fechai = nom.DtResultados.Rows[0]["FechaInicio"].ToString().ToDateTime();
fechaf = nom.DtResultados.Rows[0]["FechaFin"].ToString().ToDateTime();
@@ -8124,10 +8172,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
int chkImporteValor = 1;
int chkImporte = 1;
int chkImporteGravado = 0;
List<Archivo> Filesgral = TxtArchivoNomina.getfiles().Archivos;
//int chkImporteValor = 1;
//int chkImporte = 1;
//int chkImporteGravado = 0;
DateTime fechai = TxtRIFechaInicio.Text.ToDateTime();
DateTime fechaf = TxtRIFechaFin.Text.ToDateTime();
List<Archivo> Filesgral = TxtAsistenciaTabular.getfiles().Archivos;
bool continuar = Filesgral.Count > 0;
string stringError = "";
Archivo fileItem = continuar ? Filesgral[0] : null;
@@ -8156,7 +8206,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
try
{
DataTable dtxz = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true,4);
DataTable dtxz = Extensiones.ModExtensiones.ReadExcelFile(fileItem.FileUrl, true, 4);
DTEXcel = dtxz.FiltraParametros(" LEN(Codigo)>0 AND Codigo <> 'Codigo'");
}
@@ -8174,32 +8224,96 @@ public partial class Nomina_Nomina2 : ClsPaginas
continuar = false;
stringError = "No se encontraron cambios";
}
if(continuar)
if (continuar)
{
for (int j = 2; j < DTEXcel.Rows.Count; j++)
using (ClsNominas nom = new ClsNominas())
{
for (int i = 1; i < DTEXcel.Columns.Count; i++)
if (nom.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodoSeleccionado, -1) && (nom.DtResultados.Rows.Count > 0))
{
/*
//
string conceptocodigo = drowx[i].ToString(); string CveConcepto;
DataRow dconr = dtConceptos.FiltroPrimero(string.Format("codigo='{0}'", conceptocodigo));
if (dconr != null)
{
CveConcepto = dconr["CveConcepto"].ToString();
dtxz.Columns[i].ColumnName = CveConcepto;
}
else
{
continuar = false;
stringError = string.Format("Ocurrio un Error al procesar el excel código no valido '{0}'({1}).", conceptocodigo, i);
break;
}*/
//int CveConcepto = dtxz.Columns[i].ColumnName.ToEntero();
fechai = nom.DtResultados.Rows[0]["FechaInicio"].ToString().ToDateTime();
fechaf = nom.DtResultados.Rows[0]["FechaFin"].ToString().ToDateTime();
}
}
for (int i = 2; i < DTEXcel.Columns.Count; i++)
{
DateTime FechaAsis = DTEXcel.Columns[i].ColumnName.ToDateTime();
if( FechaAsis < fechai || FechaAsis > fechaf)
{
continuar = false;
stringError = "Las fechas no concuerdadn con el periodo seleccionado";
}
}
}
if (continuar)
{
int CvePersonal = 0;
string Codigo;
DateTime FechaAsis;
DataTable dtasis = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
List<string> listaerrores = new List<string>();
using (ClsRH ObjPersonal = new ClsRH())
{
for (int j = 0; j < DTEXcel.Rows.Count; j++)
{
Codigo = DTEXcel.Rows[j]["Codigo"].ToString();
CvePersonal = -1;
if (Codigo != "-1" && ObjPersonal.GetPersonal(CvePersonal, Codigo, "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) &&
ObjPersonal.DtResultados.Rows.Count == 1)
{
CvePersonal = ObjPersonal.CvePersonal;
//CveMetodoPago = objpersonal.CveMetodoPago;
}
for (int i = 2; i < DTEXcel.Columns.Count; i++)
{
FechaAsis = DTEXcel.Columns[i].ColumnName.ToDateTime();
string tipoasistencia = DTEXcel.Rows[j][i].ToString();
DataRow drasis = dtasis.FiltroPrimero(string.Format("Tipo = '{0}'", tipoasistencia));
if (CvePersonal > 0 && drasis != null && ObjPersonal.AddAsistencia(CvePersonal, -2, -2, FechaAsis,
drasis["CveAsistenciasInasistencias"].ToString().ToEntero(), 100, -2, -2, -2, TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
continuar = true;
}
if (CvePersonal > 0 && drasis == null && !listaerrores.Contains(tipoasistencia) && tipoasistencia != "" && tipoasistencia != "--" && tipoasistencia != "-")
{
listaerrores.Add(DTEXcel.Rows[j][i].ToString());
// stringError = String.Format("{0}<br>el empleado {1} tiene una asistencia invalidad el dia {2:dd/MM/yyyy}", stringError, Codigo, FechaAsis);
}
}
}
}
if (continuar)
{
cargarasistencia();
if (listaerrores.Count > 0)
{
string strmsg = "Los siguientes tipos de asistencia no pudieron ser cargados porque no se encuentran registrados ";
for (int i = 0; i < listaerrores.Count; i++)
{
strmsg = String.Format("{0}<br/>{1}", strmsg, listaerrores[i]);
}
Alert(strmsg, TipoMensaje.MsgInformacion);
}
else
{
Alert("La Asistencia se guardó correctamente.", TipoMensaje.MsgInformacion);
}
UpDatos.Update();
}
else
{
Alert(stringError, TipoMensaje.MsgAdvertencia);
}
}
else
{
Alert(stringError, TipoMensaje.MsgAdvertencia);
}
RegistraScript("$('#DModalAsistenciaTabular').modal('hide')");
}
protected void LnkProcesarReporteIncidencia_Click(object sender, EventArgs e)
@@ -9017,4 +9131,79 @@ public partial class Nomina_Nomina2 : ClsPaginas
RegistraScript(string.Format("$('#ModalViewCorreo').modal();", TxtmcImporte.ClientID));
}
public string TimbrarNominaV3_3(int CveNomina, int CvePersonal, int CvePeriodo, Usuario UsuarioActual, int CvePAC = 4)
{
LogicNominas lnom = new LogicNominas();
string Retorno = "";
string GetError = ""; // Le reasigno el current error a nulo
//System.Diagnostics.Stopwatch sw = null;
bool hasfiniquito = false;
UsuarioActual.Empresa.SetFuncionalidades(EmpresasFuncionalidadesnoV4);
//if (guardarLogTimbrado)
//{
// sw = new System.Diagnostics.Stopwatch();
// sw.Start();
//}
CFDITimbre cfdi = lnom.PreTimbrar(CveNomina, UsuarioActual, false); // CvePersonal, CvePeriodo,
cfdi.Comprobante.CondicionesdePago = "";
if (cfdi != null && cfdi.Mensaje == "")
{
if (!cfdi.Timbrado)
{
Timbrado ObjTimbrado = new Timbrado();
Modelos.Factura ObjFactura = new Modelos.Factura();
ObjFactura.TipoDocto = "Nomina";
ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero();
ObjFactura.Serie = cfdi.Comprobante.Serie;
ObjFactura.Timbre = cfdi;
if (!ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC))
Retorno = ObjTimbrado.MensajeErrorCFDI;
}
if (Retorno != "")
Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}";
else if (hasfiniquito)
{
cfdi = lnom.PreTimbrar(CveNomina, UsuarioActual, true); // CvePersonal, CvePeriodo,
if (cfdi != null && cfdi.Mensaje == "")
{
if (!cfdi.Timbrado)
{
Timbrado ObjTimbrado = new Timbrado();
Modelos.Factura ObjFactura = new Modelos.Factura();
ObjFactura.TipoDocto = "Nomina";
ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero();
ObjFactura.Serie = cfdi.Comprobante.Serie;
ObjFactura.Timbre = cfdi;
if (!ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, CvePAC))
Retorno = ObjTimbrado.MensajeErrorCFDI;
if (Retorno != "")
Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}";
else
{
}
}
}
else if (cfdi == null)
Retorno = $"No se pudo generar el pretimbre(GetError): <br/> {GetError}";
else
Retorno = $"No se pudo generar el pretimbre: <br/> {cfdi.Mensaje}";
}
}
else if (cfdi == null)
Retorno = $"No se pudo generar el pretimbre(GetError): <br/> {GetError}";
else
Retorno = $"No se pudo generar el pretimbre: <br/> {cfdi.Mensaje}";
//if (guardarLogTimbrado)
//{
// sw.Stop();
// GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString(), UsuarioActual.Empresa.CvePAC, "Nomina");
//}
UsuarioActual.Empresa.SetFuncionalidades(EmpresasFuncionalidades);
return Retorno;
}
}

View File

@@ -4,11 +4,11 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.GVCalculosSBC tr th:nth-child(n+8):not(:nth-child(n+12)) {
.GVCalculosSBC tr th:nth-child(n+8):not(:nth-child(n+13)) {
background-color: #a9a9e8 !important;
}
.GVCalculosSBC tr th:nth-child(n+12):not(:nth-child(n+15)) {
.GVCalculosSBC tr th:nth-child(n+13):not(:nth-child(n+16)) {
background-color: #88d6cd !important;
}
</style>
@@ -23,7 +23,9 @@
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkUpSuamodal" OnClick="LnkUpSuamodal_Click" runat="server"><i class="fa fa-check"></i> Cargar archivo SUA</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkDescargar" OnClick="LnkDescargar_Click" runat="server"><i class="fa fa-ad-excel"></i> Descargar</asp:LinkButton>
</li>
<li>
@@ -32,7 +34,7 @@
<li>
<asp:LinkButton ID="Lnkmostrararchivos" OnClick="Lnkmostrararchivos_Click" runat="server"><i class="fa fa-save"></i> Mostrar archivos</asp:LinkButton>
</li>
<li style="display: none">
<li>
<asp:LinkButton ID="LnkDownArchivosSua" OnClick="LnkDownArchivosSua_Click" runat="server"><i class="fa fa-download"></i> Descargar Archivos IDSE</asp:LinkButton>
</li>
</ContentTemplate>
@@ -55,7 +57,7 @@
<div class="titlefiltros caption">
<div class="row">
<asp:Label ID="Label1" runat="server" CssClass="col-md-1 ">Tipo :</asp:Label>
<div class="col-md-3" id="Div1" runat="server">
<div class="col-md-2" id="Div1" runat="server">
<asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control select2me">
<asp:ListItem Value="1" Text="Cambio en salario variable" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="modificación de salario"></asp:ListItem>
@@ -63,7 +65,7 @@
</div>
<asp:Label ID="LblFechaPago" runat="server" CssClass="col-md-1 ">Fecha :</asp:Label>
<div class="col-md-3" id="DivFechaPago" runat="server">
<div class="col-md-2" id="DivFechaPago" runat="server">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaPago" runat="server" Text="01/03/2021" CssClass="form-control" CausesValidation="true" Width="90%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
@@ -77,7 +79,14 @@
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaPago" Display="None" ErrorMessage="El campo <b>''Fecha Pago''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-4">
<asp:Label runat="server" AssociatedControlID="DdlRegistroPatronal" Text="Registro Patronal:" CssClass="col-md-1 "></asp:Label>
<div class="col-md-2">
<asp:DropDownList ID="DdlRegistroPatronal" runat="server" Width="100%" DataTextField="RegistroPatronal" CssClass="form-control input-sm select2me" DataValueField="CveRegistroPatronal" AppendDataBoundItems="true">
<asp:ListItem Value="-1" Text="Todas"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkCalcular" OnClick="LnkCalcular_Click" runat="server" Text="Calcular" Visible="true" class="btn btn-primary" />
</div>
</div>
@@ -86,18 +95,23 @@
</div>
</div>
</div>
<div style="float: right;">
<asp:TextBox CssClass="TxtBusqueda form-control input-sm" runat="server" onkeyup="FiltrarTablaV2('.TxtBusqueda','.GVBuscaddor')" Style="display: inline-block; margin-right: -20px; width: 150px;"></asp:TextBox>
<a href="javascript:;" onclick="FiltrarTablaV2('.TxtBusqueda','.GVCalculosSBC')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold yellow-gold"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
</div>
<ajax:TabContainer ID="Tab" runat="server" Width="100%">
<ajax:TabPanel ID="TabSBC" runat="server" HeaderText="Salario base cotización">
<ContentTemplate>
<table id="tableheader" style="display: none">
<tr>
<th colspan="7"></th>
<th colspan="4" style="background-color: #a9a9e8 !important;">Actual</th>
<th colspan="5" style="background-color: #a9a9e8 !important;">Actual</th>
<th colspan="3" style="background-color: #88d6cd !important;">Nuevo</th>
<th></th>
<%--<th></th>--%>
</tr>
</table>
<asp:GridView ID="GVCalculosSBC" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalculosSBC" AutoGenerateColumns="False" data-tableheader="#tableheader"
<asp:GridView ID="GVCalculosSBC" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalculosSBC GVBuscaddor" AutoGenerateColumns="False" data-tableheader="#tableheader"
DataKeyNames="CvePersonal,Codigo,Nombre,FechaInicio,Antiguedad,Incapacitado,NumeroSS,CveTipodeSalario,TipodeSalario,SalarioDiario,SDINuevo,SalarioVariableNuevo,SalarioDiarioSSNuevo,SDI,SalarioVariable,SalarioDiarioSS,PorPrimaVacacional,NumDiasAguinaldo,Acumulado,diasBimestre,Faltas,Incapaciadad,diaslaborados,Movtotxt,RegistroPatronal">
<Columns>
<asp:TemplateField HeaderText="Código">
@@ -112,13 +126,13 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("SubProyecto")%>'> </asp:Label>
<asp:Label runat="server" Text='<%# Eval("SubProyecto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Registro Patronal">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RegistroPatronal")%>'> </asp:Label>
<asp:Label runat="server" Text='<%# Eval("RegistroPatronal")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
@@ -179,6 +193,15 @@
<asp:Label ID="lblsalarioDiarioSS" runat="server" Text='<%# Eval("SalarioDiarioSS","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
Salario
<br />SUA
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblSalarioSUA" runat="server" Text='<%# Eval("SalarioSUA","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
@@ -186,7 +209,7 @@
integrado
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsDI" runat="server" Text='<%# Eval("SDINuevo","{0:N2}")%>'> </asp:Label>
<asp:Label ID="lblsDIn" runat="server" Text='<%# Eval("SDINuevo","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
@@ -196,7 +219,7 @@
variable
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsalarioVariable" runat="server" Text='<%# Eval("SalarioVariableNuevo","{0:N2}")%>'> </asp:Label>
<asp:Label ID="lblsalarioVariablev" runat="server" Text='<%# Eval("SalarioVariableNuevo","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
@@ -206,7 +229,7 @@
cotización
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsalarioDiarioSS" runat="server" Text='<%# Eval("SalarioDiarioSSNuevo","{0:N2}")%>'> </asp:Label>
<asp:Label ID="lblsalarioDiarioSSs" runat="server" Text='<%# Eval("SalarioDiarioSSNuevo","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center">
@@ -214,7 +237,15 @@
Modificación
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblsalarioDiarioSS" runat="server" Text='<%# (Eval("SalarioDiarioSSNuevo", "{0:N2}") == Eval("SalarioDiarioSS", "{0:N2}") ? "NO" : "SI") %>'> </asp:Label>
<asp:Label ID="lblsalarioDiarioSSf" runat="server" Text='<%# (Eval("SalarioDiarioSSNuevo", "{0:N2}") == Eval("SalarioDiarioSS", "{0:N2}") ? "NO" : "SI") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center" Visible="false">
<ItemTemplate>
<div style="width: 50px;">
<asp:CheckBox runat="server" ID="chkCon" />
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -224,7 +255,7 @@
<ajax:TabPanel ID="TabParteFija" runat="server" HeaderText="Parte fija">
<ContentTemplate>
<asp:GridView ID="GVCFija" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
<asp:GridView ID="GVCFija" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVBuscaddor" AutoGenerateColumns="False" HeaderStyle-CssClass="ADtr"
DataKeyNames="CvePersonal,Codigo,Nombre,FechaInicio,Antiguedad,Incapacitado,NumeroSS,CveTipodeSalario,TipodeSalario,SalarioDiario,SDI,SalarioVariable,SalarioDiarioSS,PorPrimaVacacional,NumDiasAguinaldo,Acumulado,diasBimestre,Faltas,Incapaciadad,diaslaborados">
<Columns>
<asp:TemplateField HeaderText="Código">
@@ -331,7 +362,7 @@
<ajax:TabPanel ID="TabParteVariable" runat="server" HeaderText="Parte variable">
<ContentTemplate>
<asp:GridView ID="GVPV" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
<asp:GridView ID="GVPV" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVBuscaddor" AutoGenerateColumns="False" HeaderStyle-CssClass="ADtr"
DataKeyNames="CvePersonal,Codigo,Nombre,FechaInicio,Antiguedad,Incapacitado,NumeroSS,CveTipodeSalario,TipodeSalario,SalarioDiario,SDI,SalarioVariable,SalarioDiarioSS,PorPrimaVacacional,NumDiasAguinaldo,Acumulado,diasBimestre,Faltas,Incapaciadad,diaslaborados">
<Columns>
<asp:TemplateField HeaderText="Código">
@@ -344,9 +375,10 @@
<asp:Label ID="lblnombre" runat="server" Text='<%# Eval("Nombre")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Fecha alta <br />
Fecha alta
<br />
o reingreso
</HeaderTemplate>
<ItemTemplate>
@@ -373,18 +405,20 @@
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
Percepciones <br />
Percepciones
<br />
variables
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblacumulado" runat="server" Text='<%# Eval("Acumulado","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>
Días <br />
Días
<br />
incapacidad
</HeaderTemplate>
<ItemTemplate>
@@ -417,7 +451,7 @@
</ajax:TabPanel>
<ajax:TabPanel ID="TabDetalleParteVariable" runat="server" HeaderText="Detalle parte variable">
<ContentTemplate>
<asp:GridView ID="GVDetalleParteVariable" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall"></asp:GridView>
<asp:GridView ID="GVDetalleParteVariable" HeaderStyle-CssClass="ADtr" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVBuscaddor"></asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
@@ -580,7 +614,223 @@
</div>
</div>
<div id="DmodalCompareSua" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpArchivoSua" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" runat="server" style="text-align: left">Procesar Archivo SUA</h4>
</div>
<div class="modal-body">
<div class="portlet light smmallpadding bordered" id="cargaarchivoprocesasua">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Cargar Archivo</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:TextBox ID="TxtArchivoSua" CssClass="ADSdropzone hidden" runat="server"></asp:TextBox>
<div class="text-center">
</div>
</div>
</div>
<div class="portlet light smmallpadding bordered" id="resultadoprocesasua" style="display: none">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Paso 2:Resultado (Periodo :
<asp:Literal ID="LtlPeriodo" runat="server"></asp:Literal>)</span>
</div>
<div class="tools">
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkDownExcelSua" OnClick="LnkDownExcelSua_Click" CssClass="btn btn-default" runat="server"><i class="fa fa-ad-excel"></i>Descargar</asp:LinkButton>
</div>
</div>
</div>
<div class="portlet-body rowpadding " style="display: none;">
<div style="width: 1200px; min-height: 340px;">
<table id="headerProcesaSUAxd" style="display: none">
<tr>
<th colspan="5"></th>
<th colspan="10">Obrera</th>
<th colspan="10">Patronal</th>
</tr>
<tr>
<th></th>
<th colspan="2">Salario</th>
<th colspan="2">Días</th>
<th colspan="2">Cuota Excedente</th>
<th colspan="2">Prestaciones en Dinero</th>
<th colspan="2">Gastos Medicos</th>
<th colspan="2">Invalidez y Vida</th>
<th colspan="2">Cesantia y Vejez</th>
<th colspan="2">Cuota Fija</th>
<th colspan="2">Riesgos de Trabajo</th>
<th colspan="2">Guarderia</th>
<th colspan="2">Retiro</th>
<th colspan="2">Cesantia y Vejez</th>
</tr>
</table>
<asp:GridView ID="GVProcesarSUA" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD" AutoGenerateColumns="False"
OnRowDataBound="GVProcesarSUA_RowDataBound" data-height="300" data-tableheader="#headerProcesaSUAxd"
DataKeyNames="CvePersonal,CodigoNombreCompleto,CuotaFijaSUA,CuotaFijaSIG,CuotaExcedenteSUA,CuotaExcedenteSIG,PrestacionesDineroSUA,PrestacionesSIG,GastosMedPenSUA,GastosMedicosSIG,RiesgosdeTrabajoSUA,RiesgoTrabajoSIG,InvalidezyVidaSUA,InvalidezyVidaSIG,GuarderiaSUA,GuarderiaSIG,RetiroSUA,RetiroSIG,SalarioSUA,SalarioSIG,CesantiayVejezObreraSUA,CesantiayVejezObreraSIG,CesantiayVejezPatronalSUA,CesantiayVejezPatronalSIG">
<Columns>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
<asp:Label ID="lblcodigoNombreCompleto" runat="server" Text='<%# Eval("CodigoNombreCompleto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("SalarioSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("SalarioSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("DiasMes","{0:N0}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("DiasAsistio","{0:N0}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CuotaExcedenteSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CuotaExcedenteSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("PrestacionesDineroSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("PrestacionesSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("GastosMedPenSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("GastosMedicosSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("InvalidezyVidaSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("InvalidezyVidaSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CesantiayVejezObreraSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CesantiayVejezObreraSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CuotaFijaSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CuotaFijaSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RiesgosdeTrabajoSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RiesgoTrabajoSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("GuarderiaSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("GuarderiaSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RetiroSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("RetiroSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SUA">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CesantiayVejezPatronalSUA","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SIG">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("CesantiayVejezPatronalSIG","{0:N2}")%>'> </asp:Label></td>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LnkUpSuaFile" OnClick="LnkUpSuaFile_Click" CssClass="btn btn-primary" runat="server"> Procesar</asp:LinkButton>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDownExcelSua" />
</Triggers>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
@@ -600,6 +850,32 @@
document.body.removeChild(elem);
}
}
function showResult() {
/*
setTimeout(function () {
let collapse = $('#cargaarchivoprocesasua .expand');
let body = $('#cargaarchivoprocesasua .portlet-body');
if (collapse && collapse.length > 0) {
collapse.removeClass('collapse');
collapse.addClass('expand');
}
if (body && body.length > 0) {
body.css('display', 'none');
}
collapse = $('#resultadoprocesasua .collapse');
body = $('#resultadoprocesasua .portlet-body');
if (collapse && collapse.length > 0) {
collapse.addClass('collapse');
collapse.removeClass('expand');
}
if (body && body.length > 0) {
body.css('display', '');
}
setTimeout(function () { loadadscroll(); }, 50);
}, 400);*/
}
</script>
</asp:Content>

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -23,6 +24,17 @@ public partial class RH_CalculoSBC : ClsPaginas
if (!IsPostBack)
{
TxtFechaPago.Text = String.Format("{0:01/MM/yyyy}", DateTime.Now);
ClsRH ObjRH = new ClsRH();
if (ObjRH.GetRegistrosPatronales(-1, UsuarioActual.CveEmpresa, 1))
DdlRegistroPatronal.DataSource = ObjRH.DtResultados;
else
DdlRegistroPatronal.DataSource = null;
DdlRegistroPatronal.DataBind();
ObjRH.Dispose();
//string rutarchivos = string.Format("{0}modificacionsalarios\\", UsuarioActual.Empresa.RutaArchivos);
//Alert(rutarchivos);
//ADSNetLibrary.SIGAPI.Services.Agropecuaria.IAgropecuariaService servicioAgro = new ADSNetLibrary.SIGAPI.Services.Agropecuaria.AgropecuariaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
@@ -34,11 +46,157 @@ public partial class RH_CalculoSBC : ClsPaginas
}
}
protected void LnkDownExcelSua_Click(object sender, EventArgs e)
{
}
protected void LnkUpSuamodal_Click(object sender, EventArgs e)
{
TxtArchivoSua.Text = "";
GVProcesarSUA.DataSource = null;
GVProcesarSUA.DataBind();
RegistraScript("$('#DmodalCompareSua').modal();shownew();");
UpArchivoSua.Update();
}
protected void LnkUpSuaFile_Click(object sender, EventArgs e)
{
string fileurl = "";
GVProcesarSUA.DataSource = null;
Files archivos = TxtArchivoSua.getfiles();
if (archivos.Archivos.Count > 0)
{
fileurl = archivos.Archivos[0].FileUrl;
string SuaFiletext = System.IO.File.ReadAllText(fileurl, Encoding.GetEncoding("iso-8859-1"));
using (ClsNominas ObjPersonal = new ClsNominas())
{
if (ObjPersonal.ProcesarSUA(SuaFiletext, UsuarioActual.CveEmpresa))
{
if (ObjPersonal.DTSetResultados.Tables.Count > 4)
{
DateTime dateperiodo;
DateTime.TryParseExact(string.Format("{0}01", ObjPersonal.DTSetResultados.Tables[1].Rows[0]["Periodo"]), "yyyyMMdd", new System.Globalization.CultureInfo("es-MX"), System.Globalization.DateTimeStyles.None, out dateperiodo);
LtlPeriodo.Text = dateperiodo.Date.ToString("MMMM yyyy", new System.Globalization.CultureInfo("es-MX"));
//DtSuaProcesado = ObjPersonal.DTSetResultados.Tables[3];
GVProcesarSUA.DataSource = ObjPersonal.DTSetResultados.Tables[3];
}
}
}
}
GVProcesarSUA.DataBind();
TxtArchivoSua.Text = "";
//RegistraScript("showResult();");
RegistraScript("$('#DmodalCompareSua').modal('hide');shownew();");
Alert("El archivo se a procesado Correctamente");
LnkCalcular_Click(null,null);
UpArchivoSua.Update();
}
protected void GVProcesarSUA_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
e.Row.CssClass = "Totales";
}
string SalarioSUA = string.Format("{0:N2}", e.Row.DataKey("SalarioSUA").ToDecimal());
string SalarioSIG = string.Format("{0:N2}", e.Row.DataKey("SalarioSIG").ToDecimal());
int celda = 1;
if (Math.Abs(SalarioSUA.ToDecimal() - SalarioSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 4;
string CuotaExcedenteSUA = string.Format("{0:N2}", e.Row.DataKey("CuotaExcedenteSUA").ToDecimal());
string CuotaExcedenteSIG = string.Format("{0:N2}", e.Row.DataKey("CuotaExcedenteSIG").ToDecimal());
if (Math.Abs(CuotaExcedenteSUA.ToDecimal() - CuotaExcedenteSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string PrestacionesDineroSUA = string.Format("{0:N2}", e.Row.DataKey("PrestacionesDineroSUA").ToDecimal());
string PrestacionesSIG = string.Format("{0:N2}", e.Row.DataKey("PrestacionesSIG").ToDecimal());
if (Math.Abs(PrestacionesDineroSUA.ToDecimal() - PrestacionesSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string GastosMedPenSUA = string.Format("{0:N2}", e.Row.DataKey("GastosMedPenSUA").ToDecimal());
string GastosMedicosSIG = string.Format("{0:N2}", e.Row.DataKey("GastosMedicosSIG").ToDecimal());
if (Math.Abs(GastosMedPenSUA.ToDecimal() - GastosMedicosSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string InvalidezyVidaSUA = string.Format("{0:N2}", e.Row.DataKey("InvalidezyVidaSUA").ToDecimal());
string InvalidezyVidaSIG = string.Format("{0:N2}", e.Row.DataKey("InvalidezyVidaSIG").ToDecimal());
if (Math.Abs(InvalidezyVidaSUA.ToDecimal() - InvalidezyVidaSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string CesantiayVejezObreraSUA = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezObreraSUA").ToDecimal());
string CesantiayVejezObreraSIG = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezObreraSIG").ToDecimal());
if (Math.Abs(CesantiayVejezObreraSUA.ToDecimal() - CesantiayVejezObreraSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string CuotaFijaSUA = string.Format("{0:N2}", e.Row.DataKey("CuotaFijaSUA").ToDecimal());
string CuotaFijaSIG = string.Format("{0:N2}", e.Row.DataKey("CuotaFijaSIG").ToDecimal());
if (Math.Abs(CuotaFijaSUA.ToDecimal() - CuotaFijaSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string RiesgosdeTrabajoSUA = string.Format("{0:N2}", e.Row.DataKey("RiesgosdeTrabajoSUA").ToDecimal());
string RiesgoTrabajoSIG = string.Format("{0:N2}", e.Row.DataKey("RiesgoTrabajoSIG").ToDecimal());
if (Math.Abs(RiesgosdeTrabajoSUA.ToDecimal() - RiesgoTrabajoSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string GuarderiaSUA = string.Format("{0:N2}", e.Row.DataKey("GuarderiaSUA").ToDecimal());
string GuarderiaSIG = string.Format("{0:N2}", e.Row.DataKey("GuarderiaSIG").ToDecimal());
if (Math.Abs(GuarderiaSUA.ToDecimal() - GuarderiaSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string RetiroSUA = string.Format("{0:N2}", e.Row.DataKey("RetiroSUA").ToDecimal());
string RetiroSIG = string.Format("{0:N2}", e.Row.DataKey("RetiroSIG").ToDecimal());
if (Math.Abs(RetiroSUA.ToDecimal() - RetiroSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
string CesantiayVejezPatronalSUA = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezPatronalSUA").ToDecimal());
string CesantiayVejezPatronalSIG = string.Format("{0:N2}", e.Row.DataKey("CesantiayVejezPatronalSIG").ToDecimal());
if (Math.Abs(CesantiayVejezPatronalSUA.ToDecimal() - CesantiayVejezPatronalSIG.ToDecimal()) > 1)
{
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
}
}
protected void LnkCalcular_Click(object sender, EventArgs e)
{
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text))
if (objnom.GetCalculoSBC(UsuarioActual.CveEmpresa, DdlTipo.SelectedValue.ToEntero(), TxtFechaPago.Text,DdlRegistroPatronal.SelectedValue.ToEntero()))
{
GVCalculosSBC.DataSource = objnom.DTSetResultados.Tables[0];
GVCFija.DataSource = objnom.DTSetResultados.Tables[0];
@@ -92,7 +250,7 @@ public partial class RH_CalculoSBC : ClsPaginas
double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2);
double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2);
string RegistroPatronal = item.DataKey("RegistroPatronal");
if(oldRegistroPatronal != "-1" && oldRegistroPatronal != RegistroPatronal)
if(oldRegistroPatronal != "-1" && oldRegistroPatronal != RegistroPatronal )
{
MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater,
$"************* 00{(contador < 1000 ? "0" : "")}{(contador < 100 ? "0" : "")}{(contador < 10 ? "0" : "")}{contador} 00001 9");
@@ -103,7 +261,7 @@ public partial class RH_CalculoSBC : ClsPaginas
concater = "";
contador = 0;
}
if (SalarioDiarioSSNuevo != SalarioDiarioSS)
if (SalarioDiarioSSNuevo != SalarioDiarioSS || item.FCCheckBox("chkCon").Checked)
{
MovtosmodSalario = string.Format("{0}{1}{2}", MovtosmodSalario, concater, item.DataKey("Movtotxt"));
concater = "\\r\\n";
@@ -249,18 +407,18 @@ public partial class RH_CalculoSBC : ClsPaginas
//libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}";
libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
libro.Range(5, 8, 5, 11).Merge().Value = "Actual";
libro.Range(5, 12, 5, 14).Merge().Value = "Nuevo";
libro.Range(5, 8, 5, 12).Merge().Value = "Actual";
libro.Range(5, 13, 5, 15).Merge().Value = "Nuevo";
libro.Range(5, 1, 6, 14).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center;
libro.Range(5, 1, 6, 13).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189));
libro.Range(5, 1, 5, 13).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.None;
libro.Range(5, 1, 6, 16).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189));
libro.Range(5, 1, 5, 16).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.None;
libro.Range(5, 8, 6, 11).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 100, 162));
libro.Range(5, 8, 6, 11).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
libro.Range(5, 12, 6, 14).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(136, 214, 205));
libro.Range(5, 12, 6, 14).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
libro.Range(5, 8, 6, 12).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(128, 100, 162));
libro.Range(5, 8, 6, 12).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
libro.Range(5, 13, 6, 15).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(136, 214, 205));
libro.Range(5, 13, 6, 15).Style.Font.FontColor = ClosedXML.Excel.XLColor.White;
libro.Range(7, 8, 7 + dt.Rows.Count, 12).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right;

View File

@@ -372,23 +372,22 @@
<div id="DvTags" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<div class="modal-dialog modal-lg">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpEtiquetas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<h4> <asp:Literal ID="Literal2" runat="server">Etiquetas</asp:Literal></h4>
</h4>
</div>
<div class="modal-body">
<div class="modal-body ADScroller ADScroller-body" style="max-height:80vh">
<div class="col-md-6 table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Etiqueta</th>
<th>Descripción</th>
<th class="col-md-4">Etiqueta</th>
<th class="col-md-6">Descripción</th>
</tr>
</thead>
<tbody>
@@ -401,7 +400,7 @@
<tr><td>{Peso}</td><td></td></tr>
<tr><td>{LugarNacimiento}</td><td>Lugar de nacimie</td></tr>
<tr><td>{Edad}</td><td></td></tr>
<tr><td>{NombreTelEmergencia}</td><td>Nombre y telefono al presentarse una emergencia</td></tr>
<tr><td>{NombreTelEmergencia}</td><td>Nombre y telefono al presentarse una emergencia</td></tr>
<tr><td>{TipoSangre}</td><td></td></tr>
<tr><td>{SubProyecto}</td><td>Se refiere a la sucursal o centro de costos</td></tr>
<tr><td>{EstadoCivil}</td><td></td></tr>
@@ -411,12 +410,24 @@
<tr><td>{CreditoInfonavit}</td><td></td></tr>
<tr><td>{RentaMensual}</td><td></td></tr>
<tr><td>{TransportePublico}</td><td></td></tr>
<tr><td>{TrabajadoAnteriormente}</td><td>La persona a trabajado enteriormente en la empresa</td></tr>
<tr><td>{TrabajadoAnteriormenteObservaciones}</td><td>Detalle de trabajo enterior en empresa</td></tr>
<tr><td>{ParientesEmpresa}</td><td>Se tienen parientes en la empresa</td></tr>
<tr><td>{TrabajadoAnteriormente}</td><td>La persona ha trabajado anteriormente en la empresa</td></tr>
<tr><td>{TrabajadoAnteriormenteObservaciones}</td><td>Detalle de trabajo anterior en empresa</td></tr>
<tr><td>{ParientesEmpresa}</td><td>Se tienen parientes en la empresa</td></tr>
<tr><td>{AcusadoDelito}</td><td></td></tr>
<tr><td>{AcusadoDelitoObservaciones}</td><td></td></tr>
<tr><td>{Calle}</td><td></td></tr>
</tbody>
</table>
</div>
<div class="col-md-6 table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th class="col-md-4">Etiqueta</th>
<th class="col-md-6">Descripción</th>
</tr>
</thead>
<tbody>
<tr><td>{Calle}</td><td></td></tr>
<tr><td>{Colonia}</td><td></td></tr>
<tr><td>{CP}</td><td></td></tr>
<tr><td>{Telefono}</td><td></td></tr>
@@ -425,31 +436,25 @@
<tr><td>{NumeroSS}</td><td></td></tr>
<tr><td>{Licencia}</td><td></td></tr>
<tr><td>{CartillaMilitar}</td><td></td></tr>
<tr><td>{CURP}</td><td></td></tr>
<tr><td>{CredencialElector}</td><td></td></tr>
<tr><td>{FechaIngreso}</td><td></td></tr>
<tr><td>{Puesto}</td><td></td></tr>
<tr><td>{FechaActual}</td><td></td></tr>
<tr><td>{FechaActualDF}</td><td></td></tr>
<tr><td>{FechaFin}</td><td>Fecha Fin de Contrato</td></tr>
<tr><td>Sexo</td><td>Sexo</td></tr>
<tr><td>{NombreEmpresa}</td><td>Empresa</td></tr>
<tr><td>{Sueldo}</td><td>Sueldo</td></tr>
<tr><td>{SueldoLetra}</td><td>Sueldo en letra</td></tr>
<tr><td>{Nacionalidad}</td><td>Nacionalidad</td></tr>
<tr><td>{CURP}</td><td></td></tr>
<tr><td>{CredencialElector}</td><td></td></tr>
<tr><td>{FechaIngreso}</td><td></td></tr>
<tr><td>{Puesto}</td><td></td></tr>
<tr><td>{FechaActual}</td><td></td></tr>
<tr><td>{FechaActualDF}</td><td></td></tr>
<tr><td>{FechaFin}</td><td>Fecha Fin de Contrato</td></tr>
<tr><td>{Sexo}</td><td>Sexo</td></tr>
<tr><td>{Sueldo}</td><td>Sueldo</td></tr>
<tr><td>{SueldoLetra}</td><td>Sueldo en letra</td></tr>
<tr><td>{Nacionalidad}</td><td>Nacionalidad</td></tr>
<tr><td>{EmpresaNombre}</td><td>Empresa</td></tr>
<tr><td>{EmpresaDireccion}</td><td>Dirección de la Empresa</td></tr>
<tr><td>{EmpresaCiudad}</td><td>Ciudad de la Empresa</td></tr>
<tr><td>{EmpresaRFC}</td><td>RFC Empresa</td></tr>
<tr><td>{EmpresaRepresentante}</td><td>Representante Empresa</td></tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">

View File

@@ -316,10 +316,6 @@
<asp:RegularExpressionValidator ID="REVCorreo" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" CssClass="help-block errorimput" ControlToValidate="TxtCorreo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo - Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMailrecibonomina" runat="server" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtMailrecibonomina" Text="Mail recibo nómina:"></asp:Label>
</div>
<div class="form-group form-md-line-input input-iconright" style="display: none">

View File

@@ -252,14 +252,13 @@
<label class="col-md-1">Agrupador: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlReporte" runat="server" Style="width: 100% !important;" CssClass="select2me" DataValueField="CveUsuario" DataTextField="Nombre">
<asp:ListItem Value="1" Text="Por Mes"></asp:ListItem>
<asp:ListItem Value="1" Text="Agregado"></asp:ListItem>
<asp:ListItem Value="2" Text="Por Comprobante"></asp:ListItem>
<asp:ListItem Value="3" Text="Mes Moneda"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 mediocol">Fecha inicio:</label>
<div class="col-md-2">
<%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%>
<div class="col-md-1" style="min-width: 120px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtRpdFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server"></asp:TextBox>
<span class="input-group-btn ">
@@ -272,7 +271,7 @@
</div>
</div>
<label class="col-md-1 mediocol">Fecha fin:</label>
<div class="col-md-2">
<div class="col-md-1" style="min-width: 120px">
<%--<asp:TextBox ID="TxtPeriodoFin" Text="99" CssClass="form-control" runat="server"></asp:TextBox>--%>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtRpdFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 80px" runat="server"></asp:TextBox>
@@ -285,13 +284,18 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaFin"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-2" style="text-align: right">
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Consultar" Visible="true" class="btn btn-primary" />
<label class="col-md-1 mediocol">Vista:</label>
<div class="col-md-1" style="min-width: 120px">
<asp:DropDownList ID="DdlVista" runat="server">
<asp:ListItem Value="1" Text="SAT"></asp:ListItem>
<asp:ListItem Value="2" Text="Contable"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
<asp:Button ID="BtnConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Consultar" Visible="true" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body" style="display: none">
@@ -308,17 +312,17 @@
<div class="row" runat="server" id="DVResumen1" visible="false">
<div class="col-md-6" style="text-align: right">
<div class="col-md-7" style="text-align: right">
<input type="text" id="TxtBusquedaResumen" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaResumen','{0}')", GvResumen.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaResumen','{0}')", GvResumen.ClientID) %>" style="margin-top: -3px; margin-left: -13px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row" runat="server" id="DVResumen2" visible="false">
<div class="col-md-6">
<div class="col-md-7">
<asp:GridView ID="GvResumen" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False" OnRowDataBound="GvResumen_RowDataBound"
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
DataKeyNames="Mes">
DataKeyNames="Fecha">
<Columns>
<asp:TemplateField HeaderText="Mes">
<ItemTemplate>
@@ -387,7 +391,7 @@
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField HeaderText="LnkSerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="VSerieFolio" ControlStyle-CssClass='Texto' Target='_blank'></asp:HyperLinkField>
<asp:HyperLinkField HeaderText="Serie Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="VSerieFolio" ControlStyle-CssClass='Texto' Target='_blank'></asp:HyperLinkField>
<%-- <asp:TemplateField HeaderText="Serie Folio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
@@ -505,7 +509,7 @@
<div id="ModalViewSolicitudes" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UPModalViewSolicitudes" class="modal-dialog rowpadding xspadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UPModalViewSolicitudes" class="modal-dialog modal-lg rowpadding xspadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
@@ -678,7 +682,7 @@
</div>
<div id="ModalAgregarSolicitud" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UPModalViewSolicitudesAgregar" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UPModalViewSolicitudesAgregar" class="modal-dialog modal-lg rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">

View File

@@ -95,7 +95,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
LnkDownloadExcel.Visible = false;
if (DdlReporte.SelectedValue.ToEntero() == 1)
if (DdlReporte.SelectedValue.ToEntero() == 1 || DdlReporte.SelectedValue.ToEntero() == 3)
{
DVResumen1.Visible = true;
DVResumen2.Visible = true;
@@ -112,21 +112,21 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
using (ClsNominas ObjNom = new ClsNominas())
{
if (ObjNom.SATSolicitudTimbreIngresosRep(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDate(), TxtRpdFechaFin.Text.ToDate(), DdlReporte.SelectedValue.ToEntero()))
if (ObjNom.SATSolicitudTimbreIngresosRep(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDate(), TxtRpdFechaFin.Text.ToDate(), DdlReporte.SelectedValue.ToEntero(),DdlVista.SelectedValue.ToEntero()))
{
if (DdlReporte.SelectedValue.ToEntero() == 1)
if (DdlReporte.SelectedValue.ToEntero() == 1 || DdlReporte.SelectedValue.ToEntero() == 3)
{
GvResumen.DataSource = ObjNom.DtResultados;
TipoDescarga = ObjNom.DtResultados.Rows.Count > 0 ? 1:0;
LnkDownloadExcel.Visible = true;
}
else
{
else if (DdlReporte.SelectedValue.ToEntero() == 2)
{
GvDatos.DataSource = ObjNom.DtResultados;
TipoDescarga = ObjNom.DtResultados.Rows.Count > 0 ? 2 : 0;
LnkDownloadExcel.Visible = true;
}
}
}
}
GvResumen.DataBind();
@@ -396,11 +396,11 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
if(e.Row.DataKey("Mes").ToString() == "")
if(e.Row.DataKey("Fecha") == "")
{
e.Row.Cells[0].Text = "Total";
// e.Row.Cells[0].Text = "Total";
e.Row.Attributes.Add("class", "Totales");
}
}
}

View File

@@ -2299,7 +2299,6 @@ Partial Class Clientes
End If
End If
If UsuarioActual.Empresa.AsuntoPlantillaMailVenta.Trim.Length > 0 Then
Asunto = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
Asunto = Asunto.Replace("{""TipoDocumento""}", TipoComprobante)
@@ -2308,9 +2307,9 @@ Partial Class Clientes
End If
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso HdnTipoDocto.Value.Contiene("Ing", "Egs", "Ant", "Dev") Then
If File.Exists($"{Ruta}PDF\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.pdf") AndAlso File.Exists($"{Ruta}XML\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.xml") Then
Dim PDF As String = $"{Ruta}PDF\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.pdf"
Dim XML As String = $"{Ruta}XML\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.xml"
Dim PDF As String = $"{Ruta}PDF\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.pdf"
Dim XML As String = $"{Ruta}XML\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.xml"
If File.Exists(PDF) AndAlso File.Exists(XML) Then
Dim ResultadoMail As Integer = 0
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
@@ -2344,38 +2343,38 @@ Partial Class Clientes
Else
Alert("No se pudo adjuntar el correo electrónico.", TipoMensaje.MsgError)
End If
ElseIf UsuarioActual.Empresa.TipoFacturacion = "CBB" AndAlso HdnTipoDocto.Value.Contiene("Ing", "Egs", "Ant", "Dev") Then
If File.Exists(Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf") Then
Dim PDF As String = Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf"
'ElseIf UsuarioActual.Empresa.TipoFacturacion = "CBB" AndAlso HdnTipoDocto.Value.Contiene("Ing", "Egs", "Ant", "Dev") Then
' If File.Exists(Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf") Then
' Dim PDF As String = Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf"
Dim ResultadoMail As Integer = 0
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
If Dr("Adjunto").ToString() <> "" Then
Adjunto = Dr("Adjunto").ToString()
Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
End If
' Dim ResultadoMail As Integer = 0
' Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
' LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
' If Dr("Adjunto").ToString() <> "" Then
' Adjunto = Dr("Adjunto").ToString()
' Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
' LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
' End If
'If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Entrega de Factura", PDF, XML, ArrayCC, TxtBody.Text.Trim) Then
If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, Asunto, Cuerpo, TxtCC.Text.Trim, LSRutasMail) Then
ResultadoMail = 1
TxtCC.Text = ""
TxtBody.Text = ""
RegistraScript("$('#ModalDivMail').modal('hide');")
Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
CargaHistorial()
UpnHistorial.Update()
Else
ResultadoMail = 3
End If
' 'If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Entrega de Factura", PDF, XML, ArrayCC, TxtBody.Text.Trim) Then
' If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, Asunto, Cuerpo, TxtCC.Text.Trim, LSRutasMail) Then
' ResultadoMail = 1
' TxtCC.Text = ""
' TxtBody.Text = ""
' RegistraScript("$('#ModalDivMail').modal('hide');")
' Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
' CargaHistorial()
' UpnHistorial.Update()
' Else
' ResultadoMail = 3
' End If
Dim ObjVentas As New ClsVentas
ObjVentas.UpdateVentaMail(ResultadoMail, HdnCveVenta.Value.ToEntero())
ObjVentas.Dispose()
Else
Alert("No se pudo adjuntar el correo electrónico.", TipoMensaje.MsgError)
End If
' Dim ObjVentas As New ClsVentas
' ObjVentas.UpdateVentaMail(ResultadoMail, HdnCveVenta.Value.ToEntero())
' ObjVentas.Dispose()
' Else
' Alert("No se pudo adjuntar el correo electrónico.", TipoMensaje.MsgError)
' End If
ElseIf HdnTipoDocto.Value = "Cot" Then
If File.Exists($"{Ruta}PDF\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.pdf") Then
Dim PDF As String = $"{Ruta}PDF\{HdnTipoDocto.Value}\{HdnFolioVenta.Value}.pdf"

View File

@@ -652,17 +652,7 @@
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-8">
</div>
<div class="col-md-4" style="text-align:right!important">
<asp:LinkButton runat="server" ID="LnkDescargaFormato" OnClick="LnkDescargaFormato_Click" CssClass="blue Texto">
Descargar Formato <i class="fa fa-download" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
<br />
<asp:UpdatePanel runat="server" ID="UpModalSeleccionLayout" UpdateMode="Conditional">
@@ -680,8 +670,13 @@
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkSeleccionLayout" runat="server" CssClass="btn btn-primary" Text="Aceptar" OnClick="LnkSeleccionLayout_Click" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
<div class="col-md-2" style="text-align: left">
<asp:Button ID="LnkDescargaFormato" OnClick="LnkDescargaFormato_Click" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
</div>
<div class="col-md-10" style="text-align: right">
<asp:LinkButton ID="LnkSeleccionLayout" runat="server" CssClass="btn btn-primary" Text="Aceptar" OnClick="LnkSeleccionLayout_Click" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -3139,11 +3139,8 @@ Partial Class Ventas_ClientesAbonar
Protected Sub LnkAccionesModalSeleccionLayout_Click(sender As Object, e As EventArgs)
TxtModalLayoutExcel.Text = "[]"
UpModalSeleccionLayout.Update()
RegistraScript("$('#ModalSeleccionLayout').modal('show');")
@@ -3165,23 +3162,19 @@ Partial Class Ventas_ClientesAbonar
Dim Directorio As String = Server.MapPath("~") & file.path
Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
Dim DT As New DataTable
Dim ErrorArchivo = False
Dim ErrorExcel = False
DT = ReadSeleccionExcelFile(Directorio + file.filename, True)
DT = ReadExcelFile(Directorio + file.filename, True)
If Not dt.Columns(0).ColumnName.ToUpper = "FOLIO" Then
Alert("El nombre de la primera columna debe ser 'Folio'. Favor de corregirlo", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Not dt.Columns(1).ColumnName.ToUpper = "IMPORTE PAGO" Then
Alert("El nombre de la segunda columna debe ser 'Importe Pago'.Favor de corregirlo", TipoMensaje.MsgAdvertencia)
If Not DT.Columns(1).ColumnName.ToUpper = "IMPORTE PAGO" Then
Alert("El nombre de la segunda columna debe ser 'Importe Pago'.Favor de corregirlo." & DT.Columns(1).ColumnName, TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -3191,17 +3184,16 @@ Partial Class Ventas_ClientesAbonar
Dim ImportePago As Decimal = Drow("Importe Pago").ToString.ToDecimal.RoundSQL(2)
Dim SerieFolioEncontrado As Boolean = False
If ImportePago > 0 Then
If ImportePago >= 0 Then
For Each GvRow As GridViewRow In GvCxC.Rows
Dim SerieFolioGv As String = GvRow.DataKey("SerieFolio").Trim.ToUpper
If SerieFolioBusqueda = SerieFolioGv Then
SerieFolioEncontrado = True
Dim SaldoGV As Decimal = GvRow.DataKey("Saldo").ToDecimal
If ImportePago = 0 Then ImportePago = SaldoGV 'si no se especifica cantidad toma la totalidad del saldo
Dim Diferencia As Decimal = SaldoGV - ImportePago
If Diferencia < 0 Then
@@ -3215,30 +3207,19 @@ Partial Class Ventas_ClientesAbonar
End If
End If
Dim ChkGv As CheckBox = GvRow.FCCheckBox("Chk")
Dim TxtAbonarGv As TextBox = GvRow.FCTextBox("TxtAbonar")
ChkGv.Checked = True
TxtAbonarGv.Text = ImportePago.ToString("###,###,###.00")
GvRow.FCCheckBox("Chk").Checked = True
GvRow.FCTextBox("TxtAbonar").Text = ImportePago.ToString("###,###,###.00")
TotalSeleccion = TotalSeleccion + ImportePago
CountRegistros = CountRegistros + 1
Exit For
End If
Next
If Not SerieFolioEncontrado Then
SBNoEncotradosEnLista.AppendLine($"{SerieFolioBusqueda}<br>")
End If
End If
Next
@@ -3246,9 +3227,6 @@ Partial Class Ventas_ClientesAbonar
Alert("Se debe seleccionar un archivo", TipoMensaje.MsgError)
End If
If ProcesoOK Then
Alert($"Facturas seleccionadas: {CountRegistros} <br/>{SBNoEncotradosEnLista.ToString}")
@@ -3269,55 +3247,6 @@ Partial Class Ventas_ClientesAbonar
End Sub
Public Function ReadSeleccionExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean, Optional curRow As Integer = 0) As DataTable
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As GemBox.Spreadsheet.ExcelFile = GemBox.Spreadsheet.ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
'Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As GemBox.Spreadsheet.ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(curRow).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(curRow).Cells(cols).Value.ToString())
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
curRow = 1
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
Protected Sub LnkDescargaFormato_Click(sender As Object, e As EventArgs)

View File

@@ -578,10 +578,6 @@