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
6d565adf
Commit
6d565adf
authored
Nov 03, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integration overhead form, public holiday
parent
c4357f33
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
8 deletions
+49
-8
packages/portal/timesheet/src/Http/Controllers/FormController.php
+49
-8
No files found.
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
6d565adf
...
@@ -928,7 +928,7 @@ class FormController extends Controller
...
@@ -928,7 +928,7 @@ class FormController extends Controller
->
first
();
->
first
();
$mcdetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$mcdetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$mcdetail
->
td_overhead_note
=
'
Cuti Sakit
'
;
$mcdetail
->
td_overhead_note
=
'
Medical Leave
'
;
$mcdetail
->
td_hours
=
8
;
$mcdetail
->
td_hours
=
8
;
$mcdetail
->
td_timesheet_sts
=
1
;
$mcdetail
->
td_timesheet_sts
=
1
;
$mcdetail
->
save
();
$mcdetail
->
save
();
...
@@ -963,7 +963,7 @@ class FormController extends Controller
...
@@ -963,7 +963,7 @@ class FormController extends Controller
->
first
();
->
first
();
$eldetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$eldetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$eldetail
->
td_overhead_note
=
'
Cuti Kecemasan
'
;
$eldetail
->
td_overhead_note
=
'
Emergency Leave
'
;
$eldetail
->
td_hours
=
8
;
$eldetail
->
td_hours
=
8
;
$eldetail
->
td_timesheet_sts
=
1
;
$eldetail
->
td_timesheet_sts
=
1
;
$eldetail
->
save
();
$eldetail
->
save
();
...
@@ -978,13 +978,13 @@ class FormController extends Controller
...
@@ -978,13 +978,13 @@ class FormController extends Controller
foreach
(
$halfday
as
$key
=>
$value
)
{
foreach
(
$halfday
as
$key
=>
$value
)
{
if
(
data_get
(
$value
,
'jenis_cuti'
)
==
'AL(m)'
)
if
(
data_get
(
$value
,
'jenis_cuti'
)
==
'AL(m)'
)
{
{
$checktdetail
al
=
Ts_detail
::
where
(
'td_date'
,
data_get
(
$value
,
'DATE'
))
$checktdetail
hd
=
Ts_detail
::
where
(
'td_date'
,
data_get
(
$value
,
'DATE'
))
->
where
(
'tm_staff_id'
,
data_get
(
$value
,
'staff_id'
))
->
where
(
'tm_staff_id'
,
data_get
(
$value
,
'staff_id'
))
->
where
(
'fk_o_id'
,
$al
)
->
where
(
'fk_o_id'
,
$al
)
->
where
(
'fk_tm_id'
,
$fk_tm_id
)
->
where
(
'fk_tm_id'
,
$fk_tm_id
)
->
first
();
->
first
();
if
(
$checktdetail
al
)
if
(
$checktdetail
hd
)
{
{
}
}
else
else
...
@@ -1005,7 +1005,7 @@ class FormController extends Controller
...
@@ -1005,7 +1005,7 @@ class FormController extends Controller
->
first
();
->
first
();
$aldetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$aldetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$aldetail
->
td_overhead_note
=
'
Cuti Separuh Hari (Pagi
)'
;
$aldetail
->
td_overhead_note
=
'
Halfday Leave (Morning
)'
;
$aldetail
->
td_hours
=
4
;
$aldetail
->
td_hours
=
4
;
$aldetail
->
td_timesheet_sts
=
1
;
$aldetail
->
td_timesheet_sts
=
1
;
$aldetail
->
save
();
$aldetail
->
save
();
...
@@ -1013,13 +1013,13 @@ class FormController extends Controller
...
@@ -1013,13 +1013,13 @@ class FormController extends Controller
}
}
else
if
(
data_get
(
$value
,
'jenis_cuti'
)
==
'AL (e)'
)
else
if
(
data_get
(
$value
,
'jenis_cuti'
)
==
'AL (e)'
)
{
{
$checktdetail
al
=
Ts_detail
::
where
(
'td_date'
,
data_get
(
$value
,
'DATE'
))
$checktdetail
hd
=
Ts_detail
::
where
(
'td_date'
,
data_get
(
$value
,
'DATE'
))
->
where
(
'tm_staff_id'
,
data_get
(
$value
,
'staff_id'
))
->
where
(
'tm_staff_id'
,
data_get
(
$value
,
'staff_id'
))
->
where
(
'fk_o_id'
,
$al
)
->
where
(
'fk_o_id'
,
$al
)
->
where
(
'fk_tm_id'
,
$fk_tm_id
)
->
where
(
'fk_tm_id'
,
$fk_tm_id
)
->
first
();
->
first
();
if
(
$checktdetail
al
)
if
(
$checktdetail
hd
)
{
{
}
}
else
else
...
@@ -1040,7 +1040,7 @@ class FormController extends Controller
...
@@ -1040,7 +1040,7 @@ class FormController extends Controller
->
first
();
->
first
();
$aldetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$aldetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$aldetail
->
td_overhead_note
=
'
Cuti Separuh Hari (Peta
ng)'
;
$aldetail
->
td_overhead_note
=
'
Halfday Leave (Eveni
ng)'
;
$aldetail
->
td_hours
=
4
;
$aldetail
->
td_hours
=
4
;
$aldetail
->
td_timesheet_sts
=
1
;
$aldetail
->
td_timesheet_sts
=
1
;
$aldetail
->
save
();
$aldetail
->
save
();
...
@@ -1049,6 +1049,47 @@ class FormController extends Controller
...
@@ -1049,6 +1049,47 @@ class FormController extends Controller
}
}
}
}
$pubhol
=
$lat
->
where
(
'attendance_status'
,
4
);
// dd($pubhol);
if
(
count
(
$pubhol
)
>
0
)
{
foreach
(
$pubhol
as
$key
=>
$value
)
{
$checktdetailph
=
Ts_detail
::
where
(
'td_date'
,
data_get
(
$value
,
'DATE'
))
->
where
(
'tm_staff_id'
,
data_get
(
$value
,
'staff_id'
))
->
where
(
'fk_o_id'
,
$publichol
)
->
where
(
'fk_tm_id'
,
$fk_tm_id
)
->
first
();
if
(
$checktdetailph
)
{
}
else
{
//create baru
$pbdetail
=
new
Ts_detail
;
$pbdetail
->
td_date
=
data_get
(
$value
,
'DATE'
);
$pbdetail
->
fk_o_id
=
$publichol
;
$pbdetail
->
fk_tm_id
=
$fk_tm_id
;
$pbdetail
->
tm_staff_id
=
$userId
;
$pbdetail
->
tm_month
=
$month
;
$pbdetail
->
tm_year
=
$year
;
$pbdetail
->
tm_phase
=
$phase
;
$pbdetail
->
td_project_type
=
3
;
$pbdetail
->
updated_by
=
$userId
;
$project
=
Overhead
::
where
(
'id'
,
$publichol
)
->
first
();
$pbdetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$pbdetail
->
td_overhead_note
=
'Public Holiday'
;
$pbdetail
->
td_hours
=
8
;
$pbdetail
->
td_timesheet_sts
=
1
;
$pbdetail
->
save
();
}
}
}
if
(
$fk_tm_id
)
if
(
$fk_tm_id
)
{
{
...
...
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