Merge branch 'apiaku' into 'master'
Apiaku See merge request online-sistem1/api_arrahn!102
This commit is contained in:
@@ -18,6 +18,7 @@ use App\Vault;
|
||||
use App\Tunai;
|
||||
use App\Komuditi;
|
||||
use App\KawalanStokLama;
|
||||
use App\KawalanStok;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -553,8 +554,29 @@ class GadaiController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])
|
||||
->where('t_gadai','=',$tarikh)
|
||||
->select('Gadai.t_gadai','Gadai.norujukan','cust.nama','Gadai.nokp','Gadai.semakbarcode','Gadai.masa','Gadai.berat','Gadai.nilaimarhun','Gadai.pinjaman','Gadai.upah12','Gadai.percentpinj','cust.alamat1','Gadai.teller')
|
||||
->join('Customer as cust', function($join)
|
||||
{
|
||||
$join->on('Gadai.nokp', '=', 'cust.kpbaru');
|
||||
$join->orOn('Gadai.nokp', '=', 'cust.kplama');
|
||||
})
|
||||
->where('Gadai.t_gadai','=',$tarikh)
|
||||
->orderBy('Gadai.teller')
|
||||
->get();
|
||||
|
||||
return response()->json($gadai);
|
||||
}
|
||||
|
||||
public function getLaporanGadaiRange($kodcaw,Request $request){
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])
|
||||
->where('t_gadai','>=',$request->mula)
|
||||
->where('t_gadai','<=',$request->akhir)
|
||||
->orderBy('teller')
|
||||
->orderBy('t_gadai','asc')
|
||||
->orderBy('sirig','asc')
|
||||
->get();
|
||||
|
||||
return response()->json($gadai);
|
||||
@@ -1133,6 +1155,62 @@ class GadaiController extends Controller
|
||||
$lelong3[0]['pinj'] = $lelpinj3;
|
||||
|
||||
}
|
||||
}else{
|
||||
$kawalanstok = KawalanStok::on($cawangan['mysql'])
|
||||
->get();
|
||||
|
||||
foreach($kawalanstok as $indexgad => $gadaikawalanstok)
|
||||
{
|
||||
|
||||
//Gadai
|
||||
$gad1 = $gadai1[0]['bil'] + intval($gadaikawalanstok['bilgadc1']);
|
||||
$gad2 = $gadai2[0]['bil'] + intval($gadaikawalanstok['bilgadc2']);
|
||||
$gad3 = $gadai3[0]['bil'] + intval($gadaikawalanstok['bilgadc3']);
|
||||
$gadpinj1 = $gadai1[0]['pinj'] + floatval($gadaikawalanstok['pinjgadc1']);
|
||||
$gadpinj2 = $gadai2[0]['pinj'] + floatval($gadaikawalanstok['pinjgadc2']);
|
||||
$gadpinj3 = $gadai3[0]['pinj'] + floatval($gadaikawalanstok['pinjgadc3']);
|
||||
|
||||
$gadai1[0]['bil'] = $gad1;
|
||||
$gadai1[0]['pinj'] = $gadpinj1;
|
||||
$gadai2[0]['bil'] = $gad2;
|
||||
$gadai2[0]['pinj'] = $gadpinj2;
|
||||
$gadai3[0]['bil'] = $gad3;
|
||||
$gadai3[0]['pinj'] = $gadpinj3;
|
||||
|
||||
//Tebus
|
||||
|
||||
$teb1 = $tebus1[0]['bil'] + intval($gadaikawalanstok['biltebc1']);
|
||||
$teb2 = $tebus2[0]['bil'] + intval($gadaikawalanstok['biltebc2']);
|
||||
$teb3 = $tebus3[0]['bil'] + intval($gadaikawalanstok['biltebc3']);
|
||||
$tebpinj1 = $tebus1[0]['pinj'] + floatval($gadaikawalanstok['pinjtebc1']);
|
||||
$tebpinj2 = $tebus2[0]['pinj'] + floatval($gadaikawalanstok['pinjtebc2']);
|
||||
$tebpinj3 = $tebus3[0]['pinj'] + floatval($gadaikawalanstok['pinjtebc3']);
|
||||
|
||||
$tebus1[0]['bil'] = $teb1;
|
||||
$tebus1[0]['pinj'] = $tebpinj1;
|
||||
$tebus2[0]['bil'] = $teb2;
|
||||
$tebus2[0]['pinj'] = $tebpinj2;
|
||||
$tebus3[0]['bil'] = $teb3;
|
||||
$tebus3[0]['pinj'] = $tebpinj3;
|
||||
|
||||
//Lelong
|
||||
|
||||
$lel1 = $lelong1[0]['bil'] + intval($gadaikawalanstok['billelc1']);
|
||||
$lel2 = $lelong2[0]['bil'] + intval($gadaikawalanstok['billelc2']);
|
||||
$lel3 = $lelong3[0]['bil'] + intval($gadaikawalanstok['billelc3']);
|
||||
$lelpinj1 = $lelong1[0]['pinj'] + floatval($gadaikawalanstok['pinjlelc1']);
|
||||
$lelpinj2 = $lelong2[0]['pinj'] + floatval($gadaikawalanstok['pinjlelc2']);
|
||||
$lelpinj3 = $lelong3[0]['pinj'] + floatval($gadaikawalanstok['pinjlelc3']);
|
||||
|
||||
$lelong1[0]['bil'] = $lel1;
|
||||
$lelong1[0]['pinj'] = $lelpinj1;
|
||||
$lelong2[0]['bil'] = $lel2;
|
||||
$lelong2[0]['pinj'] = $lelpinj2;
|
||||
$lelong3[0]['bil'] = $lel3;
|
||||
$lelong3[0]['pinj'] = $lelpinj3;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////////////
|
||||
@@ -2196,7 +2274,7 @@ class GadaiController extends Controller
|
||||
case 'WB':
|
||||
$tarikhtawarruq = '2021-05-24';
|
||||
break;
|
||||
case 'APM':
|
||||
case 'APM':
|
||||
$tarikhtawarruq = '2021-06-08';
|
||||
break;
|
||||
case 'ARM':
|
||||
@@ -2214,6 +2292,12 @@ class GadaiController extends Controller
|
||||
case 'JLI':
|
||||
$tarikhtawarruq = '2021-06-13';
|
||||
break;
|
||||
case '010621':
|
||||
$tarikhtawarruq = '2021-06-15';
|
||||
break;
|
||||
case 'ARP':
|
||||
$tarikhtawarruq = '2021-06-15';
|
||||
break;
|
||||
}
|
||||
|
||||
$rekod_emaspalsu = Gadai::on($cawangan['mysql'])
|
||||
@@ -2245,16 +2329,11 @@ class GadaiController extends Controller
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||
|
||||
// if($request->tarikh > '2021-04-13'){
|
||||
$rekod_pinjamandiberi = Gadai::on($cawangan['mysql'])
|
||||
->where('tagpalsu','=',0)
|
||||
// ->where([['t_gadai','<=',$request->tarikh],['t_gadai','>','2021-04-13'],['sttebus','=',''],['t_update','<=',$request->tarikh]])
|
||||
->where([['t_gadai','<=',$request->tarikh],['sttebus','=',''],['hargajualan','<>','NULL']])
|
||||
// ->orWhere([['sttebus','!=',''],['t_update','>',$request->tarikh],['t_gadai','<=',$request->tarikh]])
|
||||
// ->orWhere([['t_update','>',$request->tarikh],['sttebus','!=',''],['t_gadai','<=',$request->tarikh],['t_gadai','>=','2021-04-14']])
|
||||
->orWhere([['t_update','>',$request->tarikh],['sttebus','!=',''],['t_gadai','<=',$request->tarikh],['hargajualan','<>','null']])
|
||||
->sum('pinjaman');
|
||||
// }
|
||||
|
||||
return response()->json($rekod_pinjamandiberi);
|
||||
}
|
||||
|
||||
@@ -37,15 +37,12 @@ class GlejerController extends Controller
|
||||
public function Getglejer_Data($tarikh1,$tarikh2,$kodcaw)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$glejer=Glejer::on($cawangan['mysql'])->whereBetween('tarikh',[$tarikh1,$tarikh2])->orderBy('glcode','ASC')->get();
|
||||
return response()->json($glejer);
|
||||
|
||||
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$db=$cawangan['mysql'];
|
||||
|
||||
$glejer=DB::connection($db)->select( "SELECT glcode, descpt , SUM(debit)AS total_debit, SUM(kredit) AS total_kredit, SUM(hariini) AS totalharini FROM glejer where tarikh BETWEEN '".$tarikh1."' and '".$tarikh2."' GROUP BY glcode,descpt ORDER BY glcode asc" );
|
||||
return response()->json($glejer);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,14 @@ class KomuditiController extends Controller
|
||||
return response()->json($komuditi);
|
||||
}
|
||||
|
||||
public function checkKomuditiDateChoose(Request $request){
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$komuditi = KomuditiPurchase::on('mysql7')->where('date_purchase','=',$request->tarikh)->orderBy('created_at','desc')->first();
|
||||
return response()->json($komuditi);
|
||||
}
|
||||
|
||||
public function checkKomuditiDashboard(){
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
@@ -49,10 +49,9 @@ class LaporanController extends Controller
|
||||
->whereDate('trans.created_at','=',$request->tarikh)
|
||||
->where('trans.trans_type','=','A')
|
||||
->groupBy('trans.id')
|
||||
->sum('keuntungan_rebet');
|
||||
->sum('bayaran_keuntungan');
|
||||
|
||||
// $total_ansuran = number_format($total_ansuran,2);
|
||||
|
||||
$total_keuntungan = floatval($total_upah) + floatval($total_keuntunganansuran) + floatval($total_keuntungantebus);
|
||||
|
||||
|
||||
@@ -237,6 +236,115 @@ class LaporanController extends Controller
|
||||
return response()->json($laporan_harian);
|
||||
}
|
||||
|
||||
public function laporanTerkumpul(Request $request){
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||
$laporan_terkumpul = [];
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir]]);
|
||||
|
||||
$tebus = Tebus::on($cawangan['mysql'])->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->akhir]]);
|
||||
$ansuran = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]]);
|
||||
|
||||
|
||||
//a
|
||||
$total_gadai = $gadai->sum('pinjaman');
|
||||
$total_tebus = $tebus->sum('pinjaman');
|
||||
$total_ansuran = $ansuran->sum('duit_masuk');
|
||||
// $total_keuntungan = TransaksiKeuntungan::on('mysql7')->whereDate('tarikh_bayaran','=',$request->tarikh)->sum('bayaran_keuntungan');
|
||||
$total_upah = Advansur::on($cawangan['mysql'])->where([['tarikh','>=',$request->mula],['tarikh','<=',$request->akhir]])->sum('upahdibayar');
|
||||
$total_keuntungantebus = Tebus::on($cawangan['mysql'])->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->akhir]])->sum('bakiupah');
|
||||
|
||||
$total_keuntunganansuran = 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','>=',$request->mula)
|
||||
->whereDate('trans.created_at','<=',$request->akhir)
|
||||
->where('trans.trans_type','=','A')
|
||||
->groupBy('trans.id')
|
||||
->sum('keuntungan_rebet');
|
||||
|
||||
// $total_ansuran = number_format($total_ansuran,2);
|
||||
|
||||
$total_keuntungan = floatval($total_upah) + floatval($total_keuntunganansuran) + floatval($total_keuntungantebus);
|
||||
|
||||
|
||||
//b
|
||||
$bilangan_gadai = $gadai->count();
|
||||
$bilangan_tebus = $tebus->count();
|
||||
$bilangan_ansuran = $ansuran->count();
|
||||
$bilangan_customer_baru = Customer::on($cawangan['mysql'])->where([['tarikhdaftar','>=',$request->mula],['tarikhdaftar','<=',$request->akhir]])->count();
|
||||
|
||||
//f
|
||||
$data_lelong = Lelong::on($cawangan['mysql'])->where([['t_jual','=',$request->mula],['t_jual','=',$request->akhir]])->get();
|
||||
$bilangan_lelong = Lelong::on($cawangan['mysql'])->where([['t_jual','=',$request->mula],['t_jual','=',$request->akhir]])->count();
|
||||
|
||||
$cas_lelong = 0;
|
||||
$jumlah_lelong = 0;
|
||||
$baki_lelong = 0;
|
||||
$rugi_lelong = 0;
|
||||
|
||||
foreach($data_lelong as $index=>$lelong){
|
||||
if($lelong['baki'] >= 0){
|
||||
$cas_lelong += $lelong['cajlelong'];
|
||||
$jumlah_lelong += $lelong['hargajual'];
|
||||
$baki_lelong += $lelong['baki'];
|
||||
}elseif($lelong['baki'] < 0){
|
||||
$cas_lelong += $lelong['cajlelong'];
|
||||
$jumlah_lelong += $lelong['hargajual'];
|
||||
$rugi_lelong += abs($lelong['baki']);
|
||||
}
|
||||
}
|
||||
|
||||
//g
|
||||
$bayar_baki_lelong = TuntutBaki::on($cawangan['mysql'])->where([['tarikh','=',$request->mula],['tarikh','=',$request->akhir]])->sum('jumlah');
|
||||
|
||||
//h
|
||||
$gadai_70 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','<=',70]])->sum('pinjaman');
|
||||
$gadai_75 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','<=',75]])->sum('pinjaman');
|
||||
$gadai_80 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','>',75],['percentpinj','<=',80]])->sum('pinjaman');
|
||||
|
||||
$nilaimarhun_70 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','<=',70]])->sum('nilaimarhun');
|
||||
$nilaimarhun_75 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','>',70],['percentpinj','<=',75]])->sum('nilaimarhun');
|
||||
$nilaimarhun_80 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','>',75],['percentpinj','<=',80]])->sum('nilaimarhun');
|
||||
|
||||
$bilangan_70 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','<=',70]])->count();
|
||||
$bilangan_75 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','>',70],['percentpinj','<=',75]])->count();
|
||||
$bilangan_80 = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir],['percentpinj','>',75],['percentpinj','<=',80]])->count();
|
||||
|
||||
array_push($laporan_terkumpul,[
|
||||
'total_gadai'=>$total_gadai,
|
||||
'total_tebus'=>$total_tebus,
|
||||
'total_ansuran'=>$total_ansuran,
|
||||
'bilangan_gadai'=>$bilangan_gadai,
|
||||
'bilangan_tebus'=>$bilangan_tebus,
|
||||
'bilangan_ansuran'=>$bilangan_ansuran,
|
||||
'bilangan_customer_baru'=>$bilangan_customer_baru,
|
||||
'bayar_baki_lelong'=>$bayar_baki_lelong,
|
||||
'gadai_70'=>$gadai_70,
|
||||
'gadai_75'=>$gadai_75,
|
||||
'gadai_80'=>$gadai_80,
|
||||
'nilaimarhun_70'=>$nilaimarhun_70,
|
||||
'nilaimarhun_75'=>$nilaimarhun_75,
|
||||
'nilaimarhun_80'=>$nilaimarhun_80,
|
||||
'bilangan_70'=>$bilangan_70,
|
||||
'bilangan_75'=>$bilangan_75,
|
||||
'bilangan_80'=>$bilangan_80,
|
||||
'bilangan_lelong'=>$bilangan_lelong,
|
||||
'cas_lelong'=>$cas_lelong,
|
||||
'jumlah_lelong'=>$jumlah_lelong,
|
||||
'baki_lelong'=>$baki_lelong,
|
||||
'rugi_lelong'=>$rugi_lelong,
|
||||
'total_keuntungan'=>floatval($total_keuntungan)
|
||||
|
||||
]);
|
||||
|
||||
return response()->json($laporan_terkumpul);
|
||||
}
|
||||
|
||||
|
||||
public function CalcHapusKira($kodcaw,Request $request)
|
||||
{
|
||||
@@ -267,9 +375,9 @@ class LaporanController extends Controller
|
||||
->where('glcode','=','7000/201')
|
||||
->sum('amaun');
|
||||
|
||||
$kerugianlelongxtra = GlCode::on($cawangan['mysql'])
|
||||
->where('glcode','=','3000/120')
|
||||
->sum('amaun');
|
||||
$kerugianlelongxtra = GlCode::on($cawangan['mysql'])
|
||||
->where('glcode','=','3000/120')
|
||||
->sum('amaun');
|
||||
|
||||
$arrayxtra = ['upahsimpan' => floatval($upahsimpan), 'bakilelong' => floatval($bakilelongxtra), 'untungrugiterkumpul' => floatval($untungrugiterkumpul), 'kerugianlelong' => floatval($kerugianlelongxtra)];
|
||||
|
||||
|
||||
@@ -182,11 +182,6 @@ class LelongController extends Controller
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// dd($bakilelong->toSql());
|
||||
|
||||
$ansrugi = AnsRugi::on($cawangan['mysql'])
|
||||
->sum('bayaran');
|
||||
@@ -201,7 +196,10 @@ class LelongController extends Controller
|
||||
->where('baki','<',0)
|
||||
->sum('baki');
|
||||
|
||||
$rugitotal=$rugilelong + $ansrugi;
|
||||
$rugitotal=$rugilelong + $ansrugi;
|
||||
|
||||
if($kodcaw == 'APM')
|
||||
$bakilelong += 4498.1;
|
||||
|
||||
$arraylelong = ['bakilelong' => $bakilelong, 'rugilelong' => $rugitotal];
|
||||
|
||||
|
||||
@@ -494,8 +494,15 @@ class TebusController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$tebus = Tebus::on($cawangan['mysql'])
|
||||
->where('t_tebus','=',$tarikh)
|
||||
->orderBy('teller')
|
||||
->select('tebus.t_tebus', 'gad.t_gadai','Tebus.tagterima', 'tebus.teller','tebus.jenistebus','tebus.pinjaman','tebus.bakiupah','tebus.bakipjm','gad.norujukan','cust.nama','gad.nokp','tebus.jbg')
|
||||
->join('Gadai as gad','gad.norujukan','=','Tebus.norujukan')
|
||||
->join('Customer as cust', function($join)
|
||||
{
|
||||
$join->on('gad.nokp', '=', 'cust.kpbaru');
|
||||
$join->orOn('gad.nokp', '=', 'cust.kplama');
|
||||
})
|
||||
->where('Tebus.t_tebus','=',$tarikh)
|
||||
->orderBy('Tebus.teller')
|
||||
->get();
|
||||
|
||||
return response()->json($tebus);
|
||||
@@ -687,6 +694,23 @@ class TebusController extends Controller
|
||||
return response()->json($listadvansur,200);
|
||||
}
|
||||
|
||||
public function SenaraiAdvansurRangeDate($kodcaw,Request $request){
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$listadvansur = Advansur::on($cawangan['mysql'])
|
||||
->where('tarikh','>=',$request->mula)
|
||||
->where('tarikh','<=',$request->akhir)
|
||||
->orderBy('teller')
|
||||
->orderBy('tarikh','asc')
|
||||
->get();
|
||||
|
||||
return response()->json($listadvansur,200);
|
||||
}
|
||||
|
||||
public function advansurharini($kodcaw,Request $request){
|
||||
|
||||
$current = Carbon::now();
|
||||
@@ -720,6 +744,24 @@ class TebusController extends Controller
|
||||
return response()->json($arrayadvansur,200);
|
||||
}
|
||||
|
||||
public function advansurdetailsRange($kodcaw,Request $request){
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$listadvansur = Advansur::on($cawangan['mysql'])
|
||||
->where('tarikh','>=',$request->mula)->where('tarikh','<=',$request->akhir);
|
||||
|
||||
$countadvansur = $listadvansur->count();
|
||||
$totaladvansur = $listadvansur->sum('upahdibayar');
|
||||
|
||||
$arrayadvansur = ['bil' => $countadvansur, 'total' => $totaladvansur];
|
||||
|
||||
return response()->json($arrayadvansur,200);
|
||||
}
|
||||
|
||||
public function getAdvansurByKodlaluan($kodcaw,Request $request)
|
||||
{
|
||||
$current = Carbon::now();
|
||||
@@ -936,28 +978,24 @@ class TebusController extends Controller
|
||||
$daterequest = new Carbon($request->tarikh);
|
||||
$daterequest->addDays(1);
|
||||
|
||||
//$dateSM = new Carbon('2021-04-24');
|
||||
//$dateSM->addDays(1);
|
||||
|
||||
$dateSM = '2021-04-24';
|
||||
$dateSM = '2021-04-24';
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$keuntungan = TransaksiKeuntungan::on('mysql7')
|
||||
->join($cawangan['db_name'].'.gadai as db2','transaksi_keuntungan.norujukan','=','db2.norujukan')
|
||||
// ->where('transaksi_keuntungan.tarikh_bayaran' ,'>=', $datetawarruq)
|
||||
->whereDate('transaksi_keuntungan.tarikh_bayaran', '<=', $request->tarikh)
|
||||
->whereDate('transaksi_keuntungan.tarikh_bayaran', '<=', $request->tarikh)
|
||||
->whereDate('transaksi_keuntungan.tarikh_bayaran' ,'<', $dateSM)
|
||||
->whereYear('tarikh_bayaran','=',$current->year)
|
||||
->whereNotNull('db2.hargajualan')
|
||||
->sum('bayaran_keuntungan');
|
||||
|
||||
|
||||
$keuntunganreducing = TransaksiKeuntungan::on('mysql7')
|
||||
->join($cawangan['db_name'].'.gadai as db2','transaksi_keuntungan.norujukan','=','db2.norujukan')
|
||||
// ->where('transaksi_keuntungan.tarikh_bayaran' ,'>=', $datetawarruq)
|
||||
->where('transaksi_keuntungan.tarikh_bayaran' ,'<', $request->tarikh)
|
||||
->where('transaksi_keuntungan.tarikh_bayaran','>=', $dateSM)
|
||||
->whereDate('transaksi_keuntungan.tarikh_bayaran' ,'<', $request->tarikh)
|
||||
->whereDate('transaksi_keuntungan.tarikh_bayaran','>=', $dateSM)
|
||||
->whereYear('tarikh_bayaran','=',$current->year)
|
||||
->whereNotNull('db2.hargajualan')
|
||||
->sum('keuntungan_rebet');
|
||||
@@ -990,7 +1028,7 @@ class TebusController extends Controller
|
||||
->whereNotNull('db2.hargajualan')
|
||||
->sum('bayaran_keuntungan');
|
||||
|
||||
$total = ($keuntungan+$keuntunganreducing + $ansuran + $bukanansuran);
|
||||
$total = ($keuntungan + $keuntunganreducing + $ansuran + $bukanansuran);
|
||||
|
||||
return response($total);
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ class VaultController extends Controller
|
||||
|
||||
|
||||
//Sebelum Tawarruq
|
||||
if($kodcaw == 'KB2' || $kodcaw == 'WCY' || $kodcaw == '1STOP' || $kodcaw == 'ARM' || $kodcaw == 'APM')
|
||||
if($kodcaw == 'KB2' || $kodcaw == 'WCY' || $kodcaw == '1STOP' || $kodcaw == 'ARM' || $kodcaw == 'APM' || $kodcaw == '010621')
|
||||
{
|
||||
$serahanpkb = GlDetail::on($cawangan['mysql'])
|
||||
->where('dtacct','=',$serahanpkb)
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class KawalanStok extends Model
|
||||
{
|
||||
protected $table = 'kawalanstok';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'bilgadcf1',
|
||||
'bilgadc1',
|
||||
'bilgad1',
|
||||
'bilgadcf2',
|
||||
'bilgadc2',
|
||||
'bilgad2',
|
||||
'bilgadcf3',
|
||||
'bilgadc3',
|
||||
'bilgad3',
|
||||
'pinjgadcf1',
|
||||
'pinjgadc1',
|
||||
'pinjgad1',
|
||||
'pinjgadcf2',
|
||||
'pinjgadc2',
|
||||
'pinjgad2',
|
||||
'pinjgadcf3',
|
||||
'pinjgadc3',
|
||||
'pinjgad3',
|
||||
'biltebcf1',
|
||||
'biltebc1',
|
||||
'bilteb1',
|
||||
'biltebcf2',
|
||||
'biltebc2',
|
||||
'bilteb2',
|
||||
'biltebcf3',
|
||||
'biltebc3',
|
||||
'bilteb3',
|
||||
'pinjtebcf1',
|
||||
'pinjtebc1',
|
||||
'pinjteb1',
|
||||
'pinjtebcf2',
|
||||
'pinjtebc2',
|
||||
'pinjteb2',
|
||||
'pinjtebcf3',
|
||||
'pinjtebc3',
|
||||
'pinjteb3',
|
||||
'billelcf1',
|
||||
'billelc1',
|
||||
'billel1',
|
||||
'billelcf2',
|
||||
'billelc2',
|
||||
'billel2',
|
||||
'billelcf3',
|
||||
'billelc3',
|
||||
'billel3',
|
||||
'pinjlelcf1',
|
||||
'pinjlelc1',
|
||||
'pinjlel1',
|
||||
'pinjlelcf2',
|
||||
'pinjlelc2',
|
||||
'pinjlel2',
|
||||
'pinjlelcf3',
|
||||
'pinjlelc3',
|
||||
'pinjlel3',
|
||||
'bilhapcf1',
|
||||
'bilhapc1',
|
||||
'bilhap1',
|
||||
'bilhapcf2',
|
||||
'bilhapc2',
|
||||
'bilhap2',
|
||||
'bilhapcf3',
|
||||
'bilhapc3',
|
||||
'bilhap3',
|
||||
'pinjhapcf1',
|
||||
'pinjhapc1',
|
||||
'pinjhap1',
|
||||
'pinjhapcf2',
|
||||
'pinjhapc2',
|
||||
'pinjhap2',
|
||||
'pinjhapcf3',
|
||||
'pinjhapc3',
|
||||
'pinjhap3',
|
||||
'jumbil1',
|
||||
'jumbil2',
|
||||
'jumbil3',
|
||||
'jumbilall',
|
||||
'jumpinj1',
|
||||
'jumpinj2',
|
||||
'jumpinj3',
|
||||
'jumpinjall',
|
||||
'per1',
|
||||
'per2',
|
||||
'per3',
|
||||
'jumgad',
|
||||
'jumpinjgad',
|
||||
'jumpinjgadall',
|
||||
'jumteb',
|
||||
'jumpinjteb',
|
||||
'jumpinjteball',
|
||||
'jumlel',
|
||||
'jumpinjlel',
|
||||
'jumpinjlelall',
|
||||
'jumhap',
|
||||
'jumpinjhap',
|
||||
'jumpinjhapall',
|
||||
'jumpinjgadcf',
|
||||
'jumpinjtebcf',
|
||||
'jumpinjlelcf',
|
||||
'jumpinjhapcf',
|
||||
'jumgadcf',
|
||||
'jumgadall',
|
||||
'jumtebcf',
|
||||
'jumteball',
|
||||
'jumlelcf',
|
||||
'jumlelall',
|
||||
'jumhapcf',
|
||||
'jumhapall'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $hidden = [];
|
||||
}
|
||||
@@ -73,6 +73,8 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('gadaiansemasa/{kodcaw}',['uses'=>'GadaiController@getGadaianSemasa']);
|
||||
$router->get('gadaiansemasa/belum_serah/{kodcaw}',['uses'=>'GadaiController@getGadaianBelumSerah']);
|
||||
$router->get('gadai/laporan/{kodcaw}/{tarikh}',['uses'=>'GadaiController@getLaporanGadai']);
|
||||
$router->get('gadailaporanRange/{kodcaw}',['uses'=>'GadaiController@getLaporanGadaiRange']); //Range Date
|
||||
|
||||
|
||||
$router->get('gadai/customers/{ic}/outstandingsemasa/{kodcaw}',['uses'=>'GadaiController@outstandingSemasaCustomer']);
|
||||
$router->put('gadai/updatehistory/{kodcaw}/{norujukan}',['uses'=>'GadaiController@updateHistoryGadai']);
|
||||
@@ -93,6 +95,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('upahbukantawarruq/{kodcaw}/{norujukan}',['uses'=>'TebusController@upahNotTawarruq']);
|
||||
$router->get('tebus/laporan/{kodcaw}/{tarikh}',['uses'=>'TebusController@getLaporanTebus']);
|
||||
$router->get('tebus/laporanjenistawarruq/{kodcaw}',['uses'=>'TebusController@getLaporanTebusPengasingan']);
|
||||
|
||||
//Maintenance API TEBUS
|
||||
// $router->get('rebet/{kodcaw}/{norujukan}',['uses' => 'TebusController@rebet']);
|
||||
$router->put('updatetebus/{kodcaw}/{norujukan}',['uses'=>'TebusController@tebusUpdate']);
|
||||
@@ -198,9 +201,11 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('ansuran/laporan/{kodcaw}',['uses'=>'GadaiController@getLaporanAnsuran']); //laporan lelong
|
||||
$router->get('ansuran/{kodcaw}/{norujukan}',['uses'=>'TebusController@getAdvansur']);
|
||||
$router->get('AnsuranByTarikh/{kodcaw}',['uses'=>'TebusController@SenaraiAdvansur']);
|
||||
$router->get('AnsuranByRangeTarikh/{kodcaw}',['uses'=>'TebusController@SenaraiAdvansurRangeDate']);
|
||||
$router->get('ansuranupah/{kodcaw}',['uses'=>'TebusController@getAdvansurByKodlaluan']);
|
||||
$router->get('advansurharini/{kodcaw}',['uses'=>'TebusController@advansurharini']);
|
||||
$router->get('advansurdetails/{kodcaw}',['uses'=>'TebusController@advansurdetails']);
|
||||
$router->get('advansurdetailsrange/{kodcaw}',['uses'=>'TebusController@advansurdetailsRange']);
|
||||
$router->post('ansuran/create/{kodcaw}',['uses'=>'TebusController@createAdvansur']);
|
||||
$router->get('advansur/{kodcaw}/{norujukan}',['uses'=>'TebusController@getAdvansurUpah']);
|
||||
|
||||
@@ -401,6 +406,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
|
||||
//Komuditi Pukal
|
||||
$router->get('komuditi/check',['uses'=>'KomuditiController@checkKomuditi']);
|
||||
$router->get('komuditi/checkdate',['uses'=>'KomuditiController@checkKomuditiDateChoose']);
|
||||
$router->post('komuditi/pembelian',['uses'=>'KomuditiController@beliKomuditi']);
|
||||
$router->post('komuditi/jual',['uses'=>'KomuditiController@jualKomuditi']);
|
||||
$router->put('komuditi/update',['uses'=>'KomuditiController@updateKomuditi']);
|
||||
@@ -415,6 +421,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('komoditi/rekod/transaksi',['uses'=>'KomuditiController@rekodTransaksiKomoditi']);
|
||||
|
||||
$router->get('laporan/harian',['uses'=>'LaporanController@laporanHarian']);
|
||||
$router->get('laporan/terkumpul',['uses'=>'LaporanController@laporanTerkumpul']);
|
||||
|
||||
//Collection ID Billplz
|
||||
$router->get('billplz/collectionid',['uses'=>'PortalBillplzController@getCollectionIDCawangan']);
|
||||
|
||||
Reference in New Issue
Block a user