diff --git a/brmbar3/schema/0010-shop-sell-for-cash.sql b/brmbar3/schema/0010-shop-sell-for-cash.sql index c29b0f8..12e0b9d 100644 --- a/brmbar3/schema/0010-shop-sell-for-cash.sql +++ b/brmbar3/schema/0010-shop-sell-for-cash.sql @@ -87,7 +87,11 @@ BEGIN -- the profit INSERT INTO public.transaction_splits (transaction, side, account, amount, memo) - 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)); + VALUES (v_transaction_id, + 'debit', + (SELECT id FROM public.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;