From 7492d5dce67b55768c7418c4f8bcd6481092d6bd Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 21 Sep 2022 14:02:36 -0700 Subject: [PATCH] Validar importes, recepcion de usados cuando es garantia --- Inventarios/RecepcionUsados.aspx.vb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index a6f23b581..8e1a53863 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -2803,11 +2803,20 @@ Partial Class Inventarios_RecepcionUsados PS = Dr("PSCodigo").ToString UnidadMedida = Dr("UnidadMedida").ToString Clasificacion = Dr("Clasificacion").ToString + End If PorcentajeIVA = 0.16D IVA = SubTotal * PorcentajeIVA + Dim Descuento As Decimal = 0 - AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "", + Dim ImporteCargo As Decimal = GlobalDTAcumTamaños().FiltroPrimeroValor("Cargo", String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa)).ToDecimal() + + 'SI ES AJUSTE O GARANTIA SOLO DEBE SUMAR EL IMPORTE DE LA GARANTIA SI NO RECIBIO USADO + If RblUsadosAjuste.SelectedValue = "1" AndAlso ImporteCargo <= 0 Then + Descuento = (Cantidad * PU).RoundSQL(6) + End If + + AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, Descuento, -1, "", ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño) Else Alert("No se pudo cargar el producto", TipoMensaje.MsgError) @@ -2863,14 +2872,14 @@ Partial Class Inventarios_RecepcionUsados Dim ImporteRetIVA As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteRetIVA").ToDecimal() Dim ImporteRetISR As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteRetISR").ToDecimal() Dim ImporteIEPS As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteIEPS").ToDecimal() - Dim Descuento As Decimal = ObjRemisionNC.DtDetalle.SUM("Descuento").ToDecimal() + Dim DescuentoTotal As Decimal = ObjRemisionNC.DtDetalle.SUM("Descuento").ToDecimal() Dim Amortizacion As Decimal = 0 - Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion) + Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + DescuentoTotal + Amortizacion) 'DETALLES ObjRemisionNC.SubTotal = TotalImporte - ObjRemisionNC.Descuento = Descuento + ObjRemisionNC.Descuento = DescuentoTotal ObjRemisionNC.Amortizacion = Amortizacion ObjRemisionNC.IVA = ImporteIVA ObjRemisionNC.RetIVA = ImporteRetIVA