From 7622ac6f58b8173c16e238be48d3bb43296b438a Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 7 Dec 2015 11:22:01 +0100 Subject: [PATCH] Fixed Assets: Added sum-of-the-year digits method, fixed declining balance method, changed related db scheme. --- fixed_assets/fixed_asset_classes.php | 21 ++++-------- fixed_assets/includes/depreciation.inc | 30 ++++++++++------- fixed_assets/includes/fa_classes_db.inc | 15 ++++----- fixed_assets/includes/fixed_assets_db.inc | 2 +- fixed_assets/inquiry/stock_inquiry.php | 15 +++++---- includes/sysnames.inc | 1 + inventory/includes/db/items_db.inc | 11 ++++--- inventory/manage/items.php | 40 +++++++++++------------ sql/alter2.4rc1.sql | 5 ++- sql/en_US-demo.sql | 16 ++++----- sql/en_US-new.sql | 4 +-- 11 files changed, 80 insertions(+), 80 deletions(-) diff --git a/fixed_assets/fixed_asset_classes.php b/fixed_assets/fixed_asset_classes.php index 87c3218d..291a0779 100644 --- a/fixed_assets/fixed_asset_classes.php +++ b/fixed_assets/fixed_asset_classes.php @@ -36,16 +36,16 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') if ($selected_id != -1) { update_fixed_asset_class($selected_id, $_POST['parent_id'], $_POST['description'], $_POST['long_description'], - $_POST['depreciation_method'], $_POST['depreciation_rate'], $_POST['depreciation_period']); + $_POST['depreciation_rate']); display_notification(_('Selected fixed asset class has been updated')); } else { add_fixed_asset_class($_POST['fa_class_id'], $_POST['parent_id'], $_POST['description'], $_POST['long_description'], - $_POST['depreciation_method'], $_POST['depreciation_rate'], $_POST['depreciation_period']); + $_POST['depreciation_rate']); display_notification(_('New fixed asset class has been added')); } - + $Mode = 'RESET'; } } @@ -83,7 +83,7 @@ $result = get_fixed_asset_classes(); start_form(); start_table(TABLESTYLE); -$th = array(_("Fixed asset class"), _("Description"), _("Depreciation method"), _("Depreciation rate"), _("Depreciation period"), "", ""); +$th = array(_("Fixed asset class"), _("Description"), _("Basic Depreciation Rate"), "", ""); inactive_control_column($th); table_header($th); $k = 0; //row colour counter @@ -93,9 +93,7 @@ while ($myrow = db_fetch($result)) label_cell($myrow["fa_class_id"]); label_cell($myrow["description"]); - label_cell($depreciation_methods[$myrow["depreciation_method"]]); label_cell($myrow["depreciation_rate"].'%'); - label_cell($myrow["depreciation_period"].' years'); inactive_control_cell($myrow["fa_class_id"], $myrow["inactive"], 'stock_fa_classes', 'fa_class_id'); edit_button_cell("Edit".$myrow["fa_class_id"], _("Edit")); delete_button_cell("Delete".$myrow["fa_class_id"], _("Delete")); @@ -107,7 +105,7 @@ end_table(1); echo '
'; start_form(true); - +div_start('par_tbl'); start_table(TABLESTYLE2); if ($selected_id != -1) @@ -119,9 +117,7 @@ if ($selected_id != -1) $_POST['parent_id'] = $myrow["parent_id"]; $_POST['description'] = $myrow["description"]; $_POST['long_description'] = $myrow["long_description"]; - $_POST['depreciation_method'] = $myrow["depreciation_method"]; $_POST['depreciation_rate'] = $myrow["depreciation_rate"]; - $_POST['depreciation_period'] = $myrow["depreciation_period"]; } hidden("selected_id", $selected_id); hidden("fa_class_id"); @@ -137,14 +133,11 @@ else text_row(_("Description:"), 'description', null, 42, 200); textarea_row(_('Long description:'), 'long_description', null, 42, 3); -array_selector_row(_("Depreciation Method").":", "depreciation_method", null, $depreciation_methods, array('select_submit'=> true)); -small_amount_row(_("Depreciation Rate").':', 'depreciation_rate', null, null, '%', user_percent_dec()); -text_row_ex(_("Depreciation Period").':', 'depreciation_period', 3, 3, '', null, null, _("years")); - +small_amount_row(_("Basic Depreciation Rate").':', 'depreciation_rate', null, null, '%', user_percent_dec()); //text_row(_("Parent id:"), 'parent_id', null, 3, 3); end_table(1); - +div_end(); //if ($selected_id != -1) submit_add_or_update_center($selected_id == -1, '', 'both'); diff --git a/fixed_assets/includes/depreciation.inc b/fixed_assets/includes/depreciation.inc index dda99f96..ab36edd3 100644 --- a/fixed_assets/includes/depreciation.inc +++ b/fixed_assets/includes/depreciation.inc @@ -62,20 +62,26 @@ function compute_gl_rows_for_depreciation($item, $no_months, $period) { $y = date('Y', strtotime($year['end'])); switch ($item['depreciation_method']) { - case 'D': - $value = $item['material_cost'] * $item['depreciation_rate'] / 100 / 12; - break; - - case 'S': - // depreciation_rate is the period here. - $done_months = months_between_dates($item['depreciation_start'], $item['depreciation_date']); - $remaining_months = $item['depreciation_rate'] * 12 - $done_months; - $value = $item['material_cost'] / $remaining_months; - break; + case 'D': + $line_value = $item['actual_cost']*$item['depreciation_rate']/100/12; + $value = $item['material_cost'] * $item['depreciation_rate'] * $item['depreciation_factor']/100/12; + if ($value < $line_value) + $value = $line_value; + break; + + case 'S': // actual_cost stores start cost of item + $value = $item['actual_cost']*$item['depreciation_rate']/100/12; + break; + + case 'N': + $N = $item['depreciation_rate']; + $done_years = months_between_dates($item['depreciation_start'], $item['depreciation_date'])/12; + $value = $item['material_cost']* ($N-$done_years)/($N*($N+1)/2)/12; + break; case 'O': - $value = $item['material_cost']; - break; + $value = $item['material_cost']; + break; } $next = next_depreciation_date($item['depreciation_date']); diff --git a/fixed_assets/includes/fa_classes_db.inc b/fixed_assets/includes/fa_classes_db.inc index 3c5b68cf..6f76c48b 100644 --- a/fixed_assets/includes/fa_classes_db.inc +++ b/fixed_assets/includes/fa_classes_db.inc @@ -19,28 +19,25 @@ function get_fixed_asset_classes() return $result; } -function update_fixed_asset_class($fa_class_id, $parent_id, $description, $long_description, $depreciation_method, $depreciation_rate, $depreciation_period) +function update_fixed_asset_class($fa_class_id, $parent_id, $description, $long_description, $depreciation_rate) { $sql = "UPDATE ".TB_PREF."stock_fa_class SET parent_id=".db_escape($parent_id).", description=".db_escape($description).", long_description=".db_escape($long_description).", - depreciation_method=".db_escape($depreciation_method).", - depreciation_rate=".db_escape($depreciation_rate).", - depreciation_period=".db_escape($depreciation_period)." + depreciation_rate=".db_escape($depreciation_rate)." WHERE fa_class_id=".db_escape($fa_class_id); db_query($sql, "The fixed asset class could not be updated"); } -function add_fixed_asset_class($fa_class_id, $parent_id, $description, $long_description, $depreciation_method, $depreciation_rate, $depreciation_period) +function add_fixed_asset_class($fa_class_id, $parent_id, $description, $long_description, $depreciation_rate) { $sql = "INSERT INTO ".TB_PREF."stock_fa_class (fa_class_id, parent_id, description, long_description, - depreciation_method, depreciation_rate, depreciation_period) VALUES (" + depreciation_rate) VALUES (" .db_escape($fa_class_id).", ".db_escape($parent_id).", " - .db_escape($description).", ".db_escape($long_description).", " - .db_escape($depreciation_method).", ".db_escape($depreciation_rate).", " - .db_escape($depreciation_period).")"; + .db_escape($description).", ".db_escape($long_description).", " + .db_escape($depreciation_rate).")"; db_query($sql, "The fixed asset class could not be added"); } diff --git a/fixed_assets/includes/fixed_assets_db.inc b/fixed_assets/includes/fixed_assets_db.inc index 8cb9a05d..7f30d8db 100644 --- a/fixed_assets/includes/fixed_assets_db.inc +++ b/fixed_assets/includes/fixed_assets_db.inc @@ -140,7 +140,7 @@ function get_sql_for_fixed_assets($show_inactive = false) { $sql = "SELECT s.stock_id, c.description, s.units, s.description as name, s.depreciation_rate, s.depreciation_method, s.inactive, rcv.tran_date as purchase_date, rcv.trans_no as purchase_no, - adj.tran_date as disposal_date, adj.type as disposal_type, adj.trans_no as disposal_no, s.material_cost, s.last_cost + adj.tran_date as disposal_date, adj.type as disposal_type, adj.trans_no as disposal_no, s.material_cost, s.last_cost, s.depreciation_factor FROM ".TB_PREF."stock_master s" ." LEFT JOIN ".TB_PREF."stock_moves rcv ON rcv.stock_id=s.stock_id AND rcv.type=".ST_SUPPRECEIVE ." LEFT JOIN ".TB_PREF."stock_moves adj ON adj.stock_id=s.stock_id AND adj.type IN(".ST_INVADJUST.",".ST_CUSTDELIVERY.")" diff --git a/fixed_assets/inquiry/stock_inquiry.php b/fixed_assets/inquiry/stock_inquiry.php index e60d448f..93c79446 100644 --- a/fixed_assets/inquiry/stock_inquiry.php +++ b/fixed_assets/inquiry/stock_inquiry.php @@ -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'), diff --git a/includes/sysnames.inc b/includes/sysnames.inc index 70c78fef..80fab811 100644 --- a/includes/sysnames.inc +++ b/includes/sysnames.inc @@ -161,6 +161,7 @@ $quick_entry_types = array( $depreciation_methods = array( 'D' => _("Declining balance"), 'S' => _("Straight line"), + 'N' => _("Sum of the Year Digits"), 'O' => _("One-time"), ); diff --git a/inventory/includes/db/items_db.inc b/inventory/includes/db/items_db.inc index 3806518e..b9b87b13 100644 --- a/inventory/includes/db/items_db.inc +++ b/inventory/includes/db/items_db.inc @@ -13,8 +13,8 @@ function update_item($stock_id, $description, $long_description, $category_id, $tax_type_id, $units='', $mb_flag='', $sales_account, $inventory_account, $cogs_account, $adjustment_account, $assembly_account, $dimension_id, $dimension2_id, $no_sale, $editable, $no_purchase, - $depreciation_method = 'D', $depreciation_rate=100, $depreciation_start=null, - $fa_class_id=null) + $depreciation_method = 'D', $depreciation_rate=100, $depreciation_factor=1, + $depreciation_start=null, $fa_class_id=null) { $sql = "UPDATE ".TB_PREF."stock_master SET long_description=".db_escape($long_description).", description=".db_escape($description).", @@ -32,6 +32,7 @@ function update_item($stock_id, $description, $long_description, $category_id, editable=".db_escape($editable).", depreciation_method=".db_escape($depreciation_method).", depreciation_rate=".db_escape($depreciation_rate).", + depreciation_factor=".db_escape($depreciation_factor).", fa_class_id=".db_escape($fa_class_id); if ($units != '') @@ -56,13 +57,13 @@ function add_item($stock_id, $description, $long_description, $category_id, $tax_type_id, $units, $mb_flag, $sales_account, $inventory_account, $cogs_account, $adjustment_account, $assembly_account, $dimension_id, $dimension2_id, $no_sale, $editable, $no_purchase, - $depreciation_method='D', $depreciation_rate=100, $depreciation_start=null, + $depreciation_method='D', $depreciation_rate=100, $depreciation_factor=1, $depreciation_start=null, $fa_class_id=null) { $sql = "INSERT INTO ".TB_PREF."stock_master (stock_id, description, long_description, category_id, tax_type_id, units, mb_flag, sales_account, inventory_account, cogs_account, adjustment_account, assembly_account, dimension_id, dimension2_id, no_sale, no_purchase, editable, - depreciation_method, depreciation_rate, depreciation_start, depreciation_date, fa_class_id) + depreciation_method, depreciation_rate, depreciation_factor, depreciation_start, depreciation_date, fa_class_id) VALUES (".db_escape($stock_id).", ".db_escape($description).", ".db_escape($long_description).", ".db_escape($category_id).", ".db_escape($tax_type_id).", " .db_escape($units).", ".db_escape($mb_flag).", @@ -73,7 +74,7 @@ function add_item($stock_id, $description, $long_description, $category_id, .db_escape($no_sale)."," .db_escape($no_purchase)."," .db_escape($editable)."," - .db_escape($depreciation_method).",".db_escape($depreciation_rate).",'" + .db_escape($depreciation_method).",".db_escape($depreciation_rate).",".db_escape($depreciation_factor).",'" .date2sql($depreciation_start)."','".date2sql($depreciation_start)."'," .db_escape($fa_class_id).")"; diff --git a/inventory/manage/items.php b/inventory/manage/items.php index c4ab903f..ad65ee0f 100644 --- a/inventory/manage/items.php +++ b/inventory/manage/items.php @@ -155,6 +155,7 @@ function clear_data() unset($_POST['no_purchase']); unset($_POST['depreciation_method']); unset($_POST['depreciation_rate']); + unset($_POST['depreciation_factor']); unset($_POST['depreciation_start']); } @@ -226,7 +227,7 @@ if (isset($_POST['addupdate'])) $_POST['adjustment_account'], $_POST['assembly_account'], $_POST['dimension_id'], $_POST['dimension2_id'], check_value('no_sale'), check_value('editable'), check_value('no_purchase'), - get_post('depreciation_method'), get_post('depreciation_rate'), get_post('depreciation_start'), + get_post('depreciation_method'), input_num('depreciation_rate'), input_num('depreciation_factor'), get_post('depreciation_start'), get_post('fa_class_id')); update_record_status($_POST['NewStockID'], $_POST['inactive'], @@ -247,7 +248,7 @@ if (isset($_POST['addupdate'])) $_POST['adjustment_account'], $_POST['assembly_account'], $_POST['dimension_id'], $_POST['dimension2_id'], check_value('no_sale'), check_value('editable'), check_value('no_purchase'), - get_post('depreciation_method'), get_post('depreciation_rate'), get_post('depreciation_start'), + get_post('depreciation_method'), input_num('depreciation_rate'), input_num('depreciation_factor'), get_post('depreciation_start'), get_post('fa_class_id')); display_notification(_("A new item has been added.")); @@ -335,7 +336,8 @@ function item_settings(&$stock_id, $new_item) $_POST['mb_flag'] = $myrow["mb_flag"]; $_POST['depreciation_method'] = $myrow['depreciation_method']; - $_POST['depreciation_rate'] = $myrow['depreciation_rate']; + $_POST['depreciation_rate'] = number_format2($myrow['depreciation_rate'], 1); + $_POST['depreciation_factor'] = number_format2($myrow['depreciation_factor'], 1); $_POST['depreciation_start'] = sql2date($myrow['depreciation_start']); $_POST['depreciation_date'] = sql2date($myrow['depreciation_date']); $_POST['fa_class_id'] = $myrow['fa_class_id']; @@ -415,24 +417,22 @@ function item_settings(&$stock_id, $new_item) if (!isset($_POST['depreciation_rate']) || (list_updated('fa_class_id') || list_updated('depreciation_method'))) { $class_row = get_fixed_asset_class($_POST['fa_class_id']); - if ($_POST['depreciation_method'] == 'S') - $_POST['depreciation_rate'] = $class_row['depreciation_period']; - else - $_POST['depreciation_rate'] = $class_row['depreciation_rate']; + if ($_POST['depreciation_method'] == 'O') + { + hidden('depreciation_rate', 100); + label_row(_("Depreciation Rate").':', "100 %"); } - - switch ($_POST['depreciation_method']) { - case 'D': - small_amount_row(_("Depreciation Rate").':', 'depreciation_rate', null, null, '%', user_percent_dec()); - break; - case 'S': - text_row_ex(_("Depreciation Period").':', 'depreciation_rate', 3, 3, '', null, null, _("years")); - break; - case 'O': - hidden('depreciation_rate', 100); - label_row(_("Depreciation Rate").':', "100 %"); - break; + elseif ($_POST['depreciation_method'] == 'N') + { + small_amount_row(_("Depreciation Years").':', 'depreciation_rate', null, null, _('years'), 0); } + elseif ($_POST['depreciation_method'] == 'D') + small_amount_row(_("Base Rate").':', 'depreciation_rate', null, null, '%', user_percent_dec()); + else + small_amount_row(_("Depreciation Rate").':', 'depreciation_rate', null, null, '%', user_percent_dec()); + + if ($_POST['depreciation_method'] == 'D') + small_amount_row(_("Rate multiplier").':', 'depreciation_factor', null, null, '', 2); // do not allow to change the depreciation start after this item has been depreciated if ($new_item || $_POST['depreciation_start'] == $_POST['depreciation_date']) @@ -443,7 +443,7 @@ function item_settings(&$stock_id, $new_item) label_row(_("Last Depreciation").':', $_POST['depreciation_date']); } hidden('depreciation_date'); - + } } table_section(2); diff --git a/sql/alter2.4rc1.sql b/sql/alter2.4rc1.sql index df967f43..735c9e3b 100644 --- a/sql/alter2.4rc1.sql +++ b/sql/alter2.4rc1.sql @@ -6,16 +6,15 @@ CREATE TABLE `0_stock_fa_class` ( `parent_id` varchar(20) NOT NULL DEFAULT '', `description` varchar(200) NOT NULL DEFAULT '', `long_description` tinytext NOT NULL, - `depreciation_method` char(1) NOT NULL DEFAULT 'D', `depreciation_rate` double NOT NULL DEFAULT '0', - `depreciation_period` tinyint(1) NOT NULL DEFAULT '0', `inactive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`fa_class_id`) ) ENGINE=InnoDB; ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_method` char(1) NOT NULL DEFAULT 'D' AFTER `editable`; ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_rate` double NOT NULL DEFAULT '0' AFTER `depreciation_method`; -ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_start` date NOT NULL DEFAULT '0000-00-00' AFTER `depreciation_rate`; +ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_factor` double NOT NULL DEFAULT '0' AFTER `depreciation_par`; +ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_start` date NOT NULL DEFAULT '0000-00-00' AFTER `depreciation_factor`; ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_date` date NOT NULL DEFAULT '0000-00-00' AFTER `depreciation_start`; ALTER TABLE `0_stock_master` ADD COLUMN `fa_class_id` varchar(20) NOT NULL DEFAULT '' AFTER `depreciation_date`; diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index 21dbbbcc..309a9c46 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -1850,7 +1850,6 @@ CREATE TABLE `0_stock_fa_class` ( `long_description` tinytext NOT NULL, `depreciation_method` char(1) NOT NULL DEFAULT 'D', `depreciation_rate` double NOT NULL DEFAULT '0', - `depreciation_period` tinyint(1) NOT NULL DEFAULT '0', `inactive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`fa_class_id`) ) ENGINE=InnoDB; @@ -1886,8 +1885,9 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` ( `no_sale` tinyint(1) NOT NULL DEFAULT '0', `no_purchase` tinyint(1) NOT NULL DEFAULT '0', `editable` tinyint(1) NOT NULL DEFAULT '0', - `depreciation_method` char(1) NOT NULL DEFAULT 'D', + `depreciation_method` char(1) NOT NULL DEFAULT 'S', `depreciation_rate` double NOT NULL DEFAULT '0', + `depreciation_factor` double NOT NULL DEFAULT '1', `depreciation_start` date NOT NULL DEFAULT '0000-00-00', `depreciation_date` date NOT NULL DEFAULT '0000-00-00', `fa_class_id` varchar(20) NOT NULL DEFAULT '', @@ -1899,12 +1899,12 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` ( -- INSERT INTO `0_stock_master` VALUES -('101', '1', '1', 'iPad Air 2 16GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '200', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''), -('102', '1', '1', 'iPhone 6 64GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '150', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''), -('103', '1', '1', 'iPhone Cover Case', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '10', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''), -('201', '3', '1', 'AP Surf Set', '', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '360', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''), -('202', '4', '1', 'Maintenance', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'D', '0', '0000-00-00', '0000-00-00', ''), -('301', '4', '1', 'Support', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''); +('101', '1', '1', 'iPad Air 2 16GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '200', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''), +('102', '1', '1', 'iPhone 6 64GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '150', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''), +('103', '1', '1', 'iPhone Cover Case', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '10', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''), +('201', '3', '1', 'AP Surf Set', '', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '360', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''), +('202', '4', '1', 'Maintenance', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'S', '0', '1', '0000-00-00', '0000-00-00', ''), +('301', '4', '1', 'Support', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''); -- -------------------------------------------------------- diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index 7356ecd0..3794400b 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -1608,7 +1608,6 @@ CREATE TABLE `0_stock_fa_class` ( `long_description` tinytext NOT NULL, `depreciation_method` char(1) NOT NULL DEFAULT 'D', `depreciation_rate` double NOT NULL DEFAULT '0', - `depreciation_period` tinyint(1) NOT NULL DEFAULT '0', `inactive` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`fa_class_id`) ) ENGINE=InnoDB; @@ -1644,8 +1643,9 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` ( `no_sale` tinyint(1) NOT NULL default '0', `no_purchase` tinyint(1) NOT NULL default '0', `editable` tinyint(1) NOT NULL default '0', - `depreciation_method` char(1) NOT NULL DEFAULT 'D', + `depreciation_method` char(1) NOT NULL DEFAULT 'S', `depreciation_rate` double NOT NULL DEFAULT '0', + `depreciation_factor` double NOT NULL DEFAULT '1', `depreciation_start` date NOT NULL DEFAULT '0000-00-00', `depreciation_date` date NOT NULL DEFAULT '0000-00-00', `fa_class_id` varchar(20) NOT NULL DEFAULT '', -- 2.30.2