From 7255ef3ea903c20ef20748a7a14571f6117e1bdb Mon Sep 17 00:00:00 2001 From: Afiq Hamzah Date: Mon, 27 Nov 2023 10:17:57 +0800 Subject: [PATCH] Update tinker files to use new Helper implementations --- tinker/getLaporanCawangan.php | 11 ++++++----- tinker/getLaporanGadaiAll.php | 3 ++- tinker/getLaporanGadaiAllSummary.php | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tinker/getLaporanCawangan.php b/tinker/getLaporanCawangan.php index ee6f18f..57b5464 100644 --- a/tinker/getLaporanCawangan.php +++ b/tinker/getLaporanCawangan.php @@ -7,6 +7,7 @@ use App\Gadai; use App\Marhun; use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\Request; +use App\Helper; // test variable $request = new Request(); @@ -150,9 +151,9 @@ $total_gadaian = $total_gadaian->zip($customer_info, $marhun_gadaian)->map(funct 'no_kp' => $gadai['nokp'], 'masa' => $gadai['masa'], 'marhun' => $marhun_gadaian, - 'berat' => formatNumber($gadai['berat']), - 'nilai_marhun' => formatNumber($gadai['nilaimarhun']), - 'pembiayaan' => formatNumber($gadai['pinjaman']), + 'berat' => Helper::formatNumber($gadai['berat']), + 'nilai_marhun' => Helper::formatNumber($gadai['nilaimarhun']), + 'pembiayaan' => Helper::formatNumber($gadai['pinjaman']), 'peratusan_margin_pinjaman' => $gadai['percentpinj'], 'teller' => $gadai['teller'], ]; @@ -170,8 +171,8 @@ $total_gadaian = $total_gadaian $data = [ 'query' => [ - 'startDate' => formatDate($request->startDate), - 'endDate' => formatDate($request->endDate), + 'startDate' => Helper::formatDate($request->startDate), + 'endDate' => Helper::formatDate($request->endDate), ], 'cawangan_detail' => $cawangan_detail, 'gadaian' => $total_gadaian, diff --git a/tinker/getLaporanGadaiAll.php b/tinker/getLaporanGadaiAll.php index d1d09b7..0addbcf 100644 --- a/tinker/getLaporanGadaiAll.php +++ b/tinker/getLaporanGadaiAll.php @@ -3,10 +3,11 @@ use App\Cawangan; use App\Customer; use App\Gadai; +use App\Helper; $tarikh = '2023-11-01'; -$active_cawangan_db_connection = getActiveCawanganDbConnection(); +$active_cawangan_db_connection = Helper::getActiveCawanganDbConnection(); $active_cawangan_db = array_map(function($connection){ return config('database.connections.' . $connection)['database']; diff --git a/tinker/getLaporanGadaiAllSummary.php b/tinker/getLaporanGadaiAllSummary.php index 4d03b51..dae0053 100644 --- a/tinker/getLaporanGadaiAllSummary.php +++ b/tinker/getLaporanGadaiAllSummary.php @@ -3,9 +3,10 @@ use App\Cawangan; use App\Gadai; use Illuminate\Support\Facades\DB; +use App\Helper; $tarikh = '2023-11-01'; -$active_cawangan_db_connection = getActiveCawanganDbConnection(); +$active_cawangan_db_connection = Helper::getActiveCawanganDbConnection(); $active_cawangan_db_name = array_map(function($db_connection){ return config('database.connections' . '.' . $db_connection. '.' . 'database' );