34 |
34 |
|
35 |
35 |
use POSIX qw(strftime);
|
36 |
36 |
|
|
37 |
use List::MoreUtils qw(none);
|
|
38 |
|
37 |
39 |
use SL::IS;
|
38 |
40 |
use SL::DN;
|
39 |
41 |
use SL::DB::Department;
|
... | ... | |
337 |
339 |
|
338 |
340 |
$main::auth->assert('dunning_edit');
|
339 |
341 |
|
340 |
|
my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber
|
|
342 |
my @filter_field_list = qw(customer_id customer dunning_id dunning_level department_id invnumber ordnumber
|
341 |
343 |
transdatefrom transdateto dunningfrom dunningto notes showold l_salesman salesman_id);
|
342 |
344 |
|
343 |
345 |
report_generator_set_default_sort('customername', 1);
|
... | ... | |
375 |
377 |
'transdate' => { 'text' => $locale->text('Invdate') },
|
376 |
378 |
'duedate' => { 'text' => $locale->text('Invoice Duedate') },
|
377 |
379 |
'amount' => { 'text' => $locale->text('Amount') },
|
|
380 |
'dunning_id' => { 'text' => $locale->text('Dunning number') },
|
378 |
381 |
'dunning_date' => { 'text' => $locale->text('Dunning Date') },
|
379 |
382 |
'dunning_duedate' => { 'text' => $locale->text('Dunning Duedate') },
|
380 |
383 |
'fee' => { 'text' => $locale->text('Total Fees') },
|
... | ... | |
384 |
387 |
);
|
385 |
388 |
|
386 |
389 |
$report->set_columns(%column_defs);
|
387 |
|
$report->set_column_order(qw(checkbox dunning_description customername language invnumber transdate
|
|
390 |
$report->set_column_order(qw(checkbox dunning_description dunning_id customername language invnumber transdate
|
388 |
391 |
duedate amount dunning_date dunning_duedate fee interest salesman));
|
389 |
392 |
$report->set_sort_indicator($form->{sort}, $form->{sortdir});
|
390 |
393 |
|
... | ... | |
392 |
395 |
my $print_url = sub { build_std_url('action=print_dunning', 'format=pdf', 'media=screen', 'dunning_id='.$_[0]->{dunning_id}, 'language_id=' . $_[0]->{language_id}) };
|
393 |
396 |
my $sort_url = build_std_url('action=show_dunning', grep { $form->{$_} } @filter_field_list);
|
394 |
397 |
|
395 |
|
foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate salesman)) {
|
|
398 |
foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate salesman dunning_id)) {
|
396 |
399 |
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
|
397 |
400 |
$column_defs{$name}->{link} = $sort_url . "&sort=$name&sortdir=$sortdir";
|
398 |
401 |
}
|
399 |
402 |
|
400 |
|
my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest salesman);
|
|
403 |
my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest salesman dunning_id);
|
401 |
404 |
|
402 |
405 |
my ($current_dunning_rows, $previous_dunning_id, $first_row_for_dunning);
|
403 |
406 |
|
... | ... | |
423 |
426 |
my $row = { };
|
424 |
427 |
foreach my $column (keys %{ $ref }) {
|
425 |
428 |
$row->{$column} = {
|
426 |
|
'data' => $first_row_for_dunning || (($column ne 'dunning_description') && ($column ne 'customername')) ? $ref->{$column} : '',
|
|
429 |
'data' => $first_row_for_dunning || (none { $_ eq $column } qw(dunning_description customername dunning_id)) ? $ref->{$column} : '',
|
427 |
430 |
|
428 |
431 |
'align' => $alignment{$column},
|
429 |
432 |
|
430 |
433 |
'link' => ( $column eq 'invnumber' ? $edit_url->($ref)
|
431 |
434 |
: $column eq 'dunning_description' ? $print_url->($ref)
|
|
435 |
: $column eq 'dunning_id' ? $print_url->($ref)
|
432 |
436 |
: ''),
|
433 |
437 |
};
|
434 |
438 |
}
|
Mahnbericht: Nach Mahnungsnummer filtern können und diese Anzeigen