transactionamount -> postingamount
This commit is contained in:
parent
d8fe2aabb2
commit
32a3af8334
@ -368,7 +368,7 @@ normalposting :: GenParser Char LedgerFileCtx Posting
|
||||
normalposting = do
|
||||
status <- ledgerstatus
|
||||
account <- transactionaccountname
|
||||
amount <- transactionamount
|
||||
amount <- postingamount
|
||||
many spacenonewline
|
||||
comment <- ledgercomment
|
||||
restofline
|
||||
@ -381,7 +381,7 @@ virtualposting = do
|
||||
char '('
|
||||
account <- transactionaccountname
|
||||
char ')'
|
||||
amount <- transactionamount
|
||||
amount <- postingamount
|
||||
many spacenonewline
|
||||
comment <- ledgercomment
|
||||
restofline
|
||||
@ -394,7 +394,7 @@ balancedvirtualposting = do
|
||||
char '['
|
||||
account <- transactionaccountname
|
||||
char ']'
|
||||
amount <- transactionamount
|
||||
amount <- postingamount
|
||||
many spacenonewline
|
||||
comment <- ledgercomment
|
||||
restofline
|
||||
@ -417,8 +417,8 @@ ledgeraccountname = do
|
||||
accountnamechar = notFollowedBy (oneOf "()[]") >> nonspace
|
||||
<?> "account name character (non-bracket, non-parenthesis, non-whitespace)"
|
||||
|
||||
transactionamount :: GenParser Char st MixedAmount
|
||||
transactionamount =
|
||||
postingamount :: GenParser Char st MixedAmount
|
||||
postingamount =
|
||||
try (do
|
||||
many1 spacenonewline
|
||||
a <- someamount <|> return missingamt
|
||||
|
||||
8
Tests.hs
8
Tests.hs
@ -734,9 +734,9 @@ tests = [
|
||||
nulltxn{date=parsedate "2008/01/01",description="- 2008/12/31",account="",amount=Mixed [dollars 15]}
|
||||
]
|
||||
|
||||
,"transactionamount" ~: do
|
||||
parseWithCtx transactionamount " $47.18" `parseis` Mixed [dollars 47.18]
|
||||
parseWithCtx transactionamount " $1." `parseis`
|
||||
,"postingamount" ~: do
|
||||
parseWithCtx postingamount " $47.18" `parseis` Mixed [dollars 47.18]
|
||||
parseWithCtx postingamount " $1." `parseis`
|
||||
Mixed [Amount (Commodity {symbol="$",side=L,spaced=False,comma=False,precision=0}) 1 Nothing]
|
||||
|
||||
]
|
||||
@ -1147,5 +1147,5 @@ rawLedgerWithAmounts as =
|
||||
[]
|
||||
[]
|
||||
""
|
||||
where parse = fromparse . parseWithCtx transactionamount . (" "++)
|
||||
where parse = fromparse . parseWithCtx postingamount . (" "++)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user