Revision 9c7262bf
Von Sven Schöling vor fast 11 Jahren hinzugefügt
SL/Controller/FinancialControllingReport.pm | ||
---|---|---|
6 | 6 |
use List::Util qw(sum); |
7 | 7 |
|
8 | 8 |
use SL::DB::Order; |
9 |
use SL::DB::ProjectType; |
|
9 | 10 |
use SL::Controller::Helper::GetModels; |
10 | 11 |
use SL::Controller::Helper::Paginated; |
11 | 12 |
use SL::Controller::Helper::Sorted; |
... | ... | |
37 | 38 |
customer => t8('Customer'), |
38 | 39 |
transaction_description => t8('Transaction description'), |
39 | 40 |
globalprojectnumber => t8('Project'), |
41 |
globalproject_type => t8('Project Type'), |
|
40 | 42 |
netamount => t8('Order amount'), |
41 | 43 |
); |
42 | 44 |
|
... | ... | |
62 | 64 |
my ($self) = @_; |
63 | 65 |
|
64 | 66 |
$self->{filter} = {}; |
65 |
my %args = ( parse_filter($::form->{filter}, with_objects => [ 'customer', 'globalproject' ], launder_to => $self->{filter})); |
|
67 |
my %args = ( parse_filter($::form->{filter}, with_objects => [ 'customer', 'globalproject', 'globalproject.project_type' ], launder_to => $self->{filter}));
|
|
66 | 68 |
$args{query} = [ |
67 | 69 |
@{ $args{query} || [] }, |
68 | 70 |
SL::DB::Manager::Order->type_filter('sales_order'), |
... | ... | |
77 | 79 |
my $report = SL::ReportGenerator->new(\%::myconfig, $::form); |
78 | 80 |
$self->{report} = $report; |
79 | 81 |
|
80 |
my @columns = qw(customer globalprojectnumber project_type ordnumber netamount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p |
|
82 |
my @columns = qw(customer globalprojectnumber globalproject_type ordnumber netamount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p
|
|
81 | 83 |
billable_amount billable_amount_p other_amount); |
82 |
my @sortable = qw(ordnumber transdate customer netamount globalprojectnumber); |
|
84 |
my @sortable = qw(ordnumber transdate customer netamount globalprojectnumber globalproject_type);
|
|
83 | 85 |
$self->{number_columns} = [ qw(netamount billed_amount billed_amount_p delivered_amount delivered_amount_p paid_amount paid_amount_p other_amount billable_amount billable_amount_p) ]; |
84 | 86 |
|
85 | 87 |
my %column_defs = ( |
... | ... | |
97 | 99 |
customer => { sub => sub { $_[0]->customer->name }, |
98 | 100 |
obj_link => sub { $self->link_to($_[0]->customer) } }, |
99 | 101 |
globalprojectnumber => { sub => sub { $_[0]->globalproject_id ? $_[0]->globalproject->projectnumber : '' } }, |
100 |
project_type => { text => $::locale->text('Project type'),
|
|
101 |
sub => sub { $_[0]->globalproject_id ? $_[0]->globalproject->type : '' } },
|
|
102 |
globalproject_type => { text => $::locale->text('Project type'),
|
|
103 |
sub => sub { $_[0]->globalproject_id ? $_[0]->globalproject->project_type->description : '' } },
|
|
102 | 104 |
); |
103 | 105 |
|
104 | 106 |
map { $column_defs{$_}->{text} ||= $::locale->text( $self->get_sort_spec->{$_}->{title} ) } keys %column_defs; |
Auch abrufbar als: Unified diff
Projekttypen verwaltbar gemacht