showTransaction:
2018/10/19 Joe Doe | Test
Account 1 €388.00 = €2913.00
Account 2
Account 3
showTransactionUnelided:
2018/10/19 Joe Doe | Test
Account 1 €388.00 = €2913.00
Account 2
Account 3 $10.00
Account 3 €-96.00
showTransactionUnelidedOneLineAmounts:
2018/10/19 Joe Doe | Test
Account 1 €388.00 = €2913.00
Account 2
Account 3 $10.00, €-96.00
Created
October 21, 2018 11:41
-
-
Save peti/a872301806a2073827e6efbe6702c436 to your computer and use it in GitHub Desktop.
How to show an hledger transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Hledger.Data | |
import Data.Time | |
t :: Transaction | |
t = nulltransaction | |
{ tdate = fromGregorian 2018 10 19 | |
, tdescription = "Joe Doe | Test" | |
, tpostings = [tp1, tp2, tp3] | |
} | |
tp1 :: Posting | |
tp1 = nullposting | |
{ paccount="Account 1" | |
, pamount = mixed [eur 388] | |
, pbalanceassertion = Just (eur 2913, nullsourcepos) | |
} | |
tp2 :: Posting | |
tp2 = nullposting | |
{ paccount="Account 2" | |
, pamount = missingmixedamt | |
} | |
tp3 :: Posting | |
tp3 = nullposting | |
{ paccount="Account 3" | |
, pamount = mixed [eur (-96), usd (10)] | |
} | |
main :: IO () | |
main = do | |
putStrLn "showTransaction:\n" | |
putStr (showTransaction t) | |
putStrLn "showTransactionUnelided:\n" | |
putStr (showTransactionUnelided t) | |
putStrLn "showTransactionUnelidedOneLineAmounts:\n" | |
putStr (showTransactionUnelidedOneLineAmounts t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment