@@ -80,7 +80,7 @@ class CawanganDebugConnections extends Command
|
|||||||
return $idToNameMap[$item['mysql']] !== $item['database'];
|
return $idToNameMap[$item['mysql']] !== $item['database'];
|
||||||
});
|
});
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
dump(sprintf('Connection %s not found in table online_arrahn.arrahn_master_db but present in config. Make sure both of connection exist in both app/config and arrahn_master_db', $tested_connection));
|
dump(sprintf('Connection %s not found in table %s.arrahn_master_db but present in config. Make sure both of connection exist in both app/config and arrahn_master_db', $tested_connection, config('tennant_database.master_db')));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,7 @@ class Helper
|
|||||||
{
|
{
|
||||||
|
|
||||||
$online_arrahn_connection = array_filter(config('database.connections'), function ($connection) {
|
$online_arrahn_connection = array_filter(config('database.connections'), function ($connection) {
|
||||||
if ($connection['database'] === 'online_arrahn') {
|
if ($connection['database'] === config('tennant_database.master_db')) {
|
||||||
return $connection;
|
return $connection;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -43,7 +43,7 @@ class Helper
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$non_cawangan_database = ['lelong', 'online_arrahn', 'kaunterpkb'];
|
$non_cawangan_database = ['lelong', config('tennant_database.master_db'), config('tennant_database.kaunter_db')];
|
||||||
|
|
||||||
$all_cawangan_db = array_filter($all_active_db_keys, function ($db_key) use ($non_cawangan_database) {
|
$all_cawangan_db = array_filter($all_active_db_keys, function ($db_key) use ($non_cawangan_database) {
|
||||||
$isNotCawangan = in_array(config('database.connections.' . $db_key . '.database'), $non_cawangan_database);
|
$isNotCawangan = in_array(config('database.connections.' . $db_key . '.database'), $non_cawangan_database);
|
||||||
@@ -74,7 +74,7 @@ class Helper
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$non_cawangan_database = ['lelong', 'online_arrahn', 'kaunterpkb'];
|
$non_cawangan_database = ['lelong', config('tennant_database.master_db'), config('tennant_database.kaunter_db')];
|
||||||
|
|
||||||
$all_cawangan_db = array_filter($all_inactive_db_keys, function ($db_key) use ($non_cawangan_database) {
|
$all_cawangan_db = array_filter($all_inactive_db_keys, function ($db_key) use ($non_cawangan_database) {
|
||||||
$isNotCawangan = in_array(config('database.connections.' . $db_key . '.database'), $non_cawangan_database);
|
$isNotCawangan = in_array(config('database.connections.' . $db_key . '.database'), $non_cawangan_database);
|
||||||
|
|||||||
@@ -4050,11 +4050,11 @@ class AdminPageController extends Controller
|
|||||||
'tarikh' => $request->tarikh,
|
'tarikh' => $request->tarikh,
|
||||||
'kodcaw' => $kodcaw,
|
'kodcaw' => $kodcaw,
|
||||||
]);
|
]);
|
||||||
$exception_case = $this->AkruKeuntunganSebenar($requestData);
|
$exception_case = $this->AkruKeuntunganSebenar($requestData)->getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
$backdate_keun_sebenar += isset($get_imbangduga['keun_sebenar']) ? $get_imbangduga['keun_sebenar'] : 0;
|
$backdate_keun_sebenar += isset($get_imbangduga['keun_sebenar']) ? $get_imbangduga['keun_sebenar'] : 0;
|
||||||
$backdate_keun_sebenar += $exception_case;
|
$backdate_keun_sebenar += (float) ($exception_case ?? 0);
|
||||||
$recentDate->subYear()->startOfYear();
|
$recentDate->subYear()->startOfYear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ class CustomerController extends Controller
|
|||||||
$customer = Customer::on($cawangan['mysql'])
|
$customer = Customer::on($cawangan['mysql'])
|
||||||
->where('kplama','=',$nokp)
|
->where('kplama','=',$nokp)
|
||||||
->orWhere('kpbaru','=',$nokp)
|
->orWhere('kpbaru','=',$nokp)
|
||||||
->rightJoin('online_arrahn.bank', 'bank.id', '=', 'customer.kodbank')
|
->rightJoin(config('tennant_database.master_db') . '.bank', 'bank.id', '=', 'customer.kodbank')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if(!empty($customer))
|
if(!empty($customer))
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class MarhunController extends Controller
|
|||||||
$marhun = Marhun::on($cawangan['mysql'])
|
$marhun = Marhun::on($cawangan['mysql'])
|
||||||
->select('marhun.norujukan','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai','marhun.tag_permata', 'marhun.berat_batu_permata')
|
->select('marhun.norujukan','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai','marhun.tag_permata', 'marhun.berat_batu_permata')
|
||||||
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
||||||
->rightJoin('online_arrahn.customer as customer', 'customer.kpbaru','=','gadai.nokp')
|
->rightJoin(config('tennant_database.master_db') . '.customer as customer', 'customer.kpbaru','=','gadai.nokp')
|
||||||
->where('marhun.t_gadai','=',$tarikh)
|
->where('marhun.t_gadai','=',$tarikh)
|
||||||
->orderBy('marhun.t_gadai')
|
->orderBy('marhun.t_gadai')
|
||||||
->get();
|
->get();
|
||||||
@@ -221,7 +221,7 @@ class MarhunController extends Controller
|
|||||||
$marhun = Marhun::on($cawangan['mysql'])
|
$marhun = Marhun::on($cawangan['mysql'])
|
||||||
->select('marhun.norujukan','gadai.sttebus','gadai.pinjaman','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai')
|
->select('marhun.norujukan','gadai.sttebus','gadai.pinjaman','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai')
|
||||||
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
||||||
->rightJoin('online_arrahn.customer as customer', 'customer.kpbaru','=','gadai.nokp')
|
->rightJoin(config('tennant_database.master_db') . '.customer as customer', 'customer.kpbaru','=','gadai.nokp')
|
||||||
->where('marhun.t_gadai','<=',$tarikh)
|
->where('marhun.t_gadai','<=',$tarikh)
|
||||||
->whereYear('marhun.t_gadai','=',$current->year)
|
->whereYear('marhun.t_gadai','=',$current->year)
|
||||||
->where('gadai.sttebus','=','')
|
->where('gadai.sttebus','=','')
|
||||||
|
|||||||
@@ -377,7 +377,8 @@ class ImbangDugaService
|
|||||||
return $transaction->trans_type !== 'A';
|
return $transaction->trans_type !== 'A';
|
||||||
})->sum('keuntungan_rebet');
|
})->sum('keuntungan_rebet');
|
||||||
|
|
||||||
$total = $total_ansuran + $total_tebus + $get_imbangduga['keun_sebenar'];
|
$backdate_keun_sebenar = isset($get_imbangduga['keun_sebenar']) ? $get_imbangduga['keun_sebenar'] : 0;
|
||||||
|
$total = $total_ansuran + $total_tebus + $backdate_keun_sebenar;
|
||||||
|
|
||||||
return $total;
|
return $total;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1322,7 +1322,7 @@ class RingkasanHarianService
|
|||||||
return floatval($totalSerahan);
|
return floatval($totalSerahan);
|
||||||
}
|
}
|
||||||
|
|
||||||
return floatval(0);
|
return floatval($serahanpkbTawarruq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@ $app->singleton(
|
|||||||
|
|
||||||
$app->configure('app');
|
$app->configure('app');
|
||||||
$app->configure('tinker');
|
$app->configure('tinker');
|
||||||
$app->configure('tennant_master');
|
$app->configure('tennant_database');
|
||||||
$app->configure('report');
|
$app->configure('report');
|
||||||
$app->configure('app_parameter');
|
$app->configure('app_parameter');
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'master_db' => env('TENNANT_MASTER_DB','online_arrahn'),
|
||||||
|
'kaunter_db' => env('TENNANT_KAUNTER_DB','kaunterpkb')
|
||||||
|
];
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'database' => env('TENNANT_MASTER_DB','master_erahn')
|
|
||||||
];
|
|
||||||
@@ -42,7 +42,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
|
|||||||
{
|
{
|
||||||
$online_arrahn_connection_array = array_filter(config('database.connections'), function($connection) {
|
$online_arrahn_connection_array = array_filter(config('database.connections'), function($connection) {
|
||||||
|
|
||||||
if($connection['database'] === 'online_arrahn' || $connection['database'] === 'master_krk' || $connection['database'] === config('tennant_master.database')){
|
if($connection['database'] === config('tennant_database.master_db')){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
|
|||||||
|
|
||||||
|
|
||||||
if(empty($online_arrahn_connection_array)){
|
if(empty($online_arrahn_connection_array)){
|
||||||
throw new Exception("online_arrahn or master_krk doesn't exist in config.database.connections array");
|
throw new Exception("Tennant master database (" . config('tennant_database.master_db') . ") doesn't exist in config.database.connections array");
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_keys($online_arrahn_connection_array)[0];
|
return array_keys($online_arrahn_connection_array)[0];
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ $all_active_db_keys = array_filter(array_keys(config('database.connections')), f
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$non_cawangan_database = ['lelong', 'online_arrahn', 'kaunterpkb'];
|
$non_cawangan_database = ['lelong', config('tennant_database.master_db'), config('tennant_database.kaunter_db')];
|
||||||
|
|
||||||
$all_cawangan_db = array_filter($all_active_db_keys, function($db_key) use($non_cawangan_database){
|
$all_cawangan_db = array_filter($all_active_db_keys, function($db_key) use($non_cawangan_database){
|
||||||
$isNotCawangan = in_array(config('database.connections.' . $db_key . '.database'), $non_cawangan_database);
|
$isNotCawangan = in_array(config('database.connections.' . $db_key . '.database'), $non_cawangan_database);
|
||||||
|
|||||||
Reference in New Issue
Block a user