From d2ed6f9df97385e36127c853891db196366eb355 Mon Sep 17 00:00:00 2001 From: KhatamNugraha Date: Thu, 21 Mar 2024 15:02:29 +0700 Subject: [PATCH] FIX formate currency --- Entities/Account.php | 5 +- Http/Controllers/KonfirmasiBankController.php | 10 ++-- Resources/views/pages/index.blade.php | 8 ++-- .../views/pages/index_fasilitas.blade.php | 10 ++-- Resources/views/pages/index_signer.blade.php | 47 ++++++++++++++++--- 5 files changed, 59 insertions(+), 21 deletions(-) diff --git a/Entities/Account.php b/Entities/Account.php index 004a336..cd820a4 100644 --- a/Entities/Account.php +++ b/Entities/Account.php @@ -81,8 +81,9 @@ class Account extends Model // ->where('INACTIV_MARKER', NULL) ->where('AC.BATCH_DATE',$startDate) ->whereIn('AC.ACCOUNT_NUMBER', $arrAccount) - ->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','600','660','101']) + //->whereIn(DB::raw("LEFT(CATEGORY, 3)"),['100','600','660','101']) ->groupBy('CUSTOMER_NO','ACCOUNT_NUMBER','SHORT_TITLE','SHORT_NAME','COMPANY_NAME') + ->orderBy('SHORT_NAME', 'ASC') ->limit(100); return $data; } @@ -213,4 +214,4 @@ class Account extends Model -} \ No newline at end of file +} diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index ca6fe82..361ba34 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -32,6 +32,9 @@ use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Storage; use Modules\Konfirmasibank\Http\Requests\Fasilitas\StoreFasilitasRequest; + use Akaunting\Money\Currency; + use Akaunting\Money\Money; + class KonfirmasiBankController extends Controller { public $user; @@ -402,13 +405,12 @@ } $fasilitas = Fasilitas::where('nomor_cif',$request['cusNo'] )->where('status',1)->get(); + foreach ($fasilitas as $key3 => $val3) { - $saldo1 = str_replace(',', '.',$val3->saldo); - $saldo2 = str_replace('.', '',$saldo1); $DataFasilitas[$key3]['jenis_fasilitas'] = $val3->jenis_fasilitas; $DataFasilitas[$key3]['start_date'] = $val3->start_date; $DataFasilitas[$key3]['mata_uang'] = $val3->mata_uang; - $DataFasilitas[$key3]['saldo'] = number_format($saldo2, 2, ',', '.') ?? '';; + $DataFasilitas[$key3]['saldo'] = number_format(floatval($val3->saldo), 2, ',', '.'); $DataFasilitas[$key3]['jangka_waktu'] = $val3->jangka_waktu; $DataFasilitas[$key3]['fixed_rate'] = $val3->fixed_rate ?? ''; $DataFasilitas[$key3]['due_date'] = $val3->due_date ?? ''; @@ -647,4 +649,4 @@ } - } \ No newline at end of file + } diff --git a/Resources/views/pages/index.blade.php b/Resources/views/pages/index.blade.php index e4517fe..bf519ae 100644 --- a/Resources/views/pages/index.blade.php +++ b/Resources/views/pages/index.blade.php @@ -8,6 +8,7 @@ +