update
This commit is contained in:
@@ -17,66 +17,38 @@ use Carbon\Carbon;
|
|||||||
class CustomerController extends Controller
|
class CustomerController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function showAllCustomers()
|
public function showAllCustomers(){
|
||||||
{
|
$customer = Customer::on('mysql7')->get();
|
||||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
|
||||||
// $customer_all = [];
|
|
||||||
// foreach($cawangan_all as $index=>$cawangan){
|
|
||||||
$customer = Customer::on('mysql7')->get();
|
|
||||||
// if($customer != null){
|
|
||||||
// array_push($customer_all,$customer);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return response()->json($customer);
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLatestCustomer($kodcaw){
|
public function getLatestCustomer($kodcaw){
|
||||||
// $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
|
||||||
|
|
||||||
$customer = Customer::on('mysql7')->orderBy('tarikhdaftar','desc')->orderBy('nosiri','desc')->first();
|
$customer = Customer::on('mysql7')->orderBy('tarikhdaftar','desc')->orderBy('nosiri','desc')->first();
|
||||||
|
|
||||||
return response()->json($customer);
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showAllCustomersByCawangan($kodcaw)
|
public function showAllCustomersByCawangan($kodcaw){
|
||||||
{
|
|
||||||
// $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
|
||||||
|
|
||||||
$customer = Customer::on('mysql7')->get();
|
$customer = Customer::on('mysql7')->get();
|
||||||
|
|
||||||
return response()->json($customer);
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showOneCustomerByIC($ic){
|
public function showOneCustomerByIC($ic){
|
||||||
|
$customer = Customer::on('mysql7')
|
||||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
->where('kplama','=',$ic)
|
||||||
// $customer_all = [];
|
->orWhere('kpbaru','=',$ic)
|
||||||
// foreach($cawangan_all as $index=>$cawangan){
|
->first();
|
||||||
$customer = Customer::on('mysql7')
|
|
||||||
->where('kplama','=',$ic)
|
|
||||||
->orWhere('kpbaru','=',$ic)
|
|
||||||
->first();
|
|
||||||
// if($customer != null){
|
|
||||||
// array_push($customer_all,$customer);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return response()->json($customer);
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showOneCustomerByICAdmin(Request $request){
|
public function showOneCustomerByICAdmin(Request $request){
|
||||||
|
|
||||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
$customer = Customer::on('mysql7')
|
||||||
// $customer_all = [];
|
->where('kplama','=',$request->ic)
|
||||||
// foreach($cawangan_all as $index=>$cawangan){
|
->orWhere('kpbaru','=',$request->ic)
|
||||||
$customer = Customer::on('mysql7')
|
->first();
|
||||||
->where('kplama','=',$request->ic)
|
|
||||||
->orWhere('kpbaru','=',$request->ic)
|
|
||||||
->first();
|
|
||||||
// if($customer != null){
|
|
||||||
// array_push($customer_all,$customer);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return response()->json($customer);
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
@@ -315,8 +287,6 @@ class CustomerController extends Controller
|
|||||||
|
|
||||||
public function getLaporanCustomers($kodcaw, $tarikh)
|
public function getLaporanCustomers($kodcaw, $tarikh)
|
||||||
{
|
{
|
||||||
// $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
|
||||||
|
|
||||||
$gadai = Customer::on('mysql7')
|
$gadai = Customer::on('mysql7')
|
||||||
->where([['tarikhdaftar','=',$tarikh],['kodcaw',$kodcaw]])
|
->where([['tarikhdaftar','=',$tarikh],['kodcaw',$kodcaw]])
|
||||||
->orderBy('tarikhdaftar', 'desc')
|
->orderBy('tarikhdaftar', 'desc')
|
||||||
@@ -364,28 +334,19 @@ class CustomerController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function customerUpdate($nokp,Request $request){
|
public function customerUpdate($nokp,Request $request){
|
||||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||||
// foreach($cawangan_all as $index=>$cawangan){
|
$customer_update = Customer::on('mysql7')
|
||||||
// $customer = Customer::on($cawangan['mysql'])
|
->where('kplama','=',$nokp)
|
||||||
// ->where('kplama','=',$nokp)
|
->orWhere('kpbaru','=',$nokp)
|
||||||
// ->orWhere('kpbaru','=',$nokp)
|
->update(array(
|
||||||
// ->first();
|
'alamat1' => $request->alamat,
|
||||||
// if($customer != null){
|
'alamat2' => '',
|
||||||
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
'poskod' => $request->poskod,
|
||||||
$customer_update = Customer::on('mysql7')
|
'koddaerah' => $poskod['koddaerah'],
|
||||||
->where('kplama','=',$nokp)
|
'kodnegeri' => $poskod['kodnegeri'],
|
||||||
->orWhere('kpbaru','=',$nokp)
|
'telefon' => $request->telefon1,
|
||||||
->update(array(
|
'telefon2' => $request->telefon2
|
||||||
'alamat1' => $request->alamat,
|
));
|
||||||
'alamat2' => '',
|
|
||||||
'poskod' => $request->poskod,
|
|
||||||
'koddaerah' => $poskod['koddaerah'],
|
|
||||||
'kodnegeri' => $poskod['kodnegeri'],
|
|
||||||
'telefon' => $request->telefon1,
|
|
||||||
'telefon2' => $request->telefon2
|
|
||||||
));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return response()->json($customer_update, 200);
|
return response()->json($customer_update, 200);
|
||||||
}
|
}
|
||||||
@@ -412,32 +373,24 @@ class CustomerController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function customerUpdateKhazanah($nokp,Request $request){
|
public function customerUpdateKhazanah($nokp,Request $request){
|
||||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
|
||||||
// foreach($cawangan_all as $index=>$cawangan){
|
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||||
// $customer = Customer::on($cawangan['mysql'])
|
|
||||||
// ->where('kplama','=',$nokp)
|
|
||||||
// ->orWhere('kpbaru','=',$nokp)
|
|
||||||
// ->first();
|
|
||||||
// if($customer != null){
|
|
||||||
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
|
||||||
|
|
||||||
$customer_update = Customer::on('mysql7')
|
$customer_update = Customer::on('mysql7')
|
||||||
->where('kplama','=',$nokp)
|
->where('kplama','=',$nokp)
|
||||||
->orWhere('kpbaru','=',$nokp)
|
->orWhere('kpbaru','=',$nokp)
|
||||||
->update(array(
|
->update(array(
|
||||||
'telefon' => $request->telefon1,
|
'telefon' => $request->telefon1,
|
||||||
'telefon2' => $request->telefon2,
|
'telefon2' => $request->telefon2,
|
||||||
'kodbank' => $request->kodbank,
|
'kodbank' => $request->kodbank,
|
||||||
'noakaun' => $request->noakaun,
|
'noakaun' => $request->noakaun,
|
||||||
'nota' => $request->nota,
|
'nota' => $request->nota,
|
||||||
'nama' => $request->nama,
|
'nama' => $request->nama,
|
||||||
'alamat1' => $request->alamat,
|
'alamat1' => $request->alamat,
|
||||||
'poskod' => $request->poskod,
|
'poskod' => $request->poskod,
|
||||||
'koddaerah' => $poskod['koddaerah'],
|
'koddaerah' => $poskod['koddaerah'],
|
||||||
'kodnegeri' => $poskod['kodnegeri']
|
'kodnegeri' => $poskod['kodnegeri']
|
||||||
));
|
));
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return response()->json($customer_update, 200);
|
return response()->json($customer_update, 200);
|
||||||
}
|
}
|
||||||
@@ -654,21 +607,18 @@ class CustomerController extends Controller
|
|||||||
|
|
||||||
public function insertAkaunBankMobile(Request $request)
|
public function insertAkaunBankMobile(Request $request)
|
||||||
{
|
{
|
||||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
$customer = Customer::on('mysql7')
|
||||||
// foreach($cawangan_all as $index=>$cawangan)
|
->where('kplama','=',$request->nokp)
|
||||||
// {
|
->orWhere('kpbaru','=',$request->nokp)
|
||||||
$customer = Customer::on('mysql7')
|
->first();
|
||||||
->where('kplama','=',$request->nokp)
|
|
||||||
->orWhere('kpbaru','=',$request->nokp)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if(!empty($customer))
|
if(!empty($customer))
|
||||||
{
|
{
|
||||||
$customer->kodbank = $request->kodbank;
|
$customer->kodbank = $request->kodbank;
|
||||||
$customer->noakaun = $request->noakaun;
|
$customer->noakaun = $request->noakaun;
|
||||||
$customer->save();
|
$customer->save();
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
return response()->json($customer, 200);
|
return response()->json($customer, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ use Carbon\Carbon;
|
|||||||
|
|
||||||
class DenominasiController extends Controller
|
class DenominasiController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public function listdenominasi($kodcaw)
|
public function listdenominasi($kodcaw)
|
||||||
{
|
{
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
|
|||||||
@@ -911,13 +911,6 @@ class GadaiController extends Controller
|
|||||||
->orderBy('t_gadai')
|
->orderBy('t_gadai')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
// $tebus = Gadai::on($cawangan['mysql'])
|
|
||||||
// ->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman, SUM(bakiupah) as upahsimpan')
|
|
||||||
// ->where('t_gadai','=',$request->tarikh)
|
|
||||||
// ->where('sttebus','=','T')
|
|
||||||
// ->orderBy('t_gadai')
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
$tebus = Tebus::on($cawangan['mysql'])
|
$tebus = Tebus::on($cawangan['mysql'])
|
||||||
->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman, SUM(bakiupah) as upahsimpan')
|
->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman, SUM(bakiupah) as upahsimpan')
|
||||||
->where('t_tebus','=',$request->tarikh)
|
->where('t_tebus','=',$request->tarikh)
|
||||||
@@ -1884,6 +1877,16 @@ class GadaiController extends Controller
|
|||||||
$bakiakhir = 0;
|
$bakiakhir = 0;
|
||||||
$totalkeluar = 0;
|
$totalkeluar = 0;
|
||||||
|
|
||||||
|
$audit = new Audit();
|
||||||
|
$audit->users = $request->kodlaluan;
|
||||||
|
$audit->actions = 'Hapus Gadai';
|
||||||
|
$audit->norujukan = $norujukan;
|
||||||
|
$audit->old_data = $gadai;
|
||||||
|
$audit->kodcaw = $kodcaw;
|
||||||
|
$audit->created_at = $current;
|
||||||
|
$audit->updated_at = $current;
|
||||||
|
$audit->save();
|
||||||
|
|
||||||
|
|
||||||
if($gadai[0]['historygadaian'] != "0" && $gadai[0]['historygadaian'] != '')
|
if($gadai[0]['historygadaian'] != "0" && $gadai[0]['historygadaian'] != '')
|
||||||
{
|
{
|
||||||
@@ -2009,8 +2012,8 @@ class GadaiController extends Controller
|
|||||||
|
|
||||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||||
Marhun::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
Marhun::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||||
// TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
||||||
// Transaction::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
Transaction::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
||||||
|
|
||||||
return response('Deleted Successfully', 200);
|
return response('Deleted Successfully', 200);
|
||||||
}
|
}
|
||||||
@@ -2026,6 +2029,8 @@ class GadaiController extends Controller
|
|||||||
|
|
||||||
$tebus = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->get();
|
$tebus = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->get();
|
||||||
|
|
||||||
|
$gadai = Gadai::on($cawangan['mysql'])->where('historygadaian',$norujukan)->first();
|
||||||
|
|
||||||
$tunai=Tunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()],['kodlaluan','=',$request->kodlaluan]])
|
$tunai=Tunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()],['kodlaluan','=',$request->kodlaluan]])
|
||||||
->orderBy('tarikh','desc')
|
->orderBy('tarikh','desc')
|
||||||
->first();
|
->first();
|
||||||
@@ -2040,62 +2045,77 @@ class GadaiController extends Controller
|
|||||||
$bakiakhir = $baki;
|
$bakiakhir = $baki;
|
||||||
$totalkeluar = 0;
|
$totalkeluar = 0;
|
||||||
|
|
||||||
if($tebus[0]['tagterima'] == 1)
|
if($gadai){
|
||||||
{
|
return response('Bukan-Tebus', 200);
|
||||||
if($tebus[0]['jenistebus'] == 'T')
|
|
||||||
{
|
|
||||||
$totalmasuk = $masuk - $tebus[0]['bakipjm'];
|
|
||||||
|
|
||||||
// $bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
|
|
||||||
$bakiakhir = $baki - $tebus[0]['bakipjm'];
|
|
||||||
|
|
||||||
$updatetunai=Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
|
||||||
update(array(
|
|
||||||
'keluar' => $keluar,
|
|
||||||
'masuk' => $totalmasuk,
|
|
||||||
'baki' => $bakiakhir
|
|
||||||
));
|
|
||||||
|
|
||||||
|
|
||||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(['sttebus' => '']);
|
|
||||||
|
|
||||||
Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
|
||||||
|
|
||||||
TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
|
||||||
|
|
||||||
Transaction::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
|
||||||
|
|
||||||
return response('Deleted Successfully', 200);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return response('Bukan-Tebus', 200);
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
$audit = new Audit();
|
||||||
|
$audit->users = $request->kodlaluan;
|
||||||
|
$audit->actions = 'Hapus Gadai';
|
||||||
|
$audit->norujukan = $norujukan;
|
||||||
|
$audit->old_data = $gadai;
|
||||||
|
$audit->kodcaw = $kodcaw;
|
||||||
|
$audit->created_at = $current;
|
||||||
|
$audit->updated_at = $current;
|
||||||
|
$audit->save();
|
||||||
|
|
||||||
if($tebus[0]['jenistebus'] == 'T')
|
if($tebus[0]['tagterima'] == 1)
|
||||||
{
|
{
|
||||||
|
if($tebus[0]['jenistebus'] == 'T')
|
||||||
$bakiakhir = $bakiakhir - $tebus[0]['bakipjm'];
|
{
|
||||||
|
$totalmasuk = $masuk - $tebus[0]['bakipjm'];
|
||||||
$updatetunai=Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
|
||||||
update(array(
|
// $bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
|
||||||
'keluar' => $keluar,
|
$bakiakhir = $baki - $tebus[0]['bakipjm'];
|
||||||
'masuk' => $masuk,
|
|
||||||
'baki' => $bakiakhir
|
$updatetunai=Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
||||||
));
|
update(array(
|
||||||
|
'keluar' => $keluar,
|
||||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(['sttebus' => '']);
|
'masuk' => $totalmasuk,
|
||||||
|
'baki' => $bakiakhir
|
||||||
Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
));
|
||||||
|
|
||||||
TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
|
||||||
|
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(['sttebus' => '']);
|
||||||
|
|
||||||
|
Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||||
|
|
||||||
|
TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
||||||
|
|
||||||
|
Transaction::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
||||||
|
|
||||||
Transaction::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
return response('Deleted Successfully', 200);
|
||||||
|
}
|
||||||
return response('Deleted Successfully', 200);
|
else
|
||||||
|
return response('Bukan-Tebus', 200);
|
||||||
|
}else{
|
||||||
|
|
||||||
|
if($tebus[0]['jenistebus'] == 'T')
|
||||||
|
{
|
||||||
|
|
||||||
|
$bakiakhir = $bakiakhir - $tebus[0]['bakipjm'];
|
||||||
|
|
||||||
|
$updatetunai=Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
||||||
|
update(array(
|
||||||
|
'keluar' => $keluar,
|
||||||
|
'masuk' => $masuk,
|
||||||
|
'baki' => $bakiakhir
|
||||||
|
));
|
||||||
|
|
||||||
|
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(['sttebus' => '']);
|
||||||
|
|
||||||
|
Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||||
|
|
||||||
|
TransaksiKeuntungan::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
||||||
|
|
||||||
|
Transaction::on('mysql7')->where('norujukan','=',$norujukan)->orderBy('id', 'desc')->limit(1)->delete();
|
||||||
|
|
||||||
|
return response('Deleted Successfully', 200);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return response('Bukan-Tebus', 200);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
return response('Bukan-Tebus', 200);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function senaraiLelong($kodcaw,Request $request){
|
public function senaraiLelong($kodcaw,Request $request){
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
class GlejerController extends Controller
|
class GlejerController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getGlejer($kodcaw, Request $request)
|
public function getGlejer($kodcaw, Request $request)
|
||||||
{
|
{
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
@@ -27,13 +23,6 @@ class GlejerController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function Getglejer_Data($tarikh1,$tarikh2,$kodcaw)
|
public function Getglejer_Data($tarikh1,$tarikh2,$kodcaw)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -68,122 +57,55 @@ class GlejerController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSemalam_Glejer($kodcaw, Request $request){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getSemalam_Glejer($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$glejer=Glejer::on($cawangan['mysql'])->where('glcode','=',$request->glcode)->orderBy('tarikh','DESC')->limit(1)->get();
|
$glejer=Glejer::on($cawangan['mysql'])->where('glcode','=',$request->glcode)->orderBy('tarikh','DESC')->limit(1)->get();
|
||||||
|
|
||||||
return response()->json($glejer);
|
return response()->json($glejer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Create_Glejer($kodcaw,Request $request){
|
||||||
|
|
||||||
}
|
$current = Carbon::now();
|
||||||
|
$current = new Carbon();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function Create_Glejer($kodcaw,Request $request)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$current = Carbon::now();
|
|
||||||
$current = new Carbon();
|
|
||||||
|
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
$glejer=Glejer::on($cawangan['mysql'])->create([
|
||||||
|
// 'tarikh' => $current->toDateString(),
|
||||||
|
'kodcaw'=> $request->kodcaw,
|
||||||
|
'tarikh'=>$current->toDateString(),
|
||||||
|
'glcode'=>$request->glcode,
|
||||||
|
'descpt'=>$request->descpt,
|
||||||
|
'debit'=>$request->debit,
|
||||||
|
'kredit'=>$request->kredit,
|
||||||
|
'hariini'=>$request->hariini,
|
||||||
|
'kelmarin'=>$request->kelmarin,
|
||||||
|
'jumlah'=>$request->jumlah,
|
||||||
|
'bulanini'=>$request->bulanini,
|
||||||
|
'tahunini'=>$request->tahunini,
|
||||||
|
'acttype'=>$request->acttype
|
||||||
|
]);
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
return response()->json($glejer,201);
|
||||||
$glejer=Glejer::on($cawangan['mysql'])->create([
|
|
||||||
|
|
||||||
// 'tarikh' => $current->toDateString(),
|
|
||||||
'kodcaw'=> $request->kodcaw,
|
|
||||||
'tarikh'=>$current->toDateString(),
|
|
||||||
'glcode'=>$request->glcode,
|
|
||||||
'descpt'=>$request->descpt,
|
|
||||||
'debit'=>$request->debit,
|
|
||||||
'kredit'=>$request->kredit,
|
|
||||||
'hariini'=>$request->hariini,
|
|
||||||
'kelmarin'=>$request->kelmarin,
|
|
||||||
'jumlah'=>$request->jumlah,
|
|
||||||
'bulanini'=>$request->bulanini,
|
|
||||||
'tahunini'=>$request->tahunini,
|
|
||||||
'acttype'=>$request->acttype
|
|
||||||
|
|
||||||
]);
|
|
||||||
|
|
||||||
return response()->json($glejer,201);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function carianBulananTahun_glejer($kodcaw,Request $request)
|
public function carianBulananTahun_glejer($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$yr = Carbon::now()->format('Y');
|
$yr = Carbon::now()->format('Y');
|
||||||
$month= Carbon::now()->format('m');
|
$month= Carbon::now()->format('m');
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
$glejerMy=Glejer::on ($cawangan['mysql'])->whereYear('tarikh','=',$yr)->whereMonth('tarikh', '=',$month)->where('glcode', '=',$request->glcode)->
|
$glejerMy=Glejer::on ($cawangan['mysql'])->whereYear('tarikh','=',$yr)->whereMonth('tarikh', '=',$month)->where('glcode', '=',$request->glcode)->
|
||||||
orderBy('tarikh','ASC')->get();
|
orderBy('tarikh','ASC')->get();
|
||||||
return response()->json($glejerMy);
|
return response()->json($glejerMy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*public function updateRequestTeller($kodcaw,Request $request)
|
|
||||||
{
|
|
||||||
$requestteller = RequestTeller::on('mysql7')->
|
|
||||||
where([['no','=',$request->no],['kodcaw','=',$kodcaw],['kodlaluan','=',$request->kodlaluan],['update','=',0]])
|
|
||||||
->update(array(
|
|
||||||
|
|
||||||
'update' => 1
|
|
||||||
|
|
||||||
) );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function Kemaskini_Glejer($kodcaw, Request $request)
|
public function Kemaskini_Glejer($kodcaw, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -199,30 +121,21 @@ class GlejerController extends Controller
|
|||||||
'hariini'=>$request->hariini,
|
'hariini'=>$request->hariini,
|
||||||
'kelmarin'=>$request->kelmarin
|
'kelmarin'=>$request->kelmarin
|
||||||
|
|
||||||
) );
|
));
|
||||||
|
|
||||||
return response()->json($updateGLejer,200);
|
return response()->json($updateGLejer,200);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function carianTahun_glejer($kodcaw,Request $request)
|
public function carianTahun_glejer($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$yr = Carbon::now()->format('Y');
|
$yr = Carbon::now()->format('Y');
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$db=$cawangan['mysql'];
|
$db=$cawangan['mysql'];
|
||||||
|
|
||||||
$gelejerYear=Glejer::on($cawangan['mysql'])->whereYear('tarikh','=',$yr)->where('glcode', '=',$request->glcode)->
|
$gelejerYear=Glejer::on($cawangan['mysql'])->whereYear('tarikh','=',$yr)->where('glcode', '=',$request->glcode)->
|
||||||
orderBy('tarikh','ASC')->get();
|
orderBy('tarikh','ASC')->get();
|
||||||
return response()->json($gelejerYear);
|
return response()->json($gelejerYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,23 +10,12 @@ use Illuminate\Http\Request;
|
|||||||
|
|
||||||
class ImbangDugaLamaController extends Controller
|
class ImbangDugaLamaController extends Controller
|
||||||
{
|
{
|
||||||
|
public function GetImbangDuga_Lama($kodcaw)
|
||||||
|
{
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
|
$getImbangDugaLama=imbangdugalama::on($cawangan['mysql'])->get();
|
||||||
|
|
||||||
|
return response()->json($getImbangDugaLama);
|
||||||
|
}
|
||||||
public function GetImbangDuga_Lama($kodcaw)
|
|
||||||
{
|
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
|
||||||
|
|
||||||
$getImbangDugaLama=imbangdugalama::on($cawangan['mysql'])->get();
|
|
||||||
|
|
||||||
return response()->json($getImbangDugaLama);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -258,11 +258,6 @@ class LaporanController extends Controller
|
|||||||
|
|
||||||
/* Kawalan Stok */
|
/* Kawalan Stok */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//f
|
//f
|
||||||
$data_lelong = Lelong::on($cawangan['mysql'])->where('t_jual','=',$request->tarikh)->get();
|
$data_lelong = Lelong::on($cawangan['mysql'])->where('t_jual','=',$request->tarikh)->get();
|
||||||
$bilangan_lelong = Lelong::on($cawangan['mysql'])->where('t_jual','=',$request->tarikh)->count();
|
$bilangan_lelong = Lelong::on($cawangan['mysql'])->where('t_jual','=',$request->tarikh)->count();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||||||
use App\Panjar;
|
use App\Panjar;
|
||||||
use App\Cawangan;
|
use App\Cawangan;
|
||||||
use App\DenoPanjar;
|
use App\DenoPanjar;
|
||||||
|
use App\Audit;
|
||||||
|
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
@@ -75,8 +76,6 @@ class PanjarController extends Controller
|
|||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$kelulusan=Panjar::on($cawangan['mysql'])
|
$kelulusan=Panjar::on($cawangan['mysql'])
|
||||||
->where('tarikh','=',$harini->toDateString())
|
->where('tarikh','=',$harini->toDateString())
|
||||||
->where('norujukan','=',$norujukan)
|
->where('norujukan','=',$norujukan)
|
||||||
@@ -110,16 +109,38 @@ class PanjarController extends Controller
|
|||||||
'tuntutoleh' => $request->tuntutoleh
|
'tuntutoleh' => $request->tuntutoleh
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
$audit = new Audit();
|
||||||
|
$audit->users = $request->tuntutoleh;
|
||||||
|
$audit->actions = "Daftar Perbelanjaan";
|
||||||
|
$audit->new_data = $panjar;
|
||||||
|
$audit->kodcaw = $kodcaw;
|
||||||
|
$audit->created_at = $harini;
|
||||||
|
$audit->updated_at = $harini;
|
||||||
|
$audit->save();
|
||||||
|
|
||||||
return response()->json($panjar);
|
return response()->json($panjar);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(REQUEST $request,$kodcaw)
|
public function delete(REQUEST $request,$kodcaw)
|
||||||
{
|
{
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$harini = Carbon::now();
|
||||||
|
$harini = new Carbon;
|
||||||
Panjar::on($cawangan['mysql'])->where('recno','=',$request->recno)->delete();
|
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
return response('Batal Berjaya', 200);
|
$panjar = Panjar::on($cawangan['mysql'])->where('recno','=',$request->recno)->first();
|
||||||
|
Panjar::on($cawangan['mysql'])->where('recno','=',$request->recno)->delete();
|
||||||
|
|
||||||
|
$audit = new Audit();
|
||||||
|
$audit->users = $request->users;
|
||||||
|
$audit->actions = "Hapus Perbelanjaan";
|
||||||
|
$audit->old_data = $panjar;
|
||||||
|
$audit->kodcaw = $kodcaw;
|
||||||
|
$audit->created_at = $harini;
|
||||||
|
$audit->updated_at = $harini;
|
||||||
|
$audit->save();
|
||||||
|
|
||||||
|
return response('Batal Berjaya', 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calculationpanjar(Request $request,$kodcaw)
|
public function calculationpanjar(Request $request,$kodcaw)
|
||||||
|
|||||||
@@ -13,16 +13,11 @@ use Illuminate\Http\Request;
|
|||||||
class PendahuluanSerahanController extends Controller
|
class PendahuluanSerahanController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function createDenoPendSer($kodcaw,Request $request)
|
public function createDenoPendSer($kodcaw,Request $request){
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
|
$denopendser = DenoPendSer::on('mysql7')->create([
|
||||||
$denopendser = DenoPendSer::on('mysql7')->create([
|
|
||||||
|
|
||||||
'tarikh' => $current->toDateString(),
|
'tarikh' => $current->toDateString(),
|
||||||
'masa' => $current->toTimeString(),
|
'masa' => $current->toTimeString(),
|
||||||
'kodcaw' => $kodcaw,
|
'kodcaw' => $kodcaw,
|
||||||
@@ -54,9 +49,7 @@ class PendahuluanSerahanController extends Controller
|
|||||||
return response()->json($denopendser,200);
|
return response()->json($denopendser,200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDenoPendSer($kodcaw,Request $request)
|
public function getDenoPendSer($kodcaw,Request $request){
|
||||||
{
|
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
@@ -66,9 +59,7 @@ class PendahuluanSerahanController extends Controller
|
|||||||
return response()->json($denopendser,200);
|
return response()->json($denopendser,200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateDenoPendSer($kodcaw,Request $request)
|
public function updateDenoPendSer($kodcaw,Request $request){
|
||||||
{
|
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
@@ -81,16 +72,13 @@ class PendahuluanSerahanController extends Controller
|
|||||||
));
|
));
|
||||||
|
|
||||||
return response()->json($denopendser,200);
|
return response()->json($denopendser,200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(REQUEST $request,$kodcaw)
|
public function delete(REQUEST $request,$kodcaw){
|
||||||
{
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
|
||||||
|
|
||||||
GlDetail::on($cawangan['mysql'])->where('recno','=',$request->recno)->delete();
|
|
||||||
|
|
||||||
return response('Batal Berjaya', 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
GlDetail::on($cawangan['mysql'])->where('recno','=',$request->recno)->delete();
|
||||||
|
|
||||||
|
return response('Batal Berjaya', 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ class TacExpressPaymentController extends Controller
|
|||||||
'expired_at' => $expired_at
|
'expired_at' => $expired_at
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// $mobileno = '6'.$request->mobileno;
|
$mobileno = '6'.$request->mobileno;
|
||||||
$mobileno = '60189025461';
|
// $mobileno = '60189025461';
|
||||||
$messages = 'SPARE : SMS-OTP '. $request->otp_token . ' for one time usage on ' . $expired_at . '. Call AR-RAHN CARELINE CENTRE 1300-22-4343 if not request';
|
$messages = 'SPARE : SMS-OTP '. $request->otp_token . ' for one time usage on ' . $expired_at . '. Call AR-RAHN CARELINE CENTRE 1300-22-4343 if not request';
|
||||||
|
|
||||||
$status = Http::get('http://gateway.onewaysms.com.au:10001/api.aspx',[
|
$status = Http::get('http://gateway.onewaysms.com.au:10001/api.aspx',[
|
||||||
|
|||||||
@@ -1425,10 +1425,23 @@ class TebusController extends Controller
|
|||||||
|
|
||||||
public function removeUpahLamaToday($kodcaw,$norujukan)
|
public function removeUpahLamaToday($kodcaw,$norujukan)
|
||||||
{
|
{
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$current = Carbon::now();
|
||||||
|
$current = new Carbon();
|
||||||
|
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
$data_ansuran = Advansur::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->first();
|
||||||
$removed = Advansur::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
$removed = Advansur::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||||
|
|
||||||
|
$audit = new Audit();
|
||||||
|
$audit->users = $request->teller;
|
||||||
|
$audit->actions = "Hapus Upah";
|
||||||
|
$audit->norujukan = $norujukan;
|
||||||
|
$audit->old_data = $data_ansuran;
|
||||||
|
$audit->kodcaw = $kodcaw;
|
||||||
|
$audit->created_at = $current;
|
||||||
|
$audit->updated_at = $current;
|
||||||
|
$audit->save();
|
||||||
|
|
||||||
if($removed)
|
if($removed)
|
||||||
return response(1);
|
return response(1);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -13,14 +13,8 @@ use Carbon\Carbon;
|
|||||||
|
|
||||||
class TunaiGadTebController extends Controller
|
class TunaiGadTebController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getCurrentTunaiGadTeb($kodcaw,Request $request)
|
public function getCurrentTunaiGadTeb($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
@@ -31,18 +25,10 @@ class TunaiGadTebController extends Controller
|
|||||||
->orderBy('tarikh','desc')
|
->orderBy('tarikh','desc')
|
||||||
->first();
|
->first();
|
||||||
return response()->json($tunaiGadteb);
|
return response()->json($tunaiGadteb);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function UpdateTunaiGadTeb($kodcaw, Request $request)
|
public function UpdateTunaiGadTeb($kodcaw, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
@@ -56,26 +42,10 @@ class TunaiGadTebController extends Controller
|
|||||||
));
|
));
|
||||||
|
|
||||||
return response()->json($updatetunaiGD, 200);
|
return response()->json($updatetunaiGD, 200);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function createTunaiGadTeb($kodcaw, Request $request)
|
public function createTunaiGadTeb($kodcaw, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
@@ -94,14 +64,6 @@ class TunaiGadTebController extends Controller
|
|||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return response()->json($tunaigadteb,201);
|
return response()->json($tunaigadteb,201);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user