'scalar --get_set_init' => [ qw(project_types models) ],
);
-__PACKAGE__->run_before(sub { $::auth->assert('sales_order_edit'); });
+__PACKAGE__->run_before(sub { $::auth->assert('sales_financial_controlling'); });
my %sort_columns = (
ordnumber => t8('Order'),
$self->calculate_data;
+ $self->setup_list_action_bar;
$self->list_objects;
}
sub prepare_report {
my ($self) = @_;
- my $report = SL::ReportGenerator->new(\%::myconfig, $::form);
- $self->{report} = $report;
+ my $report = SL::ReportGenerator->new(\%::myconfig, $::form);
+ $report->{title} = t8('Financial Controlling Report');
+ $self->{report} = $report;
my @columns = qw(customer globalprojectnumber globalproject_type transaction_description ordnumber net_amount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p
billable_amount billable_amount_p other_amount);
query => [
SL::DB::Manager::Order->type_filter('sales_order'),
'!closed' => 1,
+ (salesman_id => SL::DB::Manager::Employee->current->id) x !$::auth->assert('sales_all_edit', 1),
or => [
globalproject_id => undef,
and => [
if ($object->isa('SL::DB::Order')) {
my $type = $object->type;
my $id = $object->id;
-
- return "oe.pl?action=$action&type=$type&vc=customer&id=$id";
+ return "controller.pl?action=Order/$action&type=$type&id=$id";
}
if ($object->isa('SL::DB::Customer')) {
my $id = $object->id;
}
}
+sub setup_list_action_bar {
+ my ($self, %params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Update'),
+ submit => [ '#filter_form', { action => 'FinancialControllingReport/list' } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
1;