Merge branch 'ujrah_master' of https://bitbucket.org/arrahn-pkb/api_arrahn into finadev

This commit is contained in:
Afrina Alimi
2024-01-16 15:00:21 +08:00
10 changed files with 1253 additions and 20 deletions
@@ -73,15 +73,26 @@ class CawanganDebugConnections extends Command
$idToNameMap[$item['mysql']] = $item['db_name'];
}
$tested_connection = '';
try {
$filteredArray2 = array_filter($array2, function ($item) use ($idToNameMap) {
$tested_connection = $idToNameMap[$item['mysql']];
return $idToNameMap[$item['mysql']] !== $item['database'];
});
} 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));
return;
}
return $filteredArray2;
}
$filteredConnections = filterArraysByDatabaseNames($all_cawangan, $all_cawangan_in_config);
if($filteredConnections === null OR sizeof($filteredConnections) > 1){
return;
}
$isOK = true;
// checks if there is connection errors
+443 -15
View File
@@ -42,6 +42,9 @@ use App\Services\MasterServices;
use App\Daerah;
use App\Poskod;
use App\Negeri;
use App\NotisJbg;
use App\NotJbg;
use App\CawanganNotisJbg;
use Log;
use App\Services\OnePercentServices;
@@ -1080,25 +1083,450 @@ class CallCenterController extends Controller
}
}
return response()->json('success');
}
}
}
}
public function getcawnotiskemaskini($notisid)
{
$current = Carbon::now();
$current = new Carbon();
//carian untuk notis jbg
public function getJbgGadai($kodcaw,Request $request)
{
// return 1;
//$kodcaw = $request->kodcaw;
$jbgmula = $request->jbgmula;
$jbghingga = $request->jbghingga;
$arraybatch = [];
$batchnotis = Notis::on('mysql7')->where('id',$notisid)->get();
$cawangan_all = Cawangan::on('mysql7')->get();
$cawnotis_all = [];
foreach ($batchnotis as $index => $cawangan){
$notis = CawanganNotis::on('mysql7')
->join('arrahn_master_db', 'arrahn_master_db.kodcaw', '=', 'cawangan_notis.kodcaw')
->where('notis_id',$notisid)->get();
// dd($jbghingga, $jbgmula);
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$gadaian = Gadai::on($cawangan['mysql'])
->where([['tagpalsu','=',0],['tempoh','>=',$jbgmula],['tempoh','<=',$jbghingga],['sttebus','=',''],['taglel','=',0]])
->orderBy('t_gadai', 'ASC')
->orderBy('sirig', 'ASC');
$arraynorujukan = $gadaian->pluck('norujukan')->toArray();
$rekodgadai = $gadaian->get();
$totalrekod = $gadaian->count('norujukan');
$totalberat = $gadaian->sum('berat');
$totalnilaimarhun = $gadaian->sum('nilaimarhun');
$totalpinjaman = $gadaian->sum('pinjaman');
$totalbakipjm = $gadaian->sum('bakipjm');
$totaltunggakan = $gadaian->sum('tunggakan');
$arrayrekod = ['rekod' => $rekodgadai, 'totalsag' => $totalrekod,'totalberat' => $totalberat,'totalnilaimarhun' => $totalnilaimarhun,'totalpembiayaan'=>$totalpinjaman,'totalbakipjm'=>$totalbakipjm,'totaltunggakan'=>$totaltunggakan];
//dd($arrayrekod);
return response()->json($arrayrekod,200);
}
public function getbatchnotisjbg(Request $request){
$currentDate = Carbon::now();
$tarikh_daftar = $currentDate->toDateString();
$jbgmula = $request->jbgmula;
$jbghingga = $request->jbghingga;
$notis = NotJbg::create([
'tarikh_notjbg' => $tarikh_daftar,
'daritempoh' => $jbgmula,
'hinggatempoh' => $jbghingga,
'sts_notis' => 1,
'notiskali' => 1
]);
$batchnotis = NotJbg::on('mysql7')->orderBy('id','desc')->first()->id;
return response()->json($batchnotis);
}
public function insertdatagadaijbg($kodcaw,Request $request)
{
$jbgmula = $request->jbgmula;
$jbghingga = $request->jbghingga;
$notisid = $request->notisid;
$currentDate = Carbon::now();
// $currentDate = $currentDate->toDateString();
$tarikh_daftar = $currentDate->toDateString();
$sag_cawangans = [];
$bil_surat = 0;
// dd($kodcaw);
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$datagadaijbg = Gadai::on($cawangan['mysql'])
->where([['tagpalsu','=',0],['tempoh','>=',$jbgmula],['tempoh','<=',$jbghingga],['sttebus','=',''],['taglel','=',0]])
->orderBy('t_gadai', 'ASC')
->orderBy('sirig', 'ASC');
// ->get();
array_push($sag_cawangans,['data'=>$datagadaijbg->get()]);
//dd($sag_cawangans);
foreach($sag_cawangans as $index=>$cawnotis){
// dd($cawnotis);
$caw_notis = new CawanganNotisJbg;
$caw_notis->notjbg_id = $notisid;
$caw_notis->kodcaw = $kodcaw;
$caw_notis->notiskali = 1;
$caw_notis->daritempoh = $jbgmula;
$caw_notis->hinggatempoh = $jbghingga;
$caw_notis->status = 1;
$caw_notis->save();
//dd($caw_notis);
$notiscaw = $cawnotis['data'];
$notis_jbg_arr = [];
$now = Carbon::now();
foreach($notiscaw as $call)
{
$notis_to_be_inserted = new NotisJbg();
$notis_to_be_inserted->notjbg_id = $notisid;
$notis_to_be_inserted->tarikh_daftar = $tarikh_daftar;
$notis_to_be_inserted->kodcaw = $kodcaw;
$notis_to_be_inserted->norujukan = $call->norujukan;
$notis_to_be_inserted->nokp = $call->nokp;
$notis_to_be_inserted->jbg = $call->tempoh;
$notis_to_be_inserted->kadarupah = $call->kadarupah;
$notis_to_be_inserted->nilaimarhun = $call->nilaimarhun;
$notis_to_be_inserted->pinjaman = $call->bakipjm;
$notis_to_be_inserted->bakiupah = $call->bakiupah;
$notis_to_be_inserted->berat = $call->berat;
$notis_to_be_inserted->marhun = $call->marhun;
$notis_to_be_inserted->percentpinj = $call->percentpinj;
$notis_to_be_inserted->notiskali = '1';
$notis_jbg_arr[] = $notis_to_be_inserted->attributesToArray();
}
$notis_jbg_collection = collect($notis_jbg_arr);
NotisJbg::insert($notis_jbg_arr);
}
return response()->json("success");
}
public function senarainotisjbg()
{
$current = Carbon::now();
$current = new Carbon();
$arraybatch = [];
$batchnotis = NotJbg::on('mysql7')->get();
// $cawangan_all = Cawangan::on('mysql7')->get();
// $cawnotis_all = [];
// foreach ($batchnotis as $index => $cawangan){
// $notis = CawanganNotis::on('mysql7')->get();
// if(sizeof($notis) != 0){
// array_push($cawnotis_all,$notis);
// }
// }
return response()->json($batchnotis);
}
public function getcawnotisjbg($notisid)
{
$current = Carbon::now();
$current = new Carbon();
$arraybatch = [];
$batchnotisjbg = NotJbg::on('mysql7')->where('id',$notisid)->get();
$cawangan_all = Cawangan::on('mysql7')->get();
$cawnotisjbg_all = [];
foreach ($batchnotisjbg as $index => $cawangan){
$notis = CawanganNotisJbg::on('mysql7')
->join('arrahn_master_db', 'arrahn_master_db.kodcaw', '=', 'cawangan_notisjbg.kodcaw')
->where('cawangan_notisjbg.notjbg_id',$notisid)->get();
if(sizeof($notis) != 0){
array_push($cawnotisjbg_all,$notis);
}
}
return response()->json($cawnotisjbg_all);
}
public function getcawnotisjbgbycaw(Request $request)
{
$current = Carbon::now();
$current = new Carbon();
$kodcaw = $request->kodcaw;
$notisid = $request->notisid;
$cawnotis_all = [];
$arraybatch = [];
$batchnotis = CawanganNotisJbg::on('mysql7')
->join('arrahn_master_db', 'arrahn_master_db.kodcaw', '=', 'cawangan_notisjbg.kodcaw')
->where('cawangan_notisjbg.notjbg_id',$notisid)->get();
foreach ($batchnotis as $index => $cawangan){
$notis = NotisJbg::on('mysql7')
->where('notisjbg.notjbg_id',$notisid)
->where('notisjbg.kodcaw',$cawangan['kodcaw'])
->distinct()
->get();
$totalsagjbg = $notis->count('norujukan');
//$batchnotis [$index]['totalsag'] = $notis->count('norujukan');
//dd($totalsagjbg);
// if(sizeof($notis) != 0){
array_push($cawnotis_all,['namacaw'=>$batchnotis, 'detailbycaw' => $notis, 'totalsagjbg' =>$totalsagjbg]);
// }
}
// dd($cawnotis_all);
// $arrayrekod = ['rekod' => $cawnotis_all,'totalsagjbg' =>$totalsagjbg];
return response()->json($cawnotis_all);
}
public function bycawnotisjbg($kodcaw,$notisid)
{
$cawnotis_all = [];
$notisjbgbycaw = NotisJbg::on('mysql7')
->where('notisjbg.notjbg_id',$notisid)->where('notisjbg.kodcaw',$kodcaw)
->distinct()
->get();
$notisjbgbycawarray = $notisjbgbycaw->toArray();
foreach($notisjbgbycawarray as $index=>$cal){
$customer = Customer::where('kpbaru','=',$cal['nokp'])
->orWhere('kplama','=',$cal['nokp'])
->first();
$notisjbgbycawarray[$index]['namacust'] = $customer;
}
array_push($notisjbgbycawarray);
return response()->json($notisjbgbycawarray);
}
public function bysagnotisjbg($kodcaw,$notisid,$id)
{
$notissag = NotisJbg::on('mysql7')
//->join('customer','customer.kplama','||','customer.kpbaru','=','notisjbg.nokp')
->where('notisjbg.notjbg_id',$notisid)->where('notisjbg.kodcaw',$kodcaw)->where('notisjbg.id',$id)
->first();
return response()->json($notissag);
}
public function bysagnotisjbgCustomer($kodcaw,$notisid,$id)
{
$notissag = NotisJbg::on('mysql7')
//->join('customer','customer.kplama','||','customer.kpbaru','=','notisjbg.nokp')
->where('notisjbg.notjbg_id',$notisid)->where('notisjbg.kodcaw',$kodcaw)->where('notisjbg.id',$id)
->first();
$nokp = $notissag['nokp'];
// $notissagbyjbgarray = $notissagbyjbg->toArray();
// foreach($notissagbyjbgarray as $index=>$cal){
$cust_info = Customer::where('kpbaru','=',$notissag['nokp'])
->orWhere('kplama','=',$notissag['nokp'])
->first();
// $notissagbyjbgarray[$index]['namacust'] = $customer;
// }
return response()->json($cust_info);
}
public function bycawnotisjbg2($kodcaw,$notisid)
{
$cawnotis_all = [];
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$notisjbgbycaw = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$notisid)->where('notisperingatan.kodcaw',$kodcaw)
->where('notisperingatan.peringatan',2)
->distinct()
->get();
$arraynorujukan = $notisjbgbycaw->pluck('norujukan')->toArray();
$notisnokp = NotisPeringatan::on('mysql7')->whereIn('norujukan', $arraynorujukan)
->where('notisperingatan.peringatan',2)
->select('nokp')
->groupBy('nokp')
->get();
foreach($notisnokp as $index1=>$cal){
$customer = Customer::on('mysql7')->where('kpbaru','=',$cal['nokp'])
->orWhere('kplama','=',$cal['nokp'])
->first();
$listnotis = NotisPeringatan::on('mysql7')->whereIn('norujukan', $arraynorujukan)
// ->where('nokp','=',$cal['nokp'])
->where('nokp', 'like', '%'.$cal['nokp'].'%')
->where('notisperingatan.peringatan',2)
->get();
$listsag = Gadai::on($cawangan['mysql'])
->whereIn('norujukan', $arraynorujukan)
->where('nokp','=',$cal['nokp'])
->get();
foreach($listsag as $index2=>$sag){
if($sag['tagbaru'] == '0'){
$keuntungan = 'asal';
$jeniskeuntungan = ($keuntungan == 'onepercent') ? 'onepercent' : 'asal';
$master = new MasterServices($kodcaw);
$response = $master->kiraUpahTawarruq($kodcaw,$sag['norujukan'],$jeniskeuntungan);
//dd($response);
}elseif($sag['tagbaru'] == '1'){
$keuntungan = 'onepercent';
$jeniskeuntungan = ($keuntungan == 'onepercent') ? 'onepercent' : 'asal';
$master = new MasterServices($kodcaw);
$response = $master->kiraupahUjrahOnePercent($kodcaw,$sag['norujukan']);
}
return response()->json($notis);
$listsag[$index2]['keuntungan'] = $response;
}
$notisnokp[$index1]['info'] = $customer;
$notisnokp[$index1]['listsag'] = $listsag;
$notisnokp[$index1]['listnotis'] = $listnotis;
}
$totalrekod = $notisjbgbycaw->sum('pinjaman');
$totalberat = $notisjbgbycaw->sum('berat');
$totalnilaimarhun = $notisjbgbycaw->sum('nilaimarhun');
$totalpinjaman = $notisjbgbycaw->sum('pinjaman');
$totalbakipjm = $notisjbgbycaw->sum('bakipjm');
$totaltunggakan = $notisjbgbycaw->sum('tunggakan');
$arrayrekod = ['rekod' => $notisnokp, 'total' => $totalrekod,'totalberat' => $totalberat,'totalnilaimarhun' => $totalnilaimarhun,'totalpinjaman'=>$totalpinjaman,'totalbakipjm'=>$totalbakipjm,'totaltunggakan'=>$totaltunggakan];
// dd($arrayrekod);
return response()->json($arrayrekod,200);
}
public function bysagnotisjbg2($kodcaw,$notisid,$nokp)
{
$cawnotis_all = [];
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$notisjbgbycaw = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$notisid)->where('notisperingatan.kodcaw',$kodcaw)
->where('nokp',$nokp)
->where('notisperingatan.peringatan',2)
->distinct()
->get();
$arraynorujukan = $notisjbgbycaw->pluck('norujukan')->toArray();
$notisnokp = NotisPeringatan::on('mysql7')->whereIn('norujukan', $arraynorujukan)
->where('notisperingatan.peringatan',2)
->select('nokp')
->groupBy('nokp')
->get();
// dd($notisnokp);
foreach($notisnokp as $index1=>$cal){
$listnotis = NotisPeringatan::on('mysql7')->whereIn('norujukan', $arraynorujukan)
// ->where('nokp','=',$cal['nokp'])
->where('nokp', 'like', '%'.$cal['nokp'].'%')
->where('notisperingatan.peringatan',2)
->get();
$listsag = Gadai::on($cawangan['mysql'])
->whereIn('norujukan', $arraynorujukan)
->where('nokp','=',$cal['nokp'])
->get();
foreach($listsag as $index11=>$sag){
if($sag['tagbaru'] == '0'){
$keuntungan = 'asal';
$jeniskeuntungan = ($keuntungan == 'onepercent') ? 'onepercent' : 'asal';
$master = new MasterServices($kodcaw);
$response = $master->kiraUpahTawarruq($kodcaw,$sag['norujukan'],$jeniskeuntungan);
//dd($response);
}elseif($sag['tagbaru'] == '1'){
$keuntungan = 'onepercent';
$jeniskeuntungan = ($keuntungan == 'onepercent') ? 'onepercent' : 'asal';
$master = new MasterServices($kodcaw);
$response = $master->kiraupahUjrahOnePercent($kodcaw,$sag['norujukan']);
}
$listsag[$index11]['keuntungan'] = $response;
}
$notisnokp[$index1]['listsag'] = $listsag;
$notisnokp[$index1]['listnotis'] = $listnotis;
}
$getstatusremark = NotisPeringatan::on('mysql7')->where('nokp', $nokp)
//->whereIn('norujukan', $arraynorujukan)
->where('notis_id',$notisid)
->where('notisperingatan.peringatan',2)
// ->select('statuscall,remark1')
->groupBy('nokp')
->get();
$arrayrekod = ['rekodnotis' => $notisnokp, 'getstatusremark' => $getstatusremark];
// dd($arrayrekod);
return response()->json($arrayrekod,200);
}
public function bysagnotisjbgCustomer2($kodcaw,$notisid,$nokp)
{
$notissag = NotisPeringatan::on('mysql7')
//->join('customer','customer.kplama','||','customer.kpbaru','=','notisjbg.nokp')
->where('notis_id',$notisid)->where('kodcaw',$kodcaw)->where('nokp',$nokp)
->where('peringatan',2)
->first();
$nokp = $notissag['nokp'];
// $notissagbyjbgarray = $notissagbyjbg->toArray();
// foreach($notissagbyjbgarray as $index=>$cal){
$cust_info = Customer::where('kpbaru','=',$notissag['nokp'])
->orWhere('kplama','=',$notissag['nokp'])
->first();
// $notissagbyjbgarray[$index]['namacust'] = $customer;
// }
return response()->json($cust_info);
}
public function getcawnotiskemaskini($notisid)
{
$current = Carbon::now();
$current = new Carbon();
$arraybatch = [];
$batchnotis = Notis::on('mysql7')->where('id',$notisid)->get();
$cawangan_all = Cawangan::on('mysql7')->get();
$cawnotis_all = [];
foreach ($batchnotis as $index => $cawangan){
$notis = CawanganNotis::on('mysql7')
->join('arrahn_master_db', 'arrahn_master_db.kodcaw', '=', 'cawangan_notis.kodcaw')
->where('notis_id',$notisid)->get();
}
return response()->json($notis);
}
public function updatecall($kodcaw,$notisid,$nokp, Request $request)
{
$current = Carbon::now();
$current = new Carbon();
$harini = $current->toDateString();
$cawnotis_all = [];
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$notiscall = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$notisid)->where('notisperingatan.kodcaw',$kodcaw)
->where('nokp',$nokp)
//->where('notisperingatan.peringatan',2)
->distinct()
->get();
$arraynorujukan = $notiscall->pluck('norujukan')->toArray();
$updateNotisCall = NotisPeringatan::on('mysql7')
->where('nokp', $nokp)
->where('notis_id', $notisid)->update([
'tarikhcall1'=> $harini,
'remark1'=> $request->nota,
'statuscall'=> $request->statuscall,
'caller'=>$request->caller
]);
return response()->json('success');
}
public function senarainotisperingatankedua()
{
@@ -0,0 +1,181 @@
<?php
namespace App\Http\Controllers;
use App\Gadai;
use App\Marhun;
use App\Cawangan;
use App\Transaction;
use App\TransaksiKeuntungan;
use App\TransactionOnline;
use App\batalGadai;
use App\TuntutBaki;
use App\AnsRugi;
use App\Lelong;
use App\WTD;
use App\HapusKira;
use App\Tebus;
use App\Vault;
use App\Tunai;
use App\Komuditi;
use App\KawalanStokLama;
use App\KawalanStok;
use App\KadarUpah;
use App\Moratorium;
use App\Audit;
use App\Customer;
use App\KomuditiPurchase;
use App\KomuditiTransaksi;
use App\Advansur;
use App\BlastWasap;
use App\Notis;
use App\CawanganNotis;
use App\NotisPeringatan;
use App\Jobs\WhatsappPelangganSAGLAMA;
use App\Jobs\SMSPelangganSAGLAMA;
use Illuminate\Http\Request;
use App\CawanganDetail;
use App\BlastSMS;
use App\Jobs\ARCCWhatsappPelangganSAGLAMAbysag;
use App\Jobs\ARCCSMSPelangganSAGLAMAbysag;
use App\Services\MasterServices;
use App\Daerah;
use App\Poskod;
use App\Negeri;
use Log;
use App\Services\OnePercentServices;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
class CawanganCallCenterController extends Controller
{
public function senarainotisperingatan($kodcaw)
{
$current = Carbon::now();
$current = new Carbon();
$arraybatch = [];
$batchnotis = CawanganNotis::on('mysql7')
->join('notis', 'notis.id', '=', 'cawangan_notis.notis_id')
->where('kodcaw',$kodcaw)->get();
return response()->json($batchnotis);
}
public function getcawnotis($kodcaw,$notisid)
{
$current = Carbon::now();
$current = new Carbon();
$arraybatch = [];
$batchnotis = Notis::on('mysql7')->where('id',$notisid)->get();
$cawangan_all = Cawangan::on('mysql7')->get();
$cawnotis_all = [];
foreach ($batchnotis as $index => $cawangan){
$notis = CawanganNotis::on('mysql7')
->join('arrahn_master_db', 'arrahn_master_db.kodcaw', '=', 'cawangan_notis.kodcaw')
->where('notis_id',$notisid)->where('cawangan_notis.kodcaw',$kodcaw)->get();
if(sizeof($notis) != 0){
array_push($cawnotis_all,$notis);
}
}
return response()->json($cawnotis_all);
}
public function getcawnotisall(Request $request)
{
$kodcaw = $request->kodcaw;
$current = Carbon::now();
$current = new Carbon();
$arraybatch = [];
$cawangan_all = Cawangan::on('mysql7')->get();
$cawnotis_all = [];
$notis = CawanganNotis::on('mysql7')
->join('notis', 'notis.id', '=', 'cawangan_notis.notis_id')
->join('arrahn_master_db', 'arrahn_master_db.kodcaw', '=', 'cawangan_notis.kodcaw')
->where('cawangan_notis.kodcaw',$kodcaw)->get();
foreach ($notis as $index => $cawangan){
// dd($cawangan['kodcaw']);
// dd($cawangan);
$notisbycaw = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$cawangan['notis_id'])
->where('notisperingatan.kodcaw',$cawangan['kodcaw'])
// ->where('notisperingatan.tarikhnotis1','=', NULL)
->distinct()
->get();
$notispertamabycaw = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$cawangan['notis_id'])
->where('notisperingatan.kodcaw',$cawangan['kodcaw'])
->where('notisperingatan.peringatan','=', 1)
->distinct()
->get();
$notiskeduabycaw = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$cawangan['notis_id'])
->where('notisperingatan.kodcaw',$cawangan['kodcaw'])
->where('notisperingatan.peringatan','=', 2)
->distinct()
->get();
$totalsag = $notisbycaw->count('norujukan');
$totalsagpertama = $notispertamabycaw->count('norujukan');
$totalsagkedua = $notiskeduabycaw->count('norujukan');
$totalbakipjm = $notisbycaw->sum('pinjaman');
// if(sizeof($notis) != 0){
array_push($cawnotis_all,['namacaw' => $notis, 'detailbycaw' => $notisbycaw,'totalsag' =>$totalsag,'totalsagpertama' =>$totalsagpertama,'totalsagkedua' =>$totalsagkedua,'totalbakipjm' =>$totalbakipjm]);
// }
}
// dd($cawnotis_all);
return response()->json($cawnotis_all);
}
public function bycawnotisperingatan($kodcaw,$notisid)
{
$cawnotis_all = [];
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$notisbycaw = NotisPeringatan::on('mysql7')
->where('notisperingatan.notis_id',$notisid)
->where('notisperingatan.kodcaw',$kodcaw)
// ->where('notisperingatan.peringatan', '=', 1)
->distinct()
->get();
$notisbycawarray = $notisbycaw->toArray();
foreach($notisbycawarray as $index=>$cal){
$customer = Customer::where('kpbaru','=',$cal['nokp'])
->orWhere('kplama','=',$cal['nokp'])
->first();
$datagadai = Gadai::on($cawangan['mysql'])
->where('norujukan','=',$cal['norujukan'])
->first();
// dd( $datagadai);
if($datagadai->tagbaru == '0'){
$keuntungan = 'asal';
$jeniskeuntungan = ($keuntungan == 'onepercent') ? 'onepercent' : 'asal';
$master = new MasterServices($kodcaw);
$response = $master->kiraUpahTawarruq($kodcaw,$cal['norujukan'],$jeniskeuntungan);
}elseif($datagadai->tagbaru == '1'){
$keuntungan = 'onepercent';
$jeniskeuntungan = ($keuntungan == 'onepercent') ? 'onepercent' : 'asal';
$master = new MasterServices($kodcaw);
$response = $master->kiraupahUjrahOnePercent($kodcaw,$cal['norujukan']);
}
$notisbycawarray[$index]['namacust'] = $customer;
$notisbycawarray[$index]['datagadai'] = $datagadai;
$notisbycawarray[$index]['keuntungan'] = $response;
}
array_push($notisbycawarray);
return response()->json($notisbycawarray);
}
}
+6 -3
View File
@@ -143,7 +143,12 @@ class TunaiController extends Controller
->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()],['kodlaluan','=',$request->kodlaluan]])
->orderBy('tarikh','desc')
->first();
return response()->json($tunai);
return response()->json($tunai)
->withHeaders([
'Pragma' => 'no-cache',
'Cache-Control' => 'no-store',
'Expires' => 'Mon, 01 Jan 1990 00:00:00 GMT',
]);
}
@@ -640,5 +645,3 @@ class TunaiController extends Controller
return response()->json($requestteller);
}
}
@@ -104,6 +104,9 @@ class RingkasanHarianService
$getUjrahSebenarKaunter = $this->getUjrahSebenarKaunter();
$getTotalOnePercentOnline = $this->getTotalOnePercentOnline();
$getTotalUjrahOnline = $this->getTotalUjrahOnline();
$getUpahSimpanKaunterLama = $this->getUpahSimpanKaunterLama();
$getKeuntunganSebenarKaunterLama = $this->getKeuntunganSebenarKaunterLama();
$getTotalKeuntunganOnlineLama = $this->getTotalKeuntunganOnlineLama();
array_push($laporan_harian, [
'total_gadai' => $total_gadai,
@@ -166,6 +169,9 @@ class RingkasanHarianService
'ujrahSebenarKaunter' => $getUjrahSebenarKaunter,
'totalOnePercentOnline' => $getTotalOnePercentOnline,
'totalUjrahOnline' => $getTotalUjrahOnline,
'upahSimpanKaunterLama' => $getUpahSimpanKaunterLama,
'keuntunganSebenarKaunterLama' => $getKeuntunganSebenarKaunterLama,
'totalKeuntunganOnlineLama' => $getTotalKeuntunganOnlineLama,
]);
return response()->json($laporan_harian);
@@ -448,6 +454,73 @@ class RingkasanHarianService
}
private function getTotalKeuntunganOnlineLama()
{
$total_keuntunganansuran_data_online = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->whereDate('trans.created_at', '>=', $this->startDate)->whereDate('trans.created_at', '<=', $this->endDate)
->where('trans.teller', '=', 'Online')
->where('trans.trans_type', '=', 'A')
->where('transaksi_keuntungan.margin_semasa', '=' ,0.00)
->where('trans.kodcaw', $this->kodCawangan)
->pluck('transaksi_keuntungan.norujukan');
$gadaiDataOnline = Gadai::on($this->connectionCawangan)->whereIn('norujukan', $total_keuntunganansuran_data_online)->whereNotNull('hargajualan')->pluck('norujukan');
$keuntunganansuran_online_query = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->whereDate('trans.created_at', '>=', $this->startDate)->whereDate('trans.created_at', '<=', $this->endDate)
->where('trans.teller', '=', 'Online')
->where('trans.trans_type', '=', 'A')
->where('trans.kodcaw', $this->kodCawangan)
->where('transaksi_keuntungan.margin_semasa', '=' ,0.00)
->whereIn('trans.norujukan', $gadaiDataOnline)
->whereDate('transaksi_keuntungan.tarikh_bayaran', '>=', $this->startDate)->whereDate('transaksi_keuntungan.tarikh_bayaran', '<=', $this->endDate);
$total_keuntunganansuran_online = $keuntunganansuran_online_query->sum('bayaran_keuntungan');
$total_keuntunganbukanansuran_data_online = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->where('trans.trans_type', '!=', 'A')
->where('trans.teller', '=', 'Online')
->where('transaksi_keuntungan.margin_semasa', '=' ,0.00)
->whereDate('trans.created_at', '>=', $this->startDate)->whereDate('trans.created_at', '<=', $this->endDate)
->where('trans.kodcaw', '=', $this->kodCawangan)
->pluck('transaksi_keuntungan.norujukan');
$gadaiDataOnline = Gadai::on($this->connectionCawangan)->whereIn('norujukan', $total_keuntunganbukanansuran_data_online)->whereNotNull('hargajualan')->pluck('norujukan');
$keuntunganbukanansuran_online_query = TransaksiKeuntungan::on('mysql7')
->whereIn('norujukan', $gadaiDataOnline)
->where('margin_semasa', '=' ,0.00)
->whereDate('tarikh_bayaran', '>=', $this->startDate)->whereDate('tarikh_bayaran', '<=', $this->endDate);
$total_keuntunganbukanansuran_online = $keuntunganbukanansuran_online_query->sum('keuntungan_rebet');
$keuntungansebenaronline = $total_keuntunganansuran_online + $total_keuntunganbukanansuran_online;
$upahansurOnlineQuery = Advansur::on($this->connectionCawangan)
->where('teller', '=', 'Online')
->whereDate('tarikh', '>=', $this->startDate)->whereDate('tarikh', '<=', $this->endDate);
$upahansurOnline = $upahansurOnlineQuery->sum('upahdibayar');
$upahsimpanonline = $upahansurOnline;
$total_keuntungan_online = floatval($upahsimpanonline) + floatval($keuntungansebenaronline);
return floatval($total_keuntungan_online);
}
private function getTotalOnePercentOnline()
{
$total_keuntunganansuran_data_online = TransaksiKeuntungan::on('mysql7')
@@ -985,6 +1058,55 @@ class RingkasanHarianService
return floatval($upahsimpanujrah);
}
private function getUpahSimpanKaunterLama()
{
$keuntungan_data_kaunter = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->whereDate('transaksi_keuntungan.tarikh_bayaran', '>=', $this->startDate)->whereDate('transaksi_keuntungan.tarikh_bayaran', '<=', $this->endDate)
->where('trans.teller', '<>', 'Online')
->pluck('transaksi_keuntungan.norujukan');
$gadaiDataKaunter = Gadai::on($this->connectionCawangan)->whereIn('norujukan', $keuntungan_data_kaunter)->whereNull('hargajualan')->pluck('norujukan');
$keuntungan_kaunter_query = TransaksiKeuntungan::on('mysql7')
->whereIn('norujukan', $gadaiDataKaunter)
->where('margin_semasa', '=' ,0.00);
$keuntungan_kaunter = $keuntungan_kaunter_query->sum('bayaran_keuntungan');
// $upahtebus = Tebus::on($this->connectionCawangan)
// ->whereDate('t_tebus', '>=', $this->startDate)->whereDate('t_tebus', '<=', $this->endDate)
// ->sum('upahdibayar');
$upahlelong = Lelong::on($this->connectionCawangan)
->whereDate('t_jual', '>=', $this->startDate)->whereDate('t_jual', '<=', $this->endDate)
->sum('bakiupah');
$total_keuntunganbukanansuran_data_kaunter = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->where('trans.trans_type', '!=', 'A')
->where('trans.teller', '<>', 'Online')
->whereDate('trans.created_at', '>=', $this->startDate)->whereDate('trans.created_at', '<=', $this->endDate)
->where('trans.kodcaw', '=', $this->kodCawangan)
->where('transaksi_keuntungan.margin_semasa', '=' ,0.00);
$total_keuntunganbukanansuran_kaunter = $total_keuntunganbukanansuran_data_kaunter->sum('keuntungan_rebet');
$upahsimpankaunterlama = $keuntungan_kaunter + $upahlelong + $total_keuntunganbukanansuran_kaunter;
return floatval($upahsimpankaunterlama);
}
private function getKeuntunganSebenarKaunter()
{
$total_keuntunganansuran_data_kaunter = TransaksiKeuntungan::on('mysql7')
@@ -1017,6 +1139,40 @@ class RingkasanHarianService
return floatval($keuntungansebenarkaunter);
}
private function getKeuntunganSebenarKaunterLama()
{
$total_keuntunganansuran_data_kaunter = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->whereDate('trans.created_at', '>=', $this->startDate)->whereDate('trans.created_at', '<=', $this->endDate)
->where('trans.teller', '<>', 'Online')
->where('trans.trans_type', '=', 'A')
->where('trans.kodcaw', $this->kodCawangan)
->where('transaksi_keuntungan.margin_semasa', '=' ,0.00)
->pluck('transaksi_keuntungan.norujukan');
$gadaiDataKaunter = Gadai::on($this->connectionCawangan)->whereIn('norujukan', $total_keuntunganansuran_data_kaunter)->whereNotNull('hargajualan')->pluck('norujukan');
$keuntunganansuran_kaunter_query = TransaksiKeuntungan::on('mysql7')
->leftJoin('transaction as trans', function ($join) {
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
})
->where('trans.teller', '<>', 'Online')
->where('trans.trans_type', '=', 'A')
->whereIn('transaksi_keuntungan.norujukan', $gadaiDataKaunter)
->where('transaksi_keuntungan.margin_semasa', '=' ,0.00)
->whereDate('transaksi_keuntungan.tarikh_bayaran', '>=', $this->startDate)->whereDate('transaksi_keuntungan.tarikh_bayaran', '<=', $this->endDate);
$total_keuntunganansuran_kaunter = $keuntunganansuran_kaunter_query->sum('bayaran_keuntungan');
$keuntungansebenarkaunter = $total_keuntunganansuran_kaunter;
return floatval($keuntungansebenarkaunter);
}
private function getOnepercentSebenarKaunter()
{
$total_keuntunganansuran_data_kaunter = TransaksiKeuntungan::on('mysql7')
+1
View File
@@ -7,6 +7,7 @@
"require": {
"php": "^7.2.5",
"auth0/auth0-php": "^7.4",
"doctrine/dbal": "2.13.5",
"laravel/lumen-framework": "^7.0",
"laravel/tinker": "^2.8",
"rap2hpoutre/laravel-log-viewer": "^1.7",
Generated
+338 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "17aa13bd1f3c89969c4cdcce223e8172",
"content-hash": "2a35e67752107934701ceea957a4fd34",
"packages": [
{
"name": "auth0/auth0-php",
@@ -193,6 +193,343 @@
],
"time": "2021-08-15T20:50:18+00:00"
},
{
"name": "doctrine/cache",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "1ca8f21980e770095a31456042471a57bc4c68fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb",
"reference": "1ca8f21980e770095a31456042471a57bc4c68fb",
"shasum": ""
},
"require": {
"php": "~7.1 || ^8.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^9",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/cache": "^4.4 || ^5.4 || ^6",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
"homepage": "https://www.doctrine-project.org/projects/cache.html",
"keywords": [
"abstraction",
"apcu",
"cache",
"caching",
"couchdb",
"memcached",
"php",
"redis",
"xcache"
],
"support": {
"issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/2.2.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
"type": "tidelift"
}
],
"time": "2022-05-20T20:07:39+00:00"
},
{
"name": "doctrine/dbal",
"version": "2.13.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "d92ddb260547c2a7b650ff140f744eb6f395d8fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/d92ddb260547c2a7b650ff140f744eb6f395d8fc",
"reference": "d92ddb260547c2a7b650ff140f744eb6f395d8fc",
"shasum": ""
},
"require": {
"doctrine/cache": "^1.0|^2.0",
"doctrine/deprecations": "^0.5.3",
"doctrine/event-manager": "^1.0",
"ext-pdo": "*",
"php": "^7.1 || ^8"
},
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2021.1",
"phpstan/phpstan": "1.1.1",
"phpunit/phpunit": "^7.5.20|^8.5|9.5.10",
"psalm/plugin-phpunit": "0.16.1",
"squizlabs/php_codesniffer": "3.6.1",
"symfony/cache": "^4.4",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"vimeo/psalm": "4.12.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": [
"bin/doctrine-dbal"
],
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\DBAL\\": "lib/Doctrine/DBAL"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
"keywords": [
"abstraction",
"database",
"db2",
"dbal",
"mariadb",
"mssql",
"mysql",
"oci8",
"oracle",
"pdo",
"pgsql",
"postgresql",
"queryobject",
"sasql",
"sql",
"sqlanywhere",
"sqlite",
"sqlserver",
"sqlsrv"
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/2.13.5"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
"type": "tidelift"
}
],
"time": "2021-11-11T16:27:36+00:00"
},
{
"name": "doctrine/deprecations",
"version": "v0.5.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "9504165960a1f83cc1480e2be1dd0a0478561314"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314",
"reference": "9504165960a1f83cc1480e2be1dd0a0478561314",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^6.0|^7.0|^8.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"psr/log": "^1.0"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/v0.5.3"
},
"time": "2021-03-21T12:59:47+00:00"
},
{
"name": "doctrine/event-manager",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/event-manager.git",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^0.5.3 || ^1",
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/common": "<2.9"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^10",
"phpstan/phpstan": "~1.4.10 || ^1.8.8",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.24"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.",
"homepage": "https://www.doctrine-project.org/projects/event-manager.html",
"keywords": [
"event",
"event dispatcher",
"event manager",
"event system",
"events"
],
"support": {
"issues": "https://github.com/doctrine/event-manager/issues",
"source": "https://github.com/doctrine/event-manager/tree/1.2.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager",
"type": "tidelift"
}
],
"time": "2022-10-12T20:51:15+00:00"
},
{
"name": "doctrine/inflector",
"version": "2.0.4",
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddNotiscallToNotisPeringatanTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('notisperingatan', function (Blueprint $table) {
$table->date('tarikhcall1')->nullable();
$table->date('tarikhcall2')->nullable();
$table->string('remark1')->nullable();
$table->string('remark2')->nullable();
$table->integer('statuscall')->default(0);
$table->string('caller')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// Schema::table('notisperingatan', function (Blueprint $table) {
// $table->dropColumn(['tarikhcall1']);
// $table->dropColumn(['tarikhcall2']);
// $table->dropColumn(['remark1']);
// $table->dropColumn(['remark2']);
// });
}
}
@@ -0,0 +1,62 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Doctrine\DBAL;
class AddIndexToTransactionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql7')->table('transaction', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('transaction');
if (! array_key_exists('idx_search_norujukan', $indexesFound)) {
$table->index(['created_at', 'trans_type', 'kodcaw'], 'idx_search_norujukan');
}
});
Schema::connection('mysql7')->table('transaksi_keuntungan', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('transaksi_keuntungan');
if (! array_key_exists('idx_tarikh_bayaran', $indexesFound)) {
$table->index('tarikh_bayaran', 'idx_tarikh_bayaran');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('mysql7')->table('transaction', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('transaction');
if (array_key_exists('idx_seach_norujukan', $indexesFound)) {
$table->dropIndex('idx_search_norujukan');
}
});
Schema::connection('mysql7')->table('transaksi_keuntungan', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('transaksi_keuntungan');
if (array_key_exists('idx_tarikh_bayaran', $indexesFound)) {
$table->dropIndex('idx_tarikh_bayaran');
}
});
}
}
+15 -1
View File
@@ -616,7 +616,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->get('/cawangan/getcawnotis/{kodcaw}/{notisid}',['uses'=>'CawanganCallCenterController@getcawnotis']);
$router->get('/cawangan/senarainotisperingatan/{kodcaw}',['uses'=>'CawanganCallCenterController@senarainotisperingatan']);
$router->get('/cawangan/getcawnotisall/{kodcaw}',['uses'=>'CawanganCallCenterController@getcawnotisall']);
$router->get('/cawangan/bycawnotisperingatan/{kodcaw}/{notisid}',['uses'=>'CawanganCallCenterController@bycawnotisperingatan']);
});
@@ -873,4 +873,18 @@ $router->group(['prefix'=>'arcc'], function () use ($router){
$router->get('senarainotisperingatankedua',['uses'=>'CallCenterController@senarainotisperingatankedua']);
$router->get('gadaian/{kodcaw}',['uses'=>'CallCenterController@getJbgGadai']);
$router->get('getbatchnotisjbg',['uses'=>'CallCenterController@getbatchnotisjbg']);
$router->post('insertdatagadaijbg/{kodcaw}',['uses'=>'CallCenterController@insertdatagadaijbg']);
$router->get('senarainotisjbg',['uses'=>'CallCenterController@senarainotisjbg']);
$router->get('getcawnotisjbg/{notisid}',['uses'=>'CallCenterController@getcawnotisjbg']);
$router->get('getcawnotisjbgbycaw',['uses'=>'CallCenterController@getcawnotisjbgbycaw']);
$router->get('bycawnotisjbg/{kodcaw}/{notisid}',['uses'=>'CallCenterController@bycawnotisjbg']);
$router->get('bysagnotisjbg/{kodcaw}/{notisid}/{id}',['uses'=>'CallCenterController@bysagnotisjbg']);
$router->get('bysagnotisjbgcustomer/{kodcaw}/{notisid}/{id}',['uses'=>'CallCenterController@bysagnotisjbgCustomer']);
$router->get('bycawnotisjbg2/{kodcaw}/{notisid}',['uses'=>'CallCenterController@bycawnotisjbg2']);
$router->get('bysagnotisjbg2/{kodcaw}/{notisid}/{nokp}',['uses'=>'CallCenterController@bysagnotisjbg2']);
$router->put('updatecall/{kodcaw}/{notisid}/{nokp}', ['uses' => 'CallCenterController@updatecall']);
$router->get('bysagnotisjbgcustomer2/{kodcaw}/{notisid}/{nokp}',['uses'=>'CallCenterController@bysagnotisjbgCustomer2']);
});