Browse Source

Change from formatRp() to format_money()

pull/32/head
Nafies Luthfi 7 years ago
parent
commit
bf7c359ab1
  1. 2
      app/Entities/Payments/PaymentPresenter.php
  2. 3
      app/helpers.php
  3. 4
      resources/views/customers/invoices.blade.php
  4. 2
      resources/views/customers/payments.blade.php
  5. 2
      resources/views/customers/projects.blade.php
  6. 2
      resources/views/customers/subscriptions.blade.php
  7. 6
      resources/views/invoice-drafts/partials/draft-confirm.blade.php
  8. 2
      resources/views/invoice-drafts/partials/draft-item-list.blade.php
  9. 4
      resources/views/invoices/index.blade.php
  10. 2
      resources/views/invoices/partials/detail.blade.php
  11. 2
      resources/views/invoices/partials/item-list.blade.php
  12. 8
      resources/views/invoices/pdf.blade.php
  13. 8
      resources/views/invoices/show.blade.php
  14. 2
      resources/views/jobs/partials/job-show.blade.php
  15. 4
      resources/views/jobs/unfinished.blade.php
  16. 2
      resources/views/options/page-1.blade.php
  17. 6
      resources/views/pages/home.blade.php
  18. 2
      resources/views/payments/pdf.blade.php
  19. 2
      resources/views/projects/index.blade.php
  20. 4
      resources/views/projects/invoices.blade.php
  21. 4
      resources/views/projects/jobs/export-html.blade.php
  22. 4
      resources/views/projects/jobs/index.blade.php
  23. 8
      resources/views/projects/jobs/progress-export-html.blade.php
  24. 16
      resources/views/projects/partials/payment-summary.blade.php
  25. 4
      resources/views/projects/partials/project-show.blade.php
  26. 2
      resources/views/projects/partials/project-stats.blade.php
  27. 4
      resources/views/projects/payments.blade.php
  28. 2
      resources/views/projects/subscriptions.blade.php
  29. 8
      resources/views/reports/current-credits.blade.php
  30. 2
      resources/views/reports/payments/daily.blade.php
  31. 12
      resources/views/reports/payments/monthly.blade.php
  32. 12
      resources/views/reports/payments/yearly.blade.php
  33. 2
      resources/views/subscriptions/index.blade.php
  34. 2
      resources/views/subscriptions/partials/subscription-show.blade.php
  35. 2
      resources/views/users/jobs.blade.php
  36. 2
      resources/views/users/projects.blade.php
  37. 4
      resources/views/vendors/show.blade.php
  38. 6
      tests/Feature/Invoices/InvoiceEntryTest.php
  39. 2
      tests/Feature/ManageJobsTest.php
  40. 2
      tests/Feature/ManageSubscriptionsTest.php
  41. 2
      tests/Feature/Payments/ManagePaymentsTest.php
  42. 12
      tests/Unit/Helpers/MoneyFormatTest.php

2
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()

3
app/helpers.php

@ -13,10 +13,11 @@ function formatNo($number)
/**
* 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.');

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

@ -22,7 +22,7 @@
<td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td>
<td>{{ $invoice->project->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">
{!! html_link_to_route(
'invoices.show', '', [$invoice->number],
@ -49,7 +49,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -42,7 +42,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -21,7 +21,7 @@
<td>{{ $project->nameLink() }}</td>
<td class="text-center">{{ $project->start_date }}</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">
{!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!}

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

@ -26,7 +26,7 @@
<td class="text-right" title="{!! $subscription->dueDateDescription() !!}">
{{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
</td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td>{{ $subscription->vendor->name }}</td>
<td class="text-center">{{ $subscription->status() }}</td>
</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.total') }}</td>
<th class="text-right lead">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right lead">{{ format_money($draft->getTotal()) }}</th>
</tr>
<tr><td>{{ trans('invoice.notes') }}</td><td>{{ $draft->notes }}</td></tr>
</tbody>
@ -48,7 +48,7 @@
<tr>
<td width="5%">{{ $key + 1 }}</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>
@empty
@endforelse
@ -56,7 +56,7 @@
<tfoot>
<tr>
<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>
</tfoot>
</table>

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

@ -51,7 +51,7 @@
@endforeach
<tr>
<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>
</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>{{ $invoice->project->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">
{!! html_link_to_route(
'invoices.show', '', [$invoice->number],
@ -61,7 +61,7 @@
<tfoot>
<tr>
<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>
</tr>
</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.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.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>
</table>

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

@ -77,7 +77,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -114,7 +114,7 @@
<tr>
<td class="text-center text-top">{{ 1 + $key }}</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>
@php
$subtotal += $item['amount'];
@ -123,19 +123,19 @@
@if ($invoice->discount)
<tr>
<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>
<td colspan="2" class="text-right">
<strong>{{ __('invoice.discount') }}</strong>
{{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} :
</td>
<th class="text-right">- {{ formatRp($invoice->discount) }}</th>
<th class="text-right">- {{ format_money($invoice->discount) }}</th>
</tr>
@endif
<tr>
<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>
</tbody>
</table>

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

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

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

@ -5,7 +5,7 @@
<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>
@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
<tr><th>{{ __('job.progress') }}</th><td>{{ format_decimal($job->progress) }}%</td></tr>
<tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>

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

@ -48,7 +48,7 @@
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ format_decimal($job->progress) }} %</td>
@can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
@endcan
<td>{{ $job->worker->name }}</td>
<td>
@ -65,7 +65,7 @@
<th class="text-center">{{ $jobs->sum('tasks_count') }}</th>
<th class="text-center">{{ format_decimal($jobs->avg('progress')) }} %</th>
@can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
@endcan
<th colspan="2"></th>
</tr>

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

@ -17,7 +17,7 @@
['class' => 'form-control', 'maxlength' => 3]
) }}
<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>
</td>
</tr>

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

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

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

@ -69,7 +69,7 @@
<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; vertical-align: bottom;">
{{ formatRp($payment->amount) }},-
{{ format_money($payment->amount) }},-
</td>
<td style="text-align: center;vertical-align: bottom;">
<strong>{{ auth()->user()->name }}</strong> <br>

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

@ -48,7 +48,7 @@
<td class="text-center">{{ $project->due_date }}</td>
@endif
@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
<td class="text-center">{{ $project->present()->status }}</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->due_date }}</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">
{!! html_link_to_route(
'invoices.show', '', [$invoice->number],
@ -68,7 +68,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -52,14 +52,14 @@
<tr>
<td class="text-center">{{ 1 + $key }}</td>
<td>{{ $job->name }}</td>
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<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>
</tfoot>
</table>

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

@ -84,7 +84,7 @@
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ format_decimal($job->progress) }} %</td>
@can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
@endcan
<td class="text-center">
{{ $job->updated_at->diffForHumans() }} <br>
@ -112,7 +112,7 @@
<span title="Overal Progress" style="font-weight:300">({{ format_decimal($project->getJobOveralProgress()) }} %)</span>
</th>
@can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($groupedJobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($groupedJobs->sum('price')) }}</th>
@endcan
<th colspan="2">
@can('update', $project)

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

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

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

@ -7,8 +7,8 @@
<tr><td>{{ trans('project.description') }}</td><td>{!! nl2br($project->description) !!}</td></tr>
<tr><td>{{ trans('project.proposal_date') }}</td><td>{{ date_id($project->proposal_date) }}</td></tr>
@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
<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>

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

@ -38,7 +38,7 @@
<div class="col-xs-12 text-right">
<i class="fa fa-money fa-2x pull-left"></i>
<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>

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

@ -36,7 +36,7 @@
<tr>
<td class="text-center">{{ 1 + $key }}</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->description }} [{{ $payment->type() }}]</td>
<td class="text-center">
@ -53,7 +53,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -33,7 +33,7 @@
<td>{{ $subscription->nameLink() }}</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">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td>
{!! 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']) !!}

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

@ -23,9 +23,9 @@
<tr>
<td>{{ 1 + $key }}</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 class="text-center">{{ $project->present()->status }}</td>
</tr>
@ -36,7 +36,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -67,7 +67,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

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

@ -50,9 +50,9 @@
<tr>
<td class="text-center">{{ date_id($date = $year.'-'.$month.'-'.$dateNumber) }}</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">
{{ link_to_route(
'reports.payments.daily',
@ -75,9 +75,9 @@
<tr>
<th class="text-right">{{ __('app.total') }}</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>
</tr>
</tfoot>

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

@ -44,9 +44,9 @@
<tr>
<td class="text-center">{{ month_id($monthNumber) }}</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">
{{ link_to_route(
'reports.payments.monthly',
@ -69,9 +69,9 @@
<tr>
<th class="text-center">{{ trans('app.total') }}</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>
</tr>
</tfoot>

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

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

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

@ -1,7 +1,7 @@
<table class="table table-condensed">
<tbody>
<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.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>

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

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

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

@ -30,7 +30,7 @@
<td>{{ $project->nameLink() }}</td>
<td class="text-center">{{ $project->start_date }}</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>{{ $project->customer->name }}</td>
<td>

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

@ -44,7 +44,7 @@
<td class="text-center">{{ 1 + $key }}</td>
<td>{{ $payment->project->name }}</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>
</tr>
@endforeach
@ -52,7 +52,7 @@
<tfoot>
<tr>
<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>
</tr>
</tfoot>

6
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']);
}

2
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);
}

2
tests/Feature/ManageSubscriptionsTest.php

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

12
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));
}
}
Loading…
Cancel
Save