1 package SL::DATEV::KNEFile;
18 map { $self->{$_} = $params{$_} } keys %params;
20 $self->{remaining_bytes} = 250;
21 $self->{block_count} = 0;
28 return $self->{data} || '';
34 return $self->{block_count};
41 my $block_len = length $block;
44 $self->flush() if ($block_len > $self->{remaining_bytes});
46 $self->{data} .= $block;
47 $self->{remaining_bytes} -= $block_len;
55 if (250 == $self->{remaining_bytes}) {
59 my $num_zeros = 6 + $self->{remaining_bytes};
60 $self->{data} .= "\x00" x $num_zeros;
62 $self->{remaining_bytes} = 250;
63 $self->{block_count}++;
74 my ($places, $decimal_places) = split m/\./, "$amount";
77 $decimal_places ||= 0;
81 $places = sprintf("\%0${stellen}d", $places);
84 $decimal_places .= '0' if (2 > length $decimal_places);
85 $amount = $places . substr($decimal_places, 0, 2);
86 $amount *= 1 if (!$width);