Fixed layout, changes, bugs and improvements to Fixed Assets application.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 1 Dec 2015 15:16:35 +0000 (16:16 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 1 Dec 2015 15:16:35 +0000 (16:16 +0100)
admin/gl_setup.php
applications/fixed_assets.php
fixed_assets/includes/fixed_assets_db.inc
fixed_assets/inquiry/stock_inquiry.php
frontaccounting.php
inventory/adjustments.php
inventory/manage/item_categories.php
inventory/manage/items.php
inventory/manage/locations.php
reporting/includes/reports_classes.inc
reporting/reports_main.php

index 415fca0ebd423e3856a2e498419c609015ea9afb..62af2b02717c8348f7f68058bc490fc65c1bda2c 100644 (file)
@@ -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');
index 35aa150a8a02553944d311afeb8a28ef58607c76..3967c06a6e4f6981cc9ab0bf4e4e3f1ae488db74 100644 (file)
@@ -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();
index 3a588874f2c71a99b7aef7d7f273d496fa2287bc..8cb9a05db88162d8304221c94fbc8e9fd56c7cea 100644 (file)
@@ -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.")"
index 24c7c9be62d3698e9a29ea680fce92775d2994b8..e60d448fb36d21330731fd6480df9d48eb3f1219 100644 (file)
@@ -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'),
index 56418165fd6e0d3631edba1942e1ee9307c23b1f..326f74ae8cfd540c96b3e14502fccf0938b43a57 100644 (file)
@@ -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());
 
index b82a61227aebfb6a840a2844b1b2b42ffe7bba7d..9dbe1ea6623f42657193d6d45e7977cd43578079 100644 (file)
@@ -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");
        }
index d63354d1a8971309a493b97af4565a56f2f8989b..21e0b394f2ad92fd3bfba16d001ebd8f65e27ab5 100644 (file)
@@ -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 {
index fbb756070b7702f5faf780d58ea73f55a8bf1ce0..c4ab903ff147164e75e4d27fe4f4ee2b76302bb2 100644 (file)
@@ -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');
index 2dae0a78cdd77cca0df92d63b6e6bd8661c357bf..86bdb9d9f3e7abcb690a811ab4e218c51ede8573 100644 (file)
@@ -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";
index 01e76da7583cd568bce7ec5b7817147baf348af8..5a3094409fb861afb6e91a0e64070f2db6855993 100644 (file)
@@ -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);
 
index b5a89fcea87399278320404f96a142cdcb84cd94..9c571eb85d96aa81288ad79997f3a4983054d519 100644 (file)
@@ -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)
 {