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

SF.net SVN: ledger-smb:[2819] addons/1.3/assets/trunk/sql/modules/Assets. sql



Revision: 2819
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2819&view=rev
Author:   einhverfr
Date:     2009-12-11 17:05:11 +0000 (Fri, 11 Dec 2009)

Log Message:
-----------
commenting out function not working yet

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

Modified: addons/1.3/assets/trunk/sql/modules/Assets.sql
===================================================================
--- addons/1.3/assets/trunk/sql/modules/Assets.sql	2009-12-11 17:00:54 UTC (rev 2818)
+++ addons/1.3/assets/trunk/sql/modules/Assets.sql	2009-12-11 17:05:11 UTC (rev 2819)
@@ -24,32 +24,33 @@
           END;
 $$ language sql;
 
-CREATE OR REPLACE FUNCTION asset_dep_straight_line_yr
-(in_asset_ids int[],  in_dep_date date, in_report_id int)
-RETURNS numeric AS
-$$
-     INSERT INTO asset_report_line (asset_id, report_id, amount, department_id, 
-                                   warehouse_id)
-     SELECT ai.id, $3,
-            asset_dep__straight_line_base(
-                        asset_dep_get_usable_life_yr(
-                                   ai.usable_life,
-                                   coalesce(
-                                            ai.start_depreciation, 
-                                            ai.purchase_date
-                                   ),
-                                   max(rep.report_date)
-                       ),
-                       get_fractional_year(max(rep.report_date), $2),
-                       ai.purchase_value - ai.salvage_value
-            ),
-            ai.department_id, ai.location_id
-       FROM asset_item ai
-  LEFT JOIN asset_report_line repline ON (rep.asset_id = ai.id)
-  LEFT JOIN asset_report rep ON (repline.report_id = rep.id)
-      WHERE ai.id = ANY ($1)
-   GROUP BY
-$$ language sql;
+-- CREATE OR REPLACE FUNCTION asset_dep_straight_line_yr
+-- (in_asset_ids int[],  in_dep_date date, in_report_id int)
+-- RETURNS numeric AS
+-- $$
+--      INSERT INTO asset_report_line (asset_id, report_id, amount, department_id, 
+--                                    warehouse_id)
+--      SELECT ai.id, $3,
+--             asset_dep__straight_line_base(
+--                         asset_dep_get_usable_life_yr(
+--                                    ai.usable_life,
+--                                    coalesce(
+--                                             ai.start_depreciation, 
+--                                             ai.purchase_date
+--                                    ),
+--                                    max(rep.report_date)
+--                        ),
+--                        get_fractional_year(max(rep.report_date), $2),
+--                        ai.purchase_value - ai.salvage_value
+--             ),
+--             ai.department_id, ai.location_id
+--        FROM asset_item ai
+--   LEFT JOIN asset_report_line repline ON (rep.asset_id = ai.id)
+--   LEFT JOIN asset_report rep ON (repline.report_id = rep.id)
+--       WHERE ai.id = ANY ($1)
+--    GROUP BY ai.id, ai.start_depreciation, ai.purchase_date, ai.purchase_value,
+--             ai.salvage_value, ai.department_id, ai.location_id;
+-- $$ language sql;
 
 CREATE OR REPLACE FUNCTION asset_report__generate_gl(in_report_id int)
 RETURNS INT AS


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