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

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



Revision: 5169
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5169&view=rev
Author:   einhverfr
Date:     2012-11-07 13:22:24 +0000 (Wed, 07 Nov 2012)
Log Message:
-----------
Fixes for pdf printing of parts thumbnails when enabled

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/File.pm
    branches/1.3/bin/io.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-11-04 19:55:14 UTC (rev 5168)
+++ branches/1.3/Changelog	2012-11-07 13:22:24 UTC (rev 5169)
@@ -9,6 +9,7 @@
 * Corrected image not showable on html invoice (Chris T)
 * Fixed invoice date not printing on checks (Chris T, h/t Neil S)
 * Changed INSTALL to do make test, not of make install (Chris T h/t Kevin B)
+* Fixed framework for printing parts tumbnails in invoices (Chris T)
 
 berend T is Berend Tober
 Chris T is Chris Travers

Modified: branches/1.3/LedgerSMB/File.pm
===================================================================
--- branches/1.3/LedgerSMB/File.pm	2012-11-04 19:55:14 UTC (rev 5168)
+++ branches/1.3/LedgerSMB/File.pm	2012-11-07 13:22:24 UTC (rev 5169)
@@ -322,6 +322,12 @@
            $result->{sizex} = $x;
            $result->{sizey} = $y;
         };
+        if ($result->{file_class} == 3){ 
+           $result->{ref_key} = $result->{file_name};
+           $result->{ref_key} =~ s/-.*//;
+        } else {
+           $result->{ref_key} = $args->{ref_key};
+        }
     }
 }
 

Modified: branches/1.3/bin/io.pl
===================================================================
--- branches/1.3/bin/io.pl	2012-11-04 19:55:14 UTC (rev 5168)
+++ branches/1.3/bin/io.pl	2012-11-07 13:22:24 UTC (rev 5169)
@@ -1592,7 +1592,17 @@
         my @files = $file->get_for_template(
                 {ref_key => $form->{id}, file_class => $fc}
         );
-        $form->{file_list} = ..hidden..;
+        my @main_files;
+        my %parts_files;
+        for my $f (@files){
+            if ($f->{file_class} == 3) {
+              $parts_files{$f->{ref_key}} = $f;
+            } else {
+               push @main_files, $f;
+            }
+        }
+        $form->{file_list} = ..hidden..;
+        $form->{parts_files} = \%parts_files;
         $form->{file_path} = $file->file_path;
     }
 
@@ -1634,7 +1644,7 @@
             "projectnumber_$i", "partsgroup_$i",
             "serialnumber_$i",  "bin_$i",
             "unit_$i",          "notes_$i", 
-            "image_$i",
+            "image_$i",         "id_$i"
           );
     }
     for ( split / /, $form->{taxaccounts} ) { push @vars, "${_}_description" }

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