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

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



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

Log Message:
-----------
Approval patch committed

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-02-08 04:06:30 UTC (rev 2864)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-02-08 04:58:20 UTC (rev 2865)
@@ -499,7 +499,59 @@
    });
 }
 
+sub report_details {
+    my ($request) = @_;
+    my $locale = $request->{_locale};
+    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->{id}, $report->{transdate});
+    my $header = {
+                            tag => $locale->text('Tag'),
+                    description => $locale->text('Description'),
+                  purchase_date => $locale->text('Purchase Date'),
+                          basis => $locale->text('Basis'),
+                         amount => $locale->text('Amount'),
+    };
+    my $rows = [];
+    for my $r (@{$report->{lines}}){
+        push @$rows, $r;
+    }
+    my $template = LedgerSMB::Template->new(
+        user =>$request->{_user}, 
+        locale => $request->{_locale},
+        path => 'UI',
+        template => 'form-dynatable',
+        format => 'HTML'
+    );
+    $template->render({form => $report, 
+                       cols => ..hidden.., 
+                    heading => $header,
+                       rows => $rows,
+                     hidden => $hidden,
+                    buttons => $buttons
+    });
+}
+
+sub report_details_approve {
+    my ($request) = @_;
+    my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
+    $report->approve;
+    search_reports($request);
+}
+
 sub report_results_approve {
+    my ($request) = @_;
+    my $report = LedgerSMB::DBObject::Asset_Report->new(base => $request);
+    for my $l (0 .. $report->{rowcount}){
+    if ($report->{"report_id_$l"}){
+        my $approved = LedgerSMB::DBObject::Asset_Report->new(base => $request);
+        $approved->{id} = $report->{"report_id_$l"};
+        $approved->approve;
+    }
+   search_reports($request);
+
 }
 
 1;


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