[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.uibudget.inc.php class.sobud...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc class.uibudget.inc.php class.sobud... |
Date: |
Fri, 05 May 2006 07:43:34 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Branch:
Changes by: Sigurd Nes <address@hidden> 06/05/05 07:43:34
Modified files:
inc : class.uibudget.inc.php class.sobudget.inc.php
class.soworkorder.inc.php
class.uiworkorder.inc.php
class.boworkorder.inc.php
class.sowo_hour.inc.php
Log message:
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uibudget.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sobudget.inc.php.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soworkorder.inc.php.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiworkorder.inc.php.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boworkorder.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sowo_hour.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
Patches:
Index: property/inc/class.boworkorder.inc.php
diff -u property/inc/class.boworkorder.inc.php:1.11
property/inc/class.boworkorder.inc.php:1.12
--- property/inc/class.boworkorder.inc.php:1.11 Mon Apr 17 11:36:05 2006
+++ property/inc/class.boworkorder.inc.php Fri May 5 07:43:34 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.boworkorder.inc.php,v 1.11 2006/04/17 11:36:05
sigurdne Exp $
+ * @version $Id: class.boworkorder.inc.php,v 1.12 2006/05/05 07:43:34
sigurdne Exp $
*/
/**
@@ -57,6 +57,7 @@
$wo_hour_cat_id =
get_var('wo_hour_cat_id',array('POST','GET'));
$start_date =
get_var('start_date',array('POST','GET'));
$end_date =
get_var('end_date',array('POST','GET'));
+ $b_group =
get_var('b_group',array('POST','GET'));
if ($start)
{
@@ -67,6 +68,10 @@
$this->start=0;
}
+ if(array_key_exists('b_group',$_POST) ||
array_key_exists('b_group',$_GET) )
+ {
+ $this->b_group = $b_group;
+ }
if(array_key_exists('query',$_POST) ||
array_key_exists('query',$_GET) )
{
$this->query = $query;
@@ -124,6 +129,7 @@
$this->wo_hour_cat_id = $data['wo_hour_cat_id'];
$this->start_date = $data['start_date'];
$this->end_date = $data['end_date'];
+ $this->b_group = $data['b_group'];
}
function save_sessiondata($data)
@@ -210,7 +216,8 @@
$workorder = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'filter' => $this->filter,'cat_id' => $this->cat_id,'status_id' =>
$this->status_id,
'search_vendor' => $this->search_vendor,'wo_hour_cat_id' =>
$this->wo_hour_cat_id,
-
'start_date'=>$start_date,'end_date'=>$end_date,'allrows'=>$allrows));
+
'start_date'=>$start_date,'end_date'=>$end_date,'allrows'=>$allrows,
+
'b_group'=>$this->b_group));
$this->total_records = $this->so->total_records;
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
Index: property/inc/class.sobudget.inc.php
diff -u property/inc/class.sobudget.inc.php:1.12
property/inc/class.sobudget.inc.php:1.13
--- property/inc/class.sobudget.inc.php:1.12 Thu May 4 13:47:13 2006
+++ property/inc/class.sobudget.inc.php Fri May 5 07:43:34 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage budget
- * @version $Id: class.sobudget.inc.php,v 1.12 2006/05/04 13:47:13
sigurdne Exp $
+ * @version $Id: class.sobudget.inc.php,v 1.13 2006/05/05 07:43:34
sigurdne Exp $
*/
/**
@@ -467,7 +467,7 @@
}
- $sql = "SELECT sum(combined_cost) as combined_cost,
fm_b_account.category as b_group, district_id FROM"
+ $sql = "SELECT sum(combined_cost) as combined_cost,
count(fm_workorder.id) as hits, fm_b_account.category as b_group, district_id
FROM"
. " fm_workorder $this->join fm_b_account ON
fm_workorder.account_id =fm_b_account.id "
. " $this->join fm_project ON
fm_workorder.project_id =fm_project.id "
. " $this->join fm_location1 ON fm_project.loc1
= fm_location1.loc1 "
@@ -485,26 +485,19 @@
$this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
}
- $config = CreateObject('phpgwapi.config');
- $config->read_repository();
- $tax = 1+($config->config_data['fm_tax'])/100;
- // $workorder['calculation']
=number_format($workorder['calculation']*$tax, 2, ',', '');
-
-
while ($this->db->next_record())
{
$obligations[] = array
(
'grouping' =>
$this->db->f('b_group'),
'district_id' =>
$this->db->f('district_id'),
- 'budget_cost' =>
round($this->db->f('combined_cost')*$tax),
+ 'budget_cost' =>
round($this->db->f('combined_cost')),
+ 'hits' =>
$this->db->f('hits')
);
}
return $obligations;
}
-
-
function get_b_group_list()
{
$sql = "SELECT id FROM fm_b_account_category order by
id asc";
Index: property/inc/class.sowo_hour.inc.php
diff -u property/inc/class.sowo_hour.inc.php:1.14
property/inc/class.sowo_hour.inc.php:1.15
--- property/inc/class.sowo_hour.inc.php:1.14 Thu May 4 13:47:13 2006
+++ property/inc/class.sowo_hour.inc.php Fri May 5 07:43:34 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.sowo_hour.inc.php,v 1.14 2006/05/04 13:47:13
sigurdne Exp $
+ * @version $Id: class.sowo_hour.inc.php,v 1.15 2006/05/05 07:43:34
sigurdne Exp $
*/
/**
@@ -726,6 +726,11 @@
if($calculation > 0)
{
+ $config =
CreateObject('phpgwapi.config');
+ $config->read_repository();
+ $tax = 1+(($config->config_data['fm_tax'])/100);
+ $calculation = $calculation * $tax;
+
$this->db->query("UPDATE fm_workorder SET
combined_cost = '$calculation' WHERE id=$id",__LINE__,__FILE__);
}
Index: property/inc/class.soworkorder.inc.php
diff -u property/inc/class.soworkorder.inc.php:1.16
property/inc/class.soworkorder.inc.php:1.17
--- property/inc/class.soworkorder.inc.php:1.16 Thu May 4 13:47:13 2006
+++ property/inc/class.soworkorder.inc.php Fri May 5 07:43:34 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.soworkorder.inc.php,v 1.16 2006/05/04 13:47:13
sigurdne Exp $
+ * @version $Id: class.soworkorder.inc.php,v 1.17 2006/05/05 07:43:34
sigurdne Exp $
*/
/**
@@ -133,10 +133,11 @@
$end_date =
(isset($data['end_date'])?$data['end_date']:'');
$allrows =
(isset($data['allrows'])?$data['allrows']:'');
$wo_hour_cat_id =
(isset($data['wo_hour_cat_id'])?$data['wo_hour_cat_id']:'');
+ $b_group =
(isset($data['b_group'])?$data['b_group']:'');
}
//_debug_array($data);
- $sql =
$this->bocommon->fm_cache('sql_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id);
+ $sql =
$this->bocommon->fm_cache('sql_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group);
if(!$sql)
{
@@ -220,29 +221,41 @@
//----- wo_hour_status
+
+ //----- b_group
+
+ if($b_group)
+ {
+ $joinmethod .= " $this->join
fm_b_account ON (fm_workorder.account_id =fm_b_account.id))";
+ $paranthesis .='(';
+ }
+
+ //----- b_group
+
+
$sql =
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
-
$this->bocommon->fm_cache('sql_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id,$sql);
+
$this->bocommon->fm_cache('sql_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group,$sql);
$this->uicols =
$this->bocommon->uicols;
$cols_return =
$this->bocommon->cols_return;
$type_id =
$this->bocommon->type_id;
// $this->cols_extra =
$this->bocommon->cols_extra;
-
$this->bocommon->fm_cache('uicols_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id,$this->uicols);
-
$this->bocommon->fm_cache('cols_return_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id,$cols_return);
-
$this->bocommon->fm_cache('type_id_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id,$type_id);
-//
$this->bocommon->fm_cache('cols_extra_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id,$this->cols_extra);
+
$this->bocommon->fm_cache('uicols_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group,$this->uicols);
+
$this->bocommon->fm_cache('cols_return_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group,$cols_return);
+
$this->bocommon->fm_cache('type_id_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group,$type_id);
+//
$this->bocommon->fm_cache('cols_extra_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group,$this->cols_extra);
}
else
{
- $this->uicols =
$this->bocommon->fm_cache('uicols_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id);
- $cols_return =
$this->bocommon->fm_cache('cols_return_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id);
- $type_id =
$this->bocommon->fm_cache('type_id_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id);
-// $this->cols_extra =
$this->bocommon->fm_cache('cols_extra_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id);
+ $this->uicols =
$this->bocommon->fm_cache('uicols_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group);
+ $cols_return =
$this->bocommon->fm_cache('cols_return_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group);
+ $type_id =
$this->bocommon->fm_cache('type_id_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group);
+// $this->cols_extra =
$this->bocommon->fm_cache('cols_extra_workorder'.!!$search_vendor . '_' .
!!$wo_hour_cat_id . '_' . !!$b_group);
}
if ($order)
@@ -275,6 +288,13 @@
$group_method = " group by
fm_project.id,fm_project.location_code,fm_workorder.id,workorder_id,title,fm_workorder.status,fm_workorder.entry_date,user_lid,fm_workorder.vendor_id,project_owner,fm_project.address,fm_vendor.org_name";
}
+
+ if ($b_group)
+ {
+ $filtermethod .= " $where
fm_b_account.category='$b_group' ";
+ $where= 'AND';
+ }
+
if ($filter=='all')
{
if (is_array($this->grants))
@@ -518,7 +538,10 @@
if ($this->db->f('calculation') > 0)
{
- $combined_cost = $this->db->f('calculation');
+ $config = CreateObject('phpgwapi.config');
+ $config->read_repository();
+ $tax = 1+(($config->config_data['fm_tax'])/100);
+ $combined_cost = $this->db->f('calculation')*
$tax;
}
else
{
Index: property/inc/class.uibudget.inc.php
diff -u property/inc/class.uibudget.inc.php:1.10
property/inc/class.uibudget.inc.php:1.11
--- property/inc/class.uibudget.inc.php:1.10 Thu May 4 13:47:13 2006
+++ property/inc/class.uibudget.inc.php Fri May 5 07:43:33 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage budget
- * @version $Id: class.uibudget.inc.php,v 1.10 2006/05/04 13:47:13
sigurdne Exp $
+ * @version $Id: class.uibudget.inc.php,v 1.11 2006/05/05 07:43:33
sigurdne Exp $
*/
/**
@@ -28,15 +28,15 @@
var $public_functions = array
(
- 'index' => True,
- 'basis' => True,
- 'obligations' => True,
- 'view' => True,
- 'edit' => True,
- 'edit_basis' => True,
- 'excel' => True,
- 'delete' => True,
- 'delete_basis' => True
+ 'index' => True,
+ 'basis' => True,
+ 'obligations' => True,
+ 'view' => True,
+ 'edit' => True,
+ 'edit_basis' => True,
+ 'excel' => True,
+ 'delete' => True,
+ 'delete_basis' => True
);
function uibudget()
@@ -534,7 +534,8 @@
'grouping'
=> $entry['grouping'],
'district_id'
=> $entry['district_id'],
'budget_cost'
=> $entry['budget_cost'],
- 'link_details'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uibudget.obligation_details&district_id='
. $entry['district_id'] . '&grouping=' . $entry['grouping']),
+ 'hits'
=> $entry['hits'],
+ 'link_details'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.index&filter=all&status_id=Bestilt&district_id='
. $entry['district_id'] . '&b_group=' . $entry['grouping']),
'lang_details_text'
=> lang('obligation details'),
'text_details'
=> lang('details'),
);
@@ -546,10 +547,24 @@
(
'lang_budget_cost' => lang('budget cost'),
'lang_grouping' => lang('grouping'),
+ 'lang_hits' => lang('hits'),
'lang_details' => lang('details'),
'lang_district_id' => lang('district_id'),
+ 'sort_hits' =>
$this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'hits',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uibudget.obligations',
+
'district_id'
=>$this->district_id,
+
'year' =>$this->year,
+
'period' =>$this->period,
+
'grouping'
=>$this->grouping,
+
'allrows'
=>$this->allrows)
+
)),
+
'sort_district_id' =>
$this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
@@ -560,7 +575,6 @@
'year' =>$this->year,
'period' =>$this->period,
'grouping'
=>$this->grouping,
-
'revision'
=>$this->revision,
'allrows'
=>$this->allrows)
)),
@@ -575,7 +589,6 @@
'year' =>$this->year,
'period' =>$this->period,
'grouping'
=>$this->grouping,
-
'revision'
=>$this->revision,
'allrows'=>$this->allrows)
)),
@@ -589,7 +602,6 @@
'year' =>$this->year,
'period' =>$this->period,
'grouping'
=>$this->grouping,
-
'revision'
=>$this->revision,
'allrows'=>$this->allrows)
)),
);
@@ -615,9 +627,7 @@
'filter' =>$this->filter,
'query' =>$this->query,
'district_id'
=>$this->district_id,
- 'year' =>$this->year,
- 'grouping'
=>$this->grouping,
- 'revision'
=>$this->revision
+ 'grouping'
=>$this->grouping
);
if(!$this->allrows)
Index: property/inc/class.uiworkorder.inc.php
diff -u property/inc/class.uiworkorder.inc.php:1.20
property/inc/class.uiworkorder.inc.php:1.21
--- property/inc/class.uiworkorder.inc.php:1.20 Mon Apr 17 11:36:05 2006
+++ property/inc/class.uiworkorder.inc.php Fri May 5 07:43:34 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.uiworkorder.inc.php,v 1.20 2006/04/17 11:36:05
sigurdne Exp $
+ * @version $Id: class.uiworkorder.inc.php,v 1.21 2006/05/05 07:43:34
sigurdne Exp $
*/
/**
@@ -46,11 +46,11 @@
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->bo =
CreateObject($this->currentapp.'.boworkorder',True);
- $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
- $this->menu =
CreateObject($this->currentapp.'.menu');
+ $this->bo =
CreateObject($this->currentapp.'.boworkorder',True);
+ $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
+ $this->menu =
CreateObject($this->currentapp.'.menu');
$this->acl2 =
CreateObject($this->currentapp.'.acl2');
- $this->acl2_location = '.project';
+ $this->acl2_location = '.project';
$this->acl_read =
$this->acl2->check('.project',1);
$this->acl_add =
$this->acl2->check('.project',2);
$this->acl_edit =
$this->acl2->check('.project',4);
@@ -58,16 +58,18 @@
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
- $this->sort =
$this->bo->sort;
+ $this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->filter =
$this->bo->filter;
$this->cat_id =
$this->bo->cat_id;
$this->status_id =
$this->bo->status_id;
- $this->search_vendor =
$this->bo->search_vendor;
+ $this->search_vendor =
$this->bo->search_vendor;
$this->wo_hour_cat_id =
$this->bo->wo_hour_cat_id;
$this->start_date =
$this->bo->start_date;
$this->end_date =
$this->bo->end_date;
+ $this->b_group =
$this->bo->b_group;
+
$this->menu->sub ='project';
}
@@ -85,7 +87,8 @@
'status_id' =>
$this->status_id,
'wo_hour_cat_id' =>
$this->wo_hour_cat_id,
'start_date' =>
$this->start_date,
- 'end_date' =>
$this->end_date
+ 'end_date' =>
$this->end_date,
+ 'b_group' =>
$this->b_group
);
$this->bo->save_sessiondata($data);
}
@@ -222,9 +225,10 @@
'district_id' =>
$this->district_id,
'search_vendor'
=>$this->search_vendor,
'cat_id'
=>$this->cat_id,
-
'start_date'=>$start_date,
-
'end_date'=>$end_date,
-
'wo_hour_cat_id'
=>$this->wo_hour_cat_id
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date,
+
'wo_hour_cat_id'=>$this->wo_hour_cat_id,
+
'b_group' =>
$this->b_group
)
));
}
@@ -243,9 +247,10 @@
'district_id' =>
$this->district_id,
'search_vendor'
=>$this->search_vendor,
'cat_id'
=>$this->cat_id,
-
'start_date'=>$start_date,
-
'end_date'=>$end_date,
-
'wo_hour_cat_id'
=>$this->wo_hour_cat_id
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date,
+
'wo_hour_cat_id'=>$this->wo_hour_cat_id,
+
'b_group' =>
$this->b_group
)
));
}
if($uicols['name'][$i]=='workorder_id')
@@ -263,9 +268,10 @@
'district_id' =>
$this->district_id,
'search_vendor'
=>$this->search_vendor,
'cat_id'
=>$this->cat_id,
-
'start_date'=>$start_date,
-
'end_date'=>$end_date,
-
'wo_hour_cat_id'
=>$this->wo_hour_cat_id
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date,
+
'wo_hour_cat_id'
=>$this->wo_hour_cat_id,
+
'b_group' =>
$this->b_group
)
));
}
@@ -284,9 +290,10 @@
'district_id' =>
$this->district_id,
'search_vendor'
=>$this->search_vendor,
'cat_id'
=>$this->cat_id,
-
'start_date'=>$start_date,
-
'end_date'=>$end_date,
-
'wo_hour_cat_id'
=>$this->wo_hour_cat_id
+
'start_date'
=>$start_date,
+
'end_date'
=>$end_date,
+
'wo_hour_cat_id'=>$this->wo_hour_cat_id,
+
'b_group' =>
$this->b_group
)
));
}
@@ -354,7 +361,8 @@
'search_vendor'
=>$this->search_vendor,
'start_date'
=>$start_date,
'end_date'
=>$end_date,
- 'wo_hour_cat_id'
=>$this->wo_hour_cat_id
+ 'wo_hour_cat_id'
=>$this->wo_hour_cat_id,
+ 'b_group' =>
$this->b_group
);
$link_date_search
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.date_search');
@@ -374,6 +382,7 @@
'end_date'
=>$end_date,
'start'
=>$this->start,
'wo_hour_cat_id'
=>$this->wo_hour_cat_id,
+ 'b_group' =>
$this->b_group
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc class.uibudget.inc.php class.sobud...,
Sigurd Nes <=