Browse Source

Merge branch 'helper-naming-convetions'

pull/32/head
Nafies Luthfi 7 years ago
parent
commit
f8cb57c144
  1. 2
      app/Entities/Payments/PaymentPresenter.php
  2. 6
      app/Entities/Projects/Project.php
  3. 4
      app/Entities/Subscriptions/Subscription.php
  4. 6
      app/Http/Controllers/ReportsController.php
  5. 62
      app/helpers.php
  6. 2
      resources/views/auth/app-install.blade.php
  7. 2
      resources/views/auth/login.blade.php
  8. 2
      resources/views/backups/index.blade.php
  9. 4
      resources/views/customers/invoices.blade.php
  10. 2
      resources/views/customers/payments.blade.php
  11. 2
      resources/views/customers/projects.blade.php
  12. 4
      resources/views/customers/subscriptions.blade.php
  13. 6
      resources/views/invoice-drafts/partials/draft-confirm.blade.php
  14. 2
      resources/views/invoice-drafts/partials/draft-item-list.blade.php
  15. 4
      resources/views/invoices/index.blade.php
  16. 2
      resources/views/invoices/partials/detail.blade.php
  17. 2
      resources/views/invoices/partials/item-list.blade.php
  18. 16
      resources/views/invoices/pdf.blade.php
  19. 8
      resources/views/invoices/show.blade.php
  20. 4
      resources/views/jobs/partials/job-show.blade.php
  21. 2
      resources/views/jobs/partials/job-tasks.blade.php
  22. 8
      resources/views/jobs/unfinished.blade.php
  23. 2
      resources/views/layouts/partials/sidebar.blade.php
  24. 2
      resources/views/options/page-1.blade.php
  25. 6
      resources/views/pages/home.blade.php
  26. 6
      resources/views/payments/pdf.blade.php
  27. 46
      resources/views/projects/files.blade.php
  28. 4
      resources/views/projects/index.blade.php
  29. 4
      resources/views/projects/invoices.blade.php
  30. 4
      resources/views/projects/jobs/export-html.blade.php
  31. 10
      resources/views/projects/jobs/index.blade.php
  32. 12
      resources/views/projects/jobs/progress-export-html.blade.php
  33. 16
      resources/views/projects/partials/payment-summary.blade.php
  34. 12
      resources/views/projects/partials/project-show.blade.php
  35. 4
      resources/views/projects/partials/project-stats.blade.php
  36. 4
      resources/views/projects/payments.blade.php
  37. 6
      resources/views/projects/subscriptions.blade.php
  38. 8
      resources/views/reports/current-credits.blade.php
  39. 26
      resources/views/reports/log-files.blade.php
  40. 8
      resources/views/reports/payments/daily.blade.php
  41. 18
      resources/views/reports/payments/monthly.blade.php
  42. 22
      resources/views/reports/payments/yearly.blade.php
  43. 4
      resources/views/subscriptions/index.blade.php
  44. 6
      resources/views/subscriptions/partials/subscription-show.blade.php
  45. 2
      resources/views/users/agency/edit.blade.php
  46. 2
      resources/views/users/agency/show.blade.php
  47. 4
      resources/views/users/jobs.blade.php
  48. 2
      resources/views/users/projects.blade.php
  49. 4
      resources/views/vendors/show.blade.php
  50. 6
      tests/Feature/Invoices/InvoiceEntryTest.php
  51. 2
      tests/Feature/ManageJobsTest.php
  52. 6
      tests/Feature/ManageSubscriptionsTest.php
  53. 2
      tests/Feature/Payments/ManagePaymentsTest.php
  54. 12
      tests/Unit/Helpers/AppLogoImageTest.php
  55. 10
      tests/Unit/Helpers/DateDifferenceTest.php
  56. 12
      tests/Unit/Helpers/MoneyFormatTest.php
  57. 6
      tests/Unit/Models/SubscriptionTest.php

2
app/Entities/Payments/PaymentPresenter.php

@ -8,7 +8,7 @@ class PaymentPresenter extends Presenter
{ {
public function amount() 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() public function projectLink()

6
app/Entities/Projects/Project.php

@ -234,12 +234,12 @@ class Project extends Model
return '-'; return '-';
} }
$workDuration = dateDifference($startDate, $endDate);
$workDuration = date_difference($startDate, $endDate);
if ((int) $workDuration > 365) { 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) { } 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)'; return $workDuration.' Day(s)';

4
app/Entities/Subscriptions/Subscription.php

@ -61,8 +61,8 @@ class Subscription extends Model
*/ */
public function dueDateDescription() 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; return $dueDateDescription;
} }

6
app/Http/Controllers/ReportsController.php

@ -45,8 +45,8 @@ class ReportsController extends Controller
$month = $req->get('month'); $month = $req->get('month');
} }
$reports = $this->repo->getMonthlyReports($year, $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')); 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')); $year = $req->get('year', date('Y'));
$reports = $this->repo->getYearlyReports($year); $reports = $this->repo->getYearlyReports($year);
$years = \getYears();
$years = \get_years();
return view('reports.payments.yearly', compact('reports', 'years', 'year')); return view('reports.payments.yearly', compact('reports', 'years', 'year'));
} }

62
app/helpers.php

@ -6,17 +6,18 @@
* @param int $number money in integer format * @param int $number money in integer format
* @return string money in string format * @return string money in string format
*/ */
function formatNo($number)
function format_no($number)
{ {
return number_format($number, 0, ',', '.'); return number_format($number, 0, ',', '.');
} }
/** /**
* Get number in money currency format. * Get number in money currency format.
*
* @param int|string $number * @param int|string $number
* @return string * @return string
*/ */
function formatRp($number)
function format_money($number)
{ {
$moneySign = Option::get('money_sign', 'Rp.'); $moneySign = Option::get('money_sign', 'Rp.');
@ -25,10 +26,10 @@ function formatRp($number)
} }
if ($number < 0) { 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 * @param int|string $number
* @return string * @return string
*/ */
function formatDecimal($number)
function format_decimal($number)
{ {
return number_format($number, 2, ',', '.'); 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. * Get Indonesian date format.
* *
* @param string $date * @param string $date
* @return string * @return string
*/ */
function dateId($date)
function date_id($date)
{ {
if (is_null($date) || $date == '0000-00-00') { if (is_null($date) || $date == '0000-00-00') {
return '-'; return '-';
@ -80,7 +58,7 @@ function dateId($date)
$explodedDate = explode('-', $date); $explodedDate = explode('-', $date);
if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) { if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) {
$months = getMonths();
$months = get_months();
return $explodedDate[2].' '.$months[$explodedDate[1]].' '.$explodedDate[0]; return $explodedDate[2].' '.$months[$explodedDate[1]].' '.$explodedDate[0];
} }
@ -94,7 +72,7 @@ function dateId($date)
* @param int|string $number * @param int|string $number
* @return string * @return string
*/ */
function monthNumber($number)
function month_number($number)
{ {
return str_pad($number, 2, '0', STR_PAD_LEFT); return str_pad($number, 2, '0', STR_PAD_LEFT);
} }
@ -105,14 +83,14 @@ function monthNumber($number)
* @param int|string $monthNumber * @param int|string $monthNumber
* @return string * @return string
*/ */
function monthId($monthNumber)
function month_id($monthNumber)
{ {
if (is_null($monthNumber)) { if (is_null($monthNumber)) {
return $monthNumber; return $monthNumber;
} }
$months = getMonths();
$monthNumber = monthNumber($monthNumber);
$months = get_months();
$monthNumber = month_number($monthNumber);
return $months[$monthNumber]; return $months[$monthNumber];
} }
@ -122,7 +100,7 @@ function monthId($monthNumber)
* *
* @return array * @return array
*/ */
function getMonths()
function get_months()
{ {
return [ return [
'01' => __('time.months.01'), '01' => __('time.months.01'),
@ -145,7 +123,7 @@ function getMonths()
* *
* @return array * @return array
*/ */
function getYears()
function get_years()
{ {
$yearRange = range(2014, date('Y')); $yearRange = range(2014, date('Y'));
foreach ($yearRange as $year) { foreach ($yearRange as $year) {
@ -172,7 +150,7 @@ function str_split_ucwords($string)
* @param int $bytes File size. * @param int $bytes File size.
* @return string Converted file size with unit. * @return string Converted file size with unit.
*/ */
function formatSizeUnits($bytes)
function format_size_units($bytes)
{ {
if ($bytes >= 1073741824) { if ($bytes >= 1073741824) {
$bytes = number_format($bytes / 1073741824, 2).' GB'; $bytes = number_format($bytes / 1073741824, 2).' GB';
@ -217,7 +195,7 @@ function html_link_to_route($name, $title = null, $parameters = [], $attributes
* @param string $differenceFormat * @param string $differenceFormat
* @return int|string * @return int|string
*/ */
function dateDifference($date1, $date2, $differenceFormat = '%a')
function date_difference($date1, $date2, $differenceFormat = '%a')
{ {
$datetime1 = date_create($date1); $datetime1 = date_create($date1);
$datetime2 = date_create($date2); $datetime2 = date_create($date2);
@ -233,10 +211,10 @@ function dateDifference($date1, $date2, $differenceFormat = '%a')
* @param array $attributes * @param array $attributes
* @return \Illuminate\Support\HtmlString * @return \Illuminate\Support\HtmlString
*/ */
function appLogoImage($attributes = [])
function app_logo_image($attributes = [])
{ {
return Html::image( return Html::image(
appLogoPath(),
app_logo_path(),
'Logo '.Option::get('agency_name', 'Laravel'), 'Logo '.Option::get('agency_name', 'Laravel'),
$attributes $attributes
); );
@ -247,7 +225,7 @@ function appLogoImage($attributes = [])
* *
* @return string * @return string
*/ */
function appLogoPath()
function app_logo_path()
{ {
$defaultLogoImagePath = 'default-logo.png'; $defaultLogoImagePath = 'default-logo.png';
$optionLogoImagePath = Option::get('agency_logo_path'); $optionLogoImagePath = Option::get('agency_logo_path');
@ -266,7 +244,7 @@ function appLogoPath()
* @param string $month * @param string $month
* @return array * @return array
*/ */
function monthDateArray($year, $month)
function month_date_array($year, $month)
{ {
$dateCount = Carbon::parse($year.'-'.$month)->format('t'); $dateCount = Carbon::parse($year.'-'.$month)->format('t');
$dates = []; $dates = [];

2
resources/views/auth/app-install.blade.php

@ -11,7 +11,7 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="text-center"> <div class="text-center">
{!! appLogoImage(['style' => 'width:150px']) !!}
{!! app_logo_image(['style' => 'width:150px']) !!}
<h3>{{ config('app.name') }}</h3> <h3>{{ config('app.name') }}</h3>
</div> </div>
</div> </div>

2
resources/views/auth/login.blade.php

@ -5,7 +5,7 @@
@section('content') @section('content')
<div class="login-panel col-md-4 col-md-offset-4 text-center"> <div class="login-panel col-md-4 col-md-offset-4 text-center">
{!! appLogoImage() !!}
{!! app_logo_image() !!}
<h3>{{ config('app.name') }}</h3> <h3>{{ config('app.name') }}</h3>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">

2
resources/views/backups/index.blade.php

@ -24,7 +24,7 @@
<tr> <tr>
<td>{{ $key + 1 }}</td> <td>{{ $key + 1 }}</td>
<td>{{ $backup->getFilename() }}</td> <td>{{ $backup->getFilename() }}</td>
<td>{{ formatSizeUnits($backup->getSize()) }}</td>
<td>{{ format_size_units($backup->getSize()) }}</td>
<td>{{ date('Y-m-d H:i:s', $backup->getMTime()) }}</td> <td>{{ date('Y-m-d H:i:s', $backup->getMTime()) }}</td>
<td class="text-center"> <td class="text-center">
<a href="{{ route('backups.index', ['action' => 'restore', 'file_name' => $backup->getFilename()]) }}" <a href="{{ route('backups.index', ['action' => 'restore', 'file_name' => $backup->getFilename()]) }}"

4
resources/views/customers/invoices.blade.php

@ -22,7 +22,7 @@
<td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td> <td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td>
<td>{{ $invoice->project->nameLink() }}</td> <td>{{ $invoice->project->nameLink() }}</td>
<td>{{ $invoice->project->customer->nameLink() }}</td> <td>{{ $invoice->project->customer->nameLink() }}</td>
<td class="text-right">{{ formatRp($invoice->amount) }}</td>
<td class="text-right">{{ format_money($invoice->amount) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route( {!! html_link_to_route(
'invoices.show', '', [$invoice->number], 'invoices.show', '', [$invoice->number],
@ -49,7 +49,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="text-right">{{ trans('app.total') }}</th> <th colspan="5" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($invoices->sum('amount')) }}</th>
<th class="text-right">{{ format_money($invoices->sum('amount')) }}</th>
<th></th> <th></th>
</tr> </tr>
</tfoot> </tfoot>

2
resources/views/customers/payments.blade.php

@ -42,7 +42,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="4" class="text-right">{{ __('app.total') }}</th> <th colspan="4" class="text-right">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($payments->sum('amount')) }}</th>
<th class="text-right">{{ format_money($payments->sum('amount')) }}</th>
<th colspan="2">&nbsp;</th> <th colspan="2">&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

2
resources/views/customers/projects.blade.php

@ -21,7 +21,7 @@
<td>{{ $project->nameLink() }}</td> <td>{{ $project->nameLink() }}</td>
<td class="text-center">{{ $project->start_date }}</td> <td class="text-center">{{ $project->start_date }}</td>
<td class="text-right">{{ $project->work_duration }}</td> <td class="text-right">{{ $project->work_duration }}</td>
<td class="text-right">{{ formatRp($project->project_value) }}</td>
<td class="text-right">{{ format_money($project->project_value) }}</td>
<td class="text-center">{{ $project->present()->status }}</td> <td class="text-center">{{ $project->present()->status }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!} {!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!}

4
resources/views/customers/subscriptions.blade.php

@ -24,9 +24,9 @@
<td class="text-center">{!! $subscription->type_label !!}</td> <td class="text-center">{!! $subscription->type_label !!}</td>
<td>{{ $subscription->customer->name }}</td> <td>{{ $subscription->customer->name }}</td>
<td class="text-right" title="{!! $subscription->dueDateDescription() !!}"> <td class="text-right" title="{!! $subscription->dueDateDescription() !!}">
{{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
{{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
</td> </td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td>{{ $subscription->vendor->name }}</td> <td>{{ $subscription->vendor->name }}</td>
<td class="text-center">{{ $subscription->status() }}</td> <td class="text-center">{{ $subscription->status() }}</td>
</tr> </tr>

6
resources/views/invoice-drafts/partials/draft-confirm.blade.php

@ -18,7 +18,7 @@
<tr><td>{{ trans('invoice.due_date') }}</td><td>{{ $draft->dueDate }}</td></tr> <tr><td>{{ trans('invoice.due_date') }}</td><td>{{ $draft->dueDate }}</td></tr>
<tr> <tr>
<td>{{ trans('invoice.total') }}</td> <td>{{ trans('invoice.total') }}</td>
<th class="text-right lead">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right lead">{{ format_money($draft->getTotal()) }}</th>
</tr> </tr>
<tr><td>{{ trans('invoice.notes') }}</td><td>{{ $draft->notes }}</td></tr> <tr><td>{{ trans('invoice.notes') }}</td><td>{{ $draft->notes }}</td></tr>
</tbody> </tbody>
@ -48,7 +48,7 @@
<tr> <tr>
<td width="5%">{{ $key + 1 }}</td> <td width="5%">{{ $key + 1 }}</td>
<td width="70%">{!! nl2br($item->description) !!}</td> <td width="70%">{!! nl2br($item->description) !!}</td>
<td width="25%" class="text-right">{{ formatRp($item->amount) }}</td>
<td width="25%" class="text-right">{{ format_money($item->amount) }}</td>
</tr> </tr>
@empty @empty
@endforelse @endforelse
@ -56,7 +56,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('invoice.total') }} :</th> <th colspan="2" class="text-right">{{ trans('invoice.total') }} :</th>
<th class="text-right">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right">{{ format_money($draft->getTotal()) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

2
resources/views/invoice-drafts/partials/draft-item-list.blade.php

@ -51,7 +51,7 @@
@endforeach @endforeach
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th> <th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th>
<th class="text-right">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right">{{ format_money($draft->getTotal()) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
<tr> <tr>

4
resources/views/invoices/index.blade.php

@ -34,7 +34,7 @@
<td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td> <td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td>
<td>{{ $invoice->project->nameLink() }}</td> <td>{{ $invoice->project->nameLink() }}</td>
<td>{{ $invoice->project->customer->nameLink() }}</td> <td>{{ $invoice->project->customer->nameLink() }}</td>
<td class="text-right">{{ formatRp($invoice->amount) }}</td>
<td class="text-right">{{ format_money($invoice->amount) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route( {!! html_link_to_route(
'invoices.show', '', [$invoice->number], 'invoices.show', '', [$invoice->number],
@ -61,7 +61,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="text-right">{{ trans('app.total') }}</th> <th colspan="5" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($invoices->sum('amount')) }}</th>
<th class="text-right">{{ format_money($invoices->sum('amount')) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

2
resources/views/invoices/partials/detail.blade.php

@ -7,6 +7,6 @@
<tr><th>{{ trans('invoice.customer') }}</th><td>{{ $invoice->project->customer->nameLink() }}</td></tr> <tr><th>{{ trans('invoice.customer') }}</th><td>{{ $invoice->project->customer->nameLink() }}</td></tr>
<tr><th>{{ trans('invoice.items_count') }}</th><td>{{ $invoice->items_count }}</td></tr> <tr><th>{{ trans('invoice.items_count') }}</th><td>{{ $invoice->items_count }}</td></tr>
<tr><th>{{ trans('invoice.creator') }}</th><td>{{ $invoice->creator->name }}</td></tr> <tr><th>{{ trans('invoice.creator') }}</th><td>{{ $invoice->creator->name }}</td></tr>
<tr><th>{{ trans('invoice.amount') }}</th><td class="text-right lead">{{ formatRp($invoice->amount) }}</td></tr>
<tr><th>{{ trans('invoice.amount') }}</th><td class="text-right lead">{{ format_money($invoice->amount) }}</td></tr>
</tbody> </tbody>
</table> </table>

2
resources/views/invoices/partials/item-list.blade.php

@ -77,7 +77,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th> <th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th>
<th class="text-right">{{ formatRp(collect($invoice->items)->sum('amount')) }}</th>
<th class="text-right">{{ format_money(collect($invoice->items)->sum('amount')) }}</th>
<th></th> <th></th>
</tr> </tr>
</tfoot> </tfoot>

16
resources/views/invoices/pdf.blade.php

@ -39,7 +39,7 @@
<tbody> <tbody>
<tr> <tr>
<td style="width:100px;"> <td style="width:100px;">
{!! appLogoImage(['style' => 'width:100%']) !!}
{!! app_logo_image(['style' => 'width:100%']) !!}
</td> </td>
<td style="width:380px"> <td style="width:380px">
<div style="width:300px"> <div style="width:300px">
@ -61,7 +61,7 @@
<td style="width:270px; text-align: center;"> <td style="width:270px; text-align: center;">
<h3 style="margin: 3px 0; font-size: 24px">{{ __('invoice.invoice') }}</h3> <h3 style="margin: 3px 0; font-size: 24px">{{ __('invoice.invoice') }}</h3>
<div style="margin: 5px">{{ __('invoice.number') }} : INV-{{ $invoice->number }}</div> <div style="margin: 5px">{{ __('invoice.number') }} : INV-{{ $invoice->number }}</div>
<div>{{ __('app.date') }} : {{ dateId($invoice->date) }}</div>
<div>{{ __('app.date') }} : {{ date_id($invoice->date) }}</div>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -87,7 +87,7 @@
<td class="text-center text-top"> <td class="text-center text-top">
@if ($invoice->due_date) @if ($invoice->due_date)
<h4 style="margin: 30px 3px 0;">{{ __('invoice.due_date') }}</h4> <h4 style="margin: 30px 3px 0;">{{ __('invoice.due_date') }}</h4>
<p>{{ dateId($invoice->due_date) }}</p>
<p>{{ date_id($invoice->due_date) }}</p>
@endif @endif
@if ($taxId = Option::get('agency_tax_id')) @if ($taxId = Option::get('agency_tax_id'))
<h4 style="margin: 30px 3px 0;">{{ __('agency.tax_id') }}</h4> <h4 style="margin: 30px 3px 0;">{{ __('agency.tax_id') }}</h4>
@ -114,7 +114,7 @@
<tr> <tr>
<td class="text-center text-top">{{ 1 + $key }}</td> <td class="text-center text-top">{{ 1 + $key }}</td>
<td>{!! nl2br($item['description']) !!}</td> <td>{!! nl2br($item['description']) !!}</td>
<td class="text-right text-top">{{ formatRp($item['amount']) }}</td>
<td class="text-right text-top">{{ format_money($item['amount']) }}</td>
</tr> </tr>
@php @php
$subtotal += $item['amount']; $subtotal += $item['amount'];
@ -123,19 +123,19 @@
@if ($invoice->discount) @if ($invoice->discount)
<tr> <tr>
<th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th> <th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th>
<th class="text-right">{{ formatRp($subtotal) }}</th>
<th class="text-right">{{ format_money($subtotal) }}</th>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="text-right"> <td colspan="2" class="text-right">
<strong>{{ __('invoice.discount') }}</strong> <strong>{{ __('invoice.discount') }}</strong>
{{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} : {{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} :
</td> </td>
<th class="text-right">- {{ formatRp($invoice->discount) }}</th>
<th class="text-right">- {{ format_money($invoice->discount) }}</th>
</tr> </tr>
@endif @endif
<tr> <tr>
<th colspan="2" class="text-right">{{ __('app.total') }}</th> <th colspan="2" class="text-right">{{ __('app.total') }}</th>
<th colspan="2" class="text-right">{{ formatRp($invoice->amount) }}</th>
<th colspan="2" class="text-right">{{ format_money($invoice->amount) }}</th>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -176,7 +176,7 @@
<tr> <tr>
<td colspan="3" class="text-center"> <td colspan="3" class="text-center">
{{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} {{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }}
{{ dateId($invoice->date) }} <br><br><br><br>
{{ date_id($invoice->date) }} <br><br><br><br>
<div style="font-weight: bold;">{{ Option::get('agency_name') }}</div> <div style="font-weight: bold;">{{ Option::get('agency_name') }}</div>
</td> </td>
</tr> </tr>

8
resources/views/invoices/show.blade.php

@ -39,7 +39,7 @@
<tr> <tr>
<td>{{ $key + 1 }}</td> <td>{{ $key + 1 }}</td>
<td>{!! nl2br($item['description']) !!}</td> <td>{!! nl2br($item['description']) !!}</td>
<td class="text-right">{{ formatRp($item['amount']) }}</td>
<td class="text-right">{{ format_money($item['amount']) }}</td>
</tr> </tr>
@php @php
$subtotal += $item['amount']; $subtotal += $item['amount'];
@ -50,19 +50,19 @@
@if ($invoice->discount) @if ($invoice->discount)
<tr> <tr>
<th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th> <th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th>
<th class="text-right">{{ formatRp($subtotal) }}</th>
<th class="text-right">{{ format_money($subtotal) }}</th>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="text-right"> <td colspan="2" class="text-right">
<strong>{{ __('invoice.discount') }}</strong> <strong>{{ __('invoice.discount') }}</strong>
{{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} : {{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} :
</td> </td>
<th class="text-right">- {{ formatRp($invoice->discount) }}</th>
<th class="text-right">- {{ format_money($invoice->discount) }}</th>
</tr> </tr>
@endif @endif
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('app.total') }} :</th> <th colspan="2" class="text-right">{{ trans('app.total') }} :</th>
<th class="text-right">{{ formatRp($invoice->amount) }}</th>
<th class="text-right">{{ format_money($invoice->amount) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

4
resources/views/jobs/partials/job-show.blade.php

@ -5,9 +5,9 @@
<tr><th class="col-md-4">{{ __('job.name') }}</th><td class="col-md-8">{{ $job->name }}</td></tr> <tr><th class="col-md-4">{{ __('job.name') }}</th><td class="col-md-8">{{ $job->name }}</td></tr>
<tr><th>{{ __('job.type') }}</th><td>{{ $job->type() }}</td></tr> <tr><th>{{ __('job.type') }}</th><td>{{ $job->type() }}</td></tr>
@can('see-pricings', $job) @can('see-pricings', $job)
<tr><th>{{ __('job.price') }}</th><td>{{ formatRp($job->price) }}</td></tr>
<tr><th>{{ __('job.price') }}</th><td>{{ format_money($job->price) }}</td></tr>
@endcan @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>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>
<tr><th>{{ __('time.updated_at') }}</th><td>{{ $job->updated_at }}</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> <tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr>

2
resources/views/jobs/partials/job-tasks.blade.php

@ -66,7 +66,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="2">{{ __('app.total') }}</th> <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> <th>
@if (request('action') == 'sort_tasks') @if (request('action') == 'sort_tasks')
{{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }} {{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }}

8
resources/views/jobs/unfinished.blade.php

@ -46,9 +46,9 @@
@endif @endif
</td> </td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</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) @can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
@endcan @endcan
<td>{{ $job->worker->name }}</td> <td>{{ $job->worker->name }}</td>
<td> <td>
@ -63,9 +63,9 @@
<tr> <tr>
<th class="text-right" colspan="3">{{ __('app.total') }}</th> <th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-center">{{ $jobs->sum('tasks_count') }}</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) @can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
@endcan @endcan
<th colspan="2"></th> <th colspan="2"></th>
</tr> </tr>

2
resources/views/layouts/partials/sidebar.blade.php

@ -10,7 +10,7 @@
<div class="navbar-default sidebar hidden-print" role="navigation"> <div class="navbar-default sidebar hidden-print" role="navigation">
<div class="sidebar-nav navbar-collapse"> <div class="sidebar-nav navbar-collapse">
<a class="navbar-brand text-center" title="Home | {{ Option::get('agency_tagline', 'Laravel app description') }}" href="{{ route('home') }}"> <a class="navbar-brand text-center" title="Home | {{ Option::get('agency_tagline', 'Laravel app description') }}" href="{{ route('home') }}">
{{ appLogoImage(['class' => 'sidebar-logo']) }}
{{ app_logo_image(['class' => 'sidebar-logo']) }}
<div class="small" style="margin-top:10px">{{ config('app.name') }}</div> <div class="small" style="margin-top:10px">{{ config('app.name') }}</div>
</a> </a>
@include('layouts.partials.lang-switcher') @include('layouts.partials.lang-switcher')

2
resources/views/options/page-1.blade.php

@ -17,7 +17,7 @@
['class' => 'form-control', 'maxlength' => 3] ['class' => 'form-control', 'maxlength' => 3]
) }} ) }}
<span class="text-info small"> <span class="text-info small">
Money sign like : <strong>{{ formatRp('9900') }}</strong><br>(Max 3 characters)
Money sign like : <strong>{{ format_money('9900') }}</strong><br>(Max 3 characters)
</span> </span>
</td> </td>
</tr> </tr>

6
resources/views/pages/home.blade.php

@ -32,13 +32,13 @@
</tr> </tr>
<tr> <tr>
<td class="text-center text-primary lead" style="border-top: none;"> <td class="text-center text-primary lead" style="border-top: none;">
{{ $totalEarnings = formatRp(AdminDashboard::totalEarnings($queriedYear)) }}
{{ $totalEarnings = format_money(AdminDashboard::totalEarnings($queriedYear)) }}
</td> </td>
<td class="text-center text-primary lead" style="border-top: none;"> <td class="text-center text-primary lead" style="border-top: none;">
{{ $totalFinishedProjects = AdminDashboard::totalFinishedProjects($queriedYear) }} Projects {{ $totalFinishedProjects = AdminDashboard::totalFinishedProjects($queriedYear) }} Projects
</td> </td>
<td class="text-center text-primary lead" style="border-top: none;"> <td class="text-center text-primary lead" style="border-top: none;">
{{ $currentOutstandingCustomerPayment = formatRp(AdminDashboard::currentOutstandingCustomerPayment($queriedYear)) }}
{{ $currentOutstandingCustomerPayment = format_money(AdminDashboard::currentOutstandingCustomerPayment($queriedYear)) }}
</td> </td>
</tr> </tr>
</table> </table>
@ -73,7 +73,7 @@
<tr> <tr>
<td>{{ $subscription->nameLink() }}</td> <td>{{ $subscription->nameLink() }}</td>
<td>{{ $subscription->customer->name }}</td> <td>{{ $subscription->customer->name }}</td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td class="text-center"> <td class="text-center">
{{ $subscription->due_date }} {{ $subscription->due_date }}
{!! $subscription->nearOfDueDateSign() !!} {!! $subscription->nearOfDueDateSign() !!}

6
resources/views/payments/pdf.blade.php

@ -22,7 +22,7 @@
<table class="receipt-table"> <table class="receipt-table">
<tbody> <tbody>
<tr> <tr>
<td style="width:140px;">{{ appLogoImage(['style' => 'width: 100px;']) }}</td>
<td style="width:140px;">{{ app_logo_image(['style' => 'width: 100px;']) }}</td>
<td style="width:330px"> <td style="width:330px">
<div style="width:280px"> <div style="width:280px">
<h4 style="margin:0px; border-bottom: 3px; font-size: 21.5px">{{ Option::get('agency_name') }}</h4> <h4 style="margin:0px; border-bottom: 3px; font-size: 21.5px">{{ Option::get('agency_name') }}</h4>
@ -63,13 +63,13 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td style="text-align: center;"> <td style="text-align: center;">
{{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} {{ dateId($payment->date) }}
{{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} {{ date_id($payment->date) }}
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="font-size: 20px; font-weight: bold; text-align: center;height: 100px;vertical-align: bottom;">@lang('payment.cash_amount')</td> <td style="font-size: 20px; font-weight: bold; text-align: center;height: 100px;vertical-align: bottom;">@lang('payment.cash_amount')</td>
<td style="font-size: 20px; font-weight: bold; vertical-align: bottom;"> <td style="font-size: 20px; font-weight: bold; vertical-align: bottom;">
{{ formatRp($payment->amount) }},-
{{ format_money($payment->amount) }},-
</td> </td>
<td style="text-align: center;vertical-align: bottom;"> <td style="text-align: center;vertical-align: bottom;">
<strong>{{ auth()->user()->name }}</strong> <br> <strong>{{ auth()->user()->name }}</strong> <br>

46
resources/views/projects/files.blade.php

@ -1,12 +1,12 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', trans('project.files') . ' | ' . $project->name)
@section('title', __('project.files').' | '.$project->name)
@section('content') @section('content')
@include('projects.partials.breadcrumb',['title' => trans('project.files')])
@include('projects.partials.breadcrumb',['title' => __('project.files')])
<h1 class="page-header"> <h1 class="page-header">
{{ $project->name }} <small>{{ trans('project.files') }}</small>
{{ $project->name }} <small>{{ __('project.files') }}</small>
</h1> </h1>
@include('projects.partials.nav-tabs') @include('projects.partials.nav-tabs')
@ -14,16 +14,16 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="panel panel-default table-responsive"> <div class="panel panel-default table-responsive">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{{ trans('project.files') }}</h3>
<h3 class="panel-title">{{ __('project.files') }}</h3>
</div> </div>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<th>{{ trans('app.table_no') }}</th>
<th>{{ trans('file.file') }}</th>
<th class="text-center">{{ trans('file.updated_at') }}</th>
<th class="text-right">{{ trans('file.size') }}</th>
<th class="text-center">{{ trans('file.download') }}</th>
<th class="text-center">{{ trans('app.action') }}</th>
<th>{{ __('app.table_no') }}</th>
<th>{{ __('file.file') }}</th>
<th class="text-center">{{ __('file.updated_at') }}</th>
<th class="text-right">{{ __('file.size') }}</th>
<th class="text-center">{{ __('file.download') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead> </thead>
<tbody class="sort-files"> <tbody class="sort-files">
@forelse($files as $key => $file) @forelse($files as $key => $file)
@ -37,16 +37,16 @@
<div class="">{{ $file->getDate() }}</div> <div class="">{{ $file->getDate() }}</div>
<div class="text-info small">{{ $file->getTime() }}</div> <div class="text-info small">{{ $file->getTime() }}</div>
</td> </td>
<td class="text-right">{{ formatSizeUnits($file->getSize()) }}</td>
<td class="text-right">{{ format_size_units($file->getSize()) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => trans('file.download')]) !!}
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => __('file.download')]) !!}
</td> </td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('projects.files', '', [$project->id, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => trans('file.edit')]) !!}
{!! html_link_to_route('projects.files', '', [$project->id, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => __('file.edit')]) !!}
</td> </td>
</tr> </tr>
@empty @empty
<tr><td colspan="6">{{ trans('file.empty') }}</td></tr>
<tr><td colspan="6">{{ __('file.empty') }}</td></tr>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>
@ -55,27 +55,27 @@
<div class="col-md-4"> <div class="col-md-4">
@if (Request::has('action') == false) @if (Request::has('action') == false)
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('file.create') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('file.create') }}</h3></div>
<div class="panel-body"> <div class="panel-body">
{!! Form::open(['route' => ['files.upload', $project->id], 'id' => 'upload-file', 'files' => true]) !!} {!! Form::open(['route' => ['files.upload', $project->id], 'id' => 'upload-file', 'files' => true]) !!}
{{ Form::hidden('fileable_type', get_class($project)) }} {{ Form::hidden('fileable_type', get_class($project)) }}
{!! FormField::file('file', ['label' => trans('file.select')]) !!}
{!! FormField::file('file', ['label' => __('file.select')]) !!}
{!! FormField::text('title') !!} {!! FormField::text('title') !!}
{!! FormField::textarea('description') !!} {!! FormField::textarea('description') !!}
{!! Form::submit(trans('file.upload'), ['class' => 'btn btn-info']) !!}
{!! Form::submit(__('file.upload'), ['class' => 'btn btn-info']) !!}
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
@endif @endif
@if (Request::get('action') == 'edit' && $editableFile) @if (Request::get('action') == 'edit' && $editableFile)
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('file.edit') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('file.edit') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-body"> <div class="panel-body">
{!! Form::model($editableFile, ['route' => ['files.update', $editableFile->id],'method' => 'patch']) !!} {!! Form::model($editableFile, ['route' => ['files.update', $editableFile->id],'method' => 'patch']) !!}
{!! FormField::text('title', ['label' => trans('file.title'), 'required' => true]) !!}
{!! FormField::textarea('description', ['label' => trans('file.description')]) !!}
{!! Form::submit(trans('file.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.files', trans('app.cancel'), [$project->id], ['class' => 'btn btn-default']) }}
{!! FormField::text('title', ['label' => __('file.title'), 'required' => true]) !!}
{!! FormField::textarea('description', ['label' => __('file.description')]) !!}
{!! Form::submit(__('file.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.files', __('app.cancel'), [$project->id], ['class' => 'btn btn-default']) }}
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
@ -84,4 +84,4 @@
</div> </div>
@endsection
@endsection

4
resources/views/projects/index.blade.php

@ -44,11 +44,11 @@
<td class="text-center">{{ $project->start_date }}</td> <td class="text-center">{{ $project->start_date }}</td>
<td class="text-right">{{ $project->work_duration }}</td> <td class="text-right">{{ $project->work_duration }}</td>
@if (request('status_id') == 2) @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> <td class="text-center">{{ $project->due_date }}</td>
@endif @endif
@can('see-pricings', new App\Entities\Projects\Project) @can('see-pricings', new App\Entities\Projects\Project)
<td class="text-right">{{ formatRp($project->project_value) }}</td>
<td class="text-right">{{ format_money($project->project_value) }}</td>
@endcan @endcan
<td class="text-center">{{ $project->present()->status }}</td> <td class="text-center">{{ $project->present()->status }}</td>
<td>{{ $project->customer->name }}</td> <td>{{ $project->customer->name }}</td>

4
resources/views/projects/invoices.blade.php

@ -40,7 +40,7 @@
<td class="text-center">{{ $invoice->date }}</td> <td class="text-center">{{ $invoice->date }}</td>
<td class="text-center">{{ $invoice->due_date }}</td> <td class="text-center">{{ $invoice->due_date }}</td>
<td>{{ $project->customer->nameLink() }}</td> <td>{{ $project->customer->nameLink() }}</td>
<td class="text-right">{{ formatRp($invoice->amount) }}</td>
<td class="text-right">{{ format_money($invoice->amount) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route( {!! html_link_to_route(
'invoices.show', '', [$invoice->number], 'invoices.show', '', [$invoice->number],
@ -68,7 +68,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="text-right">{{ trans('app.total') }}</th> <th colspan="5" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($project->invoices->sum('amount')) }}</th>
<th class="text-right">{{ format_money($project->invoices->sum('amount')) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

4
resources/views/projects/jobs/export-html.blade.php

@ -52,14 +52,14 @@
<tr> <tr>
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td>{{ $job->name }}</td> <td>{{ $job->name }}</td>
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="2">Total</th> <th class="text-right" colspan="2">Total</th>
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

10
resources/views/projects/jobs/index.blade.php

@ -82,9 +82,9 @@
@endif @endif
</td> </td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</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) @can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
@endcan @endcan
<td class="text-center"> <td class="text-center">
{{ $job->updated_at->diffForHumans() }} <br> {{ $job->updated_at->diffForHumans() }} <br>
@ -108,11 +108,11 @@
<th class="text-right" colspan="2">Total</th> <th class="text-right" colspan="2">Total</th>
<th class="text-center">{{ $groupedJobs->sum('tasks_count') }}</th> <th class="text-center">{{ $groupedJobs->sum('tasks_count') }}</th>
<th class="text-center"> <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> </th>
@can('see-pricings', new App\Entities\Projects\Job) @can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($groupedJobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($groupedJobs->sum('price')) }}</th>
@endcan @endcan
<th colspan="2"> <th colspan="2">
@can('update', $project) @can('update', $project)

12
resources/views/projects/jobs/progress-export-html.blade.php

@ -30,18 +30,18 @@
<tr> <tr>
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td>{{ $job->name }}</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">{{ formatRp($job->receiveable_earning) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
<td class="text-right">{{ format_decimal($job->progress) }} %</td>
<td class="text-right">{{ format_money($job->receiveable_earning) }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="2">{{ __('app.total') }}</th> <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">{{ formatRp($jobs->sum('receiveable_earning')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_decimal($project->getJobOveralProgress()) }} %</th>
<th class="text-right">{{ format_money($jobs->sum('receiveable_earning')) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

16
resources/views/projects/partials/payment-summary.blade.php

@ -8,19 +8,19 @@
<td class="col-xs-2 text-center">{{ trans('project.payment_status') }}</td> <td class="col-xs-2 text-center">{{ trans('project.payment_status') }}</td>
</tr> </tr>
<tr> <tr>
<td class="text-center lead" style="border-top: none;">{{ formatRp($project->project_value) }}</td>
<td class="text-center lead" style="border-top: none;">{{ formatRp($project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ formatRp($project->cashOutTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ formatRp($balance = $project->project_value - $project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($project->project_value) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($project->cashOutTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($balance = $project->project_value - $project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</td> <td class="text-center lead" style="border-top: none;">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</td>
</tr> </tr>
</table> </table>
</div> </div>
<ul class="list-group visible-xs"> <ul class="list-group visible-xs">
<li class="list-group-item">{{ trans('project.project_value') }} <span class="pull-right">{{ formatRp($project->project_value) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_in_total') }} <span class="pull-right">{{ formatRp($project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_out_total') }} <span class="pull-right">{{ formatRp($project->cashOutTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.payment_remaining') }} <span class="pull-right">{{ formatRp($balance = $project->project_value - $project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.project_value') }} <span class="pull-right">{{ format_money($project->project_value) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_in_total') }} <span class="pull-right">{{ format_money($project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_out_total') }} <span class="pull-right">{{ format_money($project->cashOutTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.payment_remaining') }} <span class="pull-right">{{ format_money($balance = $project->project_value - $project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.payment_status') }} <span class="pull-right">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</span></li> <li class="list-group-item">{{ trans('project.payment_status') }} <span class="pull-right">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</span></li>
</ul> </ul>

12
resources/views/projects/partials/project-show.blade.php

@ -5,14 +5,14 @@
<tbody> <tbody>
<tr><td class="col-xs-3">{{ trans('project.name') }}</td><td class="col-xs-9">{{ $project->name }}</td></tr> <tr><td class="col-xs-3">{{ trans('project.name') }}</td><td class="col-xs-9">{{ $project->name }}</td></tr>
<tr><td>{{ trans('project.description') }}</td><td>{!! nl2br($project->description) !!}</td></tr> <tr><td>{{ trans('project.description') }}</td><td>{!! nl2br($project->description) !!}</td></tr>
<tr><td>{{ trans('project.proposal_date') }}</td><td>{{ dateId($project->proposal_date) }}</td></tr>
<tr><td>{{ trans('project.proposal_date') }}</td><td>{{ date_id($project->proposal_date) }}</td></tr>
@can('see-pricings', $project) @can('see-pricings', $project)
<tr><td>{{ trans('project.proposal_value') }}</td><td class="text-right">{{ formatRp($project->proposal_value) }}</td></tr>
<tr><td>{{ trans('project.project_value') }}</td><td class="text-right">{{ formatRp($project->project_value) }}</td></tr>
<tr><td>{{ trans('project.proposal_value') }}</td><td class="text-right">{{ format_money($project->proposal_value) }}</td></tr>
<tr><td>{{ trans('project.project_value') }}</td><td class="text-right">{{ format_money($project->project_value) }}</td></tr>
@endcan @endcan
<tr><td>{{ trans('project.start_date') }}</td><td>{{ dateId($project->start_date) }}</td></tr>
<tr><td>{{ trans('project.end_date') }}</td><td>{{ dateId($project->end_date) }}</td></tr>
<tr><td>{{ trans('project.due_date') }}</td><td>{{ dateId($project->due_date) }}</td></tr>
<tr><td>{{ trans('project.start_date') }}</td><td>{{ date_id($project->start_date) }}</td></tr>
<tr><td>{{ trans('project.end_date') }}</td><td>{{ date_id($project->end_date) }}</td></tr>
<tr><td>{{ trans('project.due_date') }}</td><td>{{ date_id($project->due_date) }}</td></tr>
<tr><td>{{ trans('app.status') }}</td><td>{{ $project->present()->status }}</td></tr> <tr><td>{{ trans('app.status') }}</td><td>{{ $project->present()->status }}</td></tr>
<tr> <tr>
<td>{{ trans('project.customer') }}</td> <td>{{ trans('project.customer') }}</td>

4
resources/views/projects/partials/project-stats.blade.php

@ -6,7 +6,7 @@
<div class="row"> <div class="row">
<div class="col-xs-3"><i class="fa fa-tasks fa-4x"></i></div> <div class="col-xs-3"><i class="fa fa-tasks fa-4x"></i></div>
<div class="col-xs-9 text-right"> <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 class="lead">{{ __('project.overall_progress') }}</div>
</div> </div>
</div> </div>
@ -38,7 +38,7 @@
<div class="col-xs-12 text-right"> <div class="col-xs-12 text-right">
<i class="fa fa-money fa-2x pull-left"></i> <i class="fa fa-money fa-2x pull-left"></i>
<div class="lead">Collectibe Earnings</div> <div class="lead">Collectibe Earnings</div>
<div class="lead" style="font-size: 30px;">{{ formatRp($project->getCollectibeEarnings()) }}</div>
<div class="lead" style="font-size: 30px;">{{ format_money($project->getCollectibeEarnings()) }}</div>
</div> </div>
</div> </div>
</div> </div>

4
resources/views/projects/payments.blade.php

@ -36,7 +36,7 @@
<tr> <tr>
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td class="text-center">{{ $payment->date }}</td> <td class="text-center">{{ $payment->date }}</td>
<td class="text-right">{{ formatRp($payment->amount) }}</td>
<td class="text-right">{{ format_money($payment->amount) }}</td>
<td>{{ $payment->partner->name }}</td> <td>{{ $payment->partner->name }}</td>
<td>{{ $payment->description }} [{{ $payment->type() }}]</td> <td>{{ $payment->description }} [{{ $payment->type() }}]</td>
<td class="text-center"> <td class="text-center">
@ -53,7 +53,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('app.total') }}</th> <th colspan="2" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($payments->sum('amount')) }}</th>
<th class="text-right">{{ format_money($payments->sum('amount')) }}</th>
<th colspan="5"></th> <th colspan="5"></th>
</tr> </tr>
</tfoot> </tfoot>

6
resources/views/projects/subscriptions.blade.php

@ -31,9 +31,9 @@
<td>{{ 1 + $key }}</td> <td>{{ 1 + $key }}</td>
<td class="text-center">{{ $subscription->type }}</td> <td class="text-center">{{ $subscription->type }}</td>
<td>{{ $subscription->nameLink() }}</td> <td>{{ $subscription->nameLink() }}</td>
<td class="text-right">{{ dateId($subscription->start_date) }}</td>
<td class="text-right">{{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}</td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ date_id($subscription->start_date) }}</td>
<td class="text-right">{{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td> <td>
{!! link_to_route('subscriptions.show',trans('app.show'),[$subscription->id],['class'=>'btn btn-info btn-xs']) !!} {!! 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']) !!} {!! link_to_route('subscriptions.edit',trans('app.edit'),[$subscription->id],['class'=>'btn btn-warning btn-xs']) !!}

8
resources/views/reports/current-credits.blade.php

@ -23,9 +23,9 @@
<tr> <tr>
<td>{{ 1 + $key }}</td> <td>{{ 1 + $key }}</td>
<td>{!! link_to_route('projects.payments', $project->name, [$project->id], ['title' => __('project.view_payments'), 'target' => '_blank']) !!}</td> <td>{!! link_to_route('projects.payments', $project->name, [$project->id], ['title' => __('project.view_payments'), 'target' => '_blank']) !!}</td>
<td class="text-right">{{ formatRp($project->project_value) }}</td>
<td class="text-right">{{ formatRp($project->cashInTotal()) }}</td>
<td class="text-right">{{ formatRp($project->balance = $project->project_value - $project->cashInTotal()) }}</td>
<td class="text-right">{{ format_money($project->project_value) }}</td>
<td class="text-right">{{ format_money($project->cashInTotal()) }}</td>
<td class="text-right">{{ format_money($project->balance = $project->project_value - $project->cashInTotal()) }}</td>
<td>{{ $project->customer->name }}</td> <td>{{ $project->customer->name }}</td>
<td class="text-center">{{ $project->present()->status }}</td> <td class="text-center">{{ $project->present()->status }}</td>
</tr> </tr>
@ -36,7 +36,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="4">{{ __('app.total') }}</th> <th class="text-right" colspan="4">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($projects->sum('balance')) }}</th>
<th class="text-right">{{ format_money($projects->sum('balance')) }}</th>
<th colspan="3">&nbsp;</th> <th colspan="3">&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

26
resources/views/reports/log-files.blade.php

@ -1,11 +1,9 @@
@extends('layouts.app') @extends('layouts.app')
@section('title','Log Files')
@section('title', 'Log Files')
@section('content') @section('content')
<h3 class="page-header">
Log Files
</h3>
<h3 class="page-header">Log Files</h3>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div class="panel panel-default"> <div class="panel panel-default">
@ -15,35 +13,33 @@
<th>Nama File</th> <th>Nama File</th>
<th>Ukuran</th> <th>Ukuran</th>
<th>Tanggal Jam</th> <th>Tanggal Jam</th>
<th>{{ trans('app.action') }}</th>
<th>{{ __('app.action') }}</th>
</thead> </thead>
<tbody> <tbody>
@forelse($logFiles as $key => $logFile) @forelse($logFiles as $key => $logFile)
<tr> <tr>
<td>{{ $key + 1 }}</td> <td>{{ $key + 1 }}</td>
<td>{{ $logFile->getFilename() }}</td> <td>{{ $logFile->getFilename() }}</td>
<td>{{ formatSizeUnits($logFile->getSize()) }}</td>
<td>{{ format_size_units($logFile->getSize()) }}</td>
<td>{{ date('Y-m-d H:i:s', $logFile->getMTime()) }}</td> <td>{{ date('Y-m-d H:i:s', $logFile->getMTime()) }}</td>
<td> <td>
{!! html_link_to_route('log-files.download','',[$logFile->getFilename()],[
{!! html_link_to_route('log-files.download', '', [$logFile->getFilename()], [
'class'=>'btn btn-default btn-xs', 'class'=>'btn btn-default btn-xs',
'icon' => 'download', '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', 'class'=>'btn btn-default btn-xs',
'icon' => 'search', 'icon' => 'search',
'id' => 'view-' . $logFile->getFilename(),
'title' => 'View file ' . $logFile->getFilename(),
'id' => 'view-'.$logFile->getFilename(),
'title' => 'View file '.$logFile->getFilename(),
'target' => '_blank', 'target' => '_blank',
]) !!} ]) !!}
</td> </td>
</tr> </tr>
@empty @empty
<tr>
<td colspan="3">Belum ada file logFile</td>
</tr>
<tr><td colspan="5">Belum ada file logFile</td></tr>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

8
resources/views/reports/payments/daily.blade.php

@ -1,6 +1,6 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', __('report.daily', ['date' => dateId($date)]))
@section('title', __('report.daily', ['date' => date_id($date)]))
@section('content') @section('content')
@ -8,7 +8,7 @@
<ul class="breadcrumb hidden-print"> <ul class="breadcrumb hidden-print">
<li>{{ link_to_route('reports.payments.yearly', __('report.yearly', ['year' => $dt->year]), ['year' => $dt->year]) }}</li> <li>{{ link_to_route('reports.payments.yearly', __('report.yearly', ['year' => $dt->year]), ['year' => $dt->year]) }}</li>
<li>{{ link_to_route('reports.payments.monthly', getMonths()[monthNumber($dt->month)], ['year' => $dt->year,'month' => monthNumber($dt->month)]) }}</li>
<li>{{ link_to_route('reports.payments.monthly', get_months()[month_number($dt->month)], ['year' => $dt->year,'month' => month_number($dt->month)]) }}</li>
<li class="active">{{ $dt->format('d') }}</li> <li class="active">{{ $dt->format('d') }}</li>
</ul> </ul>
@ -20,7 +20,7 @@
{{ link_to_route( {{ link_to_route(
'reports.payments.monthly', 'reports.payments.monthly',
__('report.view_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'] ['class' => 'btn btn-default btn-sm']
) }} ) }}
{{ Form::close() }} {{ Form::close() }}
@ -67,7 +67,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="3">{{ __('app.total') }}</th> <th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($total) }}</th>
<th class="text-right">{{ format_money($total) }}</th>
<th colspan="3">&nbsp;</th> <th colspan="3">&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

18
resources/views/reports/payments/monthly.blade.php

@ -40,7 +40,7 @@
</thead> </thead>
<tbody> <tbody>
@php $chartData = []; @endphp @php $chartData = []; @endphp
@foreach(monthDateArray($year, $month) as $dateNumber)
@foreach(month_date_array($year, $month) as $dateNumber)
@php @php
$any = isset($reports[$dateNumber]); $any = isset($reports[$dateNumber]);
$count = $any ? $reports[$dateNumber]->count : 0; $count = $any ? $reports[$dateNumber]->count : 0;
@ -48,11 +48,11 @@
@endphp @endphp
@if ($any) @if ($any)
<tr> <tr>
<td class="text-center">{{ dateId($date = $year.'-'.$month.'-'.$dateNumber) }}</td>
<td class="text-center">{{ date_id($date = $year.'-'.$month.'-'.$dateNumber) }}</td>
<td class="text-center">{{ $count }}</td> <td class="text-center">{{ $count }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$dateNumber]->cashin : 0) }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$dateNumber]->cashout : 0) }}</td>
<td class="text-right">{{ formatRp($profit) }}</td>
<td class="text-right">{{ format_money($any ? $reports[$dateNumber]->cashin : 0) }}</td>
<td class="text-right">{{ format_money($any ? $reports[$dateNumber]->cashout : 0) }}</td>
<td class="text-right">{{ format_money($profit) }}</td>
<td class="text-center"> <td class="text-center">
{{ link_to_route( {{ link_to_route(
'reports.payments.daily', 'reports.payments.daily',
@ -60,7 +60,7 @@
['date' => $date], ['date' => $date],
[ [
'class' => 'btn btn-info btn-xs', 'class' => 'btn btn-info btn-xs',
'title' => __('report.daily', ['date' => dateId($date)]),
'title' => __('report.daily', ['date' => date_id($date)]),
] ]
) }} ) }}
</td> </td>
@ -75,9 +75,9 @@
<tr> <tr>
<th class="text-right">{{ __('app.total') }}</th> <th class="text-right">{{ __('app.total') }}</th>
<th class="text-center">{{ $reports->sum('count') }}</th> <th class="text-center">{{ $reports->sum('count') }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashin')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashout')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('profit')) }}</th>
<th class="text-right">{{ format_money($reports->sum('cashin')) }}</th>
<th class="text-right">{{ format_money($reports->sum('cashout')) }}</th>
<th class="text-right">{{ format_money($reports->sum('profit')) }}</th>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</tfoot> </tfoot>

22
resources/views/reports/payments/yearly.blade.php

@ -37,16 +37,16 @@
</thead> </thead>
<tbody> <tbody>
@php $chartData = []; @endphp @php $chartData = []; @endphp
@foreach(getMonths() as $monthNumber => $monthName)
@foreach(get_months() as $monthNumber => $monthName)
@php @php
$any = isset($reports[$monthNumber]); $any = isset($reports[$monthNumber]);
@endphp @endphp
<tr> <tr>
<td class="text-center">{{ monthId($monthNumber) }}</td>
<td class="text-center">{{ month_id($monthNumber) }}</td>
<td class="text-center">{{ $any ? $reports[$monthNumber]->count : 0 }}</td> <td class="text-center">{{ $any ? $reports[$monthNumber]->count : 0 }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$monthNumber]->cashin : 0) }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$monthNumber]->cashout : 0) }}</td>
<td class="text-right">{{ formatRp($profit = $any ? $reports[$monthNumber]->profit : 0) }}</td>
<td class="text-right">{{ format_money($any ? $reports[$monthNumber]->cashin : 0) }}</td>
<td class="text-right">{{ format_money($any ? $reports[$monthNumber]->cashout : 0) }}</td>
<td class="text-right">{{ format_money($profit = $any ? $reports[$monthNumber]->profit : 0) }}</td>
<td class="text-center"> <td class="text-center">
{{ link_to_route( {{ link_to_route(
'reports.payments.monthly', 'reports.payments.monthly',
@ -54,14 +54,14 @@
['month' => $monthNumber, 'year' => $year], ['month' => $monthNumber, 'year' => $year],
[ [
'class' => 'btn btn-info btn-xs', '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]),
] ]
) }} ) }}
</td> </td>
</tr> </tr>
@php @php
$chartData[] = ['month' => monthId($monthNumber), 'value' => $profit];
$chartData[] = ['month' => month_id($monthNumber), 'value' => $profit];
@endphp @endphp
@endforeach @endforeach
</tbody> </tbody>
@ -69,9 +69,9 @@
<tr> <tr>
<th class="text-center">{{ trans('app.total') }}</th> <th class="text-center">{{ trans('app.total') }}</th>
<th class="text-center">{{ $reports->sum('count') }}</th> <th class="text-center">{{ $reports->sum('count') }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashin')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashout')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('profit')) }}</th>
<th class="text-right">{{ format_money($reports->sum('cashin')) }}</th>
<th class="text-right">{{ format_money($reports->sum('cashout')) }}</th>
<th class="text-right">{{ format_money($reports->sum('profit')) }}</th>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</tfoot> </tfoot>

4
resources/views/subscriptions/index.blade.php

@ -34,9 +34,9 @@
<td class="text-center">{!! $subscription->type_label !!}</td> <td class="text-center">{!! $subscription->type_label !!}</td>
<td>{{ $subscription->customer->name }}</td> <td>{{ $subscription->customer->name }}</td>
<td class="text-right" title="{!! $subscription->dueDateDescription() !!}"> <td class="text-right" title="{!! $subscription->dueDateDescription() !!}">
{{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
{{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
</td> </td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td>{{ $subscription->vendor->name }}</td> <td>{{ $subscription->vendor->name }}</td>
<td class="text-center">{{ $subscription->status() }}</td> <td class="text-center">{{ $subscription->status() }}</td>
</tr> </tr>

6
resources/views/subscriptions/partials/subscription-show.blade.php

@ -1,10 +1,10 @@
<table class="table table-condensed"> <table class="table table-condensed">
<tbody> <tbody>
<tr><td>{{ trans('subscription.name') }}</td><td>{{ $subscription->name }}</td></tr> <tr><td>{{ trans('subscription.name') }}</td><td>{{ $subscription->name }}</td></tr>
<tr><td>{{ trans('subscription.price') }}</td><td>{{ formatRp($subscription->price) }}</td></tr>
<tr><td>{{ trans('subscription.price') }}</td><td>{{ format_money($subscription->price) }}</td></tr>
<tr><td>{{ trans('subscription.type') }}</td><td>{{ $subscription->type }}</td></tr> <tr><td>{{ trans('subscription.type') }}</td><td>{{ $subscription->type }}</td></tr>
<tr><td>{{ trans('subscription.start_date') }}</td><td>{{ dateId($subscription->start_date) }}</td></tr>
<tr><td>{{ trans('subscription.due_date') }}</td><td>{{ dateId($subscription->due_date) }}</td></tr>
<tr><td>{{ trans('subscription.start_date') }}</td><td>{{ date_id($subscription->start_date) }}</td></tr>
<tr><td>{{ trans('subscription.due_date') }}</td><td>{{ date_id($subscription->due_date) }}</td></tr>
<tr><td>{{ trans('subscription.customer') }}</td><td>{{ $subscription->customer->nameLink() }}</td></tr> <tr><td>{{ trans('subscription.customer') }}</td><td>{{ $subscription->customer->nameLink() }}</td></tr>
<tr> <tr>
<td>{{ trans('subscription.project') }}</td> <td>{{ trans('subscription.project') }}</td>

2
resources/views/users/agency/edit.blade.php

@ -31,7 +31,7 @@
<div class="col-md-3 text-center"> <div class="col-md-3 text-center">
{{ Form::open(['route' => 'users.agency.logo-upload', 'method' => 'patch', 'files' => true]) }} {{ Form::open(['route' => 'users.agency.logo-upload', 'method' => 'patch', 'files' => true]) }}
<legend>{{ __('agency.logo') }}</legend> <legend>{{ __('agency.logo') }}</legend>
<p>{!! appLogoImage(['style' => 'margin:20px auto']) !!}</p>
<p>{!! app_logo_image(['style' => 'margin:20px auto']) !!}</p>
{!! FormField::file('logo', [ {!! FormField::file('logo', [
'label' => __('agency.logo_change'), 'label' => __('agency.logo_change'),
'info' => ['text' => __('agency.logo_upload_info'), 'class' => 'warning'], 'info' => ['text' => __('agency.logo_upload_info'), 'class' => 'warning'],

2
resources/views/users/agency/show.blade.php

@ -6,7 +6,7 @@
<div class="row"> <div class="row">
<div class="col-md-4 text-center"> <div class="col-md-4 text-center">
<p>{!! appLogoImage() !!}</p>
<p>{!! app_logo_image() !!}</p>
<h3 class="text-primary">{{ Option::get('agency_name') }}</h3> <h3 class="text-primary">{{ Option::get('agency_name') }}</h3>
<p>{{ Option::get('agency_tagline') }}</p> <p>{{ Option::get('agency_tagline') }}</p>

4
resources/views/users/jobs.blade.php

@ -33,8 +33,8 @@
@endif @endif
</td> </td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</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-right">{{ formatRp($job->price) }}</td>
<td class="text-center">{{ format_decimal($job->progress = $job->progress) }} %</td>
<td class="text-right">{{ format_money($job->price) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('jobs.show', '', [$job], [ {!! html_link_to_route('jobs.show', '', [$job], [
'icon' => 'search', 'icon' => 'search',

2
resources/views/users/projects.blade.php

@ -30,7 +30,7 @@
<td>{{ $project->nameLink() }}</td> <td>{{ $project->nameLink() }}</td>
<td class="text-center">{{ $project->start_date }}</td> <td class="text-center">{{ $project->start_date }}</td>
<td class="text-right">{{ $project->work_duration }}</td> <td class="text-right">{{ $project->work_duration }}</td>
<td class="text-right">{{ formatRp($project->project_value) }}</td>
<td class="text-right">{{ format_money($project->project_value) }}</td>
<td class="text-center">{{ $project->present()->status }}</td> <td class="text-center">{{ $project->present()->status }}</td>
<td>{{ $project->customer->name }}</td> <td>{{ $project->customer->name }}</td>
<td> <td>

4
resources/views/vendors/show.blade.php

@ -44,7 +44,7 @@
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td>{{ $payment->project->name }}</td> <td>{{ $payment->project->name }}</td>
<td class="text-center">{{ $payment->date }}</td> <td class="text-center">{{ $payment->date }}</td>
<td class="text-right">{{ formatRp($payment->amount) }}</td>
<td class="text-right">{{ format_money($payment->amount) }}</td>
<td>{{ $payment->description }}</td> <td>{{ $payment->description }}</td>
</tr> </tr>
@endforeach @endforeach
@ -52,7 +52,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="3">{{ __('app.total') }}</th> <th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($vendor->payments->sum('amount')) }}</th>
<th class="text-right">{{ format_money($vendor->payments->sum('amount')) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

6
tests/Feature/Invoices/InvoiceEntryTest.php

@ -87,7 +87,7 @@ class InvoiceEntryTest extends TestCase
$this->seePageIs(route('invoice-drafts.show', $draft->draftKey)); $this->seePageIs(route('invoice-drafts.show', $draft->draftKey));
$this->assertEquals(5000, $draft->getTotal()); $this->assertEquals(5000, $draft->getTotal());
$this->see(formatRp(5000));
$this->see(format_money(5000));
} }
/** @test */ /** @test */
@ -137,7 +137,7 @@ class InvoiceEntryTest extends TestCase
$this->assertEquals(200, $draft->getTotal()); $this->assertEquals(200, $draft->getTotal());
$this->see(formatRp($draft->getTotal()));
$this->see(format_money($draft->getTotal()));
} }
/** @test */ /** @test */
@ -174,7 +174,7 @@ class InvoiceEntryTest extends TestCase
$this->see($project->name); $this->see($project->name);
$this->see($project->customer->name); $this->see($project->customer->name);
$this->see($draft->notes); $this->see($draft->notes);
$this->see(formatRp(3000));
$this->see(format_money(3000));
$this->seeElement('input', ['id' => 'save-invoice-draft']); $this->seeElement('input', ['id' => 'save-invoice-draft']);
} }

2
tests/Feature/ManageJobsTest.php

@ -142,7 +142,7 @@ class ManageJobsTest extends TestCase
$this->seePageIs(route('jobs.show', $project->id)); $this->seePageIs(route('jobs.show', $project->id));
$this->see(trans('job.detail')); $this->see(trans('job.detail'));
$this->see($job->name); $this->see($job->name);
$this->see(formatRp($job->price));
$this->see(format_money($job->price));
$this->see($job->worker->name); $this->see($job->worker->name);
} }

6
tests/Feature/ManageSubscriptionsTest.php

@ -111,8 +111,8 @@ class ManageSubscriptionsTest extends TestCase
$this->visit(route('subscriptions.show', $subscription->id)); $this->visit(route('subscriptions.show', $subscription->id));
$this->see($subscription->name); $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));
} }
} }

2
tests/Feature/Payments/ManagePaymentsTest.php

@ -216,7 +216,7 @@ class ManagePaymentsTest extends TestCase
$this->seePageIs(route('payments.show', $payment->id)); $this->seePageIs(route('payments.show', $payment->id));
$this->see(trans('payment.detail')); $this->see(trans('payment.detail'));
$this->see($payment->date); $this->see($payment->date);
$this->see(formatRp($payment->amount));
$this->see(format_money($payment->amount));
$this->see($payment->description); $this->see($payment->description);
$this->see($payment->partner->name); $this->see($payment->partner->name);
} }

12
tests/Unit/Helpers/AppLogoImageTest.php

@ -17,13 +17,13 @@ class AppLogoImageTest extends TestCase
'value' => 'icon_user_1.png', '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 */ /** @test */
public function app_logo_path_function_returns_default_logo_image_path_if_no_image_logo_path_setting() 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 */ /** @test */
@ -33,7 +33,7 @@ class AppLogoImageTest extends TestCase
$logoString .= ' src="'.asset('assets/imgs/default-logo.png').'"'; $logoString .= ' src="'.asset('assets/imgs/default-logo.png').'"';
$logoString .= ' alt="Logo Laravel">'; $logoString .= ' alt="Logo Laravel">';
$this->assertEquals($logoString, appLogoImage());
$this->assertEquals($logoString, app_logo_image());
} }
/** @test */ /** @test */
@ -48,7 +48,7 @@ class AppLogoImageTest extends TestCase
$logoString .= ' src="'.asset('assets/imgs/icon_user_1.png').'"'; $logoString .= ' src="'.asset('assets/imgs/icon_user_1.png').'"';
$logoString .= ' alt="Logo Laravel">'; $logoString .= ' alt="Logo Laravel">';
$this->assertEquals($logoString, appLogoImage());
$this->assertEquals($logoString, app_logo_image());
} }
/** @test */ /** @test */
@ -69,7 +69,7 @@ class AppLogoImageTest extends TestCase
'class' => '123', 'class' => '123',
'style' => 'display: inline', 'style' => 'display: inline',
]; ];
$this->assertEquals($logoString, appLogoImage($overrides));
$this->assertEquals($logoString, app_logo_image($overrides));
} }
/** @test */ /** @test */
@ -84,6 +84,6 @@ class AppLogoImageTest extends TestCase
$logoString .= ' src="'.asset('assets/imgs/default-logo.png').'"'; $logoString .= ' src="'.asset('assets/imgs/default-logo.png').'"';
$logoString .= ' alt="Logo Laravel">'; $logoString .= ' alt="Logo Laravel">';
$this->assertEquals($logoString, appLogoImage());
$this->assertEquals($logoString, app_logo_image());
} }
} }

10
tests/Unit/Helpers/DateDifferenceTest.php

@ -14,31 +14,31 @@ class DateDifferenceTest extends TestCase
/** @test */ /** @test */
public function date_difference_function_exists() public function date_difference_function_exists()
{ {
$this->assertTrue(function_exists('dateDifference'));
$this->assertTrue(function_exists('date_difference'));
} }
/** @test */ /** @test */
public function date_difference_returns_days_count_by_default() 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 */ /** @test */
public function date_difference_can_returns_formatted_string() 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 */ /** @test */
public function date_difference_returns_proper_months_and_days_format() public function date_difference_returns_proper_months_and_days_format()
{ {
// TODO: Need to fix, this should returns 1 months 9 days // 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 */ /** @test */
public function date_difference_returns_proper_years_months_and_days_format() 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'));
} }
} }

12
tests/Unit/Helpers/MoneyFormatTest.php

@ -17,9 +17,9 @@ class MoneyFormatTest extends TestCase
/** @test */ /** @test */
public function format_money_returns_string_with_default_money_sign() 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 */ /** @test */
@ -30,8 +30,8 @@ class MoneyFormatTest extends TestCase
'value' => 'USD', '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));
} }
} }

6
tests/Unit/Models/SubscriptionTest.php

@ -3,7 +3,7 @@
namespace Tests\Unit\Models; namespace Tests\Unit\Models;
use Carbon\Carbon; use Carbon\Carbon;
use Tests\TestCase as TestCase;
use Tests\TestCase;
use App\Entities\Partners\Vendor; use App\Entities\Partners\Vendor;
use App\Entities\Projects\Project; use App\Entities\Projects\Project;
use App\Entities\Partners\Customer; use App\Entities\Partners\Customer;
@ -69,8 +69,8 @@ class SubscriptionTest extends TestCase
$next3Months = Carbon::now()->addMonths(2)->format('Y-m-d'); $next3Months = Carbon::now()->addMonths(2)->format('Y-m-d');
$subscription = factory(Subscription::class)->make(['due_date' => $next3Months]); $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()); $this->assertEquals($dueDateDescription, $subscription->dueDateDescription());
} }

Loading…
Cancel
Save