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

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



Revision: 3082
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3082&view=rev
Author:   einhverfr
Date:     2010-10-02 00:03:19 +0000 (Sat, 02 Oct 2010)

Log Message:
-----------
Customization hooks

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-01 23:37:03 UTC (rev 3081)
+++ addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-10-02 00:03:19 UTC (rev 3082)
@@ -22,7 +22,8 @@
    ap_multi =>  ['vendor', 'amount', 'account', 'ap', 'description', 
                  'invnumber', 'transdate'],
 };
-
+our $preprocess = {};
+our $postprocess = {};
 our $process = {
    gl       => sub {
                    use LedgerSMB::GL;
@@ -159,6 +160,14 @@
 sub run_import {
     my ($request) = @_;
     my @entries = parse_file($request);
+    if (ref($preprocess->{$request->{type}}) eq 'CODE'){
+        $preprocess->{$request->{type}}($request, ..hidden..);
+    }
     $process->{$request->{type}}($request, ..hidden..) || begin_import($request);
+    if (ref($postprocess->{$request->{type}}) eq 'CODE'){
+        $postprocess->{$request->{type}}($request, ..hidden..);
+    }
     begin_import($request);
 }
+
+eval { do 'scripts/custom/import_trans.pl'; };


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