Allow missing entityId in Ledger output.

The ledger data can, in fact, sometimes have a missing entityId for
various reasons.  For now, these donations should just be ignored.
Perhaps in future a warning of some sort should be generated.
This commit is contained in:
Bradley M. Kuhn 2016-01-18 21:10:47 -08:00
parent cf8cc36045
commit ded2028069
2 changed files with 3 additions and 1 deletions

View file

@ -1447,8 +1447,9 @@ sub _readLedgerData($) {
while (my $line = <ALL>) {
next if $line =~ /^\s*$/;
die "Invalid line in @cmd output:\n $line"
unless $line =~ /^\s*([^\d]+)\s+([\d\-]+)\s+(\S+)\s+\$\s*(\-?\s*[\d,\.]+)\s*$/;
unless $line =~ /^\s*([^\d]+)\s+([\d\-]+)\s+(\S*)\s+\$\s*(\-?\s*[\d,\.]+)\s*$/;
my($type, $date, $entityId, $amount) = ($1, $2, $3, $4);
next unless defined $entityId and $entityId !~ /^\s*$/;
if (defined $self->{programTypeSearch}) {
if ($type =~ /$self->{programTypeSearch}{annual}/) {
$type = 'Annual';

View file

@ -52,6 +52,7 @@ Supporters:Match Pledge 2015-02-26 Whitman-Dick \$-300.00
Supporters:Monthly 2015-02-16 Olson-Margaret \$-10.00
Supporters:Monthly 2015-06-30 Olson-Margaret \$-10.00
Supporters:Annual 2015-03-04 Harris-Joan \$-120.00
Supporters:Annual 2016-01-10 \$-120.00
FAKE_LEDGER_TEST_DATA_END
=item Public-facing methods of the module, as follows: