Beispiel #1
0
 protected function getSumbangan($bulan_tahun)
 {
     $tarikh = explode('-', $bulan_tahun);
     $tarikh = $tarikh[1] . '-' . $tarikh[0];
     $sumbangan = Yurantambahan::where('created_at', 'like', $tarikh . '%')->sum('jumlah');
     return $sumbangan;
 }
Beispiel #2
0
 public function noAnggota()
 {
     $profiles = Profile::where('no_gaji', Request::get('no_gaji'))->get();
     if ($profiles->isEmpty()) {
         Session::flash('error', 'Gagal. No Gaji * ' . Request::get('no_gaji') . ' * tidak berdaftar sebagai ahli KOMADA.');
         return Redirect::route('members.index');
     }
     $yurans = Yuran::where('no_gaji', Request::get('no_gaji'))->where('bulan_tahun', 'like', '%' . Carbon::now()->format('Y'))->orderBy('bulan_tahun', 'asc')->get();
     $yuranTambahan = [];
     for ($i = 1; $i <= 12; $i++) {
         if ($i < 10) {
             $bulan = '0' . $i;
         } else {
             $bulan = $i;
         }
         $yuranTambahans = Yurantambahan::where('created_at', 'like', Carbon::now()->format('Y') . '-' . $bulan . '%')->orderBy('created_at', 'asc')->get();
         if ($yuranTambahans->isEmpty()) {
             $yuranTambahan = 0.0;
         } else {
             foreach ($yuranTambahans as $tambahan) {
                 array_push($yuranTambahan, ['bulan' => $bulan, 'no_gaji' => $tambahan->no_gaji, 'nama' => $tambahan->profileName($tambahan->no_gaji), 'catatan' => $tambahan->sumbangan->nama, 'penerima' => $tambahan->penerima, 'tarikh' => $tambahan->tarikh, 'jumlah' => $tambahan->jumlah]);
             }
         }
         if ($i == Carbon::now()->format('m')) {
             $i = 13;
         }
     }
     $bil = 1;
     $biasas = AkaunPotongan::where('no_gaji', Request::get('no_gaji'))->get();
     return View('members.profile', compact('bil', 'profiles', 'yurans', 'yuranTambahan', 'biasas'));
 }
Beispiel #3
0
 public function yuranTambahan()
 {
     $tarikh = explode('-', Request::get('bulan_tahun'));
     $created_at = $tarikh[1] . '-' . $tarikh[0] . '-' . Carbon::now()->format('d') . ' 00:00:00';
     Yurantambahan::create(['jumlah' => Request::get('jumlah'), 'sumbangan_id' => Request::get('sumbangan_id'), 'no_gaji' => Request::get('no_gaji'), 'tarikh' => Request::get('tarikh'), 'penerima' => strtoupper(Request::get('penerima')), 'created_at' => $created_at]);
     $profile = Profile::where('no_gaji', Request::get('no_gaji'))->first();
     $profile->status = 0;
     $profile->save();
     $accounts = AkaunPotongan::where('no_gaji', Request::get('no_gaji'))->get();
     if (!$accounts->isEmpty()) {
         foreach ($accounts as $account) {
             $account->status = 0;
             $account->save();
         }
     }
     Session::flash('success', 'Berjaya. Yuran Tambahan berjaya didaftarkan dan Anggota telah di nyah-aktifkan.');
     return redirect()->route('members.yuran.index');
 }