Merge branch 'date_formatting'

This commit is contained in:
Simon Michael 2020-01-07 16:18:47 -08:00
commit 41f00e42f9
60 changed files with 490 additions and 490 deletions

View File

@ -115,7 +115,7 @@ instance Show DateSpan where
-- show s = "DateSpan \"" ++ showDateSpan s ++ "\"" -- quotes to help pretty-show
showDate :: Day -> String
showDate = formatTime defaultTimeLocale "%0C%y/%m/%d"
showDate = show
-- | Render a datespan as a display string, abbreviating into a
-- compact form if possible.

View File

@ -154,16 +154,16 @@ isStandardPeriod = isStandardPeriod' . simplifyPeriod
-- | Render a period as a compact display string suitable for user output.
--
-- >>> showPeriod (WeekPeriod (fromGregorian 2016 7 25))
-- "2016/07/25w30"
showPeriod (DayPeriod b) = formatTime defaultTimeLocale "%0C%y/%m/%d" b -- DATE
showPeriod (WeekPeriod b) = formatTime defaultTimeLocale "%0C%y/%m/%dw%V" b -- STARTDATEwYEARWEEK
-- "2016-07-25w30"
showPeriod (DayPeriod b) = formatTime defaultTimeLocale "%F" b -- DATE
showPeriod (WeekPeriod b) = formatTime defaultTimeLocale "%Fw%V" b -- STARTDATEwYEARWEEK
showPeriod (MonthPeriod y m) = printf "%04d/%02d" y m -- YYYY/MM
showPeriod (QuarterPeriod y q) = printf "%04dq%d" y q -- YYYYqN
showPeriod (YearPeriod y) = printf "%04d" y -- YYYY
showPeriod (PeriodBetween b e) = formatTime defaultTimeLocale "%0C%y/%m/%d" b
++ formatTime defaultTimeLocale "-%0C%y/%m/%d" (addDays (-1) e) -- STARTDATE-INCLUSIVEENDDATE
showPeriod (PeriodFrom b) = formatTime defaultTimeLocale "%0C%y/%m/%d-" b -- STARTDATE-
showPeriod (PeriodTo e) = formatTime defaultTimeLocale "-%0C%y/%m/%d" (addDays (-1) e) -- -INCLUSIVEENDDATE
showPeriod (PeriodBetween b e) = formatTime defaultTimeLocale "%F" b
++ formatTime defaultTimeLocale "-%F" (addDays (-1) e) -- STARTDATE-INCLUSIVEENDDATE
showPeriod (PeriodFrom b) = formatTime defaultTimeLocale "%F-" b -- STARTDATE-
showPeriod (PeriodTo e) = formatTime defaultTimeLocale "-%F" (addDays (-1) e) -- -INCLUSIVEENDDATE
showPeriod PeriodAll = "-"
-- | Like showPeriod, but if it's a month period show just

View File

@ -638,7 +638,7 @@ tests_Transaction =
Right nulltransaction{tpostings = ["a" `post` usd (-5), "b" `post` (eur 3 @@ usd 4), "c" `post` usd 1]}
, tests "showTransaction" [
test "null transaction" $ showTransaction nulltransaction @?= "0000/01/01\n\n"
test "null transaction" $ showTransaction nulltransaction @?= "0000-01-01\n\n"
, test "non-null transaction" $ showTransaction
nulltransaction
{ tdate = parsedate "2012/05/14"
@ -660,7 +660,7 @@ tests_Transaction =
]
} @?=
unlines
[ "2012/05/14=2012/05/15 (code) desc ; tcomment1"
[ "2012-05-14=2012-05-15 (code) desc ; tcomment1"
, " ; tcomment2"
, " * a $1.00"
, " ; pcomment2"
@ -686,7 +686,7 @@ tests_Transaction =
]
in showTransaction t) @?=
(unlines
[ "2007/01/28 coopportunity"
[ "2007-01-28 coopportunity"
, " expenses:food:groceries $47.18"
, " assets:checking $-47.18"
, ""
@ -709,7 +709,7 @@ tests_Transaction =
, posting {paccount = "assets:checking", pamount = Mixed [usd (-47.19)]}
])) @?=
(unlines
[ "2007/01/28 coopportunity"
[ "2007-01-28 coopportunity"
, " expenses:food:groceries $47.18"
, " assets:checking $-47.19"
, ""
@ -729,7 +729,7 @@ tests_Transaction =
""
[]
[posting {paccount = "expenses:food:groceries", pamount = missingmixedamt}])) @?=
(unlines ["2007/01/28 coopportunity", " expenses:food:groceries", ""])
(unlines ["2007-01-28 coopportunity", " expenses:food:groceries", ""])
, test "show a transaction with a priced commodityless amount" $
(showTransaction
(txnTieKnot $
@ -747,7 +747,7 @@ tests_Transaction =
[ posting {paccount = "a", pamount = Mixed [num 1 `at` (usd 2 `withPrecision` 0)]}
, posting {paccount = "b", pamount = missingmixedamt}
])) @?=
(unlines ["2010/01/01 x", " a 1 @ $2", " b", ""])
(unlines ["2010-01-01 x", " a 1 @ $2", " b", ""])
]
, tests "balanceTransaction" [
test "detect unbalanced entry, sign error" $

View File

@ -30,7 +30,7 @@ import Data.Maybe
import Data.Text (Text)
import qualified Data.Text as T
import Data.Time.Calendar (Day)
import Data.Time.Format (formatTime, defaultTimeLocale)
import Data.Time.Format (formatTime, defaultTimeLocale, iso8601DateFormat)
import Data.Typeable (Typeable)
import Safe (headDef, headMay, atMay)
import System.Console.CmdArgs.Explicit
@ -164,7 +164,8 @@ confirmedTransactionWizard prevInput es@EntryState{..} stack@(currentStage : _)
{ esArgs = drop 1 esArgs
, esDefDate = date
}
dateAndCodeString = formatTime defaultTimeLocale "%Y/%m/%d" date ++ (if T.null code then "" else " (" ++ T.unpack code ++ ")")
dateAndCodeString = formatTime defaultTimeLocale yyyymmddFormat date ++ (if T.null code then "" else " (" ++ T.unpack code ++ ")")
yyyymmddFormat = iso8601DateFormat Nothing
confirmedTransactionWizard prevInput{prevDateAndCode=Just dateAndCodeString} es' (EnterDescAndComment (date, code) : stack)
Nothing ->
confirmedTransactionWizard prevInput es stack

View File

@ -200,7 +200,7 @@ tests_Register = tests "Register" [
(postingsReportAsText defcliopts $ postingsReport opts (queryFromOpts (parsedate "2008/11/26") opts) j)
@?=
unlines
["2009/01/01 медвежья шкура расходы:покупки 100 100"
["2009-01-01 медвежья шкура расходы:покупки 100 100"
," актив:наличные -100 0"]
]

View File

@ -18,7 +18,6 @@ import Data.Maybe
import qualified Data.Text as TS
import qualified Data.Text.Lazy as TL
import Data.Time.Calendar
import Data.Time.Format
import System.Console.CmdArgs.Explicit as C
import Hledger.Read.CsvReader (CSV, printCSV)
import Lucid as L hiding (value_)
@ -250,7 +249,7 @@ showEndDates es = case es of
[e] -> showdate e
[] -> ""
where
showdate = formatTime defaultTimeLocale "%0C%y/%m/%d"
showdate = show
-- | Run one subreport for a compound balance command in multi-column mode.
-- This returns a MultiBalanceReport.

View File

@ -61,12 +61,12 @@ alias /A (.)/=\1
c
$ hledger -f- print
2011/01/01
2011-01-01
b b 1
b b 2
c
2011/01/01
2011-01-01
b 1
b 2
c
@ -85,7 +85,7 @@ $ hledger -f- print
c
$ hledger -f- print --alias '/A (.)/=a' --alias /a/=b
2011/01/01
2011-01-01
b 1
b 2
c
@ -104,7 +104,7 @@ alias E=F
[x:a:x]
$ hledger -f- print --alias /a/=A --alias /B/=C --alias /B/=D --alias /C/=D
2011/01/01
2011-01-01
[E:x] 1
[x:A:x]
@ -144,7 +144,7 @@ alias a = b
a 1
b -1
$ hledger -f- reg '^a$' '^b$'
2017/01/01 b 1 1
2017-01-01 b 1 1
b -1 0
# recursive aliases https://github.com/simonmichael/hledger/issues/1055
@ -155,7 +155,7 @@ $ hledger -f- reg '^a$' '^b$'
(one) 1
$ hledger -f- --alias "one=two" --alias "two=three" print
2000/01/01
2000-01-01
(three) 1
>=0
@ -169,7 +169,7 @@ alias one = two
(one) 1
$ hledger -f- print
2000/01/01
2000-01-01
(three) 1
>=0
@ -182,7 +182,7 @@ alias one = two
(one) 1
$ hledger -f- print
2000/01/01
2000-01-01
(two) 1
>=0
@ -193,7 +193,7 @@ $ hledger -f- print
(one) 1
$ hledger -f- --alias "/one/=two" --alias "/two/=three" print
2000/01/01
2000-01-01
(three) 1
>=0
@ -207,7 +207,7 @@ alias /one/ = two
(one) 1
$ hledger -f- print
2000/01/01
2000-01-01
(three) 1
>=0
@ -220,7 +220,7 @@ alias /one/ = two
(one) 1
$ hledger -f- print
2000/01/01
2000-01-01
(two) 1
>=0

View File

@ -7,7 +7,7 @@ hledger -f - print --explicit
b USD 1 ; a dollar
c ; a euro and a dollar
>>>
2010/01/01
2010-01-01
a EUR 1 ; a euro
b USD 1 ; a dollar
c EUR -1 ; a euro and a dollar
@ -23,7 +23,7 @@ hledger -f - register
b USD 1 ; a dollar
c ; a euro and a dollar
>>>
2010/01/01 a EUR 1 EUR 1
2010-01-01 a EUR 1 EUR 1
b USD 1 EUR 1
USD 1
c EUR -1
@ -53,7 +53,7 @@ hledger -f- print --explicit --empty
a $0.00 @ 3EUR
b
>>>
2010/03/01 x
2010-03-01 x
a 0 @ 3EUR
b 0
@ -93,14 +93,14 @@ D 1000,00€
# b USD 1 ; a dollar
# c ; a euro and a dollar
# >>>
# 2010/01/01
# 2010-01-01
# a EUR 1 @ USD 1.1 ; a euro
# b USD 1 ; a dollar
# EUR -1 @ USD 1.1
# c USD -1 ; a euro and a dollar
#
##
# 2010/01/01
# 2010-01-01
# a EUR 1 @ USD 1.1 ; a euro
# b USD 1.0 ; a dollar
# c USD -2.1 ; a euro and a dollar
@ -115,7 +115,7 @@ D 1000,00€
# b USD 1 ; a dollar
# c ; a euro and a dollar
# >>>
# 2010/01/01 a EUR 1 EUR 1
# 2010-01-01 a EUR 1 EUR 1
# EUR 1
# b USD 1.0 USD 1.0
# EUR 1

View File

@ -4,7 +4,7 @@ hledger -f balance-multicol.journal bal -MEH --no-total date:2013/1 --tree --fla
>>>
Ending balances (historical) in 2013/01:
|| 2013/01/31
|| 2013-01-31
=================++============
assets:checking || 10
>>>= 0
@ -14,7 +14,7 @@ hledger -f balance-multicol.journal bal -MEH --no-total date:2013/1 --flat --tre
>>>
Ending balances (historical) in 2013/01:
|| 2013/01/31
|| 2013-01-31
============++============
assets || 10
checking || 10

View File

@ -36,9 +36,9 @@
assets:cash
$ hledger -f- bal --budget -DTN
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03 Total
|| 2016-12-01 2016-12-02 2016-12-03 Total
==================++========================================================================================
assets || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25] $-75 [ 100% of $-75]
assets:cash || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25] $-75 [ 100% of $-75]
@ -82,9 +82,9 @@ account expenses:leisure
assets:cash
$ hledger -f- bal --budget -DTN
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03 Total
|| 2016-12-01 2016-12-02 2016-12-03 Total
==================++========================================================================================
expenses || $10 [ 40% of $25] $14 [ 56% of $25] $51 [ 204% of $25] $75 [ 100% of $75]
expenses:leisure || 0 [ 0% of $15] $5 [ 33% of $15] 0 [ 0% of $15] $5 [ 11% of $45]
@ -94,9 +94,9 @@ Budget performance in 2016/12/01-2016/12/03:
# # 2. -E
# $ hledger bal -D -b 2016-12-01 -e 2016-12-04 -f - --budget -E
# Budget performance in 2016/12/01-2016/12/03:
# Budget performance in 2016-12-01-2016-12-03:
# || 2016/12/01 2016/12/02 2016/12/03
# || 2016-12-01 2016-12-02 2016-12-03
# ==============================++==============================================================================
# <unbudgeted>:expenses:cab || 0 0 $15
# <unbudgeted>:expenses:movies || 0 0 $25
@ -142,9 +142,9 @@ Budget performance in 2016/12/01-2016/12/03:
# assets:cash
# $ hledger bal -D -b 2016-12-01 -e 2016-12-04 -f - --budget
# Budget performance in 2016/12/01-2016/12/03:
# Budget performance in 2016-12-01-2016-12-03:
# || 2016/12/01 2016/12/02 2016/12/03
# || 2016-12-01 2016-12-02 2016-12-03
# ==================++=====================================================================================
# <unbudgeted> || 0 0 $40
# assets:cash || $-15 [ 60% of $-25] $-26 [ 104% of $-25] $-51 [ 204% of $-25]
@ -156,9 +156,9 @@ Budget performance in 2016/12/01-2016/12/03:
#** Sort by actual amount, flat mode.
$ hledger -f- bal --budget -DTNS
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03 Total
|| 2016-12-01 2016-12-02 2016-12-03 Total
==================++========================================================================================
expenses || $10 [ 40% of $25] $14 [ 56% of $25] $51 [ 204% of $25] $75 [ 100% of $75]
expenses:food || $10 [ 100% of $10] $9 [ 90% of $10] $11 [ 110% of $10] $30 [ 100% of $30]
@ -169,9 +169,9 @@ Budget performance in 2016/12/01-2016/12/03:
#** Sort by actual amount, tree mode.
$ hledger -f- bal --budget -DTNS --tree
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03 Total
|| 2016-12-01 2016-12-02 2016-12-03 Total
===========++========================================================================================
expenses || $10 [ 40% of $25] $14 [ 56% of $25] $51 [ 204% of $25] $75 [ 100% of $75]
food || $10 [ 100% of $10] $9 [ 90% of $10] $11 [ 110% of $10] $30 [ 100% of $30]

View File

@ -32,9 +32,9 @@
# 1. Test --budget switch
$ hledger -f- bal -D -b 2016-12-01 -e 2016-12-04 --budget
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03
|| 2016-12-01 2016-12-02 2016-12-03
==================++==================================================================
assets || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25]
assets:cash || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25]
@ -46,9 +46,9 @@ Budget performance in 2016/12/01-2016/12/03:
# 2. -E
$ hledger -f- bal -D -b 2016-12-01 -e 2016-12-04 --budget -E
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03
|| 2016-12-01 2016-12-02 2016-12-03
==================++==================================================================
assets || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25]
assets:cash || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25]
@ -96,9 +96,9 @@ Budget performance in 2016/12/01-2016/12/03:
assets:cash
$ hledger -f- bal -D -b 2016-12-01 -e 2016-12-04 --budget
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03
|| 2016-12-01 2016-12-02 2016-12-03
==================++======================================================================================
assets || $-15 [ 60% of $-25] $-26 [ 104% of $-25] $-51 [ 204% of $-25]
assets:cash || $-15 [ 60% of $-25] $-26 [ 104% of $-25] $-51 [ 204% of $-25]
@ -131,9 +131,9 @@ Budget performance in 2016/12/01-2016/12/03:
(c) 1
$ hledger -f- bal --budget
Budget performance in 2018/01/01-2018/01/03:
Budget performance in 2018-01-01-2018-01-03:
|| 2018/01/01-2018/01/03
|| 2018-01-01-2018-01-03
===++=======================
a || 2 [ 7% of 30]
b || 2 [ 2% of 100]
@ -145,9 +145,9 @@ Budget performance in 2018/01/01-2018/01/03:
# Budget goals with lower frequency than the report are posted in the
# appropriate intermittent periods.
$ hledger -f- bal --budget -D
Budget performance in 2018/01/01-2018/01/03:
Budget performance in 2018-01-01-2018-01-03:
|| 2018/01/01 2018/01/02 2018/01/03
|| 2018-01-01 2018-01-02 2018-01-03
===++=========================================================
a || 1 [ 10% of 10] 0 [ 0% of 10] 1 [ 10% of 10]
b || 1 [ 1% of 100] 0 [ 0] 1 [ 0]
@ -157,9 +157,9 @@ Budget performance in 2018/01/01-2018/01/03:
# 6. Budget goals with higher frequency than the report get added up appropriately.
$ hledger -f- bal --budget -W
Budget performance in 2018/01/01w01:
Budget performance in 2018-01-01w01:
|| 2018/01/01w01
|| 2018-01-01w01
===++===================
a || 2 [ 7% of 30]
b || 2 [ 2% of 100]
@ -189,9 +189,9 @@ Budget performance in 2018/01/01w01:
(b) 1
$ hledger -f- bal --budget -D
Budget performance in 2018/01/01-2018/01/04:
Budget performance in 2018-01-01-2018-01-04:
|| 2018/01/01 2018/01/02 2018/01/03 2018/01/04
|| 2018-01-01 2018-01-02 2018-01-03 2018-01-04
==============++================================================================
<unbudgeted> || 1 1 1 1
a || 1 1 [ 100% of 1] 1 [ 100% of 1] 1
@ -219,9 +219,9 @@ Budget performance in 2018/01/01-2018/01/04:
(a) 1
$ hledger -f- bal --budget -D
Budget performance in 2018/01/01-2018/01/04:
Budget performance in 2018-01-01-2018-01-04:
|| 2018/01/01 2018/01/02 2018/01/03 2018/01/04
|| 2018-01-01 2018-01-02 2018-01-03 2018-01-04
===++====================================================================
a || 1 [ 100% of 1] 1 [ 100% of 1] 1 [ 10% of 10] 1 [ 10% of 10]
---++--------------------------------------------------------------------
@ -229,9 +229,9 @@ Budget performance in 2018/01/01-2018/01/04:
# 9. A "from A to B" budget should not be included in a report beginning on B.
$ hledger -f- bal --budget -D -b 2018/1/3
Budget performance in 2018/01/03-2018/01/04:
Budget performance in 2018-01-03-2018-01-04:
|| 2018/01/03 2018/01/04
|| 2018-01-03 2018-01-04
===++==================================
a || 1 [ 10% of 10] 1 [ 10% of 10]
---++----------------------------------
@ -251,9 +251,9 @@ Budget performance in 2018/01/03-2018/01/04:
# even if there are no actual transactions in the period,
# or if the actual amount is zero.
$ hledger -f- bal --budget -D date:2018/1/1-2018/1/3
Budget performance in 2018/01/01-2018/01/02:
Budget performance in 2018-01-01-2018-01-02:
|| 2018/01/01 2018/01/02
|| 2018-01-01 2018-01-02
===++================================
a || 0 [ 0% of 1] 0 [ 0% of 1]
---++--------------------------------
@ -261,9 +261,9 @@ Budget performance in 2018/01/01-2018/01/02:
# 11. With -E, zeroes are shown
$ hledger -f- bal --budget -D date:2018/1/1-2018/1/3 -E
Budget performance in 2018/01/01-2018/01/02:
Budget performance in 2018-01-01-2018-01-02:
|| 2018/01/01 2018/01/02
|| 2018-01-01 2018-01-02
===++================================
a || 0 [ 0% of 1] 0 [ 0% of 1]
---++--------------------------------
@ -278,9 +278,9 @@ Budget performance in 2018/01/01-2018/01/02:
(a:b) 1
$ hledger -f- bal --budget -N
Budget performance in 2018/01/01:
Budget performance in 2018-01-01:
|| 2018/01/01
|| 2018-01-01
===++================
a || 1 [ 100% of 1]
@ -295,9 +295,9 @@ Budget performance in 2018/01/01:
(a:b:c) 1
$ hledger -f- bal --budget
Budget performance in 2018/01/01:
Budget performance in 2018-01-01:
|| 2018/01/01
|| 2018-01-01
=======++==================
a || 2 [ 2% of 101]
a:b || 1 [ 100% of 1]
@ -307,9 +307,9 @@ Budget performance in 2018/01/01:
# 14. tree mode
$ hledger -f- bal --budget --tree
Budget performance in 2018/01/01:
Budget performance in 2018-01-01:
|| 2018/01/01
|| 2018-01-01
=======++==================
a || 2 [ 2% of 101]
b || 1 [ 100% of 1]
@ -338,7 +338,7 @@ P 2018/01/26 SHARE €10
assets:bank
$ hledger -f - bal -M --budget --cumulative --forecast -V
Budget performance in 2018/05/01-2018/06/30, valued at period ends:
Budget performance in 2018-05-01-2018-06-30, valued at period ends:
|| May Jun
================++==========================================
@ -368,9 +368,9 @@ Budget performance in 2018/05/01-2018/06/30, valued at period ends:
liabilities $-30.00
$ hledger -f- bal --budget
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
===================++==============================
expenses || $50.00 [ 5% of $1,000.00]
expenses:personal || $50.00 [ 5% of $1,000.00]
@ -380,9 +380,9 @@ Budget performance in 2019/01/01-2019/01/03:
# 17.
$ hledger -f- bal --budget -E
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
========================================++==============================
expenses || $50.00 [ 5% of $1,000.00]
expenses:personal || $50.00 [ 5% of $1,000.00]
@ -394,9 +394,9 @@ Budget performance in 2019/01/01-2019/01/03:
# 18.
$ hledger -f- bal --budget --tree
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
=============++==============================
expenses || $50.00 [ 5% of $1,000.00]
personal || $50.00 [ 5% of $1,000.00]
@ -406,9 +406,9 @@ Budget performance in 2019/01/01-2019/01/03:
# 19.
$ hledger -f- bal --budget --tree -E
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
=================++==============================
expenses || $50.00 [ 5% of $1,000.00]
personal || $50.00 [ 5% of $1,000.00]
@ -438,9 +438,9 @@ Budget performance in 2019/01/01-2019/01/03:
liabilities $-30.00
$ hledger -f- bal --budget
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
===============================++==============================
expenses || $50.00 [ 5% of $1100.00]
expenses:personal || $50.00 [ 5% of $1100.00]
@ -451,9 +451,9 @@ Budget performance in 2019/01/01-2019/01/03:
# 21.
$ hledger -f- bal --budget -E
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
========================================++==============================
expenses || $50.00 [ 5% of $1100.00]
expenses:personal || $50.00 [ 5% of $1100.00]
@ -465,9 +465,9 @@ Budget performance in 2019/01/01-2019/01/03:
# 22.
$ hledger -f- bal --budget --tree
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
=================++==============================
expenses || $50.00 [ 5% of $1100.00]
personal || $50.00 [ 5% of $1100.00]
@ -478,9 +478,9 @@ Budget performance in 2019/01/01-2019/01/03:
# 23.
$ hledger -f- bal --budget --tree -E
Budget performance in 2019/01/01-2019/01/03:
Budget performance in 2019-01-01-2019-01-03:
|| 2019/01/01-2019/01/03
|| 2019-01-01-2019-01-03
=================++==============================
expenses || $50.00 [ 5% of $1100.00]
personal || $50.00 [ 5% of $1100.00]
@ -515,9 +515,9 @@ Budget performance in 2019/01/01-2019/01/03:
# By default it hides d (because no budget) and e (because zero posted amount).
# f is shown though its budget is zero, it probably shouldn't be.
$ hledger bal -f- --budget
Budget performance in 2019/01/01-2019/01/02:
Budget performance in 2019-01-01-2019-01-02:
|| 2019/01/01-2019/01/02
|| 2019-01-01-2019-01-02
==================++=======================
expenses || $80 [ 22% of $370]
expenses:bills || $80 [ 22% of $370]
@ -532,9 +532,9 @@ Budget performance in 2019/01/01-2019/01/02:
# 25. -E shows d
$ hledger bal -f- --budget -E
Budget performance in 2019/01/01-2019/01/02:
Budget performance in 2019-01-01-2019-01-02:
|| 2019/01/01-2019/01/02
|| 2019-01-01-2019-01-02
==================++=======================
expenses || $80 [ 22% of $370]
expenses:bills || $80 [ 22% of $370]

View File

@ -3,12 +3,12 @@
# 1. Here are the postings used in most tests below:
hledger -f balance-multicol.journal register
>>>
2012/12/31 (assets:checking) 10 10
2013/01/01 (assets:checking) 1 11
2013/01/15 (assets:checking) -1 10
2013/02/01 (assets:cash) 1 11
2013/02/02 (assets) 1 12
2013/03/01 (assets:checking) 1 13
2012-12-31 (assets:checking) 10 10
2013-01-01 (assets:checking) 1 11
2013-01-15 (assets:checking) -1 10
2013-02-01 (assets:cash) 1 11
2013-02-02 (assets) 1 12
2013-03-01 (assets:checking) 1 13
>>>=0
# 2. A period balance (flow) report. --no-total also works but isn't pretty.
@ -49,7 +49,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative
>>>
Ending balances (cumulative) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
=================++====================================
assets || 0 1 1
assets:cash || 0 1 1
@ -65,7 +65,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative no
>>>
Ending balances (cumulative) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
=================++====================================
assets || 0 1 1
assets:checking || 0 0 1
@ -78,7 +78,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --historical
>>>
Ending balances (historical) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
=================++====================================
assets || 0 1 1
assets:cash || 0 1 1
@ -106,7 +106,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' not:assets$ --c
>>>
Ending balances (cumulative) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
=================++====================================
assets:cash || 0 1 1
assets:checking || 0 0 1
@ -119,7 +119,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --historical
>>>
Ending balances (historical) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
=================++====================================
assets || 0 1 1
assets:cash || 0 1 1
@ -159,7 +159,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 --cum
>>>
Ending balances (cumulative) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
========++====================================
assets || 0 2 3
--------++------------------------------------
@ -171,7 +171,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --depth 1 --his
>>>
Ending balances (historical) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
========++====================================
assets || 10 12 13
--------++------------------------------------
@ -197,7 +197,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --cumulative --
>>>
Ending balances (cumulative) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
============++====================================
assets || 0 2 3
cash || 0 1 1
@ -211,7 +211,7 @@ hledger -f balance-multicol.journal balance -p 'monthly in 2013' --historical --
>>>
Ending balances (historical) in 2013q1:
|| 2013/01/31 2013/02/28 2013/03/31
|| 2013-01-31 2013-02-28 2013-03-31
============++====================================
assets || 10 12 13
cash || 0 1 1
@ -253,7 +253,7 @@ hledger -f- balance -p 'monthly 2014/1/10-2014/2/20'
(after) 1
>>>
Balance changes in 2014/01/01-2014/02/28:
Balance changes in 2014-01-01-2014-02-28:
|| Jan Feb
========++==========

View File

@ -12,9 +12,9 @@ hledger -f sample.journal balance expenses -%
# 2. Multi column percent
hledger -f sample.journal balance expenses -% -p daily
>>>
Balance changes in 2008/06/03:
Balance changes in 2008-06-03:
|| 2008/06/03
|| 2008-06-03
===================++============
expenses:food || 50.0 %
expenses:supplies || 50.0 %

View File

@ -1,6 +1,6 @@
hledger -f balance-multicol.journal balance --pretty-tables -M
>>>
Balance changes in 2012/12/01-2013/03/31:
Balance changes in 2012-12-01-2013-03-31:
║ Dec Jan Feb Mar
═════════════════╬════════════════════

View File

@ -1,6 +1,6 @@
hledger -f balance-multicol.journal balance -M -A --transpose
>>>
Balance changes in 2012/12/01-2013/03/31:
Balance changes in 2012-12-01-2013-03-31:
|| assets assets:cash assets:checking |
=========++======================================+====
@ -53,9 +53,9 @@ hledger bal -D -b 2016-12-01 -e 2016-12-04 -f - --budget
expenses:leisure $15
assets:cash
>>>
Budget performance in 2016/12/01-2016/12/03:
Budget performance in 2016-12-01-2016-12-03:
|| 2016/12/01 2016/12/02 2016/12/03
|| 2016-12-01 2016-12-02 2016-12-03
==================++==================================================================
assets || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25]
assets:cash || $-10 [ 40% of $-25] $-14 [ 56% of $-25] $-51 [ 204% of $-25]

View File

@ -5,9 +5,9 @@ hledger -f - balancesheet
assets 1
b
>>>
Balance Sheet 2016/01/01
Balance Sheet 2016-01-01
|| 2016/01/01
|| 2016-01-01
=============++============
Assets ||
-------------++------------
@ -48,9 +48,9 @@ Balance Sheet 2016/01/01
#
hledger -f sample.journal balancesheet -p 'monthly in 2008'
>>>
Balance Sheet 2008/01/31,,2008/12/31
Balance Sheet 2008-01-31,,2008-12-31
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
|| 2008-01-31 2008-02-29 2008-03-31 2008-04-30 2008-05-31 2008-06-30 2008-07-31 2008-08-31 2008-09-30 2008-10-31 2008-11-30 2008-12-31
======================++================================================================================================================================================
Assets ||
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
@ -94,9 +94,9 @@ Balance Sheet 2008/01/31,,2008/12/31
#
hledger -f sample.journal balancesheet -p 'monthly in 2008' --tree
>>>
Balance Sheet 2008/01/31,,2008/12/31
Balance Sheet 2008-01-31,,2008-12-31
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
|| 2008-01-31 2008-02-29 2008-03-31 2008-04-30 2008-05-31 2008-06-30 2008-07-31 2008-08-31 2008-09-30 2008-10-31 2008-11-30 2008-12-31
==============++================================================================================================================================================
Assets ||
--------------++------------------------------------------------------------------------------------------------------------------------------------------------
@ -123,9 +123,9 @@ Balance Sheet 2008/01/31,,2008/12/31
# by default (shows ending balances).
hledger -f sample.journal balancesheet -p 'monthly in 2008' -NAT
>>>
Balance Sheet 2008/01/31,,2008/12/31
Balance Sheet 2008-01-31,,2008-12-31
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Average
|| 2008-01-31 2008-02-29 2008-03-31 2008-04-30 2008-05-31 2008-06-30 2008-07-31 2008-08-31 2008-09-30 2008-10-31 2008-11-30 2008-12-31 Average
======================++=========================================================================================================================================================
Assets ||
----------------------++---------------------------------------------------------------------------------------------------------------------------------------------------------
@ -148,9 +148,9 @@ hledger -f- balancesheet
2017/1/1
(assets:b) 1
>>>
Balance Sheet 2017/01/01
Balance Sheet 2017-01-01
|| 2017/01/01
|| 2017-01-01
=============++============
Assets ||
-------------++------------
@ -174,9 +174,9 @@ hledger -f- balancesheet --flat
2017/1/1
(assets:b) 1
>>>
Balance Sheet 2017/01/01
Balance Sheet 2017-01-01
|| 2017/01/01
|| 2017-01-01
=============++============
Assets ||
-------------++------------
@ -199,9 +199,9 @@ hledger -f- balancesheet -YA
2017/1/1
(assets) $1
>>>
Balance Sheet 2017/12/31
Balance Sheet 2017-12-31
|| 2017/12/31 Average
|| 2017-12-31 Average
=============++=====================
Assets ||
-------------++---------------------
@ -225,9 +225,9 @@ hledger -f - balancesheet -M --pretty-tables
assets 1
b
>>>
Balance Sheet 2016/01/31
Balance Sheet 2016-01-31
║ 2016/01/31
║ 2016-01-31
═════════════╬════════════
Assets ║
─────────────╫────────────
@ -262,9 +262,9 @@ hledger -f - balancesheet
assets:this account should not disappear:subaccount -$10
assets:this account should not disappear
>>>
Balance Sheet 2018/10/03
Balance Sheet 2018-10-03
|| 2018/10/03
|| 2018-10-03
=====================================++============
Assets ||
-------------------------------------++------------

View File

@ -5,9 +5,9 @@ hledger -f - cashflow
assets 1
b
>>>
Cashflow Statement 2016/01/01
Cashflow Statement 2016-01-01
|| 2016/01/01
|| 2016-01-01
============++============
Cash flows ||
------------++------------
@ -75,9 +75,9 @@ hledger -f - cashflow -b 2015 -e 2017
assets:checking $10.00
assets:receivables -$10.00
>>>
Cashflow Statement 2015/01/01-2016/12/31
Cashflow Statement 2015-01-01-2016-12-31
|| 2015/01/01-2016/12/31
|| 2015-01-01-2016-12-31
=================++=======================
Cash flows ||
-----------------++-----------------------
@ -175,9 +175,9 @@ Cashflow Statement 2008
# 7. Multicolumn test (historical)
hledger -f sample.journal cashflow -p 'monthly in 2008' -A --historical
>>>
Cashflow Statement 2008/01/31,,2008/12/31 (Historical Ending Balances)
Cashflow Statement 2008-01-31,,2008-12-31 (Historical Ending Balances)
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Average
|| 2008-01-31 2008-02-29 2008-03-31 2008-04-30 2008-05-31 2008-06-30 2008-07-31 2008-08-31 2008-09-30 2008-10-31 2008-11-30 2008-12-31 Average
======================++=========================================================================================================================================================
Cash flows ||
----------------------++---------------------------------------------------------------------------------------------------------------------------------------------------------
@ -229,9 +229,9 @@ hledger -f - cashflow
assets:fixed assets:equipment 1
b
>>>
Cashflow Statement 2016/01/01
Cashflow Statement 2016-01-01
|| 2016/01/01
|| 2016-01-01
============++============
Cash flows ||
------------++------------

View File

@ -13,52 +13,52 @@
# If this one fails, we got a wrong regex and the inverted regex tests below
# are also wrong.
$ hledger -f- register
> /2019\/01\/01/
> /2019-01-01/
# Show only February
$ hledger -f- register -p 2019-02
> !/2019\/01\/01/
> !/2019-01-01/
# The last -b overrides the first -b
# -> show only February
$ hledger -f- register -b 2019 -b 2019-02
> !/2019\/01\/01/
> !/2019-01-01/
# The last -e overrides the first -e
# Note that -e means: include posting/txns BEFORE this date.
# -> show only January
$ hledger -f- register -e 2020 -e 2019-02-01
> !/2019\/02\/01/
> !/2019-02-01/
# -p's begin overrides -b because it comes last
# -> show only February
$ hledger -f- register -b 2019-01-01 -p 2019-02
> !/2019\/01\/01/
> !/2019-01-01/
# -e overrides -p's end because it come last
# -> show only first part of January
$ hledger -f- register -p 2019 -e 2019-01-20
> !/2019\/02\/01/
> !/2019-02-01/
# Date options and queries are AND'ed and produce the intersection independent
# of their order
$ hledger -f- register date:2019-02 -p 2019
> !/2019\/01\/01/
> !/2019-01-01/
$ hledger -f- register -p 2019 date:2019-02
> !/2019\/01\/01/
> !/2019-01-01/
# Date queries are AND'ed and produce the intersection independent of their
# order
$ hledger -f- register date:2019 date:2019-02
> !/2019\/01\/01/
> !/2019-01-01/
$ hledger -f- register date:2019-02 date:2019
> !/2019\/01\/01/
> !/2019-01-01/
$ hledger -f- register date:2019-02 date:2019-01-01-
> !/2019\/01\/01/
> !/2019-01-01/
## Date options override date queries
#$ hledger -f- register date:2019-02 -p 2019
#> /2019\/01\/01/
#> /2019-01-01/
# Smart dates https://github.com/simonmichael/hledger/issues/1079
$ hledger -f- activity -b 2019-02-01 -e 'next year'

View File

@ -1,9 +1,9 @@
# 1. all data files on the command line should be read
hledger inc -f personal.journal -f business.journal
>>>
Income Statement 2014/01/01-2014/01/02
Income Statement 2014-01-01-2014-01-02
|| 2014/01/01-2014/01/02
|| 2014-01-01-2014-01-02
==========================++=======================
Revenues ||
--------------------------++-----------------------
@ -24,15 +24,15 @@ Income Statement 2014/01/01-2014/01/02
# 2. aliases etc. in files currently don't carry over to subsequent files
hledger print -f personal.journal -f business.journal -f alias.journal -f personal.journal
>>>
2014/01/01
2014-01-01
expenses:office supplies $1
assets:business checking
2014/01/02
2014-01-02
expenses:food $1
assets:cash
2014/01/02
2014-01-02
expenses:food $1
assets:cash
@ -46,14 +46,14 @@ hledger print -f personal.journal -f business.journal -f alias.journal -f person
# 3. files can be of different formats
hledger print -f personal.journal -f ../journal/a.timeclock -f ../journal/b.timedot
>>>
2014/01/02
2014-01-02
expenses:food $1
assets:cash
2016/01/01 * 12:00-16:00
2016-01-01 * 12:00-16:00
(a:aa) 4.00h
2016/01/01 *
2016-01-01 *
(b.bb) 1.00
>>>2
@ -62,7 +62,7 @@ hledger print -f personal.journal -f ../journal/a.timeclock -f ../journal/b.time
# 4. same-date transactions in different files are shown in the right order
hledger -f a.j -f b.j reg
>>>
2018/01/01 a1 (a) 1 1
2018/01/01 b1 (b) 1 2
2018-01-01 a1 (a) 1 1
2018-01-01 b1 (b) 1 2
>>>2
>>>=0

View File

@ -5,7 +5,7 @@ hledger -f- register 'a a'
a a 1
b
>>>
2010/03/01 x a a 1 1
2010-03-01 x a a 1 1
>>>=0
#
@ -20,7 +20,7 @@ hledger -f- register desc:'x x'
a 1
b
>>>
2010/03/02 x x a 1 1
2010-03-02 x x a 1 1
b -1 0
>>>=0
@ -32,6 +32,6 @@ hledger -f- register 'a a' "'b"
a a 1
'b
>>>
2011/09/11 a a 1 1
2011-09-11 a a 1 1
'b -1 0
>>>=0

View File

@ -17,14 +17,14 @@ $ hledger -f- register --weekly --monthly
2019/02 a 1 3
$ hledger -f- register --monthly --weekly
2018/12/31w01 a 2 2
2019/01/28w05 a 1 3
2018-12-31w01 a 2 2
2019-01-28w05 a 1 3
# The last report interval option takes precedence.
# The --period expression is no exception.
$ hledger -f- register -p 'monthly in 2019' --weekly
2018/12/31w01 a 2 2
2019/01/28w05 a 1 3
2018-12-31w01 a 2 2
2019-01-28w05 a 1 3
$ hledger -f- register --weekly -p 'monthly in 2019'
2019/01 a 2 2

View File

@ -19,13 +19,13 @@
assets:cash
$ hledger close -f- -p 2016 assets liabilities
2016/12/31 closing balances
2016-12-31 closing balances
assets:bank $-80 = $0
assets:cash $-10 = $0
liabilities $-25 = $0
equity:closing balances $115
2017/01/01 opening balances
2017-01-01 opening balances
assets:bank $80 = $80
assets:cash $10 = $10
liabilities $25 = $25
@ -39,11 +39,11 @@ $ hledger close -f- -p 2016 assets liabilities
(a) 1
$ hledger close -f- -b2017/6/1 -e2018
2017/12/31 closing balances
2017-12-31 closing balances
a -1 = 0
equity:closing balances 1
2018/01/01 opening balances
2018-01-01 opening balances
a 1 = 1
equity:opening balances -1
@ -69,7 +69,7 @@ $ hledger close -f- -b2017/6/1 -e2018
assets:cash
$ hledger close -f- -p 2016 assets liabilities --opening
2017/01/01 opening balances
2017-01-01 opening balances
assets:bank $80 = $80
assets:cash $10 = $10
liabilities $25 = $25
@ -97,7 +97,7 @@ $ hledger close -f- -p 2016 assets liabilities --opening
assets:cash
$ hledger close -f- -p 2016 assets liabilities --closing
2016/12/31 closing balances
2016-12-31 closing balances
assets:bank $-80 = $0
assets:cash $-10 = $0
liabilities $-25 = $0
@ -125,13 +125,13 @@ $ hledger close -f- -p 2016 assets liabilities --closing
assets:cash
$ hledger close -f- -p 2016 assets liabilities --opening --closing
2016/12/31 closing balances
2016-12-31 closing balances
assets:bank $-80 = $0
assets:cash $-10 = $0
liabilities $-25 = $0
equity:closing balances $115
2017/01/01 opening balances
2017-01-01 opening balances
assets:bank $80 = $80
assets:cash $10 = $10
liabilities $25 = $25
@ -149,13 +149,13 @@ $ hledger close -f- -p 2016 assets liabilities --opening --closing
equity
$ hledger -f- close assets -p 2019
2019/12/31 closing balances
2019-12-31 closing balances
assets -1A @ 1B
assets -1A @ 1C = 0A
equity:closing balances 1A @ 1B
equity:closing balances 1A @ 1C
2020/01/01 opening balances
2020-01-01 opening balances
assets 1A @ 1B
assets 1A @ 1C = 2A
equity:opening balances -1A @ 1B
@ -174,13 +174,13 @@ $ hledger -f- close assets -p 2019
(assets) 1A @ 2B
$ hledger -f- close assets -p 2019
2019/12/31 closing balances
2019-12-31 closing balances
assets -1A @ 1B
assets -1A @ 2B = 0A
equity:closing balances 1A @ 1B
equity:closing balances 1A @ 2B
2020/01/01 opening balances
2020-01-01 opening balances
assets 1A @ 1B
assets 1A @ 2B = 2A
equity:opening balances -1A @ 1B
@ -213,7 +213,7 @@ $ hledger -f- close assets -p 2019
liabilities:employer
$ hledger -f- close -p 2016 assets liabilities
2016/12/31 closing balances
2016-12-31 closing balances
assets:bank -5,733.00 EUR = 0.00 EUR
liabilities:employer $-10,000.00
liabilities:employer $5,000.00 @ 0.93 EUR
@ -224,7 +224,7 @@ $ hledger -f- close -p 2016 assets liabilities
equity:closing balances $-5,000.00 @ 0.95 EUR
equity:closing balances 5,734.00 EUR
2017/01/01 opening balances
2017-01-01 opening balances
assets:bank 5,733.00 EUR = 5,733.00 EUR
liabilities:employer $10,000.00
liabilities:employer $-5,000.00 @ 0.93 EUR

View File

@ -8,7 +8,7 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50
income:unknown $-50
@ -28,11 +28,11 @@ amount-out %4
currency $
$ ./hledger-csv
2009/09/10 Flubber Co🎅
2009-09-10 Flubber Co🎅
Assets:MyAccount $50
income:unknown $-50
2009/09/11 Flubber Co🎅
2009-09-11 Flubber Co🎅
Assets:MyAccount $-50
expenses:unknown $50
@ -51,7 +51,7 @@ if Flubber
account2 acct
comment cmt
$ ./hledger-csv
2009/09/10 Flubber Co ; cmt
2009-09-10 Flubber Co ; cmt
assets:myacct $50
acct $-50
@ -68,7 +68,7 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50 = $123
income:unknown $-50
@ -86,11 +86,11 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50 = $123
income:unknown $-50
2009/09/11 Blubber Co
2009-09-11 Blubber Co
assets:myacct $60
income:unknown $-60
@ -108,11 +108,11 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50 = $123
income:unknown $-50
2009/09/11 Blubber Co
2009-09-11 Blubber Co
assets:myacct $60
income:unknown $-60
@ -135,11 +135,11 @@ amount -%payment
account1 liabilities:bank
account2 expense:other
$ ./hledger-csv
2009/10/09
2009-10-09
liabilities:bank $-50
expense:other $50
2009/11/09
2009-11-09
liabilities:bank $60
expense:other $-60
@ -160,11 +160,11 @@ amount-out %4
currency $
$ ./hledger-csv
2009/09/10 Flubber Co🎅
2009-09-10 Flubber Co🎅
Assets:MyAccount $50
income:unknown $-50
2009/09/11 Flubber Co🎅
2009-09-11 Flubber Co🎅
Assets:MyAccount $-50
expenses:unknown $50
@ -181,7 +181,7 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50
income:unknown $-50 = $123
@ -198,7 +198,7 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50 = $321
income:unknown $-50 = $123
@ -218,7 +218,7 @@ account3 expenses:tax
account4 the:remainder
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50.000 = $321.000
expenses:unknown = $123.000
expenses:tax $0.234 ; VAT
@ -239,7 +239,7 @@ account3 expenses:tax
account4 the:remainder
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50 = $321
expenses:unknown = $123
expenses:tax £0.234 ; VAT
@ -261,11 +261,11 @@ amount-out %4
currency $
$ ./hledger-csv
2009/09/10 Flubber Co🎅
2009-09-10 Flubber Co🎅
Assets:MyAccount $50
income:unknown $-50
2009/09/11 Flubber Co🎅
2009-09-11 Flubber Co🎅
Assets:MyAccount $-50
expenses:unknown $50
@ -291,7 +291,7 @@ date-format %d/%Y/%m
currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co Co Co
2009-09-10 Flubber Co Co Co
assets:myacct $50
income:unknown $-50
@ -310,7 +310,7 @@ if Flubber
account1 assets:%account1
amount-in (%amount-in)
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $-50
expenses:unknown $50
@ -334,7 +334,7 @@ date %1
date-format %m/%d/%Y
description %description for %itemtitle
$ ./hledger-csv
2018/12/22 (123456789) Someone for Joyful Systems
2018-12-22 (123456789) Someone for Joyful Systems
sm:assets:online:paypal $9.41 = $57.60
sm:expenses:unknown
JS:expenses:banking:paypal $-0.59
@ -383,11 +383,11 @@ if MIDDLE
skip 3
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50
income:unknown $-50
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50
income:unknown $-50
@ -407,15 +407,15 @@ description Assets Update
account1 assets
account2 income
$ ./hledger-csv
2018/10/15 Assets Update
2018-10-15 Assets Update
assets = EUR 100
income
2018/10/16 Assets Update
2018-10-16 Assets Update
assets = EUR 200
income
2018/10/17 Assets Update
2018-10-17 Assets Update
assets = EUR 300
income
@ -431,7 +431,7 @@ amount
comment x
$ ./hledger-csv
2018/10/15 ; x
2018-10-15 ; x
>=0
@ -465,12 +465,12 @@ if ,Empty fee
skip
$ ./hledger-csv
2018/12/22 (123456789) Someone for Joyful Systems
2018-12-22 (123456789) Someone for Joyful Systems
sm:assets:online:paypal $9.41 = $57.60
sm:expenses:unknown
JS:expenses:banking:paypal $-0.59
2018/12/22 (10101010101) Someone for Joyful Systems
2018-12-22 (10101010101) Someone for Joyful Systems
sm:assets:online:paypal $7.77 = $88.66
sm:expenses:unknown $-7.77
@ -488,7 +488,7 @@ currency $
account1 assets:myacct
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
assets:myacct $50 ==* $123
income:unknown $-50
@ -505,7 +505,7 @@ currency $
account1 (assets:myacct)
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
(assets:myacct) $50 = $123
>=0
@ -522,7 +522,7 @@ account1 [assets:myacct]
account2 [assets:another-acct]
$ ./hledger-csv
2009/09/10 Flubber Co
2009-09-10 Flubber Co
[assets:myacct] $50
[assets:another-acct] $-50
@ -539,7 +539,7 @@ account1 (assets:myacct)
separator TAB
$ ./hledger-csv
2009/10/01 Flubber Co
2009-10-01 Flubber Co
(assets:myacct) $50 = $123
>=0
@ -553,7 +553,7 @@ $ ./hledger-csv
#account2 (a)
#
#$ ./hledger-csv
#2019/01/01
#2019-01-01
# (a) 1
#
#>=0

View File

@ -16,7 +16,7 @@ hledger bal -M -b 2016-11 -e 2017-02 -f - --forecast
expenses:grocery $30
assets:cash
>>>
Balance changes in 2016/12/01-2017/01/31:
Balance changes in 2016-12-01-2017-01-31:
|| Dec Jan
==================++===============
@ -46,11 +46,11 @@ hledger print -b 2016-11 -e 2017-02 -f - --forecast
expenses:grocery $30
assets:cash
>>>
2016/12/31
2016-12-31
expenses:housing $600
assets:cash
2017/01/01 * marked cleared, and with a description
2017-01-01 * marked cleared, and with a description
; generated-transaction: ~ monthly from 2016/1
income $-1000
expenses:food $20
@ -76,7 +76,7 @@ hledger register -b 2016-11 -e 2017-02 -f - --forecast tag:a
expenses:grocery $30
assets:cash
>>>
2017/01/01 income $-1000 $-1000
2017-01-01 income $-1000 $-1000
expenses:food $20 $-980
expenses:leisure $15 $-965
expenses:grocery $30 $-935
@ -99,9 +99,9 @@ hledger register -b 2015-12 -e 2017-02 -f - assets:cash --forecast
income $-10000 ; bonus
assets:cash
>>>
2016/01/01 assets:cash $-10 $-10
2016/12/02 assets:cash $-600 $-610
2017/01/01 assets:cash $10000 $9390
2016-01-01 assets:cash $-10 $-10
2016-12-02 assets:cash $-600 $-610
2017-01-01 assets:cash $10000 $9390
>>>2
>>>=0
@ -117,7 +117,7 @@ Y 2000
2000/1/1 real
>>>
2000/02/01 forecast
2000-02-01 forecast
; generated-transaction: ~ 2/1
>>>2
@ -134,7 +134,7 @@ Y 2000
2000/1/1 real
>>>
2000/01/15 forecast
2000-01-15 forecast
; generated-transaction: ~ 15
>>>2
@ -151,7 +151,7 @@ Y 2000
2000/1/1 real
>>>
2000/02/01 forecast
2000-02-01 forecast
; generated-transaction: ~ next month
>>>2

View File

@ -4,5 +4,5 @@ hledger -f - register τράπ
τράπεζα 10 руб
नकद
>>>
2009/01/01 проверка τράπεζα 10 руб 10 руб
2009-01-01 проверка τράπεζα 10 руб 10 руб
>>>=0

View File

@ -7,6 +7,6 @@ hledger -f - register desc:аура
bank 20
cash
>>>
2009/01/01 аура (cyrillic le.. bank 10 10
2009-01-01 аура (cyrillic le.. bank 10 10
cash -10 0
>>>=0

View File

@ -4,7 +4,7 @@ hledger -f - print
счёт:первый 1
счёт:второй
>>>
2009/01/01 проверка
2009-01-01 проверка
счёт:первый 1
счёт:второй

View File

@ -4,6 +4,6 @@ hledger -f - register
τράπεζα 10 руб
नकद
>>>
2009/01/01 проверка τράπεζα 10 руб 10 руб
2009-01-01 проверка τράπεζα 10 руб 10 руб
नकद -10 руб 0
>>>=0

View File

@ -19,15 +19,15 @@ hledger -f - print
㐀:㐁:㐂:㐃:㐄 1
㐀 -1
>>>
2000/01/01 transaction 1
2000-01-01 transaction 1
㐀 㐃㐃1 @ 2 㐂㐂㐂㐂㐂㐂㐂㐂㐂㐂㐂
㐀:㐁 ; 㐃㐃-1
2000/01/02 transaction 2
2000-01-02 transaction 2
㐀:㐁:㐂 USD 1
㐀:㐁:㐂:㐃 EUR -1
2000/01/03 transaction 3
2000-01-03 transaction 3
㐀:㐁:㐂:㐃:㐄 1
㐀 -1
@ -37,11 +37,11 @@ hledger -f - print
# 2.
hledger -f chinese.journal register --width 80
>>>
2000/01/01 transaction 1 㐀 1 A 1 A
2000-01-01 transaction 1 㐀 1 A 1 A
㐀:㐁 -1 A 0
2000/01/02 transaction 2 㐀:㐁:㐂 1 A 1 A
2000-01-02 transaction 2 㐀:㐁:㐂 1 A 1 A
㐀:㐁:㐂:㐃 -1 A 0
2000/01/03 transaction 3 㐀:㐁:㐂:㐃:㐄 1 A 1 A
2000-01-03 transaction 3 㐀:㐁:㐂:㐃:㐄 1 A 1 A
㐀 -1 A 0
>>>2
>>>=0

View File

@ -5,9 +5,9 @@ hledger -f - incomestatement
income 1
b
>>>
Income Statement 2016/01/01
Income Statement 2016-01-01
|| 2016/01/01
|| 2016-01-01
==========++============
Revenues ||
----------++------------
@ -90,9 +90,9 @@ hledger -f - incomestatement -b 2015 -e 2017
assets:checking $10.00
assets:receivables -$10.00
>>>
Income Statement 2015/01/01-2016/12/31
Income Statement 2015-01-01-2016-12-31
|| 2015/01/01-2016/12/31
|| 2015-01-01-2016-12-31
===================++=======================
Revenues ||
-------------------++-----------------------
@ -243,7 +243,7 @@ Income Statement 2008
# old (arithmetic sign):
# Income Statement (Historical Ending Balances)
#
# || 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
# || 2008-01-31 2008-02-29 2008-03-31 2008-04-30 2008-05-31 2008-06-30 2008-07-31 2008-08-31 2008-09-30 2008-10-31 2008-11-30 2008-12-31
# ===================++================================================================================================================================================
# Revenues ||
# -------------------++------------------------------------------------------------------------------------------------------------------------------------------------
@ -263,9 +263,9 @@ Income Statement 2008
#
hledger -f sample.journal incomestatement -p 'monthly in 2008' --historical
>>>
Income Statement 2008/01/31,,2008/12/31 (Historical Ending Balances)
Income Statement 2008-01-31,,2008-12-31 (Historical Ending Balances)
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
|| 2008-01-31 2008-02-29 2008-03-31 2008-04-30 2008-05-31 2008-06-30 2008-07-31 2008-08-31 2008-09-30 2008-10-31 2008-11-30 2008-12-31
===================++================================================================================================================================================
Revenues ||
-------------------++------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -32,7 +32,7 @@ $ hledger -f- print
a 10 "DE 0002 635307"
b
$ hledger -f- print --explicit
2010/04/05 x
2010-04-05 x
a 10 "DE 0002 635307"
b -10 "DE 0002 635307"
@ -53,7 +53,7 @@ $ hledger -f- balance
Equity:Unbalanced
$ hledger -f- print -x
2016/01/01
2016-01-01
saving-card $-105
snacks 95 EUR @@ $100
Equity:Unbalanced $5
@ -105,10 +105,10 @@ $ hledger -f- bal -V -N
# (a) 1,000 A
#
#$ hledger -f- print
#2015/01/01
#2015-01-01
# (a) 1,000.00 A
#
#2015/01/01
#2015-01-01
# (a) 1,000.00 A
#
#>=
@ -160,6 +160,6 @@ $ hledger -f- print
#
# $ hledger -f- print
# could not balance this transaction (real postings are off by $9,990,000)
# 2000/01/01
# 2000-01-01
# a $-10,000
# b $10,000,000

View File

@ -15,14 +15,14 @@
# 1. print
$ hledger print -f- --auto
2016/01/01 paycheck ; modified:
2016-01-01 paycheck ; modified:
income:remuneration $-100
(liabilities:tax) $-33 ; income tax, generated-posting: = ^income
income:donations $-15
(liabilities:tax) $-5 ; income tax, generated-posting: = ^income
assets:bank
2016/01/01 withdraw
2016-01-01 withdraw
assets:cash $20
assets:bank
@ -30,12 +30,12 @@ $ hledger print -f- --auto
# 2. register
$ hledger register -f- --auto
2016/01/01 paycheck income:remuneration $-100 $-100
2016-01-01 paycheck income:remuneration $-100 $-100
(liabilities:tax) $-33 $-133
income:donations $-15 $-148
(liabilities:tax) $-5 $-153
assets:bank $115 $-38
2016/01/01 withdraw assets:cash $20 $-18
2016-01-01 withdraw assets:cash $20 $-18
assets:bank $-20 $-38
>=
@ -63,7 +63,7 @@ $ hledger balance -f- --auto
# 4.
$ hledger register -f- --auto
2018/01/01 (trigger) 1 1
2018-01-01 (trigger) 1 1
(target) 10 11
(target) 1 12
>=
@ -80,7 +80,7 @@ $ hledger register -f- --auto
# 5.
$ hledger print -f- --auto
2018/10/07 * MARKET ; modified:
2018-10-07 * MARKET ; modified:
expenses:groceries:food
[budget:groceries] $-20 ; generated-posting: = ^expenses:groceries
[assets:bank:checking] $20 ; generated-posting: = ^expenses:groceries
@ -99,7 +99,7 @@ $ hledger print -f- --auto
# 6.
$ hledger -f- print --auto -x
2018/01/01 ; modified:
2018-01-01 ; modified:
(assets:billable:client1) 0.50h @ $90
assets:receivable:client1 50.00h @ $90 ; generated-posting: = assets:billable:client1
revenues:client1 $-4500 ; generated-posting: = assets:billable:client1
@ -117,7 +117,7 @@ $ hledger -f- print --auto -x
# 7.
$ hledger -f- print --auto -x
2018/01/01 ; modified:
2018-01-01 ; modified:
(assets:billable:client1) 0.50h
assets:receivable:client1 $50 ; generated-posting: = assets:billable:client1
revenues:client1 $-50 ; generated-posting: = assets:billable:client1
@ -135,7 +135,7 @@ $ hledger -f- print --auto -x
# 8.
$ hledger -f- print --auto -x
2018/01/01 ; modified:
2018-01-01 ; modified:
(assets:billable:client1) 0.50h @ $90
assets:receivable:client1 0.50 "Client1 Hours" @ $100.00 ; generated-posting: = assets:billable:client1
revenues:client1 $-50.00 ; generated-posting: = assets:billable:client1
@ -180,7 +180,7 @@ $ hledger print -f- --auto
# 10.
$ hledger -f- print --auto
2018/01/01 ; modified:
2018-01-01 ; modified:
Expenses:Joint:Widgets $100.00 @ £0.50
Expenses:Joint $-100.00 @ £0.50 ; generated-posting: = ^Expenses:Joint
Liabilities:Joint:Bob $50.00 @ £0.50 ; generated-posting: = ^Expenses:Joint
@ -202,7 +202,7 @@ $ hledger -f- print --auto
# 11.
$ hledger -f- print --auto
2018/01/01 ; modified:
2018-01-01 ; modified:
Expenses:Joint:Widgets $100.00 @@ £50
Expenses:Joint $-100.00 @@ £50 ; generated-posting: = ^Expenses:Joint
Liabilities:Joint:Bob $50.00 @@ £25 ; generated-posting: = ^Expenses:Joint
@ -231,7 +231,7 @@ $ hledger -f- print --auto
# 12.
$ hledger -f- print --auto
2018/01/01 ; modified:
2018-01-01 ; modified:
Expenses:Joint:Widgets $100.00
Expenses:Joint $-100.00 @@ £50 ; generated-posting: = ^Expenses:Joint
Liabilities:Joint:Bob $50.00 @@ £25 ; generated-posting: = ^Expenses:Joint
@ -259,11 +259,11 @@ $ hledger -f- print --auto
# 13.
$ hledger print -f- --auto --forecast -b 2016-01 -e 2016-03
2016/01/03 withdraw
2016-01-03 withdraw
assets:cash $20
assets:bank
2016/02/01 paycheck
2016-02-01 paycheck
; generated-transaction: ~ monthly from 2016-01, modified:
income:remuneration $-100
(liabilities:tax) $-33 ; income tax, generated-posting: = ^income
@ -275,11 +275,11 @@ $ hledger print -f- --auto --forecast -b 2016-01 -e 2016-03
# 14. and they don't force --auto on
$ hledger print -f- --forecast -b 2016-01 -e 2016-03
2016/01/03 withdraw
2016-01-03 withdraw
assets:cash $20
assets:bank
2016/02/01 paycheck
2016-02-01 paycheck
; generated-transaction: ~ monthly from 2016-01
income:remuneration $-100
income:donations $-15
@ -299,7 +299,7 @@ $ hledger print -f- --forecast -b 2016-01 -e 2016-03
# 15.
$ hledger -f- register --auto
2020/10/07 MARKET ex:groceries:food $20 $20
2020-10-07 MARKET ex:groceries:food $20 $20
[budget:groceries] $-20 0
[as:bank:checking] $20 $20
assets:bank:checking $-20 0
@ -316,7 +316,7 @@ $ hledger -f- register --auto
# 16. Transaction balancing sees auto postings ?
# $ hledger -f- print -x --auto
# 2018/12/18
# 2018-12-18
# a EUR -10.00 ; :tax20:
# taxes EUR -2.00
# b EUR 12.00

View File

@ -348,7 +348,7 @@ hledger -f- print
2019/01/01
(a) 1A @ 1B = 1A @ 2B
>>>
2019/01/01
2019-01-01
(a) 1A @ 1B = 1A @ 2B
>>>=0
@ -360,7 +360,7 @@ hledger -f- print --explicit
2019/01/01
(a) = 1A @ 2B
>>>
2019/01/01
2019-01-01
(a) 1A @ 2B = 1A @ 2B
>>>=0
@ -420,7 +420,7 @@ hledger -f- print
(a:b) 0 =* Y7
(a:b) 0 ==* Y7
>>>
2019/01/01
2019-01-01
(a) X1
(a) Y3
(a:b) Y7

View File

@ -23,7 +23,7 @@ hledger -f - print
; trailing file comment, ignored
>>>
2009/01/01 x ; transaction same line comment
2009-01-01 x ; transaction same line comment
; transaction new line comment
a 1 ; posting 1 same line comment
; posting 1 new line comment
@ -38,7 +38,7 @@ hledger -f - print
<<<
2017/1/1 this # and * are not ; the comment
>>>
2017/01/01 this # and * are not ; the comment
2017-01-01 this # and * are not ; the comment
>>>2
>>>=0
@ -58,7 +58,7 @@ hledger -f - register
b
>>>
2010/01/01 x a 1 1
2010-01-01 x a 1 1
b -1 0
>>>2
>>>=0

View File

@ -22,7 +22,7 @@ hledger -f- print
a 1
b
>>>
2000/02/29 x
2000-02-29 x
a 1
b

View File

@ -10,7 +10,7 @@ hledger -f- print
a 1000
b
>>>
2010/01/01
2010-01-01
a 1000
b
@ -24,7 +24,7 @@ D £1000.00
a 1000
b
>>>
2010/01/01
2010-01-01
a £1000.00
b
@ -38,7 +38,7 @@ D $1,000
a 1000
b
>>>
2010/01/01
2010-01-01
a $1000,000
b
@ -51,7 +51,7 @@ D $1,000.0
2010/1/1
(a) 1000000
>>>
2010/01/01
2010-01-01
(a) $1,000,000.0
>>>=0
@ -66,7 +66,7 @@ D $1,000.0
(a) $1000000.00
(b) 1000000
>>>
2010/01/01
2010-01-01
(a) $1,000,000.00
(b) $1,000,000.00
@ -85,7 +85,7 @@ D $1000.
(a) €1
>>>
2018/01/01 ; modified:
2018-01-01 ; modified:
(a) €1
(b) €2 ; generated-posting: = a

View File

@ -25,9 +25,9 @@ account b L
(b:bb) 3
$ hledger -f - bs -N --flat
Balance Sheet 2018/01/01
Balance Sheet 2018-01-01
|| 2018/01/01
|| 2018-01-01
=============++============
Assets ||
-------------++------------
@ -46,9 +46,9 @@ Balance Sheet 2018/01/01
# It must be shown above bb, but since not an asset, its balance is excluded there.
# It is shown again in the liabilities section, this time with balance.
$ hledger -f - bs -N
Balance Sheet 2018/01/01
Balance Sheet 2018-01-01
|| 2018/01/01
|| 2018-01-01
=============++============
Assets ||
-------------++------------

View File

@ -1,16 +1,16 @@
# 1. nested includes in subdirectories
mkdir -p b/c/d ; printf '2010/1/1\n (D) 1\n' >b/c/d/d.journal ; printf '2010/1/1\n (C) 1\n!include d/d.journal\n' >b/c/c.journal ; printf '2010/1/1\n (B) 1\n!include c/c.journal\n' >b/b.journal ; printf '2010/1/1\n (A) 1\n!include b/b.journal\n' >a.journal ; hledger -f a.journal print; rm -rf a.journal b
>>>
2010/01/01
2010-01-01
(A) 1
2010/01/01
2010-01-01
(B) 1
2010/01/01
2010-01-01
(C) 1
2010/01/01
2010-01-01
(D) 1
>>>2
@ -25,13 +25,13 @@ hledger -f - print
include a.timeclock
include b.timedot
>>>
2016/01/01
2016-01-01
(x) 1.00
2016/01/01 * 12:00-16:00
2016-01-01 * 12:00-16:00
(a:aa) 4.00h
2016/01/01 *
2016-01-01 *
(b.bb) 1.00
>>>=0
@ -41,10 +41,10 @@ include b.timedot
<<<
include *b.journal
>>>
2018/01/01
2018-01-01
(A) 1
2018/01/01
2018-01-01
(B) 1
>>>=0
@ -66,7 +66,7 @@ include doesnotexist.journal
<<<
include ~/included.journal
>>>
2018/01/01
2018-01-01
(A) 1
>>>2

View File

@ -5,7 +5,7 @@ hledger -f - print
b (b) b -1
c
>>>
2009/01/01 x
2009-01-01 x
a 2
b (b) b -1
c

View File

@ -27,7 +27,7 @@ expecting date separator or digit
# But in this case the timedot reader can parse it.
$ hledger -f - print
>
2018/01/01 *
2018-01-01 *
(a) 1.00
>=
@ -51,7 +51,7 @@ $ hledger -f journal:- print
# 5. hledger doesn't detect this as an error directly, it parses account name "(a) 1" and
# amount 0 here.
$ hledger -f - print -x
2018/01/01
2018-01-01
(a) 1 0
>=

View File

@ -5,7 +5,7 @@ hledger -f- register
<<<
2000/1/2
a 0 ; date: 3/4, date: 4-5, date:6.7
>>> /^2000\/03\/04/
>>> /^2000-03-04/
>>>=0
# 2. If the date: or date2: tags do not have a valid simple date
@ -33,7 +33,7 @@ hledger -f- register --date2
<<<
2000/1/2
a 0 ; [=3-4]
>>> /^2000\/03\/04/
>>> /^2000-03-04/
>>>=0
# 4. Date parsing and error reporting activates for square brackets

View File

@ -8,7 +8,7 @@ hledger -f - print
A 55.3653 C @ 30.92189512 D
A -1712 D
>>>
2010/01/01 x
2010-01-01 x
A 55.3653 C @ 30.92189512 D
A -1712 D
@ -24,7 +24,7 @@ hledger -f - print --explicit
a 1C @ $1.0049
a
>>>
2010/01/01
2010-01-01
a 0
a 1C @ $1.0049
a $-1.00
@ -122,7 +122,7 @@ hledger -f- print --explicit
c C 11.00
d D -320.00
>>>
2015/01/01
2015-01-01
c C 10.00 @ D 15.2381
c C 11.00 @ D 15.2381
d D -320.00
@ -139,7 +139,7 @@ hledger -f- print --explicit
e E 11
f F -320.000
>>>
2015/01/01
2015-01-01
e E 10.0000 @ F 15.2380952
e E 11.0000 @ F 15.2380952
f F -320.000

View File

@ -37,7 +37,7 @@ commodity $1,000.00000000
c $1E+3
d
>>>
2018/01/01
2018-01-01
a $105.00000000
b $3.14159260
c $1,000.00000000

View File

@ -3,15 +3,15 @@
# 1. transactions and postings have status marks which are nothing, ! or *
hledger -fstatus.journal print
>>>
2017/01/01 unmarked
2017-01-01 unmarked
(a) 1
(b) 1
2017/01/02 ! pending
2017-01-02 ! pending
(a) 1
! (b) 1
2017/01/03 * cleared
2017-01-03 * cleared
(a) 1
* (b) 1
@ -22,7 +22,7 @@ hledger -f- print desc:%
<<<
2017/01/01 %
>>>
2017/01/01 %
2017-01-01 %
>>>=0
@ -31,7 +31,7 @@ hledger -f- print desc:%
# 3. --cleared matches * only
hledger -fstatus.journal print --cleared
>>>
2017/01/03 * cleared
2017-01-03 * cleared
(a) 1
* (b) 1
@ -40,7 +40,7 @@ hledger -fstatus.journal print --cleared
# 4. --pending matches ! only
hledger -fstatus.journal print --pending
>>>
2017/01/02 ! pending
2017-01-02 ! pending
(a) 1
! (b) 1
@ -49,7 +49,7 @@ hledger -fstatus.journal print --pending
# 5. --unmarked matches no status mark only
hledger -fstatus.journal print --unmarked
>>>
2017/01/01 unmarked
2017-01-01 unmarked
(a) 1
(b) 1
@ -58,9 +58,9 @@ hledger -fstatus.journal print --unmarked
# 6. these flags can be combined
hledger -fstatus.journal register --unmarked --pending
>>>
2017/01/01 unmarked (a) 1 1
2017-01-01 unmarked (a) 1 1
(b) 1 2
2017/01/02 pending (a) 1 3
2017-01-02 pending (a) 1 3
(b) 1 4
>>>= 0
@ -76,7 +76,7 @@ hledger -fstatus.journal balance -N --unmarked
# 8. status:* matches * only
hledger -fstatus.journal print status:*
>>>
2017/01/03 * cleared
2017-01-03 * cleared
(a) 1
* (b) 1
@ -85,7 +85,7 @@ hledger -fstatus.journal print status:*
# 9. status:! matches ! only
hledger -fstatus.journal print status:!
>>>
2017/01/02 ! pending
2017-01-02 ! pending
(a) 1
! (b) 1
@ -94,7 +94,7 @@ hledger -fstatus.journal print status:!
# 10. status: matches unmarked only
hledger -fstatus.journal print status:
>>>
2017/01/01 unmarked
2017-01-01 unmarked
(a) 1
(b) 1
@ -103,11 +103,11 @@ hledger -fstatus.journal print status:
# 11. multiple status: queries are OR'd
hledger -fstatus.journal print status: status:!
>>>
2017/01/01 unmarked
2017-01-01 unmarked
(a) 1
(b) 1
2017/01/02 ! pending
2017-01-02 ! pending
(a) 1
! (b) 1

View File

@ -6,7 +6,7 @@ hledger -f- print --explicit
expenses:foreign currency €100 @ $1.35
assets
>>>
2011/01/01
2011-01-01
expenses:foreign currency €100 @ $1.35
assets $-135.00
@ -19,7 +19,7 @@ hledger -f- print --explicit --cost
expenses:foreign currency €100 @ $1.35
assets
>>>
2011/01/01
2011-01-01
expenses:foreign currency $135.00
assets $-135.00
@ -32,7 +32,7 @@ hledger -f - print --explicit
expenses:foreign currency €100 @@ $135
assets
>>>
2011/01/01
2011-01-01
expenses:foreign currency €100 @@ $135
assets $-135
@ -50,7 +50,7 @@ hledger -f - print --explicit
misc €-1
misc $-2.1
>>>
2011/01/01
2011-01-01
expenses:foreign currency €100 @ $1.35
misc $2.10
assets $-135.00
@ -67,7 +67,7 @@ hledger -f - print --explicit
c56a21d23a6535184e7152ee138c28974f14280c 866.231000 GGGGG
a35e82730cf91569c302b313780e5895f75a62b9 $-17,783.72
>>>
2002/09/30 * 1a1a6305d06ce4b284dba0d267c23f69d70c20be
2002-09-30 * 1a1a6305d06ce4b284dba0d267c23f69d70c20be
c56a21d23a6535184e7152ee138c28974f14280c 866.231000 GGGGG @@ $17,783.72
a35e82730cf91569c302b313780e5895f75a62b9 $-17,783.72

View File

@ -100,7 +100,7 @@ P 2000/1/1 $ €1.20
(a) $100
$ hledger -f- reg -V
2000/01/01 (a) €120.00 €120.00
2000-01-01 (a) €120.00 €120.00
# 8. print -V affects posting amounts but not balance assertions.
@ -110,7 +110,7 @@ P 2000/1/1 $ €1.20
(a) $100 = $100
$ hledger -f- print -V
2000/01/01
2000-01-01
(a) €120.00 = $100
>=0
@ -137,23 +137,23 @@ P 2000/04/01 A 4 B
# 9. print costs using transaction prices
$ hledger -f- print --value=cost
2000/01/01
2000-01-01
(a) 6 B
2000/02/01
2000-02-01
(a) 7 B
2000/03/01
2000-03-01
(a) 8 B
>=0
# 10. print value using prices on last day of report period (2000-02-29)
$ hledger -f- print --value=end date:2000/01-2000/03
2000/01/01
2000-01-01
(a) 2 B
2000/02/01
2000-02-01
(a) 2 B
>=0
@ -161,26 +161,26 @@ $ hledger -f- print --value=end date:2000/01-2000/03
# 11. print value using prices on last day of report period (no period specified)
# specified - uses last day of journal (2000-03-01)
$ hledger -f- print --value=end
2000/01/01
2000-01-01
(a) 3 B
2000/02/01
2000-02-01
(a) 3 B
2000/03/01
2000-03-01
(a) 3 B
>=0
# 12. print value using prices on a specified date
$ hledger -f- print --value=2000-01-15
2000/01/01
2000-01-01
(a) 5 B
2000/02/01
2000-02-01
(a) 5 B
2000/03/01
2000-03-01
(a) 5 B
>=0
@ -188,13 +188,13 @@ $ hledger -f- print --value=2000-01-15
# 13. print value using prices today
# (assuming today's date is >= 2000-04-01)
$ hledger -f- print --value=now
2000/01/01
2000-01-01
(a) 4 B
2000/02/01
2000-02-01
(a) 4 B
2000/03/01
2000-03-01
(a) 4 B
>=0
@ -203,53 +203,53 @@ $ hledger -f- print --value=now
# 14. register report valued at cost.
$ hledger -f- reg --value=cost
2000/01/01 (a) 6 B 6 B
2000/02/01 (a) 7 B 13 B
2000/03/01 (a) 8 B 21 B
2000-01-01 (a) 6 B 6 B
2000-02-01 (a) 7 B 13 B
2000-03-01 (a) 8 B 21 B
# 15. register report valued at period end
$ hledger -f- reg --value=end
2000/01/01 (a) 3 B 3 B
2000/02/01 (a) 3 B 6 B
2000/03/01 (a) 3 B 9 B
2000-01-01 (a) 3 B 3 B
2000-02-01 (a) 3 B 6 B
2000-03-01 (a) 3 B 9 B
# 16. register report valued at specified date
$ hledger -f- reg --value=2000-01-15
2000/01/01 (a) 5 B 5 B
2000/02/01 (a) 5 B 10 B
2000/03/01 (a) 5 B 15 B
2000-01-01 (a) 5 B 5 B
2000-02-01 (a) 5 B 10 B
2000-03-01 (a) 5 B 15 B
# 17. register report valued today
$ hledger -f- reg --value=now
2000/01/01 (a) 4 B 4 B
2000/02/01 (a) 4 B 8 B
2000/03/01 (a) 4 B 12 B
2000-01-01 (a) 4 B 4 B
2000-02-01 (a) 4 B 8 B
2000-03-01 (a) 4 B 12 B
# 18. single-period register report valued at default date (same as --value=now)
$ hledger -f- reg -V
2000/01/01 (a) 4 B 4 B
2000/02/01 (a) 4 B 8 B
2000/03/01 (a) 4 B 12 B
2000-01-01 (a) 4 B 4 B
2000-02-01 (a) 4 B 8 B
2000-03-01 (a) 4 B 12 B
# register with -H (starting balance)
# 19. register with starting balance, valued at cost.
$ hledger -f- reg --value=cost -b 200002 -H
2000/02/01 (a) 7 B 13 B
2000/03/01 (a) 8 B 21 B
2000-02-01 (a) 7 B 13 B
2000-03-01 (a) 8 B 21 B
# 20. register with starting balance, valued at period end.
# That is unspecified so the last posting date is used, ie 2000/3/1, so the price is 3 B.
# Starting balance is 5 B as above.
$ hledger -f- reg --value=end -b 200002 -H
2000/02/01 (a) 3 B 8 B
2000/03/01 (a) 3 B 11 B
2000-02-01 (a) 3 B 8 B
2000-03-01 (a) 3 B 11 B
# 21. register with starting balance, valued at specified date (when the price is 5 B).
# Starting balance is 5 B as above.
$ hledger -f- reg --value=2000-01-15 -b 200002 -H
2000/02/01 (a) 5 B 10 B
2000/03/01 (a) 5 B 15 B
2000-02-01 (a) 5 B 10 B
2000-03-01 (a) 5 B 15 B
# register, periodic
@ -378,7 +378,7 @@ Balance changes in 2000q1, valued at period ends:
# 35. multicolumn balance report valued at other date
$ hledger -f- bal -MTA --value=2000-01-15
Balance changes in 2000q1, valued at 2000/01/15:
Balance changes in 2000q1, valued at 2000-01-15:
|| Jan Feb Mar Total Average
===++=================================
@ -413,9 +413,9 @@ Balance changes in 2000q1, valued at period ends:
# February adds 1 A costing 7 B, making 13 B.
# March adds 1 A costing 8 B, making 21 B.
$ hledger -f- bal -M -H -b 200002 --value=cost
Ending balances (historical) in 2000/02/01-2000/03/31, valued at cost:
Ending balances (historical) in 2000-02-01-2000-03-31, valued at cost:
|| 2000/02/29 2000/03/31
|| 2000-02-29 2000-03-31
===++========================
a || 13 B 21 B
---++------------------------
@ -426,9 +426,9 @@ Ending balances (historical) in 2000/02/01-2000/03/31, valued at cost:
# February adds 1 A making 2 A, which is valued at 2000/02/29 as 4 B.
# March adds 1 A making 3 A, which is valued at 2000/03/31 as 9 B.
$ hledger -f- bal -MA -H -b 200002 --value=end
Ending balances (historical) in 2000/02/01-2000/03/31, valued at period ends:
Ending balances (historical) in 2000-02-01-2000-03-31, valued at period ends:
|| 2000/02/29 2000/03/31 Average
|| 2000-02-29 2000-03-31 Average
===++=================================
a || 4 B 9 B 6 B
---++---------------------------------
@ -437,9 +437,9 @@ Ending balances (historical) in 2000/02/01-2000/03/31, valued at period ends:
# 40. multicolumn balance report with -H valued at other date.
# The starting balance is 5 B (1 A valued at 2000/1/15).
$ hledger -f- bal -M -H -b 200002 --value=2000-01-15
Ending balances (historical) in 2000/02/01-2000/03/31, valued at 2000/01/15:
Ending balances (historical) in 2000-02-01-2000-03-31, valued at 2000-01-15:
|| 2000/02/29 2000/03/31
|| 2000-02-29 2000-03-31
===++========================
a || 10 B 15 B
---++------------------------
@ -459,7 +459,7 @@ P 2000/04/01 A 4 B
$ hledger -f- bal -ME -H -p200001-200004 --value=c
Ending balances (historical) in 2000q1, valued at cost:
|| 2000/01/31 2000/02/29 2000/03/31
|| 2000-01-31 2000-02-29 2000-03-31
===++====================================
a || 6 B 6 B 6 B
---++------------------------------------
@ -470,7 +470,7 @@ Ending balances (historical) in 2000q1, valued at cost:
$ hledger -f- bal -META -H -p200001-200004 --value=e
Ending balances (historical) in 2000q1, valued at period ends:
|| 2000/01/31 2000/02/29 2000/03/31 Average
|| 2000-01-31 2000-02-29 2000-03-31 Average
===++=============================================
a || 5 B 2 B 3 B 3 B
---++---------------------------------------------
@ -478,9 +478,9 @@ Ending balances (historical) in 2000q1, valued at period ends:
# 43. multicolumn balance report with -H, valuing each period's carried-over balances at other date.
$ hledger -f- bal -ME -H -p200001-200004 --value=2000-01-15
Ending balances (historical) in 2000q1, valued at 2000/01/15:
Ending balances (historical) in 2000q1, valued at 2000-01-15:
|| 2000/01/31 2000/02/29 2000/03/31
|| 2000-01-31 2000-02-29 2000-03-31
===++====================================
a || 5 B 5 B 5 B
---++------------------------------------
@ -540,7 +540,7 @@ Budget performance in 2000q1, valued at period ends:
# 47. budget report, valued at other date.
$ hledger -f- bal -MTA --budget --value=2000-01-15
Budget performance in 2000q1, valued at 2000/01/15:
Budget performance in 2000q1, valued at 2000-01-15:
|| Jan Feb Mar Total Average
===++==========================================================================================================

View File

@ -17,7 +17,7 @@ comment
# 1. normal unvalued output
$ hledger -f- print -x
2019/06/01
2019-06-01
a 1 B
b -1 B
@ -25,7 +25,7 @@ $ hledger -f- print -x
# 2. current market value in default valuation commodity
$ hledger -f- print -x -V
2019/06/01
2019-06-01
a 10 A
b -10 A
@ -33,7 +33,7 @@ $ hledger -f- print -x -V
# 3. same as above, but request commodity A explicitly
$ hledger -f- print -x --value=now,A
2019/06/01
2019-06-01
a 10 A
b -10 A
@ -41,7 +41,7 @@ $ hledger -f- print -x --value=now,A
# 4. request commodity B - no effect
$ hledger -f- print -x --value=now,B
2019/06/01
2019-06-01
a 1 B
b -1 B
@ -49,7 +49,7 @@ $ hledger -f- print -x --value=now,B
# 5. request commodity we don't have prices for - no effect
$ hledger -f- print -x --value=now,Z
2019/06/01
2019-06-01
a 1 B
b -1 B
@ -61,7 +61,7 @@ $ hledger -f- print -x --value=now,Z
# And because that makes it display as zero, the commodity symbol
# and sign are not shown either.
$ hledger -f- print -x --value=now,C
2019/06/01
2019-06-01
a 0
b 0
@ -70,7 +70,7 @@ $ hledger -f- print -x --value=now,C
# # but the precision is increased to show the decimal digit
# # (otherwise it would show C0).
# $ hledger -f- print -x --value=now,C
# 2019/06/01
# 2019-06-01
# a C0.5
# b C-0.5
#
@ -78,7 +78,7 @@ $ hledger -f- print -x --value=now,C
# 7. request commodity D - chains B->A, A->D prices
$ hledger -f- print -x --value=now,D
2019/06/01
2019-06-01
a 1000 D
b -1000 D
@ -87,7 +87,7 @@ $ hledger -f- print -x --value=now,D
# 8. request commodity E - chains B->A, A->D, reverse of D->E prices.
# As with C above, E gets the default display style, with precision 0.
$ hledger -f- print -x --value=now,E
2019/06/01
2019-06-01
a E333
b E-333
@ -95,7 +95,7 @@ $ hledger -f- print -x --value=now,E
# # As with C above, E gets the default display style, but with the precision
# # increased to show the decimal digits, but no more than 8.
# $ hledger -f- print -x --value=now,E
# 2019/06/01
# 2019-06-01
# a E333.33333333
# b E-333.33333333
#
@ -112,7 +112,7 @@ $ hledger -f- print -x --value=now,E
# 9. Normal print output.
$ hledger -f- print
2000/01/01
2000-01-01
a -1A @ 1B
b 1B
@ -120,7 +120,7 @@ $ hledger -f- print
# 10. Valuing in a commodity with no market price has no effect.
$ hledger -f- print -XZ
2000/01/01
2000-01-01
a -1A @ 1B
b 1B
@ -128,7 +128,7 @@ $ hledger -f- print -XZ
# 11. -B converts to the transaction price's commodity.
$ hledger -f- print -B
2000/01/01
2000-01-01
a -1B
b 1B
@ -137,7 +137,7 @@ $ hledger -f- print -B
# 12. Note the -XZ nullifies the -B here, because both are forms of --value
# (-B -XZ is equivalent to --value=cost --value=end,Z), and the rightmost wins.
$ hledger -f- print -B -XZ
2000/01/01
2000-01-01
a -1A @ 1B
b 1B
@ -153,7 +153,7 @@ P 2000/1/1 A 1B
# 13.
$ hledger -f- print
2000/01/01
2000-01-01
a -1A @ 1B
b 1B
@ -161,7 +161,7 @@ $ hledger -f- print
# 14.
$ hledger -f- print -XZ
2000/01/01
2000-01-01
a -1A @ 1B
b 1B
@ -169,7 +169,7 @@ $ hledger -f- print -XZ
# 15.
$ hledger -f- print -B
2000/01/01
2000-01-01
a -1B
b 1B
@ -177,7 +177,7 @@ $ hledger -f- print -B
# 16.
$ hledger -f- print -B -XZ
2000/01/01
2000-01-01
a -1A @ 1B
b 1B
@ -193,11 +193,11 @@ P 2002/01/01 A 3 B
# 17. -V uses today as the default valuation date, unlike --value=end.
$ hledger -f- reg -V
2000/01/01 (a) 3 B 3 B
2000-01-01 (a) 3 B 3 B
# 18. -V uses the report end date, if specified, as valuation date.
$ hledger -f- reg -V -e 2001
2000/01/01 (a) 2 B 2 B
2000-01-01 (a) 2 B 2 B
# 19. In balance reports too.
$ hledger -f- bal -N -V

View File

@ -8,7 +8,7 @@ hledger -f- --pivot TAG print
Account2 -2 EUR
; TAG: value
>>>
2016/02/16 Test Transaction
2016-02-16 Test Transaction
2 EUR
value -2 EUR
; TAG: value
@ -50,7 +50,7 @@ hledger -f- --pivot TAG reg '^Account2$' '^fun$' not:hidden
Account2 -1 EUR
; TAG: hidden
>>>
2016/02/16 Test Transaction fun 2 EUR 2 EUR
2016-02-16 Test Transaction fun 2 EUR 2 EUR
value -1 EUR 1 EUR
>>>=0
@ -63,7 +63,7 @@ hledger -f- --pivot expenses reg not:liabilities
assets $5 ; expenses:c
liabilities $-1605
>>>
2017/01/01 prepay a $1500 $1500
2017-01-01 prepay a $1500 $1500
b $100 $1600
c $5 $1605
>>>=0
@ -97,7 +97,7 @@ hledger -f- --pivot code reg ^income
assets:bank account 2 EUR
income:donations -2 EUR
>>>
2016/02/16 Donation Freifunk Freifunk -2 EUR -2 EUR
2016-02-16 Donation Freifunk Freifunk -2 EUR -2 EUR
>>>=0
# get expenses balance by description/payee
@ -132,7 +132,7 @@ hledger -f- --pivot payee reg -D ^expense
assets:bank account
expense:grocery 30 EUR
>>>
2016/02/16 Auchan 22 EUR 22 EUR
2016-02-16 Auchan 22 EUR 22 EUR
StarBars 5 EUR 27 EUR
2016/02/17 Auchan 30 EUR 57 EUR
2016-02-17 Auchan 30 EUR 57 EUR
>>>=0

View File

@ -8,10 +8,10 @@ hledger -f - print
(b) 1
>>>
2000/01/01=2000/03/03
2000-01-01=2000-03-03
(a) 1
2000/01/02=2000/02/02
2000-01-02=2000-02-02
(b) 1
>>>2
@ -27,10 +27,10 @@ hledger -f - print --date2
(b) 1
>>>
2000/01/02=2000/02/02
2000-01-02=2000-02-02
(b) 1
2000/01/01=2000/03/03
2000-01-01=2000-03-03
(a) 1
>>>2

View File

@ -7,7 +7,7 @@ hledger -f - print
expenses $5
assets
>>>
2017/01/01
2017-01-01
expenses $5
assets
@ -21,7 +21,7 @@ hledger -f - print --explicit
expenses $5
assets
>>>
2017/01/01
2017-01-01
expenses $5
assets $-5
@ -35,7 +35,7 @@ hledger -f - print
expenses 4 EUR
assets $-5
>>>
2017/01/01
2017-01-01
expenses 4 EUR
assets $-5
@ -49,7 +49,7 @@ hledger -f - print --explicit
expenses 4 EUR
assets $-5
>>>
2017/01/01
2017-01-01
expenses 4 EUR @@ $5
assets $-5
@ -63,7 +63,7 @@ hledger -f - print
assets = $100
equity
>>>
2017/01/01
2017-01-01
assets = $100
equity
@ -77,7 +77,7 @@ hledger -f - print --explicit
assets = $100
equity
>>>
2017/01/01
2017-01-01
assets $100 = $100
equity $-100
@ -92,7 +92,7 @@ D 1000.00 EUR
expenses 100
assets
>>>
2017/01/01
2017-01-01
expenses 100.00 EUR
assets
@ -106,7 +106,7 @@ hledger -f - print --explicit
assets $0
equity
>>>
2017/01/01
2017-01-01
assets 0
equity 0

View File

@ -4,7 +4,7 @@ hledger -f - print
aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1
b
>>>
2009/01/01 x
2009-01-01 x
aaaaabbbbbcccccdddddeeeeefffffggggghhhhh 1
b

View File

@ -9,7 +9,7 @@ hledger -f - print desc:x
b
>>>
2009/01/01 x
2009-01-01 x
a 1
b

View File

@ -12,7 +12,7 @@ hledger -f - print
; posting-2-tag-2:
; non-metadata:
>>>
2010/01/01 ; txntag1: txn val 1
2010-01-01 ; txntag1: txn val 1
; txntag2: txn val 2
a 1
; posting1tag1: posting 1 val 1
@ -38,11 +38,11 @@ hledger -f - print tag:foo
e 1
f -1
>>>
2010/01/01 ; foo:bar
2010-01-01 ; foo:bar
a 1
b -1
2010/01/02 ; foo:baz
2010-01-02 ; foo:baz
c 1
d -1
@ -65,7 +65,7 @@ hledger -f - print tag:foo=bar
e 1
f -1
>>>
2010/01/01 ; foo:bar
2010-01-01 ; foo:bar
a 1
b -1
@ -87,8 +87,8 @@ hledger -f - register tag:foo=bar
e 1
f -1
>>>
2010/01/01 a 1 1
2010/01/03 e 1 2
2010-01-01 a 1 1
2010-01-03 e 1 2
f -1 1
>>>2
>>>=0
@ -113,15 +113,15 @@ hledger -f - print not:tag:.
g 4
h -4
>>>
2010/01/01 desc
2010-01-01 desc
a 1
b -1
2010/01/03
2010-01-03
e 3
f -3
2010/01/04 (code)
2010-01-04 (code)
g 4
h -4

View File

@ -11,8 +11,8 @@
(a) 1
$ hledger -f- register -A
2019/01/01 (a) 1.0 1.0
2019/01/02 (a) 1.0 1.0
2019/01/03 (a) 1.0 1.0
2019/01/04 (a) 1.0 1.0
2019-01-01 (a) 1.0 1.0
2019-01-02 (a) 1.0 1.0
2019-01-03 (a) 1.0 1.0
2019-01-04 (a) 1.0 1.0
>=

View File

@ -12,7 +12,7 @@ hledger -f - register --date2
a 1
b
>>>
2010/01/01 x a 1 1
2010-01-01 x a 1 1
b -1 0
>>>=0
@ -25,7 +25,7 @@ hledger -f- register -p 2014/1/2 --date2
2014/1/3
(b) 1
>>>
2014/01/02 (a) 1 1
2014-01-02 (a) 1 1
>>>=0
# 3. --date2 causes date: to match the secondary date
@ -37,7 +37,7 @@ hledger -f- register date:2014/1/2 --date2
2014/1/3
(b) 1
>>>
2014/01/02 (a) 1 1
2014-01-02 (a) 1 1
>>>=0
# 4. date2: matches the secondary date (but does not necessarily display it)
@ -49,7 +49,7 @@ hledger -f- register date2:2014/1/2
2014/1/3
(b) 1
>>>
2014/01/01 (a) 1 1
2014-01-01 (a) 1 1
>>>=0
# 5. date2: plus --date2 both matches and displays the secondary date
@ -61,7 +61,7 @@ hledger -f- register date2:2014/1/2 --date2
2014/1/3
(b) 1
>>>
2014/01/02 (a) 1 1
2014-01-02 (a) 1 1
>>>=0
# 6. date2: matching is not affected by --date2
@ -84,6 +84,6 @@ hledger -f- register --date2
2014/1/3=2/1
(b) 1
>>>
2014/02/01 (b) 1 1
2014/02/02 (a) 1 2
2014-02-01 (b) 1 1
2014-02-02 (a) 1 2
>>>=0

View File

@ -5,7 +5,7 @@ hledger -f - register aa --depth 1
a:aa:aaa 1
b
>>>
2010/01/01 x a 1 1
2010-01-01 x a 1 1
>>>=0
# 2. separate postings remain separate
@ -23,9 +23,9 @@ hledger -f - register aa --depth 2
a:aa 1
b:bb:bbb
>>>
2010/01/01 x a:aa 1 1
2010/01/01 y a:aa 1 2
2010/01/02 z a:aa 1 3
2010-01-01 x a:aa 1 1
2010-01-01 y a:aa 1 2
2010-01-02 z a:aa 1 3
>>>=0
# 3. with a reporting interval, all postings are aggregated under each (clipped) account
@ -43,8 +43,8 @@ hledger -f - register aa --depth 1 --daily
a:aa 1
b:bb:bbb
>>>
2010/01/01 a 2 2
2010/01/02 a 1 3
2010-01-01 a 2 2
2010-01-02 a 1 3
>>>=0
# 4. with --cleared
@ -53,7 +53,7 @@ hledger -f - register a --depth 1 --cleared
2012/1/1 *
(a:aa) 1
>>>
2012/01/01 (a) 1 1
2012-01-01 (a) 1 1
>>>2
>>>=0
@ -75,7 +75,7 @@ hledger -f - register --depth 0 --daily a b
b:bb 2
c:cc
>>>
2010/01/01 ... 6 6
2010/01/02 ... 3 9
2010-01-01 ... 6 6
2010-01-02 ... 3 9
>>>=0

View File

@ -10,6 +10,6 @@ hledger -f- register date:2014/4
(a) 1
>>>
2014/04/01 (a) 1 1
2014-04-01 (a) 1 1
>>>2
>>>= 0

View File

@ -10,14 +10,14 @@ hledger rewrite -f- ^income --add-posting '(liabilities:tax) *.33 ; income tax
assets:cash $20
assets:bank
>>>
2016/01/01 paycheck ; modified:
2016-01-01 paycheck ; modified:
income:remuneration $-100
(liabilities:tax) $-33 ; income tax, generated-posting: = ^income
income:donations $-15
(liabilities:tax) $-5 ; income tax, generated-posting: = ^income
assets:bank
2016/01/01 withdraw
2016-01-01 withdraw
assets:cash $20
assets:bank
@ -36,14 +36,14 @@ hledger rewrite -f- expenses:gifts --add-posting '(budget:gifts) *-1'
assets:cash $-15
expenses:gifts ; [1/2]
>>>
2016/01/01 withdraw
2016-01-01 withdraw
assets:cash $20
assets:bank
2016/01/01 gift ; modified:
2016-01-01 gift ; modified:
assets:cash $-15
expenses:gifts ; [1/2]
(budget:gifts) $-15 ; [2016/01/02], generated-posting: = expenses:gifts
(budget:gifts) $-15 ; [2016-01-02], generated-posting: = expenses:gifts
>>>2
>>>=0
@ -67,15 +67,15 @@ hledger rewrite -f-
= ^assets:unbilled:client2
(assets:to bill:client2) *150.00 CAD
>>>
2017/04/24 * 09:00-09:25 ; modified:
2017-04-24 * 09:00-09:25 ; modified:
(assets:unbilled:client1) 0.42h
(assets:to bill:client1) 42.00 CAD ; generated-posting: = ^assets:unbilled:client1
2017/04/25 * 10:00-11:15 ; modified:
2017-04-25 * 10:00-11:15 ; modified:
(assets:unbilled:client1) 1.25h
(assets:to bill:client1) 125.00 CAD ; generated-posting: = ^assets:unbilled:client1
2017/04/25 * 14:00-15:32 ; modified:
2017-04-25 * 14:00-15:32 ; modified:
(assets:unbilled:client2) 1.54h
(assets:to bill:client2) 231.00 CAD ; generated-posting: = ^assets:unbilled:client2
@ -104,17 +104,17 @@ hledger rewrite -f- -B
assets:to bill:client2 *1.00 hours @ $150.00
income:consulting:client2
>>>
2017/04/24 * 09:00-09:25 ; modified:
2017-04-24 * 09:00-09:25 ; modified:
(assets:unbilled:client1) 0.42h
assets:to bill:client1 $42.00 ; generated-posting: = ^assets:unbilled:client1
income:consulting:client1 ; generated-posting: = ^assets:unbilled:client1
2017/04/25 * 10:00-11:15 ; modified:
2017-04-25 * 10:00-11:15 ; modified:
(assets:unbilled:client1) 1.25h
assets:to bill:client1 $125.00 ; generated-posting: = ^assets:unbilled:client1
income:consulting:client1 ; generated-posting: = ^assets:unbilled:client1
2017/04/25 * 14:00-15:32 ; modified:
2017-04-25 * 14:00-15:32 ; modified:
(assets:unbilled:client2) 1.54h
assets:to bill:client2 $231.00 ; generated-posting: = ^assets:unbilled:client2
income:consulting:client2 ; generated-posting: = ^assets:unbilled:client2
@ -139,13 +139,13 @@ hledger rewrite -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' -
# income:remuneration $-100
# assets:bank
>>>
2016/01/01 withdraw ; modified:
2016-01-01 withdraw ; modified:
assets:cash $20
assets:bank
expenses:fee $5 ; generated-posting: = assets:bank and "amt:<0"
assets:bank $-5 ; generated-posting: = assets:bank and "amt:<0"
2016/01/02 withdraw ; modified:
2016-01-02 withdraw ; modified:
assets:cash
assets:bank $-30
expenses:fee $5 ; generated-posting: = assets:bank and "amt:<0"
@ -188,12 +188,12 @@ hledger rewrite -f- date:2017/1 --add-posting 'Here comes Santa $0'
= ^expenses not:housing not:grocery not:food
(budget:misc) *-1
>>>
2016/12/31 ; modified:
2016-12-31 ; modified:
expenses:housing $600.00
(budget:housing) $-600.00 ; generated-posting: = ^expenses:housing
assets:cash
2017/01/01 ; modified:
2017-01-01 ; modified:
expenses:food $20.00
(budget:food) $-20.00 ; generated-posting: = ^expenses:grocery ^expenses:food
Here comes Santa 0 ; generated-posting: = date:2017/1
@ -206,7 +206,7 @@ hledger rewrite -f- date:2017/1 --add-posting 'Here comes Santa $0'
assets:cash
Here comes Santa 0 ; generated-posting: = date:2017/1
2017/01/02 ; modified:
2017-01-02 ; modified:
assets:cash $200.00
Here comes Santa 0 ; generated-posting: = date:2017/1
assets:bank
@ -215,7 +215,7 @@ hledger rewrite -f- date:2017/1 --add-posting 'Here comes Santa $0'
(budget:misc) $-1.60 ; generated-posting: = ^expenses not:housing not:grocery not:food
Here comes Santa 0 ; generated-posting: = date:2017/1
2017/02/01
2017-02-01
assets:cash $100.00
assets:bank
@ -237,14 +237,14 @@ hledger rewrite --diff -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee
+++ -
@@ -1,3 +1,5 @@
-2016/01/01 withdraw
+2016/01/01 withdraw ; modified:
+2016-01-01 withdraw ; modified:
assets:cash $20
assets:bank
+ expenses:fee $5 ; generated-posting: = assets:bank and "amt:<0"
+ assets:bank $-5 ; generated-posting: = assets:bank and "amt:<0"
@@ -5,3 +7,5 @@
-2016/01/02 withdraw
+2016/01/02 withdraw ; modified:
+2016-01-02 withdraw ; modified:
assets:cash
assets:bank $-30
+ expenses:fee $5 ; generated-posting: = assets:bank and "amt:<0"

View File

@ -12,7 +12,7 @@ hledger -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Y
+---++------------+------------++---------------+----------+-------------+-----++-------+-------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++=======+=======+
| 1 || 2017/01/01 | 2017/12/31 || 0 | 200 | 200 | 0 || 0.00% | 0.00% |
| 1 || 2017-01-01 | 2017-12-31 || 0 | 200 | 200 | 0 || 0.00% | 0.00% |
+---++------------+------------++---------------+----------+-------------+-----++-------+-------+
>>>=0
@ -31,7 +31,7 @@ hledger -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Y
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++========+========+
| 1 || 2017/01/01 | 2017/12/31 || 0 | 100 | 112 | 12 || 12.00% | 12.00% |
| 1 || 2017-01-01 | 2017-12-31 || 0 | 100 | 112 | 12 || 12.00% | 12.00% |
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
>>>=0
@ -95,7 +95,7 @@ hledger -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Y
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++========+========+
| 1 || 2017/01/01 | 2017/12/31 || 0 | 100 | 112 | 12 || 12.00% | 12.00% |
| 1 || 2017-01-01 | 2017-12-31 || 0 | 100 | 112 | 12 || 12.00% | 12.00% |
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
>>>=0
@ -118,7 +118,7 @@ hledger -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Y
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++========+========+
| 1 || 2017/01/01 | 2017/12/31 || 0 | 200 | 220 | 20 || 12.72% | 10.00% |
| 1 || 2017-01-01 | 2017-12-31 || 0 | 200 | 220 | 20 || 12.72% | 10.00% |
+---++------------+------------++---------------+----------+-------------+-----++--------+--------+
>>>=0
@ -141,7 +141,7 @@ hledger -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Y
+---++------------+------------++---------------+----------+-------------+------++---------+---------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+======++=========+=========+
| 1 || 2017/01/01 | 2017/12/31 || 0 | 200 | 20 | -180 || -95.73% | -90.00% |
| 1 || 2017-01-01 | 2017-12-31 || 0 | 200 | 20 | -180 || -95.73% | -90.00% |
+---++------------+------------++---------------+----------+-------------+------++---------+---------+
>>>=0
@ -172,10 +172,10 @@ hledger -f- roi --inv investment --pnl pnl -b 2017 -e 2018 -Q
+---++------------+------------++---------------+----------+-------------+-----++---------+---------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++=========+=========+
| 1 || 2017/01/01 | 2017/03/31 || 0 | 100 | 100 | 0 || 0.00% | 0.00% |
| 2 || 2017/04/01 | 2017/06/30 || 100 | 0 | 110 | 10 || 46.56% | 46.56% |
| 3 || 2017/07/01 | 2017/09/30 || 110 | 100 | 210 | 0 || 0.00% | 0.00% |
| 4 || 2017/10/01 | 2017/12/31 || 210 | -50 | 155 | -5 || -11.83% | -11.82% |
| 1 || 2017-01-01 | 2017-03-31 || 0 | 100 | 100 | 0 || 0.00% | 0.00% |
| 2 || 2017-04-01 | 2017-06-30 || 100 | 0 | 110 | 10 || 46.56% | 46.56% |
| 3 || 2017-07-01 | 2017-09-30 || 110 | 100 | 210 | 0 || 0.00% | 0.00% |
| 4 || 2017-10-01 | 2017-12-31 || 210 | -50 | 155 | -5 || -11.83% | -11.82% |
+---++------------+------------++---------------+----------+-------------+-----++---------+---------+
>>>=0
@ -206,7 +206,7 @@ hledger -f- roi --inv investment --pnl pnl -b 2017-06 -e 2018
+---++------------+------------++---------------+----------+-------------+-----++-------+--------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++=======+========+
| 1 || 2017/06/01 | 2017/12/31 || 100 | 50 | 155 | 5 || 5.24% | 11.45% |
| 1 || 2017-06-01 | 2017-12-31 || 100 | 50 | 155 | 5 || 5.24% | 11.45% |
+---++------------+------------++---------------+----------+-------------+-----++-------+--------+
>>>=0
@ -221,7 +221,7 @@ hledger -f- roi -p 2019-11
+---++------------+------------++---------------+----------+-------------+-----++-------+-------+
| || Begin | End || Value (begin) | Cashflow | Value (end) | PnL || IRR | TWR |
+===++============+============++===============+==========+=============+=====++=======+=======+
| 1 || 2019/11/01 | 2019/11/30 || 0 | 0 | 0 | 0 || 0.00% | 0.00% |
| 1 || 2019-11-01 | 2019-11-30 || 0 | 0 | 0 | 0 || 0.00% | 0.00% |
+---++------------+------------++---------------+----------+-------------+-----++-------+-------+
>>>=0

View File

@ -9,13 +9,13 @@ o 2009/1/2 09:00:00
i 2009/1/3 08:00:00 some:account name and a description
o 2009/1/3 09:00:00
>>>
2009/01/01 * 08:00-09:00
2009-01-01 * 08:00-09:00
() 1.00h
2009/01/02 * 08:00-09:00
2009-01-02 * 08:00-09:00
(account name) 1.00h
2009/01/03 * and a description
2009-01-03 * and a description
(some:account name) 1.00h
>>>2
@ -46,25 +46,25 @@ o 2009/1/3 09:00:00
#i 2017/04/22 09:00:00 C
#o 2017/04/22 17:00:00
#>>>
#2017/04/20 * 09:00-17:00
#2017-04-20 * 09:00-17:00
# (A) 8.00h
#
#2017/04/21 * 09:00-23:59
#2017-04-21 * 09:00-23:59
# (B) 15.00h
#
#2017/04/22 * 00:00-09:00
#2017-04-22 * 00:00-09:00
# (B) 9.00h
#
#2017/04/22 * 17:00-23:59
#2017-04-22 * 17:00-23:59
# () 7.00h
#
#2017/04/23 * 00:00-23:59
#2017-04-23 * 00:00-23:59
# () 24.00h
#
#2017/04/24 * 00:00-23:59
#2017-04-24 * 00:00-23:59
# () 24.00h
#
#2017/04/25 * 00:00-11:28
#2017-04-25 * 00:00-11:28
# () 11.47h
#
#>>>2