about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2015-04-07 16:46:44 +0100
committerAlan Pearce2015-04-07 16:46:44 +0100
commit6c29b8421c09abbf1ec4e0c68a8da91e7576481c (patch)
tree42717c6f4260ec830c97f8796cb961c4891a57f0
parent102c7ffde62a1a2ee08678747583ee207b8263cf (diff)
downloadynab-ledger-6c29b8421c09abbf1ec4e0c68a8da91e7576481c.tar.xz
ynab-ledger-6c29b8421c09abbf1ec4e0c68a8da91e7576481c.zip
Align accounts and amounts
-rw-r--r--src/Command/ConvertCommand.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Command/ConvertCommand.php b/src/Command/ConvertCommand.php index 1df8249..2cf727b 100644 --- a/src/Command/ConvertCommand.php +++ b/src/Command/ConvertCommand.php
@@ -341,12 +341,14 @@ class ConvertCommand extends Command {
341 , !empty($txn->note) ? " ; $txn->note" : "" 341 , !empty($txn->note) ? " ; $txn->note" : ""
342 , PHP_EOL; 342 , PHP_EOL;
343 foreach ($txn->postings as $posting) { 343 foreach ($txn->postings as $posting) {
344 echo " " 344 printf(
345 , $txn->isVirtual ? "[" : ($posting->isVirtual ? "(" : "") 345 " %-40s",
346 , implode(':', $posting->account) 346 ($txn->isVirtual ? "[" : ($posting->isVirtual ? "(" : ""))
347 , $txn->isVirtual ? "]" : ($posting->isVirtual ? ")" : ""); 347 . implode(':', $posting->account)
348 . ($txn->isVirtual ? "]" : ($posting->isVirtual ? ")" : ""))
349 );
348 if ($posting->currency !== null) { 350 if ($posting->currency !== null) {
349 echo " {$fmt->formatCurrency($posting->amount, $posting->currency)}"; 351 printf(" %10s", $fmt->formatCurrency($posting->amount, $posting->currency));
350 } 352 }
351 echo !empty($posting->note) ? " ; $posting->note" : "", PHP_EOL; 353 echo !empty($posting->note) ? " ; $posting->note" : "", PHP_EOL;
352 } 354 }