fix penebusan rekod bayaran upah serahan kemaskini

This commit is contained in:
fifi97
2021-06-20 11:25:23 +08:00
parent 43cc37bfac
commit 42b83449f1
6 changed files with 35 additions and 56 deletions
+14 -2
View File
@@ -554,8 +554,14 @@ class GadaiController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$gadai = Gadai::on($cawangan['mysql'])
->where('t_gadai','=',$tarikh)
->orderBy('teller')
->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);
@@ -2286,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'])
+3 -3
View File
@@ -39,10 +39,10 @@ class GlejerController extends Controller
$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");
$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);
}
+4 -1
View File
@@ -196,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];
+13 -47
View File
@@ -494,22 +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')
->get();
return response()->json($tebus);
}
public function getLaporanTebusRange($kodcaw,Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$tebus = Tebus::on($cawangan['mysql'])
->where('t_tebus','>=',$request->mula)
->where('t_tebus','<=',$request->akhir)
->orderBy('teller')
->orderBy('t_tebus','asc')
->orderBy('sirit','asc')
->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);
@@ -543,36 +536,6 @@ class TebusController extends Controller
return response()->json($array_penebusan);
}
public function getLaporanTebusPengasinganRange($kodcaw,Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$tebusarrahn = Tebus::on($cawangan['mysql'])
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
->where('t_tebus','>=',$request->mula)
->where('t_tebus','<=',$request->akhir)
->whereNull('hargajualan');
$totalpenebusanarrahn = $tebusarrahn->sum('tebus.pinjaman');
$bilpenebusanarrahn = $tebusarrahn->count();
$totalkeuntunganarrahn = $tebusarrahn->sum('tebus.bakiupah');
$tebustawarruq = Tebus::on($cawangan['mysql'])
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
->where('t_tebus','>=',$request->mula)
->where('t_tebus','<=',$request->akhir)
->whereNotNull('hargajualan');
$totalpenebusantawarruq = $tebustawarruq->sum('tebus.pinjaman');
$bilpenebusantawarruq = $tebustawarruq->count();
$totalrebatetawarruq = $tebustawarruq->sum('tebus.rebate');
$totalkeuntungantawarruq = $tebustawarruq->sum('tebus.bakiupah');
$array_penebusan = ['bilarrahn' => $bilpenebusanarrahn, 'totalarrahn' => $totalpenebusanarrahn, 'keuntunganarrahn' => $totalkeuntunganarrahn, 'biltawarruq' => $bilpenebusantawarruq, 'totaltawarruq' => $totalpenebusantawarruq,'totalrebate' => $totalrebatetawarruq,'keuntungantawarruq' => $totalkeuntungantawarruq];
return response()->json($array_penebusan);
}
public function listPenebusanBaru($kodcaw){
$current = Carbon::now();
@@ -1066,7 +1029,10 @@ class TebusController extends Controller
->whereNotNull('db2.hargajualan')
->sum('bayaran_keuntungan');
$total = ($keuntungan+$keuntunganreducing + $ansuran + $bukanansuran);
$total = $bukanansuran + $ansuran + $keuntungan;
// $total = ($keuntungan + $keuntunganreducing + $ansuran + $bukanansuran);
return response($total);
}
+1 -1
View File
@@ -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)
-2
View File
@@ -94,9 +94,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->get('tebusbukantawarruq/{kodcaw}/{norujukan}',['uses'=>'TebusController@tebusNotTawarruq']);
$router->get('upahbukantawarruq/{kodcaw}/{norujukan}',['uses'=>'TebusController@upahNotTawarruq']);
$router->get('tebus/laporan/{kodcaw}/{tarikh}',['uses'=>'TebusController@getLaporanTebus']);
$router->get('tebuslaporanRange/{kodcaw}',['uses'=>'TebusController@getLaporanTebusRange']);
$router->get('tebus/laporanjenistawarruq/{kodcaw}',['uses'=>'TebusController@getLaporanTebusPengasingan']);
$router->get('tebuslaporanjenistawarruqrange/{kodcaw}',['uses'=>'TebusController@getLaporanTebusPengasinganRange']);
//Maintenance API TEBUS
// $router->get('rebet/{kodcaw}/{norujukan}',['uses' => 'TebusController@rebet']);