diff --git a/brmbar3/schema/0020-shop-undo.sql b/brmbar3/schema/0020-shop-undo.sql index a279580..d2d12b3 100644 --- a/brmbar3/schema/0020-shop-undo.sql +++ b/brmbar3/schema/0020-shop-undo.sql @@ -41,7 +41,7 @@ DECLARE v_old_split public.transaction_splits%ROWTYPE; BEGIN SELECT * INTO v_old_trn FROM public.transactions WHERE id = i_id; - INSERT INTO transactions ("description") VALUES ('undo '||o_id||' ('||v_old_trn.description||')') RETURNING id into v_ntrn_id; + INSERT INTO transactions ("description") VALUES ('undo '||i_id||' ('||v_old_trn.description||')') RETURNING id into v_ntrn_id; FOR v_old_split IN SELECT * FROM transaction_splits WHERE "transaction" = i_id LOOP