my $memo = $transaction->{wording} || '';
my $payee = $homebank->find_payee_by_key($transaction->{payee});
my $tags = _split_tags($transaction->{tags});
+ my $date = $transaction->{date};
my @postings;
push @postings, {
+ date => $date,
account => $account->{ledger_name},
amount => $amount,
commodity => $commodities{$account->{currency}},
$seen{$transaction->{transfer_key}}++ if $transaction->{transfer_key};
$seen{$paired_transaction->{transfer_key}}++ if $paired_transaction->{transfer_key};
+ my $paired_date = $paired_transaction && $paired_transaction->{date};
my $paired_payee = $homebank->find_payee_by_key($paired_transaction->{payee});
push @postings, {
+ date => $paired_date,
account => $dst_account->{ledger_name},
amount => $paired_transaction->{amount} || -$transaction->{amount},
commodity => $commodities{$dst_account->{currency}},
};
}
}
- else { # with or without category
+ else { # normal transaction with or without category
my $amount = -$transaction->{amount};
my $category = $homebank->find_category_by_key($transaction->{category});
my $other_account = $category ? $category->{ledger_name}
}
$ledger->add_transactions({
- date => $transaction->{date},
+ date => $date,
payee => $payee->{name},
memo => $memo,
postings => \@postings,