use strict;
use App::HomeBank2Ledger::Util qw(commify rtrim);
+use Scalar::Util qw(looks_like_number);
use parent 'App::HomeBank2Ledger::Formatter';
$out[-1] .= ' '.join(' ', @tags);
}
+ my $metadata = $transaction->{metadata} || {};
+ for my $key (sort keys %$metadata) {
+ my $value = looks_like_number($metadata->{$key}) ? $metadata->{$key}
+ : $self->_format_string($metadata->{$key});
+ push @out, " ; ${key}: ${value}";
+ }
+
for my $posting (@postings) {
my @line;
}
push @out, join('', @line);
+
+ my $metadata = $posting->{metadata} || {};
+ for my $key (sort keys %$metadata) {
+ my $value = looks_like_number($metadata->{$key}) ? $metadata->{$key}
+ : $self->_format_string($metadata->{$key});
+ push @out, " ; ${key}: ${value}";
+ }
}
push @out, '';
$memo && " ; $memo",
);
+ my $metadata = $transaction->{metadata} || {};
+ for my $key (sort keys %$metadata) {
+ my $value = $self->_format_string($metadata->{$key});
+ push @out, " ; ${key}: ${value}";
+ }
+
for my $posting (@postings) {
my @line;
push @out, join('', @line);
+ my $metadata = $posting->{metadata} || {};
+ for my $key (sort keys %$metadata) {
+ my $value = $self->_format_string($metadata->{$key});
+ push @out, " ; ${key}: ${value}";
+ }
+
if (my $posting_payee = $posting->{payee}) {
$posting_payee = $self->_format_string($posting_payee);
push @out, " ; Payee: $posting_payee" if $posting_payee ne $payee;