Commit 9aefbe50 by Azhan Hannan

changes, reset decimal scale to 2

parent 2a6c87d6
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeColumnTypeInTimesheetDtlTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_dtl', function (Blueprint $table) {
$table->decimal('td_hours', 10, 1)->unsigned()->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_dtl', function (Blueprint $table) {
//
});
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeColumnTypeInTimesheetMasterTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_master', function (Blueprint $table) {
$table->decimal('tm_chargeable_hrs', 10, 1)->unsigned()->nullable()->change();
$table->decimal('tm_chargeable_days', 10, 1)->unsigned()->nullable()->change();
$table->decimal('tm_overhead_hrs', 10, 1)->unsigned()->nullable()->change();
$table->decimal('tm_overhead_days', 10, 1)->unsigned()->nullable()->change();
$table->decimal('tm_overtime_hrs', 10, 1)->unsigned()->nullable()->change();
$table->decimal('tm_total_hours', 10, 1)->unsigned()->nullable()->change();
$table->decimal('tm_total_days', 10, 1)->unsigned()->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_master', function (Blueprint $table) {
//
});
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeColumnTypeInTimesheetPrjTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
$table->decimal('tp_hours', 10, 1)->unsigned()->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_prj', function (Blueprint $table) {
//
});
}
}
...@@ -115,7 +115,9 @@ input[type=number] { ...@@ -115,7 +115,9 @@ input[type=number] {
} }
?> ?>
<td > <td >
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@endfor @endfor
...@@ -201,7 +203,6 @@ input[type=number] { ...@@ -201,7 +203,6 @@ input[type=number] {
console.log(isNaN(value)); console.log(isNaN(value));
if(isNaN(value)){ if(isNaN(value)){
// this.value = '';
value = 0; value = 0;
} }
...@@ -211,6 +212,7 @@ input[type=number] { ...@@ -211,6 +212,7 @@ input[type=number] {
} }
} }
} }
console.log("currenttotal --> " + currenttotal); console.log("currenttotal --> " + currenttotal);
......
...@@ -242,7 +242,14 @@ class FormController extends Controller ...@@ -242,7 +242,14 @@ class FormController extends Controller
if($valuehour == 0) if($valuehour == 0)
{ {
if($checkTimesheetDetail)
{
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->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