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

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



Revision: 2869
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2869&view=rev
Author:   einhverfr
Date:     2010-02-08 23:14:08 +0000 (Mon, 08 Feb 2010)

Log Message:
-----------
More assets fixes

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-02-08 21:45:33 UTC (rev 2868)
+++ addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm	2010-02-08 23:14:08 UTC (rev 2869)
@@ -37,8 +37,12 @@
     $self->{dbh}->commit;
 }
 
-sub get_report {
+sub get {
     my ($self) = @_;
+    my ($ref) = $self->exec_method(funcname => 'asset_report__get');
+    $self->merge($ref);
+    @{$self->{report_lines}} = $self->exec_method(funcname => 'asset_report__get_lines');
+    return;
 }
 
 sub generate {

Modified: addons/1.3/assets/trunk/scripts/asset.pl
===================================================================
--- addons/1.3/assets/trunk/scripts/asset.pl	2010-02-08 21:45:33 UTC (rev 2868)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-02-08 23:14:08 UTC (rev 2869)
@@ -304,7 +304,6 @@
         }
     } 
     $report->save;
-    $report->debug({file => '/tmp/report'});
     my $ar = LedgerSMB::DBObject::Asset_Report->new(
              base => $request, 
              copy => 'base'
@@ -448,6 +447,7 @@
     my $rows = [];
     my $hiddens = {};
     my $count = 0;
+    my $base_href = "asset.pl?action=report_details";
     for my $r (@results){
         $hidden->{"id_$count"} = $r->{id};
         my $ref = {
@@ -457,7 +457,9 @@
                                             value   => '1',
                                           },
                                 },
-               id             => $r->{id},
+               id             => {href => $base_href . "&id=".$r->{id},
+                                  text => $r->{id},
+                                 },
                report_date    => $r->{report_date},
                entered_at     => $r->{entered_at},
                approved_at    => $r->{approved_at},
@@ -467,7 +469,7 @@
                 $ref->{asset_class} = $ac->{label};
             }
         }
-        if ($r->{depreciation}){
+        if ($r->{report_class} == 1){
            $ref->{type} = $locale->text('Depreciation');
         } else {
            $ref->{type} = $locale->text('Disposal');
@@ -505,7 +507,7 @@
     my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
     $report->get;
     my @cols = qw(tag description purchase_date basis amount);
-    $report->title = $locale->text("Report [_1] on date [_2]", 
+    $report->{title} = $locale->text("Report [_1] on date [_2]", 
                      $report->{id}, $report->{transdate});
     my $header = {
                             tag => $locale->text('Tag'),
@@ -515,7 +517,7 @@
                          amount => $locale->text('Amount'),
     };
     my $rows = [];
-    for my $r (@{$report->{lines}}){
+    for my $r (@{$report->{report_lines}}){
         push @$rows, $r;
     }
     my $template = LedgerSMB::Template->new(


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