Finanzcontrollingbericht: bezahlte Beträge als Netto und nicht Brutto berechnen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 31 Jan 2013 11:41:49 +0000 (12:41 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 17 Dec 2013 13:36:45 +0000 (14:36 +0100)
SL/Controller/FinancialControllingReport.pm

index 2e62e0f..165a649 100644 (file)
@@ -148,7 +148,7 @@ sub calculate_data {
 
     $order->{delivered_amount}  = sum map { $self->sum_relevant_items(order => $order, other => $_, by_order => 1) } @delivery_orders;
     $order->{billed_amount}     = sum map { $self->sum_relevant_items(order => $order, other => $_)                } @invoices;
-    $order->{paid_amount}       = sum map { $_->paid                                                               } @invoices;
+    $order->{paid_amount}       = sum map { $_->paid * $_->netamount / (($_->amount * 1) || ($_->netamount * 1) || 1) } @invoices;
     my $billed_amount           = sum map { $_->netamount                                                          } @invoices;
     $order->{other_amount}      = $billed_amount             - $order->{billed_amount};
     $order->{billable_amount}   = $order->{delivered_amount} - $order->{billed_amount};