Merge branch 'apiaku' into 'master'
online create gadai old See merge request online-sistem1/api_arrahn!22
This commit is contained in:
@@ -52,6 +52,8 @@ class Gadai extends Model
|
|||||||
'marhun' ,
|
'marhun' ,
|
||||||
'taglel' ,
|
'taglel' ,
|
||||||
't_update',
|
't_update',
|
||||||
|
't_matang',
|
||||||
|
't_matang1',
|
||||||
'penilai' ,
|
'penilai' ,
|
||||||
'tagserah' ,
|
'tagserah' ,
|
||||||
'namapelulus' ,
|
'namapelulus' ,
|
||||||
|
|||||||
@@ -103,6 +103,71 @@ class GadaiController extends Controller
|
|||||||
return response()->json($gadai, 201);
|
return response()->json($gadai, 201);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createold($kodcaw,Request $request)
|
||||||
|
{
|
||||||
|
$current = Carbon::now();
|
||||||
|
$current = new Carbon();
|
||||||
|
|
||||||
|
$t_matang = Carbon::now();
|
||||||
|
$t_matang = new Carbon();
|
||||||
|
$t_matang = $t_matang->addMonths(6)->subDays(1);
|
||||||
|
|
||||||
|
$t_kontrak = Carbon::now();
|
||||||
|
$t_kontrak = new Carbon();
|
||||||
|
$t_kontrak = $t_kontrak->addMonths(12)->subDays(1);
|
||||||
|
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
$gadai = Gadai::on($cawangan['mysql'])->create([
|
||||||
|
'kodcaw'=>$kodcaw,
|
||||||
|
'norujukan' => $request->norujukan,
|
||||||
|
"prkod" => $request->prkod,
|
||||||
|
'nopelanggan' => $request->nopelanggan,
|
||||||
|
'nokp' => $request->nokp,
|
||||||
|
'sirig' => $request->sirig,
|
||||||
|
't_gadai' => $current->toDateString(),
|
||||||
|
'sttebus' => '',
|
||||||
|
'masa' =>$current->toTimeString(),
|
||||||
|
"nilaimarhun" => $request->nilaimarhun,
|
||||||
|
"n_marhuns" => $request->n_marhuns,
|
||||||
|
"berat" => $request->berat,
|
||||||
|
"pinjaman" => $request->pinjaman,
|
||||||
|
"telahbayar" => $request->telahbayar,
|
||||||
|
"upahtelahbyr" => $request->upahtelahbyr,
|
||||||
|
"cajtelahbyr" => $request->cajtelahbyr,
|
||||||
|
"ansuran" => $request->ansuran,
|
||||||
|
"ansupah" => $request->ansupah,
|
||||||
|
"kadarupah" => $request->kadarupah,
|
||||||
|
"t_matang" => $t_matang,
|
||||||
|
"t_matang1" => $t_kontrak,
|
||||||
|
"bakiupah" => $request->bakiupah,
|
||||||
|
"cajlain" => $request->cajlain,
|
||||||
|
"marhun" => $request->marhun,
|
||||||
|
"kuantiti" => $request->kuantiti,
|
||||||
|
"jbg" => 0.5,
|
||||||
|
"tempoh" => 0.5,
|
||||||
|
"kodgl" => $request->kodgl,
|
||||||
|
"taglel" => $request->taglel,
|
||||||
|
"jantina" => $request->jantina,
|
||||||
|
"penilai" => $request->penilai,
|
||||||
|
"namapenilai" => $request->namapenilai,
|
||||||
|
"namateller" => $request->namateller,
|
||||||
|
"tagserah" => $request->tagserah,
|
||||||
|
"namapelulus" => $request->namapelulus,
|
||||||
|
"percentpinj" => $request->percentpinj,
|
||||||
|
"jumtebus" => $request->jumtebus,
|
||||||
|
"upahnotis" => $request->upahnotis,
|
||||||
|
"upahpercuma" => $request->upahpercuma,
|
||||||
|
"upahdibayar" => $request->upahdibayar,
|
||||||
|
"semakbarcode" => $request->semakbarcode,
|
||||||
|
"historygadaian" => $request->historygadaian,
|
||||||
|
"idjompay" => $request->idjompay,
|
||||||
|
"bayarupahonline" => $request->bayarupahonline
|
||||||
|
|
||||||
|
]);
|
||||||
|
return response()->json($gadai, 201);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function daftarGadaiMarhun($norujukan,Request $request)
|
public function daftarGadaiMarhun($norujukan,Request $request)
|
||||||
{
|
{
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
$router->get('gadai/norujukan/{norujukan}',['uses'=>'GadaiController@showOneGadaiByNorujukan']);
|
$router->get('gadai/norujukan/{norujukan}',['uses'=>'GadaiController@showOneGadaiByNorujukan']);
|
||||||
$router->get('gadai/norujukan/{kodcaw}/{norujukan}',['uses'=>'GadaiController@showOneGadaibyRujukanAndCawangan']);
|
$router->get('gadai/norujukan/{kodcaw}/{norujukan}',['uses'=>'GadaiController@showOneGadaibyRujukanAndCawangan']);
|
||||||
$router->post('gadai/{kodcaw}',['uses'=>'GadaiController@create']);
|
$router->post('gadai/{kodcaw}',['uses'=>'GadaiController@create']);
|
||||||
|
$router->post('gadaiold/{kodcaw}',['uses'=>'GadaiController@createold']); //create old sag
|
||||||
$router->get('gadai/{cawangan_code}/{date}',['uses'=>'GadaiController@gadaiTransactionByCawanganAndDay']);
|
$router->get('gadai/{cawangan_code}/{date}',['uses'=>'GadaiController@gadaiTransactionByCawanganAndDay']);
|
||||||
$router->put('gadai/norujukan/{norujukan}',['uses'=>'GadaiController@updateOneGadaiByNorujukan']);
|
$router->put('gadai/norujukan/{norujukan}',['uses'=>'GadaiController@updateOneGadaiByNorujukan']);
|
||||||
$router->put('gadai/{kodcaw}/norujukan/{norujukan}',['uses'=>'GadaiController@updateGadaiMarhunOnline']); // gadai online ansuran
|
$router->put('gadai/{kodcaw}/norujukan/{norujukan}',['uses'=>'GadaiController@updateGadaiMarhunOnline']); // gadai online ansuran
|
||||||
|
|||||||
Reference in New Issue
Block a user