about summary refs log tree commit diff stats
path: root/src/Command
diff options
context:
space:
mode:
authorAlan Pearce2015-04-07 16:41:34 +0100
committerAlan Pearce2015-04-07 16:41:34 +0100
commit102c7ffde62a1a2ee08678747583ee207b8263cf (patch)
tree5a17390b8b33669dbdcf015c6c67a3f05ef0fb6c /src/Command
parente33883dee25749f08a50f423a464082f6c3c0b98 (diff)
downloadynab-ledger-102c7ffde62a1a2ee08678747583ee207b8263cf.tar.lz
ynab-ledger-102c7ffde62a1a2ee08678747583ee207b8263cf.tar.zst
ynab-ledger-102c7ffde62a1a2ee08678747583ee207b8263cf.zip
Remove Pre-YNAB debt category from output
Diffstat (limited to 'src/Command')
-rw-r--r--src/Command/ConvertCommand.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Command/ConvertCommand.php b/src/Command/ConvertCommand.php
index ca2bcc4..1df8249 100644
--- a/src/Command/ConvertCommand.php
+++ b/src/Command/ConvertCommand.php
@@ -93,12 +93,14 @@ function toLedger (Generator $transactions) {
                 $startDate = $txn->date;
                 $lTxn->isVirtual = true;
                 do {
-                    $posting = new LedgerPosting;
-                    $posting->currency = $txn->currency;
-                    $posting->amount = $txn->in;
-                    $posting->account = array_merge(['Funds'], $txn->category);
-                    if ($posting->amount !== 0.00) {
-                        $lTxn->postings[] = $posting;
+                    if ($txn->category[0] != 'Pre-YNAB Debt') {
+                        $posting = new LedgerPosting;
+                        $posting->currency = $txn->currency;
+                        $posting->amount = $txn->in;
+                        $posting->account = array_merge(['Funds'], $txn->category);
+                        if ($posting->amount !== 0.00) {
+                            $lTxn->postings[] = $posting;
+                        }
                     }
 
                     $transactions->next();