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

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



Revision: 4706
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4706&view=rev
Author:   einhverfr
Date:     2012-05-12 01:59:08 +0000 (Sat, 12 May 2012)
Log Message:
-----------
Fixing company name/address missing from balance sheet and income statement

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

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-05-11 00:28:25 UTC (rev 4705)
+++ branches/1.3/Changelog	2012-05-12 01:59:08 UTC (rev 4706)
@@ -5,7 +5,11 @@
 Changelog for 1.3.17
 * Address now shows on ECA selection screen (Erik H)
 * Taxes::Simple now respects min/max values based on subtotal (Chris T)
+* Fixed company name/address missing from income statement (Chris T, h/t Mark L)
+* Fixed company name/address missing from balance sheet (Chris T, h/t Mark L)
 
+Mark L is Matt Lubratt
+
 Changelog for 1.3.16
 
 * Changes in <head> element for non-Latin characters, HTML invoices (Erik H)

Modified: branches/1.3/bin/rp.pl
===================================================================
--- branches/1.3/bin/rp.pl	2012-05-11 00:28:25 UTC (rev 4705)
+++ branches/1.3/bin/rp.pl	2012-05-12 01:59:08 UTC (rev 4706)
@@ -48,52 +48,30 @@
 use LedgerSMB::Template;
 use LedgerSMB::PE;
 use LedgerSMB::RP;
+use LedgerSMB::Company_Config;
 
 1;
 
 # end of main
 
-# this is for our long dates
-# $locale->text('January')
-# $locale->text('February')
-# $locale->text('March')
-# $locale->text('April')
-# $locale->text('May ')
-# $locale->text('June')
-# $locale->text('July')
-# $locale->text('August')
-# $locale->text('September')
-# $locale->text('October')
-# $locale->text('November')
-# $locale->text('December')
+=item init_company_config
 
-# this is for our short month
-# $locale->text('Jan')
-# $locale->text('Feb')
-# $locale->text('Mar')
-# $locale->text('Apr')
-# $locale->text('May')
-# $locale->text('Jun')
-# $locale->text('Jul')
-# $locale->text('Aug')
-# $locale->text('Sep')
-# $locale->text('Oct')
-# $locale->text('Nov')
-# $locale->text('Dec')
+Sets $form->{company} and $form->{address} for income statement and balance 
+statement
 
-# $locale->text('Balance Sheet')
-# $locale->text('Income Statement')
-# $locale->text('Trial Balance')
-# $locale->text('AR Aging')
-# $locale->text('AP Aging')
-# $locale->text('Tax collected')
-# $locale->text('Tax paid')
-# $locale->text('Receipts')
-# $locale->text('Payments')
-# $locale->text('Project Transactions')
-# $locale->text('Non-taxable Sales')
-# $locale->text('Non-taxable Purchases')
+=cut
 
+sub init_company_config {
+   my ($form) = @_;
+   $cconfig = LedgerSMB::Company_Config->new();
+   $cconfig->merge($form);
+   $cconfig->initialize;
+   $form->{company} = $LedgerSMB::Company_Config::settings->{company_name};
+   $form->{address} = $LedgerSMB::Company_Config::settings->{company_address};
+}
+
+
+
 sub report {
     my %hiddens;
     my %report = (
@@ -464,6 +442,7 @@
 }
 
 sub generate_income_statement {
+    init_company_config($form);
 
     RP->income_statement( \%myconfig, \%$form );
 
@@ -507,9 +486,6 @@
             $longcomparefromdate, $longcomparetodate);
     }
 
-    # setup variables for the form
-    my @vars = qw(company address businessnumber);
-    for (@vars) { $form->{$_} = $myconfig{$_} }
     ##SC: The escaped form will be converted in-template
     $form->{address} =~ s/\\n/<br>/g;
 
@@ -533,7 +509,7 @@
 }
 
 sub generate_balance_sheet {
-
+    init_company_config($form);
     RP->balance_sheet( \%myconfig, \%$form );
 
     $form->{asofdate} = $form->current_date( \%myconfig )
@@ -556,7 +532,7 @@
       $locale->date( \%myconfig, $form->{compareasofdate}, 0 );
 
     # setup company variables for the form
-    for (qw(company address businessnumber nativecurr login)) {
+    for (qw(nativecurr login)) {
         $form->{$_} = $myconfig{$_};
     }
     ##SC: The escaped form will be converted in-template

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