use parent qw(SL::Controller::Base);
-use SL::Controller::Helper::ReportGenerator;
+#use SL::Controller::Helper::ReportGenerator;
+use SL::ReportGenerator;
use SL::DBUtils;
#use Data::Dumper;
my $sql = "SELECT chart_id,xbrl_tag from mebil_mapping";
$self->{data} = SL::DBUtils::selectall_hashref_query($::form, $::form->get_standard_dbh, $sql);
-# $self->get_objects;
-# $self->calculate_one_time_data;
-# $self->calculate_periodic_invoices;
$self->prepare_report;
$self->list_data;
-=cut
- $::form->header(no_layout => 1);
-
- print "<h1>Mebil-Mapping</h1>";
- print "<p>Folgende Zuordnungen sind in der DB hinterlegt:";
-
- print "<table><tr><th>Konto</th><th>Ziel</th></tr>\n";
- foreach my $mapping (@{ $self->{data} }) {
- print "<tr><td>",$mapping->{chart_id},"</td><td>",$mapping->{xbrl_tag},"</td></tr>\n";
- }
- print "</table>\n";
-=cut
$::lxdebug->leave_sub;
}
+
sub prepare_report {
my ($self) = @_;
return $self->report->generate_with_headers;
}
-
-=cut
-sub get_objects {
- my ($self) = @_;
- $self->objects({
- sales_quotations => SL::DB::Manager::Order->get_all( where => [ and => [ @f_date, @f_salesman, SL::DB::Manager::Order->type_filter('sales_quotation') ]]),
- sales_orders => SL::DB::Manager::Order->get_all( where => [ and => [ @f_date, @f_salesman, SL::DB::Manager::Order->type_filter('sales_order') ]], with_objects => [ qw(periodic_invoices_config) ]),
- sales_orders_per_inv => [],
- requests_for_quotation => SL::DB::Manager::Order->get_all( where => [ and => [ @f_date, @f_salesman, SL::DB::Manager::Order->type_filter('request_quotation') ]]),
- purchase_orders => SL::DB::Manager::Order->get_all( where => [ and => [ @f_date, @f_salesman, SL::DB::Manager::Order->type_filter('purchase_order') ]]),
- sales_invoices => SL::DB::Manager::Invoice->get_all( where => [ and => [ @f_date, @f_salesman, ]]),
- purchase_invoices => SL::DB::Manager::PurchaseInvoice->get_all(where => [ and => \@f_date ]),
- periodic_invoices_cfg => SL::DB::Manager::PeriodicInvoicesConfig->get_all(where => [ active => 1, $self->salesman_id ? ('order.salesman_id' => $self->salesman_id) : () ], with_objects => [ qw(order) ]),
- });
-
- $self->objects->{sales_orders} = [ grep { !$_->periodic_invoices_config || !$_->periodic_invoices_config->active } @{ $self->objects->{sales_orders} } ];
-}
-=cut
-
1;