diff --git a/app/Helpers/date_time.php b/app/Helpers/date_time.php
index 19963b7..dea70f1 100644
--- a/app/Helpers/date_time.php
+++ b/app/Helpers/date_time.php
@@ -1,23 +1,6 @@
__('time.months.01'),
@@ -69,7 +52,7 @@ function getMonths()
];
}
-function getYears()
+function get_years()
{
$yearRange = range(2017, date('Y'));
foreach ($yearRange as $year) {
@@ -79,7 +62,7 @@ function getYears()
return $years;
}
-function monthDateArray($year, $month)
+function month_date_array($year, $month)
{
$dateCount = Carbon\Carbon::parse($year.'-'.$month)->format('t');
$dates = [];
diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php
index d2a0006..8b2dbd0 100644
--- a/app/Helpers/helpers.php
+++ b/app/Helpers/helpers.php
@@ -1,17 +1,17 @@
decode(link_to_route($name, $title, $parameters, $attributes));
}
-function formatSizeUnits($bytes)
+function format_size_units($bytes)
{
if ($bytes >= 1073741824) {
$bytes = number_format($bytes / 1073741824, 2).' GB';
diff --git a/app/Http/Controllers/CartController.php b/app/Http/Controllers/CartController.php
index fb586a0..7397693 100644
--- a/app/Http/Controllers/CartController.php
+++ b/app/Http/Controllers/CartController.php
@@ -125,8 +125,8 @@ class CartController extends Controller
'payment' => 'required|numeric|min:'.$request->get('total').'|max:'.($request->get('total') + 100000),
'notes' => 'nullable|string|max:100',
], [
- 'payment.min' => 'Pembayaran minimal '.formatRp($request->get('total')).'.',
- 'payment.max' => 'Pembayaran terlalu besar '.formatRp($request->get('payment')).'.',
+ 'payment.min' => 'Pembayaran minimal '.format_rp($request->get('total')).'.',
+ 'payment.max' => 'Pembayaran terlalu besar '.format_rp($request->get('payment')).'.',
]);
$draft = $this->cart->updateDraftAttributes($draftKey, $request->only('customer', 'notes', 'payment'));
diff --git a/app/Http/Controllers/Reports/SalesController.php b/app/Http/Controllers/Reports/SalesController.php
index 84174df..d3e2aaf 100755
--- a/app/Http/Controllers/Reports/SalesController.php
+++ b/app/Http/Controllers/Reports/SalesController.php
@@ -27,8 +27,8 @@ class SalesController extends Controller
public function monthly(Request $request)
{
- $years = getYears();
- $months = getMonths();
+ $years = get_years();
+ $months = get_months();
$year = $request->get('year', date('Y'));
$month = $request->get('month', date('m'));
$reports = $this->getMonthlyReports($year, $month);
@@ -41,7 +41,7 @@ class SalesController extends Controller
$year = $request->get('year', date('Y'));
$reports = $this->getYearlyReports($year);
- $years = getYears();
+ $years = get_years();
return view('reports.sales.yearly', compact('reports', 'years', 'year'));
}
diff --git a/resources/views/backups/index.blade.php b/resources/views/backups/index.blade.php
index 745e233..2848ff7 100644
--- a/resources/views/backups/index.blade.php
+++ b/resources/views/backups/index.blade.php
@@ -21,7 +21,7 @@
| {{ $key + 1 }} |
{{ $backup->getFilename() }} |
- {{ formatSizeUnits($backup->getSize()) }} |
+ {{ format_size_units($backup->getSize()) }} |
{{ date('Y-m-d H:i:s', $backup->getMTime()) }} |
| {{ $key + 1 }} |
{{ $item->name }} |
- {{ formatRp($item->price) }} |
- {{ formatRp($item->item_discount) }} |
+ {{ format_rp($item->price) }} |
+ {{ format_rp($item->item_discount) }} |
{{ $item->qty }} |
- {{ formatRp($item->subtotal) }} |
+ {{ format_rp($item->subtotal) }} |
@empty
@endforelse
@@ -32,15 +32,15 @@
{{ trans('transaction.subtotal') }} : |
- {{ formatRp($draft->getSubtotal()) }} |
+ {{ format_rp($draft->getSubtotal()) }} |
| {{ trans('transaction.discount_total') }} : |
- {{ formatRp($draft->getDiscountTotal()) }} |
+ {{ format_rp($draft->getDiscountTotal()) }} |
| {{ trans('transaction.total') }} : |
- {{ formatRp($draft->getTotal()) }} |
+ {{ format_rp($draft->getTotal()) }} |
@@ -55,9 +55,9 @@
| {{ trans('transaction.customer_name') }} | {{ $draft->customer['name'] }} |
| {{ trans('transaction.customer_phone') }} | {{ $draft->customer['phone'] }} |
- | {{ trans('transaction.payment') }} | {{ formatRp($draft->payment) }} |
- | {{ trans('transaction.total') }} | {{ formatRp($draft->getTotal()) }} |
- | {{ trans('transaction.exchange') }} | {{ formatRp($draft->getExchange()) }} |
+ | {{ trans('transaction.payment') }} | {{ format_rp($draft->payment) }} |
+ | {{ trans('transaction.total') }} | {{ format_rp($draft->getTotal()) }} |
+ | {{ trans('transaction.exchange') }} | {{ format_rp($draft->getExchange()) }} |
| {{ trans('transaction.notes') }} | {{ $draft->notes }} |
diff --git a/resources/views/cart/partials/draft-item-list.blade.php b/resources/views/cart/partials/draft-item-list.blade.php
index 7029cae..40b9a9c 100644
--- a/resources/views/cart/partials/draft-item-list.blade.php
+++ b/resources/views/cart/partials/draft-item-list.blade.php
@@ -27,7 +27,7 @@
{{ $item->name }}
({{ $item->unit }})
- {{ formatRp($item->price) }} |
+ {{ format_rp($item->price) }} |
{{ Form::open(['route' => ['cart.update-draft-item', $draft->draftKey], 'method' => 'patch']) }}
{{ Form::hidden('item_key', $key) }}
@@ -43,7 +43,7 @@
'min' => 1
]) }}
|
- {{ formatRp($item->subtotal) }} |
+ {{ format_rp($item->subtotal) }} |
{{ Form::submit('update-item-' . $key, ['style'=>'display:none']) }}
{{ Form::close() }}
@@ -60,17 +60,17 @@
|
| {{ trans('transaction.subtotal') }} : |
- {{ formatRp($draft->getSubtotal()) }} |
+ {{ format_rp($draft->getSubtotal()) }} |
|
| {{ trans('transaction.discount_total') }} : |
- {{ formatRp($draft->getDiscountTotal()) }} |
+ {{ format_rp($draft->getDiscountTotal()) }} |
|
| {{ trans('transaction.total') }} : |
- {{ formatRp($draft->getTotal()) }} |
+ {{ format_rp($draft->getTotal()) }} |
|
diff --git a/resources/views/cart/partials/product-search-result-box.blade.php b/resources/views/cart/partials/product-search-result-box.blade.php
index 60e050c..1266191 100644
--- a/resources/views/cart/partials/product-search-result-box.blade.php
+++ b/resources/views/cart/partials/product-search-result-box.blade.php
@@ -13,7 +13,7 @@
| {{ $product->name }} |
{{ $product->unit->name }} |
- {{ formatRp($product->getPrice($draftType)) }} |
+ {{ format_rp($product->getPrice($draftType)) }} |
|
{{ $transaction->items_count }} |
- {{ formatRp($transaction->total) }} |
+ {{ format_rp($transaction->total) }} |
{{ link_to_route('transactions.show', trans('app.show'), $transaction->invoice_no) }} |
{{ link_to_route('transactions.receipt', trans('app.print'), $transaction->invoice_no) }}
diff --git a/resources/views/transactions/pdf.blade.php b/resources/views/transactions/pdf.blade.php
index f12d40a..c16ae46 100644
--- a/resources/views/transactions/pdf.blade.php
+++ b/resources/views/transactions/pdf.blade.php
@@ -47,32 +47,32 @@
|
| {{ $item['qty'] }} |
- {{ formatRp($item['price']) }} ({{ formatRp($item['item_discount']) }})
+ {{ format_rp($item['price']) }} ({{ format_rp($item['item_discount']) }})
|
- {{ formatRp($item['subtotal']) }} |
+ {{ format_rp($item['subtotal']) }} |
@endforeach
@if ($loop->last && $loop->parent->last)
| {{ trans('transaction.subtotal') }} : |
- {{ formatRp($transaction['total'] + $discountTotal) }} |
+ {{ format_rp($transaction['total'] + $discountTotal) }} |
| {{ trans('transaction.discount_total') }} : |
- {{ formatRp($discountTotal) }} |
+ {{ format_rp($discountTotal) }} |
| {{ trans('transaction.total') }} : |
- {{ formatRp($transaction['total']) }} |
+ {{ format_rp($transaction['total']) }} |
| {{ trans('transaction.payment') }} : |
- {{ formatRp($transaction->payment) }} |
+ {{ format_rp($transaction->payment) }} |
| {{ trans('transaction.exchange') }} : |
- {{ formatRp($transaction->getExchange()) }} |
+ {{ format_rp($transaction->getExchange()) }} |
@endif
diff --git a/resources/views/transactions/receipt.blade.php b/resources/views/transactions/receipt.blade.php
index a884566..3edf2e2 100644
--- a/resources/views/transactions/receipt.blade.php
+++ b/resources/views/transactions/receipt.blade.php
@@ -53,31 +53,31 @@
| {{ $item['qty'] }} |
- {{ formatRp($item['price']) }} ({{ formatRp($item['item_discount']) }})
+ {{ format_rp($item['price']) }} ({{ format_rp($item['item_discount']) }})
|
- {{ formatRp($item['subtotal']) }} |
+ {{ format_rp($item['subtotal']) }} |
@endforeach
| {{ trans('transaction.subtotal') }} : |
- {{ formatRp($transaction['total'] + $discountTotal) }} |
+ {{ format_rp($transaction['total'] + $discountTotal) }} |
| {{ trans('transaction.discount_total') }} : |
- {{ formatRp($discountTotal) }} |
+ {{ format_rp($discountTotal) }} |
| {{ trans('transaction.total') }} : |
- {{ formatRp($transaction['total']) }} |
+ {{ format_rp($transaction['total']) }} |
| {{ trans('transaction.payment') }} : |
- {{ formatRp($transaction->payment) }} |
+ {{ format_rp($transaction->payment) }} |
| {{ trans('transaction.exchange') }} : |
- {{ formatRp($transaction->getExchange()) }} |
+ {{ format_rp($transaction->getExchange()) }} |
diff --git a/resources/views/transactions/show.blade.php b/resources/views/transactions/show.blade.php
index 925a904..21d7d80 100644
--- a/resources/views/transactions/show.blade.php
+++ b/resources/views/transactions/show.blade.php
@@ -20,9 +20,9 @@
| {{ trans('transaction.customer_name') }} | {{ $transaction->customer['name'] }} |
| {{ trans('transaction.customer_phone') }} | {{ $transaction->customer['phone'] }} |
| {{ trans('transaction.items_count') }} | {{ $transaction->items_count }} |
- | {{ trans('transaction.total') }} | {{ formatRp($transaction->total) }} |
- | {{ trans('transaction.payment') }} | {{ formatRp($transaction->payment) }} |
- | {{ trans('transaction.exchange') }} | {{ formatRp($transaction->getExchange()) }} |
+ | {{ trans('transaction.total') }} | {{ format_rp($transaction->total) }} |
+ | {{ trans('transaction.payment') }} | {{ format_rp($transaction->payment) }} |
+ | {{ trans('transaction.exchange') }} | {{ format_rp($transaction->getExchange()) }} |
@@ -52,10 +52,10 @@
{{ $item['name'] }}
({{ $item['unit'] }})
- {{ formatRp($item['price']) }} |
- {{ formatRp($item['item_discount']) }} |
+ {{ format_rp($item['price']) }} |
+ {{ format_rp($item['item_discount']) }} |
{{ $item['qty'] }} |
- {{ formatRp($item['subtotal']) }} |
+ {{ format_rp($item['subtotal']) }} |
@endforeach
@@ -63,15 +63,15 @@
| {{ trans('transaction.subtotal') }} : |
- {{ formatRp($transaction['total'] + $discountTotal) }} |
+ {{ format_rp($transaction['total'] + $discountTotal) }} |
| {{ trans('transaction.discount_total') }} : |
- {{ formatRp($discountTotal) }} |
+ {{ format_rp($discountTotal) }} |
| {{ trans('transaction.total') }} : |
- {{ formatRp($transaction['total']) }} |
+ {{ format_rp($transaction['total']) }} |
diff --git a/tests/Feature/TransactionEntryTest.php b/tests/Feature/TransactionEntryTest.php
index b602dea..f67ca46 100644
--- a/tests/Feature/TransactionEntryTest.php
+++ b/tests/Feature/TransactionEntryTest.php
@@ -67,7 +67,7 @@ class TransactionEntryTest extends BrowserKitTestCase
$this->seePageIs(route('cart.show', [$draft->draftKey, 'query' => 'testing']));
// See product list appears
$this->see($product->name);
- $this->see(formatRp($product->credit_price));
+ $this->see(format_rp($product->credit_price));
$this->seeElement('form', ['action' => route('cart.add-draft-item', [$draft->draftKey, $product->id])]);
$this->seeElement('input', ['id' => 'qty-'.$product->id, 'name' => 'qty']);
$this->seeElement('input', ['id' => 'add-product-'.$product->id]);
@@ -110,7 +110,7 @@ class TransactionEntryTest extends BrowserKitTestCase
$this->seeElement('input', ['id' => 'qty-'. 0]);
$this->seeElement('input', ['id' => 'item_discount-'. 0]);
$this->seeElement('button', ['id' => 'remove-item-'. 0]);
- $this->see(formatRp(3800));
+ $this->see(format_rp(3800));
}
/** @test */
@@ -173,8 +173,8 @@ class TransactionEntryTest extends BrowserKitTestCase
$this->assertEquals(6000, $draft->getSubtotal());
$this->assertEquals(5600, $draft->getTotal());
- $this->see(formatRp($draft->getSubtotal()));
- $this->see(formatRp($draft->getTotal()));
+ $this->see(format_rp($draft->getSubtotal()));
+ $this->see(format_rp($draft->getTotal()));
}
/** @test */
@@ -208,8 +208,8 @@ class TransactionEntryTest extends BrowserKitTestCase
$this->see($draft->customer['name']);
$this->see($draft->customer['phone']);
$this->see($draft->notes);
- $this->see(formatRp(10000));
- $this->see(formatRp(3000));
+ $this->see(format_rp(10000));
+ $this->see(format_rp(3000));
$this->seeElement('input', ['id' => 'save-transaction-draft']);
}