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/AP.pm
96 96
      qq|ORDER BY c.accno|;
97 97
    $sth = $dbh->prepare($query);
98 98
    $sth->execute($form->{"tax_id_$i"}) || $form->dberror($query . " (" . $form->{"tax_id_$i"} . ")");
99
    ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) =
100
      $sth->fetchrow_array;
101
    $form->{AP_amounts}{"tax_$i"}{taxkey}    = $form->{"taxkey_$i"};
102
    $form->{AP_amounts}{"amount_$i"}{taxkey} = $form->{"taxkey_$i"};
99
    ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = $sth->fetchrow_array();
103 100

  
104 101
    $sth->finish;
105 102
    if ($form->{taxincluded} *= 1) {
......
212 209
      if ($form->{"amount_$i"} != 0) {
213 210
        my $project_id;
214 211
        $project_id = conv_i($form->{"project_id_$i"});
215
        $taxkey = $form->{AP_amounts}{"amount_$i"}{taxkey};
216 212

  
217 213
        # insert detail records in acc_trans
218 214
        $query =
......
222 218
          qq|  ?, ?, ?, ?)|;
223 219
        @values = ($form->{id}, $form->{AP_amounts}{"amount_$i"},
224 220
                   $form->{"amount_$i"}, conv_date($form->{transdate}),
225
                   $project_id, $taxkey);
221
                   $project_id, $form->{"taxkey_$i"});
226 222
        do_query($form, $dbh, $query, @values);
227 223

  
228 224
        if ($form->{"tax_$i"} != 0) {
......
234 230
            qq|  ?, ?, ?, ?)|;
235 231
          @values = ($form->{id}, $form->{AP_amounts}{"tax_$i"},
236 232
                     $form->{"tax_$i"}, conv_date($form->{transdate}),
237
                     $project_id, $taxkey);
233
                     $project_id, $form->{"taxkey_$i"});
238 234
          do_query($form, $dbh, $query, @values);
239 235
        }
240 236

  
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