[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] projects/inc/class.boprojects.inc.php, 1.132
From: |
nomail |
Subject: |
[Phpgroupware-cvs] projects/inc/class.boprojects.inc.php, 1.132 |
Date: |
Sun, 23 May 2004 16:59:27 -0000 |
Update of /projects/inc
Modified Files:
Branch:
class.boprojects.inc.php
date: 2004/05/02 20:56:52; author: ceb; state: Exp; lines: +96 -9
Log Message:
update
=====================================================================
Index: projects/inc/class.boprojects.inc.php
diff -u projects/inc/class.boprojects.inc.php:1.131
projects/inc/class.boprojects.inc.php:1.132
--- projects/inc/class.boprojects.inc.php:1.131 Wed Apr 28 13:34:46 2004
+++ projects/inc/class.boprojects.inc.php Sun May 2 20:56:52 2004
@@ -668,11 +668,34 @@
break;
case 'employee':
$emps_pro =
$this->sohours->get_employee_time_used(array('project_id' =>
$params['project_id']));
+
//_debug_array($emps_pro);
for($i=0;$i<count($emps_pro);$i++)
{
$factor =
$this->soconfig->return_value('acc',$emps_pro[$i]['employee']);
- $bill =
$this->calculate_budget($factor,$emps_pro[$i]['utime']);
-
$acc['u_budget'] += $bill;
+
//_debug_array($factor);
+
if(is_array($emps_pro[$i]['hours']))
+ {
+
foreach($emps_pro[$i]['hours'] as $wh)
+ {
+
$wh['factor'] = 0;
+
if(is_array($factor))
+
{
+
for($j=0;$j<count($factor);++$j)
+
{
+
if($wh['sdate']>=$factor[$j]['sdate'] &&
$wh['edate']<=$factor[$j]['edate'])
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
else if($factor[$j]['sdate']==0)
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
}
+
}
+
$bill = $this->calculate_budget($wh['factor'],$wh['minutes']);
+
$acc['u_budget'] += $bill;
+ }
+ }
}
if($params['billable']
== 'Y')
@@ -681,8 +704,29 @@
for($i=0;$i<count($emps_pro_bill);$i++)
{
$factor
= $this->soconfig->return_value('acc',$emps_pro_bill[$i]['employee']);
- $bill
= $this->calculate_budget($factor,$emps_pro_bill[$i]['utime']);
-
$acc['b_budget'] += $bill;
+
if(is_array($emps_pro_bill[$i]['hours']))
+ {
+
foreach($emps_pro_bill[$i]['hours'] as $wh)
+
{
+
$wh['factor'] = 0;
+
if(is_array($factor))
+
{
+
for($j=0;$j<count($factor);++$j)
+
{
+
if($wh['sdate']>=$factor[$j]['sdate'] &&
$wh['edate']<=$factor[$j]['edate'])
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
else if($factor[$j]['sdate']==0)
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
}
+
}
+
$bill = $this->calculate_budget($wh['factor'],$wh['minutes']);
+
$acc['b_budget'] += $bill;
+
}
+ }
}
}
//_debug_array($emps_pro);
@@ -711,8 +755,29 @@
for($k=0;$k<count($emps_pro);$k++)
{
$factor
= $this->soconfig->return_value('acc',$emps_pro[$k]['employee']);
- $bill
= $this->calculate_budget($factor,$emps_pro[$k]['utime']);
-
$pro_budget += $bill;
+
if(is_array($emps_pro[$k]['hours']))
+ {
+
foreach($emps_pro[$k]['hours'] as $wh)
+
{
+
$wh['factor'] = 0;
+
if(is_array($factor))
+
{
+
for($j=0;$j<count($factor);++$j)
+
{
+
if($wh['sdate']>=$factor[$j]['sdate'] &&
$wh['edate']<=$factor[$j]['edate'])
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
else if($factor[$j]['sdate']==0)
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
}
+
}
+
$bill = $this->calculate_budget($wh['factor'],$wh['minutes']);
+
$pro_budget += $bill;
+
}
+ }
}
if($subs[$i]['billable'] == 'Y')
{
@@ -720,8 +785,30 @@
for($k=0;$k<count($emps_pro_bill);$k++)
{
$factor = $this->soconfig->return_value('acc',$emps_pro_bill[$k]['employee']);
-
$bill = $this->calculate_budget($factor,$emps_pro_bill[$k]['utime']);
-
$pro_budget_bill += $bill;
+
+
if(is_array($emps_pro_bill[$k]['hours']))
+
{
+
foreach($emps_pro_bill[$k]['hours'] as $wh)
+
{
+
$wh['factor'] = 0;
+
if(is_array($factor))
+
{
+
for($j=0;$j<count($factor);++$j)
+
{
+
if($wh['sdate']>=$factor[$j]['sdate'] &&
$wh['edate']<=$factor[$j]['edate'])
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
else if($factor[$j]['sdate']==0)
+
{
+
$wh['factor'] = $factor[$j]['factor'];
+
}
+
}
+
}
+
$bill = $this->calculate_budget($wh['factor'],$wh['minutes']);
+
$pro_budget_bill += $bill;
+
}
+
}
}
}
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] projects/inc/class.boprojects.inc.php, 1.132,
nomail <=