From: Moritz Bunkus Date: Wed, 27 Apr 2011 08:47:44 +0000 (+0200) Subject: Beim Speichern eines Kontos chart.taxkey_id aus taxkeys aktualisieren/setzen X-Git-Tag: release-2.6.3~30 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=90221504d9934369ef85bc88b7270e9da56f9c89;p=kivitendo-erp.git Beim Speichern eines Kontos chart.taxkey_id aus taxkeys aktualisieren/setzen Fix für Bug 1627. --- 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 +);