From: Sven Schöling Date: Mon, 19 Oct 2009 16:05:29 +0000 (+0200) Subject: strictness. X-Git-Tag: release-2.6.1beta1~214 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=80f6efd0cd9de22d54ccc605808a74c9955e643c;p=kivitendo-erp.git strictness. Ausserdem das "use strict" einheitlich unter die includes verschoben um deutlich zu machen, dass das pragma die eingebundenen dateien nicht checken soll. --- diff --git a/SL/AM.pm b/SL/AM.pm index 5a3b0f73e..11b32ca4b 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -41,6 +41,8 @@ use Carp; use Data::Dumper; use SL::DBUtils; +use strict; + sub get_account { $main::lxdebug->enter_sub(); diff --git a/SL/CP.pm b/SL/CP.pm index cb97f96c1..dec4323e2 100644 --- a/SL/CP.pm +++ b/SL/CP.pm @@ -37,6 +37,8 @@ package CP; use SL::DBUtils; +use strict; + sub new { $main::lxdebug->enter_sub(); diff --git a/SL/Chart.pm b/SL/Chart.pm index 5d3c7d334..ad9ad8095 100644 --- a/SL/Chart.pm +++ b/SL/Chart.pm @@ -1,10 +1,10 @@ package SL::Chart; -use strict; - use SL::Form; use SL::DBUtils; +use strict; + sub list { $main::lxdebug->enter_sub(); diff --git a/SL/DO.pm b/SL/DO.pm index 49dbb9f4d..092fd0bc3 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -43,6 +43,8 @@ use SL::DBUtils; use SL::RecordLinks; use SL::IC; +use strict; + sub transactions { $main::lxdebug->enter_sub(); @@ -58,7 +60,7 @@ sub transactions { my $vc = $form->{vc} eq "customer" ? "customer" : "vendor"; - $query = + my $query = qq|SELECT dord.id, dord.donumber, dord.ordnumber, dord.transdate, ct.name, dord.${vc}_id, dord.globalproject_id, dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia, @@ -278,7 +280,7 @@ sub save { $form->{"sellprice_$i"} = $form->parse_amount($myconfig, $form->{"sellprice_$i"}); $price_factor = $price_factors{ $form->{"price_factor_id_$i"} } || 1; - $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / $price_factor, 2); + my $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / $price_factor, 2); $reqdate = ($form->{"reqdate_$i"}) ? $form->{"reqdate_$i"} : undef; @@ -497,6 +499,7 @@ sub delete { my $spoolfile; my @spoolfiles = (); + my @values; while (($spoolfile) = $sth->fetchrow_array) { push @spoolfiles, $spoolfile; @@ -604,7 +607,7 @@ sub retrieve { $sth = prepare_execute_query($form, $dbh, $query, @do_ids); delete $form->{"${vc}_id"}; - while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { + while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { if ($form->{"${vc}_id"} && ($ref->{"${vc}_id"} != $form->{"${vc}_id"})) { $sth->finish(); $main::lxdebug->leave_sub(); @@ -626,7 +629,7 @@ sub retrieve { $query = qq|SELECT s.* FROM shipto s WHERE s.trans_id = ? AND s.module = 'DO'|; $sth = prepare_execute_query($form, $dbh, $query, $form->{id}); - $ref = $sth->fetchrow_hashref(NAME_lc); + $ref = $sth->fetchrow_hashref("NAME_lc"); delete $ref->{id}; map { $form->{$_} = $ref->{$_} } keys %$ref; $sth->finish(); @@ -635,7 +638,7 @@ sub retrieve { $query = qq|SELECT s.printed, s.emailed, s.spoolfile, s.formname FROM status s WHERE s.trans_id = ?|; $sth = prepare_execute_query($form, $dbh, $query, conv_i($form->{id})); - while ($ref = $sth->fetchrow_hashref(NAME_lc)) { + while ($ref = $sth->fetchrow_hashref("NAME_lc")) { $form->{printed} .= "$ref->{formname} " if $ref->{printed}; $form->{emailed} .= "$ref->{formname} " if $ref->{emailed}; $form->{queued} .= "$ref->{formname} $ref->{spoolfile} " if $ref->{spoolfile}; @@ -765,7 +768,7 @@ sub order_details { JOIN parts p ON (a.parts_id = p.id) LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id) WHERE a.bom = '1' - AND a.id = ? $sortorder|; + AND a.id = ?|; my $h_pg = prepare_query($form, $dbh, $q_pg); my $q_bin_wh = qq|SELECT (SELECT description FROM bin WHERE id = ?) AS bin, @@ -787,10 +790,13 @@ sub order_details { si_runningnumber si_number si_description si_warehouse si_bin si_chargenumber si_qty si_unit); - map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays); + map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays); push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; + $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS'); + my %price_factors = map { $_->{id} => $_->{factor} } @{ $form->{ALL_PRICE_FACTORS} }; + my $sameitem = ""; foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) { $i = $item->[0]; @@ -837,7 +843,7 @@ sub order_details { do_statement($form, $h_pg, $q_pg, conv_i($form->{"id_$i"})); - while (my $ref = $h_pg->fetchrow_hashref(NAME_lc)) { + while (my $ref = $h_pg->fetchrow_hashref("NAME_lc")) { if ($form->{groupitems} && $ref->{partsgroup} ne $sameitem) { map({ push(@{ $form->{$_} }, "") } grep({ $_ ne "description" } @arrays)); $sameitem = ($ref->{partsgroup}) ? $ref->{partsgroup} : "--"; @@ -886,6 +892,8 @@ sub project_description { my ($self, $dbh, $id) = @_; + my $form = $main::form; + my $query = qq|SELECT description FROM project WHERE id = ?|; my ($value) = selectrow_query($form, $dbh, $query, $id); @@ -929,6 +937,7 @@ sub get_item_availability { my @parts_ids = 'ARRAY' eq ref $params{parts_id} ? @{ $params{parts_id} } : ($params{parts_id}); my $form = $main::form; + my $myconfig = \%main::myconfig; my $query = qq|SELECT i.warehouse_id, i.bin_id, i.chargenumber, SUM(qty) AS qty, i.parts_id, diff --git a/SL/IC.pm b/SL/IC.pm index ffc734bd8..0bf015f3f 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -41,6 +41,8 @@ use YAML; use SL::CVar; use SL::DBUtils; +use strict; + sub get_part { $main::lxdebug->enter_sub(); diff --git a/SL/IO.pm b/SL/IO.pm index 32537e547..814a452dc 100644 --- a/SL/IO.pm +++ b/SL/IO.pm @@ -1,9 +1,9 @@ package IO; -use strict; - use SL::DBUtils; +use strict; + sub retrieve_partunits { $main::lxdebug->enter_sub(); diff --git a/SL/Notes.pm b/SL/Notes.pm index c61dd3d1e..3eafb5b9e 100644 --- a/SL/Notes.pm +++ b/SL/Notes.pm @@ -5,6 +5,8 @@ package Notes; use SL::Common; use SL::DBUtils; +use strict; + sub save { $main::lxdebug->enter_sub(); @@ -51,7 +53,7 @@ sub retrieve { my $dbh = $form->get_standard_dbh($myconfig); - my $ref = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM notes WHERE id = ?|, conv_i($param{id})); + my $ref = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM notes WHERE id = ?|, conv_i($params{id})); $main::lxdebug->leave_sub(); @@ -79,8 +81,6 @@ sub delete { $dbh->commit() unless ($params{dbh}); $main::lxdebug->leave_sub(); - - return $ref; } 1; diff --git a/SL/Taxkeys.pm b/SL/Taxkeys.pm index 8d90dcb3c..cf3463bb7 100644 --- a/SL/Taxkeys.pm +++ b/SL/Taxkeys.pm @@ -1,11 +1,11 @@ package Taxkeys; -use strict; - use Memoize; use SL::DBUtils; +use strict; + sub new { my $type = shift;