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

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



Revision: 3089
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3089&view=rev
Author:   einhverfr
Date:     2010-10-05 20:59:24 +0000 (Tue, 05 Oct 2010)

Log Message:
-----------
Correcting error detection to eliminate common false positives

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:01:46 UTC (rev 3088)
+++ addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-10-05 20:59:24 UTC (rev 3089)
@@ -66,7 +66,8 @@
                    my ($request, $entries) = @_;
                    my $batch = LedgerSMB::Batch->new({base => $request});
                    $batch->{batch_number} = $request->{reference};
-                   $batch->{batch_class} = 1;
+                   $batch->{batch_date} = $request->{transdate};
+                   $batch->{batch_class} = 'ap';
                    $batch->create(); 
                    # Necessary to test things are found before starting to 
                    # import! -- CT
@@ -78,6 +79,7 @@
                    );
                    for my $ref (@$entries){
                        my $pass;
+                       next if $ref->[1] !~ /\d/;
                        $acst->execute($ref->[2]);
                        ($pass) = $acst->fetchrow_array;
                        $request->error("Account $ref->[2] not found") if !$pass;


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