Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
3dae253d
Commit
3dae253d
authored
Oct 27, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display details staff & project hours dalam timesheet approval
parent
38a0e852
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
132 additions
and
4 deletions
+132
-4
packages/portal/timesheet/resources/views/dashboard/approvalaction.blade.php
+0
-0
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+132
-4
No files found.
packages/portal/timesheet/resources/views/dashboard/approvalaction.blade.php
View file @
3dae253d
This diff is collapsed.
Click to expand it.
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
3dae253d
...
@@ -848,15 +848,143 @@ class DashboardController extends Controller
...
@@ -848,15 +848,143 @@ class DashboardController extends Controller
{
{
$page
=
data_get
(
$request
,
'page'
);
$page
=
data_get
(
$request
,
'page'
);
// dd($page);
// dd($page);
$bod
=
Users
::
find
(
Auth
::
id
());
$profile
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
$profile
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
->
with
(
'team'
)
->
with
(
'team'
)
->
first
();
->
first
();
$bod
=
Users
::
find
(
Auth
::
id
());
// dd($profile);
// dd($profile);
return
view
(
'timesheet::dashboard.approvalaction'
,
compact
(
'profile'
,
'bod'
,
'page'
));
$phase
=
$profile
->
tp_phase
;
$month
=
$profile
->
tp_month
;
$year
=
$profile
->
tp_year
;
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$myDate
=
$month
.
'/'
.
'1'
.
'/'
.
$year
;
$date
=
Carbon
::
createFromFormat
(
'm/d/Y'
,
$myDate
);
$staff
=
VwViewer
::
where
(
'STAFF_ID'
,
$profile
->
staffid
)
->
first
();
$strMonth
=
$date
->
format
(
'F'
);
$strdays
=
[];
for
(
$i
=
0
;
$i
<
$daymonth
;
$i
++
)
{
$tempdate
=
$year
.
'-'
.
sprintf
(
'%02d'
,
$month
)
.
'-'
.
sprintf
(
'%02d'
,
$i
+
1
);
$strday
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$tempdate
)
->
format
(
'l'
);
$strdays
[
$i
]
=
substr
(
$strday
,
0
,
3
);
}
// dd($staff);
$chargeable
=
1
;
$overhead
=
3
;
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$profile
->
staffid
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
with
(
'attachement'
)
->
first
();
$chargeableproject
=
Tproject
::
where
(
'fk_tm_id'
,
data_get
(
$check
,
'id'
))
->
where
(
'tp_project_type'
,
1
)
->
with
(
'project'
)
->
get
();
$chargeablelist
=
[];
$overheadlist
=
[];
foreach
(
$chargeableproject
as
$key
=>
$value
)
{
$chargeablelist
[]
=
[
'pid'
=>
$value
->
td_project
,
'pcode'
=>
$value
->
project
->
p_project_code
,
'pname'
=>
$value
->
project
->
p_project_description
,
];
}
if
(
$check
)
{
$chargehour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$chargeable
)
// ->where('td_hours', '!=', 0)
->
get
();
$overheadhour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$overhead
)
->
where
(
'td_hours'
,
'!='
,
0
)
->
get
();
$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
;
}
}
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
;
$notes
=
Ts_detail
::
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'tm_staff_id'
,
$profile
->
staffid
)
->
where
(
'td_project_type'
,
$overhead
)
->
whereNotNull
(
'td_hours'
)
->
orderby
(
'td_date'
)
->
get
();
}
else
{
$chargehour
=
null
;
$overheadhour
=
null
;
$totalchargehrs
=
null
;
$totaloverheadhrs
=
null
;
$notes
=
null
;
$check
=
null
;
}
return
view
(
'timesheet::dashboard.approvalaction'
,
compact
(
'profile'
,
'bod'
,
'page'
,
'staff'
,
'daymonth'
,
'strMonth'
,
'year'
,
'month'
,
'phase'
,
'strdays'
,
'chargeablelist'
,
'chargehour'
,
'totalchargehrs'
));
}
}
public
function
approval
(
Request
$request
)
public
function
approval
(
Request
$request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment