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

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



Revision: 2987
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2987&view=rev
Author:   einhverfr
Date:     2010-04-15 19:31:27 +0000 (Thu, 15 Apr 2010)

Log Message:
-----------
Import and nbv issues corrected

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-04-14 18:03:50 UTC (rev 2986)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-04-15 19:31:27 UTC (rev 2987)
@@ -791,8 +791,11 @@
     my @results = $report->get_nbv;
     my $rows = [];
     for my $r(@results){
-        for my $amt (qw(basis salvage_value accum_depreciation net_book_value 
-                        percent_depreciated remaining_life)){
+        for my $amt (qw(basis salvage_value accum_depreciation net_book_value)){
+            $r->{$amt} = $request->format_amount({amount => $r->{$amt}, money => 1});
+        }
+        push @$rows, $r;
+        for my $amt (qw(percent_depreciated remaining_life)){
             $r->{$amt} = $request->format_amount({amount => $r->{$amt}});
         }
         push @$rows, $r;
@@ -826,7 +829,11 @@
 sub import {
     my ($request) = @_;
     my $asset = LedgerSMB::DBObject::Asset->new({base => $request});
+    $asset->get_metadata;
     for my $ai ($asset->import_file($request->{import_file})){
+        for my $attr_name (qw(location department asset_class)){
+            my $attr = $ai->{$attr_name};
+        }
         $ai->save;
     }
     $request->{info} = $request->{_locale}->text('File Imported');


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