From 8be8a8c3aa57c7672f00144ee51ab7dab0da5aa5 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Tue, 21 Sep 2021 16:16:47 +0800 Subject: [PATCH] Set option name_income for top-level account Revenue Fixes #255 --- .aspell.en.pws | 4 +++- bin/ledger2beancount | 2 ++ docs/authors.md | 1 + docs/changelog.md | 1 + tests/accounts.beancount | 6 ++++-- tests/accounts.header | 1 - 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.aspell.en.pws b/.aspell.en.pws index 0e9c30b4..33803dc3 100644 --- a/.aspell.en.pws +++ b/.aspell.en.pws @@ -1,4 +1,4 @@ -personal_ws-1.1 en 78 utf-8 +personal_ws-1.1 en 80 utf-8 AUR Alen Baier @@ -13,10 +13,12 @@ Goncharov Homebrew JPY Jelmer +Kaleem Kirill Kurup MERCHANTABILITY Michlmayr +Mohsin NetBSD Nicolodi PWD diff --git a/bin/ledger2beancount b/bin/ledger2beancount index d2d97cba..b1d9fbaa 100755 --- a/bin/ledger2beancount +++ b/bin/ledger2beancount @@ -177,6 +177,8 @@ my %root_mappings = ( qr/Καθαρή θέση/ => "equity", qr/Έσοδα/ => "income", qr/Έξοδα/ => "expenses", + # en - English + qr/Revenues?/ => "income", # es - Spanish qr/Activos?/ => "assets", qr/Pasivos?/ => "liabilities", diff --git a/docs/authors.md b/docs/authors.md index b7750177..a9de2eb2 100644 --- a/docs/authors.md +++ b/docs/authors.md @@ -24,6 +24,7 @@ We have also had contributions and input from: * Kirill Goncharov (bug reports; package for Arch Linux) * Marin Bernard (bug reports) * Martin Blais (help with compatibility with beancount) +* Mohsin Kaleem (bug reports) * Remco Rijnders (feedback) * Simon Michael (bug reports; fixes; help with compatibility with hledger) * Taylor R. Campbell (package for pkgsrc) diff --git a/docs/changelog.md b/docs/changelog.md index 9b88563e..a4db95be 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,7 @@ * Improve pre-processing example in documentation * Add support for amounts with plus sign +* Set option `name_income` for top-level account `Revenue` ## 2.6 (2021-04-15) diff --git a/tests/accounts.beancount b/tests/accounts.beancount index 884f7281..ffdfda73 100644 --- a/tests/accounts.beancount +++ b/tests/accounts.beancount @@ -4,7 +4,7 @@ ; - Skipped second account declaration for Expenses:Travel (old Expenses:Bar:Travel) ; - Virtual posting in parentheses ignored ; - Account Revenue not allowed; it needs a sub-account, e.g. Revenue:Subaccount -; - Non-standard root name Revenue used; please set beancount options name_* +; - Non-standard root name Revenue used; setting beancount option name_income ; - Skipped second account declaration for Expenses:Food (old Expenses:Food) ; - Account Accrued:Accounts Payable:Baz renamed to Liabilities:Accounts-Payable:Baz ; - Account Assets:Bank Debian)bar renamed to Assets:Bank-Debian-bar @@ -28,9 +28,11 @@ ;---------------------------------------------------------------------- -option "title" "Test account names" option "name_income" "Revenue" + +option "title" "Test account names" + ; Beancount: 2.1.0 ; SPDX-FileCopyrightText: © 2018 Martin Michlmayr diff --git a/tests/accounts.header b/tests/accounts.header index 9a4883a1..d1e5ddac 100644 --- a/tests/accounts.header +++ b/tests/accounts.header @@ -1,4 +1,3 @@ option "title" "Test account names" -option "name_income" "Revenue"