SL::Controller::Customer entfernt
[kivitendo-erp.git] / SL / RP.pm
index 7890ecd..095f758 100644 (file)
--- a/SL/RP.pm
+++ b/SL/RP.pm
@@ -214,14 +214,14 @@ sub get_accounts {
   # filter for opening and closing bookings
   # if l_ob is selected l_cb is always ignored
   if ( $last_period ) {
-    # ob/cb-settings for "as of" balance
+    # ob/cb-settings for "compared to" balance
     if ( $form->{l_ob_compared} ) {
       $where .= ' AND ac.ob_transaction is true  '
     } elsif ( not $form->{l_cb_compared} ) {
       $where .= ' AND ac.cb_transaction is false ';
     };
   } else {
-    # ob/cb-settings for "compared to" balance
+    # ob/cb-settings for "as of" balance
     if ( $form->{l_ob} ) {
       $where .= ' AND ac.ob_transaction is true  '
     } elsif ( not $form->{l_cb} ) {
@@ -1238,7 +1238,7 @@ sub aging {
       "duedate", invoice, ${arap}.id, date_part('days', now() - duedate) as overduedays,
       (SELECT $buysell
        FROM exchangerate
-       WHERE (${arap}.curr = exchangerate.curr)
+       WHERE (${arap}.currency_id = exchangerate.currency_id)
          AND (exchangerate.transdate = ${arap}.transdate)) AS exchangerate
     FROM ${arap}, ${ct}
     WHERE ((paid != amount) OR (datepaid > (date $todate) AND datepaid is not null))