This commit is contained in:
2025-03-05 17:22:35 -07:00
parent 5521ec4bb9
commit 07e4cb087a

View File

@@ -3266,7 +3266,6 @@ Partial Class Compras_Compras
If DdlRetIVAConcepto.SelectedValue.ToEntero > 0 Then
DdlRetIVAConcepto.Enabled = True
End If
If DdlRetISRConcepto.SelectedValue.ToEntero > 0 Then
DdlRetISRConcepto.Enabled = True
End If
@@ -7792,8 +7791,8 @@ Partial Class Compras_Compras
Alert("Ocurrió un Error al agregar el IVA.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ElseIf ErrorMovInv Then
Alert("Ocurrió un Error al agregar el Producto o Servicio al Inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ElseIf TieneError Then
Alert("El total de los IMPORTES del FINANCIAMIENTO debe ser mayor que 0 y menor o igual al total de la compra", TipoMensaje.MsgAdvertencia)
'ElseIf TieneError Then
' Alert("El total de los IMPORTES del FINANCIAMIENTO debe ser mayor que 0 y menor o igual al total de la compra", TipoMensaje.MsgAdvertencia)
ElseIf ErrorAF Then
Alert("Error al actualizar la vinculacion del Activo Fijo", TipoMensaje.MsgAdvertencia)
ElseIf ErrorAC Then
@@ -7953,7 +7952,7 @@ Partial Class Compras_Compras
If CveEvaluacionProveedor > 0 Then
Msg.Append("<br/><br/>El proveedor tiene evaluaciones pendientes<br/>")
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
Msg.Append("¿Desea realizar una evaluación al proveedor?")
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
End If
@@ -13909,7 +13908,7 @@ Partial Class Compras_Compras
If realizadevolucion Then
subtotaldevolucion = subtotaldevolucion.RoundSQL(2)
'si el subtotal es igual a la nc lo guardo si no marco error
Dim tTolerancia As Decimal = 0
Dim tTolerancia As Decimal = 0.1D
Dim tAjustaUltimo As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
tTolerancia = Math.Abs(TxtSubTotal2.Text.ToDecimal - subtotaldevolucion)
@@ -13966,11 +13965,11 @@ Partial Class Compras_Compras
End If
Else
ErrorMovInv = True
Alert("El Total de la NC debe ser igual al total de la devolucion", TipoMensaje.MsgAdvertencia)
Alert("El Total de la NC debe ser igual al total de la devolución", TipoMensaje.MsgAdvertencia)
End If
End If
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa, -1) Then
If Not ErrorMovInv AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa, -1) Then
For Each drow As DataRow In ObjInventario.DtResultados.Rows
TotalSumaPU = TotalSumaPU + drow("Total").ToString.ToDecimal
@@ -14016,7 +14015,7 @@ Partial Class Compras_Compras
Dim objcompras As New ClsCompras()
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
GVDevolucion.DataSource = objcompras.DtResultados
FechaMovtoDev = objcompras.DtResultados.FiltroPrimeroValor("FechaMovto").ToDate.ToString("dd/MM/yyyy").ToDate
FechaMovtoDev = objcompras.DtResultados.FiltroPrimeroValor("FechaMovto").ToDate
End If
objcompras.Dispose()
GVDevolucion.DataBind()
@@ -14029,7 +14028,7 @@ Partial Class Compras_Compras
DdlAlmacenDevolucion.SelectedValueExist(CveAlmacen)
UPDevolucion.Update()
If EsGrupoDiaz AndAlso FechaMovtoDev <> MinFecha AndAlso (FechaMovtoDev >= TxtFecha.Text.ToDate) Then
If FechaMovtoDev <> MinFecha AndAlso (FechaMovtoDev >= TxtFecha.Text.ToDate) Then
Alert("La fecha de la devolución se cambiará a una fecha posterior al ingreso.", TipoMensaje.ToastAdventencia)
End If
@@ -14088,10 +14087,7 @@ Partial Class Compras_Compras
Dim IEPSCompra As Decimal = TxtIEPS.Text.ToDecimal()
Dim RetIVACompra As Decimal = TxtRetIVA.Text.ToDecimal()
Dim RetISRCompra As Decimal = TxtRetISR.Text.ToDecimal()
Dim Acumulado As Decimal = 0
'Dim TotalCalculable As Decimal = TotalCompra - IEPSCompra + RetIVACompra + RetISRCompra
Dim AcumuladoDevolucion As Decimal = 0
Dim IVAPorcentajeCompra As Decimal = Math.Round((IVACompra / SubTotalCompra), 2)
Dim Contador As Integer = 0
Dim Consec As Integer = 0
@@ -14127,12 +14123,12 @@ Partial Class Compras_Compras
Dim IVA As Decimal = IVAPorcentajeCompra 'Math.Round(Total * IVAPorcentajeCompra, 2)
Dim Descuento As Decimal = 0
Acumulado += (PU * Cantidad)
AcumuladoDevolucion += (PU * Cantidad)
Consec += 1
If Consec = Contador AndAlso tAjusteUltimo Then 'SubTotalCompra < Acumulado Then
If Consec = Contador AndAlso tAjusteUltimo Then 'SubTotalCompra < AcumuladoDevolucion Then
'ajusta el valor
Dim dif As Decimal = SubTotalCompra - Acumulado
Dim dif As Decimal = SubTotalCompra - AcumuladoDevolucion
If dif <> 0 Then
PU = ((PU * Cantidad) + dif) / Cantidad
Total = Cantidad * PU
@@ -14150,7 +14146,7 @@ Partial Class Compras_Compras
End If
Dim PSRow As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSRNC).FiltroPrimero("")
Dim PS As String = PSRow("PSCodigo").ToString
Dim tDif As Decimal = TxtSubTotal2.Text.ToDecimal - Total
Dim tDif As Decimal = TxtSubTotal2.Text.ToDecimal - AcumuladoDevolucion
DevolucionImporteOriginal = tDif
AddPS(1, PSRow("CveUnidadMedida").ToString.ToEntero, PSRow("UnidadMedida").ToString,