epogrebnyak / abacus

A minimal yet valid double-entry accounting system in Python or command line.
https://epogrebnyak.github.io/abacus/
GNU General Public License v3.0
57 stars 4 forks source link

review and simplify CLI #51

Closed epogrebnyak closed 11 months ago

epogrebnyak commented 1 year ago
bx init .   
cat ./abacus.json # {"chart": "chart.json", "entries": "entries.json"}
bx chart add --cash cash 
bx chart add --asset ar prepaid_rent goods
bx chart add --equity equity
bx chart set --retained-earnings re
bx chart add --liability ap dividend_due
bx chart add --income sales
bx chart offset sales refunds
bx chart add --expense cogs sga
bx chart name ar "Accounts recievable"
bx chart name ap "Accounts payable"
bx chart name cogs "Cost of goods sold"
bx chart name sga "Selling, general and adm. expenses"
bx chart show [--json] [--validate]
echo {} > start_balances.json
bx ledger start start_balances.json 
bx ledger post cash equity 500 --title "Initial investment"
bx ledger post prepaid_rent cash 120 "--title Prepay storage facility for 12 months"
bx ledger post goods cash 380 --title "Acquire goods for resale"
bx ledger post cogs goods 250 --title "Register cost of sales on contract 2023-1"
bx ledger post ar sales 360 --title "Register sales on contract 2023-1" 
bx ledger post cash ar 300 --title "Accept cash"
bx ledger post sga cash 60 --title "Pay sales team"
bx ledger show (--all | --last | --recent n | --date range | --id hash) [--csv]
bx trial-balance [--json]
bx ledger adjust sga prepaid_rent 80 --title "Expense 8 months of storage rent"
bx ledger close
bx ledger post-close re dividend_due 20
bx account re --assert-balance 0
bx report --balance-sheet
bx report --income-statement
bx ledger balances --json > end_balances.json   
epogrebnyak commented 1 year ago

Current interface:

  bx chart init
  bx chart add --assets <account_names>... 
  bx chart add --capital <account_names>... 
  bx chart add --liabilities <account_names>... 
  bx chart add --income <account_names>...
  bx chart add --expenses <account_names>... 
  bx chart offset <account_name> <contra_account_names>...
  bx chart adds --asset     <account_name> [--title <title>] [--code <code>] 
  bx chart adds --capital   <account_name> [--title <title>] [--code <code>]
  bx chart adds --liability <account_name> [--title <title>] [--code <code>]
  bx chart adds --income    <account_name> [--title <title>] [--code <code>]
  bx chart adds --expense   <account_name> [--title <title>] [--code <code>]
  bx chart set --retained-earnings <account_name>
  bx chart name <account_name> <title>
  bx chart code <account_name> <code>
  bx chart alias --operation <name> --debit <debit> --credit <credit> [--requires <requires>]
  bx chart show [--json]
  bx chart erase --force
  bx ledger open [--start <file>]
  bx ledger post <debit> <credit> <amount>
  bx ledger post --operation (<operations> <amounts>)...
  bx ledger close
  bx ledger show
  bx ledger erase --force
  bx report --income-statement [--json | --rich]
  bx report --balance-sheet [--json | --rich]
  bx accounts show --trial-balance
  bx accounts show <account_name> [--assert <balance> [--silent]]
  bx accounts show --balances [--nonzero]
epogrebnyak commented 1 year ago
  bx chart add --asset     <account_name> [--title <title>] [--code <code>] 
  bx chart add --capital   <account_name> [--title <title>] [--code <code>]
  bx chart add --liability <account_name> [--title <title>] [--code <code>]
  bx chart add --income    <account_name> [--title <title>] [--code <code>]
  bx chart add --expense   <account_name> [--title <title>] [--code <code>]
epogrebnyak commented 1 year ago
  bx chart add --asset  --bulk <account_names>...
  bx chart add --capital --bulk <account_names>...
  bx chart add --liability --bulk <account_names>...
  bx chart add --income --bulk <account_names>...
  bx chart add --expense --bulk <account_names>...