]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/FinancialControllingReport.pm
Finanzcontrollingbericht: Klassenname für Export richtig setzen
[mfinanz.git] / SL / Controller / FinancialControllingReport.pm
index eab060a15ac55c987e31ac0472faf1641edef9e6..e587f2dd562c54af9670d509b515dc15a45fe5c7 100644 (file)
@@ -30,10 +30,9 @@ __PACKAGE__->make_sorted(
   MODEL                   => 'Order',
   ONLY                    => [ qw(list) ],
 
-  DEFAULT_BY              => 'transdate',
+  DEFAULT_BY              => 'globalprojectnumber',
   DEFAULT_DIR             => 1,
 
-  transdate               => t8('Order Date'),
   ordnumber               => t8('Order'),
   customer                => t8('Customer'),
   transaction_description => t8('Transaction description'),
@@ -78,13 +77,12 @@ sub prepare_report {
   my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
   $self->{report} = $report;
 
-  my @columns     = qw(customer globalprojectnumber ordnumber transdate netamount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p
-                       billable_amount billable_amount_p other_amount open_amount transaction_description);
+  my @columns     = qw(customer globalprojectnumber ordnumber netamount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p
+                       billable_amount billable_amount_p other_amount);
   my @sortable    = qw(ordnumber transdate customer netamount globalprojectnumber);
-  $self->{number_columns} = [ qw(netamount billed_amount billed_amount_p delivered_amount delivered_amount_p paid_amount paid_amount_p open_amount other_amount billable_amount billable_amount_p) ];
+  $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) ];
 
   my %column_defs           = (
-    transdate               => {      sub => sub { $_[0]->transdate_as_date                                           }  },
     netamount               => {                                                                                         },
     billed_amount           => { text     => $::locale->text('Billed amount')                                            },
     billed_amount_p         => { text     => $::locale->text('%')                                                        },
@@ -94,9 +92,7 @@ sub prepare_report {
     paid_amount_p           => { text     => $::locale->text('%')                                                        },
     billable_amount         => { text     => $::locale->text('Billable amount')                                          },
     billable_amount_p       => { text     => $::locale->text('%')                                                        },
-    open_amount             => { text     => $::locale->text('Bills receivable')                                         },
     other_amount            => { text     => $::locale->text('Billed extra expenses')                                    },
-    transaction_description => {                                                                                         },
     ordnumber               => { obj_link => sub { $self->link_to($_[0])                                              }  },
     customer                => {      sub => sub { $_[0]->customer->name                                              },
                                  obj_link => sub { $self->link_to($_[0]->customer)                                    }  },
@@ -108,7 +104,7 @@ sub prepare_report {
 
   $report->set_options(
     std_column_visibility => 1,
-    controller_class      => 'FinancialControlling',
+    controller_class      => 'FinancialControllingReport',
     output_format         => 'HTML',
     top_info_text         => $::locale->text('Financial controlling report for open sales orders'),
     raw_top_info_text     => $self->render('financial_controlling_report/report_top',    { no_output => 1, partial => 1 }),
@@ -144,7 +140,6 @@ sub calculate_data {
     my $billed_amount           = sum map { $_->netamount                                                          } @{ $invoices        };
     $order->{other_amount}      = $billed_amount             - $order->{billed_amount};
     $order->{billable_amount}   = $order->{delivered_amount} - $order->{billed_amount};
-    $order->{open_amount}       = $billed_amount             - $order->{paid_amount  };
 
     foreach (qw(delivered billed paid billable)) {
       $order->{"${_}_amount_p"} = $order->netamount * 1 ? $order->{"${_}_amount"} * 100 / $order->netamount : undef;
@@ -182,11 +177,6 @@ sub sum_relevant_items {
     }
   }
 
-  if (!$params{by_order} && ($params{order}->ordnumber =~ m/4$/)) {
-    $::lxdebug->dump(0, "obj @ $total", $sums);
-    $::lxdebug->dump(0, "ord", $params{order}->{amounts_by_parts_id});
-  }
-
   return $total;
 }