diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php
index e6fd186..8b2dbd0 100644
--- a/app/Helpers/helpers.php
+++ b/app/Helpers/helpers.php
@@ -1,17 +1,17 @@
'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/resources/views/cart/partials/draft-confirm.blade.php b/resources/views/cart/partials/draft-confirm.blade.php
index 570be31..49261e9 100644
--- a/resources/views/cart/partials/draft-confirm.blade.php
+++ b/resources/views/cart/partials/draft-confirm.blade.php
@@ -19,10 +19,10 @@
| {{ $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']);
}