RP aging(): Anpassung auf curr => currency_id
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 21 May 2013 11:10:21 +0000 (13:10 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 21 May 2013 11:10:21 +0000 (13:10 +0200)
SL/RP.pm

index 65cb302..095f758 100644 (file)
--- a/SL/RP.pm
+++ b/SL/RP.pm
@@ -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))