Commit 7e86c8ce by Azhan Hannan

fixing report by project

parent 33cd0610
......@@ -39,11 +39,11 @@
</tr>
</thead>
<tbody>
<?php
<?php
$pteam = [];
?>
@foreach($roles as $key => $role)
<?php
<?php
$pteam = $pteams->where('role_id', data_get($role,'pm_roles'));
?>
<tr>
......@@ -51,7 +51,7 @@
<td rowspan="{{count($pteam)+1}}">{{data_get($role,'pm_hours')}} Hours <br> {{data_get($role,'pm_days')}} Days
</td>
<td rowspan="{{count($pteam)+1}}">
<?php
<?php
$accumulatehours = 0;
$staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles'));
foreach ($staffaccumulateshours as $key => $accumulateshours) {
......@@ -59,7 +59,7 @@
}
?>
{{ number_format($accumulatehours, 1, '.', '') }} Hours <br>
{{ number_format($accumulatehours/8, 1, '.', '') }} Days
{{ number_format($accumulatehours/8, 1, '.', '') }} Days
</td>
</tr>
<?php $count = 0; ?>
......@@ -67,11 +67,11 @@
<tr>
<td>{{data_get($team,'pt_team')}}</td>
<td class="center aligned">
<?php
<?php
$currhour = 0;
$currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
foreach ($currmonthhours as $key => $hours) {
$currhour = data_get($hours,'tp_hours');
$currhour += data_get($hours,'tp_hours');
}
?>
{{ number_format($currhour, '1', '.', '') }} Hours
......@@ -81,7 +81,7 @@
</td>
@if($count == 0)
<td rowspan="{{count($pteam)}}" class="center aligned">
<?php
<?php
$balancehours = data_get($role,'pm_hours') - $accumulatehours;
?>
{{ number_format($balancehours, '1', '.', '') }} Hours <br>
......@@ -89,7 +89,7 @@
</td>
@else
@endif
<?php
<?php
$count++;
?>
</tr>
......@@ -97,4 +97,4 @@
@endforeach
</tbody>
</table>
\ No newline at end of file
</table>
......@@ -5,7 +5,7 @@
<div class="ui segment">
<a class="ui green left ribbon label">Report by Project</a>
<br><br>
<form class="ui form" action="{{ route('timesheet::report.generateprojectreport') }}" method="POST">
{{csrf_field()}}
<div class="one fields">
......@@ -17,13 +17,13 @@
<option value="{{ data_get($value,'id') }}" @if(data_get($value,'id') == data_get($pdetail,'pid')) selected="selected" @endif>{{ data_get($value,'p_project_code') }} | {{ data_get($value,'p_project_description') }}</option>
@endforeach
@else
<option value="noproject">No Project</option>
<option value="noproject">No Project</option>
@endif
</select>
</div>
</div>
<?php
// dd($year);
<?php
// dd($year);
?>
<div class="two fields">
<div class="three wide field">
......@@ -39,7 +39,7 @@
</select>
</div>
<div class="three wide field">
<label>Month</label>
<label>Month</label>
<select name="month" class="ui fluid dropdown search" required="required">
@foreach($listmonth as $key => $value)
<option value="{{ $key+1 }}" @if($value == $month) selected="selected" @endif>{{ $value }}</option>
......@@ -52,8 +52,8 @@
</form>
</div>
<div class="ui segment">
<div class="ui purple left ribbon label">
<div class="ui segment">
<div class="ui purple left ribbon label">
Reporting
</div>
......@@ -75,7 +75,7 @@
<th style="width: 20%"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th>
<th style="width: 10%">Start Date </th>
<th style="width: 1%">:</th>
<th style="width: 20%">
<th style="width: 20%">
@if(data_get($pdetail,'start_date')) {{ date("j M Y", strtotime(data_get($pdetail,'start_date'))) }} @endif
</th>
</tr>
......@@ -85,13 +85,13 @@
<th style="width: 20%"> {{$month}} {{$year}}</th>
<th style="width: 10%"> End Date</th>
<th style="width: 1%">:</th>
<th style="width: 20%">
<th style="width: 20%">
@if(data_get($pdetail,'end_date')) {{ date("j M Y", strtotime(data_get($pdetail,'end_date'))) }} @endif
</th>
</tr>
</thead>
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
......@@ -108,11 +108,11 @@
</tr>
</thead>
<tbody>
<?php
<?php
$pteam = [];
?>
@foreach($roles as $key => $role)
<?php
<?php
$pteam = $pteams->where('role_id', data_get($role,'pm_roles'));
// dump($role);
// dump($pteams);
......@@ -121,7 +121,7 @@
<td rowspan="{{count($pteam)+1}}" class="center aligned">{{data_get($role,'role.role')}}</td>
<td rowspan="{{count($pteam)+1}}" class="center aligned">
<?php $hannan = 0; ?>
<?php
<?php
$hannan = data_get($role,'pm_hours');
if ($hannan) {
} else {
......@@ -131,10 +131,10 @@
{{ number_format($hannan, 1, '.', '') }} Hours<br>
{{ number_format($hannan/8, 1, '.', '') }} Days
</td>
<td rowspan="{{count($pteam)+1}}" class="center aligned">
<?php
<?php
$accumulatehours = 0;
$staffaccumulateshours = $accumulates->where('tp_roles', data_get($role,'pm_roles'));
foreach ($staffaccumulateshours as $key => $accumulateshours) {
......@@ -142,8 +142,8 @@
$accumulatehours += data_get($accumulateshours,'tp_hours');
}
?>
{{ number_format($accumulatehours, 1, '.', '') }} Hours <br>
{{ number_format($accumulatehours/8, 1, '.', '') }} Days
{{ number_format($accumulatehours, 1, '.', '') }} Hours <br>
{{ number_format($accumulatehours/8, 1, '.', '') }} Days
</td>
<?php $count = 0; ?>
@foreach($pteam as $key => $team)
......@@ -152,12 +152,12 @@
{{ data_get($team,'pt_team') }}
</td>
<td class="center aligned">
<?php
<?php
// dd($count);
$currhour = 0;
$currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
foreach ($currmonthhours as $key => $hours) {
$currhour = data_get($hours,'tp_hours');
$currhour += data_get($hours,'tp_hours');
}
// dd($currmonthhours);
?>
......@@ -180,7 +180,7 @@
</td>
@else
@endif
<?php
<?php
$count++;
?>
</tr>
......@@ -191,7 +191,7 @@
</table>
</div>
</div>
</div>
</div>
......@@ -199,4 +199,4 @@
@endsection
@push('script')
@endpush
\ No newline at end of file
@endpush
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment