From: Joe Hunt Date: Tue, 1 Dec 2015 15:16:35 +0000 (+0100) Subject: Fixed layout, changes, bugs and improvements to Fixed Assets application. X-Git-Tag: v2.4.2~19^2~119 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=d4bcee971cf7ea37e2afc9d6abeb16d00af20de8;hp=fd069bba86276f15311ff6ab10b22d4a06a55513;p=fa-stable.git Fixed layout, changes, bugs and improvements to Fixed Assets application. --- diff --git a/admin/gl_setup.php b/admin/gl_setup.php index 415fca0e..62af2b02 100644 --- a/admin/gl_setup.php +++ b/admin/gl_setup.php @@ -165,6 +165,12 @@ tax_algorithm_list_row(_("Tax Algorithm:"), 'tax_algorithm', $_POST['tax_algorit //--------------- +table_section_title(_("Dimension Defaults")); + +text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days")); + +//---------------- + table_section_title(_("Customers and Sales")); text_row(_("Default Credit Limit:"), 'default_credit_limit', $_POST['default_credit_limit'], 12, 12); @@ -203,12 +209,6 @@ text_row(_("Delivery Required By:"), 'default_delivery_required', $_POST['defaul table_section(2); -table_section_title(_("Dimension Defaults")); - -text_row(_("Dimension Required By After:"), 'default_dim_required', $_POST['default_dim_required'], 6, 6, '', "", _("days")); - -//---------------- - table_section_title(_("Suppliers and Purchasing")); percent_row(_("Delivery Over-Receive Allowance:"), 'po_over_receive'); diff --git a/applications/fixed_assets.php b/applications/fixed_assets.php index 35aa150a..3967c06a 100644 --- a/applications/fixed_assets.php +++ b/applications/fixed_assets.php @@ -16,36 +16,39 @@ class assets_app extends application $this->application("assets", _($this->help_context = "&Fixed Assets")); $this->add_module(_("Transactions")); - $this->add_lapp_function(0, _("FA &Purchase"), + $this->add_lapp_function(0, _("Fixed Assets &Purchase"), "purchasing/po_entry_items.php?NewInvoice=Yes&FixedAsset=1", 'SA_SUPPLIERINVOICE', MENU_TRANSACTION); - $this->add_lapp_function(0, _("FA Location &Transfers"), + $this->add_lapp_function(0, _("Fixed Assets Location &Transfers"), "inventory/transfers.php?NewTransfer=1&FixedAsset=1", 'SA_ASSETTRANSFER', MENU_TRANSACTION); - $this->add_lapp_function(0, _("FA &Disposal"), + $this->add_lapp_function(0, _("Fixed Assets &Disposal"), "inventory/adjustments.php?NewAdjustment=1&FixedAsset=1", 'SA_ASSETDISPOSAL', MENU_TRANSACTION); - $this->add_lapp_function(0, _("FA &Sale"), + $this->add_lapp_function(0, _("Fixed Assets &Sale"), "sales/sales_order_entry.php?NewInvoice=0&FixedAsset=1", 'SA_SALESINVOICE', MENU_TRANSACTION); $this->add_rapp_function(0, _("Process &Depreciation"), "fixed_assets/process_depreciation.php", 'SA_DEPRECIATION', MENU_MAINTENANCE); // TODO: needs work - //$this->add_rapp_function(0, _("FA &Revaluation"), + //$this->add_rapp_function(0, _("Fixed Assets &Revaluation"), // "inventory/cost_update.php?FixedAsset=1", 'SA_STANDARDCOST', MENU_MAINTENANCE); $this->add_module(_("Inquiries and Reports")); - $this->add_lapp_function(1, _("FA Item In&quiry"), + $this->add_lapp_function(1, _("Fixed Assets &Movements"), + "inventory/inquiry/stock_movements.php?FixedAsset=1", 'SA_ASSETSTRANSVIEW', MENU_INQUIRY); + $this->add_lapp_function(1, _("Fixed Assets In&quiry"), "fixed_assets/inquiry/stock_inquiry.php?", 'SA_ASSETSANALYTIC', MENU_INQUIRY); - $this->add_rapp_function(1, _("FA Item &Movements"), - "inventory/inquiry/stock_movements.php?FixedAsset=1", 'SA_ASSETSTRANSVIEW', MENU_INQUIRY); + + $this->add_rapp_function(1, _("Fixed Assets &Reports"), + "reporting/reports_main.php?Class=7", 'SA_ASSETSANALYTIC', MENU_REPORT); $this->add_module(_("Maintenance")); $this->add_lapp_function(2, _("Fixed &Assets"), "inventory/manage/items.php?FixedAsset=1", 'SA_ASSET', MENU_ENTRY); - $this->add_rapp_function(2, _("FA &Locations"), + $this->add_rapp_function(2, _("Fixed Assets &Locations"), "inventory/manage/locations.php?FixedAsset=1", 'SA_INVENTORYLOCATION', MENU_MAINTENANCE); - $this->add_rapp_function(2, _("FA Item &Categories"), + $this->add_rapp_function(2, _("Fixed Assets &Categories"), "inventory/manage/item_categories.php?FixedAsset=1", 'SA_ASSETCATEGORY', MENU_MAINTENANCE); - $this->add_rapp_function(2, _("FA Cl&asses"), + $this->add_rapp_function(2, _("Fixed Assets Cl&asses"), "fixed_assets/fixed_asset_classes.php", 'SA_ASSETCLASS', MENU_MAINTENANCE); $this->add_extensions(); diff --git a/fixed_assets/includes/fixed_assets_db.inc b/fixed_assets/includes/fixed_assets_db.inc index 3a588874..8cb9a05d 100644 --- a/fixed_assets/includes/fixed_assets_db.inc +++ b/fixed_assets/includes/fixed_assets_db.inc @@ -138,9 +138,9 @@ function get_fixed_asset_class($id) function get_sql_for_fixed_assets($show_inactive = false) { - $sql = "SELECT s.stock_id, c.description, s.units, s.long_description, + $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 + adj.tran_date as disposal_date, adj.type as disposal_type, adj.trans_no as disposal_no, s.material_cost, s.last_cost 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 24c7c9be..e60d448f 100644 --- a/fixed_assets/inquiry/stock_inquiry.php +++ b/fixed_assets/inquiry/stock_inquiry.php @@ -23,7 +23,7 @@ if ($SysPrefs->use_popup_windows) $js .= get_js_open_window(900, 500); if (user_use_date_picker()) $js .= get_js_date_picker(); -page(_($help_context = "FA Item Inquiry"), false, false, "", $js); +page(_($help_context = "Fixed Assets Inquiry"), false, false, "", $js); if (isset($_GET['location'])) { @@ -112,6 +112,22 @@ function disposal_link($row) } } +function amount_link($row) +{ + return price_format($row['last_cost']); +} + +function depr_link($row) +{ + return price_format($row['last_cost'] - $row['material_cost']); +} + +function balance_link($row) +{ + return price_format($row['material_cost']); +} + + //------------------------------------------------------------------------------------------------ $sql = get_sql_for_fixed_assets(get_post('show_inactive')); @@ -119,14 +135,17 @@ $sql = get_sql_for_fixed_assets(get_post('show_inactive')); $cols = array( //_("Type") => array('fun'=>'systype_name', 'ord'=>''), //_("#") => array('fun'=>'trans_view', 'ord'=>''), - _("Item") => array('fun' => 'fa_link'), - _("FA Class"), - _("Units of Measure") => array('align' => 'center'), - _("Long description"), - _("Depreciation Rate or Lifecycle") => array('fun' => 'depr_rate_title'), - _("Depreciation Method") => array('fun' => 'depr_method_title'), + _("#") => array('fun' => 'fa_link'), + _("Class"), + _("UOM") => array('align' => 'center'), + _("Description"), + _("Rate or Lifecycle") => array('fun' => 'depr_rate_title'), + _("Method") => array('fun' => 'depr_method_title'), _("Status") => array('fun' => 'status_title'), - _("Purchase") => array('fun' => 'purchase_link'), + _("Purchased") => array('fun' => 'purchase_link'), + _("Amount") => array('align'=>'right', 'fun' => 'amount_link'), + _("Depreciations") => array('align'=>'right', 'fun' => 'depr_link'), + _("Balance") => array('align'=>'right', 'fun' => 'balance_link'), _("Liquidation or Sale") => array('align' => 'center', 'fun' => 'disposal_link'), //array('insert'=>true, 'fun'=>'gl_view'), //array('insert'=>true, 'fun'=>'rm_link'), diff --git a/frontaccounting.php b/frontaccounting.php index 56418165..326f74ae 100644 --- a/frontaccounting.php +++ b/frontaccounting.php @@ -78,8 +78,8 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_ $this->add_application(new customers_app()); $this->add_application(new suppliers_app()); $this->add_application(new inventory_app()); - $this->add_application(new assets_app()); $this->add_application(new manufacturing_app()); + $this->add_application(new assets_app()); $this->add_application(new dimensions_app()); $this->add_application(new general_ledger_app()); diff --git a/inventory/adjustments.php b/inventory/adjustments.php index b82a6122..9dbe1ea6 100644 --- a/inventory/adjustments.php +++ b/inventory/adjustments.php @@ -29,7 +29,7 @@ if (user_use_date_picker()) if (isset($_GET['NewAdjustment'])) { if (isset($_GET['FixedAsset'])) { $page_security = 'SA_ASSETDISPOSAL'; - $_SESSION['page_title'] = _($help_context = "FA Disposal"); + $_SESSION['page_title'] = _($help_context = "Fixed Assets Disposal"); } else { $_SESSION['page_title'] = _($help_context = "Item Adjustments Note"); } diff --git a/inventory/manage/item_categories.php b/inventory/manage/item_categories.php index d63354d1..21e0b394 100644 --- a/inventory/manage/item_categories.php +++ b/inventory/manage/item_categories.php @@ -15,7 +15,7 @@ include($path_to_root . "/includes/session.inc"); if (isset($_GET['FixedAsset'])) { $page_security = 'SA_ASSETCATEGORY'; - $help_context = "FA Item Categories"; + $help_context = "Fixed Assets Categories"; $_POST['mb_flag'] = 'F'; } else { diff --git a/inventory/manage/items.php b/inventory/manage/items.php index fbb75607..c4ab903f 100644 --- a/inventory/manage/items.php +++ b/inventory/manage/items.php @@ -340,7 +340,8 @@ function item_settings(&$stock_id, $new_item) $_POST['depreciation_date'] = sql2date($myrow['depreciation_date']); $_POST['fa_class_id'] = $myrow['fa_class_id']; $_POST['material_cost'] = $myrow['material_cost']; - + $_POST['last_cost'] = $myrow['last_cost']; + $_POST['sales_account'] = $myrow['sales_account']; $_POST['inventory_account'] = $myrow['inventory_account']; $_POST['cogs_account'] = $myrow['cogs_account']; @@ -443,10 +444,6 @@ function item_settings(&$stock_id, $new_item) } hidden('depreciation_date'); - if (!$new_item) { - hidden('material_cost'); - label_row(_("Current Value").':', price_format($_POST['material_cost'])); - } } table_section(2); @@ -518,6 +515,16 @@ function item_settings(&$stock_id, $new_item) check_row(_("Delete Image:"), 'del_image'); record_status_list_row(_("Item status:"), 'inactive'); + if (get_post('fixed_asset')) { + table_section_title(_("Values")); + if (!$new_item) { + hidden('material_cost'); + hidden('last_cost'); + label_row(_("Amount").":", price_format($_POST['last_cost']), "", "align='right'"); + label_row(_("Depreciations").":", price_format($_POST['last_cost'] - $_POST['material_cost']), "", "align='right'"); + label_row(_("Current Value").':', price_format($_POST['material_cost']), "", "align='right'"); + } + } end_outer_table(1); div_start('controls'); diff --git a/inventory/manage/locations.php b/inventory/manage/locations.php index 2dae0a78..86bdb9d9 100644 --- a/inventory/manage/locations.php +++ b/inventory/manage/locations.php @@ -19,7 +19,7 @@ include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/inventory/includes/inventory_db.inc"); if (isset($_GET['FixedAsset'])) { - $help_context = "FA Locations"; + $help_context = "Fixed Assets Locations"; $_POST['fixed_asset'] = 1; } else $help_context = "Inventory Locations"; diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index 01e76da7..5a309440 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -18,6 +18,7 @@ define('RC_MANUFACTURE', 3); define('RC_DIMENSIONS', 4); define('RC_BANKING', 5); define('RC_GL', 6); +define('RC_FIXEDASSETS', 7); class BoxReports { @@ -416,10 +417,15 @@ class BoxReports case 'LOCATIONS': return locations_list($name, null, _("No Location Filter")); + case 'FLOCATIONS': + return locations_list($name, null, _("No Location Filter"), false, true); case 'CATEGORIES': return stock_categories_list($name, null, _("No Category Filter")); - + case 'FCATEGORIES': + return stock_categories_list($name, null, _("No Category Filter"), false, true); + case 'FCLASS': + return fixed_asset_classes_list($name, null, _("No Class Filter"), false); case 'SALESTYPES': return sales_types_list($name); diff --git a/reporting/reports_main.php b/reporting/reports_main.php index b5a89fce..9c571eb8 100644 --- a/reporting/reports_main.php +++ b/reporting/reports_main.php @@ -299,6 +299,15 @@ $reports->addReport(RC_MANUFACTURE, 409, _('Print &Work Orders'), _('Email Locations') => 'YES_NO', _('Comments') => 'TEXTBOX', _('Orientation') => 'ORIENTATION')); +$reports->addReportClass(_('Fixed Assets'), RC_FIXEDASSETS); +$reports->addReport(RC_FIXEDASSETS, 451, _('&Fixed Assets Valuation'), + array( _('End Date') => 'DATE', + _('Fixed Assets Class') => 'FCLASS', + _('Fixed Assets Location') => 'FLOCATIONS', + _('Summary Only') => 'YES_NO', + _('Comments') => 'TEXTBOX', + _('Orientation') => 'ORIENTATION', + _('Destination') => 'DESTINATION')); $reports->addReportClass(_('Dimensions'), RC_DIMENSIONS); if ($dim > 0) {