{"id":24289290,"url":"https://github.com/rla/placcounting","last_synced_at":"2026-05-26T23:02:31.103Z","repository":{"id":7528785,"uuid":"8880308","full_name":"rla/placcounting","owner":"rla","description":"Simple double-entry financial journal","archived":false,"fork":false,"pushed_at":"2013-03-19T14:19:28.000Z","size":112,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T10:58:35.077Z","etag":null,"topics":["accounting","bookkeeping","ledger","swi-prolog","yaml"],"latest_commit_sha":null,"homepage":null,"language":"Prolog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-19T14:18:50.000Z","updated_at":"2019-12-17T07:45:26.000Z","dependencies_parsed_at":"2022-09-03T06:42:15.958Z","dependency_job_id":null,"html_url":"https://github.com/rla/placcounting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Fplaccounting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Fplaccounting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Fplaccounting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Fplaccounting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rla","download_url":"https://codeload.github.com/rla/placcounting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242128906,"owners_count":20076276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accounting","bookkeeping","ledger","swi-prolog","yaml"],"created_at":"2025-01-16T10:51:49.926Z","updated_at":"2026-05-26T23:02:26.083Z","avatar_url":"https://github.com/rla.png","language":"Prolog","funding_links":[],"categories":[],"sub_categories":[],"readme":"placcounting\n============\n\nSimple double-entry bookkeeping console application written in Prolog. It is currently\ncompatible and tested with the [Swi-Prolog](http://www.swi-prolog.org/). The program\nhelps to prepare montly and annual reports and serves as a financial journal. It does\nnot support asset or inventory management, client handling or invoicing. Only single\ncurrency is supported. For multiple currencies, conversion has to be done externally,\nand the profit or loss from the conversion can then be logged into the separate account.\n\nInstallation\n------------\n\nThe application requires Swi-Prolog and [Prolog-yamltiny](https://github.com/rla/prolog-yamltiny).\nTo install placcounting, run `make install`. The installation location depends on the install\nprefix of the Swi-Prolog and for the system-wide install it requires the root privileges.\n\nUsage\n-----\n\nRun `placcounting \u003cdirectory\u003e` where the directory contains suitable YAML files. Files\naccounts.yml, reports.yml and settings.yml are considered to be special, all other\nfiles ending in *.yml are assumed to contain financial transactions. The file accounts.yml contains\nthe list of accounts in the following format:\n\n    code: 1\n    name: Cash\n    type: asset\n    ---\n    code: 2\n    name: Bank\n    type: asset\n    ---\n    code: 3\n    name: Sales\n    type: income\n    ---\n    code: 4\n    name: Expenses\n    type: expense\n    ---\n    code: 5\n    name: Accounts payable\n    type: liability\n    ---\n    code: 6\n    name: Owner's equity\n    type: equity\n\nThe code field assigns an unique account identifier to each account. It can be arbitrary (does\nnot have to be a number, could be some kind of a semantic tag). The account type can be one of\nthese: asset, liability, income, expense, equity. The type currently sets on which side of\nthe [Accounting equation](http://en.wikipedia.org/wiki/Accounting_equation) the account resides.\nThis is needed to calculate account balances.\n\nFiles reports.yml and settings.yml are reserved but not used in the current version. All other *.yml\nfiles in the directory are assumed to contain transactions in the following format:\n\n    date: 2012-01-01\n    desc: Opening balances\n    lines:\n      - debit: 2\n        credit: 6\n        sum: 2556.00\n    ---\n    date: 2012-02-04\n    desc: VPS hosting invoice #123, January\n    lines:\n      - debit: 4\n        credit: 5\n        sum: 14.0\n    ---\n    date: 2012-02-05\n    desc: Paying VPS hosting invoice #123\n    lines:\n      - debit: 5\n        credit: 2\n        sum: 14.0\n      - debit: 4\n        credit: 2\n        sum: 0.38\n        desc: Bank's fee\n\nDates are in the Date-Only ISO8601 format. Under lines, multiple items might be\npresent. An item can have its own description. No special constructs are used for\nopening or closing accounts, all of that can be and should be done with normal\ntransactions.\n\nThis example is also included in the example folder. Running `placcounting /path/to/example`\nwill bring up the Prolog console with the following output:\n\n    cleaning database\n    reading example/accounts.yml\n    asserting 6 accounts\n    reading example/all.yml\n    asserting 3 transactions\n    total accounts: 6\n    total transactions: 3\n    total lines: 4\n    accounting system started.\n\nRunning a query `report('2')` for the bank account will bring up the following output:\n\n    ?- report('2').\n    2012-01-01 2 6 2556.00 Opening balances\n    2012-02-05 4 2 0.38 Paying VPS hosting invoice (Bank's fee)\n    2012-02-05 5 2 14.00 Paying VPS hosting invoice\n    Debit: 2556.00\n    Credit: 14.38\n    Balance: 2541.62\n\nQuoted account code '2' has to be used since account codes are not numbers\nbut just Prolog atoms.\n\nQueries\n-------\n\nFor more detailed info, please see thr documentation for the exported predicates in\nsource files src/analysis.pl and src/reporting.pl.\n\n`read_all(Directory)`\n\nLoads all *.yml files in the directory. Previously loaded\ndata is cleared from the memory. Running the placcounting command will\nexecute this automatically.\n\n`report(Account)`\n\nOutputs transaction lines for the given account. Reports total credit, total debit and balance.\n\n`balance(Account, Balance)`\n\nCalculates the balance for the given account.\n\n`balance(Account, Month, Balance)`\n\nCalculates the balance for the given account for the given month. This only\nuses transactions done at the given month. It does not accumulate the\nprevious months. Month is specified as an integer. January is 1, February is 2 and so on.\n\n`reread`\n\nRe-reads currently loaded database files.\n\nDebugging\n---------\n\nWhen you get the following error:\n\n    ERROR: Unknown message: account_does_not_exist(6)\n\nThen you have a transaction that uses an account that is not specified in\nthe accounts.yml file.\n\nTODO\n----\n\n* Better and more reporting options.\n* Report splitting by debit or credit source - cash flow reports need this.\n* Reports should also allow account types not only specific accounts.\n* Document how to use it as a Prolog library.\n* Unit tests.\n\nLicense\n-------\n\n    Copyright (c) 2013 Raivo Laanemets\n\n    Permission is hereby granted, free of charge, to any person\n    obtaining a copy of this software and associated documentation\n    files (the \"Software\"), to deal in the Software without restriction,\n    including without limitation the rights to use, copy, modify, merge,\n    publish, distribute, sublicense, and/or sell copies of the Software,\n    and to permit persons to whom the Software is furnished to do so,\n    subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included\n    in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n    IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frla%2Fplaccounting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frla%2Fplaccounting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frla%2Fplaccounting/lists"}