Commit 9b2b22b9 by Azhan Hannan

fix

parent 5a3f9eb6
......@@ -211,8 +211,8 @@
@endfor
@endif
<th style="width: 5%">@if($totalchargeableall){{ number_format($totalchargeableall, 1, '.', '') }}@else 0 @endif</th>
<th style="width: 5%">@if($totalchargeableall){{ number_format($totalchargeableall/8, 1, '.', '') }}@else 0 @endif</th>
<th style="width: 5%">@if($totalchargeableall){{ number_format($totalchargeableall, 1, '.', '') }}@else 0.0 @endif</th>
<th style="width: 5%">@if($totalchargeableall){{ number_format($totalchargeableall/8, 1, '.', '') }}@else 0.0 @endif</th>
</tfoot>
</table>
</div>
......@@ -260,6 +260,7 @@
<?php
$totaloverhead = 0;
?>
<tr>
<td style="width: 4%;"></td>
<td style="width: 23%;">{{ $projectoverhead['pname']}}</td>
......@@ -320,8 +321,8 @@
<td style="width: 5%">{{ number_format($totaloverhead, 1, '.', '') }}</td>
<td style="width: 5%">{{ number_format($totaloverhead/8, 1, '.', '') }}</td>
@else
<td style="width: 5%">0</td>
<td style="width: 5%">0</td>
<td style="width: 5%">0.0</td>
<td style="width: 5%">0.0</td>
@endif
</tr>
@endforeach
......@@ -372,8 +373,8 @@
<?php
// dd($totaloverheadhrs);
?>
<th style="width: 5%">@if($totaloverheadall) {{ number_format($totaloverheadall, 1, '.', '') }} @endif</th>
<th style="width: 5%">@if($totaloverheadall) {{ number_format($totaloverheadall/8, 1, '.', '') }} @endif</th>
<th style="width: 5%">@if($totaloverheadall) {{ number_format($totaloverheadall, 1, '.', '') }} @else 0.0 @endif</th>
<th style="width: 5%">@if($totaloverheadall) {{ number_format($totaloverheadall/8, 1, '.', '') }} @else 0.0 @endif</th>
</tfoot>
</table>
</div>
......@@ -504,7 +505,7 @@
<th style="width: 4%;">{{ number_format($ac, '1', '.', '') }}</th>
@endfor
@endif
<th style="width: 5%;"> @if($check) {{ number_format(($totalchargeableall + $totaloverheadall), 1, '.', '') }} @else 0 @endif </th>
<th style="width: 5%;"> {{ number_format(($totalchargeableall + $totaloverheadall), 1, '.', '') }} </th>
<th style="width: 5%;"> {{ number_format(($totalchargeableall + $totaloverheadall)/8, 1, '.', '') }} </th>
</tr>
......
......@@ -1254,7 +1254,6 @@ class DashboardController extends Controller
public function timesheetViewer(Request $request)
{
// dd($request);
$curruser = $user = Staff_info::where('fk_users', Auth::id())
->first();
......@@ -1266,7 +1265,6 @@ class DashboardController extends Controller
$profile = VwViewer::where('STAFF_ID', $user->staff_id)
->orderby('DEPARTMENT', 'DESC')
->first();
// dd($user->staff_id);
$dept = Department::where('id', $user->fk_lkp_department)
->first();
......@@ -1292,10 +1290,11 @@ class DashboardController extends Controller
$date = Carbon::createFromFormat('m/d/Y', $myDate);
$strdays = [];
$arraydates = [];
for ($i=0; $i < $daymonth; $i++) {
$tempdate = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
$arraydates[] = $tempdate;
$strday = Carbon::createFromFormat('Y-m-d', $tempdate)->format('l');
$strdays[$i] = substr($strday, 0, 3);
......@@ -1352,7 +1351,7 @@ class DashboardController extends Controller
->groupby('fk_o_id')
->orderby('fk_o_id', 'asc')
->get();
// dd($ovlist);
foreach ($ovlist as $key => $value)
{
$overheadlist[] = [
......@@ -1361,43 +1360,6 @@ class DashboardController extends Controller
];
}
// dd($overheadlist);
// $tempOverhead[0] = "";
// $tempOverheadid[0] = 0;
// if(isset($overheadhour[0]))
// {
// // dd('sini ke?');
// $tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
// $tempOverheadid[0] = $overheadhour[0]->fk_o_id;
// $j = 0;
// for($i = 0; $i < count($overheadhour); $i++)
// {
// if ($tempOverhead[$j] == $overheadhour[$i]->td_overhead_desc) {
// }
// else
// {
// $j++;
// $tempOverhead[$j] = $overheadhour[$i]->td_overhead_desc;
// $tempOverheadid[$j] = $overheadhour[$i]->fk_o_id;
// }
// }
// // dd($tempOverhead);
// foreach ($tempOverhead as $key => $value) {
// $overheadlist[] = [
// 'pid' => $tempOverheadid[$key],
// 'pname' => $tempOverhead[$key],
// ];
// }
// }
// else
// {
// // dd('ke sini?');
// }
$totalchargehrs = $check->tm_chargeable_hrs;
$totaloverheadhrs = $check->tm_overhead_hrs;
......@@ -1420,9 +1382,13 @@ class DashboardController extends Controller
$notes = null;
$check = null;
}
// dd($check->id);
return view('timesheet::dashboard.timesheetViewer', compact('curruser', 'user','profile', 'dept', 'phase', 'month', 'year', 'strMonth', 'daymonth', 'chargeablelist', 'overheadlist', 'chargehour', 'totalchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays'));
$statushari = LAttendance::where('staff_id', data_get($user,'staff_id'))
->whereIn('DATE', $arraydates)
->get();
// dd($statushari);
return view('timesheet::dashboard.timesheetViewer', compact('curruser', 'user','profile', 'dept', 'phase', 'month', 'year', 'strMonth', 'daymonth', 'chargeablelist', 'overheadlist', 'chargehour', 'totalchargehrs', 'totaloverheadhrs', 'overheadhour', 'notes', 'check', 'strdays','statushari'));
}
public function tsubmit(Request $request)
......
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