use Rose::Object::MakeMethods::Generic (
scalar => [ qw(db_args flat_filter) ],
- 'scalar --get_set_init' => [ qw(models all_edit_right mode vc) ],
+ 'scalar --get_set_init' => [ qw(models all_edit_right mode vc all_employees) ],
);
__PACKAGE__->run_before(sub { $::auth->assert('delivery_plan'); });
my $orderitems = $self->models->get;
$self->{all_businesses} = SL::DB::Manager::Business->get_all_sorted;
- $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems);
+ $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems);
}
# private functions
my @filter_strings;
my $business = SL::DB::Business->new(id => $filter->{order}{customer}{"business_id"})->load->description if $filter->{order}{customer}{"business_id"};
+ my $employee = SL::DB::Employee->new(id => $filter->{order}{employee_id})->load->name if $filter->{order}{employee_id};
+
my @filters = (
[ $filter->{order}{"ordnumber:substr::ilike"}, $::locale->text('Number') ],
[ $filter->{order}{globalproject}{"projectnumber:substr::ilike"}, $::locale->text('Document Project Number') ],
[ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ],
[ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ],
[ $business, $::locale->text('Customer type') ],
+ [ $employee, $::locale->text('Employee') ],
);
my %flags = (
return $::form->{mode} if ($::form->{mode} eq 'delivery_value_report' || $::form->{mode} eq 'delivery_plan') || croak "self (DeliveryPlan) has no mode defined";
}
+sub init_all_employees {
+ return SL::DB::Manager::Employee->get_all_sorted;
+}
sub link_to {
my ($self, $object, %params) = @_;
style => 'width: 200px') %]
</td>
</tr>
+ <tr>
+ <th align="right">[% 'Employee' | $T8 %]</th>
+ <td>
+ [% L.select_tag('filter.order.employee_id', SELF.all_employees,
+ default => filter.order.employee_id,
+ title_key => 'name',
+ value_key => 'id',
+ with_empty => 1,
+ style => 'width: 200px') %]
+ </td>
+ </tr>
<tr>
<th align="right">[% 'Type' | $T8 %]</th>
<td>
[% L.hidden_tag('page', FORM.page) %]
[% L.hidden_tag('vc', SELF.vc) %]
[% L.hidden_tag('mode', SELF.mode) %]
- [% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%]
+[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%]
<a href='#' onClick='javascript:$("#filter_table input").val("");$("#filter_table input[type=checkbox]").prop("checked", 0);'>[% 'Reset' | $T8 %]</a>