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

SF.net SVN: ledger-smb:[4459] trunk/LedgerSMB/Scripts/import_csv.pm



Revision: 4459
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4459&view=rev
Author:   ehuelsmann
Date:     2012-03-14 20:35:52 +0000 (Wed, 14 Mar 2012)
Log Message:
-----------
Implement support for importing gifi codes and descriptions.

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/import_csv.pm

Modified: trunk/LedgerSMB/Scripts/import_csv.pm
===================================================================
--- trunk/LedgerSMB/Scripts/import_csv.pm	2012-03-14 19:46:41 UTC (rev 4458)
+++ trunk/LedgerSMB/Scripts/import_csv.pm	2012-03-14 20:35:52 UTC (rev 4459)
@@ -145,7 +145,16 @@
                   });
                   $account->save();
                }
+             },
+    gifi  => sub {
+               my ($request, $entries) = @_;
+               my $dbh = $request->{dbh};
+               my $sth = $dbh->prepare('INSERT INTO gifi (accno, description) VALUES (?, ?)') || die $dbh->errstr;;
 
+               foreach my $entry (@$entries) {
+                 $sth->execute($entry->[0], $entry->[1]) || die $sth->errstr();
+               }
+               $dbh->commit;
              },
 };
 

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