use SL::Controller::Helper::ReportGenerator;
use SL::CVar;
use SL::DB::Customer;
+use SL::DB::DeliveryOrder;
+use SL::DB::Invoice;
+use SL::DB::Order;
use SL::DB::Project;
+use SL::DB::PurchaseInvoice;
use SL::Helper::Flash;
use SL::Locale::String;
use Rose::Object::MakeMethods::Generic
(
- scalar => [ qw(project db_args flat_filter) ],
+ scalar => [ qw(project db_args flat_filter linked_records) ],
);
__PACKAGE__->run_before('check_auth');
sub action_edit {
my ($self) = @_;
+
+ $self->linked_records([
+ map { @{ $_ } }
+ grep { $_ } (
+ SL::DB::Manager::Order-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
+ SL::DB::Manager::DeliveryOrder-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
+ SL::DB::Manager::Invoice-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer' ], sort_by => 'transdate ASC'),
+ SL::DB::Manager::PurchaseInvoice->get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'vendor' ], sort_by => 'transdate ASC'),
+ )]);
+
$self->display_form(title => $::locale->text('Edit project #1', $self->project->projectnumber),
callback => $::form->{callback} || $self->url_for(action => 'edit', id => $self->project->id));
}
[%- USE T8 %]
-[%- USE L %]
+[%- USE L %][%- USE P %]
[%- USE HTML %][%- USE LxERP %]
[%- INCLUDE 'common/flash.html' %]
[%- IF CUSTOM_VARIABLES.size %]
<li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
[%- END %]
+ [%- IF SELF.project.id %]
+ <li><a href="#" rel="linked_records">[% 'Linked Records' | $T8 %]</a></li>
+ [%- END %]
</ul>
<div class="tabcontentstyle">
</div>
[%- END %]
+ [%- IF SELF.project.id %]
+ <div id="linked_records" class="tabcontent">
+
+ [% P.grouped_record_list(SELF.linked_records) %]
+
+ <br style="clear: left" />
+ </div>
+ [%- END %]
+
</div>
<p>