1 package Finance::Bank::BR::Santander::Spreadsheet;
6 =head1 COPYRIGHT AND LICENSE
8 Copyright (C) 2015 Thadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
10 This program is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License; either version 2 of the License,
12 or (at your option) any later version.
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE.
20 use Spreadsheet::ParseExcel::Simple;
22 use DateTime::Format::Strptime qw(strptime);
24 our $VERSION = '0.01';
38 $self->{statement} = [];
44 my @sheets = $xls->sheets;
45 my $sheet = $sheets[0];
46 if ($sheet->has_data) {
47 my @header = $sheet->next_row;
49 while ($sheet->has_data) {
50 my @line = $sheet->next_row;
52 'date' => strptime("%d/%m/%Y", $line[0]),
56 'balance' => $line[5],
58 push @{$self->{statement}}, $obj;
59 $self->{balance} = $line[5];
66 if (defined($filename)) {
67 my $xls = Spreadsheet::ParseExcel::Simple->read($filename);
77 return $self->{balance};
82 return $self->{statement};