Revision history for App-HomeBank2Ledger.
+0.010 2022-01-29 20:55:19-07:00 America/Denver
+ * Set code from the transaction info if transaction type is check.
+ * Fix formatter error for symbols that have special characters.
+
0.009 2022-01-15 16:40:58-07:00 America/Denver
* Use posting dates for internal transfers where the transactions have
different dates.
"provides" : {
"App::HomeBank2Ledger" : {
"file" : "lib/App/HomeBank2Ledger.pm",
- "version" : "0.009"
+ "version" : "0.010"
},
"App::HomeBank2Ledger::Formatter" : {
"file" : "lib/App/HomeBank2Ledger/Formatter.pm",
- "version" : "0.009"
+ "version" : "0.010"
},
"App::HomeBank2Ledger::Formatter::Beancount" : {
"file" : "lib/App/HomeBank2Ledger/Formatter/Beancount.pm",
- "version" : "0.009"
+ "version" : "0.010"
},
"App::HomeBank2Ledger::Formatter::Ledger" : {
"file" : "lib/App/HomeBank2Ledger/Formatter/Ledger.pm",
- "version" : "0.009"
+ "version" : "0.010"
},
"App::HomeBank2Ledger::Ledger" : {
"file" : "lib/App/HomeBank2Ledger/Ledger.pm",
- "version" : "0.009"
+ "version" : "0.010"
},
"App::HomeBank2Ledger::Util" : {
"file" : "lib/App/HomeBank2Ledger/Util.pm",
- "version" : "0.009"
+ "version" : "0.010"
},
"File::HomeBank" : {
"file" : "lib/File/HomeBank.pm",
- "version" : "0.009"
+ "version" : "0.010"
}
},
"release_status" : "stable",
"web" : "https://github.com/chazmcgarvey/homebank2ledger"
}
},
- "version" : "0.009",
+ "version" : "0.010",
"x_authority" : "cpan:CCM",
"x_generated_by_perl" : "v5.28.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.25",
provides:
App::HomeBank2Ledger:
file: lib/App/HomeBank2Ledger.pm
- version: '0.009'
+ version: '0.010'
App::HomeBank2Ledger::Formatter:
file: lib/App/HomeBank2Ledger/Formatter.pm
- version: '0.009'
+ version: '0.010'
App::HomeBank2Ledger::Formatter::Beancount:
file: lib/App/HomeBank2Ledger/Formatter/Beancount.pm
- version: '0.009'
+ version: '0.010'
App::HomeBank2Ledger::Formatter::Ledger:
file: lib/App/HomeBank2Ledger/Formatter/Ledger.pm
- version: '0.009'
+ version: '0.010'
App::HomeBank2Ledger::Ledger:
file: lib/App/HomeBank2Ledger/Ledger.pm
- version: '0.009'
+ version: '0.010'
App::HomeBank2Ledger::Util:
file: lib/App/HomeBank2Ledger/Util.pm
- version: '0.009'
+ version: '0.010'
File::HomeBank:
file: lib/File/HomeBank.pm
- version: '0.009'
+ version: '0.010'
requires:
Carp: '0'
Exporter: '0'
bugtracker: https://github.com/chazmcgarvey/homebank2ledger/issues
homepage: https://github.com/chazmcgarvey/homebank2ledger
repository: https://github.com/chazmcgarvey/homebank2ledger.git
-version: '0.009'
+version: '0.010'
x_authority: cpan:CCM
x_generated_by_perl: v5.28.0
x_serialization_backend: 'YAML::Tiny version 1.73'
"IPC::Open3" => 0,
"Test::More" => 0
},
- "VERSION" => "0.009",
+ "VERSION" => "0.010",
"test" => {
"TESTS" => "t/*.t"
}
VERSION
- version 0.009
+ version 0.010
SYNOPSIS
use App::HomeBank2Ledger;
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
App::HomeBank2Ledger->main(@ARGV);
=head1 VERSION
-version 0.009
+version 0.010
=head1 SYNOPSIS
use Getopt::Long 2.38 qw(GetOptionsFromArray);
use Pod::Usage;
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
my %ACCOUNT_TYPES = ( # map HomeBank account types to Ledger accounts
bank => 'Assets:Bank',
my $payee = $homebank->find_payee_by_key($transaction->{payee});
my $tags = _split_tags($transaction->{tags});
my $date = $transaction->{date};
+ my $code = $transaction->{paymode} =~ /^(?:check|epayment)$/ ? $transaction->{info}
+ : undef;
my @postings;
$ledger->add_transactions({
date => $date,
payee => $payee->{name},
+ code => $code,
memo => $memo,
postings => \@postings,
});
=head1 VERSION
-version 0.009
+version 0.010
=head1 SYNOPSIS
use Module::Pluggable search_path => [__PACKAGE__],
sub_name => 'available_formatters';
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
sub _croak { require Carp; Carp::croak(@_) }
=head1 VERSION
-version 0.009
+version 0.010
=head1 SYNOPSIS
use parent 'App::HomeBank2Ledger::Formatter';
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
my %STATUS_SYMBOLS = (
cleared => '*',
=head1 VERSION
-version 0.009
+version 0.010
=head1 DESCRIPTION
use parent 'App::HomeBank2Ledger::Formatter';
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
my %STATUS_SYMBOLS = (
cleared => '*',
pending => '!',
);
+my $SYMBOL = qr![^\s\d.,;:?\!\-+*/^&|=\<\>\[\]\(\)\{\}\@]+!;
sub _croak { require Carp; Carp::croak(@_) }
return "\"$str\"";
}
+sub _format_symbol {
+ my $self = shift;
+ my $str = shift;
+ return $self->_quote_string($str) if $str !~ /^${SYMBOL}$/;
+ return $str;
+}
+
sub _format_amount {
my $self = shift;
my $amount = shift;
$num .= $commodity->{dchar} . $fraction;
}
- my $symbol = $commodity->{symbol};
- $symbol = $self->_quote_string($symbol) if $symbol =~ /[0-9\s]/;
-
+ my $symbol = $self->_format_symbol($commodity->{symbol});
$num = $commodity->{syprf} ? "$symbol $num" : "$num $symbol";
return $num;
=head1 VERSION
-version 0.009
+version 0.010
=head1 DESCRIPTION
use warnings;
use strict;
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
sub new {
=head1 VERSION
-version 0.009
+version 0.010
=head1 SYNOPSIS
use Exporter qw(import);
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
our @EXPORT_OK = qw(commify rtrim);
=head1 VERSION
-version 0.009
+version 0.010
=head1 FUNCTIONS
use XML::Entities;
use XML::Parser::Lite;
-our $VERSION = '0.009'; # VERSION
+our $VERSION = '0.010'; # VERSION
our @EXPORT_OK = qw(parse_string parse_file);
=head1 VERSION
-version 0.009
+version 0.010
=head1 SYNOPSIS