1 package SL::DATEV::KNEFile;
20 map { $self->{$_} = $params{$_} } keys %params;
22 $self->{remaining_bytes} = 250;
23 $self->{block_count} = 0;
30 return $self->{data} || '';
36 return $self->{block_count};
43 my $block_len = length $block;
46 $self->flush() if ($block_len > $self->{remaining_bytes});
48 $self->{data} .= $block;
49 $self->{remaining_bytes} -= $block_len;
57 if (250 == $self->{remaining_bytes}) {
61 my $num_zeros = 6 + $self->{remaining_bytes};
62 $self->{data} .= "\x00" x $num_zeros;
64 $self->{remaining_bytes} = 250;
65 $self->{block_count}++;
76 my ($places, $decimal_places) = split m/\./, "$amount";
79 $decimal_places ||= 0;
83 $places = sprintf("\%0${width}d", $places);
86 $decimal_places .= '0' if (2 > length $decimal_places);
87 $amount = $places . substr($decimal_places, 0, 2);
88 $amount *= 1 if (!$width);