Commit 9b2b22b9 by Azhan Hannan

fix

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