all repos — archive/ynab-ledger @ 6c29b8421c09abbf1ec4e0c68a8da91e7576481c

Convert exported YNAB data to ledger-cli

Align accounts and amounts

Alan Pearce
commit

6c29b8421c09abbf1ec4e0c68a8da91e7576481c

parent

102c7ffde62a1a2ee08678747583ee207b8263cf

1 file changed, 7 insertions(+), 5 deletions(-)

jump to
M src/Command/ConvertCommand.phpsrc/Command/ConvertCommand.php
@@ -341,12 +341,14 @@ , $txn->payee
, !empty($txn->note) ? " ; $txn->note" : "" , PHP_EOL; foreach ($txn->postings as $posting) { - echo " " - , $txn->isVirtual ? "[" : ($posting->isVirtual ? "(" : "") - , implode(':', $posting->account) - , $txn->isVirtual ? "]" : ($posting->isVirtual ? ")" : ""); + printf( + " %-40s", + ($txn->isVirtual ? "[" : ($posting->isVirtual ? "(" : "")) + . implode(':', $posting->account) + . ($txn->isVirtual ? "]" : ($posting->isVirtual ? ")" : "")) + ); if ($posting->currency !== null) { - echo " {$fmt->formatCurrency($posting->amount, $posting->currency)}"; + printf(" %10s", $fmt->formatCurrency($posting->amount, $posting->currency)); } echo !empty($posting->note) ? " ; $posting->note" : "", PHP_EOL; }