[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11027] property: budget handling
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11027] property: budget handling |
Date: |
Fri, 05 Apr 2013 09:32:36 +0000 |
Revision: 11027
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11027
Author: sigurdne
Date: 2013-04-05 09:32:35 +0000 (Fri, 05 Apr 2013)
Log Message:
-----------
property: budget handling
Modified Paths:
--------------
trunk/property/inc/class.boproject.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.soproject.inc.php
trunk/property/inc/class.uiproject.inc.php
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_update.inc.php
Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php 2013-04-04 17:47:01 UTC (rev
11026)
+++ trunk/property/inc/class.boproject.inc.php 2013-04-05 09:32:35 UTC (rev
11027)
@@ -925,4 +925,10 @@
$values = $this->so->get_order_time_span($id);
return $this->bocommon->select_list(date('Y'), $values);
}
+
+ public function get_missing_project_budget()
+ {
+ return $this->so->get_missing_project_budget();
+ }
+
}
Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php 2013-04-04 17:47:01 UTC (rev
11026)
+++ trunk/property/inc/class.menu.inc.php 2013-04-05 09:32:35 UTC (rev
11027)
@@ -275,7 +275,16 @@
(
'text' =>
lang('Accounting voucher type'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'voucher_type') )
+ ),
+ 'check_missing_project_budget'
=> array
+ (
+ 'text' => lang('check
missing project budget'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiproject.check_missing_project_budget') )
)
+
+
+
+
);
$admin_children_agreement = array
Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php 2013-04-04 17:47:01 UTC (rev
11026)
+++ trunk/property/inc/class.soproject.inc.php 2013-04-05 09:32:35 UTC (rev
11027)
@@ -3035,4 +3035,28 @@
return $year_list;
}
+
+
+ public function get_missing_project_budget()
+ {
+ $values = array();
+
+ $sql = "SELECT
fm_project_budget_year_from_order_view.project_id,fm_project_budget_year_from_order_view.year"
+ . " FROM fm_project_budget_year_from_order_view"
+ . " {$this->left_join} fm_project_budget_year_view ON
(fm_project_budget_year_from_order_view.project_id =
fm_project_budget_year_view.project_id AND
fm_project_budget_year_from_order_view.year = fm_project_budget_year_view.year)"
+ . " WHERE fm_project_budget_year_view.project_id IS
NULL"
+ . " ORDER BY
fm_project_budget_year_from_order_view.project_id,fm_project_budget_year_from_order_view.year";
+
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ while($this->db->next_record())
+ {
+ $values[] = array
+ (
+ 'project_id' =>
$this->db->f('project_id'),
+ 'year' =>
$this->db->f('year'),
+ );
+ }
+ return $values;
+ }
}
Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php 2013-04-04 17:47:01 UTC (rev
11026)
+++ trunk/property/inc/class.uiproject.inc.php 2013-04-05 09:32:35 UTC (rev
11027)
@@ -58,18 +58,19 @@
var $public_functions = array
(
- 'download' => true,
- 'index' => true,
- 'view' => true,
- 'edit' => true,
- 'delete' => true,
- 'date_search' => true,
- 'columns' => true,
- 'bulk_update_status' => true,
- 'project_group' => true,
- 'view_file' => true,
- 'get_orders' => true,
- 'get_vouchers' => true
+ 'download'
=> true,
+ 'index'
=> true,
+ 'view'
=> true,
+ 'edit'
=> true,
+ 'delete'
=> true,
+ 'date_search'
=> true,
+ 'columns'
=> true,
+ 'bulk_update_status' => true,
+ 'project_group'
=> true,
+ 'view_file'
=> true,
+ 'get_orders'
=> true,
+ 'get_vouchers'
=> true,
+ 'check_missing_project_budget' => true
);
function property_uiproject()
@@ -130,11 +131,17 @@
{
$start_date = urldecode(phpgw::get_var('start_date'));
$end_date = urldecode(phpgw::get_var('end_date'));
- $list = $this->bo->read(array('start_date' =>
$start_date, 'end_date' => $end_date, 'allrows' => true, 'skip_origin' =>
true));
+ $values = $this->bo->read(array('start_date' =>
$start_date, 'end_date' => $end_date, 'allrows' => true, 'skip_origin' =>
true));
$uicols = $this->bo->uicols;
-
$this->bocommon->download($list,$uicols['name'],$uicols['descr'],$uicols['input_type']);
+
$this->bocommon->download($values,$uicols['name'],$uicols['descr'],$uicols['input_type']);
}
+ function check_missing_project_budget()
+ {
+ $values =
$this->bo->get_missing_project_budget();
+ $this->bocommon->download( $values, array('project_id',
'year'), array(lang('project'), lang('year')) );
+ }
+
function view_file()
{
if(!$this->acl_read)
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2013-04-04 17:47:01 UTC (rev 11026)
+++ trunk/property/setup/setup.inc.php 2013-04-05 09:32:35 UTC (rev 11027)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.667';
+ $setup_info['property']['version'] = '0.9.17.668';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2013-04-04 17:47:01 UTC (rev
11026)
+++ trunk/property/setup/tables_update.inc.php 2013-04-05 09:32:35 UTC (rev
11027)
@@ -7510,9 +7510,10 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
/**
* Update property version from 0.9.17.667 to 0.9.17.668
- * Add inventory for bulk items
+ * Add check for missing budgets
*/
$test[] = '0.9.17.667';
function property_upgrade0_9_17_667()
@@ -7521,24 +7522,25 @@
$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
- $GLOBALS['phpgw_setup']->oProc->CreateTable(
- 'fm_bim_item_inventory', array(
- 'fd' => array(
- 'id' => array('type' =>
'int','precision' => 4,'nullable' => False),
- 'name' => array('type' =>
'varchar','precision' => 50,'nullable' => False),
- 'descr' => array('type' =>
'text','nullable' => True)
- ),
- 'pk' => array('id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- )
- );
+ $sql = 'CREATE OR REPLACE VIEW
fm_project_budget_year_from_order_view AS'
+ . ' SELECT DISTINCT fm_workorder.project_id,
fm_workorder_budget.year'
+ . ' FROM fm_workorder_budget'
+ . ' JOIN fm_workorder ON fm_workorder.id =
fm_workorder_budget.order_id'
+ . ' ORDER BY fm_workorder.project_id';
+ $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+
+ $sql = 'CREATE OR REPLACE VIEW fm_project_budget_year_view AS'
+ . ' SELECT DISTINCT fm_project_budget.project_id,
fm_project_budget.year'
+ . ' FROM fm_project_budget'
+ . ' ORDER BY fm_project_budget.project_id';
+
+ $GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+
if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
{
- $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.667';
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.668';
return $GLOBALS['setup_info']['property']['currentver'];
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11027] property: budget handling,
Sigurd Nes <=