From: Thomas Heck Date: Thu, 8 Nov 2012 12:13:18 +0000 (+0100) Subject: Update der Finanzamtnummern in Hamburg X-Git-Tag: release-3.0.0beta1~25^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4a5e3c2cddaae9021659466eb6ad152bfdcbab9b;p=kivitendo-erp.git Update der Finanzamtnummern in Hamburg fixt #1841 --- 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;