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

SF.net SVN: ledger-smb:[3041] addons/1.3/assets/trunk/scripts/asset.pl



Revision: 3041
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3041&view=rev
Author:   einhverfr
Date:     2010-08-09 17:20:34 +0000 (Mon, 09 Aug 2010)

Log Message:
-----------
Fixed all known asset file import handling issues

Modified Paths:
--------------
    addons/1.3/assets/trunk/scripts/asset.pl

Modified: addons/1.3/assets/trunk/scripts/asset.pl
===================================================================
--- addons/1.3/assets/trunk/scripts/asset.pl	2010-08-05 20:52:22 UTC (rev 3040)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-08-09 17:20:34 UTC (rev 3041)
@@ -869,10 +869,11 @@
        $asset_account->{"$a->{accno}"} = $a;
     }
     for my $ail ($asset->import_file($request->{import_file})){
-        my $ai = {};
-        for my $field (@file_columns){
-          $ai->{$field} = $field;
+        my $ai = LedgerSMB::DBObject::Asset->new({copy => 'base', base => $request});
+        for (0 .. $#file_columns){
+          $ai->{$file_columns[$_]} = $ail->[$_];
         }
+        next if $ai->{tag} !~ /\d/;
         $ai->{dep_report_id} = $report_results->{id};
         $ai->{location} = $location->{"$ai->{location}"};
         $ai->{department} = $department->{"$ai->{department}"};


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