Hola Nikhil,
Por favor, prueba la consulta a continuación y luego regresa
SI @transaction_type IN (N'A', N'U') Y
(@Object_type = N'20')
begin
if exists (SELECT T0.BaseEntry, SUM(T0.Quantity)
FROM [dbo].[PDN1] T0 INNER
JOIN [dbo].[POR1] T1 ON T1.DOCENTRY =
T0.BASEENTRY
WHERE T0.BaseType = 22 Y
T0.ItemCode = T1.ItemCode Y T0.BaseLine
= T1.LineNum
y T0.DOCENTRY = @list_of_cols_val_tab_del
GROUP BY T0.BaseEntry
HAVING SUM(T0.Quantity)+(SUM(T0.Quantity)*.05) > SUM(T1.Quantity)
o SUM(T0.Quantity)+(SUM(T0.Quantity)*.05) > sum(t0.BaseOpnQty)
begin
select @Error = 10, @error_message =
'La cantidad de GRPO supera la cantidad de PO'
end
end
Gracias
Unnikrishnan