my $query =
qq|SELECT se.id, se.employee_id, se.executed, se.closed, itime::date AS export_date,
+ (SELECT COUNT(*)
+ FROM sepa_export_items sei
+ WHERE (sei.sepa_export_id = se.id)) AS num_invoices,
+ (SELECT SUM(sei.amount)
+ FROM sepa_export_items sei
+ WHERE (sei.sepa_export_id = se.id)) AS sum_amounts,
e.name AS employee
FROM sepa_export se
LEFT JOIN (
'employee' => { 'text' => $locale->text('Employee'), },
'executed' => { 'text' => $locale->text('Executed'), },
'closed' => { 'text' => $locale->text('Closed'), },
+ num_invoices => { 'text' => $locale->text('Number of invoices'), },
+ sum_amounts => { 'text' => $locale->text('Sum of all amounts'), },
);
- my @columns = qw(selected id export_date employee executed closed);
+ my @columns = qw(selected id export_date employee executed closed invoices netamount);
+ my %column_alignment = map { ($_ => 'right') } qw(num_invoices sum_amounts);
foreach my $name (qw(id export_date employee executed closed)) {
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
$column_defs{selected}->{visible} = $open_available ? 'HTML' : 0;
$column_defs{executed}->{visible} = $form->{l_executed} && $form->{l_not_executed} ? 1 : 0;
$column_defs{closed}->{visible} = $form->{l_closed} && $form->{l_open} ? 1 : 0;
+ $column_defs{$_}->{align} = $column_alignment{$_} for keys %column_alignment;
my @options = ();
push @options, ($vc eq 'customer' ? $::locale->text('Customer') : $locale->text('Vendor')) . ' : ' . $form->{f_vc} if ($form->{f_vc});
my $edit_url = build_std_url('action=bank_transfer_edit', 'callback');
foreach my $export (@{ $exports }) {
- my $row = { map { $_ => { 'data' => $export->{$_} } } keys %{ $export } };
+ my $row = { map { $_ => { 'data' => $export->{$_}, 'align' => $column_alignment{$_} } } keys %{ $export } };
map { $row->{$_}->{data} = $export->{$_} ? $locale->text('yes') : $locale->text('no') } qw(executed closed);
$row->{id}->{link} = $edit_url . '&id=' . E($export->{id}) . '&vc=' . E($vc);
+ $row->{$_}->{data} = $::form->format_amount(\%::myconfig, $row->{$_}->{data}, 2) for qw(sum_amounts);
+
if (!$export->{closed}) {
$row->{selected}->{raw_data} =
$cgi->hidden(-name => "exports[+].id", -value => $export->{id})
'Number of columns of custom variables in form details (second row)' => 'Anzahl der Spalten für benutzerdef. Variablen in den Formulardetails (zweite Positionszeile)',
'Number of copies' => 'Anzahl Kopien',
'Number of entries changed: #1' => 'Anzahl geänderter Einträge: #1',
+ 'Number of invoices' => 'Anzahl Rechnungen',
'Number of invoices created:' => 'Anzahl erstellter Rechnungen:',
'Number of invoices printed:' => 'Anzahl gedruckter Rechnungen:',
'Number of invoices to create' => 'Anzahl zu erstellender Rechnungen',
'Sum for' => 'Summe für',
'Sum for #1' => 'Summe für #1',
'Sum for section' => 'Summe für Abschnitt',
+ 'Sum of all amounts' => 'Summe aller Beträge',
'Sum open amount' => 'Summierter offener Betrag',
'Sum per' => 'Summe per',
'Summen- und Saldenliste' => 'Summen- und Saldenliste',