15 Commits

Author SHA1 Message Date
nurafrinaalimi16 2363c2947d fix diskaun promosi on tebus 2026-09-02 16:41:49 +08:00
nurafrinaalimi16 280f8cefa4 Merge remote-tracking branch 'origin/prod-kopkb' into test/merge-prod-kopkb 2026-09-01 11:15:13 +08:00
nurafrinaalimi16 fb5a007fdc pelarasan rebate on imbang duga 2025-08-17 16:05:57 +08:00
nurafrinaalimi16 192a70d46e fix vault controller for rebate annur 2025-06-15 16:42:36 +08:00
nurafrinaalimi16 65eb1dfc62 add rebet to vault controller 2025-05-19 16:31:27 +08:00
nurafrinaalimi16 07d442a654 migrate for kadar rebet annur 2025-05-11 16:39:50 +08:00
nurafrinaalimi16 a2e37f5903 rebate annur 2025-05-11 16:39:11 +08:00
Ain Izazi 11bbfc1745 feat audit sag hilang and tuntut baki 2025-02-03 12:37:33 +08:00
Ain Izazi e5075859c4 feature audit kaunter 2025-02-03 12:37:33 +08:00
nurafrinaalimi16 282e8705b2 Merge branch 'production' of https://bitbucket.org/arrahn-pkb/api_arrahn into annur-rebate 2025-01-26 12:56:45 +08:00
nurafrinaalimi16 91cbcf87db fix marhun controller and connection database 2024-12-03 20:39:01 +08:00
nurafrinaalimi16 bbd033f175 Merge branch 'production' of https://bitbucket.org/arrahn-pkb/api_arrahn into annur-rebate 2024-12-03 12:54:50 +08:00
Afiq Hamzah a5f6d55151 Add .env.prod.example for docker environment 2024-11-26 13:12:56 +08:00
hayatie 4dd102f67d db 2024-11-21 12:18:48 +08:00
dev_kopkb cdcf08b209 add kadar rebate at GadaiV2 2024-11-19 11:41:31 +08:00
16 changed files with 257 additions and 58 deletions
+3 -1
View File
@@ -73,7 +73,9 @@ class Gadai extends Model
'tagkomuditi',
'tempohbayar',
'lelong_tawarruq',
'tag_tebus'
'tag_tebus',
'kadarrebet',
'diskaun'
];
/**
+4 -2
View File
@@ -589,7 +589,7 @@ class GadaiController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$gadai_data = Gadai::on($cawangan['mysql'])->select('t_gadai','norujukan','nokp','semakbarcode','masa','berat','nilaimarhun','pinjaman','upah12','percentpinj','teller','nokp','ujrah','onepercent','tagbaru')
$gadai_data = Gadai::on($cawangan['mysql'])->select('t_gadai','norujukan','nokp','semakbarcode','masa','berat','nilaimarhun','pinjaman','upah12','percentpinj','teller','nokp','ujrah','onepercent','tagbaru','diskaun')
->where('t_gadai','>=',$request->mula)
->where('t_gadai','<=',$request->akhir)
->orderBy('t_gadai')
@@ -618,7 +618,9 @@ class GadaiController extends Controller
"teller"=> $gadaiData['teller'],
"ujrah"=> $gadaiData['ujrah'],
"onepercent"=> $gadaiData['onepercent'],
"tagbaru"=> $gadaiData['tagbaru']
"tagbaru"=> $gadaiData['tagbaru'],
"kadar_rebet" => $gadaiData['kadarrebet'],
"diskaun" => $gadaiData['diskaun']
]);
}
+2 -2
View File
@@ -605,9 +605,9 @@ class LelongController extends Controller
if($cawangan['tagarrahnbid'] == 1){
if(env('APP_ENV') != 'production'){
$link = 'https://adminbid-kopkb.erahn.com.my/api/portalApi';
$link = 'https://adminbid-annur.erahn.com.my/api/portalApi';
}else{
$link = 'https://adminbid-kopkb.erahn.com.my/api/portalApi';
$link = 'https://adminbid-annur.erahn.com.my/api/portalApi';
}
$lelong = Http::withOptions(['verify' => true])->get($link,[
+2 -2
View File
@@ -203,7 +203,7 @@ class MarhunController extends Controller
$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')
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
->rightJoin('master_erahn.customer as customer', 'customer.kpbaru','=','gadai.nokp')
->rightJoin('master_annur.customer as customer', 'customer.kpbaru','=','gadai.nokp')
->where('marhun.t_gadai','=',$tarikh)
->orderBy('marhun.t_gadai')
->get();
@@ -221,7 +221,7 @@ class MarhunController extends Controller
$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')
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
->rightJoin('master_erahn.customer as customer', 'customer.kpbaru','=','gadai.nokp')
->rightJoin('master_annur.customer as customer', 'customer.kpbaru','=','gadai.nokp')
->where('marhun.t_gadai','<=',$tarikh)
->whereYear('marhun.t_gadai','=',$current->year)
->where('gadai.sttebus','=','')
+53 -4
View File
@@ -193,7 +193,7 @@ class TebusController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$tebus_data = Tebus::on($cawangan['mysql'])
->select('tebus.t_tebus', 'gad.t_gadai','gad.hargajualan','gad.bakihargajualan','gad.bakipjm as gadaibakipjm','tebus.nilaimarhun','tebus.tagterima', 'tebus.teller','tebus.jenistebus','tebus.pinjaman','tebus.bakiupah','tebus.bakipjm','gad.norujukan','gad.nokp','tebus.jbg','tebus.ujrah','tebus.onepercent','gad.tagbaru')
->select('tebus.t_tebus', 'gad.t_gadai','gad.hargajualan','gad.bakihargajualan','gad.bakipjm as gadaibakipjm','tebus.nilaimarhun','tebus.tagterima', 'tebus.teller','tebus.jenistebus','tebus.pinjaman','tebus.bakiupah','tebus.bakipjm','gad.norujukan','gad.nokp','tebus.jbg','tebus.ujrah','tebus.onepercent','gad.tagbaru','tebus.diskaun_rebate')
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
// ->join('online_arrahn.customer as cust', function($join)
// {
@@ -232,7 +232,8 @@ class TebusController extends Controller
"nokp"=>$tebusData['nokp'],
"jbg"=>$tebusData['jbg'],
"ujrah"=>$trans['ujrah_rebet'],
"onepercent"=>$trans['onepercent_rebet']
"onepercent"=>$trans['onepercent_rebet'],
"diskaun_rebate"=>$tebusData['diskaun_rebate'],
]);
}
@@ -274,7 +275,8 @@ class TebusController extends Controller
'tebus.jbg',
'tebus.ujrah',
'tebus.onepercent',
'gad.tagbaru'
'gad.tagbaru',
'tebus.diskaun_rebate'
)
->join('gadai as gad', 'gad.norujukan', '=', 'tebus.norujukan')
->where('tebus.t_tebus', '>=', $request->mula)
@@ -310,7 +312,8 @@ class TebusController extends Controller
"jbg"=>$tebusData['jbg'],
"ujrah"=>$trans['ujrah_rebet'],
"onepercent"=>$trans['onepercent_rebet'],
"tagbaru"=>$tebusData['tagbaru']
"tagbaru"=>$tebusData['tagbaru'],
"diskaun_rebate"=>$tebusData['diskaun_rebate'],
]);
}
@@ -1672,6 +1675,37 @@ class TebusController extends Controller
return response($rebet);
}
public function RebetPromoCalculation($kodcaw,Request $request)
{
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$rebet = Tebus::on($cawangan['mysql'])
->join('gadai as db2','tebus.norujukan','=','db2.norujukan')
// ->where('tebus.t_tebus','>','2021-04-13')
->where('tebus.t_tebus','<=',$request->tarikh)
->where('db2.hargajualan','>','0') // tambahan 2021-05-07
->whereNotNull('db2.hargajualan')
->sum('diskaun_rebate');
return response($rebet);
}
public function PelarasanRebate($kodcaw,Request $request)
{
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
// Jumlah diskaun_rebate dari 13/5/2025 hingga tarikh semasa
$rebet = Tebus::on($cawangan['mysql'])
->join('gadai as db2', 'tebus.norujukan', '=', 'db2.norujukan')
->whereBetween('tebus.t_tebus', ['2025-05-13', $request->tarikh])
->where('db2.hargajualan', '>', 0)
->where('db2.t_gadai', '>', '2023-05-21')
->whereNotNull('db2.hargajualan')
->sum('diskaun_rebate');
return response($rebet);
}
public function RebetCalculationLejer($kodcaw,Request $request)
{
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
@@ -1687,6 +1721,21 @@ class TebusController extends Controller
return response($rebet);
}
public function RebetPromoCalculationLejer($kodcaw,Request $request)
{
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$rebet = Tebus::on($cawangan['mysql'])
->join('gadai as db2','tebus.norujukan','=','db2.norujukan')
->where('tebus.t_tebus','>=',$request->mula)
->where('tebus.t_tebus','<=',$request->hingga)
->where('db2.hargajualan','>','0')
->whereNotNull('db2.hargajualan')
->sum('diskaun_rebate');
return response($rebet);
}
public function getUpahLamaToday($kodcaw,$norujukan)
{
$current = Carbon::now();
+3 -1
View File
@@ -12,6 +12,7 @@ use App\GlDetail;
use App\imbangdugalama;
use App\GlCode;
use App\Panjar;
use App\Tebus;
use Illuminate\Http\Request;
use Carbon\Carbon;
@@ -375,7 +376,7 @@ class VaultController extends Controller
return response()->json($gldetail,200);
}
public function TunaiDiTangan($kodcaw,Request $request)
public function TunaiDiTangan($kodcaw,Request $request)
{
$current = Carbon::now();
$current = new Carbon();
@@ -411,6 +412,7 @@ class VaultController extends Controller
return response()->json($totalbakiakhirtunai);
}
public function TunaiDiTanganLejer($kodcaw,Request $request)
{
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class KadarRebet extends Model
{
protected $table = 'kadar_rebet';
public $timestamps = false;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
function transaction()
{
}
}
+17 -1
View File
@@ -3,7 +3,9 @@
namespace App\Support\v2;
use App\KadarUpah;
use App\KadarRebet;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class Calculation
{
@@ -41,6 +43,16 @@ class Calculation
return $onepercent;
}
private function kiraanRebetAnnur (float $pembiayaan = 0.0){
$kadarrebet = KadarRebet::on('mysql7')
->where('pembiayaan_min', '<=', $pembiayaan)
->where('pembiayaan_max', '>=', $pembiayaan)
->sum('kadarrebet');
return $kadarrebet;
}
public function kiraanUjrahSebenar(float $nilaimarhun = 0.0,float $kadarujrah = 0.0,float $margin = 0.0){
if($kadarujrah >= 1){
@@ -61,13 +73,17 @@ class Calculation
$onepercent = $this->kiraanOnePercent($pembiayaan);
$ujrah_sebenar = $this->kiraanUjrahSebenar($nilaimarhun,$kadarujrah,$margin);
$discount = $this->kiraanRebetAnnur($pembiayaan);
Log::debug('discount:' . $discount);
$onepercent = (!empty($onepercent)) ? $this->getRoundedMethod($onepercent) : 0;
$ujrah_sebenar = (!empty($ujrah_sebenar)) ? $this->getRoundedMethod($ujrah_sebenar) : 0;
$keuntungan = $onepercent + $ujrah_sebenar;
return ['keuntungan' => $keuntungan,'onepercent' => $onepercent, 'ujrah' => $ujrah_sebenar];
$kadar_diskaun = $this->getRoundedMethod($keuntungan * ($discount/100));
Log::debug('kadar_discount:' .$kadar_diskaun);
return ['keuntungan' => $keuntungan,'onepercent' => $onepercent, 'ujrah' => $ujrah_sebenar,'diskaun' => $kadar_diskaun];
}
public function kiraanKeuntunganSebenar(float $pembiayaan = 0.0,float $nilaimarhun = 0.0,float $kadarujrah = 0.0,float $margin = 0.0){
+9 -2
View File
@@ -137,6 +137,9 @@ if (is_null($kadar_raw)) {
$upah12 = $onepercentservices->getRoundedMethod($upah1 * 12);
$ujrah = $onepercentservices->getRoundedMethod($keuntungan['ujrah']);
$onepercent = $onepercentservices->getRoundedMethod($keuntungan['onepercent']);
$kadar_rebet = $request->input('kadar_rebate');
$diskaun = $request->input('rebate');
$hargajualan = $request->pinjaman + $upah12;
@@ -176,6 +179,8 @@ if (is_null($kadar_raw)) {
'tagbaru' => 1,
'tunggakanujrah' => $akrual['ujrah'],
'tunggakanonepercent' => $akrual['keuntungan'],
'kadarrebet' => $kadar_rebet,
'diskaun' => $diskaun
));
$new_data = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->first();
@@ -247,7 +252,8 @@ if (is_null($kadar_raw)) {
$ujrah = $onepercentservices->getRoundedMethod($bilang_bln * $upah['ujrah']);
$upahrebet_raw = $onepercent + $ujrah;
$upahrebet_raw = $onepercentservices->getRoundedMethod($upahrebet_raw);
$upahrebet_raw = $upahrebet_raw - $upah['diskaun'];
return $upahrebet_raw;
}
@@ -284,7 +290,7 @@ if (is_null($kadar_raw)) {
$keuntungan = $onepercent->kiraanKeuntunganRebet($gadai['bakipjm'],$gadai['nilaimarhun'],$gadai['kadarupah'],$gadai['margin_semasa']);
$ujrahasal = $onepercent->kiraanUjrahSebenar($gadai['nilaimarhun'],$gadai['kadarupah'],$gadai['percentpinj']);
Log::debug($keuntungan);
$onepercentasal = $gadai['pinjaman'] * (1/100);
$ujrahasal = $onepercent->getRoundedMethod($ujrahasal);
$onepercentasal = $onepercent->getRoundedMethod($onepercentasal);
@@ -333,6 +339,7 @@ if (is_null($kadar_raw)) {
'tempoh' => $gadai['tempoh'],
'beza_tempoh' => $bilang_bln,
'margin_semasa' => $margin_semasa,
'kadardiskaun' => $keuntungan['diskaun']
]);
$transaksi_gadai = TransaksiGadai::on('mysql7')->create([
+63 -39
View File
@@ -39,33 +39,34 @@ class Penebusan
$this->cawangan_info = $cawangan_info;
}
public function tebusTawarruq($kodcaw,$norujukan){
$onepercentservices = new Calculation();
public function tebusTawarruq($kodcaw, $norujukan)
{
$onepercentservices = new Calculation();
$cawangan = Cawangan::on('mysql7')
->where('kodcaw','=',$kodcaw)
->first();
$cawangan = Cawangan::on('mysql7')
->where('kodcaw', '=', $kodcaw)
->first();
$gadai_data = Gadai::on($cawangan['mysql'])
->where('norujukan','=',$norujukan)
->first();
$gadai_data = Gadai::on($cawangan['mysql'])
->where('norujukan', '=', $norujukan)
->first();
$jeniskeuntungan = ($gadai_data['tagbaru'] == 1) ? 'onepercent' : 'asal';
$jeniskeuntungan = ($gadai_data['tagbaru'] == 1) ? 'onepercent' : 'asal';
$rebet = $this->rebetselepastawarruq($kodcaw,$norujukan,$jeniskeuntungan);
$harga_tebus = $gadai_data['bakihargajualan'] - $rebet;
$rebet = $this->rebetselepastawarruq($kodcaw, $norujukan, $jeniskeuntungan);
// $hargatebus = round($harga_tebus,PHP_ROUND_HALF_UP);
// $hargatebus = bcdiv(round($harga_tebus,2),1,1);
// $hargatebus = number_format($hargatebus,2);
// if(strpos($hargatebus,',')){
// $hargatebus = str_replace(',','',$hargatebus);
// }
// Ambil terus dari column 'diskaun'
$diskaun = $gadai_data['diskaun'] ?? 0;
$hargatebus = $onepercentservices->getRoundedMethod($harga_tebus);
// Kira harga tebus selepas tolak rebet & diskaun
$harga_tebus = $gadai_data['bakihargajualan'] - $rebet - $diskaun;
// Apply pembundaran
$hargatebus = $onepercentservices->getRoundedMethod($harga_tebus);
return response()->json($hargatebus);
}
return response()->json($hargatebus);
}
public function hargaTebusTawarruq($kodcaw,$norujukan){
$onepercentservices = new Calculation();
@@ -485,6 +486,9 @@ class Penebusan
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->first();
// Ambil nilai diskaun
$diskaun = $gadai['diskaun'] ?? 0;
//check duplicate
$data = Transaction::on('mysql7')->where('norujukan','=',$norujukan)->whereIn('trans_type', ['P', 'T', 'S'])->first();
@@ -492,7 +496,7 @@ class Penebusan
return response()->json('duplicate');
}
$ujrah=0;$onepercent=0;$rounded=0;
$ujrah=0;$onepercent=0;$rounded=0;$upah_rebet_sebenar=0;
if($gadai['hargajualan'] == null){
$harga_tebus = $this->hargaTebusNotTawarruq($kodcaw,$norujukan);
$upah_tebus = $this->kiraUpahNotTawarruq($kodcaw,$norujukan);
@@ -502,7 +506,6 @@ class Penebusan
$harga_tebus = $this->hargaTebusTawarruq($kodcaw,$norujukan,$request->jeniskeuntungan);
$upah_tebus = $this->kiraupahTawarruq($norujukan);
$upah_rebet = $this->kiraUpahRebetSebenar($kodcaw,$norujukan);
$upah_rebet_sebenar = $harga_tebus['harga'] - $gadai['bakipjm'];
if($request->jeniskeuntungan == 'onepercent'){
$array_onepercent = $this->kiraupahUjrahOnePercent($kodcaw,$norujukan);
@@ -514,8 +517,14 @@ class Penebusan
$ujrah = $array_onepercent['ujrah'];
$onepercent = $array_onepercent['onepercent'];
}
// FIX: tolak diskaun DAHULU sebelum kira upah_rebet_sebenar
$harga_tebus['harga'] -= $diskaun;
$upah_rebet_sebenar = $harga_tebus['harga'] - $gadai['bakipjm'];
}
$bayaran_keuntungan_bersih = max(0, $upah_rebet_sebenar);
$create_tebus = Tebus::on($cawangan['mysql'])->create([
'kodcaw'=> $kodcaw,
@@ -543,6 +552,7 @@ class Penebusan
'teller' => $request->teller,
'ujrah' => $ujrah_rebet,
'onepercent' => $onepercent_rebet,
'diskaun_rebate' => $diskaun, // Tambah kolum simpan diskaun
]);
$create_inoutmar = InOutMar::on($cawangan['mysql'])->create([
@@ -559,21 +569,31 @@ class Penebusan
'namateller' => $request->teller
]);
$transaction_upah = TransaksiKeuntungan::on('mysql7')->create([
'norujukan' => $norujukan,
'bayaran_keuntungan' => $upah_tebus,
'bayaran_pembiayaan' => $gadai['bakipjm'],
'keuntungan_rebet' => $upah_rebet_sebenar,
'tarikh_bayaran'=> $current,
'kodcaw'=> $kodcaw,
'ujrah' => ($request->jeniskeuntungan == 'onepercent') ? $array_onepercent['ujrah'] : 0,
'ujrah_rebet' => ($request->jeniskeuntungan == 'onepercent') ? $ujrah_rebet : 0,
'onepercent' => ($request->jeniskeuntungan == 'onepercent') ? $array_onepercent['onepercent'] : 0,
'onepercent_rebet' => ($request->jeniskeuntungan == 'onepercent') ? $onepercent_rebet : 0,
'margin_semasa' => ($request->jeniskeuntungan == 'onepercent') ? $margin_semasa : 0,
'tempoh' => $gadai['tempoh'],
'beza_tempoh' => ($gadai['tempoh'] - $gadai['tempohbayar']),
]);
$transaction_upah = TransaksiKeuntungan::on('mysql7')->create([
'norujukan' => $norujukan,
'bayaran_keuntungan' => $bayaran_keuntungan_bersih,
'bayaran_pembiayaan' => $gadai['bakipjm'],
'keuntungan_rebet' => $upah_rebet_sebenar,
'tarikh_bayaran' => $current,
'kodcaw' => $kodcaw,
'ujrah' => ($request->jeniskeuntungan == 'onepercent')
? $array_onepercent['ujrah']
: 0,
'ujrah_rebet' => ($request->jeniskeuntungan == 'onepercent')
? $ujrah_rebet
: 0,
'onepercent' => ($request->jeniskeuntungan == 'onepercent')
? $array_onepercent['onepercent']
: 0,
'onepercent_rebet' => ($request->jeniskeuntungan == 'onepercent')
? $onepercent_rebet
: 0,
'margin_semasa' => ($request->jeniskeuntungan == 'onepercent')
? $margin_semasa
: 0,
'tempoh' => $gadai['tempoh'],
'beza_tempoh' => $gadai['tempoh'] - $gadai['tempohbayar'],
]);
if($request->jenistebus == 'P'){
$baki_hargajualan = $gadai['bakihargajualan'] - $request->bakiupah;
@@ -683,6 +703,8 @@ class Penebusan
}
}
$bayaran_keuntungan_bersih = max(0, $upah_rebet_sebenar);
$update_gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
'sttebus' => "T",
't_update' => $current->toDateString(),
@@ -736,7 +758,7 @@ class Penebusan
$transaction_upah = TransaksiKeuntungan::on('mysql7')->create([
'norujukan' => $norujukan,
'bayaran_keuntungan' => $upah_tebus,
'bayaran_keuntungan' => $bayaran_keuntungan_bersih,
'bayaran_pembiayaan' => $bayaran_pembiayaan,
'keuntungan_rebet' => $upah_rebet_sebenar,
'tarikh_bayaran'=> $current,
@@ -1133,10 +1155,12 @@ class Penebusan
$upah_rebet_sebenar = $harga_tebus['harga'] - $gadai['bakipjm'];
$bayaran_keuntungan_bersih = max(0, $upah_rebet_sebenar);
try{
TransaksiKeuntungan::on('mysql7')->create([
'norujukan' => $norujukan,
'bayaran_keuntungan' => $upah_tebus,
'bayaran_keuntungan' => $bayaran_keuntungan_bersih,
'bayaran_pembiayaan' => $bayaran_pembiayaan,
'keuntungan_rebet' => $upah_rebet_sebenar,
'tarikh_bayaran'=> $current,
+2 -1
View File
@@ -52,7 +52,8 @@ class Tebus extends Model
'pinjamanterkini',
'tarikhbyrn',
'ujrah',
'onepercent'
'onepercent',
'diskaun_rebate'
];
/**
+1 -1
View File
@@ -14,7 +14,7 @@ class TransaksiKeuntungan extends Model
* @var array
*/
protected $fillable = [
'norujukan','bayaran_keuntungan','tarikh_bayaran','kodcaw','bayaran_pembiayaan','keuntungan_rebet','ujrah','ujrah_rebet','onepercent','onepercent_rebet','tempoh','beza_tempoh','margin_semasa','rounded'
'norujukan','bayaran_keuntungan','tarikh_bayaran','kodcaw','bayaran_pembiayaan','keuntungan_rebet','ujrah','ujrah_rebet','onepercent','onepercent_rebet','tempoh','beza_tempoh','margin_semasa','rounded','kadardiskaun'
];
/**
@@ -42,7 +42,7 @@ class AddColumnsToKomuditiTransaksi extends Migration
{
$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'] === 'online_arrahn' || $connection['database'] === 'master_annur' || $connection['database'] === config('tennant_master.database')){
return true;
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateKadarRebetTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql7')->table('kadar_rebet', function (Blueprint $table) {
$table->id();
$table->decimal('min');
$table->decimal('max');
$table->decimal('kadar_rebet');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('kadar_rebet');
}
}
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class KadarRebet extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
+4 -1
View File
@@ -550,6 +550,8 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->get('CalculationPendahuluanSerahan/{kodcaw}',['uses'=>'VaultController@CalculationPendahuluanSerahan']);
$router->get('KeuntunganArRahn/{kodcaw}',['uses'=>'GadaiController@CalculationKeuntungan']);
$router->get('RebetCalculation/{kodcaw}',['uses'=>'TebusController@RebetCalculation']);
$router->get('RebetPromoCalculation/{kodcaw}',['uses'=>'TebusController@RebetPromoCalculation']);
$router->get('PelarasanRebate/{kodcaw}',['uses'=>'TebusController@PelarasanRebate']);
//-- Harta Semasa --//
$router->get('PinjamanDiberi/{kodcaw}',['uses'=>'GadaiController@CalculationPinjamanDiberi']);
@@ -579,7 +581,8 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->get('PendahuluanSerahanLejer/{kodcaw}',['uses'=>'VaultController@CalculationPendahuluanSerahanLejer']);
$router->get('KeuntunganArRahnLejer/{kodcaw}',['uses'=>'GadaiController@CalculationKeuntunganLejer']);
$router->get('RebetCalculationLejer/{kodcaw}',['uses'=>'TebusController@RebetCalculationLejer']);
$router->get('cajlelongLejer/{kodcaw}',['uses'=>'LelongController@cajlelongcalculationLejer']);
$router->get('RebetPromoCalculationLejer/{kodcaw}',['uses'=>'TebusController@RebetPromoCalculationLejer']);
$router->get('cajlelongLejer/{kodcaw}',['uses'=>'LelongController@cajlelongcalculationLejer']);
// //-- Harta Semasa --//
$router->get('PinjamanDiberiLejer/{kodcaw}',['uses'=>'GadaiController@CalculationPinjamanDiberiLejer']);