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

cli: new syntax for account definition, `bx operation` command, `[ledger] do` and `report --all` #43

Closed epogrebnyak closed 1 year ago

epogrebnyak commented 1 year ago
bx chart set --asset cash 
bx chart set --asset ar --title "Accounts receivable" --offset bad_debt
bx chart name bad_debt --title "Allowance for bad debts"
bx chart set --asset inventory
bx chart set --expense cogs --title "Cost of goods sold" 
bx chart set --expense sga --title "Selling expenses"
bx chart set --capital equity 
bx chart set --retained-earnings re
bx chart set --income sales --offset discounts voids
bx chart show

bx operation set capitalize --debit cash --credit equity --title "shareholder funds"
bx operation set acquire-goods --debit inventory --credit cash --title "acquired goods for cash"
bx operation set invoice --debit ar --credit sales --title "invoice" --requires cost
bx operation set cost --debit cogs --credit inventory --title "cost of sales"
bx operation set discount --debit discounts --credit ar --title "provided discount"
bx operation set accept-payment --debit cash --credit ar --title "accepted cash payment"
bx operation set salary --debit sga --credit cash --title "paid salary in cash"
bx operation show

bx start
bx post capitalize 1000 --title "Initial investment"
bx post acquire-goods 500 --title "Purchased goods for resale"
bx post invoice 440 discount 40 cost 250 --title "Sales contract #2023-1"
bx post accept-payment 200 --title "Cash payment on sales contract #2023-1"
bx post invoice 300 cost 120 accept-payment 300 --title "Sales contract #2023-2"
bx post salary 150 --title "Sales manager remuneration"
bx post --debit bad_debt --credit ar --amount 100 --title "Unrecoverable debt on contract #2023-1"
bx close
bx list

bx report --all
epogrebnyak commented 1 year ago
bx chart set --asset <account_name> [--title <title>] [--code <code>] [--offset <contra_account_names>...]
bx chart set --expense <account_name> [--title <title>] [--code <code>] [--offset <contra_account_names>...]
bx chart set --capital <account_name> [--title <title>] [--code <code>] [--offset <contra_account_names>...]
bx chart set --retained-earnings <account_name>
bx chart set --liability <account_name> [--title <title>] [--code <code>] [--offset <contra_account_names>...]
bx chart set --income <account_name> [--title <title>] [--code <code>] [--offset <contra_account_names>...]
bx chart name <account_name> [--title <title>] [--code <code>] 
bx chart show
bx operation set <operation> --debit <dr_account> --credit <cr_account> [--title <title>] [--requires <matched_operation>]
bx operation show
bx start
bx post (<operation> <amount>)... [--title <title>]
bx post --debit <dr_account> --credit <cr_account> --amount <amount> [--title <title>]
bx close
bx list
bx report --all