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

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



Revision: 2942
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2942&view=rev
Author:   einhverfr
Date:     2010-03-03 16:57:41 +0000 (Wed, 03 Mar 2010)

Log Message:
-----------
Approval bugs fixed

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

Modified: addons/1.3/assets/trunk/scripts/asset.pl
===================================================================
--- addons/1.3/assets/trunk/scripts/asset.pl	2010-03-02 19:36:49 UTC (rev 2941)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-03-03 16:57:41 UTC (rev 2942)
@@ -490,11 +490,13 @@
         push @$rows, $ref;
         ++$count;
     }
+    $request->{rowcount} = $count;
     my $buttons = [{
                    text  => $locale->text('Approve'),
                    type  => 'submit',
                    class => 'submit',
-                   action => 'approve'
+                   name  => 'action',
+                   value => 'approve'
                    },
     ];
     my $template = LedgerSMB::Template->new(
@@ -580,12 +582,10 @@
 
 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->{expense_acct} = $report->{"expense_acct"};
+    for my $l (0 .. $request->{rowcount}){
+        if ($request->{"report_$l"}){
+            my $approved = LedgerSMB::DBObject::Asset_Report->new(base => $request, copy => 'base');
+            $approved->{id} = $request->{"report_$l"};
             $approved->approve;
         }
     }

Modified: addons/1.3/assets/trunk/sql/modules/Assets.sql
===================================================================
--- addons/1.3/assets/trunk/sql/modules/Assets.sql	2010-03-02 19:36:49 UTC (rev 2941)
+++ addons/1.3/assets/trunk/sql/modules/Assets.sql	2010-03-03 16:57:41 UTC (rev 2942)
@@ -177,7 +177,7 @@
 	GROUP BY asset_report.id, asset_report.report_date;
 
 	INSERT INTO acc_trans (trans_id, chart_id, transdate, approved, amount)
-	SELECT gl.id, in_accum_account_id, r.report_date, true, sum(amount) * -1
+	SELECT gl.id, a.exp_account_id, r.report_date, true, sum(amount) * -1
 	FROM asset_report r
 	JOIN asset_report_line l ON (r.id = l.report_id)
 	JOIN asset_item a ON (l.asset_id = a.id)


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