update
This commit is contained in:
@@ -17,66 +17,38 @@ use Carbon\Carbon;
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
|
||||
public function showAllCustomers()
|
||||
{
|
||||
// $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);
|
||||
// }
|
||||
// }
|
||||
public function showAllCustomers(){
|
||||
$customer = Customer::on('mysql7')->get();
|
||||
return response()->json($customer);
|
||||
}
|
||||
|
||||
public function getLatestCustomer($kodcaw){
|
||||
// $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$customer = Customer::on('mysql7')->orderBy('tarikhdaftar','desc')->orderBy('nosiri','desc')->first();
|
||||
|
||||
return response()->json($customer);
|
||||
}
|
||||
|
||||
public function showAllCustomersByCawangan($kodcaw)
|
||||
{
|
||||
// $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
public function showAllCustomersByCawangan($kodcaw){
|
||||
$customer = Customer::on('mysql7')->get();
|
||||
|
||||
return response()->json($customer);
|
||||
}
|
||||
|
||||
public function showOneCustomerByIC($ic){
|
||||
|
||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
||||
// $customer_all = [];
|
||||
// foreach($cawangan_all as $index=>$cawangan){
|
||||
$customer = Customer::on('mysql7')
|
||||
->where('kplama','=',$ic)
|
||||
->orWhere('kpbaru','=',$ic)
|
||||
->first();
|
||||
// if($customer != null){
|
||||
// array_push($customer_all,$customer);
|
||||
// }
|
||||
// }
|
||||
$customer = Customer::on('mysql7')
|
||||
->where('kplama','=',$ic)
|
||||
->orWhere('kpbaru','=',$ic)
|
||||
->first();
|
||||
|
||||
return response()->json($customer);
|
||||
}
|
||||
|
||||
public function showOneCustomerByICAdmin(Request $request){
|
||||
|
||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
||||
// $customer_all = [];
|
||||
// foreach($cawangan_all as $index=>$cawangan){
|
||||
$customer = Customer::on('mysql7')
|
||||
->where('kplama','=',$request->ic)
|
||||
->orWhere('kpbaru','=',$request->ic)
|
||||
->first();
|
||||
// if($customer != null){
|
||||
// array_push($customer_all,$customer);
|
||||
// }
|
||||
// }
|
||||
|
||||
$customer = Customer::on('mysql7')
|
||||
->where('kplama','=',$request->ic)
|
||||
->orWhere('kpbaru','=',$request->ic)
|
||||
->first();
|
||||
|
||||
return response()->json($customer);
|
||||
}
|
||||
@@ -315,8 +287,6 @@ class CustomerController extends Controller
|
||||
|
||||
public function getLaporanCustomers($kodcaw, $tarikh)
|
||||
{
|
||||
// $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadai = Customer::on('mysql7')
|
||||
->where([['tarikhdaftar','=',$tarikh],['kodcaw',$kodcaw]])
|
||||
->orderBy('tarikhdaftar', 'desc')
|
||||
@@ -364,28 +334,19 @@ class CustomerController extends Controller
|
||||
}
|
||||
|
||||
public function customerUpdate($nokp,Request $request){
|
||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
||||
// foreach($cawangan_all as $index=>$cawangan){
|
||||
// $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')
|
||||
->where('kplama','=',$nokp)
|
||||
->orWhere('kpbaru','=',$nokp)
|
||||
->update(array(
|
||||
'alamat1' => $request->alamat,
|
||||
'alamat2' => '',
|
||||
'poskod' => $request->poskod,
|
||||
'koddaerah' => $poskod['koddaerah'],
|
||||
'kodnegeri' => $poskod['kodnegeri'],
|
||||
'telefon' => $request->telefon1,
|
||||
'telefon2' => $request->telefon2
|
||||
));
|
||||
// }
|
||||
// }
|
||||
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||
$customer_update = Customer::on('mysql7')
|
||||
->where('kplama','=',$nokp)
|
||||
->orWhere('kpbaru','=',$nokp)
|
||||
->update(array(
|
||||
'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);
|
||||
}
|
||||
@@ -412,32 +373,24 @@ class CustomerController extends Controller
|
||||
}
|
||||
|
||||
public function customerUpdateKhazanah($nokp,Request $request){
|
||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
||||
// foreach($cawangan_all as $index=>$cawangan){
|
||||
// $customer = Customer::on($cawangan['mysql'])
|
||||
// ->where('kplama','=',$nokp)
|
||||
// ->orWhere('kpbaru','=',$nokp)
|
||||
// ->first();
|
||||
// if($customer != null){
|
||||
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||
|
||||
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||
|
||||
$customer_update = Customer::on('mysql7')
|
||||
->where('kplama','=',$nokp)
|
||||
->orWhere('kpbaru','=',$nokp)
|
||||
->update(array(
|
||||
'telefon' => $request->telefon1,
|
||||
'telefon2' => $request->telefon2,
|
||||
'kodbank' => $request->kodbank,
|
||||
'noakaun' => $request->noakaun,
|
||||
'nota' => $request->nota,
|
||||
'nama' => $request->nama,
|
||||
'alamat1' => $request->alamat,
|
||||
'poskod' => $request->poskod,
|
||||
'koddaerah' => $poskod['koddaerah'],
|
||||
'kodnegeri' => $poskod['kodnegeri']
|
||||
));
|
||||
// }
|
||||
// }
|
||||
$customer_update = Customer::on('mysql7')
|
||||
->where('kplama','=',$nokp)
|
||||
->orWhere('kpbaru','=',$nokp)
|
||||
->update(array(
|
||||
'telefon' => $request->telefon1,
|
||||
'telefon2' => $request->telefon2,
|
||||
'kodbank' => $request->kodbank,
|
||||
'noakaun' => $request->noakaun,
|
||||
'nota' => $request->nota,
|
||||
'nama' => $request->nama,
|
||||
'alamat1' => $request->alamat,
|
||||
'poskod' => $request->poskod,
|
||||
'koddaerah' => $poskod['koddaerah'],
|
||||
'kodnegeri' => $poskod['kodnegeri']
|
||||
));
|
||||
|
||||
return response()->json($customer_update, 200);
|
||||
}
|
||||
@@ -654,21 +607,18 @@ class CustomerController extends Controller
|
||||
|
||||
public function insertAkaunBankMobile(Request $request)
|
||||
{
|
||||
// $cawangan_all = Cawangan::on('mysql7')->get();
|
||||
// foreach($cawangan_all as $index=>$cawangan)
|
||||
// {
|
||||
$customer = Customer::on('mysql7')
|
||||
->where('kplama','=',$request->nokp)
|
||||
->orWhere('kpbaru','=',$request->nokp)
|
||||
->first();
|
||||
$customer = Customer::on('mysql7')
|
||||
->where('kplama','=',$request->nokp)
|
||||
->orWhere('kpbaru','=',$request->nokp)
|
||||
->first();
|
||||
|
||||
if(!empty($customer))
|
||||
{
|
||||
$customer->kodbank = $request->kodbank;
|
||||
$customer->noakaun = $request->noakaun;
|
||||
$customer->save();
|
||||
}
|
||||
// }
|
||||
if(!empty($customer))
|
||||
{
|
||||
$customer->kodbank = $request->kodbank;
|
||||
$customer->noakaun = $request->noakaun;
|
||||
$customer->save();
|
||||
}
|
||||
|
||||
return response()->json($customer, 200);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ use Carbon\Carbon;
|
||||
|
||||
class DenominasiController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function listdenominasi($kodcaw)
|
||||
{
|
||||
$current = Carbon::now();
|
||||
|
||||
@@ -911,13 +911,6 @@ class GadaiController extends Controller
|
||||
->orderBy('t_gadai')
|
||||
->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'])
|
||||
->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman, SUM(bakiupah) as upahsimpan')
|
||||
->where('t_tebus','=',$request->tarikh)
|
||||
@@ -1884,6 +1877,16 @@ class GadaiController extends Controller
|
||||
$bakiakhir = 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'] != '')
|
||||
{
|
||||
@@ -2009,8 +2012,8 @@ class GadaiController extends Controller
|
||||
|
||||
Gadai::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();
|
||||
// Transaction::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();
|
||||
|
||||
return response('Deleted Successfully', 200);
|
||||
}
|
||||
@@ -2026,6 +2029,8 @@ class GadaiController extends Controller
|
||||
|
||||
$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]])
|
||||
->orderBy('tarikh','desc')
|
||||
->first();
|
||||
@@ -2040,62 +2045,77 @@ class GadaiController extends Controller
|
||||
$bakiakhir = $baki;
|
||||
$totalkeluar = 0;
|
||||
|
||||
if($tebus[0]['tagterima'] == 1)
|
||||
{
|
||||
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);
|
||||
if($gadai){
|
||||
return response('Bukan-Tebus', 200);
|
||||
}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)
|
||||
{
|
||||
|
||||
$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();
|
||||
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();
|
||||
|
||||
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){
|
||||
|
||||
@@ -12,10 +12,6 @@ use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
class GlejerController extends Controller
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
public function getGlejer($kodcaw, Request $request)
|
||||
{
|
||||
$current = Carbon::now();
|
||||
@@ -27,13 +23,6 @@ class GlejerController extends Controller
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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();
|
||||
$glejer=Glejer::on($cawangan['mysql'])->where('glcode','=',$request->glcode)->orderBy('tarikh','DESC')->limit(1)->get();
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$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){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function Create_Glejer($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$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();
|
||||
$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);
|
||||
return response()->json($glejer,201);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function carianBulananTahun_glejer($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$yr = Carbon::now()->format('Y');
|
||||
$month= Carbon::now()->format('m');
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$glejerMy=Glejer::on ($cawangan['mysql'])->whereYear('tarikh','=',$yr)->whereMonth('tarikh', '=',$month)->where('glcode', '=',$request->glcode)->
|
||||
orderBy('tarikh','ASC')->get();
|
||||
return response()->json($glejerMy);
|
||||
|
||||
$glejerMy=Glejer::on ($cawangan['mysql'])->whereYear('tarikh','=',$yr)->whereMonth('tarikh', '=',$month)->where('glcode', '=',$request->glcode)->
|
||||
orderBy('tarikh','ASC')->get();
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -199,30 +121,21 @@ class GlejerController extends Controller
|
||||
'hariini'=>$request->hariini,
|
||||
'kelmarin'=>$request->kelmarin
|
||||
|
||||
) );
|
||||
));
|
||||
|
||||
return response()->json($updateGLejer,200);
|
||||
|
||||
|
||||
return response()->json($updateGLejer,200);
|
||||
}
|
||||
|
||||
public function carianTahun_glejer($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$yr = Carbon::now()->format('Y');
|
||||
$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)->
|
||||
orderBy('tarikh','ASC')->get();
|
||||
return response()->json($gelejerYear);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,23 +10,12 @@ use Illuminate\Http\Request;
|
||||
|
||||
class ImbangDugaLamaController extends Controller
|
||||
{
|
||||
public function GetImbangDuga_Lama($kodcaw)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$getImbangDugaLama=imbangdugalama::on($cawangan['mysql'])->get();
|
||||
|
||||
|
||||
|
||||
public function GetImbangDuga_Lama($kodcaw)
|
||||
{
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$getImbangDugaLama=imbangdugalama::on($cawangan['mysql'])->get();
|
||||
|
||||
return response()->json($getImbangDugaLama);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return response()->json($getImbangDugaLama);
|
||||
}
|
||||
}
|
||||
@@ -258,11 +258,6 @@ class LaporanController extends Controller
|
||||
|
||||
/* Kawalan Stok */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//f
|
||||
$data_lelong = Lelong::on($cawangan['mysql'])->where('t_jual','=',$request->tarikh)->get();
|
||||
$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\Cawangan;
|
||||
use App\DenoPanjar;
|
||||
use App\Audit;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
@@ -75,8 +76,6 @@ class PanjarController extends Controller
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
|
||||
|
||||
$kelulusan=Panjar::on($cawangan['mysql'])
|
||||
->where('tarikh','=',$harini->toDateString())
|
||||
->where('norujukan','=',$norujukan)
|
||||
@@ -110,16 +109,38 @@ class PanjarController extends Controller
|
||||
'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);
|
||||
}
|
||||
|
||||
public function delete(REQUEST $request,$kodcaw)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
Panjar::on($cawangan['mysql'])->where('recno','=',$request->recno)->delete();
|
||||
|
||||
return response('Batal Berjaya', 200);
|
||||
$harini = Carbon::now();
|
||||
$harini = new Carbon;
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$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)
|
||||
|
||||
@@ -13,16 +13,11 @@ use Illuminate\Http\Request;
|
||||
class PendahuluanSerahanController extends Controller
|
||||
{
|
||||
|
||||
public function createDenoPendSer($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
|
||||
public function createDenoPendSer($kodcaw,Request $request){
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
|
||||
$denopendser = DenoPendSer::on('mysql7')->create([
|
||||
|
||||
$denopendser = DenoPendSer::on('mysql7')->create([
|
||||
'tarikh' => $current->toDateString(),
|
||||
'masa' => $current->toTimeString(),
|
||||
'kodcaw' => $kodcaw,
|
||||
@@ -54,9 +49,7 @@ class PendahuluanSerahanController extends Controller
|
||||
return response()->json($denopendser,200);
|
||||
}
|
||||
|
||||
public function getDenoPendSer($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
public function getDenoPendSer($kodcaw,Request $request){
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
@@ -66,9 +59,7 @@ class PendahuluanSerahanController extends Controller
|
||||
return response()->json($denopendser,200);
|
||||
}
|
||||
|
||||
public function updateDenoPendSer($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
public function updateDenoPendSer($kodcaw,Request $request){
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
@@ -81,16 +72,13 @@ class PendahuluanSerahanController extends Controller
|
||||
));
|
||||
|
||||
return response()->json($denopendser,200);
|
||||
}
|
||||
}
|
||||
|
||||
public function delete(REQUEST $request,$kodcaw)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
GlDetail::on($cawangan['mysql'])->where('recno','=',$request->recno)->delete();
|
||||
|
||||
return response('Batal Berjaya', 200);
|
||||
}
|
||||
public function delete(REQUEST $request,$kodcaw){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
|
||||
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
|
||||
]);
|
||||
|
||||
// $mobileno = '6'.$request->mobileno;
|
||||
$mobileno = '60189025461';
|
||||
$mobileno = '6'.$request->mobileno;
|
||||
// $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';
|
||||
|
||||
$status = Http::get('http://gateway.onewaysms.com.au:10001/api.aspx',[
|
||||
|
||||
@@ -1425,10 +1425,23 @@ class TebusController extends Controller
|
||||
|
||||
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();
|
||||
|
||||
$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)
|
||||
return response(1);
|
||||
else
|
||||
|
||||
@@ -13,14 +13,8 @@ use Carbon\Carbon;
|
||||
|
||||
class TunaiGadTebController extends Controller
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getCurrentTunaiGadTeb($kodcaw,Request $request)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
@@ -31,18 +25,10 @@ class TunaiGadTebController extends Controller
|
||||
->orderBy('tarikh','desc')
|
||||
->first();
|
||||
return response()->json($tunaiGadteb);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function UpdateTunaiGadTeb($kodcaw, Request $request)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
@@ -56,26 +42,10 @@ class TunaiGadTebController extends Controller
|
||||
));
|
||||
|
||||
return response()->json($updatetunaiGD, 200);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function createTunaiGadTeb($kodcaw, Request $request)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
@@ -94,14 +64,6 @@ class TunaiGadTebController extends Controller
|
||||
|
||||
]);
|
||||
|
||||
|
||||
|
||||
return response()->json($tunaigadteb,201);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user