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

SF.net SVN: ledger-smb:[4148] trunk



Revision: 4148
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4148&view=rev
Author:   einhverfr
Date:     2011-12-05 11:16:58 +0000 (Mon, 05 Dec 2011)
Log Message:
-----------
Merging from 1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/OE.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB/Tax.pm
    trunk/LedgerSMB.pm
    trunk/bin/jc.pl
    trunk/ledgersmb.conf.default
    trunk/sql/modules/Fixes.sql

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/admin.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-4138
   + /branches/1.3:3711-4147

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/Changelog	2011-12-05 11:16:58 UTC (rev 4148)
@@ -21,6 +21,11 @@
 * 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)
+* Fixed part account mappings broken after upgrade from 1.2 (Chris T)
+* Fixed quotation number increasing when saving existing quotation (Chris T)
+* Fixed invalid from address on backup routine (Chris T)
+* Fixed error "RROR: lower bound of FOR loop cannot be null" (Chris T)
 
 Changelog for LedgerSMB 1.3.7 (Categorized due to length)
 Database

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB/Form.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -199,6 +199,7 @@
     if (!$ENV{GATEWAY_INTERFACE}){
         return 1;
     }
+    $logger->trace("\$self->{session_id}=$self->{session_id}");
     my $sth = $self->{dbh}->prepare('select form_open(?)');
     $sth->execute($self->{session_id});
     my @results = $sth->fetchrow_array();
@@ -645,7 +646,7 @@
     my ( $self, $msg ) = @_;
 
     if ( $self->{callback} || !$msg ) {
-	print STDERR "Full redirect\n";
+	$logger->trace("Full redirect \$self->{callback}=$self->{callback} \$msg=$msg");
         main::redirect();
 	$self->finalize_request();
     }

Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB/OE.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -338,7 +338,7 @@
     }
     $form->{"$ordnumber"} =
       $form->update_defaults( $myconfig, $numberfld, $dbh )
-      unless $form->{ordnumber};
+      unless $form->{"$ordnumber"};
 
 
 


Property changes on: trunk/LedgerSMB/Scripts/admin.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4138
/branches/1.3/scripts/admin.pl:3711-3903
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4147
/branches/1.3/scripts/admin.pl:3711-3903


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4138
/branches/1.3/scripts/employee.pl:3842-3843
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4147
/branches/1.3/scripts/employee.pl:3842-3843


Property changes on: trunk/LedgerSMB/Scripts/file.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4138
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4147
/branches/1.3/scripts/file.pl:3711-4138

Modified: trunk/LedgerSMB/Scripts/payment.pm
===================================================================
--- trunk/LedgerSMB/Scripts/payment.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB/Scripts/payment.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -1253,6 +1253,9 @@
      push @op_cash_account_id, $cashid;
      push @op_source, $request->{"overpayment_source1_$i"}.' '.$request->{"overpayment_source2_$i"};
      push @op_memo, $request->{"overpayment_memo_$i"};
+     if (!$id and $id ne "0"){
+         $request->error($request->{_locale}->text('No overpayment account selected.  Was one set up?'));
+     }
      push @op_account_id, $id;        
      } 
    }  


Property changes on: trunk/LedgerSMB/Scripts/payment.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4138
/branches/1.3/scripts/payment.pl:3711-4011
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4147
/branches/1.3/scripts/payment.pl:3711-4147

Modified: trunk/LedgerSMB/Scripts/setup.pm
===================================================================
--- trunk/LedgerSMB/Scripts/setup.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB/Scripts/setup.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -201,7 +201,7 @@
     if ($request->{backup_type} eq 'email'){
         my $csettings = $LedgerSMB::Company_Config::settings;
 	my $mail = new LedgerSMB::Mailer(
-		from          => $csettings->{default_email_from},
+		from          => $LedgerSMB::Sysconfig::backup_email_from,
 		to            => $request->{email},
 		subject       => "Email of Backup",
 		message       => 'The Backup is Attached',


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4138
/branches/1.3/scripts/setup.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4147
/branches/1.3/scripts/setup.pl:3711-4147

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB/Sysconfig.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -133,7 +133,7 @@
 
 # mail configuration
 for my $var (qw(sendmail smtphost smtptimeout smtpuser 
-             smtppass smtpauthmethod)) 
+             smtppass smtpauthmethod backup_email_from)) 
 {
     ${$var} = $config{mail}{$var} if $config{mail}{$var};
 }
@@ -201,11 +201,14 @@
 # Backup path
 our $backuppath = $tempdir;
 
-if(-d "$tempdir"){}
-else
-{
- my $rc=system("mkdir -p $tempdir");#TODO what if error?
- #$logger->info("created tempdir \$tempdir rc=\$rc"); log4perl not initialised yet!
+if(!(-d "$tempdir")){
+     my $rc;
+     if ($pathsep eq ';'){ # We need an actual platform configuration variable
+        $rc = system("mkdir $tempdir");
+     } else {
+         $rc=system("mkdir -p $tempdir");#TODO what if error?
+     #$logger->info("created tempdir \$tempdir rc=\$rc"); log4perl not initialised yet!
+     }
  print STDERR localtime()." Sysconfig.pm created tempdir $tempdir rc=$rc\n";
 }
 1;

Modified: trunk/LedgerSMB/Tax.pm
===================================================================
--- trunk/LedgerSMB/Tax.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB/Tax.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -28,6 +28,7 @@
 package Tax;
 
 use Math::BigFloat;
+use Log::Log4perl;
 
 my $logger = Log::Log4perl->get_logger('Tax');
 

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/LedgerSMB.pm	2011-12-05 11:16:58 UTC (rev 4148)
@@ -352,7 +352,7 @@
 
     $self->{stylesheet} = $self->{_user}->{stylesheet};
 
-    $logger->debug("End LedgerSMB.pm");
+    $logger->debug("End");
 
     return $self;
 
@@ -798,7 +798,7 @@
     my %args     = @_;
     my $creds = LedgerSMB::Auth::get_credentials();
 
-    $logger->debug("LedgerSMB::_db_init: start");
+    $logger->debug("start");
   
     $self->{login} = $creds->{login};
     if (!$self->{company}){ 
@@ -880,6 +880,7 @@
     while (my @roles = $sth->fetchrow_array){
         push @{$self->{_roles}}, $roles[0];
     }
+    $logger->debug("end");
 }
 
 #private, for db connection errors
@@ -945,7 +946,9 @@
 }
 
 sub merge {
+    (my $package,my $filename,my $line)=caller;
     my ( $self, $src ) = @_;
+    $logger->debug("begin caller \$filename=$filename \$line=$line");
     for my $arg ( $self, $src ) {
         shift;
     }
@@ -968,22 +971,23 @@
         }
         if ( defined $dst_arg && defined $src->{$arg} )
         {
-            $logger->debug("LedgerSMB.pm: merge setting $dst_arg to $src->{$arg}");
+            $logger->trace("LedgerSMB.pm: merge setting $dst_arg to $src->{$arg}");
         }
         elsif ( !defined $dst_arg && defined $src->{$arg} )
         {
-            $logger->debug("LedgerSMB.pm: merge setting \$dst_arg is undefined \$src->{\$arg} is defined $src->{$arg}");
+            $logger->trace("LedgerSMB.pm: merge setting \$dst_arg is undefined \$src->{\$arg} is defined $src->{$arg}");
         }
         elsif ( defined $dst_arg && !defined $src->{$arg} )
         {
-            $logger->debug("LedgerSMB.pm: merge setting \$dst_arg is defined $dst_arg \$src->{\$arg} is undefined");
+            $logger->trace("LedgerSMB.pm: merge setting \$dst_arg is defined $dst_arg \$src->{\$arg} is undefined");
         }
         elsif ( !defined $dst_arg && !defined $src->{$arg} )
         {
-            $logger->debug("LedgerSMB.pm: merge setting \$dst_arg is undefined \$src->{\$arg} is undefined");
+            $logger->trace("LedgerSMB.pm: merge setting \$dst_arg is undefined \$src->{\$arg} is undefined");
         }
         $self->{$dst_arg} = $src->{$arg};
     }
+    $logger->debug("end");
 }
 
 sub type {

Modified: trunk/bin/jc.pl
===================================================================
--- trunk/bin/jc.pl	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/bin/jc.pl	2011-12-05 11:16:58 UTC (rev 4148)
@@ -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});

Modified: trunk/ledgersmb.conf.default
===================================================================
--- trunk/ledgersmb.conf.default	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/ledgersmb.conf.default	2011-12-05 11:16:58 UTC (rev 4148)
@@ -78,6 +78,7 @@
 sendmail   = /usr/bin/sendmail -t
 # smtphost = 127.0.0.1
 # smtptimeout = 60
+# backup_email_from = ..hidden..
 
 [printers]
 # Available printers

Modified: trunk/sql/modules/Fixes.sql
===================================================================
--- trunk/sql/modules/Fixes.sql	2011-12-05 11:04:48 UTC (rev 4147)
+++ trunk/sql/modules/Fixes.sql	2011-12-05 11:16:58 UTC (rev 4148)
@@ -61,3 +61,21 @@
 ALTER TABLE entity_bank_account ADD UNIQUE(bic,iban);
 CREATE UNIQUE INDEX eba_iban_null_bic_u ON entity_bank_account(iban) WHERE bic IS NULL;
 COMMIT;
+
+BEGIN; -- Data fixes for 1.2-1.3 upgrade.  Will fail otherwise --Chris T
+UPDATE parts 
+   SET income_accno_id = (SELECT account.id 
+                            FROM account JOIN lsmb12.chart USING (accno)
+                           WHERE chart.id = income_accno_id),
+       expense_accno_id = (SELECT account.id 
+                            FROM account JOIN lsmb12.chart USING (accno)
+                           WHERE chart.id = expense_accno_id),
+       inventory_accno_id = (SELECT account.id
+                            FROM account JOIN lsmb12.chart USING (accno)
+                           WHERE chart.id = inventory_accno_id)
+ WHERE id IN (SELECT id FROM lsmb12.parts op 
+               WHERE op.id = parts.id 
+                     AND (op.income_accno_id = parts.income_accno_id
+                          OR op.inventory_accno_id = parts.inventory_accno_id 
+                          or op.expense_accno_id = parts.expense_accno_id));
+COMMIT; 


Property changes on: trunk/sql/upgrade/1.2-1.3-manual.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4138
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710
   + /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4147
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

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