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

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



Revision: 4140
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4140&view=rev
Author:   einhverfr
Date:     2011-12-04 12:57:13 +0000 (Sun, 04 Dec 2011)
Log Message:
-----------
Correcting header and variable interpolation broken for timecard templates

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/bin/jc.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2011-12-04 06:45:01 UTC (rev 4139)
+++ branches/1.3/Changelog	2011-12-04 12:57:13 UTC (rev 4140)
@@ -14,6 +14,7 @@
 * Logging improvements (Herman V)
 * Fixed company fax being printed under shipto (Herman V)
 * Fixed "File does not exist... [object HTMLButtonElement]" js error (Herman V)
+* Fixed timecard template headers not showing company name, etc (Chris T)
 
 Changelog for LedgerSMB 1.3.7 (Categorized due to length)
 Database

Modified: branches/1.3/bin/jc.pl
===================================================================
--- branches/1.3/bin/jc.pl	2011-12-04 06:45:01 UTC (rev 4139)
+++ branches/1.3/bin/jc.pl	2011-12-04 12:57:13 UTC (rev 4140)
@@ -43,6 +43,7 @@
 
 use LedgerSMB::Template;
 use LedgerSMB::JC;
+use LedgerSMB::Company_Config;
 
 1;
 
@@ -2081,6 +2082,14 @@
 
 sub print {
 
+    my $csettings = $LedgerSMB::Company_Config::settings;
+    $form->{company} = $csettings->{company_name};
+    $form->{businessnumber} = $csettings->{businessnumber};
+    $form->{email} = $csettings->{company_email};
+    $form->{address} = $csettings->{company_address};
+    $form->{tel} = $csettings->{company_phone};
+    $form->{fax} = $csettings->{company_fax};
+
     if ( $form->{media} !~ /screen/ ) {
         $form->error( $locale->text('Select postscript or PDF!') )
           if $form->{format} !~ /(postscript|pdf)/;
@@ -2110,9 +2119,6 @@
     }
 
     @a = ();
-    for (qw(company address tel fax businessnumber)) {
-        $form->{$_} = $myconfig{$_};
-    }
     $form->{address} =~ s/\\n/\n/g;
 
     push @a, qw(partnumber description projectnumber projectdescription);
@@ -2198,8 +2204,12 @@
           $form->audittrail( "", \%myconfig, \%audittrail );
     }
 
-    my $template = LedgerSMB::Template->new( user => \%myconfig, 
-      template => $form->{'formname'}, format => uc $form->{format} );
+    my $template = LedgerSMB::Template->new( 
+         user => \%myconfig, 
+     template => $form->{'formname'}, 
+     language => $form->{language_code},
+       locale => $locale,
+       format => uc $form->{format} );
     try {
         $template->render($form);
         $template->output(%{$form});

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