diff options
author | Alan Pearce | 2015-04-06 11:38:31 +0100 |
---|---|---|
committer | Alan Pearce | 2015-04-06 11:38:31 +0100 |
commit | b0268d45630f86546a7e6b97b86ebba17491ed26 (patch) | |
tree | cfe5bb0c5c682316b37c0e6afeca9675e5f8ec2a /src | |
parent | 5b2846ac67f99d1cc8bc5cd5bec705014196d3c7 (diff) | |
download | ynab-ledger-b0268d45630f86546a7e6b97b86ebba17491ed26.tar.lz ynab-ledger-b0268d45630f86546a7e6b97b86ebba17491ed26.tar.zst ynab-ledger-b0268d45630f86546a7e6b97b86ebba17491ed26.zip |
Include inflows in transaction amounts
Diffstat (limited to 'src')
-rw-r--r-- | src/Command/ConvertCommand.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Command/ConvertCommand.php b/src/Command/ConvertCommand.php index 2d87015..fe9868a 100644 --- a/src/Command/ConvertCommand.php +++ b/src/Command/ConvertCommand.php @@ -129,7 +129,7 @@ function toLedger (Generator $transactions) { $target = new LedgerPosting; $target->account = getAccount(explode(' : ', $txn->payee)[1], $txn); $target->currency = $txn->currency; - $target->amount = $txn->out; + $target->amount = $txn->in - $txn->out; $lTxn->postings[] = $target; $source = new LedgerPosting; @@ -149,7 +149,7 @@ function toLedger (Generator $transactions) { $target = new LedgerPosting; $target->account = array_merge(['Expenses'], $txn->category); $target->currency = $txn->currency; - $target->amount = $txn->out; + $target->amount = $txn->in - $txn->out; sscanf($txn->memo, "(Split %d/%d) %[^\r]", $i, $k, $target->note); $lTxn->postings[] = $target; @@ -167,7 +167,7 @@ function toLedger (Generator $transactions) { $target = new LedgerPosting; $target->account = array_merge(['Expenses'], $txn->category); $target->currency = $txn->currency; - $target->amount = $txn->out; + $target->amount = $txn->in - $txn->out; $lTxn->postings[] = $target; $source = new LedgerPosting; |