1 -- @tag: invalid_taxkesy
2 -- @description: Ungültige Steuerschlüssel in den Kontenrahmendefinitionen und daraus resultierende falsche Einträge in anderen Tabellen werden korrigiert.
3 -- @depends: tax_primary_key_taxkeys_foreign_keys
4 UPDATE chart SET taxkey_id = 0 WHERE taxkey_id NOT IN (SELECT DISTINCT taxkey_id FROM taxkeys);
5 UPDATE taxkeys SET taxkey_id = 0, tax_id = 0 WHERE taxkey_id NOT IN (SELECT DISTINCT taxkey_id FROM taxkeys);