# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for transfer.'));
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for transfer.'));
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for removal.'));
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for removal.'));
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit fromdate todate);
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit fromdate todate);
'bin_from' => { 'text' => $locale->text('Bin From'), },
'bin_to' => { 'text' => $locale->text('Bin To'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
'bin_from' => { 'text' => $locale->text('Bin From'), },
'bin_to' => { 'text' => $locale->text('Bin To'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
'partdescription' => { 'text' => $locale->text('Part Description'), },
'chargenumber' => { 'text' => $locale->text('Charge Number'), },
'bestbefore' => { 'text' => $locale->text('Best Before'), },
'qty' => { 'text' => $locale->text('Qty'), },
'partdescription' => { 'text' => $locale->text('Part Description'), },
'chargenumber' => { 'text' => $locale->text('Charge Number'), },
'bestbefore' => { 'text' => $locale->text('Best Before'), },
'qty' => { 'text' => $locale->text('Qty'), },
'employee' => { 'text' => $locale->text('Employee'), },
'projectnumber' => { 'text' => $locale->text('Project Number'), },
'oe_id' => { 'text' => $locale->text('Document'), },
);
my $href = build_std_url('action=generate_journal', grep { $form->{$_} } @hidden_variables);
'employee' => { 'text' => $locale->text('Employee'), },
'projectnumber' => { 'text' => $locale->text('Project Number'), },
'oe_id' => { 'text' => $locale->text('Document'), },
);
my $href = build_std_url('action=generate_journal', grep { $form->{$_} } @hidden_variables);
my %column_alignment = map { $_ => 'right' } qw(qty);
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
my %column_alignment = map { $_ => 'right' } qw(qty);
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
+ my $allrows = 0;
+ $allrows = 1 if $form->{report_generator_output_format} ne 'HTML' ;
+
+ # manual paginating
+ my $pages = {};
+ $pages->{per_page} = $::form->{per_page} || 15;
+ my $first_nr = ($page - 1) * $pages->{per_page};
+ my $last_nr = $first_nr + $pages->{per_page};
+ my $idx = 0;
+
$entry->{qty} = $form->format_amount_units('amount' => $entry->{qty},
'part_unit' => $entry->{partunit},
'conv_units' => 'convertible');
$entry->{qty} = $form->format_amount_units('amount' => $entry->{qty},
'part_unit' => $entry->{partunit},
'conv_units' => 'convertible');
+ if ( ! $allrows ) {
+ $pages->{max} = SL::DB::Helper::Paginated::ceil($idx, $pages->{per_page}) || 1;
+ $pages->{page} = $page < 1 ? 1: $page > $pages->{max} ? $pages->{max}: $page;
+ $pages->{common} = [ grep { $_->{visible} } @{ SL::DB::Helper::Paginated::make_common_pages($pages->{page}, $pages->{max}) } ];
+
+ $report->set_options('raw_bottom_info_text' => $form->parse_html_template('common/paginate',
+ { 'pages' => $pages , 'base_url' => $href}) );
+ }
bin_id => sub { push @options, $locale->text('Bin') . " : " .
SL::DB::Manager::Bin->find_by(id => $form->{bin_id})->description},
partnumber => sub { push @options, $locale->text('Partnumber') . " : $form->{partnumber}"},
bin_id => sub { push @options, $locale->text('Bin') . " : " .
SL::DB::Manager::Bin->find_by(id => $form->{bin_id})->description},
partnumber => sub { push @options, $locale->text('Partnumber') . " : $form->{partnumber}"},
description => sub { push @options, $locale->text('Description') . " : $form->{description}"},
chargenumber => sub { push @options, $locale->text('Charge Number') . " : $form->{chargenumber}"},
bestbefore => sub { push @options, $locale->text('Best Before') . " : $form->{bestbefore}"},
description => sub { push @options, $locale->text('Description') . " : $form->{description}"},
chargenumber => sub { push @options, $locale->text('Charge Number') . " : $form->{chargenumber}"},
bestbefore => sub { push @options, $locale->text('Best Before') . " : $form->{bestbefore}"},
include_invalid_warehouses => sub { push @options, $locale->text('Include invalid warehouses ')},
};
foreach (keys %filter) {
$dispatch_options->{$_}->() if $dispatch_options->{$_};
}
include_invalid_warehouses => sub { push @options, $locale->text('Include invalid warehouses ')},
};
foreach (keys %filter) {
$dispatch_options->{$_}->() if $dispatch_options->{$_};
}
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
my %column_defs = (
'warehousedescription' => { 'text' => $locale->text('Warehouse'), },
'bindescription' => { 'text' => $locale->text('Bin'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
my %column_defs = (
'warehousedescription' => { 'text' => $locale->text('Warehouse'), },
'bindescription' => { 'text' => $locale->text('Bin'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
'partdescription' => { 'text' => $locale->text('Part Description'), },
'chargenumber' => { 'text' => $locale->text('Charge Number'), },
'bestbefore' => { 'text' => $locale->text('Best Before'), },
'qty' => { 'text' => $locale->text('Qty'), },
'partdescription' => { 'text' => $locale->text('Part Description'), },
'chargenumber' => { 'text' => $locale->text('Charge Number'), },
'bestbefore' => { 'text' => $locale->text('Best Before'), },
'qty' => { 'text' => $locale->text('Qty'), },
'stock_value' => { 'text' => $locale->text('Stock value'), },
);
my $href = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
'stock_value' => { 'text' => $locale->text('Stock value'), },
);
my $href = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
my %column_alignment = map { $_ => 'right' } qw(qty stock_value);
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
my %column_alignment = map { $_ => 'right' } qw(qty stock_value);
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
+ my $allrows = 0;
+ $allrows = 1 if $form->{report_generator_output_format} ne 'HTML' ;
+
+ # manual paginating
+ 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};
+
map { $subtotals{$_} += $entry->{$_} } @subtotals_columns;
$total_stock_value += $entry->{stock_value} * 1;
map { $subtotals{$_} += $entry->{$_} } @subtotals_columns;
$total_stock_value += $entry->{stock_value} * 1;
-
- $entry->{qty} = $form->format_amount_units('amount' => $entry->{qty},
- 'part_unit' => $entry->{partunit},
- 'conv_units' => 'convertible');
+ $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->{stock_value} = $form->format_amount(\%myconfig, $entry->{stock_value} * 1, 2);
my $row_set = [ { map { $_ => { 'data' => $entry->{$_}, 'align' => $column_alignment{$_} } } @columns } ];
$entry->{stock_value} = $form->format_amount(\%myconfig, $entry->{stock_value} * 1, 2);
my $row_set = [ { map { $_ => { 'data' => $entry->{$_}, 'align' => $column_alignment{$_} } } @columns } ];
|| ($entry->{$sort_col} ne $contents[$idx + 1]->{$sort_col}))) {
my $row = { map { $_ => { 'data' => '', 'class' => 'listsubtotal', 'align' => $column_alignment{$_}, } } @columns };
|| ($entry->{$sort_col} ne $contents[$idx + 1]->{$sort_col}))) {
my $row = { map { $_ => { 'data' => '', 'class' => 'listsubtotal', 'align' => $column_alignment{$_}, } } @columns };
- $row->{qty}->{data} = $form->format_amount_units('amount' => $subtotals{qty} * 1,
- 'part_unit' => $entry->{partunit},
- 'conv_units' => 'convertible');
+ $row->{qty}->{data} = $form->format_amount(\%myconfig, $subtotals{qty});
+# $row->{qty}->{data} = $form->format_amount_units('amount' => $subtotals{qty} * 1,
+# 'part_unit' => $entry->{partunit},
+# 'conv_units' => 'convertible');
$row->{stock_value}->{data} = $form->format_amount(\%myconfig, $subtotals{stock_value} * 1, 2);
%subtotals = map { $_ => 0 } @subtotals_columns;
$row->{stock_value}->{data} = $form->format_amount(\%myconfig, $subtotals{stock_value} * 1, 2);
%subtotals = map { $_ => 0 } @subtotals_columns;