Fixed Assets: Added sum-of-the-year digits method, fixed declining balance method...
[fa-stable.git] / fixed_assets / inquiry / stock_inquiry.php
index e60d448fb36d21330731fd6480df9d48eb3f1219..93c79446b88b972e7ebe4e18918a7339eb900530 100644 (file)
@@ -73,11 +73,14 @@ function depr_method_title($row) {
   return $depreciation_methods[$row['depreciation_method']];
 }
 
-function depr_rate_title($row) {
-  if ($row['depreciation_method'] == 'S')
-    return $row['depreciation_rate'].' years';
-  else
-    return $row['depreciation_rate'].'%';
+function depr_par($row) {
+       if ($row['depreciation_method'] == 'D')
+               return $row['depreciation_rate']*$row['depreciation_factor'].'%';
+       elseif ($row['depreciation_method'] == 'N')
+               return $row['depreciation_rate'].' '._('years'
+               );
+       else
+               return $row['depreciation_rate'].'%';
 }
 
 function status_title($row) {
@@ -139,7 +142,7 @@ $cols = array(
                        _("Class"), 
                        _("UOM") => array('align' => 'center'), 
                        _("Description"),
-                       _("Rate or Lifecycle") => array('fun' => 'depr_rate_title'), 
+                       _("Rate or Lifecycle") => array('fun' => 'depr_par'), 
                        _("Method") => array('fun' => 'depr_method_title'), 
                        _("Status") => array('fun' => 'status_title'), 
                        _("Purchased") => array('fun' => 'purchase_link'),