From 2d115e33a28a5e8f98d18d371f1503760547674f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 24 Jun 2018 11:20:39 -0400 Subject: ensure a couple more fields are populated --- lib/WWW/YNAB.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') 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', $_) -- cgit v1.2.3-54-g00ecf