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

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



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

Log Message:
-----------
minor asset fixes

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-02-08 20:14:33 UTC (rev 2867)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-02-08 21:45:33 UTC (rev 2868)
@@ -545,10 +545,11 @@
     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;
+        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);
 

Modified: addons/1.3/assets/trunk/sql/modules/Assets.sql
===================================================================
--- addons/1.3/assets/trunk/sql/modules/Assets.sql	2010-02-08 20:14:33 UTC (rev 2867)
+++ addons/1.3/assets/trunk/sql/modules/Assets.sql	2010-02-08 21:45:33 UTC (rev 2868)
@@ -55,6 +55,8 @@
    GROUP BY ai.id, ai.start_depreciation, ai.purchase_date, ai.purchase_value,
             ai.salvage_value, ai.department_id, ai.location_id, ai.usable_life;
 
+    UPDATE asset_report SET depreciated = true WHERE id = in_report_id;
+
     select true;
 $$ language sql;
 


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