[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5088] branches/1.3/sql/modules/Files.sql



Revision: 5088
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5088&view=rev
Author:   einhverfr
Date:     2012-08-04 01:04:36 +0000 (Sat, 04 Aug 2012)
Log Message:
-----------
correcting errors with loading file stored procs

Modified Paths:
--------------
    branches/1.3/sql/modules/Files.sql

Modified: branches/1.3/sql/modules/Files.sql
===================================================================
--- branches/1.3/sql/modules/Files.sql	2012-08-03 07:40:25 UTC (rev 5087)
+++ branches/1.3/sql/modules/Files.sql	2012-08-04 01:04:36 UTC (rev 5088)
@@ -166,11 +166,11 @@
   JOIN entity e ON f.uploaded_by = e.id
  WHERE f.ref_key = $1 and f.file_class = $2
        AND m.invoice_include 
-       OR id IN (SELECT max(id) 
+       OR f.id IN (SELECT max(fb.id) 
                    FROM file_base fb
                    JOIN mime_type m ON fb.mime_type_id = m.id
                         AND m.mime_type ilike 'image%'
-                   JOIN invoice i ON i.trans_id = in_ref_key 
+                   JOIN invoice i ON i.trans_id = $1
                         AND i.parts_id = fb.ref_key
                   WHERE fb.file_class = 3)
 $$ language sql;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.