diff --git a/maybe_dev/README.md b/maybe_dev/README.md deleted file mode 100644 index 251a71d..0000000 --- a/maybe_dev/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Maybe Finance - -## Overview - -Personal finance and budgeting tool with a focus on privacy. - -## Project Details - -- **Project Repository:** [GitHub](https://github.com/maybe-finance/maybe) -- **Container Image:** [ghcr.io/maybe-finance/maybe](https://github.com/maybe-finance/maybe/pkgs/container/maybe) -- **Documentation:** [GitHub docs](https://github.com/maybe-finance/maybe/tree/main/docs) -- **Reverse Proxy Port:** `3000` - -## Getting Started - -1. Start the container: `docker compose up -d` -2. Open http://localhost:3000 in your browser -3. Follow the initial setup wizard to configure the application - -## Environment Variable Notes - - MAYBE_SECRET_KEY_BASE – generate with `openssl rand -hex 64` - -## Volume Notes - - /rails/storage – uploaded files - /var/lib/postgresql/data – PostgreSQL data - -## Network Notes - -Requires proxy network - -## Docker Run - -```bash -docker run -d \ - --name maybe \ - -p 3000:3000 \ - -e SELF_HOSTED=true -e RAILS_FORCE_SSL=false -e RAILS_ASSUME_SSL=false \ - -e SECRET_KEY_BASE=changeme \ - -e DB_HOST=dbhost -e POSTGRES_USER=maybe -e POSTGRES_PASSWORD=pass -e POSTGRES_DB=maybe \ - ghcr.io/maybe-finance/maybe:latest -``` - -## Additional Notes / Gotchas - -The Maybe company shut down and archived the repo — the image is frozen and receives no updates. Consider firefly_dev or paisa_dev in this repo as maintained alternatives. - -## Dockhand Stack, Deploy from Git - -Cookbooks Repository -stackname: maybe_dev -Compose file path: maybe_dev/compose.yaml -Additional env file (optional): maybe_dev/sample.env - -Then "Load" maybe_dev/sample.env into the Environmental variables in dockhand - -Create the Stack diff --git a/maybe_dev/compose.yaml b/maybe_dev/compose.yaml deleted file mode 100644 index 254f441..0000000 --- a/maybe_dev/compose.yaml +++ /dev/null @@ -1,68 +0,0 @@ -services: - maybe: - image: ${MAYBE_IMAGE:-ghcr.io/maybe-finance/maybe:latest} - restart: ${MAYBE_RESTART:-unless-stopped} - volumes: - - ${VOL_PATH:-/data}/maybe/storage:/rails/storage - environment: - - SELF_HOSTED=true - - RAILS_FORCE_SSL=false - - RAILS_ASSUME_SSL=false - - SECRET_KEY_BASE=${MAYBE_SECRET_KEY_BASE:-ChangeThisPassword} - - DB_HOST=maybe-db - - POSTGRES_DB=maybe - - POSTGRES_USER=maybe - - POSTGRES_PASSWORD=${MAYBE_DB_PASSWORD:-ChangeThisPassword} - - REDIS_URL=redis://maybe-redis:6379/1 - ports: - - ${MAYBE_PORT:-3000}:3000 - networks: - - proxy - - internal - depends_on: - - maybe-db - - maybe-redis - - maybe-worker: - image: ${MAYBE_IMAGE:-ghcr.io/maybe-finance/maybe:latest} - restart: ${MAYBE_RESTART:-unless-stopped} - environment: - - SELF_HOSTED=true - - SECRET_KEY_BASE=${MAYBE_SECRET_KEY_BASE:-ChangeThisPassword} - - DB_HOST=maybe-db - - POSTGRES_DB=maybe - - POSTGRES_USER=maybe - - POSTGRES_PASSWORD=${MAYBE_DB_PASSWORD:-ChangeThisPassword} - - REDIS_URL=redis://maybe-redis:6379/1 - networks: - - internal - depends_on: - - maybe-db - - maybe-redis - command: - - bundle - - exec - - sidekiq - - maybe-db: - image: ${POSTGRES_IMAGE:-postgres:16-alpine} - restart: ${MAYBE_RESTART:-unless-stopped} - volumes: - - ${VOL_PATH:-/data}/maybe/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=maybe - - POSTGRES_USER=maybe - - POSTGRES_PASSWORD=${MAYBE_DB_PASSWORD:-ChangeThisPassword} - networks: - - internal - - maybe-redis: - image: ${REDIS_IMAGE:-redis:7-alpine} - restart: ${MAYBE_RESTART:-unless-stopped} - networks: - - internal - -networks: - proxy: - external: true - internal: diff --git a/maybe_dev/sample.env b/maybe_dev/sample.env deleted file mode 100644 index 8101c66..0000000 --- a/maybe_dev/sample.env +++ /dev/null @@ -1,9 +0,0 @@ -# Maybe Finance -VOL_PATH=/data -MAYBE_IMAGE=ghcr.io/maybe-finance/maybe:latest -POSTGRES_IMAGE=postgres:16-alpine -REDIS_IMAGE=redis:7-alpine -MAYBE_RESTART=unless-stopped -MAYBE_PORT=3000 -MAYBE_SECRET_KEY_BASE=ChangeThisPassword -MAYBE_DB_PASSWORD=ChangeThisPassword diff --git a/paisa/README.md b/paisa/README.md new file mode 100644 index 0000000..1f19912 --- /dev/null +++ b/paisa/README.md @@ -0,0 +1,92 @@ +# Paisa + +## Overview + +Paisa is a self-hosted personal finance manager built on top of the +plain-text `ledger` accounting format, with a web UI for dashboards, +budgets, and transaction management. + +## Project Details + +- **Project Repository:** [github.com/ananthakumaran/paisa](https://github.com/ananthakumaran/paisa) +- **Container Image:** [Docker Hub](https://hub.docker.com/r/ananthakumaran/paisa) +- **Documentation:** [paisa.fyi](https://paisa.fyi/) +- **Reverse Proxy Port:** `7500` + +## Getting Started + +1. Copy this stack's `config/` folder to `${VOL_PROJECTS:-/data}/paisa` + and make it a git repo. It holds `paisa.yaml`, an empty `main.ledger`, + `sheets/`, and a `.gitignore`. Edit `paisa.yaml` to suit you. + Starting a new business? Copy `template/` instead: it has a chart of + accounts for a small BC corporation and commented example entries. + Fill in its `TODO`s. +2. Deploy the stack. Paisa creates `paisa.db` in `${VOL_PATH:-/data}/paisa`. +3. Open http://localhost:7500 in your browser. + +To explore first, see [docs/demo.md](docs/demo.md) for the sample books of +Demolition Company Ltd. For ledger syntax, see +[docs/ledger-cheatsheet.md](docs/ledger-cheatsheet.md). Accountants new to +Paisa should read [docs/paisa-for-accountants.md](docs/paisa-for-accountants.md), +especially the section on closing entries. + +## Environment Variable Notes + + PAISA_IMAGE – container image (default ananthakumaran/paisa:latest) + PAISA_RESTART – restart policy (default unless-stopped) + VOL_PATH – host base path for the database, backed up by restic (default /data) + VOL_PROJECTS – host base path for the ledger git repo (default /data) + PAISA_PORT – host port for the web UI (default 7500) + +## Volume Notes + +Anything that belongs in git goes in `VOL_PROJECTS`; anything that +doesn't (the SQLite database) goes in `VOL_PATH`, which is backed up. + +- `/root/Documents/paisa` — `paisa.yaml`, `*.ledger`, `sheets/`; + `${VOL_PROJECTS:-/data}/paisa` on the host, kept in git +- `/var/lib/paisa` — `paisa.db`; `${VOL_PATH:-/data}/paisa` on the + host, backed up by restic + +Both default to `/data`, so they start out as the same folder. Change +them in the stack's env in Dockhand to split them. + +## Network Notes + +Requires proxy network + +## Docker Run + +```bash +docker run -d \ + --name=paisa \ + -p 7500:7500 \ + -v /data/paisa:/root/Documents/paisa \ + -v /data/paisa:/var/lib/paisa \ + ananthakumaran/paisa:latest +``` + +## Additional Notes / Gotchas + +- If Paisa finds no `paisa.yaml`, it creates one with Indian defaults + (INR, en-IN, fiscal year starting in April), so copy `config/` in first. +- `db_path: /var/lib/paisa/paisa.db` in `paisa.yaml` is what keeps the + database out of git. Keep it if you write your own config. +- With the default `/data` for both, `paisa.db` sits in the git folder; + the shipped `.gitignore` keeps it out of commits. Existing single-folder + installs keep working, since `/var/lib/paisa/paisa.db` is the same file. +- `config/paisa.yaml` uses CAD, en-US number formatting, + America/Vancouver, a January fiscal year, and no login. Add + `user_accounts` before exposing Paisa through the proxy. +- The container runs as root; files it writes are root-owned. + +## Dockhand Stack, Deploy from Git + +- Cookbooks Repository +- stackname: paisa +- Compose file path: paisa/compose.yaml +- Additional env file (optional): paisa/sample.env + +Then "Load" paisa/sample.env into the Environment variables in dockhand. + +Create the Stack diff --git a/paisa_dev/compose.yaml b/paisa/compose.yaml similarity index 72% rename from paisa_dev/compose.yaml rename to paisa/compose.yaml index 2cc983a..06203da 100644 --- a/paisa_dev/compose.yaml +++ b/paisa/compose.yaml @@ -6,7 +6,8 @@ services: restart: ${PAISA_RESTART:-unless-stopped} volumes: - - ${VOL_PATH:-/data}/paisa:/root/Documents/paisa + - ${VOL_PROJECTS:-/data}/paisa:/root/Documents/paisa + - ${VOL_PATH:-/data}/paisa:/var/lib/paisa ports: - "${PAISA_PORT:-7500}:7500" diff --git a/paisa/config/.gitignore b/paisa/config/.gitignore new file mode 100644 index 0000000..8557e18 --- /dev/null +++ b/paisa/config/.gitignore @@ -0,0 +1,3 @@ +# paisa.db lives in VOL_PATH; ignore it if both paths point at the same folder +paisa.db +paisa.db-* diff --git a/paisa/config/main.ledger b/paisa/config/main.ledger new file mode 100644 index 0000000..1a99f52 --- /dev/null +++ b/paisa/config/main.ledger @@ -0,0 +1,5 @@ +; Main Paisa journal. Split by year with: include 2026.ledger +; Included files must be in this folder or a subfolder. + +commodity CAD + format 1,000.00 CAD diff --git a/paisa/config/paisa.yaml b/paisa/config/paisa.yaml new file mode 100644 index 0000000..6b6a383 --- /dev/null +++ b/paisa/config/paisa.yaml @@ -0,0 +1,44 @@ +# Paisa starter config — copy this folder into ${VOL_PROJECTS:-/data}/paisa (git repo) +# Reference: https://paisa.fyi/reference/config/ + +# Relative paths resolve from this file's directory (in git) +journal_path: main.ledger +sheets_directory: sheets + +# Database is not in git: ${VOL_PATH:-/data}/paisa, backed up by restic +db_path: /var/lib/paisa/paisa.db + +# ledger | hledger | beancount (hledger/beancount need the matching image tag) +ledger_cli: ledger + +# Upstream defaults are tuned for India (INR / en-IN / April FY) +default_currency: CAD +locale: en-US +time_zone: America/Vancouver +display_precision: 2 +amount_alignment_column: 52 +financial_year_starting_month: 1 +week_starting_day: 0 + +# "yes" requires accounts and commodities to be declared before use +strict: "no" + +budget: + rollover: "yes" + +# Empty = no login. Add users to enable auth; password is sha256 hashed twice: +# echo -n 'ChangeThisPassword' | sha256sum | head -c 64 | sha256sum | head -c 64 +user_accounts: [] +# - username: admin +# password: sha256: + +goals: + retirement: [] + savings: [] + +accounts: [] +commodities: [] +schedule_al: [] +allocation_targets: [] +import_templates: [] +credit_cards: [] diff --git a/paisa/config/sheets/.gitkeep b/paisa/config/sheets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/paisa/demo/.gitignore b/paisa/demo/.gitignore new file mode 100644 index 0000000..8557e18 --- /dev/null +++ b/paisa/demo/.gitignore @@ -0,0 +1,3 @@ +# paisa.db lives in VOL_PATH; ignore it if both paths point at the same folder +paisa.db +paisa.db-* diff --git a/paisa/demo/2025.ledger b/paisa/demo/2025.ledger new file mode 100644 index 0000000..8d3ad6d --- /dev/null +++ b/paisa/demo/2025.ledger @@ -0,0 +1,159 @@ +; 2025 transactions — Demolition Company Ltd. +; Incorporated in British Columbia on 2025/12/01. Fiscal year end: December 31. +; All amounts are fictional demo data. +; +; Share structure: 100 common shares issued at 2,500.00 CAD each (250,000.00 CAD) +; Class A (voting) 66 shares CEO 26, CAO 25, CFO 10, Secretary 5 +; Class B (non-voting) 34 shares 10 family and friends investors +; Investor01-04: 4 shares each, Investor05-10: 3 shares each + +2025/12/01 Share issuance | Class A voting shares to officers + Assets:Bank:Chequing 165,000.00 CAD + Equity:ShareCapital:ClassA:CEO -65,000.00 CAD ; Shares: 26 + Equity:ShareCapital:ClassA:CAO -62,500.00 CAD ; Shares: 25 + Equity:ShareCapital:ClassA:CFO -25,000.00 CAD ; Shares: 10 + Equity:ShareCapital:ClassA:Secretary -12,500.00 CAD ; Shares: 5 + +2025/12/01 Share issuance | Class B non-voting shares to investors + Assets:Bank:Chequing 85,000.00 CAD + Equity:ShareCapital:ClassB:Investor01 -10,000.00 CAD ; Shares: 4 + Equity:ShareCapital:ClassB:Investor02 -10,000.00 CAD ; Shares: 4 + Equity:ShareCapital:ClassB:Investor03 -10,000.00 CAD ; Shares: 4 + Equity:ShareCapital:ClassB:Investor04 -10,000.00 CAD ; Shares: 4 + Equity:ShareCapital:ClassB:Investor05 -7,500.00 CAD ; Shares: 3 + Equity:ShareCapital:ClassB:Investor06 -7,500.00 CAD ; Shares: 3 + Equity:ShareCapital:ClassB:Investor07 -7,500.00 CAD ; Shares: 3 + Equity:ShareCapital:ClassB:Investor08 -7,500.00 CAD ; Shares: 3 + Equity:ShareCapital:ClassB:Investor09 -7,500.00 CAD ; Shares: 3 + Equity:ShareCapital:ClassB:Investor10 -7,500.00 CAD ; Shares: 3 + +2025/12/01 BC Registries | Incorporation filing + Expenses:Incorporation 350.00 CAD + Assets:Bank:Chequing + +2025/12/03 Law firm | Incorporation and shareholder agreement + Expenses:ProfessionalFees 1,500.00 CAD + Assets:GST:InputTaxCredits 75.00 CAD + Assets:Bank:Chequing + +2025/12/05 Lender | Equipment loan advance + Assets:Bank:Chequing 120,000.00 CAD + Liabilities:Loan:Equipment + +; BC PST is not recoverable, so it is added to the cost of the asset +2025/12/08 Equipment dealer | Excavator and skid steer + Assets:Equipment:Machinery 197,950.00 CAD ; 185,000 + PST 12,950 + Assets:GST:InputTaxCredits 9,250.00 CAD + Assets:Bank:Chequing + +2025/12/10 Truck dealer | Dump truck and pickup + Assets:Equipment:Vehicles 66,340.00 CAD ; 62,000 + PST 4,340 + Assets:GST:InputTaxCredits 3,100.00 CAD + Assets:Bank:Chequing + +2025/12/12 Transfer | Excavator replacement fund + Assets:Bank:Savings 20,000.00 CAD + Assets:Bank:Chequing + +2025/12/12 Bank | Petty cash float + Assets:Cash 500.00 CAD + Assets:Bank:Chequing + +2025/12/15 Fuel station | Diesel for first jobs + Expenses:Fuel 320.00 CAD + Assets:GST:InputTaxCredits 16.00 CAD + Liabilities:CreditCard + +2025/12/16 Invoice 1001 | Backyard shed removal + Assets:AccountsReceivable 2,800.00 CAD + Income:Demolition -2,500.00 CAD + Liabilities:GST:Collected -125.00 CAD + Liabilities:PST:Collected -175.00 CAD + +2025/12/16 Customer | E-transfer for invoice 1001 + Assets:Bank:Chequing 2,800.00 CAD + Assets:AccountsReceivable + +2025/12/16 Landfill | Tipping fees, shed job + Expenses:Disposal 600.00 CAD + Assets:GST:InputTaxCredits 30.00 CAD + Assets:Bank:Chequing + +2025/12/19 Invoice 1002 | Kitchen tear-out, Oak Ave + Assets:AccountsReceivable 5,376.00 CAD + Income:Demolition -4,800.00 CAD + Liabilities:GST:Collected -240.00 CAD + Liabilities:PST:Collected -336.00 CAD + +2025/12/22 Fuel station | Diesel and truck fuel + Expenses:Fuel 480.00 CAD + Assets:GST:InputTaxCredits 24.00 CAD + Liabilities:CreditCard + +2025/12/22 Invoice 1003 | Detached garage demolition + Assets:AccountsReceivable 8,400.00 CAD + Income:Demolition -7,500.00 CAD + Liabilities:GST:Collected -375.00 CAD + Liabilities:PST:Collected -525.00 CAD + +2025/12/22 Landfill | Tipping fees, garage job + Expenses:Disposal 1,400.00 CAD + Assets:GST:InputTaxCredits 70.00 CAD + Assets:Bank:Chequing + +2025/12/23 Scrap yard | Steel from garage job + Assets:Bank:Chequing 682.50 CAD + Income:Scrap -650.00 CAD + Liabilities:GST:Collected -32.50 CAD + +2025/12/30 Customer | Payment on invoice 1003 + Assets:Bank:Chequing 8,400.00 CAD + Assets:AccountsReceivable + +2025/12/31 Payroll | December crew wages + Expenses:Wages 6,000.00 CAD + Liabilities:Payroll:CRA -1,500.00 CAD + Assets:Bank:Chequing + +2025/12/31 WorkSafeBC | December premium + Expenses:WorkSafeBC 240.00 CAD + Liabilities:WorkSafeBC + +2025/12/31 Lender | Equipment loan payment + Liabilities:Loan:Equipment 2,780.00 CAD + Expenses:Interest 670.00 CAD + Assets:Bank:Chequing + + +; --------------------------------------------------------------------------- +; Year end: December 31, 2025 (first fiscal year, 1 month) +; +; Income: Demolition 14,800.00 + Scrap 650.00 = 15,450.00 +; Expenses: Incorporation 350, Professional fees 1,500, +; Interest 670, Disposal 2,000, Fuel 800, +; Wages 6,000, WorkSafeBC 240 = 11,560.00 +; Net income before tax = 3,890.00 +; Corporate income tax, 11% small business rate +; (9% federal + 2% BC) = 427.90 +; Net income after tax, to retained earnings = 3,462.10 +; +; Tax is accrued now; the T2 is due 2026/06/30. Invoice 1002 is still +; receivable at year end and is collected in January 2026. +; --------------------------------------------------------------------------- + +2025/12/31 * Year end | Accrue 2025 corporate income tax + Expenses:IncomeTax 427.90 CAD + Liabilities:IncomeTax + +2025/12/31 * Year end | Close 2025 income and expenses ; :closing: + Income:Demolition 14,800.00 CAD + Income:Scrap 650.00 CAD + Expenses:Incorporation -350.00 CAD + Expenses:ProfessionalFees -1,500.00 CAD + Expenses:Interest -670.00 CAD + Expenses:Disposal -2,000.00 CAD + Expenses:Fuel -800.00 CAD + Expenses:Wages -6,000.00 CAD + Expenses:WorkSafeBC -240.00 CAD + Expenses:IncomeTax -427.90 CAD + Equity:RetainedEarnings -3,462.10 CAD diff --git a/paisa/demo/2026.ledger b/paisa/demo/2026.ledger new file mode 100644 index 0000000..ef1e341 --- /dev/null +++ b/paisa/demo/2026.ledger @@ -0,0 +1,106 @@ +; 2026 transactions — Demolition Company Ltd. +; All amounts are fictional demo data. + +2026/01/08 Customer | Payment on invoice 1002 (2025) + Assets:Bank:Chequing 5,376.00 CAD + Assets:AccountsReceivable + +2026/01/05 Fuel station | Diesel for excavator + Expenses:Fuel 850.00 CAD + Assets:GST:InputTaxCredits 42.50 CAD + Liabilities:CreditCard + +2026/01/09 Insurance broker | Annual liability policy + Expenses:Insurance 9,600.00 CAD + Assets:Bank:Chequing + +2026/01/12 City permit office | Demolition permit, 123 Main St + Expenses:Permits 450.00 CAD + Assets:Bank:Chequing + +2026/01/20 Landfill | Tipping fees, Main St job + Expenses:Disposal 3,200.00 CAD + Assets:GST:InputTaxCredits 160.00 CAD + Assets:Bank:Chequing + +2026/01/23 Scrap yard | Steel and copper from Main St job + Assets:Bank:Chequing 2,940.00 CAD + Income:Scrap -2,800.00 CAD + Liabilities:GST:Collected -140.00 CAD + +2026/01/30 Invoice 1004 | Main St house demolition + Assets:AccountsReceivable 31,360.00 CAD + Income:Demolition -28,000.00 CAD + Liabilities:GST:Collected -1,400.00 CAD + Liabilities:PST:Collected -1,960.00 CAD + +2026/01/31 Payroll | January crew wages + Expenses:Wages 18,000.00 CAD + Liabilities:Payroll:CRA -4,500.00 CAD + Assets:Bank:Chequing + +2026/01/31 WorkSafeBC | January premium + Expenses:WorkSafeBC 720.00 CAD + Liabilities:WorkSafeBC + +2026/01/31 Lender | Equipment loan payment + Liabilities:Loan:Equipment 2,800.00 CAD + Expenses:Interest 650.00 CAD + Assets:Bank:Chequing + +2026/02/04 Fuel station | Diesel and truck fuel + Expenses:Fuel 1,100.00 CAD + Assets:GST:InputTaxCredits 55.00 CAD + Liabilities:CreditCard + +2026/02/10 Customer | Payment on invoice 1004 + Assets:Bank:Chequing 31,360.00 CAD + Assets:AccountsReceivable + +2026/02/12 Equipment rental | Skid steer, 5 days + Expenses:EquipmentRental 1,750.00 CAD + Assets:GST:InputTaxCredits 87.50 CAD + Liabilities:CreditCard + +2026/02/14 CRA | Payroll source deductions remittance + Liabilities:Payroll:CRA 4,500.00 CAD + Assets:Bank:Chequing + +2026/02/16 Credit card | Payment + Liabilities:CreditCard 4,725.00 CAD + Assets:Bank:Chequing + +2026/02/20 Repair shop | Hydraulic hose replacement + Expenses:Repairs 980.00 CAD + Assets:GST:InputTaxCredits 49.00 CAD + Assets:Bank:Chequing + +2026/02/26 Invoice 1005 | Commercial interior strip-out + Assets:AccountsReceivable 47,040.00 CAD + Income:Demolition -42,000.00 CAD + Liabilities:GST:Collected -2,100.00 CAD + Liabilities:PST:Collected -2,940.00 CAD + +2026/02/27 Office supplies | Printer and paper + Expenses:Office 210.00 CAD + Assets:GST:InputTaxCredits 10.50 CAD + Assets:Bank:Chequing + +2026/02/28 Payroll | February crew wages + Expenses:Wages 21,000.00 CAD + Liabilities:Payroll:CRA -5,250.00 CAD + Assets:Bank:Chequing + +2026/02/28 WorkSafeBC | Pay Dec 2025 to Feb 2026 premiums + Liabilities:WorkSafeBC 960.00 CAD + Expenses:WorkSafeBC 840.00 CAD + Assets:Bank:Chequing + +2026/02/28 Lender | Equipment loan payment + Liabilities:Loan:Equipment 2,820.00 CAD + Expenses:Interest 630.00 CAD + Assets:Bank:Chequing + +2026/02/28 Transfer | Excavator replacement fund + Assets:Bank:Savings 2,000.00 CAD + Assets:Bank:Chequing diff --git a/paisa/demo/accounts.ledger b/paisa/demo/accounts.ledger new file mode 100644 index 0000000..b70a8b6 --- /dev/null +++ b/paisa/demo/accounts.ledger @@ -0,0 +1,64 @@ +; Chart of accounts for Demolition Company Ltd. + +commodity CAD + format 1,000.00 CAD + +; Assets +account Assets:Bank:Chequing +account Assets:Bank:Savings +account Assets:Cash +account Assets:AccountsReceivable +account Assets:GST:InputTaxCredits +account Assets:Equipment:Machinery +account Assets:Equipment:Vehicles + +; Liabilities +account Liabilities:CreditCard +account Liabilities:Loan:Equipment +account Liabilities:IncomeTax +account Liabilities:GST:Collected +account Liabilities:PST:Collected +account Liabilities:Payroll:CRA +account Liabilities:WorkSafeBC + +; Equity +; Class A: voting common shares (officers) +account Equity:ShareCapital:ClassA:CEO +account Equity:ShareCapital:ClassA:CAO +account Equity:ShareCapital:ClassA:CFO +account Equity:ShareCapital:ClassA:Secretary +; Class B: non-voting common shares (family and friends investors) +account Equity:ShareCapital:ClassB:Investor01 +account Equity:ShareCapital:ClassB:Investor02 +account Equity:ShareCapital:ClassB:Investor03 +account Equity:ShareCapital:ClassB:Investor04 +account Equity:ShareCapital:ClassB:Investor05 +account Equity:ShareCapital:ClassB:Investor06 +account Equity:ShareCapital:ClassB:Investor07 +account Equity:ShareCapital:ClassB:Investor08 +account Equity:ShareCapital:ClassB:Investor09 +account Equity:ShareCapital:ClassB:Investor10 +account Equity:RetainedEarnings + +; Income +account Income:Demolition +account Income:Scrap + +; Expenses +account Expenses:Disposal +account Expenses:EquipmentRental +account Expenses:Fuel +account Expenses:Insurance +account Expenses:IncomeTax +account Expenses:Incorporation +account Expenses:Interest +account Expenses:Office +account Expenses:Permits +account Expenses:ProfessionalFees +account Expenses:Repairs +account Expenses:Wages +account Expenses:WorkSafeBC + +; Metadata tags +tag Shares +tag closing diff --git a/paisa/demo/budget.ledger b/paisa/demo/budget.ledger new file mode 100644 index 0000000..f5dca59 --- /dev/null +++ b/paisa/demo/budget.ledger @@ -0,0 +1,9 @@ +; Monthly budget (Paisa reads periodic transactions as budgets) + +~ Monthly + Expenses:Fuel 3,000.00 CAD + Expenses:Disposal 4,000.00 CAD + Expenses:EquipmentRental 2,500.00 CAD + Expenses:Repairs 1,000.00 CAD + Expenses:Office 300.00 CAD + Assets:Bank:Chequing diff --git a/paisa/demo/main.ledger b/paisa/demo/main.ledger new file mode 100644 index 0000000..9a518f4 --- /dev/null +++ b/paisa/demo/main.ledger @@ -0,0 +1,9 @@ +; Demolition Company Ltd. — demo books (BC, Canada) +; Ledger git repo: ${VOL_PROJECTS:-/data}/paisa, mounted at /root/Documents/paisa +; Incorporated in BC on 2025/12/01; fiscal year end December 31 +; Sales tax: GST 5% (federal) + PST 7% (BC) + +include accounts.ledger +include budget.ledger +include 2025.ledger +include 2026.ledger diff --git a/paisa/demo/paisa.yaml b/paisa/demo/paisa.yaml new file mode 100644 index 0000000..27e5dee --- /dev/null +++ b/paisa/demo/paisa.yaml @@ -0,0 +1,89 @@ +# Paisa config for Demolition Company Ltd. (demo) +# Incorporated in BC 2025/12/01; 100 shares (66 Class A voting, 34 Class B non-voting) +# Git repo: ${VOL_PROJECTS:-/data}/paisa, mounted at /root/Documents/paisa +# Reference: https://paisa.fyi/reference/config/ + +# Relative paths resolve from this file's directory (in git) +journal_path: main.ledger +sheets_directory: sheets + +# Database is not in git: ${VOL_PATH:-/data}/paisa, backed up by restic +db_path: /var/lib/paisa/paisa.db + +# ledger | hledger | beancount (hledger/beancount need the matching image tag) +ledger_cli: ledger + +# Upstream defaults are tuned for India (INR / en-IN / April FY) +default_currency: CAD +locale: en-US +time_zone: America/Vancouver +display_precision: 2 +amount_alignment_column: 52 +# Fiscal year end December 31 +financial_year_starting_month: 1 +week_starting_day: 0 + +# Accounts and commodities are declared in accounts.ledger +strict: "yes" + +budget: + rollover: "yes" + +# Empty = no login. Add users to enable auth; password is sha256 hashed twice: +# echo -n 'ChangeThisPassword' | sha256sum | head -c 64 | sha256sum | head -c 64 +user_accounts: [] +# - username: admin +# password: sha256: + +accounts: + - name: Assets:Bank:Chequing + icon: mdi:bank + - name: Assets:Equipment + icon: mdi:excavator + - name: Equity:ShareCapital + icon: mdi:account-group + - name: Liabilities:CreditCard + icon: mdi:credit-card + - name: Liabilities:Loan:Equipment + icon: mdi:cash-lock + - name: Income:Demolition + icon: mdi:hammer-wrench + - name: Income:Scrap + icon: mdi:recycle + +goals: + retirement: [] + savings: + - name: Excavator Replacement + icon: mdi:excavator + target: 150000 + target_date: "2028-12-31" + rate: 3 + accounts: + - Assets:Bank:Savings + +schedule_al: + - code: bank + accounts: + - Assets:Bank:* + - code: vehicle + accounts: + - Assets:Equipment:Vehicles + - code: cash + accounts: + - Assets:Cash + - code: loan + accounts: + - Liabilities:Loan:* + +allocation_targets: [] +commodities: [] +import_templates: [] +credit_cards: + - account: Liabilities:CreditCard + credit_limit: 25000 + statement_end_day: 15 + due_day: 5 + network: visa + number: "0000" + expiration_date: "2029-12-31" diff --git a/paisa/demo/sheets/tax-estimates.paisa b/paisa/demo/sheets/tax-estimates.paisa new file mode 100644 index 0000000..49283e3 --- /dev/null +++ b/paisa/demo/sheets/tax-estimates.paisa @@ -0,0 +1,37 @@ +// Tax estimates for Demolition Company Ltd. (demo) +// Ledger signs: credits (income, tax collected) are negative, so +// negate them to read as positive numbers. + +// Rates (simplified; confirm current rates with an accountant) +small_business_rate = 11% +gst_rate = 5% + +// Exclude the 2025 closing entry so the real figures show +not_closing = {NOT payee =~ /Close 2025/} +pre_tax = {account =~ /^(Income|Expenses):/ AND NOT account = Expenses:IncomeTax} AND not_closing + +// ---- Fiscal 2025 (December 2025) ---- +fy2025 = {date >= [2025-01-01] AND date < [2026-01-01]} +profit_2025 = -cost(pre_tax AND fy2025) ; 3,890.00 +tax_2025 = profit_2025 * small_business_rate ; 427.90, accrued Dec 31 + +gst_collected_2025 = -cost({account = Liabilities:GST:Collected} AND fy2025) ; 772.50 +gst_itc_2025 = cost({account = Assets:GST:InputTaxCredits} AND fy2025) ; 12,565.00 +gst_net_2025 = gst_collected_2025 - gst_itc_2025 ; -11,792.50 = refund due + +// ---- 2026 year to date ---- +ytd = {date >= [2026-01-01] AND date < [2027-01-01]} +profit_ytd = -cost(pre_tax AND ytd) ; 12,820.00 +tax_ytd = profit_ytd * small_business_rate ; 1,410.20 to set aside + +gst_collected_ytd = -cost({account = Liabilities:GST:Collected} AND ytd) ; 3,640.00 +gst_itc_ytd = cost({account = Assets:GST:InputTaxCredits} AND ytd) ; 404.50 +gst_net_ytd = gst_collected_ytd - gst_itc_ytd ; 3,235.50 owing to CRA +pst_ytd = -cost({account = Liabilities:PST:Collected} AND ytd) ; 4,900.00 owing to BC + +// Cash to hold back for tax this year +set_aside = tax_ytd + gst_net_ytd + pst_ytd ; 9,545.70 + +// Function: GST included in a tax-inclusive receipt total +gst_in(total) = total * gst_rate / (1 + gst_rate) +gst_in(1,050) ; 50.00 diff --git a/paisa/docs/demo.md b/paisa/docs/demo.md new file mode 100644 index 0000000..82ed7fe --- /dev/null +++ b/paisa/docs/demo.md @@ -0,0 +1,158 @@ +# Using the Demo Data + +The `demo/` folder is a complete ledger git repo for a fictional +British Columbia business, **Demolition Company Ltd.** Use it to explore +Paisa before entering your own books. All figures are made up. + +## What's in it + +| File | Purpose | +| ----------------- | ---------------------------------------------------------- | +| `paisa.yaml` | Paisa config: CAD, BC time zone, strict accounts, goals | +| `main.ledger` | Entry point; includes the other files | +| `accounts.ledger` | Chart of accounts and the CAD commodity | +| `budget.ledger` | Monthly budget (periodic transaction) | +| `2025.ledger` | Incorporation, share issue, equipment purchase (Dec 2025) | +| `2026.ledger` | January and February 2026 transactions | +| `sheets/` | Paisa sheet with 2025 and 2026 tax estimates | +| `.gitignore` | Keeps `paisa.db` out of git if both paths share a folder | + +## The company + +- Incorporated in British Columbia on **December 1, 2025** +- Fiscal year end: **December 31** +- 100 common shares issued at $2,500 each ($250,000 share capital) + +| Shareholder | Class | Shares | Paid (CAD) | +| -------------------------- | ------------------- | -----: | ---------: | +| CEO | A (voting) | 26 | 65,000.00 | +| CAO | A (voting) | 25 | 62,500.00 | +| CFO | A (voting) | 10 | 25,000.00 | +| Secretary | A (voting) | 5 | 12,500.00 | +| Investor01 to Investor04 | B (non-voting) | 4 | 10,000.00 | +| Investor05 to Investor10 | B (non-voting) | 3 | 7,500.00 | +| **Total** | | 100 | 250,000.00 | + +Investor rows are per investor (four holders at 4 shares, six at 3). + +The four officers hold 66 voting shares. The CEO's 26 is the largest +single block, but no officer has a majority alone. The ten family and +friends investors hold 34 non-voting Class B shares: they share in the +equity but have no vote. Each holder has an account under +`Equity:ShareCapital:ClassA` or `ClassB`, and each posting carries a +`Shares:` tag with the share count. + +December 2025 covers incorporation and legal fees, the share issue, a +$120,000 equipment loan, machinery and vehicle purchases (BC PST added to +the asset cost, GST claimed as input tax credits), a savings transfer, a +petty cash float, and the first loan payment. + +The crew also did three small jobs that month: + +| Invoice | Job | Before tax | With GST + PST | Paid | +| ------- | ----------------------------- | ---------: | -------------: | ------------- | +| 1001 | Backyard shed removal | 2,500.00 | 2,800.00 | Dec 16, 2025 | +| 1002 | Kitchen tear-out, Oak Ave | 4,800.00 | 5,376.00 | Jan 8, 2026 | +| 1003 | Detached garage demolition | 7,500.00 | 8,400.00 | Dec 30, 2025 | + +Plus scrap steel sales, landfill fees, fuel on the credit card, December +wages, and the WorkSafeBC premium. Invoice 1002 is still owed at year end, +and $840 of fuel is still on the credit card; both are settled in 2026. + +## Year end, December 31, 2025 + +The first fiscal year is one month long. `2025.ledger` ends with two +entries dated December 31: + +1. **Tax accrual:** corporate income tax at the 11% small business rate + (9% federal + 2% BC) on 3,890.00 of profit = 427.90, owed to CRA. +2. **Closing entry**, tagged `:closing:`: moves every 2025 income and + expense balance into `Equity:RetainedEarnings`. + +| 2025 | CAD | +| -------------------------------------- | ---------: | +| Demolition income | 14,800.00 | +| Scrap income | 650.00 | +| **Total income** | **15,450.00** | +| Wages | 6,000.00 | +| Disposal | 2,000.00 | +| Professional fees | 1,500.00 | +| Fuel | 800.00 | +| Interest | 670.00 | +| Incorporation | 350.00 | +| WorkSafeBC | 240.00 | +| **Total expenses** | **11,560.00** | +| Net income before tax | 3,890.00 | +| Corporate income tax (11%) | 427.90 | +| **Net income to retained earnings** | **3,462.10** | + +The T2 return and the tax balance are due June 30, 2026 (six months after +year end). The small business rates are a simplification for the demo; +confirm current rates with an accountant. + +Accountants new to Paisa: read +[Paisa for Accountants](paisa-for-accountants.md#closing-entries) before +relying on Paisa's December 2025 reports. The closing entry makes them show +zero net income for that month. + +## Tax estimates sheet + +`sheets/tax-estimates.paisa` (in Paisa: **More → Sheets**) uses the +ledger to work out profit, the 11% small business tax, net GST, and PST +for fiscal 2025 and 2026 to date, then totals the cash to set aside. It +skips the closing entry so the 2025 figures aren't zero. The expected +result is in a comment on each line, so you can check it against the +ledger. + +## 2026 activity + +The 2026 books cover demolition invoices with GST 5% and +BC PST 7%, scrap metal sales (GST only), expenses with GST input tax +credits, payroll and CRA remittances, WorkSafeBC premiums, an equipment +loan, a credit card, and a savings transfer toward an excavator fund. + +## Where the files go + +| Data | Host path | In git? | +| ----------------------------- | ---------------------------- | ------- | +| `paisa.yaml`, `*.ledger` | `${VOL_PROJECTS:-/data}/paisa` | Yes | +| `paisa.db` (SQLite) | `${VOL_PATH:-/data}/paisa` | No, backed up by restic | + +Both variables default to `/data`, so out of the box both are `/data/paisa`. + +## Load the demo + +1. From the root of this repo, copy the demo into its own folder, keeping + your real books separate: + ```bash + mkdir -p /data/demo + cp -r paisa/demo /data/demo/paisa + ``` +2. In Dockhand, edit the stack's environment variables: + ```env + VOL_PROJECTS=/data/demo + VOL_PATH=/data/demo-db + ``` + The compose file appends `/paisa`, so the ledger comes from + `/data/demo/paisa` and the database is written to `/data/demo-db/paisa`. +3. Redeploy the stack and open http://localhost:7500 (or the host's + address or proxy hostname if you're not on the Docker host). +4. Optional: make it a git repo to try the workflow: + ```bash + cd /data/demo/paisa && git init && git add . && git commit -m "Demo books" + ``` + +## Switch back to your own books + +Set `VOL_PROJECTS` and `VOL_PATH` back to your values (default `/data`) +and redeploy. The demo database in `/data/demo-db` can be deleted at any +time; Paisa rebuilds it from the ledger files. + +## Start your own books + +- **New business:** copy `template/` instead of `demo/`. It has a + chart of accounts for a small BC corporation, `strict: "yes"`, a + sample budget, and a year file with commented examples. Fill in the + `TODO`s in `paisa.yaml`, `main.ledger`, and `accounts.ledger`. +- **Blank slate:** copy `config/`. It holds the same defaults with an + empty journal, `strict: "no"`, and no accounts. diff --git a/paisa/docs/ledger-cheatsheet.md b/paisa/docs/ledger-cheatsheet.md new file mode 100644 index 0000000..b9030da --- /dev/null +++ b/paisa/docs/ledger-cheatsheet.md @@ -0,0 +1,180 @@ +# Ledger Cheatsheet + +Quick reference for the plain-text [ledger](https://ledger-cli.org/) +format that Paisa reads. Full docs: [ledger manual](https://ledger-cli.org/doc/ledger3.html) +and [paisa.fyi](https://paisa.fyi/). + +## Transaction basics + +```ledger +2026/01/05 Payee | Description + Expenses:Fuel 850.00 CAD + Assets:GST:InputTaxCredits 42.50 CAD + Liabilities:CreditCard +``` + +- First line: date, optional status, payee/description. +- Postings are indented (at least 2 spaces or a tab). +- Separate account and amount with **2+ spaces** or a tab. +- Every transaction must balance to zero. One posting may omit its + amount; ledger fills in whatever balances it. +- Positive = debit, negative = credit. See [Account types](#account-types) + for each root's normal balance. + +## Status marks + +```ledger +2026/01/05 * Cleared transaction +2026/01/06 ! Pending transaction +``` + +## Comments + +```ledger +; whole-line comment +2026/01/05 Fuel station ; note on the transaction + Expenses:Fuel 850.00 CAD ; note on a posting + Liabilities:CreditCard +``` + +## Account types + +| Root | Normal balance | Example | +| ------------- | -------------- | ---------------------------- | +| `Assets` | Positive | `Assets:Bank:Chequing` | +| `Liabilities` | Negative | `Liabilities:CreditCard` | +| `Equity` | Negative | `Equity:OpeningBalances` | +| `Income` | Negative | `Income:Demolition` | +| `Expenses` | Positive | `Expenses:Fuel` | + +Use `:` for sub-accounts. Paisa groups its reports by these roots. + +## Declarations + +```ledger +commodity CAD + format 1,000.00 CAD + +account Assets:Bank:Chequing +account Expenses:Fuel +``` + +With `strict: "yes"` in `paisa.yaml`, every account and commodity must be +declared before it is used. + +## Includes + +```ledger +include accounts.ledger +include 2026.ledger +``` + +Ledger itself accepts any path, but Paisa only reads included files in +the same folder as the main journal or a subfolder. + +## Budgets (periodic transactions) + +```ledger +~ Monthly + Expenses:Fuel 3,000.00 CAD + Expenses:Disposal 4,000.00 CAD + Assets:Bank:Chequing +``` + +Paisa reads `~ Monthly` entries as the monthly budget. + +## Common Canadian business patterns + +Sale with GST 5% + BC PST 7%: + +```ledger +2026/01/30 Invoice 1001 | Main St demolition + Assets:AccountsReceivable 31,360.00 CAD + Income:Demolition -28,000.00 CAD + Liabilities:GST:Collected -1,400.00 CAD + Liabilities:PST:Collected -1,960.00 CAD +``` + +Customer pays the invoice: + +```ledger +2026/02/10 Customer | Payment on invoice 1001 + Assets:Bank:Chequing 31,360.00 CAD + Assets:AccountsReceivable +``` + +Purchase with a GST input tax credit: + +```ledger +2026/01/20 Landfill | Tipping fees + Expenses:Disposal 3,200.00 CAD + Assets:GST:InputTaxCredits 160.00 CAD + Assets:Bank:Chequing +``` + +Payroll, with source deductions owed to CRA: + +```ledger +2026/01/31 Payroll | January wages + Expenses:Wages 18,000.00 CAD + Liabilities:Payroll:CRA -4,500.00 CAD + Assets:Bank:Chequing +``` + +Loan payment split into principal and interest: + +```ledger +2026/01/31 Lender | Equipment loan + Liabilities:Loan:Equipment 2,800.00 CAD + Expenses:Interest 650.00 CAD + Assets:Bank:Chequing +``` + +Transfer between your own accounts: + +```ledger +2026/02/28 Transfer | To savings + Assets:Bank:Savings 2,000.00 CAD + Assets:Bank:Chequing +``` + +Opening balances: + +```ledger +2026/01/01 Opening balances + Assets:Bank:Chequing 45,000.00 CAD + Liabilities:Loan:Equipment -120,000.00 CAD + Equity:OpeningBalances +``` + +Year-end closing entry (net loss moved to retained earnings): + +```ledger +2025/12/31 * Year end | Close 2025 income and expenses ; :closing: + Expenses:Incorporation -350.00 CAD + Expenses:ProfessionalFees -1,500.00 CAD + Expenses:Interest -670.00 CAD + Equity:RetainedEarnings 2,520.00 CAD +``` + +Reverse each Income and Expenses balance for the year and post the +difference to `Equity:RetainedEarnings`. A profit shows as a negative +(credit) to retained earnings, and a loss as a positive (debit). + +## CLI commands (inside the container) + +Run them with `docker compose exec paisa sh` (or open the container console in Dockhand), then `cd /root/Documents/paisa`: + +| Command | Shows | +| ----------------------------------------- | ------------------------------ | +| `ledger -f main.ledger bal` | Balances for every account | +| `ledger -f main.ledger bal Expenses` | Expense totals | +| `ledger -f main.ledger reg Assets:Bank` | Running register for the bank | +| `ledger -f main.ledger bal -p "2026/01"` | January 2026 balances | +| `ledger -f main.ledger bal -M Expenses` | Expenses by month | +| `ledger -f main.ledger --strict bal` | Warns about undeclared accounts| +| `ledger -f main.ledger accounts` | List of accounts | +| `ledger -f main.ledger payees` | List of payees | + +After editing files by hand, click **Sync** in Paisa so it rebuilds the +database from the journal. diff --git a/paisa/docs/paisa-for-accountants.md b/paisa/docs/paisa-for-accountants.md new file mode 100644 index 0000000..bd026e5 --- /dev/null +++ b/paisa/docs/paisa-for-accountants.md @@ -0,0 +1,114 @@ +# Paisa for Accountants + +Notes for accountants and bookkeepers who know double-entry accounting +but haven't used Paisa or plain-text accounting before. + +## How Paisa differs from accounting software + +| Traditional software (QuickBooks, Sage) | Paisa + ledger | +| ----------------------------------------- | ------------------------------------------------ | +| Data lives in the program's database | Data lives in plain `.ledger` text files in git | +| Chart of accounts set up in the UI | Accounts declared in `accounts.ledger` | +| Entries made through forms | Entries typed as text (or through Paisa's editor)| +| Period close locks the books | Nothing is locked; git history is the audit trail| +| Closing entries required each year end | Reports are built from any date range on demand | + +The database (`paisa.db`) is only a cache that Paisa rebuilds from the +ledger files. The `.ledger` files are the books of record. + +## Sign convention + +Ledger shows debits as positive and credits as negative. Income, equity, +and liability balances therefore show as negative numbers. This is +expected: `-15,450.00 CAD Income` means a 15,450.00 credit balance. + +## Closing entries + +**Paisa doesn't need closing entries.** It builds the income statement for +whatever period you pick by adding up the Income and Expenses postings in +that range. Income and expense accounts are never "reset"; a report for +2026 simply starts counting on January 1, 2026. + +**What happens if you post one anyway.** The demo includes a closing +entry dated December 31, 2025 (tagged `:closing:`) so the books match what +an accountant expects at year end. Because it reverses every 2025 income +and expense balance on that date, Paisa's reports show: + +- December 2025 (and fiscal 2025) with **zero income, expenses, and net + income**, since the reversal is posted to the same accounts on the + same date +- Correct balance sheet figures, including retained earnings + +**To see the real 2025 figures,** exclude the closing entry with the +ledger CLI: + +```bash +ledger -f main.ledger bal ^Income ^Expenses -p 2025 \ + --limit 'not has_tag("closing")' +``` + +**Choosing an approach:** + +| Approach | Paisa reports | Retained earnings in the books | +| ---------------------------------------- | ------------------ | ---------------------------------- | +| Post a closing entry (the demo) | Fiscal year = zero | Recorded explicitly | +| No closing entry | Correct | Derived (equity + net income) | +| Closing entry in a separate file | Correct in Paisa | Recorded; include file for filing | + +For the third option, put closing entries in a file such as +`closing.ledger` that `main.ledger` doesn't include. Paisa then reports +normally, and you can include it when preparing statements: +`ledger -f main.ledger -f closing.ledger bal`. + +## Accruals and receivables + +Accruals work as normal journal entries. For example, the demo accrues +2025 corporate income tax on December 31 and carries invoice 1002 as a +receivable into January. Paisa shows them in the period they're dated. + +## Sales tax (GST/PST) + +There's no tax engine. GST and PST are separate postings on each entry: + +- GST collected: `Liabilities:GST:Collected` +- GST paid on purchases (input tax credits): `Assets:GST:InputTaxCredits` +- BC PST collected: `Liabilities:PST:Collected` +- BC PST paid on purchases isn't recoverable, so add it to the expense or + asset cost + +Net GST owing for a filing period: + +```bash +ledger -f main.ledger bal GST -p "2025/12/01 to 2026/01/01" +``` + +## Useful reports for year-end work + +| Report | Command | +| ---------------------------- | --------------------------------------------------------------- | +| Trial balance at year end | `ledger -f main.ledger bal -e 2026/01/01` | +| Income statement for 2025 | `ledger -f main.ledger bal ^Income ^Expenses -p 2025 --limit 'not has_tag("closing")'` | +| Balance sheet at year end | `ledger -f main.ledger bal ^Assets ^Liabilities ^Equity -e 2026/01/01` | +| General ledger for an account| `ledger -f main.ledger reg Assets:Bank:Chequing` | +| Check for undeclared accounts| `ledger -f main.ledger --strict --pedantic bal` | + +`-e` is an exclusive end date: `-e 2026/01/01` means "up to and including +December 31, 2025". If you skip closing entries, the trial balance shows +the year's Income and Expenses balances, and the balance sheet above only +balances once net income is added to equity (it isn't in +`Equity:RetainedEarnings` yet). + +## Audit trail + +Every change to the books is a git commit with an author, date, and diff. +To see who changed what: + +```bash +git log -p -- 2025.ledger +``` + +Paisa doesn't lock periods. If you need closed periods protected, use git +practices instead: tag the repo at year end (`git tag fy2025`) and review +any later changes to that year's file. + +See also: [ledger cheatsheet](ledger-cheatsheet.md), [demo data](demo.md). diff --git a/paisa_dev/sample.env b/paisa/sample.env similarity index 84% rename from paisa_dev/sample.env rename to paisa/sample.env index 95fa2bc..a7aa358 100644 --- a/paisa_dev/sample.env +++ b/paisa/sample.env @@ -1,4 +1,5 @@ PAISA_IMAGE=ananthakumaran/paisa:latest PAISA_RESTART=unless-stopped VOL_PATH=/data +VOL_PROJECTS=/data PAISA_PORT=7500 diff --git a/paisa/template/.gitignore b/paisa/template/.gitignore new file mode 100644 index 0000000..8557e18 --- /dev/null +++ b/paisa/template/.gitignore @@ -0,0 +1,3 @@ +# paisa.db lives in VOL_PATH; ignore it if both paths point at the same folder +paisa.db +paisa.db-* diff --git a/paisa/template/2026.ledger b/paisa/template/2026.ledger new file mode 100644 index 0000000..ea5a215 --- /dev/null +++ b/paisa/template/2026.ledger @@ -0,0 +1,20 @@ +; 2026 transactions. Rename this file to your first fiscal year and update +; the include in main.ledger. Uncomment and edit the examples below, or +; delete them. See docs/ledger-cheatsheet.md for more patterns. + +; Founder buys shares when the company is incorporated +; 2026/01/01 Share issuance | Class A shares to founder +; Assets:Bank:Chequing 100.00 CAD +; Equity:ShareCapital:ClassA:Founder -100.00 CAD ; Shares: 100 + +; Incorporation filing paid personally by the founder (company owes it back) +; 2026/01/01 BC Registries | Incorporation filing +; Expenses:Incorporation 350.00 CAD +; Liabilities:ShareholderLoan + +; Sale with GST 5% + BC PST 7% +; 2026/01/15 Invoice 1001 | Customer name +; Assets:AccountsReceivable 1,120.00 CAD +; Income:Sales -1,000.00 CAD +; Liabilities:GST:Collected -50.00 CAD +; Liabilities:PST:Collected -70.00 CAD diff --git a/paisa/template/accounts.ledger b/paisa/template/accounts.ledger new file mode 100644 index 0000000..f9b8895 --- /dev/null +++ b/paisa/template/accounts.ledger @@ -0,0 +1,56 @@ +; Chart of accounts for a small BC corporation. +; Add, rename, or delete accounts to suit the business. With strict: "yes", +; every account used in a transaction must be declared here first. + +commodity CAD + format 1,000.00 CAD + +; Assets +account Assets:Bank:Chequing +account Assets:Bank:Savings +account Assets:Cash +account Assets:AccountsReceivable +account Assets:GST:InputTaxCredits +account Assets:Equipment + +; Liabilities +account Liabilities:AccountsPayable +account Liabilities:CreditCard +account Liabilities:Loan +account Liabilities:ShareholderLoan +account Liabilities:IncomeTax +account Liabilities:GST:Collected +account Liabilities:PST:Collected +account Liabilities:Payroll:CRA +account Liabilities:WorkSafeBC + +; Equity +; One account per shareholder, e.g. Equity:ShareCapital:ClassA:Founder +account Equity:ShareCapital:ClassA:Founder +account Equity:RetainedEarnings +account Equity:OpeningBalances + +; Income +account Income:Sales +account Income:Interest + +; Expenses +account Expenses:Advertising +account Expenses:BankFees +account Expenses:IncomeTax +account Expenses:Incorporation +account Expenses:Insurance +account Expenses:Interest +account Expenses:Office +account Expenses:ProfessionalFees +account Expenses:Rent +account Expenses:Software +account Expenses:Telephone +account Expenses:Travel +account Expenses:Vehicle +account Expenses:Wages +account Expenses:WorkSafeBC + +; Metadata tags +tag Shares +tag closing diff --git a/paisa/template/budget.ledger b/paisa/template/budget.ledger new file mode 100644 index 0000000..5a5a6ab --- /dev/null +++ b/paisa/template/budget.ledger @@ -0,0 +1,9 @@ +; Monthly budget (Paisa reads periodic transactions as budgets) +; TODO: set amounts, or delete the block until you know your costs. + +~ Monthly + Expenses:Rent 1,000.00 CAD + Expenses:Office 200.00 CAD + Expenses:Software 100.00 CAD + Expenses:Telephone 100.00 CAD + Assets:Bank:Chequing diff --git a/paisa/template/main.ledger b/paisa/template/main.ledger new file mode 100644 index 0000000..5d40249 --- /dev/null +++ b/paisa/template/main.ledger @@ -0,0 +1,10 @@ +; TODO: Business Name Ltd. — books (BC, Canada) +; Ledger git repo: ${VOL_PROJECTS:-/data}/paisa, mounted at /root/Documents/paisa +; TODO: incorporation date and fiscal year end +; Sales tax: GST 5% (federal) + PST 7% (BC) +; +; Add a file per fiscal year (2027.ledger, ...) and include it below. + +include accounts.ledger +include budget.ledger +include 2026.ledger diff --git a/paisa/template/paisa.yaml b/paisa/template/paisa.yaml new file mode 100644 index 0000000..46a5486 --- /dev/null +++ b/paisa/template/paisa.yaml @@ -0,0 +1,78 @@ +# Paisa template for a new business — copy this folder into ${VOL_PROJECTS:-/data}/paisa (git repo) +# Fill in the TODOs here and in accounts.ledger, then start recording in the year file. +# Reference: https://paisa.fyi/reference/config/ + +# Relative paths resolve from this file's directory (in git) +journal_path: main.ledger +sheets_directory: sheets + +# Database is not in git: ${VOL_PATH:-/data}/paisa, backed up by restic +db_path: /var/lib/paisa/paisa.db + +# ledger | hledger | beancount (hledger/beancount need the matching image tag) +ledger_cli: ledger + +# Upstream defaults are tuned for India (INR / en-IN / April FY) +default_currency: CAD +locale: en-US +time_zone: America/Vancouver +display_precision: 2 +amount_alignment_column: 52 +# TODO: month your fiscal year starts (1 = January, for a December 31 year end) +financial_year_starting_month: 1 +week_starting_day: 0 + +# Accounts and commodities are declared in accounts.ledger; typos become errors +strict: "yes" + +budget: + rollover: "yes" + +# Empty = no login. Add users to enable auth; password is sha256 hashed twice: +# echo -n 'ChangeThisPassword' | sha256sum | head -c 64 | sha256sum | head -c 64 +user_accounts: [] +# - username: admin +# password: sha256: + +accounts: + - name: Assets:Bank:Chequing + icon: mdi:bank + - name: Equity:ShareCapital + icon: mdi:account-group + - name: Liabilities:CreditCard + icon: mdi:credit-card + - name: Income:Sales + icon: mdi:cash-register + +goals: + retirement: [] + savings: [] +# - name: Emergency Fund +# icon: mdi:piggy-bank +# target: 10000 +# target_date: "2027-12-31" +# accounts: +# - Assets:Bank:Savings + +schedule_al: + - code: bank + accounts: + - Assets:Bank:* + - code: cash + accounts: + - Assets:Cash + - code: loan + accounts: + - Liabilities:Loan:* + +allocation_targets: [] +commodities: [] +import_templates: [] +credit_cards: [] +# - account: Liabilities:CreditCard +# credit_limit: 10000 +# statement_end_day: 15 +# due_day: 5 +# network: visa +# number: "0000" +# expiration_date: "2029-12-31" diff --git a/paisa/template/sheets/.gitkeep b/paisa/template/sheets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/paisa_dev/README.md b/paisa_dev/README.md deleted file mode 100644 index 1b8796b..0000000 --- a/paisa_dev/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Paisa - -## Overview - -Paisa is a self-hosted personal finance manager built on top of the -plain-text `ledger` accounting format, with a web UI for dashboards, -budgets, and transaction management. - -## Project Details - -- **Project Repository:** [github.com/ananthakumaran/paisa](https://github.com/ananthakumaran/paisa) -- **Container Image:** [Docker Hub](https://hub.docker.com/r/ananthakumaran/paisa) -- **Documentation:** [paisa.fyi](https://paisa.fyi/) -- **Reverse Proxy Port:** `7500` - -## Getting Started - -1. Start the container: `docker compose up -d` -2. Open http://localhost:7500 in your browser -3. Configure your ledger journal and accounts via the web UI - -## Environment Variable Notes - - PAISA_IMAGE – container image (default ananthakumaran/paisa:latest) - PAISA_RESTART – restart policy (default unless-stopped) - VOL_PATH – host base path for volumes (default /data) - PAISA_PORT – host port for the web UI (default 7500) - -## Volume Notes - -- `/root/Documents/paisa` — ledger journal, config, and database; - stored at `${VOL_PATH:-/data}/paisa` on the host - -## Network Notes - -Requires proxy network - -## Docker Run - -```bash -docker run -d \ - --name=paisa \ - -p 7500:7500 \ - -v /data/paisa:/root/Documents/paisa \ - ananthakumaran/paisa:latest -``` - -## Additional Notes / Gotchas - -- This is a `_dev` stack — experimental, not yet production-ready. -- The container runs as root and stores everything under - `/root/Documents/paisa`; back up that directory to preserve your - ledger data. - -## Dockhand Stack, Deploy from Git - -- Cookbooks Repository -- stackname: paisa_dev -- Compose file path: paisa_dev/compose.yaml -- Additional env file (optional): paisa_dev/sample.env - -Then "Load" paisa_dev/sample.env into the Environment variables in dockhand. - -Create the Stack