From: Rolf Fluehmann Date: Tue, 18 Mar 2014 14:58:56 +0000 (+0100) Subject: =resolved uncommited prepared statement X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c264d7c975209abe5cd41073e1c073d02763129d;p=kivitendo-erp.git =resolved uncommited prepared statement Conflicts: SL/DB/MetaSetup/Default.pm --- diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index ad2d3ccdd..2145f0564 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -680,9 +680,7 @@ sub get_default_coa { my $dbconnect = 'dbi:Pg:dbname=' . $client->dbname . ';host=' . $client->dbhost . ';port=' . $client->dbport; my $dbh = DBI->connect($dbconnect, $client->dbuser, $client->dbpasswd); my $query = q{ SELECT coa FROM defaults }; - (my $sth = $dbh->prepare($query))->execute; ($coa) = selectrow_query($::form, $dbh, $query); - $sth->finish; $dbh->disconnect; }; return $coa; diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 821ed98fe..e8340c80e 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -75,6 +75,7 @@ __PACKAGE__->meta->columns( payments_changeable => { type => 'integer', default => '0', not_null => 1 }, pdonumber => { type => 'text' }, ponumber => { type => 'text' }, + precision => { type => 'numeric', precision => 15, scale => 5, default => '0.01', not_null => 1 }, profit_determination => { type => 'text' }, purchase_delivery_order_show_delete => { type => 'boolean', default => 'true' }, purchase_order_show_delete => { type => 'boolean', default => 'true' }, diff --git a/SL/Form.pm b/SL/Form.pm index 8cab71c66..22d5d1a31 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -3702,9 +3702,7 @@ sub _get_precision { my $dbconnect = 'dbi:Pg:dbname=' . $client->{dbname} . ';host=' . $client->{dbhost} . ';port=' . $client->{dbport}; my $dbh = DBI->connect($dbconnect, $client->{dbuser}, $client->{dbpasswd}); my $query = q{ SELECT precision FROM defaults }; - (my $sth = $dbh->prepare($query))->execute; ($precision) = selectrow_query($::form, $dbh, $query); - $sth->finish; $dbh->disconnect; }; return $precision; diff --git a/SL/Layout/Base.pm b/SL/Layout/Base.pm index f3c40bf67..8c7aa3927 100644 --- a/SL/Layout/Base.pm +++ b/SL/Layout/Base.pm @@ -31,11 +31,13 @@ sub new { sub init_menu { my @menu_files; - if(scalar(grep(/^Switzerland/, (selectrow_query($::form, $::form->get_standard_dbh, 'SELECT coa FROM defaults'))[0]))) { + my $dbh = $::form->get_standard_dbh; + if(scalar(grep(/^Switzerland/, (selectrow_query($::form, $dbh, 'SELECT coa FROM defaults'))[0]))) { @menu_files = qw(menus/erp_ch.ini); } else { @menu_files = qw(menus/erp.ini); } + $dbh->commit; unshift @menu_files, 'menus/crm.ini' if $::instance_conf->crm_installed; Menu->new(@menu_files); }