pembuatan api
This commit is contained in:
@@ -9,6 +9,8 @@ use App\Transaction;
|
||||
use App\TransaksiKeuntungan;
|
||||
use App\Advansur;
|
||||
use App\Tebus;
|
||||
use App\InOutMar;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -218,7 +220,7 @@ class TebusController extends Controller
|
||||
'kodcaw'=> $kodcaw,
|
||||
'norujukan'=> $norujukan,
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'jenisbyr' => "TN",
|
||||
'JenisByr' => "TN",
|
||||
'jenistebus' => $request->jenistebus,
|
||||
'glcode' => "0",
|
||||
't_tebus' => $current->toDateString(),
|
||||
@@ -237,8 +239,22 @@ class TebusController extends Controller
|
||||
'historygadaian' => $request->historygadaian,
|
||||
'tarikhbyrn' => $current->toDateString()
|
||||
]);
|
||||
|
||||
return response()->json($update_gadai, 200);
|
||||
|
||||
$create_inoutmar = InOutMar::on($cawangan['mysql'])->create([
|
||||
'TARIKH' => $current->toDateString(),
|
||||
'MASA' => $current->toTimeString(),
|
||||
'NORUJUKAN' => $norujukan,
|
||||
'NM' => $request->nilai_marhun,
|
||||
'KPD' => "kosong",
|
||||
'DRP' => "kosong",
|
||||
'BLN' => $current->month,
|
||||
'THN' => $current->year,
|
||||
'TAG' => 0,
|
||||
'jenisTebus' => $request->jenistebus,
|
||||
'namaTeller' => "nama teller"
|
||||
]);
|
||||
|
||||
return response()->json($update_gadai, 201);
|
||||
}
|
||||
|
||||
public function getLaporanTebus($kodcaw,$tarikh){
|
||||
@@ -252,5 +268,46 @@ class TebusController extends Controller
|
||||
return response()->json($tebus);
|
||||
}
|
||||
|
||||
//API FARIS
|
||||
public function listPenebusanBaru($kodcaw)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$gadai = Tebus::on($cawangan['mysql'])
|
||||
->where([['t_tebus','=',$current->toDateString()],['tagterima','=',0]])
|
||||
->get();
|
||||
|
||||
return response()->json($gadai);
|
||||
|
||||
}
|
||||
|
||||
public function listSerahKhazanah($kodcaw)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadai = Tebus::on($cawangan['mysql'])
|
||||
->where([['t_tebus','=',$current->toDateString()],['tagterima','=',1]])
|
||||
->get();
|
||||
return response()->json($gadai);
|
||||
|
||||
}
|
||||
|
||||
public function tagterimaupdate($kodcaw,$norujukan)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$update_inoutmar = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
||||
'tagterima' => 1
|
||||
));
|
||||
}
|
||||
|
||||
//END API FARIS
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user