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

SF.net SVN: ledger-smb:[5383] branches/1.3



Revision: 5383
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5383&view=rev
Author:   einhverfr
Date:     2012-12-19 08:13:20 +0000 (Wed, 19 Dec 2012)
Log Message:
-----------
Fixing files attached for parts not being properly brought over for templates where multiple line items exist on an invoice.
Fixing handling of underscores in file names when retrieivng for templates

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/File.pm
    branches/1.3/sql/modules/Files.sql

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-12-19 07:33:27 UTC (rev 5382)
+++ branches/1.3/Changelog	2012-12-19 08:13:20 UTC (rev 5383)
@@ -14,6 +14,8 @@
 * Dropped seconds/subsecs from password expiration notice (Chris T, 3593963)
 * Fixed parts images not available from template. (Chris T, h/t Brian W)
 * Fixed fs_cssdir not handling trailing / properly (Chris T, h/t Nigel T)
+* Fixed file attachments not retrieving for all invoice parts (Chris T)
+* fixed file attachements for invoices not handling _ properly (Chris T)
 
 Chris T is Chris Travers
 Havard S is Havard Sorli

Modified: branches/1.3/LedgerSMB/File.pm
===================================================================
--- branches/1.3/LedgerSMB/File.pm	2012-12-19 07:33:27 UTC (rev 5382)
+++ branches/1.3/LedgerSMB/File.pm	2012-12-19 08:13:20 UTC (rev 5383)
@@ -312,7 +312,7 @@
     $self->file_path($LedgerSMB::Sysconfig::tempdir . '/' . $$);
     
     for my $result (@results) {
-        warn "File found: $result->{file_name}";
+        $result->{file_name} =~ s/\_//g;
         open FILE, '>', $self->file_path . "/$result->{file_name}";
         binmode FILE, ':bytes';
         print FILE $result->{content};

Modified: branches/1.3/sql/modules/Files.sql
===================================================================
--- branches/1.3/sql/modules/Files.sql	2012-12-19 07:33:27 UTC (rev 5382)
+++ branches/1.3/sql/modules/Files.sql	2012-12-19 08:13:20 UTC (rev 5383)
@@ -172,7 +172,8 @@
                         AND m.mime_type ilike 'image%'
                    JOIN invoice i ON i.trans_id = $1
                         AND i.parts_id = fb.ref_key
-                  WHERE fb.file_class = 3)
+                  WHERE fb.file_class = 3
+               GROUP BY ref_key)
 $$ language sql;
 
 

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