1
0
Fork 0
forked from aiolabs/libra

Clean up awkward "the Libra" phrasing left over from rename

Replaces entity-sense references to "the Libra" with "the
organization"/"the collective" where Libra was being used as a
stand-in for the original "Castle" entity, and drops the redundant
"(like cooperatives)" parenthetical in DOCUMENTATION.md. Also swaps
the 🏰 emoji in the import helper for ⚖️.

Closes #12

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-07 08:37:30 +02:00
commit b2b2c109a4
9 changed files with 22 additions and 22 deletions

View file

@ -30,7 +30,7 @@ Enable the extension through the LNbits admin interface or by adding it to your
- Choose "Liability" if you want reimbursement - Choose "Liability" if you want reimbursement
- Choose "Equity" if it's a contribution - Choose "Equity" if it's a contribution
2. **View Your Balance**: See if the Libra owes you money or vice versa 2. **View Your Balance**: See if the collective owes you money or vice versa
3. **Pay Outstanding Balance**: Generate a Lightning invoice to settle what you owe 3. **Pay Outstanding Balance**: Generate a Lightning invoice to settle what you owe
@ -54,8 +54,8 @@ Enable the extension through the LNbits admin interface or by adding it to your
### Account Types ### Account Types
- **Assets**: Things the Libra owns (Cash, Bank, Accounts Receivable) - **Assets**: Things the organization owns (Cash, Bank, Accounts Receivable)
- **Liabilities**: What the Libra owes (Accounts Payable to members) - **Liabilities**: What the organization owes (Accounts Payable to members)
- **Equity**: Member contributions and retained earnings - **Equity**: Member contributions and retained earnings
- **Revenue**: Income streams - **Revenue**: Income streams
- **Expenses**: Operating costs - **Expenses**: Operating costs

View file

@ -200,11 +200,11 @@ DEFAULT_HIERARCHICAL_ACCOUNTS = [
("Assets:FixedAssets:ProductionFacility", AccountType.ASSET, "Production facilities"), ("Assets:FixedAssets:ProductionFacility", AccountType.ASSET, "Production facilities"),
("Assets:Inventory", AccountType.ASSET, "Inventory and stock"), ("Assets:Inventory", AccountType.ASSET, "Inventory and stock"),
("Assets:Livestock", AccountType.ASSET, "Livestock and animals"), ("Assets:Livestock", AccountType.ASSET, "Livestock and animals"),
("Assets:Receivable", AccountType.ASSET, "Money owed to the Libra"), ("Assets:Receivable", AccountType.ASSET, "Money owed to the organization"),
("Assets:Tools", AccountType.ASSET, "Tools and hand equipment"), ("Assets:Tools", AccountType.ASSET, "Tools and hand equipment"),
# Liabilities # Liabilities
("Liabilities:Payable", AccountType.LIABILITY, "Money owed by the Libra"), ("Liabilities:Payable", AccountType.LIABILITY, "Money owed by the organization"),
# Equity - User equity accounts created dynamically as Equity:User-{user_id} # Equity - User equity accounts created dynamically as Equity:User-{user_id}
# No parent "Equity" account needed - hierarchy is implicit in the name # No parent "Equity" account needed - hierarchy is implicit in the name

View file

@ -9,27 +9,27 @@ A comprehensive double-entry accounting system for collective projects, designed
- **User Expense Tracking**: Members can record out-of-pocket expenses as either: - **User Expense Tracking**: Members can record out-of-pocket expenses as either:
- **Liabilities**: Libra owes them money (reimbursable) - **Liabilities**: Libra owes them money (reimbursable)
- **Equity**: Their contribution to the collective - **Equity**: Their contribution to the collective
- **Accounts Receivable**: Track what users owe the Libra (e.g., accommodation fees) - **Accounts Receivable**: Track what users owe the organization (e.g., accommodation fees)
- **Revenue Tracking**: Record revenue received by the collective - **Revenue Tracking**: Record revenue received by the collective
- **User Balance Dashboard**: Each user sees their balance with the Libra - **User Balance Dashboard**: Each user sees their balance with the organization
- **Lightning Integration**: Generate invoices for outstanding balances - **Lightning Integration**: Generate invoices for outstanding balances
- **Transaction History**: View all accounting entries and transactions - **Transaction History**: View all accounting entries and transactions
## Use Cases ## Use Cases
### 1. User Pays Expense Out of Pocket ### 1. User Pays Expense Out of Pocket
When a member buys supplies for the Libra: When a member buys supplies for the collective:
- They can choose to be reimbursed (Liability) - They can choose to be reimbursed (Liability)
- Or contribute it as equity (Equity) - Or contribute it as equity (Equity)
### 2. Accounts Receivable ### 2. Accounts Receivable
When someone stays at the Libra and owes money: When someone stays with the collective and owes money:
- Admin creates an AR entry (e.g., "5 nights @ 10€/night = 50€") - Admin creates an AR entry (e.g., "5 nights @ 10€/night = 50€")
- User sees they owe 50€ in their dashboard - User sees they owe 50€ in their dashboard
- They can generate an invoice to pay it off - They can generate an invoice to pay it off
### 3. Revenue Recording ### 3. Revenue Recording
When the Libra receives revenue: When the organization receives revenue:
- Record revenue with the payment method (Cash, Lightning, Bank) - Record revenue with the payment method (Cash, Lightning, Bank)
- Properly categorized in the accounting system - Properly categorized in the accounting system

View file

@ -2,7 +2,7 @@
## Overview ## Overview
The Libra extension for LNbits implements a double-entry bookkeeping system designed for cooperative/communal living spaces (like cooperatives). It tracks financial relationships between a central entity (the Libra) and multiple users, handling both Lightning Network payments and manual/cash transactions. The Libra extension for LNbits implements a double-entry bookkeeping system designed for collectives like co-living spaces, makerspaces, and community projects. It tracks financial relationships between a central organization and its members, handling both Lightning Network payments and manual/cash transactions.
## Architecture ## Architecture
@ -411,10 +411,10 @@ Created by `m001_initial` migration:
- `cash` - Cash on hand - `cash` - Cash on hand
- `bank` - Bank Account - `bank` - Bank Account
- `lightning` - Lightning Balance - `lightning` - Lightning Balance
- `accounts_receivable` - Money owed to the Libra - `accounts_receivable` - Money owed to the organization
### Liabilities ### Liabilities
- `accounts_payable` - Money owed by the Libra - `accounts_payable` - Money owed by the organization
### Equity ### Equity
- `member_equity` - Member contributions - `member_equity` - Member contributions
@ -1210,4 +1210,4 @@ The Libra extension provides a solid foundation for double-entry bookkeeping in
5. Equity management features 5. Equity management features
6. External system integrations (accounting software, tax tools) 6. External system integrations (accounting software, tax tools)
The refactoring path is clear: prioritize data integrity, then add reporting/export, then enhance with advanced features. The system is production-ready for basic use cases but needs the recommended enhancements for a full-featured cooperative accounting solution. The refactoring path is clear: prioritize data integrity, then add reporting/export, then enhance with advanced features. The system is production-ready for basic use cases but needs the recommended enhancements for a full-featured collective accounting solution.

View file

@ -2,7 +2,7 @@
## Overview ## Overview
The Libra extension now requires admin approval for all user-submitted expenses. This prevents invalid or incorrect expenses from affecting balances until they are verified by the Libra admin. The Libra extension now requires admin approval for all user-submitted expenses. This prevents invalid or incorrect expenses from affecting balances until they are verified by an admin.
## How It Works ## How It Works

View file

@ -89,7 +89,7 @@ Your Beancount transactions must have an `Equity:<name>` account:
```bash ```bash
$ python import_beancount.py ledger.beancount $ python import_beancount.py ledger.beancount
====================================================================== ======================================================================
🏰 Beancount to Libra Import Script ⚖️ Beancount to Libra Import Script
====================================================================== ======================================================================
📊 Loaded 15 daily rates from btc_eur_rates.csv 📊 Loaded 15 daily rates from btc_eur_rates.csv

View file

@ -653,7 +653,7 @@ if __name__ == "__main__":
import sys import sys
print("=" * 70) print("=" * 70)
print("🏰 Beancount to Libra Import Script") print("⚖️ Beancount to Libra Import Script")
print("=" * 70) print("=" * 70)
if len(sys.argv) < 2: if len(sys.argv) < 2:

View file

@ -152,7 +152,7 @@
Libra wallet must be configured first Libra wallet must be configured first
</q-tooltip> </q-tooltip>
<q-tooltip v-else> <q-tooltip v-else>
Record when a user owes the Libra Record when a user owes the organization
</q-tooltip> </q-tooltip>
</q-btn> </q-btn>
<q-btn color="secondary" @click="loadTransactions"> <q-btn color="secondary" @click="loadTransactions">
@ -1056,7 +1056,7 @@
<div class="text-h6 q-mb-md">Request Manual Payment</div> <div class="text-h6 q-mb-md">Request Manual Payment</div>
<div class="text-caption text-grey q-mb-md"> <div class="text-caption text-grey q-mb-md">
Request the Libra to pay you manually (cash, bank transfer, etc.) to settle your balance. Request a manual payment (cash, bank transfer, etc.) from an admin to settle your balance.
</div> </div>
<div v-if="balance" class="q-mb-md"> <div v-if="balance" class="q-mb-md">

View file

@ -1420,7 +1420,7 @@ async def api_create_revenue_entry(
async def api_get_my_balance( async def api_get_my_balance(
wallet: WalletTypeInfo = Depends(require_invoice_key), wallet: WalletTypeInfo = Depends(require_invoice_key),
) -> UserBalance: ) -> UserBalance:
"""Get current user's balance with the Libra (from Fava/Beancount)""" """Get current user's balance with the organization (from Fava/Beancount)"""
from lnbits.settings import settings as lnbits_settings from lnbits.settings import settings as lnbits_settings
from .fava_client import get_fava_client from .fava_client import get_fava_client
@ -1473,7 +1473,7 @@ async def api_get_user_balance(
auth: AuthContext = Depends(require_authenticated), auth: AuthContext = Depends(require_authenticated),
) -> UserBalance: ) -> UserBalance:
""" """
Get a specific user's balance with the Libra (from Fava/Beancount). Get a specific user's balance with the organization (from Fava/Beancount).
Users can only access their own balance. Super users can access any user's balance. Users can only access their own balance. Super users can access any user's balance.
""" """
@ -2521,7 +2521,7 @@ async def api_create_manual_payment_request(
data: CreateManualPaymentRequest, data: CreateManualPaymentRequest,
wallet: WalletTypeInfo = Depends(require_invoice_key), wallet: WalletTypeInfo = Depends(require_invoice_key),
) -> ManualPaymentRequest: ) -> ManualPaymentRequest:
"""Create a manual payment request for the Libra to review""" """Create a manual payment request for an admin to review"""
return await create_manual_payment_request( return await create_manual_payment_request(
wallet.wallet.user, data.amount, data.description wallet.wallet.user, data.amount, data.description
) )