-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrep_bu_activity.php
489 lines (452 loc) · 19 KB
/
rep_bu_activity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<?php
// $flagNoAuth = true;
require ('common/auth.php');
require ('classes/budget.class.php');
require ('classes/reports.class.php');
require ('classes/item.class.php');
include ('includes/inc_report_settings.php');
include ('includes/inc_total_functions.php');
include ('includes/inc_report_pcfilter.php'); /// filter and tabs for Business unit
$arrJS[] = 'js/rep_totals.js';
$arrActions[] = Array('title'=>'Apr-Mar','action'=>'?mthStart=4&mthEnd=15');
$arrActions[] = Array('title'=>'Jan-Dec','action'=>'?mthStart=1&mthEnd=12');
$arrActions[] = Array('title'=>'YTD','action'=>'?mthStart='.(1+$oBudget->offset).'&mthEnd='.$oBudget->cm);
$arrActions[] = Array('title'=>'ROY','action'=>'?mthStart='.$oBudget->nm.'&mthEnd='.(12+$oBudget->offset));
$arrActions[] = Array('title'=>'This month','action'=>'?mthStart='.$oBudget->cm.'&mthEnd='.$oBudget->cm);
$arrActions[] = Array('title'=>'Next month','action'=>'?mthStart='.$oBudget->nm.'&mthEnd='.$oBudget->nm);
// if ($bu_group){
// $sql = "SELECT * FROM common_db.tbl_profit WHERE pccParentCode1C='{$bu_group}'";
// $rs = $oSQL->q($sql);
// while ($rw = $oSQL->f($rs)){
// $arrBus[] = $rw['pccID'];
// }
// $strBUs = implode(',',$arrBus);
// $sqlWherePC = " AND pc IN ({$strBUs})";
// }
$oBudget = new Budget($budget_scenario);
$oReference = new Budget($reference);
$mthStart = $_GET['mthStart']?(integer)$_GET['mthStart']:1+$oBudget->offset;
$mthEnd = $_GET['mthEnd']?(integer)$_GET['mthEnd']:12+$oBudget->offset;
// $strLastTitle = $oBudget->type=='FYE'?'Budget':$reference;
$strLastTitle = $oReference->title;
$arrRates_this = $oBudget->getMonthlyRates($currency);
$arrRates_last = $oReference->getMonthlyRates($currency);
// echo '<pre>'; print_r($arrRates);echo '</pre>';
$arrUsrData["pagTitle$strLocal"] .= ': '.$oBudget->title;
if($currency!=643){
$sql = "SELECT * FROM vw_currency WHERE curID={$currency} LIMIT 1";
$rs = $oSQL->q($sql);
$rw = $oSQL->f($rs);
$curTitle = $rw["curTitle$strLocal"];
} else {
$curTitle = "RUB";
}
$arrUsrData["pagTitle$strLocal"] .= ': '.$curTitle;
if ($denominator!=1) {
$arrUsrData["pagTitle$strLocal"] .= ' x'.$denominator;
}
if(isset($_GET['pccGUID'])){
$sqlWherePC = "AND pc IN (".implode(',',$filter['pc']).")";
$repType = 'budget';
switch($repType){
case 'yact':
define ('STAFF_COSTS', 'J00801:Labor cost');
define ('GROSS_PROFIT', 'Gross profit');
$sqlAccountString = "CONCAT(`account`,':',`Title`) AS 'AccountTitle', `account` AS 'Account', `yact_group` AS 'GroupTitle', `yact_group_code` AS 'Group'";
$sqlGroupBy = "`account`";
break;
case 'budget':
default:
define ('STAFF_COSTS', '02.Staff costs');
define ('GROSS_PROFIT', '01.Gross Margin');
$sqlAccountString = "`Budget item` AS 'AccountTitle', `item` AS 'Account', `Group` AS 'GroupTitle', `Group_code` AS 'Group'";
$sqlGroupBy = "`item`";
break;
}
$sql = "SELECT activity, Activity_title, prtGHQ, {$sqlAccountString} , SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd,$arrRates_this).")/$denominator as Total, 0 as Estimate
FROM vw_master
WHERE scenario='{$oBudget->id}' AND company='{$company}' AND account NOT LIKE 'SZ%' {$sqlWherePC}
GROUP BY activity, {$sqlGroupBy}
UNION ALL
SELECT activity, Activity_title, prtGHQ, {$sqlAccountString}, 0 as Total, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd,$arrRates_last).")/$denominator as Estimate
FROM vw_master
WHERE scenario='{$reference}' AND company='{$company}' AND account NOT LIKE 'SZ%' {$sqlWherePC}
GROUP BY activity, {$sqlGroupBy}
ORDER BY `Total` DESC, `Group`, prtGHQ, activity";
// echo '<pre>',$sql,'</pre>';
$rs = $oSQL->q($sql);
while ($rw=$oSQL->f($rs)){
$keyActivity = $rw['activity'];
if ($rw['Account']==Items::REVENUE || $rw['Account']==Items::INTERCOMPANY_REVENUE || $rw['Account']=='J00400'){
$arrRevenue[$keyActivity] += $rw['Total'];
$arrRevenueEst += $rw['Estimate'];
}
$arrReport['this'][$rw['GroupTitle']][$rw['AccountTitle']][$keyActivity] += $rw['Total'];
$arrReport['last'][$rw['GroupTitle']][$rw['AccountTitle']][$keyActivity] += $rw['Estimate'];
$arrTotal['this'][$rw['GroupTitle']][$keyActivity] += $rw['Total'];
$arrTotal['last'][$rw['GroupTitle']][$keyActivity] += $rw['Estimate'];
$arrGrandTotal[$keyActivity] += $rw['Total'];
$arrGrandTotalEstimate[$keyActivity] += $rw['Estimate'];
$arrEstimate[$rw['GroupTitle']][$rw['AccountTitle']] += $rw['Estimate'];
$arrActivity[$keyActivity] = $rw['Activity_title'];
}
$sql = "SELECT activity, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd).")/".($mthEnd-$mthStart+1)." as Total, 0 as Estimate
FROM reg_headcount
WHERE scenario='{$oBudget->id}' AND company='{$company}' and posted=1 and salary>10000 {$sqlWherePC}
GROUP BY activity
UNION ALL
SELECT activity, 0 as Total, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd).")/".($mthEnd-$mthStart+1)." as Estimate
FROM reg_headcount
WHERE scenario='{$reference}' AND company='{$company}' and posted=1 and salary>10000 {$sqlWherePC}
GROUP BY activity
ORDER BY activity";
$rs = $oSQL->q($sql);
while ($rw=$oSQL->f($rs)){
$keyActivity = $rw['activity'];
$arrHeadcount['this'][$keyActivity] += $rw['Total'];
$arrHeadcount['last'][$keyActivity] += $rw['Estimate'];
}
$sql = "SELECT activity, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd,$arrRates_this).")/$denominator as Total, 0 as Estimate
FROM reg_master
WHERE scenario='{$oBudget->id}' AND company='{$company}' {$sqlWherePC}
AND (account NOT LIKE '6%' AND account NOT LIKE '7%' AND account NOT LIKE 'SZ%')
GROUP BY activity
UNION ALL
SELECT activity, 0, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd,$arrRates_last).")/$denominator as Estimate
FROM reg_master
WHERE scenario='{$reference}' AND company='{$company}' {$sqlWherePC}
AND (account NOT LIKE '6%' AND account NOT LIKE '7%' AND account NOT LIKE 'SZ%')
GROUP BY activity
ORDER BY activity";
$rs = $oSQL->q($sql);
while ($rw=$oSQL->f($rs)){
$keyActivity = $rw['activity'];
$arrOpIncome['this'][$keyActivity] += $rw['Total'];
$arrOpIncome['last'][$keyActivity] += $rw['Estimate'];
}
$sql = "SELECT activity, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd,$arrRates_this).")/$denominator as Total, 0 as Estimate
FROM reg_master
WHERE scenario='{$oBudget->id}' AND company='{$company}' {$sqlWherePC}
".Reports::GOP_FILTER."
GROUP BY activity
UNION ALL
SELECT activity, 0, SUM(".$oBudget->getYTDSQL($mthStart,$mthEnd,$arrRates_last).")/$denominator as Estimate
FROM reg_master
WHERE scenario='{$reference}' AND company='{$company}' {$sqlWherePC}
".Reports::GOP_FILTER."
GROUP BY activity
ORDER BY activity";
$rs = $oSQL->q($sql);
while ($rw=$oSQL->f($rs)){
$keyActivity = $rw['activity'];
$arrGOP['this'][$keyActivity] += $rw['Total'];
$arrGOP['last'][$keyActivity] += $rw['Estimate'];
}
// echo '<pre>';print_r($arrHeadcount);echo '</pre>';echo $sql;
// echo '<pre>';print_r($arrReport);echo '</pre>';
?>
<table class='budget' id='report_<?php echo $_GET['pccGUID'];?>'>
<caption><?php echo $arrUsrData["pagTitle$strLocal"], ' printed on ', date('d.m.Y h:i');?></caption>
<thead>
<?php echo getTableHeaderAct();?>
</thead>
<tbody>
<?php
foreach($arrReport['this'] as $group=>$arrItem){
foreach($arrItem as $item=>$values){
?>
<tr>
<td><?php echo $item;?></td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($values[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(array_sum($values));?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrReport['last'][$group][$item]));?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($values) - $arrEstimate[$group][$item]);?></td>
<td class='budget-decimal budget-ratio'><?php Reports::render_ratio(array_sum($values) , $arrEstimate[$group][$item]);?></td>
</tr>
<?php
}
//---Group subtotal
?>
<tr class="budget-subtotal">
<td><?php echo $group;?></td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrTotal['this'][$group][$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(array_sum($arrTotal['this'][$group]));?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrTotal['last'][$group]));?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrTotal['this'][$group]) - array_sum($arrTotal['last'][$group]));?></td>
<td class='budget-decimal budget-ratio'><?php Reports::render_ratio(array_sum($arrTotal['this'][$group]) , array_sum($arrTotal['last'][$group]));?></td>
</tr>
<?php
//------ Ratios for gross margin
if ($group == GROSS_PROFIT){
?>
<tr class="budget-ratio">
<td>GP, %</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render_ratio($arrTotal['this'][$group][$pc],$arrRevenue[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render_ratio(array_sum($arrTotal['this'][$group]),array_sum($arrRevenue));?></td>
<td class='budget-decimal'><?php Reports::render_ratio(array_sum($arrEstimate[$group]),$arrRevenueEst);?></td>
<td class='budget-decimal'><?php @Reports::render((array_sum($arrTotal['this'][$group])/array_sum($arrRevenue)-array_sum($arrEstimate[$group])/$arrRevenueEst)*100,1);?></td>
</tr>
<?php
}
if ($group == STAFF_COSTS){
?>
<tr class="budget-ratio">
<td>GP to Staff costs</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render_ratio(-$arrTotal['this'][GROSS_PROFIT][$pc],$arrTotal['this'][STAFF_COSTS][$pc]*100);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php if(is_array($arrTotal['this'][GROSS_PROFIT])) Reports::render_ratio(-array_sum($arrTotal['this'][GROSS_PROFIT]),array_sum($arrTotal['this'][STAFF_COSTS])*100);?></td>
<td class='budget-decimal'><?php if(is_array($arrEstimate[GROSS_PROFIT])) Reports::render_ratio(-array_sum($arrEstimate[GROSS_PROFIT]),array_sum($arrEstimate[STAFF_COSTS])*100);?></td>
</tr>
<tr class="budget-ratio">
<td>SC per FTE</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render_ratio(-$arrTotal['this'][STAFF_COSTS][$pc],$arrHeadcount['this'][$pc]*100);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render_ratio(-array_sum($arrTotal['this'][STAFF_COSTS]),array_sum($arrHeadcount['this'])*100);?></td>
<td class='budget-decimal'><?php Reports::render_ratio(-array_sum($arrEstimate[STAFF_COSTS]),array_sum($arrHeadcount['last'])*100);?></td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot>
<?php echo getTableHeaderAct();?>
<tr class="budget-total">
<td>Profit before tax</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrGrandTotal[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(array_sum($arrGrandTotal));?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrGrandTotalEstimate));?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrGrandTotal)-array_sum($arrGrandTotalEstimate));?></td>
</tr>
<tr>
<td><?php echo $strLastTitle;?></td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrGrandTotalEstimate[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(array_sum($arrGrandTotalEstimate));?></td>
</tr>
<tr>
<td>Diff</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrGrandTotal[$pc]-$arrGrandTotalEstimate[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(array_sum($arrGrandTotal)-array_sum($arrGrandTotalEstimate));?></td>
</tr>
<tr class="budget-ratio">
<td>% of revenue</td>
<?php
foreach($arrActivity as $pc=>$flag){
if ($arrReport['this'][GROSS_PROFIT]['Revenue'][$pc]){
$arrCostRatio[$pc] = $arrGrandTotal[$pc]/$arrReport['this'][GROSS_PROFIT]['Revenue'][$pc]*100;
} else {
$arrCostRatio[$pc]=0;
}
if(!$flag && is_array($arrReport['this'][GROSS_PROFIT]['Revenue'])){
$arrCostRatio[$pc] = - $arrGrandTotal[$pc]/array_sum($arrReport['this'][GROSS_PROFIT]['Revenue'])*100;
}
?>
<td class='budget-decimal'><?php Reports::render($arrCostRatio[$pc],1);?></td>
<?php
}
?>
<td class='budget-decimal'><?php if(is_array($arrReport['this'][GROSS_PROFIT]['Revenue'])) Reports::render_ratio(array_sum($arrGrandTotal),array_sum($arrReport['this'][GROSS_PROFIT]['Revenue']));?></td>
</tr>
<tr class="budget-subtotal">
<td>Headcount</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrHeadcount['this'][$pc],1);?></td>
<?php
}
?>
<td class='budget-decimal'><?php Reports::render(array_sum($arrHeadcount['this']),1);?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrHeadcount['last']),1);?></td>
<td class='budget-decimal'><?php Reports::render(array_sum($arrHeadcount['this'])-array_sum($arrHeadcount['last']),1);?></td>
<td class='budget-decimal'><?php Reports::render_ratio(array_sum($arrHeadcount['this']),array_sum($arrHeadcount['last']),1);?></td>
</tr>
<tr>
<td>Headcount, <?php echo $strLastTitle;?></td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrHeadcount['last'][$pc],1);?></td>
<?php
}
?>
<td class='budget-decimal'><?php Reports::render(array_sum($arrHeadcount['last']),1);?></td>
</tr>
<tr>
<td>Diff</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrHeadcount['this'][$pc]-$arrHeadcount['last'][$pc],1);?></td>
<?php
}
?>
<td class='budget-decimal'><?php Reports::render(array_sum($arrHeadcount['this']) - array_sum($arrHeadcount['last']),1);?></td>
</tr>
<tr>
<td>Gross revenue</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrGrossRevenue[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php if(is_array($arrGrossRevenue)) Reports::render(array_sum($arrGrossRevenue));?></td>
<td class='budget-decimal'><?php Reports::render($arrGrossRevenueEstimate);?></td>
<td class='budget-decimal'><?php if(is_array($arrGrossRevenue)) Reports::render(array_sum($arrGrossRevenue)-$arrGrossRevenueEstimate);?></td>
<td class='budget-decimal budget-ratio'><?php if(is_array($arrGrossRevenue)) Reports::render_ratio(array_sum($arrGrossRevenue),$arrGrossRevenueEstimate);?></td>
</tr>
<tr class="budget-ratio">
<td>%of total</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php if(is_array($arrGrossRevenue)) Reports::render_ratio($arrGrossRevenue[$pc],array_sum($arrGrossRevenue));?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(100,1);?></td>
</tr>
<?php
renderActualVsBudget($arrGOP, $arrActivity, "Gross Operating Profit",$strLastTitle);
renderActualVsBudget($arrOpIncome, $arrActivity, "Operating income",$strLastTitle);
?>
<tr class="budget-ratio">
<td>OI, %of total</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrOpIncome['this'][$pc]/array_sum($arrOpIncome['this'])*100,1);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render(100,1);?></td>
</tr>
<tr class="budget-ratio">
<td>OI, %of revenue</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render_ratio($arrOpIncome['this'][$pc],$arrGrossRevenue[$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php if(is_array($arrGrossRevenue)) Reports::render_ratio(array_sum($arrOpIncome['this']),array_sum($arrGrossRevenue));?></td>
<td class='budget-decimal budget-ytd'><?php Reports::render_ratio(array_sum($arrOpIncome['last']),$arrGrossRevenueEstimate);?></td>
</tr>
<tr>
<td>OI per headcount</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render_ratio($arrOpIncome['this'][$pc]/100,$arrHeadcount['this'][$pc],0);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php Reports::render_ratio(array_sum($arrOpIncome['this'])/100,array_sum($arrHeadcount['this']),0);?></td>
</tr>
<tr class="budget-subtotal">
<td>OP costs</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrOpIncome['this'][$pc]-$arrTotal['this'][GROSS_PROFIT][$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php if(is_array($arrTotal['this'][GROSS_PROFIT])) Reports::render(array_sum($arrOpIncome['this']) - array_sum($arrTotal['this'][GROSS_PROFIT]));?></td>
</tr>
<tr class="">
<td>OP costs, <?php echo $strLastTitle;?></td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render($arrOpIncome['last'][$pc]-$arrTotal['last'][GROSS_PROFIT][$pc]);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php if(is_array($arrTotal['last'][GROSS_PROFIT])) Reports::render(array_sum($arrOpIncome['last']) - array_sum($arrTotal['last'][GROSS_PROFIT]));?></td>
</tr>
<tr>
<td>Op.cost per headcount</td>
<?php
foreach($arrActivity as $pc=>$flag){
?>
<td class='budget-decimal'><?php Reports::render_ratio(($arrOpIncome['this'][$pc]-$arrTotal['this'][GROSS_PROFIT][$pc])/100,$arrHeadcount['this'][$pc],0);?></td>
<?php
}
?>
<td class='budget-decimal budget-ytd'><?php if(is_array($arrTotal['this'][GROSS_PROFIT]))Reports::render_ratio((array_sum($arrOpIncome['this'])-array_sum($arrTotal['this'][GROSS_PROFIT]))/100,array_sum($arrHeadcount['this']),0);?></td>
</tr>
</tfoot>
</table>
<ul class='link-footer'>
<li><a href='javascript:SelectContent("report_<?php echo $_GET['pccGUID'];?>");'>Copy table</a></li>
</ul>
<?php
die();
}
include ('includes/inc-frame_top.php');
?>
<h1><?php echo $arrUsrData["pagTitle$strLocal"];?></h1>
<?php
include ('includes/inc_report_selectors.php');
if ($mthStart!=1 || $mthEnd!=12){
if ($mthStart==$mthEnd){
$periodTitle = date('F',mktime(0,0,0,$mthStart)).' only';
} else {
$periodTitle = 'Period: '.date('M',mktime(0,0,0,$mthStart))." – ". date('M',mktime(0,0,0,$mthEnd));
}
echo '<h2>',$periodTitle,'</h2>';
}
echo '<p>',$oBudget->timestamp,'; ',$oBudget->rates,'</p>';
$oBudget::getProfitTabs('reg_master', true, Array('pccID'=>$arrBus));
include ('includes/inc-frame_bottom.php');
?>