Uses wallet's user ID for account creation
Ensures that account creation utilizes the user ID associated with the wallet, rather than directly relying on the wallet identifier. This aligns account ownership more accurately.
This commit is contained in:
parent
ed38411fc4
commit
224d520d84
1 changed files with 3 additions and 3 deletions
|
|
@ -256,12 +256,12 @@ async def api_create_expense_entry(
|
|||
if data.is_equity:
|
||||
# Equity contribution
|
||||
user_account = await get_or_create_user_account(
|
||||
data.user_wallet, AccountType.EQUITY, "Member Equity"
|
||||
wallet.wallet.user, AccountType.EQUITY, "Member Equity"
|
||||
)
|
||||
else:
|
||||
# Liability (castle owes user)
|
||||
user_account = await get_or_create_user_account(
|
||||
data.user_wallet, AccountType.LIABILITY, "Accounts Payable"
|
||||
wallet.wallet.user, AccountType.LIABILITY, "Accounts Payable"
|
||||
)
|
||||
|
||||
# Create journal entry
|
||||
|
|
@ -275,7 +275,7 @@ async def api_create_expense_entry(
|
|||
account_id=expense_account.id,
|
||||
debit=amount_sats,
|
||||
credit=0,
|
||||
description=f"Expense paid by user {data.user_wallet[:8]}",
|
||||
description=f"Expense paid by user {wallet.wallet.user[:8]}",
|
||||
metadata=metadata,
|
||||
),
|
||||
CreateEntryLine(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue