From 81366fd2bbeb4585d1da269e8b413a1a572c2477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Sat, 12 Jul 2025 18:04:56 +0200 Subject: [PATCH] 0010: fix v_transaction_id --- brmbar3/schema/0010-shop-sell-for-cash.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brmbar3/schema/0010-shop-sell-for-cash.sql b/brmbar3/schema/0010-shop-sell-for-cash.sql index 4881b27..c29b0f8 100644 --- a/brmbar3/schema/0010-shop-sell-for-cash.sql +++ b/brmbar3/schema/0010-shop-sell-for-cash.sql @@ -77,17 +77,17 @@ BEGIN -- the item (decrease stock) INSERT INTO public.transaction_splits (transaction, side, account, amount, memo) - VALUES (i_transaction_id, 'credit', i_item_id, i_amount, + VALUES (v_transaction_id, 'credit', i_item_id, i_amount, i_other_memo); -- the user INSERT INTO public.transaction_splits (transaction, side, account, amount, memo) - VALUES (i_transaction_id, 'debit', i_user_id, v_cost, + VALUES (v_transaction_id, 'debit', i_user_id, v_cost, (SELECT "name" FROM public.accounts WHERE id = i_item_id)); -- the profit INSERT INTO public.transaction_splits (transaction, side, account, amount, memo) - VALUES (i_transaction_id, 'debit', (SELECT account_id FROM accounts WHERE name = 'BrmBar Profits'), v_profit, (SELECT 'Margin on ' || "name" FROM public.accounts WHERE id = i_item_id)); + VALUES (v_transaction_id, 'debit', (SELECT account_id FROM accounts WHERE name = 'BrmBar Profits'), v_profit, (SELECT 'Margin on ' || "name" FROM public.accounts WHERE id = i_item_id)); -- Return the cost RETURN v_cost;