Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 39da7f8c

Von Moritz Bunkus vor fast 16 Jahren hinzugefügt

  • ID 39da7f8cf4f0db564e9e6e9d8f5bd8aedcc5aaea
  • Vorgänger 3b1eaa1a
  • Nachfolger b7c3c5b7

Beim Buchen von Kreditoren- und Debitorenbuchungen immer die richtigen Steuerschlüssel in acc_trans eintragen. Vorher konnte es den Fall geben, dass bei mehreren Einträgen für ein Konto in einer Kreditoren- oder Debitorenbuchung mit unterschiedlichen Steuerschlüssel zwar die richtigen Steuersätze berechnet aber die falschen Steuerschlüssel gespeichert wurden.

Unterschiede anzeigen:

SL/AR.pm
86 86
    $query = qq|SELECT c.accno, t.taxkey, t.rate FROM tax t LEFT JOIN chart c ON (c.id = t.chart_id) WHERE t.id = ? ORDER BY c.accno|;
87 87
    ($form->{AR_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = selectrow_query($form, $dbh, $query, $form->{"tax_id_$i"});
88 88

  
89
    $form->{AR_amounts}{"tax_$i"}{taxkey}     = $form->{"taxkey_$i"};
90
    $form->{AR_amounts}{"amounts_$i"}{taxkey} = $form->{"taxkey_$i"};
91

  
92 89
    if ($form->{taxincluded} *= 1) {
93 90
      $tax = $form->{"korrektur_$i"}
94 91
        ? $form->{"tax_$i"}
......
172 169
    for $i (1 .. $form->{rowcount}) {
173 170
      if ($form->{"amount_$i"} != 0) {
174 171
        my $project_id = conv_i($form->{"project_id_$i"});
175
        $taxkey = $form->{AR_amounts}{"amounts_$i"}{taxkey};
176 172

  
177 173
        # insert detail records in acc_trans
178 174
        $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey)
179 175
                     VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?)|;
180
        @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"amount_$i"}), conv_i($form->{"amount_$i"}), conv_date($form->{transdate}), $project_id, conv_i($taxkey));
176
        @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"amount_$i"}), conv_i($form->{"amount_$i"}), conv_date($form->{transdate}), $project_id,
177
                   conv_i($form->{"taxkey_$i"}));
181 178
        do_query($form, $dbh, $query, @values);
182 179

  
183 180
        if ($form->{"tax_$i"} != 0) {
184 181
          # insert detail records in acc_trans
185 182
          $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey)
186 183
                       VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?)|;
187
          @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"tax_$i"}), conv_i($form->{"tax_$i"}), conv_date($form->{transdate}), $project_id, conv_i($taxkey));
184
          @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"tax_$i"}), conv_i($form->{"tax_$i"}), conv_date($form->{transdate}), $project_id,
185
                     conv_i($form->{"taxkey_$i"}));
188 186
          do_query($form, $dbh, $query, @values);
189 187
        }
190 188
      }

Auch abrufbar als: Unified diff