From c9767352a0c17356b6fe938942169b3333bc70af Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 2 Mar 2024 09:14:22 -0700 Subject: [PATCH] =?UTF-8?q?--=20manejo=20de=20centavo=20para=20tema=20de?= =?UTF-8?q?=20garant=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d40ab3a28..cd845a3a1 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14957,10 +14957,17 @@ Partial Class Ventas CveVentaAplicar = CveDevolucion CveVentaAmortizacionAplicar = ObjFactura.CveVenta End If + 'verifico que el AF, tenga valores iguales cuando esté vacío o "-1" + Dim drs As DataRow() = TmpDTDetalle.Select(" CveActivoFijo IS NULL") + For Each dr As DataRow In drs + dr("CveActivoFijo") = "-1" + Next + TmpDTDetalle.AcceptChanges() DT = TmpDTDetalle.FiltraParametros($"CvePS <> {CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA", "CveActivoFijo"}) If DT.Rows.Count > 0 Then + 'Se agrega movimiento separado por la cuenta de ventas (ER) For Each Row2 As DataRow In DT.Rows importeMovimiento = (TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1} AND PorcentajeIVA = {2} AND ISNULL(CveActivoFijo,-1) = {3}", Row2("CveClasificacion"), Row2("CveSubProyecto"), Row2("PorcentajeIVA"), If(Row2("CveActivoFijo").ToString().ToEntero() > 0, Row2("CveActivoFijo").ToString().ToEntero(), -1))).ToString().ToDecimal()) * ValorMultiplicador @@ -23276,7 +23283,12 @@ Partial Class Ventas 'VALIDA PAGOS EN FACTURAS DE ING,ANT NUEVAS O FACTURACION DE REM O COTIZACIONES If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso RBLPago.SelectedValue = "2" AndAlso ((CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant")) OrElse TipoDoctoViejo.Contiene("Rem", "Cot")) Then - + Dim TotalPagadoGarantia As Decimal = 0 + If TxtTotal.Text.ToDecimal = 0.01 AndAlso Me.EsGarantia = True Then + TotalPagadoGarantia = 0.01D + TienePagos = True + ViewState("SaldoVenta") = SaldoVenta - TotalPagadoGarantia + End If If Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then If MostrarAlertas Then Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) @@ -23294,7 +23306,7 @@ Partial Class Ventas Dim TotalRNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblDescuentosRNC.Text.Trim().ToDecimal(), 0) Dim ImporteTotal As Decimal = (TxtTotal.Text.ToDecimal).RoundSQL(2) - Dim TotalPagado As Decimal = (TotalPagoContado + TotalRNC + TotalProntoPago).RoundSQL(2) + Dim TotalPagado As Decimal = (TotalPagoContado + TotalRNC + TotalProntoPago + TotalPagadoGarantia).RoundSQL(2) If TotalPagado <> ImporteTotal Then If MostrarAlertas Then @@ -23316,10 +23328,7 @@ Partial Class Ventas Return Retorno End If End If - - End If - End If 'SI TIENE SALDO PENDIENTE VALIDA SI TIENE PAGOS