From: Moritz Bunkus Date: Mon, 17 Jun 2013 14:47:19 +0000 (+0200) Subject: Zusammenfassung einzelner UPDATE-Queries auf defaults zu einem einzigen X-Git-Tag: release-3.1.0beta1~309^2~20 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=839ed59d0b22d6c011dc5f3df59c6b4e6357ba02;p=kivitendo-erp.git Zusammenfassung einzelner UPDATE-Queries auf defaults zu einem einzigen --- diff --git a/SL/User.pm b/SL/User.pm index 7f4ec1a56..03961d6c3 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -286,16 +286,8 @@ sub dbcreate { # load chart of accounts $dbupdater->process_query($dbh, "sql/$form->{chart}-chart.sql", undef, $db_charset); - $query = "UPDATE defaults SET coa = ?"; - do_query($form, $dbh, $query, $form->{chart}); - $query = "UPDATE defaults SET accounting_method = ?"; - do_query($form, $dbh, $query, $form->{accounting_method}); - $query = "UPDATE defaults SET profit_determination = ?"; - do_query($form, $dbh, $query, $form->{profit_determination}); - $query = "UPDATE defaults SET inventory_system = ?"; - do_query($form, $dbh, $query, $form->{inventory_system}); - $query = "UPDATE defaults SET curr = ?"; - do_query($form, $dbh, $query, $form->{defaultcurrency}); + my $query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?|; + do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency)); $dbh->disconnect;