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

SF.net SVN: ledger-smb:[2986] addons/1.3/assets/trunk



Revision: 2986
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2986&view=rev
Author:   einhverfr
Date:     2010-04-14 18:03:50 +0000 (Wed, 14 Apr 2010)

Log Message:
-----------
minor fixes to NBV and import (import needs more testing, nbv should work now

Modified Paths:
--------------
    addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm
    addons/1.3/assets/trunk/scripts/asset.pl

Modified: addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm
===================================================================
--- addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm	2010-04-13 22:07:46 UTC (rev 2985)
+++ addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm	2010-04-14 18:03:50 UTC (rev 2986)
@@ -57,6 +57,12 @@
     return;
 }
 
+sub get_nbv {
+    my ($self) = @_;
+    return $self->exec_method(funcname => 'asset_nbv_report');
+}
+
+
 sub generate {
     my ($self) = @_;
     @{$self->{assets}} = $self->exec_method(

Modified: addons/1.3/assets/trunk/scripts/asset.pl
===================================================================
--- addons/1.3/assets/trunk/scripts/asset.pl	2010-04-13 22:07:46 UTC (rev 2985)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-04-14 18:03:50 UTC (rev 2986)
@@ -770,7 +770,7 @@
 
 sub display_nbv {
     my ($request) = @_;
-    my $locale = $request->{locale};
+    my $locale = $request->{_locale};
     my $report = LedgerSMB::DBObject::Asset_Report->new({base => $request });
     my @cols = qw(id tag description begin_depreciation method remaining_life basis salvage_value
                   through_date accum_depreciation net_book_value percent_depreciated);
@@ -792,8 +792,8 @@
     my $rows = [];
     for my $r(@results){
         for my $amt (qw(basis salvage_value accum_depreciation net_book_value 
-                        percent_depreciated)){
-            $r->{$amt} = $r->format_amount({amount => $r->{$amt}});
+                        percent_depreciated remaining_life)){
+            $r->{$amt} = $request->format_amount({amount => $r->{$amt}});
         }
         push @$rows, $r;
     }


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