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

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



Revision: 3069
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3069&view=rev
Author:   einhverfr
Date:     2010-09-23 17:41:50 +0000 (Thu, 23 Sep 2010)

Log Message:
-----------
Correcting corner cases in depreciation logic.

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	2010-09-22 23:37:09 UTC (rev 3068)
+++ addons/1.3/assets/trunk/sql/modules/Assets.sql	2010-09-23 17:41:50 UTC (rev 3069)
@@ -2,7 +2,7 @@
 (in_base_life numeric, in_life numeric, in_used numeric, in_basis numeric, 
 in_dep_to_date numeric)
 returns numeric as $$
-SELECT CASE WHEN $2 > $3 THEN $3/$1 * $4 
+SELECT CASE WHEN $3/$1 * $4 < $4 - $5 THEN $3/$1 * $4 
             ELSE $4 - $5
             END;
 $$ language sql;


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