From 839ed59d0b22d6c011dc5f3df59c6b4e6357ba02 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 17 Jun 2013 16:47:19 +0200 Subject: [PATCH] Zusammenfassung einzelner UPDATE-Queries auf defaults zu einem einzigen --- SL/User.pm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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; -- 2.20.1