Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 03ff37cb

Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt

  • ID 03ff37cb621e68f7d224d2520099ee86f612f833
  • Vorgänger 2c86cb0a
  • Nachfolger 0f0f4263

tax_id in acc_trans

Dieser Commit enthält das Update-Script um eine neue Spalte Namens
'tax_id' in die Tabelle 'acc_trans' einzufügen. Diese Spalte hat
Constrait NOT NULL und einen Fremdschlüssel auf die id von tax.

Das Pflichtfeld wird jetzt immer geschrieben bei:

-VK-Rechnungen (auch automatisch erzeugten)
-EK-Rechnungen
-Kreditorenbuchungen
-Debitorenbuchungen
-Dialogbuchungen

Durch das Feld 'tax_id' können in der Tabelle tax der
Steuerschlüssel und der Steuersatz ausgelesen werden.

In diesem Commit wird allerdings der Wert in tax_id nur geschrieben,
im Moment wird er noch nirgendwo ausgelesen.

Unterschiede anzeigen:

SL/GL.pm
157 157
    if ($amount != 0) {
158 158
      $query =
159 159
        qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
160
                                  source, memo, project_id, taxkey, ob_transaction, cb_transaction)
160
                                  source, memo, project_id, taxkey, ob_transaction, cb_transaction, tax_id)
161 161
           VALUES (?, (SELECT id FROM chart WHERE accno = ?),
162
                   ?, ?, ?, ?, ?, ?, ?, ?)|;
162
                   ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
163 163
      @values = (conv_i($form->{id}), $accno, $amount, conv_date($form->{transdate}),
164
                 $form->{"source_$i"}, $form->{"memo_$i"}, $project_id, $taxkey, $form->{ob_transaction} ? 't' : 'f', $form->{cb_transaction} ? 't' : 'f');
164
                 $form->{"source_$i"}, $form->{"memo_$i"}, $project_id, $taxkey, $form->{ob_transaction} ? 't' : 'f', $form->{cb_transaction} ? 't' : 'f', conv_i($form->{"tax_id_$i"}));
165 165
      do_query($form, $dbh, $query, @values);
166 166
    }
167 167

  
......
169 169
      # add taxentry
170 170
      $query =
171 171
        qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
172
                                  source, memo, project_id, taxkey)
172
                                  source, memo, project_id, taxkey, tax_id)
173 173
           VALUES (?, (SELECT chart_id FROM tax WHERE id = ?),
174
                   ?, ?, ?, ?, ?, ?)|;
174
                   ?, ?, ?, ?, ?, ?, ?)|;
175 175
      @values = (conv_i($form->{id}), conv_i($form->{"tax_id_$i"}),
176 176
                 $tax, conv_date($form->{transdate}), $form->{"source_$i"},
177
                 $form->{"memo_$i"}, $project_id, $taxkey);
177
                 $form->{"memo_$i"}, $project_id, $taxkey, conv_i($form->{"tax_id_$i"}));
178 178
      do_query($form, $dbh, $query, @values);
179 179
    }
180 180
  }

Auch abrufbar als: Unified diff