//---------------
+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);
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');
$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();
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.")"
$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']))
{
}
}
+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'));
$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'),
$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());
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");
}
if (isset($_GET['FixedAsset'])) {
$page_security = 'SA_ASSETCATEGORY';
- $help_context = "FA Item Categories";
+ $help_context = "Fixed Assets Categories";
$_POST['mb_flag'] = 'F';
}
else {
$_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'];
}
hidden('depreciation_date');
- if (!$new_item) {
- hidden('material_cost');
- label_row(_("Current Value").':', price_format($_POST['material_cost']));
- }
}
table_section(2);
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');
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";
define('RC_DIMENSIONS', 4);
define('RC_BANKING', 5);
define('RC_GL', 6);
+define('RC_FIXEDASSETS', 7);
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);
_('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)
{