Revision a873249c
Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt
SL/Locale.pm | ||
---|---|---|
$self->{raw_io_active} = 0;
|
||
}
|
||
|
||
sub set_numberformat_wo_thousands_separator {
|
||
my $self = shift;
|
||
my $myconfig = shift || \%::myconfig;
|
||
|
||
$self->{saved_numberformat} = $myconfig->{numberformat};
|
||
$myconfig->{numberformat} =~ s/^1[,\.]/1/;
|
||
}
|
||
|
||
sub restore_numberformat {
|
||
my $self = shift;
|
||
my $myconfig = shift || \%::myconfig;
|
||
|
||
$myconfig->{numberformat} = $self->{saved_numberformat} if $self->{saved_numberformat};
|
||
}
|
||
|
||
1;
|
bin/mozilla/ap.pl | ||
---|---|---|
'attachment_basename' => $locale->text('vendor_invoice_list') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
# add sort and escape callback, this one we use for the add sub
|
||
$form->{callback} = $href .= "&sort=$form->{sort}";
|
bin/mozilla/ar.pl | ||
---|---|---|
'attachment_basename' => $locale->text('invoice_list') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
# add sort and escape callback, this one we use for the add sub
|
||
$form->{callback} = $href .= "&sort=$form->{sort}";
|
bin/mozilla/bankaccounts.pl | ||
---|---|---|
use strict;
|
||
|
||
use List::MoreUtils qw(any);
|
||
use POSIX qw(strftime);
|
||
|
||
use SL::BankAccount;
|
||
... | ... | |
'attachment_basename' => $locale->text('bankaccounts') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
bin/mozilla/ca.pl | ||
---|---|---|
'std_column_visibility' => 1,
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
||
... | ... | |
'std_column_visibility' => 1,
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
bin/mozilla/ct.pl | ||
---|---|---|
'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
bin/mozilla/do.pl | ||
---|---|---|
'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
# add sort and escape callback, this one we use for the add sub
|
||
$form->{callback} = $href .= "&sort=$form->{sort}";
|
bin/mozilla/fu.pl | ||
---|---|---|
'attachment_basename' => $locale->text('follow_up_list') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
my $idx = 0;
|
||
my $callback = build_std_url('action=report', grep { $form->{$_} } @report_params);
|
bin/mozilla/gl.pl | ||
---|---|---|
'attachment_basename' => $locale->text('general_ledger_list') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
# add sort to callback
|
||
$form->{callback} = "$callback&sort=" . E($form->{sort}) . "&sortdir=" . E($form->{sortdir});
|
bin/mozilla/ic.pl | ||
---|---|---|
'attachment_basename' => $attachment_basenames{$form->{searchitems}} . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
bin/mozilla/oe.pl | ||
---|---|---|
'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
# add sort and escape callback, this one we use for the add sub
|
||
$form->{callback} = $href .= "&sort=$form->{sort}";
|
bin/mozilla/projects.pl | ||
---|---|---|
'attachment_basename' => $locale->text('project_list') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
CVar->add_custom_variables_to_report('module' => 'Projects',
|
||
'trans_id_field' => 'id',
|
bin/mozilla/rp.pl | ||
---|---|---|
</tr>
|
||
<tr>
|
||
<td>| . $locale->text('Review of Aging list') . qq|</td>
|
||
<td><select name="review_of_aging_list">
|
||
<td><select name="review_of_aging_list">
|
||
<option></option>
|
||
<option>0-30</option>
|
||
<option>30-60</option>
|
||
... | ... | |
'pdf_template' => 'rp/html_report_susa',
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
# add sort and escape callback, this one we use for the add sub
|
||
$form->{callback} = $href .= "&sort=$form->{sort}";
|
||
... | ... | |
'std_column_visibility' => 1,
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
||
... | ... | |
'title' => $form->{title},
|
||
'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
my $previous_ctid = 0;
|
||
my $row_idx = 0;
|
||
... | ... | |
'raw_bottom_info_text' => $raw_bottom_info_text);
|
||
}
|
||
|
||
$report->set_options_from_form();
|
||
|
||
$report->generate_with_headers();
|
||
|
||
$main::lxdebug->leave_sub();
|
||
... | ... | |
);
|
||
$report->set_options_from_form();
|
||
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
||
|
bin/mozilla/sepa.pl | ||
---|---|---|
'attachment_basename' => $locale->text('banktransfers') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%::myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
bin/mozilla/vk.pl | ||
---|---|---|
my ($callback, $href, @columns);
|
||
|
||
$form->{customer} = $form->unescape($form->{customer});
|
||
|
||
|
||
($form->{customername}, $form->{customer_id}) = split(/--/, $form->{customer});
|
||
|
||
# decimalplaces überprüfen oder auf Default 2 setzen
|
||
... | ... | |
'marge_total' => { 'text' => $locale->text('Sales margin'), },
|
||
'marge_percent' => { 'text' => $locale->text('Sales margin %'), },
|
||
);
|
||
|
||
|
||
my %column_alignment = map { $_ => 'right' } qw(lastcost sellprice sellprice_total lastcost_total unit discount marge_total marge_percent qty);
|
||
|
||
$form->{"l_type"} = "Y";
|
||
... | ... | |
'attachment_basename' => $locale->text('Sales Report') . strftime('_%Y%m%d', localtime time),
|
||
);
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
$report->set_columns(%column_defs);
|
||
$report->set_column_order(@columns);
|
||
... | ... | |
$ar->{sellprice} = $ar->{sellprice} / $ar->{price_factor};
|
||
$ar->{lastcost} = $ar->{lastcost} / $ar->{price_factor};
|
||
$ar->{sellprice_total} = $ar->{qty} * $ar->{sellprice};
|
||
$ar->{lastcost_total} = $ar->{qty} * $ar->{lastcost};
|
||
$ar->{lastcost_total} = $ar->{qty} * $ar->{lastcost};
|
||
# marge_percent wird neu berechnet, da Wert in invoice leer ist (Bug)
|
||
$ar->{marge_percent} = $ar->{sellprice_total} ? (($ar->{sellprice_total}-$ar->{lastcost_total}) / $ar->{sellprice_total}) : 0;
|
||
# marge_total neu berechnen
|
||
... | ... | |
$report->add_data($headerrow_set);
|
||
|
||
# add empty row after main header
|
||
# my $emptyheaderrow->{description}->{data} = "";
|
||
# my $emptyheaderrow->{description}->{data} = "";
|
||
# $emptyheaderrow->{description}->{class} = "listmainsortheader";
|
||
# my $emptyheaderrow_set = [ $emptyheaderrow ];
|
||
# $report->add_data($emptyheaderrow_set) if $form->{l_headers} eq "Y";
|
||
# $report->add_data($emptyheaderrow_set) if $form->{l_headers} eq "Y";
|
||
};
|
||
|
||
# subsort überschriften
|
||
if ( $idx == 0
|
||
if ( $idx == 0
|
||
or $ar->{ $form->{'subsort'} } ne $form->{AR}->[$idx - 1]->{ $form->{'subsort'} }
|
||
or $ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx - 1]->{ $form->{'mainsort'} }
|
||
) {
|
||
... | ... | |
map { $subtotals1{$_} += $ar->{$_};
|
||
$subtotals2{$_} += $ar->{$_};
|
||
} @subtotal_columns;
|
||
|
||
map { $totals{$_} += $ar->{$_} } @total_columns;
|
||
|
||
map { $totals{$_} += $ar->{$_} } @total_columns;
|
||
|
||
$subtotals2{sellprice} = $subtotals2{sellprice_total} / $subtotals2{qty} if $subtotals2{qty} != 0;
|
||
$subtotals1{sellprice} = $subtotals1{sellprice_total} / $subtotals1{qty} if $subtotals1{qty} != 0;
|
||
... | ... | |
'align' => $column_alignment{$column},
|
||
};
|
||
}
|
||
|
||
|
||
$row->{description}->{class} = 'listsortdescription';
|
||
|
||
$row->{invnumber}->{link} = build_std_url("script=is.pl", 'action=edit')
|
||
... | ... | |
} else {
|
||
$name = 'name';
|
||
};
|
||
|
||
|
||
if ($form->{l_subtotal} eq 'Y' ) {
|
||
push @{ $row_set }, create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, 'listsubsortsubtotal', $ar->{$name}) ;
|
||
push @{ $row_set }, insert_empty_row();
|
||
};
|
||
}
|
||
|
||
# if mainsort has changed, add mainsort subtotal and empty row
|
||
# if mainsort has changed, add mainsort subtotal and empty row
|
||
if (($form->{l_subtotal} eq 'Y')
|
||
&& (($idx == (scalar @{ $form->{AR} } - 1)) # last element always has a subtotal
|
||
|| ($ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx + 1]->{ $form->{'mainsort'} })
|
||
... | ... | |
push @{ $row_set }, insert_empty_row();
|
||
};
|
||
}
|
||
|
||
|
||
$report->add_data($row_set);
|
||
|
||
$idx++;
|
||
... | ... | |
my %myconfig = %main::myconfig;
|
||
|
||
my $row = { map { $_ => { 'data' => '', 'class' => $class, 'align' => $column_alignment->{$_}, } } @{ $columns } };
|
||
|
||
|
||
$row->{description}->{data} = "Summe " . $name;
|
||
|
||
map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, 2) } qw(marge_total marge_percent);
|
bin/mozilla/wh.pl | ||
---|---|---|
'title' => $form->{title},
|
||
'attachment_basename' => strftime($locale->text('warehouse_journal_list') . '_%Y%m%d', localtime time));
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
my $all_units = AM->retrieve_units(\%myconfig, $form);
|
||
my @contents = WH->get_warehouse_journal(%filter);
|
||
... | ... | |
'title' => $form->{title},
|
||
'attachment_basename' => strftime($locale->text('warehouse_report_list') . '_%Y%m%d', localtime time));
|
||
$report->set_options_from_form();
|
||
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
|
||
my $all_units = AM->retrieve_units(\%myconfig, $form);
|
||
my @contents = WH->get_warehouse_report(%filter);
|
Auch abrufbar als: Unified diff
Zahlen beim CSV-Export ohne Tausendertrennzeichen formatieren
Fix für Bug 1393.