Commit e74afdb9 by Azhan Hannan

update integration chargeable

parent fcd42909
...@@ -916,34 +916,6 @@ class FormController extends Controller ...@@ -916,34 +916,6 @@ class FormController extends Controller
if($checktdetailmc) if($checktdetailmc)
{ {
$checktpmc = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $mc)
->first();
if ($checktpmc)
{
}
else
{
$tpmc = new Tproject;
$tpmc->staffid = $userId;
$tpmc->fk_o_id = $mc;
$tpmc->fk_tm_id = $fk_tm_id;
$tpmc->tp_project_type = 3;
$tpmc->tp_year = $year;
$tpmc->tp_month = $month;
$tpmc->tp_phase = $phase;
$project = Overhead::where('id', $mc)
->first();
$tpmc->tp_project_name = $project->o_overhead_desc;
$tpmc->tp_hours = 8;
$tpmc->tp_timesheet_sts = 1;
$tpmc->tp_pm = data_get($user,'penyokong');
$tpmc->tp_pd = data_get($user,'pelulus');
$tpmc->save();
}
} }
else else
{ {
...@@ -1007,34 +979,6 @@ class FormController extends Controller ...@@ -1007,34 +979,6 @@ class FormController extends Controller
if($checktdetailel) if($checktdetailel)
{ {
$checktpel = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $el)
->first();
if ($checktpel)
{
}
else
{
$tpel = new Tproject;
$tpel->staffid = $userId;
$tpel->fk_o_id = $el;
$tpel->fk_tm_id = $fk_tm_id;
$tpel->tp_project_type = 3;
$tpel->tp_year = $year;
$tpel->tp_month = $month;
$tpel->tp_phase = $phase;
$project = Overhead::where('id', $el)
->first();
$tpel->tp_project_name = $project->o_overhead_desc;
$tpel->tp_hours = 8;
$tpel->tp_timesheet_sts = 1;
$tpel->tp_pm = data_get($user,'penyokong');
$tpel->tp_pd = data_get($user,'pelulus');
$tpel->save();
}
} }
else else
{ {
...@@ -1099,34 +1043,6 @@ class FormController extends Controller ...@@ -1099,34 +1043,6 @@ class FormController extends Controller
if($checktdetailal) if($checktdetailal)
{ {
$checktpal = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $al)
->first();
if ($checktpal)
{
}
else
{
$tpal = new Tproject;
$tpal->staffid = $userId;
$tpal->fk_o_id = $al;
$tpal->fk_tm_id = $fk_tm_id;
$tpal->tp_project_type = 3;
$tpal->tp_year = $year;
$tpal->tp_month = $month;
$tpal->tp_phase = $phase;
$project = Overhead::where('id', $al)
->first();
$tpal->tp_project_name = $project->o_overhead_desc;
$tpal->tp_hours = 8;
$tpal->tp_timesheet_sts = 1;
$tpal->tp_pm = data_get($user,'penyokong');
$tpal->tp_pd = data_get($user,'pelulus');
$tpal->save();
}
} }
else else
{ {
...@@ -1198,34 +1114,6 @@ class FormController extends Controller ...@@ -1198,34 +1114,6 @@ class FormController extends Controller
if($checktdetailhd) if($checktdetailhd)
{ {
$checktpal = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $al)
->first();
if ($checktpal)
{
}
else
{
$tpal = new Tproject;
$tpal->staffid = $userId;
$tpal->fk_o_id = $al;
$tpal->fk_tm_id = $fk_tm_id;
$tpal->tp_project_type = 3;
$tpal->tp_year = $year;
$tpal->tp_month = $month;
$tpal->tp_phase = $phase;
$project = Overhead::where('id', $al)
->first();
$tpal->tp_project_name = $project->o_overhead_desc;
$tpal->tp_hours = 4;
$tpal->tp_timesheet_sts = 1;
$tpal->tp_pm = data_get($user,'penyokong');
$tpal->tp_pd = data_get($user,'pelulus');
$tpal->save();
}
} }
else else
{ {
...@@ -1289,34 +1177,6 @@ class FormController extends Controller ...@@ -1289,34 +1177,6 @@ class FormController extends Controller
if($checktdetailhd) if($checktdetailhd)
{ {
$checktpal = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $al)
->first();
if ($checktpal)
{
}
else
{
$tpal = new Tproject;
$tpal->staffid = $userId;
$tpal->fk_o_id = $al;
$tpal->fk_tm_id = $fk_tm_id;
$tpal->tp_project_type = 3;
$tpal->tp_year = $year;
$tpal->tp_month = $month;
$tpal->tp_phase = $phase;
$project = Overhead::where('id', $al)
->first();
$tpal->tp_project_name = $project->o_overhead_desc;
$tpal->tp_hours = 4;
$tpal->tp_timesheet_sts = 1;
$tpal->tp_pm = data_get($user,'penyokong');
$tpal->tp_pd = data_get($user,'pelulus');
$tpal->save();
}
} }
else else
{ {
...@@ -1388,34 +1248,6 @@ class FormController extends Controller ...@@ -1388,34 +1248,6 @@ class FormController extends Controller
if($checktdetailtr) if($checktdetailtr)
{ {
$checktptr = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $tr)
->first();
if ($checktptr)
{
}
else
{
$tptr = new Tproject;
$tptr->staffid = $userId;
$tptr->fk_o_id = $tr;
$tptr->fk_tm_id = $fk_tm_id;
$tptr->tp_project_type = 3;
$tptr->tp_year = $year;
$tptr->tp_month = $month;
$tptr->tp_phase = $phase;
$project = Overhead::where('id', $tr)
->first();
$tptr->tp_project_name = $project->o_overhead_desc;
$tptr->tp_hours = 8;
$tptr->tp_timesheet_sts = 1;
$tptr->tp_pm = data_get($user,'penyokong');
$tptr->tp_pd = data_get($user,'pelulus');
$tptr->save();
}
} }
else else
{ {
...@@ -1484,34 +1316,6 @@ class FormController extends Controller ...@@ -1484,34 +1316,6 @@ class FormController extends Controller
if($checktdetailph) if($checktdetailph)
{ {
$checktpph = Tproject::where('fk_tm_id', $fk_tm_id)
->where('fk_o_id', $publichol)
->first();
if ($checktpph)
{
}
else
{
$tpph = new Tproject;
$tpph->staffid = $userId;
$tpph->fk_o_id = $publichol;
$tpph->fk_tm_id = $fk_tm_id;
$tpph->tp_project_type = 3;
$tpph->tp_year = $year;
$tpph->tp_month = $month;
$tpph->tp_phase = $phase;
$project = Overhead::where('id', $publichol)
->first();
$tpph->tp_project_name = $project->o_overhead_desc;
$tpph->tp_hours = 8;
$tpph->tp_timesheet_sts = 1;
$tpph->tp_pm = data_get($user,'penyokong');
$tpph->tp_pd = data_get($user,'pelulus');
$tpph->save();
}
} }
else else
{ {
......
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