Permalink
Browse files

Change formatDecimal() to format_decimal()

  • Loading branch information...
nafiesl committed Dec 23, 2018
1 parent a22146b commit 1380bc523cef0e250914e0821da211f276104e1e
@@ -37,7 +37,7 @@ function formatRp($number)
* @param int|string $number
* @return string
*/
function formatDecimal($number)
function format_decimal($number)
{
return number_format($number, 2, ',', '.');
}
@@ -7,7 +7,7 @@
@can('see-pricings', $job)
<tr><th>{{ __('job.price') }}</th><td>{{ formatRp($job->price) }}</td></tr>
@endcan
<tr><th>{{ __('job.progress') }}</th><td>{{ formatDecimal($job->progress) }}%</td></tr>
<tr><th>{{ __('job.progress') }}</th><td>{{ format_decimal($job->progress) }}%</td></tr>
<tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>
<tr><th>{{ __('time.updated_at') }}</th><td>{{ $job->updated_at }}</td></tr>
<tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr>
@@ -66,7 +66,7 @@
<tfoot>
<tr>
<th class="text-right" colspan="2">{{ __('app.total') }}</th>
<th class="text-center">{{ formatDecimal($job->tasks->avg('progress')) }} %</th>
<th class="text-center">{{ format_decimal($job->tasks->avg('progress')) }} %</th>
<th>
@if (request('action') == 'sort_tasks')
{{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }}
@@ -46,7 +46,7 @@
@endif
</td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ formatDecimal($job->progress) }} %</td>
<td class="text-center">{{ format_decimal($job->progress) }} %</td>
@can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
@endcan
@@ -63,7 +63,7 @@
<tr>
<th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-center">{{ $jobs->sum('tasks_count') }}</th>
<th class="text-center">{{ formatDecimal($jobs->avg('progress')) }} %</th>
<th class="text-center">{{ format_decimal($jobs->avg('progress')) }} %</th>
@can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
@endcan
@@ -44,7 +44,7 @@
<td class="text-center">{{ $project->start_date }}</td>
<td class="text-right">{{ $project->work_duration }}</td>
@if (request('status_id') == 2)
<td class="text-right">{{ formatDecimal($project->getJobOveralProgress()) }} %</td>
<td class="text-right">{{ format_decimal($project->getJobOveralProgress()) }} %</td>
<td class="text-center">{{ $project->due_date }}</td>
@endif
@can('see-pricings', new App\Entities\Projects\Project)
@@ -82,7 +82,7 @@
@endif
</td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ formatDecimal($job->progress) }} %</td>
<td class="text-center">{{ format_decimal($job->progress) }} %</td>
@can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
@endcan
@@ -108,8 +108,8 @@
<th class="text-right" colspan="2">Total</th>
<th class="text-center">{{ $groupedJobs->sum('tasks_count') }}</th>
<th class="text-center">
<span title="Total Progress">{{ formatDecimal($groupedJobs->sum('progress') / $groupedJobs->count()) }} %</span>
<span title="Overal Progress" style="font-weight:300">({{ formatDecimal($project->getJobOveralProgress()) }} %)</span>
<span title="Total Progress">{{ format_decimal($groupedJobs->sum('progress') / $groupedJobs->count()) }} %</span>
<span title="Overal Progress" style="font-weight:300">({{ format_decimal($project->getJobOveralProgress()) }} %)</span>
</th>
@can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($groupedJobs->sum('price')) }}</th>
@@ -31,7 +31,7 @@
<td class="text-center">{{ 1 + $key }}</td>
<td>{{ $job->name }}</td>
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ formatDecimal($job->progress) }} %</td>
<td class="text-right">{{ format_decimal($job->progress) }} %</td>
<td class="text-right">{{ formatRp($job->receiveable_earning) }}</td>
</tr>
@endforeach
@@ -40,7 +40,7 @@
<tr>
<th class="text-right" colspan="2">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ formatDecimal($project->getJobOveralProgress()) }} %</th>
<th class="text-right">{{ format_decimal($project->getJobOveralProgress()) }} %</th>
<th class="text-right">{{ formatRp($jobs->sum('receiveable_earning')) }}</th>
</tr>
</tfoot>
@@ -6,7 +6,7 @@
<div class="row">
<div class="col-xs-3"><i class="fa fa-tasks fa-4x"></i></div>
<div class="col-xs-9 text-right">
<div class="huge" style="font-size: 38px;">{{ formatDecimal($project->getJobOveralProgress()) }} %</div>
<div class="huge" style="font-size: 38px;">{{ format_decimal($project->getJobOveralProgress()) }} %</div>
<div class="lead">{{ __('project.overall_progress') }}</div>
</div>
</div>
@@ -33,7 +33,7 @@
@endif
</td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ formatDecimal($job->progress = $job->progress) }} %</td>
<td class="text-center">{{ format_decimal($job->progress = $job->progress) }} %</td>
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-center">
{!! html_link_to_route('jobs.show', '', [$job], [

0 comments on commit 1380bc5

Please sign in to comment.