From 90221504d9934369ef85bc88b7270e9da56f9c89 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 27 Apr 2011 10:47:44 +0200 Subject: [PATCH] Beim Speichern eines Kontos chart.taxkey_id aus taxkeys aktualisieren/setzen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 1627. --- SL/AM.pm | 15 +++++++++++++++ sql/Pg-upgrade2/chart_taxkey_id_from_taxkeys.sql | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 sql/Pg-upgrade2/chart_taxkey_id_from_taxkeys.sql diff --git a/SL/AM.pm b/SL/AM.pm index bf5c97d0c..a4db43992 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -378,6 +378,21 @@ sub save_account { } + # Update chart.taxkey_id to the latest from taxkeys for this chart. + $query = <{id}); + # commit my $rc = $dbh->commit; $dbh->disconnect; diff --git a/sql/Pg-upgrade2/chart_taxkey_id_from_taxkeys.sql b/sql/Pg-upgrade2/chart_taxkey_id_from_taxkeys.sql new file mode 100644 index 000000000..5301735a3 --- /dev/null +++ b/sql/Pg-upgrade2/chart_taxkey_id_from_taxkeys.sql @@ -0,0 +1,12 @@ +-- @tag: chart_taxkey_id_from_taxkeys +-- @description: chart.taxkey_id aus taxkeys aktualisieren +-- @depends: release_2_6_2 +-- @charset: utf-8 +UPDATE chart +SET taxkey_id = ( + SELECT taxkey_id + FROM taxkeys + WHERE taxkeys.chart_id = chart.id + ORDER BY startdate DESC + LIMIT 1 +); -- 2.20.1