diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index cfcc0c792..ccbbfd441 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -470,20 +470,6 @@ Public Class ClsContPAQi StrSQL.Append(" 0, @Serie, @Folio, @Referencia, 0, 0, @SubTotal + @IVA, @RetIVA, @RetISR, @SubTotal + @IVA - @RetIVA - @RetISR,") StrSQL.Append(" YEAR(@FechaMov), MONTH(@FechaMov),@SubTotal, 0,0,1,@UUID);") - StrSQL.Append(" EXEC PA_UpdateId 'Id_DevolucionIVA';") - - StrSQL.Append(" SET @IdDevIVA = dbo.FNC_GetCounter ('Id_MovimientoImpuesto');") - StrSQL.Append(" INSERT INTO MovimientosImpuestos ") - StrSQL.Append(" (Id,RowVersion, IdPoliza, NumMovto, IdPersona, SistOrig, EjercicioAsignado,PeriodoAsignado, IdCuenta,,Captado,AplicaImpuesto,Modificado, ") - StrSQL.Append(" Serie, Folio, Referencia, UUID, Origen, OrigenMovto, Computable, TipoMovimiento, TipoFactor, Impuesto, ObjetoImpuesto, NombreImpuestoLocal, TasaOCuota, ImpBase, ") - StrSQL.Append(" ImpImpuesto, ImpTotal, Desglosado, IVANoAcred, AcumulaIETU, IdConceptoIETU, IETUDeducible, IETUModificado, IETUAcreditable, GuidMov, GuidMovPadre, Migrado,") - StrSQL.Append(" ConceptoIVA,SubconceptoIVA,ClasificadorIVA,ProporcionDIOT,DeducibleDIOT)") - StrSQL.Append(" VALUES (@IdDevIVA, @RowVersion, @IdPoliza, ISNULL ((SELECT MAX (NumMovto) FROM MovimientosImpuestos WHERE IdPoliza = @IdPoliza), 0) + 1, @IdPersona, 1,YEAR(@FechaMov), MONTH(@FechaMov), @IdCuenta, 0,1,0,") - StrSQL.Append(" @Serie, @Folio, @Referencia, @UUID,2, 0,0,0,1,2,0,'',0.16, @SubTotal, @IVA,@SubTotal + @IVA,0, @IVANoAcred,0,0,0,0,'','',0,1,1,1,1,0,0);") - StrSQL.Append(" ") - - StrSQL.Append(" EXEC PA_UpdateId 'Id_MovimientoImpuesto';") - StrSQL.Append(" END TRY") StrSQL.Append(" BEGIN CATCH") @@ -526,6 +512,130 @@ Public Class ClsContPAQi Return Retorno End Function + Public Function AddMovimientoImpuesto(IdPoliza As Integer, IdCuenta As Integer, IdProveedor As Integer, TasaOCuotaIVA As Double, TasaOCuota As Double, SubTotal As Double, ImpImpuesto As Double, FechaMovto As Date, Referencia As String, Serie As String, Folio As Integer, UUID As String, + NoDeducible As Boolean, IVANoAcred As Double, GuidMov As String, GuidMovPadre As String, TipoMovimiento As Integer, Impuesto As Integer) As Boolean + + + Dim Retorno As Boolean = False + Dim ConceptoIVA As Integer = 0 + Dim SubconceptoIVA As Integer = 0 + Dim ProporcionDIOT As Integer = 100 + Dim DeducibleDIOT As Integer = 1 + + If IdPoliza <= 0 Or IdCuenta <= 0 Then + Return False + End If + + Select Case TasaOCuotaIVA + Case 16 + ConceptoIVA = 1 + SubconceptoIVA = If(SubTotal > 0, 2, 3) + Exit Select + Case 8 + ConceptoIVA = 4 + SubconceptoIVA = If(SubTotal > 0, 5, 6) + Exit Select + Case 0 + ConceptoIVA = 14 + SubconceptoIVA = If(SubTotal > 0, 15, 16) + Exit Select + Case Else + Return False + End Select + + + If NoDeducible Then + ProporcionDIOT = 0 + DeducibleDIOT = 2 + End If + + ' GuidMov, ConceptoIVA SubconceptoIVA ProporcionDIOT DeducibleDIOT + + StrSQL.Clear() + StrSQL.Append(" BEGIN") + + StrSQL.AppendLine(" DECLARE ") + StrSQL.AppendLine(" @Error NVARCHAR(300),") + StrSQL.AppendLine(" @IdMovDev INT;") + StrSQL.AppendLine(" SET NOCOUNT ON;") + + StrSQL.AppendLine(" BEGIN TRY") + + StrSQL.AppendLine(" DECLARE @IdPersona INT = (SELECT TOP 1 PER.Id FROM Proveedores PRO + INNER JOIN Personas PER ON PER.Codigo = PRO.CodigoPersona AND PER.EsProveedor = 1 + WHERE PRO.Id = @IdProveedor); + + IF @IdPersona IS NULL OR @IdPersona <= 0 + BEGIN + DECLARE @ErrorPersona NVARCHAR(300) = Concat('No se encontro el IdPersona del proveedor con id ',@IdProveedor ) + RAISERROR (@ErrorPersona, 16, 1); + END + ") + + StrSQL.AppendLine(" + SET @IdMovDev = dbo.FNC_GetCounter ('Id_MovimientoImpuesto'); + INSERT INTO MovimientosImpuestos + (Id,RowVersion, IdPoliza, NumMovto, IdPersona, SistOrig, EjercicioAsignado,PeriodoAsignado, IdCuenta,Captado,AplicaImpuesto,Modificado, + Serie, Folio, Referencia, UUID, Origen, OrigenMovto, Computable, TipoMovimiento, TipoFactor, Impuesto, ObjetoImpuesto, NombreImpLocal, TasaOCuota, ImpBase, + ImpImpuesto, ImpTotal, Desglosado, IVANoAcred, AcumulaIETU, IdConceptoIETU, IETUDeducible, IETUModificado, IETUAcreditable, GuidMov, GuidMovPadre, Migrado, + ConceptoIVA,SubconceptoIVA,ClasificadorIVA,ProporcionDIOT,DeducibleDIOT) + + VALUES (@IdMovDev, @RowVersion, @IdPoliza, ISNULL ((SELECT MAX (NumMovto) FROM MovimientosImpuestos WHERE IdPoliza = @IdPoliza), 0) + 1, @IdPersona, 0,YEAR(@FechaMov), MONTH(@FechaMov), @IdCuenta, 0, 1, 0, + @Serie, @Folio, @Referencia, @UUID, 2, 0, 1, @TipoMovimiento, 1, @Impuesto, 2,'', @TasaOCuota, @SubTotal, + @ImpImpuesto, @ImpImpuesto,0, @IVANoAcred, 0, 0, 0, 0, 0, @GuidMov, @GuidMovPadre, 0, + @ConceptoIVA, @SubconceptoIVA, 0, @ProporcionDIOT, @DeducibleDIOT); + + EXEC PA_UpdateId 'Id_MovimientoImpuesto'; + ") + + + StrSQL.AppendLine(" END TRY") + + StrSQL.AppendLine(" BEGIN CATCH") + StrSQL.AppendLine(" SET @Error = CONCAT('Número: ', ERROR_NUMBER(), '; Procedimiento: ', ERROR_PROCEDURE(), '; Linea: ', ERROR_LINE(), '; Detalle: ', ERROR_MESSAGE());") + StrSQL.AppendLine(" RAISERROR(@Error, 16, 1);") + StrSQL.AppendLine(" END CATCH") + + StrSQL.Append(" END; ") + + SqlDataAdapter(StrSQL.ToString, CommandType.Text) + 'SqlDataAdapter("PA_AddDevolucionIVA") + + With SqlAdapter.SelectCommand.Parameters + .Add("@RowVersion", SqlDbType.Int).Value = GlobalRowVersion + .Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza + .Add("@IdCuenta", SqlDbType.Int).Value = IdCuenta + .Add("@IdProveedor", SqlDbType.Int).Value = IdProveedor + .Add("@TasaOCuota", SqlDbType.Float).Value = Math.Round(TasaOCuota, 2) + .Add("@SubTotal", SqlDbType.Float).Value = Math.Round(SubTotal, 2) + .Add("@ImpImpuesto", SqlDbType.Float).Value = Math.Round(ImpImpuesto, 2) + .Add("@IVANoAcred", SqlDbType.Float).Value = Math.Round(IVANoAcred, 2) + .Add("@FechaMov", SqlDbType.DateTime).Value = FechaMovto + .Add("@Referencia", SqlDbType.VarChar).Value = If(Referencia.Length > 30, Referencia.Substring(1, 30), Referencia) + .Add("@Serie", SqlDbType.VarChar).Value = If(Serie.Length > 15, Serie.Substring(1, 15), Serie) + .Add("@Folio", SqlDbType.Int).Value = If(Len(Folio.ToString) <= 8, Folio, Right(Folio.ToString, 8).ToEntero) ' se limita a 8 digitos, sino le cortan y se toman los ultimos 8, para que guarde e contpaqi + .Add("@UUID", SqlDbType.VarChar).Value = UUID + .Add("@ConceptoIVA", SqlDbType.Int).Value = ConceptoIVA + .Add("@SubconceptoIVA", SqlDbType.Int).Value = SubconceptoIVA + .Add("@ProporcionDIOT", SqlDbType.Int).Value = ProporcionDIOT + .Add("@DeducibleDIOT", SqlDbType.Int).Value = DeducibleDIOT + .Add("@GuidMov", SqlDbType.VarChar).Value = GuidMov + .Add("@GuidMovPadre", SqlDbType.VarChar).Value = GuidMovPadre + .Add("@TipoMovimiento", SqlDbType.Int).Value = TipoMovimiento + .Add("@Impuesto", SqlDbType.Int).Value = Impuesto + End With + + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un Error al agregar el movimiento de impuesto de egresos en la póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function UpdateDevolucionesIVA(Id As Integer, IdPoliza As Integer, IdCuenta As Integer, IdProveedor As Integer, PorIVA As Double, SubTotal As Double, IVA As Double, RetIVA As Double, RetISR As Double, FechaMovto As Date, Referencia As String, Serie As String, Folio As Integer) As Boolean Dim Retorno As Boolean = False @@ -2278,6 +2388,7 @@ Public Class ClsContPAQi StrSQL.AppendLine(" @NumMovto INT,") StrSQL.AppendLine(" @IdDiario INT,") StrSQL.AppendLine(" @SegNegMovtos INT,") + StrSQL.AppendLine(" @IdMoneda INT,") StrSQL.AppendLine(" @Fecha DATETIME,") StrSQL.AppendLine(" @IDEjercicio INT,") StrSQL.AppendLine(" @TimeStamp NVARCHAR (200);") @@ -2288,10 +2399,11 @@ Public Class ClsContPAQi StrSQL.AppendLine(" SET @Fecha = @FechaMov;") StrSQL.AppendLine(" SET @IdDiario = 0;") StrSQL.AppendLine(" SELECT @Ejercicio = P.Ejercicio, @Periodo = P.Periodo, @TipoPol = TipoPol, @Folio = P.Folio FROM Polizas P WHERE Id = @IdPoliza;") - StrSQL.AppendLine(" SELECT @SegNegMovtos = SegNegMovtos FROM Cuentas C WHERE Id = @IdCuenta;") + StrSQL.AppendLine(" SELECT @SegNegMovtos = SegNegMovtos, @IdMoneda = IdMoneda FROM Cuentas C WHERE Id = @IdCuenta;") StrSQL.AppendLine("") StrSQL.AppendLine(" BEGIN TRY") StrSQL.AppendLine(" ") + StrSQL.AppendLine(" IF (@IdMoneda = 1) SET @ImporteME = 0; ") ''DESCOMENTAR PARA CIERRE PERIODO 'StrSQL.AppendLine("DECLARE") diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 7b7617049..791d4eb80 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -1649,7 +1649,7 @@ Public Class ClsGenerales Public Function AddCuentasDepositos(BancoNombre As String, Plaza As String, Sucursal As String, Cuenta As String, CLABE As String, CIE As String, SWIFT As String, Referencia As String, RefCrediProveedor As String, CveUsuario As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional Correo As String = "", Optional BBVAAlias As String = "-1", Optional EstatusPagoElectronico As Boolean = False, Optional EstatusPagoElectronicoGrupos As Boolean = False, Optional CveSATBanco As Integer = -1, - Optional ConceptoCIE As String = "-1") As Boolean + Optional ConceptoCIE As String = "-1", Optional Estatus As Boolean = True) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_CuentasDepositosAdd") @@ -1678,6 +1678,7 @@ Public Class ClsGenerales .Add("@EstatusPagoElectronicoGrupos", SqlDbType.Bit).Value = EstatusPagoElectronicoGrupos .Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco .Add("@ConceptoCIE", SqlDbType.VarChar).Value = ConceptoCIE + .Add("@Estatus", SqlDbType.VarChar).Value = Estatus End With diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx index 034a71d08..ec403c3e2 100644 --- a/Ashx/SIGFacturacion.ashx +++ b/Ashx/SIGFacturacion.ashx @@ -233,6 +233,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString() Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString() UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa) + HttpContext.Current.Session("UsuarioSIG") = UsuarioActual End If ObjUsuarios.Dispose() Return UsuarioActual diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx index fb461e57e..8e79bea06 100644 --- a/Ashx/TareasProgramadas.ashx +++ b/Ashx/TareasProgramadas.ashx @@ -108,7 +108,9 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState context.Response.Write(retorno) Case "EstadosCuenta" 'CargaEstadosCuenta(context, 119, 227774) - CargaEstadosCuenta(context, 119, -1, FechaEnvio, FechaActual) + 'CargaEstadosCuenta(context, 119, -1, FechaEnvio, FechaActual) + Dim tCveEmpresa As Integer = context.Request("CveEmpresa").ToString.ToEntero + CargaEstadosCuenta(context, tCveEmpresa, -1, FechaEnvio, FechaActual) Case "ScoreCard" CargaScoreCard(context, 140, FechaEnvio) @@ -354,6 +356,9 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState #Region "E S T A D O S D E C U E N T A" Private Sub CargaEstadosCuenta(ByVal context As HttpContext, pCveEmpresa As Integer, pCveCliente As Integer, FechaEnvio As DateTime, FechaActual As DateTime) + + Dim Usuario As Usuario = ValidaUsuarioSistema(100, pCveEmpresa) + Dim Retorno As New JArray() Dim DtEmpresas As DataTable = Nothing Using ObjEmpresas As New ClsSisEmpresas() @@ -364,7 +369,7 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState If DtEmpresas IsNot Nothing Then For Each Row As DataRow In DtEmpresas.Rows - Dim Usuario As Usuario = ValidaUsuarioSistema(100, Row("CveEmpresa").ToString().ToEntero()) + 'Dim Usuario As Usuario = ValidaUsuarioSistema(100, Row("CveEmpresa").ToString().ToEntero()) Dim obj As JObject = EjecutarEnvioEstadoCuenta(Usuario, FechaEnvio, FechaActual, pCveCliente:=pCveCliente) Retorno.Add(obj) @@ -499,7 +504,9 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState Dim Envio As Boolean = False If Not String.IsNullOrEmpty(Correo) Then + 'Correo = "oscar.irigoyen@adssistemas.mx" Envio = EnviarEstadoCuenta(UsuarioActual, Correo, Cliente) + GuardaLog($"Log envio Estados Cuenta correo {If(Envio, "Enviado", "Error")} CveCliente {CveCliente} ") End If If Envio Then @@ -522,6 +529,7 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState New JProperty("Cliente", Cliente.Nombre) )) End If + End If Next End If @@ -857,7 +865,10 @@ Public Class TareasProgramadas : Implements IHttpHandler, IReadOnlySessionState If sw.Elapsed.TotalSeconds > 10 Then GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") End If - If MR IsNot Nothing Then MR.Dispose() + If MR IsNot Nothing Then + 'MR.Close() + MR.Dispose() + End If Return Bytes End Function diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 034b3d77b..889e34b70 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -716,6 +716,8 @@ P.U.  IVA  IEPS  + Ret. IVA  + Ret. ISR  Total 
¿No Deducible?  @@ -826,55 +828,69 @@ + <%-- 10 --%> + + +
+ +
+
+ <%-- 11 --%> + + +
+ +
+
- <%-- 10 --%> + <%-- 12 --%> - <%-- 11 --%> + <%-- 13 --%> - <%-- 12 --%> + <%-- 14 --%> - <%-- 13 --%> + <%-- 15 --%> - <%-- 14 --%> + <%-- 16 --%> - <%-- 15 --%> + <%-- 17 --%> - <%-- 16 --%> + <%-- 18 --%> - <%-- 17 --%> + <%-- 19 --%> - <%-- 18 --%> + <%-- 12 --%> diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 6ed284990..8741dbff4 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -978,6 +978,36 @@ Partial Class Compras_Compras End Set End Property + + + Private Property ProvRetIVA As Decimal + Get + If ViewState("ProvRetIVA") Is Nothing Then + ViewState("ProvRetIVA") = 0 + End If + + Return ViewState("ProvRetIVA").ToString.ToDecimal + End Get + Set(value As Decimal) + ViewState("ProvRetIVA") = value + End Set + End Property + + Private Property ProvRetISR As Decimal + Get + If ViewState("ProvRetISR") Is Nothing Then + ViewState("ProvRetISR") = 0 + End If + + Return ViewState("ProvRetISR").ToString.ToDecimal + End Get + Set(value As Decimal) + ViewState("ProvRetISR") = value + End Set + End Property + + + Private Property TotalOriginal As Decimal Get If ViewState("TotalOriginal") Is Nothing Then @@ -1749,7 +1779,7 @@ Partial Class Compras_Compras DdlTipoComprobante.SelectedValueExist("DEV") End If - If Not CveCompra > 0 Then + If Not CveCompra > 0 Or (CveCompra > 0 And UsuarioActual.CveEmpresa = 141) Then LnkProrrateoGasolina.Visible = True InicializaDTProrrateoGasolina() End If @@ -1787,7 +1817,7 @@ Partial Class Compras_Compras End If - MostrarOcultarColumnaIEPS() + MostrarOcultarColumnaIEPSRetIVARetISR() End Sub @@ -1886,7 +1916,7 @@ Partial Class Compras_Compras #Region "C A R G A S" - Private Sub MostrarOcultarColumnaIEPS() + Private Sub MostrarOcultarColumnaIEPSRetIVARetISR() If TxtIEPS.Text.ToDecimal <> 0 And TmpDT.SUM("IEPSPS") <> 0 Then @@ -1896,6 +1926,25 @@ Partial Class Compras_Compras GvPS.Columns(9).Visible = False TD_Gvps_IEPS.Visible = False End If + + If TxtRetIVA.Text.ToDecimal <> 0 And TmpDT.SUM("RetIVA") <> 0 Then + GvPS.Columns(10).Visible = True + TdRetIVA.Visible = True + Else + GvPS.Columns(10).Visible = False + TdRetIVA.Visible = False + End If + + + If TxtRetISR.Text.ToDecimal <> 0 And TmpDT.SUM("RetISR") <> 0 Then + GvPS.Columns(11).Visible = True + TdRetISR.Visible = True + Else + GvPS.Columns(11).Visible = False + TdRetISR.Visible = False + End If + + UpPS.Update() End Sub @@ -2562,7 +2611,7 @@ Partial Class Compras_Compras DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) End If - If DIOTCveTipoOperacion.Contiene(0, 3) Then ' 85 - Otros + If DIOTCveTipoOperacion.Contiene(0, 3, 4) Then ' 85 - Otros If UsuarioActual.CveEmpresa <> 119 Then DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) @@ -2585,7 +2634,7 @@ Partial Class Compras_Compras DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) End If - If DIOTCveTipoOperacion.Contiene(3) Then ' 85 - Otros + If DIOTCveTipoOperacion.Contiene(3, 4) Then ' 85 - Otros If UsuarioActual.CveEmpresa <> 119 Then DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1")) DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) @@ -2619,7 +2668,7 @@ Partial Class Compras_Compras DdlRetISRConcepto.Items.Insert(0, New ListItem("Arrendamiento", "2")) End If - If DIOTCveTipoOperacion.Contiene(3) Then ' 85 - Otros + If DIOTCveTipoOperacion.Contiene(3, 4) Then ' 85 - Otros If UsuarioActual.CveEmpresa <> 119 Then DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2")) @@ -2954,6 +3003,11 @@ Partial Class Compras_Compras TxtIVA.Text = dr("IVA").ToString.FormatoNumero(2) TxtRetIVA.Text = dr("RetIVA").ToString.FormatoNumero(2) TxtRetISR.Text = dr("RetISR").ToString.FormatoNumero(2) + + RetIVAOriginal = dr("RetIVA").ToString.ToDecimal + RetISROriginal = dr("RetISR").ToString.ToDecimal + + TxtIEPS.Text = dr("IEPS").ToString.FormatoNumero(2) If dr("IEPS").ToString.ToDouble > 0 Then TrIEPS.Visible = True If dr("RetIVA").ToString.ToDouble > 0 Then TrRetIVA.Visible = True @@ -3777,6 +3831,9 @@ Partial Class Compras_Compras End If End If + ProvRetIVA = ObjProveedor.RetIVA.ToDecimal + ProvRetISR = ObjProveedor.RetISR.ToDecimal + If CveCompra <= 0 AndAlso CveFactura <= 0 Then 'si se está cargando una factura o compra no se carga 'LblRetIVA.Text = ObjProveedor.RetIVA.ToString.FormatoNumero(5) 'LblRetISR.Text = ObjProveedor.RetISR.ToString.FormatoNumero(5) @@ -10739,12 +10796,12 @@ Partial Class Compras_Compras If e.Row.RowIndex = 0 Then If UsuarioActual.Empresa.UsaAC Then 'AndAlso (CveFactura > 0 Or CveCompra > 0) - e.Row.Cells(13).Width = Unit.Pixel(150) - e.Row.Cells(14).Width = Unit.Pixel(150) e.Row.Cells(15).Width = Unit.Pixel(150) e.Row.Cells(16).Width = Unit.Pixel(150) e.Row.Cells(17).Width = Unit.Pixel(150) - e.Row.Cells(18).Width = Unit.Pixel(100) + e.Row.Cells(18).Width = Unit.Pixel(150) + e.Row.Cells(19).Width = Unit.Pixel(150) + e.Row.Cells(20).Width = Unit.Pixel(100) End If End If @@ -10847,11 +10904,11 @@ Partial Class Compras_Compras 'CargaPresupuestosEgresos If UsuarioActual.Empresa.UsaAC Then - e.Row.Cells(14).Visible = True - e.Row.Cells(15).Visible = True e.Row.Cells(16).Visible = True e.Row.Cells(17).Visible = True e.Row.Cells(18).Visible = True + e.Row.Cells(19).Visible = True + e.Row.Cells(20).Visible = True e.Row.FCDropDownList("DdlAC1").Items.Clear() e.Row.FCDropDownList("DdlAC1").DataSource = DtPresupuestos.FiltraParametros("", DistinctColumns:={"CveProgramaOperativo", "ProgramaOperativo"}) @@ -10882,19 +10939,19 @@ Partial Class Compras_Compras 'SI EL PRESUPUESTO DE EGRESOS VIENE DESDE LA OC, SE BLOQUEA PE If e.Row.DBCampo("CveOrdenCompraDetalle").ToEntero > 0 AndAlso e.Row.DBCampo("CvePresupuestoEgreso").ToEntero > 0 Then - e.Row.Cells(14).Enabled = False - e.Row.Cells(15).Enabled = False e.Row.Cells(16).Enabled = False e.Row.Cells(17).Enabled = False e.Row.Cells(18).Enabled = False + e.Row.Cells(19).Enabled = False + e.Row.Cells(20).Enabled = False End If Else - e.Row.Cells(14).Visible = False - e.Row.Cells(15).Visible = False e.Row.Cells(16).Visible = False e.Row.Cells(17).Visible = False e.Row.Cells(18).Visible = False + e.Row.Cells(19).Visible = False + e.Row.Cells(20).Visible = False End If End If @@ -13049,12 +13106,12 @@ Partial Class Compras_Compras 'Seccion Grid GvPS.Width = 1760 - GvPS.Columns(13).Visible = True - GvPS.Columns(14).Visible = True GvPS.Columns(15).Visible = True GvPS.Columns(16).Visible = True GvPS.Columns(17).Visible = True GvPS.Columns(18).Visible = True + GvPS.Columns(19).Visible = True + GvPS.Columns(20).Visible = True 'Panel General UpPresupuestosAC.Visible = True @@ -17600,7 +17657,7 @@ Partial Class Compras_Compras CargaRetISRConcepto() Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ") - If NumNoDed > 0 Then GvPS.Columns(11).Visible = True 'visualiza columnas de nodeducibles + If NumNoDed > 0 Then GvPS.Columns(13).Visible = True 'visualiza columnas de nodeducibles 'If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then ' InicializaAplicaNCFact() @@ -18151,6 +18208,9 @@ Partial Class Compras_Compras HdnPS.Value = PS("PSCodigo").ToString LblUnidadMedida.Text = PS("UnidadMedida").ToString + Dim PsRetIVA As Decimal = PS("RetIVA").ToString.ToDecimal + Dim PsRetISR As Decimal = PS("RetISR").ToString.ToDecimal + ddlUM.Items.Clear() If UsuarioActual.Empresa.UsaInventarios Then ddlUM.DataSource = GlobalDTProductosServiciosEquivalencias(PS("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) @@ -18230,6 +18290,19 @@ Partial Class Compras_Compras TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 6) TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 6) + 'OIC 2025-04-29 + If CveCompra > 0 AndAlso Modalidad = "A" Then + If ProvRetIVA > 0 Or ProvRetISR > 0 Then + TxtRetIVAModal.Text = FormatoNumero(ProvRetIVA, 6) + TxtRetISRModal.Text = FormatoNumero(ProvRetISR, 6) + ElseIf PsRetIVA > 0 Or PsRetISR > 0 Then + TxtRetIVAModal.Text = FormatoNumero(PsRetIVA, 6) + TxtRetISRModal.Text = FormatoNumero(PsRetISR, 6) + End If + End If + + + If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then TxtIEPSModal.Text = "0" Alert("El producto seleccionado contiene IEPS, pero el acumulado de la factura no contiene IEPS, por lo que no se agregara el impuesto.", TipoMensaje.MsgAdvertencia) @@ -18518,7 +18591,7 @@ Partial Class Compras_Compras UpPS.Update() CargaGvPersonal() - MostrarOcultarColumnaIEPS() + MostrarOcultarColumnaIEPSRetIVARetISR() End Sub @@ -20300,7 +20373,7 @@ Partial Class Compras_Compras Alert("Debe seleccionar al menos un impuesto", TipoMensaje.MsgAdvertencia) End If - MostrarOcultarColumnaIEPS() + MostrarOcultarColumnaIEPSRetIVARetISR() AddPS2() End Sub #End Region @@ -21156,12 +21229,12 @@ Partial Class Compras_Compras If ChkEsNoDeducible.Checked Then EsNoDeducible = True dvNoDeducible.Visible = True - GvPS.Columns(11).Visible = True + GvPS.Columns(13).Visible = True DivEsNoDeducible.Visible = True Else EsNoDeducible = False dvNoDeducible.Visible = False - GvPS.Columns(11).Visible = False + GvPS.Columns(13).Visible = False DivEsNoDeducible.Visible = False End If diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 4a7d61348..4c7dd8fa6 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -3326,89 +3326,89 @@
- -
+
+
-
-
-
-
- - -
-
-
-
- - - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - <%----%> - -
-
-
-
- - - -
-
-
-
-
-
- - - -
-
-
-
- - -
-
-
-
-
- - -
+
+ + +
-
-
- - - +
+
+
+ + + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + + +
+
+
+
+
+
+ + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + + +
+
-
-
@@ -3427,38 +3427,38 @@
-
-
-
+
+
+
-
-
+
+
-
- - +
+ +
-
-
+
+
-
- - - Seleccione uno - - - - +
+ + + Seleccione uno + + + + + +
-
-