From 4a5e3c2cddaae9021659466eb6ad152bfdcbab9b Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Thu, 8 Nov 2012 13:13:18 +0100 Subject: [PATCH] Update der Finanzamtnummern in Hamburg fixt #1841 --- .../finanzamt_update_fa_bufa_nr_hamburg.pl | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sql/Pg-upgrade2/finanzamt_update_fa_bufa_nr_hamburg.pl diff --git a/sql/Pg-upgrade2/finanzamt_update_fa_bufa_nr_hamburg.pl b/sql/Pg-upgrade2/finanzamt_update_fa_bufa_nr_hamburg.pl new file mode 100644 index 000000000..d0b14dbfa --- /dev/null +++ b/sql/Pg-upgrade2/finanzamt_update_fa_bufa_nr_hamburg.pl @@ -0,0 +1,46 @@ +# @tag: finanzamt_update_fa_bufa_nr_hamburg +# @description: Aktualisiert die fa_bufa_nr für Hamburg +# @depends: release_2_7_0 +# @charset: utf-8 +package finanzamt_update_fa_bufa_nr_hamburg; +use utf8; +use strict; + +if ( !$::form ) { + die('This script cannot be run from the command line.'); +} + +sub query { + my ($query) = @_; + + if ( !$dbh->do($query) ) { + die($dbup_locale->text('Database update error:') .'
'. $query .'
'. $DBI::errstr); + } +} + +my @data = ( + ['02', '41'], + ['57', '42'], + ['71', '43'], + ['15', '43'], + ['03', '44'], + ['54', '45'], + ['22', '46'], + ['06', '47'], + ['74', '48'], + ['26', '49'], + ['09', '50'], + ['08', '51'], + ); + +foreach my $entry (@data) { + query(' + UPDATE finanzamt + SET + fa_bufa_nr = \'22'. $entry->[1] .'\' + WHERE + fa_land_nr = \'2\' + AND fa_bufa_nr = \'22'. $entry->[0] .'\';'); +} + +return 1; -- 2.20.1