- $umsatz = abs($umsatz);
- $vorzeichen = ($umsatz > 0) ? "+" : "-";
- $buchungssatz .= $vorzeichen . &formatumsatz($umsatz, 0);
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if ( ($taxkey || $datevautomatik)
- && (!$datevautomatik || ($datevautomatik && ($charttax ne $taxkey)))) {
- if (($remaining_bytes - length("\x6C" . "11")) <= 6) {
- $fuellzeichen =
- ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- if (!$datevautomatik) {
- $buchungssatz .= "\x6C" . $taxkey;
- } else {
- $buchungssatz .= "\x6C" . "4";
- }
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
- }
-
- if (($remaining_bytes - length($gegenkonto)) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $gegenkonto;
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if (($remaining_bytes - length($belegfeld1)) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $belegfeld1;
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if (($remaining_bytes - length($belegfeld2)) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $belegfeld2;
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if (($remaining_bytes - length($datum)) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $datum;
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if (($remaining_bytes - length($konto)) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $konto;
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if (($remaining_bytes - length($buchungstext)) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $buchungstext;
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);
-
- if (($remaining_bytes - (length($waehrung . "\x79"))) <= 6) {
- $fuellzeichen = ($blockcount * 256 - length($buchungssatz . $header));
- $buchungssatz .= "\x00" x $fuellzeichen;
- $blockcount++;
- $total_bytes = ($blockcount) * 256;
- }
- $buchungssatz .= $waehrung . "\x79";
- $remaining_bytes = $total_bytes - length($buchungssatz . $header);