diff --git a/app/Entities/Payments/PaymentPresenter.php b/app/Entities/Payments/PaymentPresenter.php index c086fe4..25a13d4 100644 --- a/app/Entities/Payments/PaymentPresenter.php +++ b/app/Entities/Payments/PaymentPresenter.php @@ -8,7 +8,7 @@ class PaymentPresenter extends Presenter { public function amount() { - return $this->entity->in_out == 0 ? formatRp(-$this->entity->amount) : formatRp($this->entity->amount); + return $this->entity->in_out == 0 ? format_money(-$this->entity->amount) : format_money($this->entity->amount); } public function projectLink() diff --git a/app/Entities/Projects/Project.php b/app/Entities/Projects/Project.php index 7dfc082..e64abce 100755 --- a/app/Entities/Projects/Project.php +++ b/app/Entities/Projects/Project.php @@ -234,12 +234,12 @@ class Project extends Model return '-'; } - $workDuration = dateDifference($startDate, $endDate); + $workDuration = date_difference($startDate, $endDate); if ((int) $workDuration > 365) { - return dateDifference($startDate, $endDate, '%y Year(s) %m Month(s)'); + return date_difference($startDate, $endDate, '%y Year(s) %m Month(s)'); } elseif ((int) $workDuration > 30) { - return dateDifference($startDate, $endDate, '%m Month(s) %d Day(s)'); + return date_difference($startDate, $endDate, '%m Month(s) %d Day(s)'); } return $workDuration.' Day(s)'; diff --git a/app/Entities/Subscriptions/Subscription.php b/app/Entities/Subscriptions/Subscription.php index 1dff03e..1829921 100755 --- a/app/Entities/Subscriptions/Subscription.php +++ b/app/Entities/Subscriptions/Subscription.php @@ -61,8 +61,8 @@ class Subscription extends Model */ public function dueDateDescription() { - $dueDateDescription = __('subscription.start_date').' : '.dateId($this->start_date)."\n"; - $dueDateDescription .= __('subscription.due_date').' : '.dateId($this->due_date); + $dueDateDescription = __('subscription.start_date').' : '.date_id($this->start_date)."\n"; + $dueDateDescription .= __('subscription.due_date').' : '.date_id($this->due_date); return $dueDateDescription; } diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index df90803..52eed1b 100755 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -45,8 +45,8 @@ class ReportsController extends Controller $month = $req->get('month'); } $reports = $this->repo->getMonthlyReports($year, $month); - $months = \getMonths(); - $years = \getYears(); + $months = \get_months(); + $years = \get_years(); return view('reports.payments.monthly', compact('reports', 'months', 'years', 'month', 'year')); } @@ -56,7 +56,7 @@ class ReportsController extends Controller $year = $req->get('year', date('Y')); $reports = $this->repo->getYearlyReports($year); - $years = \getYears(); + $years = \get_years(); return view('reports.payments.yearly', compact('reports', 'years', 'year')); } diff --git a/app/helpers.php b/app/helpers.php index 3fdf5da..cfe933f 100755 --- a/app/helpers.php +++ b/app/helpers.php @@ -6,17 +6,18 @@ * @param int $number money in integer format * @return string money in string format */ -function formatNo($number) +function format_no($number) { return number_format($number, 0, ',', '.'); } /** * Get number in money currency format. + * * @param int|string $number * @return string */ -function formatRp($number) +function format_money($number) { $moneySign = Option::get('money_sign', 'Rp.'); @@ -25,10 +26,10 @@ function formatRp($number) } if ($number < 0) { - return '- '.$moneySign.' '.formatNo(abs($number)); + return '- '.$moneySign.' '.format_no(abs($number)); } - return $moneySign.' '.formatNo($number); + return $moneySign.' '.format_no($number); } /** @@ -37,41 +38,18 @@ function formatRp($number) * @param int|string $number * @return string */ -function formatDecimal($number) +function format_decimal($number) { return number_format($number, 2, ',', '.'); } /** - * Format date in indonesian format dd-mm-yyyy. - * - * @param string $date - * @return string - */ -function formatDate($date) -{ - if (!$date || $date == '0000-00-00') { - return; - } - - $explodedDate = explode('-', $date); - - if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[0], $explodedDate[2])) { - return $explodedDate[2].'-'.$explodedDate[1].'-'.$explodedDate[0]; - } elseif (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) { - return $explodedDate[2].'-'.$explodedDate[1].'-'.$explodedDate[0]; - } - - throw new App\Exceptions\InvalidDateException('Invalid date format.'); -} - -/** * Get Indonesian date format. * * @param string $date * @return string */ -function dateId($date) +function date_id($date) { if (is_null($date) || $date == '0000-00-00') { return '-'; @@ -80,7 +58,7 @@ function dateId($date) $explodedDate = explode('-', $date); if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) { - $months = getMonths(); + $months = get_months(); return $explodedDate[2].' '.$months[$explodedDate[1]].' '.$explodedDate[0]; } @@ -94,7 +72,7 @@ function dateId($date) * @param int|string $number * @return string */ -function monthNumber($number) +function month_number($number) { return str_pad($number, 2, '0', STR_PAD_LEFT); } @@ -105,14 +83,14 @@ function monthNumber($number) * @param int|string $monthNumber * @return string */ -function monthId($monthNumber) +function month_id($monthNumber) { if (is_null($monthNumber)) { return $monthNumber; } - $months = getMonths(); - $monthNumber = monthNumber($monthNumber); + $months = get_months(); + $monthNumber = month_number($monthNumber); return $months[$monthNumber]; } @@ -122,7 +100,7 @@ function monthId($monthNumber) * * @return array */ -function getMonths() +function get_months() { return [ '01' => __('time.months.01'), @@ -145,7 +123,7 @@ function getMonths() * * @return array */ -function getYears() +function get_years() { $yearRange = range(2014, date('Y')); foreach ($yearRange as $year) { @@ -172,7 +150,7 @@ function str_split_ucwords($string) * @param int $bytes File size. * @return string Converted file size with unit. */ -function formatSizeUnits($bytes) +function format_size_units($bytes) { if ($bytes >= 1073741824) { $bytes = number_format($bytes / 1073741824, 2).' GB'; @@ -217,7 +195,7 @@ function html_link_to_route($name, $title = null, $parameters = [], $attributes * @param string $differenceFormat * @return int|string */ -function dateDifference($date1, $date2, $differenceFormat = '%a') +function date_difference($date1, $date2, $differenceFormat = '%a') { $datetime1 = date_create($date1); $datetime2 = date_create($date2); @@ -233,10 +211,10 @@ function dateDifference($date1, $date2, $differenceFormat = '%a') * @param array $attributes * @return \Illuminate\Support\HtmlString */ -function appLogoImage($attributes = []) +function app_logo_image($attributes = []) { return Html::image( - appLogoPath(), + app_logo_path(), 'Logo '.Option::get('agency_name', 'Laravel'), $attributes ); @@ -247,7 +225,7 @@ function appLogoImage($attributes = []) * * @return string */ -function appLogoPath() +function app_logo_path() { $defaultLogoImagePath = 'default-logo.png'; $optionLogoImagePath = Option::get('agency_logo_path'); @@ -266,7 +244,7 @@ function appLogoPath() * @param string $month * @return array */ -function monthDateArray($year, $month) +function month_date_array($year, $month) { $dateCount = Carbon::parse($year.'-'.$month)->format('t'); $dates = []; diff --git a/resources/views/auth/app-install.blade.php b/resources/views/auth/app-install.blade.php index bce3cb6..7527df9 100644 --- a/resources/views/auth/app-install.blade.php +++ b/resources/views/auth/app-install.blade.php @@ -11,7 +11,7 @@
- {!! appLogoImage(['style' => 'width:150px']) !!} + {!! app_logo_image(['style' => 'width:150px']) !!}

{{ config('app.name') }}

diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index daa20cf..05bf52e 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -5,7 +5,7 @@ @section('content')
- {!! appLogoImage() !!} + {!! app_logo_image() !!}

{{ config('app.name') }}

diff --git a/resources/views/backups/index.blade.php b/resources/views/backups/index.blade.php index 8976fdc..d9efab9 100644 --- a/resources/views/backups/index.blade.php +++ b/resources/views/backups/index.blade.php @@ -24,7 +24,7 @@ {{ $key + 1 }} {{ $backup->getFilename() }} - {{ formatSizeUnits($backup->getSize()) }} + {{ format_size_units($backup->getSize()) }} {{ date('Y-m-d H:i:s', $backup->getMTime()) }} {{ $invoice->created_at->format('Y-m-d') }} {{ $invoice->project->nameLink() }} {{ $invoice->project->customer->nameLink() }} - {{ formatRp($invoice->amount) }} + {{ format_money($invoice->amount) }} {!! html_link_to_route( 'invoices.show', '', [$invoice->number], @@ -49,7 +49,7 @@ {{ trans('app.total') }} - {{ formatRp($invoices->sum('amount')) }} + {{ format_money($invoices->sum('amount')) }} diff --git a/resources/views/customers/payments.blade.php b/resources/views/customers/payments.blade.php index 38364f8..66a584d 100755 --- a/resources/views/customers/payments.blade.php +++ b/resources/views/customers/payments.blade.php @@ -42,7 +42,7 @@ {{ __('app.total') }} - {{ formatRp($payments->sum('amount')) }} + {{ format_money($payments->sum('amount')) }}   diff --git a/resources/views/customers/projects.blade.php b/resources/views/customers/projects.blade.php index c426a79..c7eaa7b 100755 --- a/resources/views/customers/projects.blade.php +++ b/resources/views/customers/projects.blade.php @@ -21,7 +21,7 @@ {{ $project->nameLink() }} {{ $project->start_date }} {{ $project->work_duration }} - {{ formatRp($project->project_value) }} + {{ format_money($project->project_value) }} {{ $project->present()->status }} {!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!} diff --git a/resources/views/customers/subscriptions.blade.php b/resources/views/customers/subscriptions.blade.php index b07c629..96271c9 100755 --- a/resources/views/customers/subscriptions.blade.php +++ b/resources/views/customers/subscriptions.blade.php @@ -24,9 +24,9 @@ {!! $subscription->type_label !!} {{ $subscription->customer->name }} - {{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!} + {{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!} - {{ formatRp($subscription->price) }} + {{ format_money($subscription->price) }} {{ $subscription->vendor->name }} {{ $subscription->status() }} diff --git a/resources/views/invoice-drafts/partials/draft-confirm.blade.php b/resources/views/invoice-drafts/partials/draft-confirm.blade.php index a8fbef3..eaef2f7 100644 --- a/resources/views/invoice-drafts/partials/draft-confirm.blade.php +++ b/resources/views/invoice-drafts/partials/draft-confirm.blade.php @@ -18,7 +18,7 @@ {{ trans('invoice.due_date') }}{{ $draft->dueDate }} {{ trans('invoice.total') }} - {{ formatRp($draft->getTotal()) }} + {{ format_money($draft->getTotal()) }} {{ trans('invoice.notes') }}{{ $draft->notes }} @@ -48,7 +48,7 @@ {{ $key + 1 }} {!! nl2br($item->description) !!} - {{ formatRp($item->amount) }} + {{ format_money($item->amount) }} @empty @endforelse @@ -56,7 +56,7 @@ {{ trans('invoice.total') }} : - {{ formatRp($draft->getTotal()) }} + {{ format_money($draft->getTotal()) }} diff --git a/resources/views/invoice-drafts/partials/draft-item-list.blade.php b/resources/views/invoice-drafts/partials/draft-item-list.blade.php index 65f8217..eadf7f5 100644 --- a/resources/views/invoice-drafts/partials/draft-item-list.blade.php +++ b/resources/views/invoice-drafts/partials/draft-item-list.blade.php @@ -51,7 +51,7 @@ @endforeach {{ trans('invoice.amount') }} : - {{ formatRp($draft->getTotal()) }} + {{ format_money($draft->getTotal()) }}   diff --git a/resources/views/invoices/index.blade.php b/resources/views/invoices/index.blade.php index b6c6f95..7a48368 100755 --- a/resources/views/invoices/index.blade.php +++ b/resources/views/invoices/index.blade.php @@ -34,7 +34,7 @@ {{ $invoice->created_at->format('Y-m-d') }} {{ $invoice->project->nameLink() }} {{ $invoice->project->customer->nameLink() }} - {{ formatRp($invoice->amount) }} + {{ format_money($invoice->amount) }} {!! html_link_to_route( 'invoices.show', '', [$invoice->number], @@ -61,7 +61,7 @@ {{ trans('app.total') }} - {{ formatRp($invoices->sum('amount')) }} + {{ format_money($invoices->sum('amount')) }}   diff --git a/resources/views/invoices/partials/detail.blade.php b/resources/views/invoices/partials/detail.blade.php index eed4668..d613565 100644 --- a/resources/views/invoices/partials/detail.blade.php +++ b/resources/views/invoices/partials/detail.blade.php @@ -7,6 +7,6 @@ {{ trans('invoice.customer') }}{{ $invoice->project->customer->nameLink() }} {{ trans('invoice.items_count') }}{{ $invoice->items_count }} {{ trans('invoice.creator') }}{{ $invoice->creator->name }} - {{ trans('invoice.amount') }}{{ formatRp($invoice->amount) }} + {{ trans('invoice.amount') }}{{ format_money($invoice->amount) }} diff --git a/resources/views/invoices/partials/item-list.blade.php b/resources/views/invoices/partials/item-list.blade.php index 7834873..5f3d09d 100644 --- a/resources/views/invoices/partials/item-list.blade.php +++ b/resources/views/invoices/partials/item-list.blade.php @@ -77,7 +77,7 @@ {{ trans('invoice.amount') }} : - {{ formatRp(collect($invoice->items)->sum('amount')) }} + {{ format_money(collect($invoice->items)->sum('amount')) }} diff --git a/resources/views/invoices/pdf.blade.php b/resources/views/invoices/pdf.blade.php index c830812..a97f9dd 100755 --- a/resources/views/invoices/pdf.blade.php +++ b/resources/views/invoices/pdf.blade.php @@ -39,7 +39,7 @@ - {!! appLogoImage(['style' => 'width:100%']) !!} + {!! app_logo_image(['style' => 'width:100%']) !!}
@@ -61,7 +61,7 @@

{{ __('invoice.invoice') }}

{{ __('invoice.number') }} : INV-{{ $invoice->number }}
-
{{ __('app.date') }} : {{ dateId($invoice->date) }}
+
{{ __('app.date') }} : {{ date_id($invoice->date) }}
@@ -87,7 +87,7 @@ @if ($invoice->due_date)

{{ __('invoice.due_date') }}

-

{{ dateId($invoice->due_date) }}

+

{{ date_id($invoice->due_date) }}

@endif @if ($taxId = Option::get('agency_tax_id'))

{{ __('agency.tax_id') }}

@@ -114,7 +114,7 @@ {{ 1 + $key }} {!! nl2br($item['description']) !!} - {{ formatRp($item['amount']) }} + {{ format_money($item['amount']) }} @php $subtotal += $item['amount']; @@ -123,19 +123,19 @@ @if ($invoice->discount) {{ __('invoice.subtotal') }} : - {{ formatRp($subtotal) }} + {{ format_money($subtotal) }} {{ __('invoice.discount') }} {{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} : - - {{ formatRp($invoice->discount) }} + - {{ format_money($invoice->discount) }} @endif {{ __('app.total') }} - {{ formatRp($invoice->amount) }} + {{ format_money($invoice->amount) }} @@ -176,7 +176,7 @@ {{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} - {{ dateId($invoice->date) }}



+ {{ date_id($invoice->date) }}



{{ Option::get('agency_name') }}
diff --git a/resources/views/invoices/show.blade.php b/resources/views/invoices/show.blade.php index d0737b5..f96b3fc 100644 --- a/resources/views/invoices/show.blade.php +++ b/resources/views/invoices/show.blade.php @@ -39,7 +39,7 @@ {{ $key + 1 }} {!! nl2br($item['description']) !!} - {{ formatRp($item['amount']) }} + {{ format_money($item['amount']) }} @php $subtotal += $item['amount']; @@ -50,19 +50,19 @@ @if ($invoice->discount) {{ __('invoice.subtotal') }} : - {{ formatRp($subtotal) }} + {{ format_money($subtotal) }} {{ __('invoice.discount') }} {{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} : - - {{ formatRp($invoice->discount) }} + - {{ format_money($invoice->discount) }} @endif {{ trans('app.total') }} : - {{ formatRp($invoice->amount) }} + {{ format_money($invoice->amount) }} diff --git a/resources/views/jobs/partials/job-show.blade.php b/resources/views/jobs/partials/job-show.blade.php index 36b993c..8f983a7 100644 --- a/resources/views/jobs/partials/job-show.blade.php +++ b/resources/views/jobs/partials/job-show.blade.php @@ -5,9 +5,9 @@ {{ __('job.name') }}{{ $job->name }} {{ __('job.type') }}{{ $job->type() }} @can('see-pricings', $job) - {{ __('job.price') }}{{ formatRp($job->price) }} + {{ __('job.price') }}{{ format_money($job->price) }} @endcan - {{ __('job.progress') }}{{ formatDecimal($job->progress) }}% + {{ __('job.progress') }}{{ format_decimal($job->progress) }}% {{ __('job.worker') }}{{ $job->worker->name }} {{ __('time.updated_at') }}{{ $job->updated_at }} {{ __('job.description') }}{!! nl2br($job->description) !!} diff --git a/resources/views/jobs/partials/job-tasks.blade.php b/resources/views/jobs/partials/job-tasks.blade.php index ea906d0..20fe1d1 100644 --- a/resources/views/jobs/partials/job-tasks.blade.php +++ b/resources/views/jobs/partials/job-tasks.blade.php @@ -66,7 +66,7 @@ {{ __('app.total') }} - {{ formatDecimal($job->tasks->avg('progress')) }} % + {{ format_decimal($job->tasks->avg('progress')) }} % @if (request('action') == 'sort_tasks') {{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }} diff --git a/resources/views/jobs/unfinished.blade.php b/resources/views/jobs/unfinished.blade.php index 74dfcae..8d31f01 100755 --- a/resources/views/jobs/unfinished.blade.php +++ b/resources/views/jobs/unfinished.blade.php @@ -46,9 +46,9 @@ @endif {{ $job->tasks_count = $job->tasks->count() }} - {{ formatDecimal($job->progress) }} % + {{ format_decimal($job->progress) }} % @can('see-pricings', $job) - {{ formatRp($job->price) }} + {{ format_money($job->price) }} @endcan {{ $job->worker->name }} @@ -63,9 +63,9 @@ {{ __('app.total') }} {{ $jobs->sum('tasks_count') }} - {{ formatDecimal($jobs->avg('progress')) }} % + {{ format_decimal($jobs->avg('progress')) }} % @can('see-pricings', new App\Entities\Projects\Job) - {{ formatRp($jobs->sum('price')) }} + {{ format_money($jobs->sum('price')) }} @endcan diff --git a/resources/views/layouts/partials/sidebar.blade.php b/resources/views/layouts/partials/sidebar.blade.php index c41001c..bd27221 100755 --- a/resources/views/layouts/partials/sidebar.blade.php +++ b/resources/views/layouts/partials/sidebar.blade.php @@ -10,7 +10,7 @@
diff --git a/resources/views/projects/payments.blade.php b/resources/views/projects/payments.blade.php index 923162e..59d61d0 100755 --- a/resources/views/projects/payments.blade.php +++ b/resources/views/projects/payments.blade.php @@ -36,7 +36,7 @@ {{ 1 + $key }} {{ $payment->date }} - {{ formatRp($payment->amount) }} + {{ format_money($payment->amount) }} {{ $payment->partner->name }} {{ $payment->description }} [{{ $payment->type() }}] @@ -53,7 +53,7 @@ {{ trans('app.total') }} - {{ formatRp($payments->sum('amount')) }} + {{ format_money($payments->sum('amount')) }} diff --git a/resources/views/projects/subscriptions.blade.php b/resources/views/projects/subscriptions.blade.php index 021411f..29e1e35 100755 --- a/resources/views/projects/subscriptions.blade.php +++ b/resources/views/projects/subscriptions.blade.php @@ -31,9 +31,9 @@ {{ 1 + $key }} {{ $subscription->type }} {{ $subscription->nameLink() }} - {{ dateId($subscription->start_date) }} - {{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!} - {{ formatRp($subscription->price) }} + {{ date_id($subscription->start_date) }} + {{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!} + {{ format_money($subscription->price) }} {!! link_to_route('subscriptions.show',trans('app.show'),[$subscription->id],['class'=>'btn btn-info btn-xs']) !!} {!! link_to_route('subscriptions.edit',trans('app.edit'),[$subscription->id],['class'=>'btn btn-warning btn-xs']) !!} diff --git a/resources/views/reports/current-credits.blade.php b/resources/views/reports/current-credits.blade.php index b5bf46b..be2e2a9 100644 --- a/resources/views/reports/current-credits.blade.php +++ b/resources/views/reports/current-credits.blade.php @@ -23,9 +23,9 @@ {{ 1 + $key }} {!! link_to_route('projects.payments', $project->name, [$project->id], ['title' => __('project.view_payments'), 'target' => '_blank']) !!} - {{ formatRp($project->project_value) }} - {{ formatRp($project->cashInTotal()) }} - {{ formatRp($project->balance = $project->project_value - $project->cashInTotal()) }} + {{ format_money($project->project_value) }} + {{ format_money($project->cashInTotal()) }} + {{ format_money($project->balance = $project->project_value - $project->cashInTotal()) }} {{ $project->customer->name }} {{ $project->present()->status }} @@ -36,7 +36,7 @@ {{ __('app.total') }} - {{ formatRp($projects->sum('balance')) }} + {{ format_money($projects->sum('balance')) }}   diff --git a/resources/views/reports/log-files.blade.php b/resources/views/reports/log-files.blade.php index a651c9f..16b2c50 100755 --- a/resources/views/reports/log-files.blade.php +++ b/resources/views/reports/log-files.blade.php @@ -1,11 +1,9 @@ @extends('layouts.app') -@section('title','Log Files') +@section('title', 'Log Files') @section('content') - +
@@ -15,35 +13,33 @@ Nama File Ukuran Tanggal Jam - {{ trans('app.action') }} + {{ __('app.action') }} @forelse($logFiles as $key => $logFile) {{ $key + 1 }} {{ $logFile->getFilename() }} - {{ formatSizeUnits($logFile->getSize()) }} + {{ format_size_units($logFile->getSize()) }} {{ date('Y-m-d H:i:s', $logFile->getMTime()) }} - {!! html_link_to_route('log-files.download','',[$logFile->getFilename()],[ + {!! html_link_to_route('log-files.download', '', [$logFile->getFilename()], [ 'class'=>'btn btn-default btn-xs', 'icon' => 'download', - 'id' => 'download-' . $logFile->getFilename(), - 'title' => 'Download file ' . $logFile->getFilename() + 'id' => 'download-'.$logFile->getFilename(), + 'title' => 'Download file '.$logFile->getFilename() ]) !!} - {!! html_link_to_route('log-files.show','',[$logFile->getFilename()],[ + {!! html_link_to_route('log-files.show', '', [$logFile->getFilename()], [ 'class'=>'btn btn-default btn-xs', 'icon' => 'search', - 'id' => 'view-' . $logFile->getFilename(), - 'title' => 'View file ' . $logFile->getFilename(), + 'id' => 'view-'.$logFile->getFilename(), + 'title' => 'View file '.$logFile->getFilename(), 'target' => '_blank', ]) !!} @empty - - Belum ada file logFile - + Belum ada file logFile @endforelse diff --git a/resources/views/reports/payments/daily.blade.php b/resources/views/reports/payments/daily.blade.php index c766457..a277da3 100755 --- a/resources/views/reports/payments/daily.blade.php +++ b/resources/views/reports/payments/daily.blade.php @@ -1,6 +1,6 @@ @extends('layouts.app') -@section('title', __('report.daily', ['date' => dateId($date)])) +@section('title', __('report.daily', ['date' => date_id($date)])) @section('content') @@ -8,7 +8,7 @@ @@ -20,7 +20,7 @@ {{ link_to_route( 'reports.payments.monthly', __('report.view_monthly'), - ['month' => monthNumber($dt->month), 'year' => $dt->year], + ['month' => month_number($dt->month), 'year' => $dt->year], ['class' => 'btn btn-default btn-sm'] ) }} {{ Form::close() }} @@ -67,7 +67,7 @@ {{ __('app.total') }} - {{ formatRp($total) }} + {{ format_money($total) }}   diff --git a/resources/views/reports/payments/monthly.blade.php b/resources/views/reports/payments/monthly.blade.php index 201e907..8c9711c 100755 --- a/resources/views/reports/payments/monthly.blade.php +++ b/resources/views/reports/payments/monthly.blade.php @@ -40,7 +40,7 @@ @php $chartData = []; @endphp - @foreach(monthDateArray($year, $month) as $dateNumber) + @foreach(month_date_array($year, $month) as $dateNumber) @php $any = isset($reports[$dateNumber]); $count = $any ? $reports[$dateNumber]->count : 0; @@ -48,11 +48,11 @@ @endphp @if ($any) - {{ dateId($date = $year.'-'.$month.'-'.$dateNumber) }} + {{ date_id($date = $year.'-'.$month.'-'.$dateNumber) }} {{ $count }} - {{ formatRp($any ? $reports[$dateNumber]->cashin : 0) }} - {{ formatRp($any ? $reports[$dateNumber]->cashout : 0) }} - {{ formatRp($profit) }} + {{ format_money($any ? $reports[$dateNumber]->cashin : 0) }} + {{ format_money($any ? $reports[$dateNumber]->cashout : 0) }} + {{ format_money($profit) }} {{ link_to_route( 'reports.payments.daily', @@ -60,7 +60,7 @@ ['date' => $date], [ 'class' => 'btn btn-info btn-xs', - 'title' => __('report.daily', ['date' => dateId($date)]), + 'title' => __('report.daily', ['date' => date_id($date)]), ] ) }} @@ -75,9 +75,9 @@ {{ __('app.total') }} {{ $reports->sum('count') }} - {{ formatRp($reports->sum('cashin')) }} - {{ formatRp($reports->sum('cashout')) }} - {{ formatRp($reports->sum('profit')) }} + {{ format_money($reports->sum('cashin')) }} + {{ format_money($reports->sum('cashout')) }} + {{ format_money($reports->sum('profit')) }}   diff --git a/resources/views/reports/payments/yearly.blade.php b/resources/views/reports/payments/yearly.blade.php index 2728cc9..ca28dd9 100755 --- a/resources/views/reports/payments/yearly.blade.php +++ b/resources/views/reports/payments/yearly.blade.php @@ -37,16 +37,16 @@ @php $chartData = []; @endphp - @foreach(getMonths() as $monthNumber => $monthName) + @foreach(get_months() as $monthNumber => $monthName) @php $any = isset($reports[$monthNumber]); @endphp - {{ monthId($monthNumber) }} + {{ month_id($monthNumber) }} {{ $any ? $reports[$monthNumber]->count : 0 }} - {{ formatRp($any ? $reports[$monthNumber]->cashin : 0) }} - {{ formatRp($any ? $reports[$monthNumber]->cashout : 0) }} - {{ formatRp($profit = $any ? $reports[$monthNumber]->profit : 0) }} + {{ format_money($any ? $reports[$monthNumber]->cashin : 0) }} + {{ format_money($any ? $reports[$monthNumber]->cashout : 0) }} + {{ format_money($profit = $any ? $reports[$monthNumber]->profit : 0) }} {{ link_to_route( 'reports.payments.monthly', @@ -54,14 +54,14 @@ ['month' => $monthNumber, 'year' => $year], [ 'class' => 'btn btn-info btn-xs', - 'title' => __('report.monthly', ['year_month' => monthId($monthNumber)]), - 'title' => __('report.monthly', ['year_month' => monthId($monthNumber).' '.$year]), + 'title' => __('report.monthly', ['year_month' => month_id($monthNumber)]), + 'title' => __('report.monthly', ['year_month' => month_id($monthNumber).' '.$year]), ] ) }} @php - $chartData[] = ['month' => monthId($monthNumber), 'value' => $profit]; + $chartData[] = ['month' => month_id($monthNumber), 'value' => $profit]; @endphp @endforeach @@ -69,9 +69,9 @@ {{ trans('app.total') }} {{ $reports->sum('count') }} - {{ formatRp($reports->sum('cashin')) }} - {{ formatRp($reports->sum('cashout')) }} - {{ formatRp($reports->sum('profit')) }} + {{ format_money($reports->sum('cashin')) }} + {{ format_money($reports->sum('cashout')) }} + {{ format_money($reports->sum('profit')) }}   diff --git a/resources/views/subscriptions/index.blade.php b/resources/views/subscriptions/index.blade.php index e93be92..2d0fdda 100755 --- a/resources/views/subscriptions/index.blade.php +++ b/resources/views/subscriptions/index.blade.php @@ -34,9 +34,9 @@ {!! $subscription->type_label !!} {{ $subscription->customer->name }} - {{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!} + {{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!} - {{ formatRp($subscription->price) }} + {{ format_money($subscription->price) }} {{ $subscription->vendor->name }} {{ $subscription->status() }} diff --git a/resources/views/subscriptions/partials/subscription-show.blade.php b/resources/views/subscriptions/partials/subscription-show.blade.php index 8234b9c..7d4f422 100644 --- a/resources/views/subscriptions/partials/subscription-show.blade.php +++ b/resources/views/subscriptions/partials/subscription-show.blade.php @@ -1,10 +1,10 @@ - + - - + + diff --git a/resources/views/users/agency/edit.blade.php b/resources/views/users/agency/edit.blade.php index 5b430b2..77bbdd1 100644 --- a/resources/views/users/agency/edit.blade.php +++ b/resources/views/users/agency/edit.blade.php @@ -31,7 +31,7 @@
{{ Form::open(['route' => 'users.agency.logo-upload', 'method' => 'patch', 'files' => true]) }} {{ __('agency.logo') }} -

{!! appLogoImage(['style' => 'margin:20px auto']) !!}

+

{!! app_logo_image(['style' => 'margin:20px auto']) !!}

{!! FormField::file('logo', [ 'label' => __('agency.logo_change'), 'info' => ['text' => __('agency.logo_upload_info'), 'class' => 'warning'], diff --git a/resources/views/users/agency/show.blade.php b/resources/views/users/agency/show.blade.php index 9507913..b74473a 100644 --- a/resources/views/users/agency/show.blade.php +++ b/resources/views/users/agency/show.blade.php @@ -6,7 +6,7 @@
-

{!! appLogoImage() !!}

+

{!! app_logo_image() !!}

{{ Option::get('agency_name') }}

{{ Option::get('agency_tagline') }}

diff --git a/resources/views/users/jobs.blade.php b/resources/views/users/jobs.blade.php index 6a2f113..682875d 100755 --- a/resources/views/users/jobs.blade.php +++ b/resources/views/users/jobs.blade.php @@ -33,8 +33,8 @@ @endif
- - + + - + - + @endforeach @@ -52,7 +52,7 @@ - + diff --git a/tests/Feature/Invoices/InvoiceEntryTest.php b/tests/Feature/Invoices/InvoiceEntryTest.php index b635e7b..0401c98 100644 --- a/tests/Feature/Invoices/InvoiceEntryTest.php +++ b/tests/Feature/Invoices/InvoiceEntryTest.php @@ -87,7 +87,7 @@ class InvoiceEntryTest extends TestCase $this->seePageIs(route('invoice-drafts.show', $draft->draftKey)); $this->assertEquals(5000, $draft->getTotal()); - $this->see(formatRp(5000)); + $this->see(format_money(5000)); } /** @test */ @@ -137,7 +137,7 @@ class InvoiceEntryTest extends TestCase $this->assertEquals(200, $draft->getTotal()); - $this->see(formatRp($draft->getTotal())); + $this->see(format_money($draft->getTotal())); } /** @test */ @@ -174,7 +174,7 @@ class InvoiceEntryTest extends TestCase $this->see($project->name); $this->see($project->customer->name); $this->see($draft->notes); - $this->see(formatRp(3000)); + $this->see(format_money(3000)); $this->seeElement('input', ['id' => 'save-invoice-draft']); } diff --git a/tests/Feature/ManageJobsTest.php b/tests/Feature/ManageJobsTest.php index c9972d9..a5aa6e2 100644 --- a/tests/Feature/ManageJobsTest.php +++ b/tests/Feature/ManageJobsTest.php @@ -142,7 +142,7 @@ class ManageJobsTest extends TestCase $this->seePageIs(route('jobs.show', $project->id)); $this->see(trans('job.detail')); $this->see($job->name); - $this->see(formatRp($job->price)); + $this->see(format_money($job->price)); $this->see($job->worker->name); } diff --git a/tests/Feature/ManageSubscriptionsTest.php b/tests/Feature/ManageSubscriptionsTest.php index 96e4683..8046f58 100644 --- a/tests/Feature/ManageSubscriptionsTest.php +++ b/tests/Feature/ManageSubscriptionsTest.php @@ -111,8 +111,8 @@ class ManageSubscriptionsTest extends TestCase $this->visit(route('subscriptions.show', $subscription->id)); $this->see($subscription->name); - $this->see(formatRp($subscription->price)); - $this->see(dateId($subscription->start_date)); - $this->see(dateId($subscription->due_date)); + $this->see(format_money($subscription->price)); + $this->see(date_id($subscription->start_date)); + $this->see(date_id($subscription->due_date)); } } diff --git a/tests/Feature/Payments/ManagePaymentsTest.php b/tests/Feature/Payments/ManagePaymentsTest.php index 9d0133b..8f2cbdc 100644 --- a/tests/Feature/Payments/ManagePaymentsTest.php +++ b/tests/Feature/Payments/ManagePaymentsTest.php @@ -216,7 +216,7 @@ class ManagePaymentsTest extends TestCase $this->seePageIs(route('payments.show', $payment->id)); $this->see(trans('payment.detail')); $this->see($payment->date); - $this->see(formatRp($payment->amount)); + $this->see(format_money($payment->amount)); $this->see($payment->description); $this->see($payment->partner->name); } diff --git a/tests/Unit/Helpers/AppLogoImageTest.php b/tests/Unit/Helpers/AppLogoImageTest.php index 14d508e..c78543f 100644 --- a/tests/Unit/Helpers/AppLogoImageTest.php +++ b/tests/Unit/Helpers/AppLogoImageTest.php @@ -17,13 +17,13 @@ class AppLogoImageTest extends TestCase 'value' => 'icon_user_1.png', ]); - $this->assertEquals(asset('assets/imgs/icon_user_1.png'), appLogoPath()); + $this->assertEquals(asset('assets/imgs/icon_user_1.png'), app_logo_path()); } /** @test */ public function app_logo_path_function_returns_default_logo_image_path_if_no_image_logo_path_setting() { - $this->assertEquals(asset('assets/imgs/default-logo.png'), appLogoPath()); + $this->assertEquals(asset('assets/imgs/default-logo.png'), app_logo_path()); } /** @test */ @@ -33,7 +33,7 @@ class AppLogoImageTest extends TestCase $logoString .= ' src="'.asset('assets/imgs/default-logo.png').'"'; $logoString .= ' alt="Logo Laravel">'; - $this->assertEquals($logoString, appLogoImage()); + $this->assertEquals($logoString, app_logo_image()); } /** @test */ @@ -48,7 +48,7 @@ class AppLogoImageTest extends TestCase $logoString .= ' src="'.asset('assets/imgs/icon_user_1.png').'"'; $logoString .= ' alt="Logo Laravel">'; - $this->assertEquals($logoString, appLogoImage()); + $this->assertEquals($logoString, app_logo_image()); } /** @test */ @@ -69,7 +69,7 @@ class AppLogoImageTest extends TestCase 'class' => '123', 'style' => 'display: inline', ]; - $this->assertEquals($logoString, appLogoImage($overrides)); + $this->assertEquals($logoString, app_logo_image($overrides)); } /** @test */ @@ -84,6 +84,6 @@ class AppLogoImageTest extends TestCase $logoString .= ' src="'.asset('assets/imgs/default-logo.png').'"'; $logoString .= ' alt="Logo Laravel">'; - $this->assertEquals($logoString, appLogoImage()); + $this->assertEquals($logoString, app_logo_image()); } } diff --git a/tests/Unit/Helpers/DateDifferenceTest.php b/tests/Unit/Helpers/DateDifferenceTest.php index 6984536..3a9625e 100644 --- a/tests/Unit/Helpers/DateDifferenceTest.php +++ b/tests/Unit/Helpers/DateDifferenceTest.php @@ -14,31 +14,31 @@ class DateDifferenceTest extends TestCase /** @test */ public function date_difference_function_exists() { - $this->assertTrue(function_exists('dateDifference')); + $this->assertTrue(function_exists('date_difference')); } /** @test */ public function date_difference_returns_days_count_by_default() { - $this->assertEquals(9, dateDifference('2018-04-01', '2018-04-10')); + $this->assertEquals(9, date_difference('2018-04-01', '2018-04-10')); } /** @test */ public function date_difference_can_returns_formatted_string() { - $this->assertEquals('9 days', dateDifference('2018-04-01', '2018-04-10', '%a days')); + $this->assertEquals('9 days', date_difference('2018-04-01', '2018-04-10', '%a days')); } /** @test */ public function date_difference_returns_proper_months_and_days_format() { // TODO: Need to fix, this should returns 1 months 9 days - $this->assertEquals('1 month 12 days', dateDifference('2018-03-01', '2018-04-10', '%m month %d days')); + $this->assertEquals('1 month 12 days', date_difference('2018-03-01', '2018-04-10', '%m month %d days')); } /** @test */ public function date_difference_returns_proper_years_months_and_days_format() { - $this->assertEquals('1 year 1 month 12 days', dateDifference('2017-03-01', '2018-04-10', '%y year %m month %d days')); + $this->assertEquals('1 year 1 month 12 days', date_difference('2017-03-01', '2018-04-10', '%y year %m month %d days')); } } diff --git a/tests/Unit/Helpers/MoneyFormatTest.php b/tests/Unit/Helpers/MoneyFormatTest.php index fc0384c..483d96c 100644 --- a/tests/Unit/Helpers/MoneyFormatTest.php +++ b/tests/Unit/Helpers/MoneyFormatTest.php @@ -17,9 +17,9 @@ class MoneyFormatTest extends TestCase /** @test */ public function format_money_returns_string_with_default_money_sign() { - $this->assertEquals('Rp. 1.000', formatRp(1000)); - $this->assertEquals('Rp. 0', formatRp(0)); - $this->assertEquals('- Rp. 1.000', formatRp(-1000)); + $this->assertEquals('Rp. 1.000', format_money(1000)); + $this->assertEquals('Rp. 0', format_money(0)); + $this->assertEquals('- Rp. 1.000', format_money(-1000)); } /** @test */ @@ -30,8 +30,8 @@ class MoneyFormatTest extends TestCase 'value' => 'USD', ]); - $this->assertEquals('USD 1.000', formatRp(1000)); - $this->assertEquals('USD 0', formatRp(0)); - $this->assertEquals('- USD 1.000', formatRp(-1000)); + $this->assertEquals('USD 1.000', format_money(1000)); + $this->assertEquals('USD 0', format_money(0)); + $this->assertEquals('- USD 1.000', format_money(-1000)); } } diff --git a/tests/Unit/Models/SubscriptionTest.php b/tests/Unit/Models/SubscriptionTest.php index af0f041..3d2c17a 100644 --- a/tests/Unit/Models/SubscriptionTest.php +++ b/tests/Unit/Models/SubscriptionTest.php @@ -3,7 +3,7 @@ namespace Tests\Unit\Models; use Carbon\Carbon; -use Tests\TestCase as TestCase; +use Tests\TestCase; use App\Entities\Partners\Vendor; use App\Entities\Projects\Project; use App\Entities\Partners\Customer; @@ -69,8 +69,8 @@ class SubscriptionTest extends TestCase $next3Months = Carbon::now()->addMonths(2)->format('Y-m-d'); $subscription = factory(Subscription::class)->make(['due_date' => $next3Months]); - $dueDateDescription = trans('subscription.start_date').' : '.dateId($subscription->start_date)."\n"; - $dueDateDescription .= trans('subscription.due_date').' : '.dateId($subscription->due_date); + $dueDateDescription = trans('subscription.start_date').' : '.date_id($subscription->start_date)."\n"; + $dueDateDescription .= trans('subscription.due_date').' : '.date_id($subscription->due_date); $this->assertEquals($dueDateDescription, $subscription->dueDateDescription()); }
{{ trans('subscription.name') }}{{ $subscription->name }}
{{ trans('subscription.price') }}{{ formatRp($subscription->price) }}
{{ trans('subscription.price') }}{{ format_money($subscription->price) }}
{{ trans('subscription.type') }}{{ $subscription->type }}
{{ trans('subscription.start_date') }}{{ dateId($subscription->start_date) }}
{{ trans('subscription.due_date') }}{{ dateId($subscription->due_date) }}
{{ trans('subscription.start_date') }}{{ date_id($subscription->start_date) }}
{{ trans('subscription.due_date') }}{{ date_id($subscription->due_date) }}
{{ trans('subscription.customer') }}{{ $subscription->customer->nameLink() }}
{{ trans('subscription.project') }}{{ $job->tasks_count = $job->tasks->count() }}{{ formatDecimal($job->progress = $job->progress) }} %{{ formatRp($job->price) }}{{ format_decimal($job->progress = $job->progress) }} %{{ format_money($job->price) }} {!! html_link_to_route('jobs.show', '', [$job], [ 'icon' => 'search', diff --git a/resources/views/users/projects.blade.php b/resources/views/users/projects.blade.php index 34e1075..9c625d2 100755 --- a/resources/views/users/projects.blade.php +++ b/resources/views/users/projects.blade.php @@ -30,7 +30,7 @@ {{ $project->nameLink() }} {{ $project->start_date }} {{ $project->work_duration }}{{ formatRp($project->project_value) }}{{ format_money($project->project_value) }} {{ $project->present()->status }} {{ $project->customer->name }} diff --git a/resources/views/vendors/show.blade.php b/resources/views/vendors/show.blade.php index 953dc32..1f0db62 100755 --- a/resources/views/vendors/show.blade.php +++ b/resources/views/vendors/show.blade.php @@ -44,7 +44,7 @@ {{ 1 + $key }} {{ $payment->project->name }} {{ $payment->date }}{{ formatRp($payment->amount) }}{{ format_money($payment->amount) }} {{ $payment->description }}
{{ __('app.total') }}{{ formatRp($vendor->payments->sum('amount')) }}{{ format_money($vendor->payments->sum('amount')) }}