From 84d8d7bec15be6859bee26bdd3b497d9ac7cf82f Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Fri, 26 May 2023 09:59:37 -0700 Subject: [PATCH] Prorateo deducible Compras, clientes asignar cuenta sig generada --- Compras/Compras.aspx | 1 + Compras/Compras.aspx.vb | 72 +++++++++++++++++++ .../Reportes/RepSituacionFinanciera.rdlc | 1 + Ventas/Clientes.aspx.vb | 13 ++-- 4 files changed, 82 insertions(+), 5 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index c836aa7ef..d628b144e 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1140,6 +1140,7 @@
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 1bd3b8565..30fc968ec 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1444,6 +1444,11 @@ Partial Class Compras_Compras End If + + If UsuarioActual.TienePermisoProceso(360) Then + BtnProrateoDeducible.Visible = True + End If + ElseIf Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then ViewState("CveCompra") = Request("CveCompra") @@ -20622,6 +20627,73 @@ Partial Class Compras_Compras End Sub + Private Sub ProratearDeducible() + + + ChkEsNoDeducible_CheckedChanged1(Nothing, Nothing) + + + Dim DTProtateo As DataTable = TmpDT.Clone + + + Dim Consec As Integer = 1 + + For Each dRowOriginal As DataRow In TmpDT.Rows + + + + Dim dRow91_5 As DataRow = DTProtateo.NewRow + Dim dRow8_5 As DataRow = DTProtateo.NewRow + + dRow91_5.ItemArray = dRowOriginal.ItemArray + dRow8_5.ItemArray = dRowOriginal.ItemArray + + Dim Mul91_5 As Decimal = 0.915D + Dim Mul85 As Decimal = 0.085D + + + dRow91_5("Consec") = Consec + dRow91_5("PU") = dRow91_5("PU").ToString.ToDecimal * Mul91_5 + dRow91_5("IVA") = dRow91_5("IVA").ToString.ToDecimal * Mul91_5 + dRow91_5("RetIVA") = dRow91_5("RetIVA").ToString.ToDecimal * Mul91_5 + dRow91_5("RetISR") = dRow91_5("RetISR").ToString.ToDecimal * Mul91_5 + dRow91_5("IEPSPS") = dRow91_5("IEPSPS").ToString.ToDecimal * Mul91_5 + dRow91_5("IEPSPSIVA") = dRow91_5("IEPSPSIVA").ToString.ToDecimal * Mul91_5 + dRow91_5("Total") = dRow91_5("Total").ToString.ToDecimal * Mul91_5 + dRow91_5("NoDeducible") = 1 + + + dRow8_5("Consec") = Consec + 1 + dRow8_5("PU") = dRow8_5("PU").ToString.ToDecimal * Mul85 + dRow8_5("IVA") = dRow8_5("IVA").ToString.ToDecimal * Mul85 + dRow8_5("RetIVA") = dRow8_5("RetIVA").ToString.ToDecimal * Mul85 + dRow8_5("RetISR") = dRow8_5("RetISR").ToString.ToDecimal * Mul85 + dRow8_5("IEPSPS") = dRow8_5("IEPSPS").ToString.ToDecimal * Mul85 + dRow8_5("IEPSPSIVA") = dRow8_5("IEPSPSIVA").ToString.ToDecimal * Mul85 + dRow8_5("Total") = dRow8_5("Total").ToString.ToDecimal * Mul85 + dRow8_5("NoDeducible") = 0 + + + DTProtateo.Rows.Add(dRow91_5) + DTProtateo.Rows.Add(dRow8_5) + + Consec = Consec + 2 + + Next + + DTProtateo.AcceptChanges() + TmpDT = DTProtateo + + BtnProrateoDeducible.Visible = False + + AddPS2(True) + + End Sub + + Private Sub BtnProrateoDeducible_Click(sender As Object, e As EventArgs) Handles BtnProrateoDeducible.Click + ProratearDeducible() + End Sub + #End Region diff --git a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc index 8fbc653f0..a9df55f06 100644 --- a/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc +++ b/Contabilidad2/Reportes/RepSituacionFinanciera.rdlc @@ -3056,6 +3056,7 @@ Fields!ImporteActual.Value, 0), "DataSet1") =Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" OR Fields!Sup.Value = "CAPITAL CONTABLE" +OR Fields!Sup.Value = "Capital Contable" OR Fields!Sup.Value = "Capital Social" OR Fields!Sup.Value = "Capital", Fields!ImporteActual.Value, 0),"DataSet1") diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index ccce8bfae..ccf7e3e44 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -3968,17 +3968,19 @@ Partial Class Clientes If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero If CvePadre > 0 Then - If ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq) > 0 Then - Respuesta = True + + Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq) + + If CvecuentaNueva > 0 Then + If ObjContabilidad.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CvecuentaNueva, CveCliente:=CveCliente) Then + Respuesta = True + End If End If End If End If - 'If ObjContabilidad.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, 7, -1, 1) Then - 'End If - End If Return Respuesta @@ -4856,6 +4858,7 @@ Partial Class Clientes #Region "Cuentas/Equipos" Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs) + HdnModalidad.Value = "I" DivCicloComercial.Visible = False TxtIdentificador.Text = ""