summaryrefslogtreecommitdiffstats
path: root/lib/WWW/YNAB.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-06-24 11:20:39 -0400
committerJesse Luehrs <doy@tozt.net>2018-06-24 11:20:39 -0400
commit2d115e33a28a5e8f98d18d371f1503760547674f (patch)
tree470aa3f6ae059d33b38e8114703c4fe67b92ba8a /lib/WWW/YNAB.pm
parent191680ce49a2228710f0bfc6f6236e4f5bd0628b (diff)
downloadwww-ynab-2d115e33a28a5e8f98d18d371f1503760547674f.tar.gz
www-ynab-2d115e33a28a5e8f98d18d371f1503760547674f.zip
ensure a couple more fields are populated
Diffstat (limited to 'lib/WWW/YNAB.pm')
-rw-r--r--lib/WWW/YNAB.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/WWW/YNAB.pm b/lib/WWW/YNAB.pm
index b44e004..192b5b0 100644
--- a/lib/WWW/YNAB.pm
+++ b/lib/WWW/YNAB.pm
@@ -117,6 +117,21 @@ sub budget {
my @transactions = map {
my %transaction = %$_;
+ ($transaction{account_name}) = map {
+ $_->{name}
+ } grep {
+ $_->{id} eq $transaction{account_id}
+ } @{ $budget{accounts} };
+ ($transaction{payee_name}) = map {
+ $_->{name}
+ } grep {
+ $_->{id} eq $transaction{payee_id}
+ } @{ $budget{payees} };
+ ($transaction{category_name}) = map {
+ $_->{name}
+ } grep {
+ $_->{id} eq $transaction{category_id}
+ } @{ $budget{categories} };
$transaction{subtransactions} = [
map {
$self->model_from_data('WWW::YNAB::SubTransaction', $_)