GROUP BY $group_clause
ORDER BY r_${sort_spec}) AS lines WHERE r_qty>0|;
- $query .= " LIMIT $filter{limit}" if $filter{limit} ;
- $query .= " OFFSET $filter{offset}" if $filter{offset} ;
+ my @all_vars = (@filter_vars,@filter_vars,@filter_vars);
- my $sth = prepare_execute_query($form, $dbh, $query, @filter_vars, @filter_vars, @filter_vars);
+ if ($filter{limit}) {
+ $query .= " LIMIT ?";
+ push @all_vars,$filter{limit};
+ }
+ if ($filter{offset}) {
+ $query .= " OFFSET ?";
+ push @all_vars, $filter{offset};
+ }
+
+ my $sth = prepare_execute_query($form, $dbh, $query, @all_vars);
my ($h_oe_id, $q_oe_id);
if ($form->{l_oe_id}) {
GROUP BY $group_clause
ORDER BY $sort_spec ) AS lines WHERE qty<>0|;
- $query .= " LIMIT $filter{limit}" if $filter{limit} ;
- $query .= " OFFSET $filter{offset}" if $filter{offset} ;
-
- my $sth = prepare_execute_query($form, $dbh, $query, @filter_vars);
+ if ($filter{limit}) {
+ $query .= " LIMIT ?";
+ push @filter_vars,$filter{limit};
+ }
+ if ($filter{offset}) {
+ $query .= " OFFSET ?";
+ push @filter_vars, $filter{offset};
+ }
+ my $sth = prepare_execute_query($form, $dbh, $query, @filter_vars );
my (%non_empty_bins, @all_fields, @contents);
}
# /filter stuff
- my $allrows = 0;
- $allrows = 1 if $form->{report_generator_output_format} ne 'HTML' ;
+ my $allrows = !!($form->{report_generator_output_format} ne 'HTML') ;
# manual paginating
- my $pages = {};
- my $page = $::form->{page} || 1;
- $pages->{per_page} = $::form->{per_page} || 15;
- my $first_nr = ($page - 1) * $pages->{per_page};
- my $last_nr = $first_nr + $pages->{per_page};
+ my $pages = {};
+ my $page = $::form->{page} || 1;
+ $pages->{per_page} = $::form->{per_page} || 15;
+ my $first_nr = ($page - 1) * $pages->{per_page};
+ my $last_nr = $first_nr + $pages->{per_page};
# no optimisation if qty op
if ( !$allrows && $form->{maxrows} && !$filter{qty_op}) {
$filter{limit} = $pages->{per_page};
$filter{offset} = ($page - 1) * $pages->{per_page};
- $first_nr = 0;
- $last_nr = $pages->{per_page};
+ $first_nr = 0;
+ $last_nr = $pages->{per_page};
}
my @contents = WH->get_warehouse_journal(%filter);
$entry->{type_and_classific} = $::request->presenter->type_abbreviation($entry->{part_type}).
$::request->presenter->classification_abbreviation($entry->{classification_id});
$entry->{qty} = $form->format_amount(\%myconfig, $entry->{qty});
-# $entry->{qty} = $form->format_amount_units('amount' => $entry->{qty},
-# 'part_unit' => $entry->{partunit},
-# 'conv_units' => 'convertible');
$entry->{trans_type} = $locale->text($entry->{trans_type});
my $row = { };
$form->{report_generator_output_format} = 'HTML' if !$form->{report_generator_output_format};
# manual paginating
- my $allrows = 0;
- $allrows = 1 if $form->{report_generator_output_format} ne 'HTML' ;
- my $page = $::form->{page} || 1;
- my $pages = {};
- $pages->{per_page} = $::form->{per_page} || 20;
- my $first_nr = ($page - 1) * $pages->{per_page};
- my $last_nr = $first_nr + $pages->{per_page};
+ my $allrows = !!($form->{report_generator_output_format} ne 'HTML') ;
+ my $page = $::form->{page} || 1;
+ my $pages = {};
+ $pages->{per_page} = $::form->{per_page} || 20;
+ my $first_nr = ($page - 1) * $pages->{per_page};
+ my $last_nr = $first_nr + $pages->{per_page};
# no optimisation if qty op
if ( !$allrows && $form->{maxrows} && !$filter{qty_op}) {
$filter{limit} = $pages->{per_page};
$filter{offset} = ($page - 1) * $pages->{per_page};
- $first_nr = 0;
- $last_nr = $pages->{per_page};
+ $first_nr = 0;
+ $last_nr = $pages->{per_page};
}
my @contents = WH->get_warehouse_report(%filter);