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

SF.net SVN: ledger-smb:[3090] addons/1.3/import_trans/trunk/scripts/ import_trans.pl



Revision: 3090
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3090&view=rev
Author:   einhverfr
Date:     2010-10-05 22:12:48 +0000 (Tue, 05 Oct 2010)

Log Message:
-----------
Fixing error handling to properly look up accounts

Modified Paths:
--------------
    addons/1.3/import_trans/trunk/scripts/import_trans.pl

Modified: addons/1.3/import_trans/trunk/scripts/import_trans.pl
===================================================================
--- addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-10-05 20:59:24 UTC (rev 3089)
+++ addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-10-05 22:12:48 UTC (rev 3090)
@@ -80,12 +80,14 @@
                    for my $ref (@$entries){
                        my $pass;
                        next if $ref->[1] !~ /\d/;
-                       $acst->execute($ref->[2]);
+                       my ($acct) = split /--/, $ref->[2];
+                       $acst->execute($acct);
                        ($pass) = $acst->fetchrow_array;
-                       $request->error("Account $ref->[2] not found") if !$pass;
-                       $acst->execute($ref->[3]);
+                       $request->error("Account $acct not found") if !$pass;
+                       ($acct) = split /--/, $ref->[3];
+                       $acst->execute($acct);
                        ($pass) = $acst->fetchrow_array;
-                       $request->error("Account $ref->[3] not found") if !$pass;
+                       $request->error("Account $acct not found") if !$pass;
                        $vcst->execute(uc($ref->[0]));
                        ($pass) = $vcst->fetchrow_array;
                        $request->error("Vendor $ref->[0] not found") if !$pass;


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