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

SF.net SVN: ledger-smb:[5244] trunk/LedgerSMB



Revision: 5244
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5244&view=rev
Author:   einhverfr
Date:     2012-11-23 04:15:28 +0000 (Fri, 23 Nov 2012)
Log Message:
-----------
Correcting Perl errors in 1.2-1.4 upgrade.

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/pnl.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Upgrade_Tests.pm

Modified: trunk/LedgerSMB/Scripts/pnl.pm
===================================================================
--- trunk/LedgerSMB/Scripts/pnl.pm	2012-11-23 02:14:34 UTC (rev 5243)
+++ trunk/LedgerSMB/Scripts/pnl.pm	2012-11-23 04:15:28 UTC (rev 5244)
@@ -43,7 +43,7 @@
     } elsif ($request->{pnl_type} eq 'product'){
         $rpt = LedgerSMB::Report::PNL::Product->new(%$request);
     } else {
-        my $rpt =LedgerSMB::Report::PNL::Income_Statement->new(%$request);
+        $rpt =LedgerSMB::Report::PNL::Income_Statement->new(%$request);
     }
     $rpt->render($request);
 }

Modified: trunk/LedgerSMB/Scripts/setup.pm
===================================================================
--- trunk/LedgerSMB/Scripts/setup.pm	2012-11-23 02:14:34 UTC (rev 5243)
+++ trunk/LedgerSMB/Scripts/setup.pm	2012-11-23 04:15:28 UTC (rev 5244)
@@ -402,6 +402,7 @@
         $sth->execute();
         if ($sth->rows > 0){ # Check failed --CT
              _failed_check($request, $check, $sth);
+             return;
         }
     }
 
@@ -443,13 +444,14 @@
                     edit => $check->{edit},
                 database => $request->{database}};
     my $header = {};
-    for (@{$check->{cols}}){
+    for (@{$check->display_cols}){
         $header->{$_} = $_;
     }
     while (my $row = $sth->fetchrow_hashref('NAME_lc')){
-          $row->{$check->{'edit'}} = 
+          warn $check;
+          $row->{$check->column} = 
                     { input => {
-                                name => "$check->{edit}_$row->{id}",
+                                name => $check->column . "_$row->{id}",
                                 value => $row->{$check->{'edit'}},
                                 type => 'text',
                                 size => 15,
@@ -460,6 +462,7 @@
           ++$count;
     }
     $hiddens->{count} = $count;
+    $hiddens->{edit} = $check->column;
     my $buttons = [
            { type => 'submit',
              name => 'action',
@@ -470,7 +473,7 @@
     $template->render({
            form     => $request,
            heading  => $header,
-           columns  => $check->{cols},
+           columns  => $check->display_cols,
            rows     => $rows,
            hiddens  => $hiddens,
            buttons  => $buttons
@@ -505,6 +508,7 @@
     );
     
     for my $count (1 .. $request->{count}){
+        warn $count;
         my $id = $request->{"id_$count"};
         $sth->execute($request->{"$request->{edit}_$id"}, $id) ||
             $request->error($sth->errstr);
@@ -791,12 +795,12 @@
     $request->{dbh} = DBI->connect("dbi:Pg:dbname=$request->{database}");
     _set_dbh($request->{dbh});
     my $dbh = $request->{dbh};
+    my $dbinfo = $database->get_info();
     $dbh->do('ALTER SCHEMA public RENAME TO lsmb12');
     $dbh->do('CREATE SCHEMA PUBLIC');
 
     $database->load_modules('LOADORDER');
     $database->process_roles('Roles.sql');
-    my $dbinfo = $database->get_info();
     my $dbtemplate = LedgerSMB::Template->new(
         user => {}, 
         path => 'sql/upgrade',

Modified: trunk/LedgerSMB/Upgrade_Tests.pm
===================================================================
--- trunk/LedgerSMB/Upgrade_Tests.pm	2012-11-23 02:14:34 UTC (rev 5243)
+++ trunk/LedgerSMB/Upgrade_Tests.pm	2012-11-23 04:15:28 UTC (rev 5244)
@@ -128,7 +128,7 @@
         test_query =>
            "select id, customernumber, name, address1, city, state, zipcode
                    from customer where customernumber in 
-                    (SELECT customernumberfrom customer
+                    (SELECT customernumber from customer
                    GROUP BY customernumber
                    HAVING count(*) > 1)",
  display_name => $LedgerSMB::App_State::Locale->text('Unique Customernumber'),

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