Ejemplo n.º 1
0
 public function lapGajiIndividu($zon, $bulan, $tahun)
 {
     $bulan_tahun = $bulan . '-' . $tahun;
     $bahagian = Zon::where('kod', $zon)->first();
     $profiles = Profile::where('zon_gaji_id', $zon)->where('status', 1)->get();
     $persons = [];
     $jumlahBesar = 0.0;
     foreach ($profiles as $profile) {
         // yuran, tka, takaful
         $yuran = $this->getYuran($profile->no_gaji, $bulan_tahun);
         if ($yuran == null) {
             Session::flash('error', 'Gagal. Laporan tidak dapat dijana. Yuran bagi ' . $bulan_tahun . ' belum diproses.');
             return Redirect::back();
         }
         // sumbangan kematian
         $sumbangan = number_format($this->getSumbangan($bulan_tahun), 2);
         // Pinjaman. WT, Kecemasan, Buku Sekolah, Roadtax, Tayar Bateri, Insurans
         $pwt = $this->getPinjaman($profile->no_gaji, $bulan_tahun, 1);
         $bs = $this->getPinjaman($profile->no_gaji, $bulan_tahun, 2);
         $rt = $this->getPinjaman($profile->no_gaji, $bulan_tahun, 3);
         $ins = $this->getPinjaman($profile->no_gaji, $bulan_tahun, 4);
         $tb = $this->getPinjaman($profile->no_gaji, $bulan_tahun, 5);
         $kc = $this->getPinjaman($profile->no_gaji, $bulan_tahun, 6);
         $jumlah = $yuran->yuran + $yuran->tka + $yuran->takaful + $sumbangan + $pwt['jumlah'] + $pwt['cp'] + $pwt['ins'] + $kc['jumlah'] + $kc['cp'] + $kc['ins'] + $bs['jumlah'] + $rt['jumlah'] + $tb['jumlah'] + $tb['cp'] + $ins['jumlah'] + $profile->jumlah_pertaruhan;
         array_push($persons, ['no_gaji' => $profile->no_gaji, 'nama' => $profile->nama, 'yuran' => number_format($yuran->yuran, 2), 'tka' => number_format($yuran->tka, 2), 'pertaruhan' => number_format($profile->jumlah_pertaruhan, 2), 'takaful' => number_format($yuran->takaful, 2), 'sumbangan' => number_format($sumbangan, 2), 'pwt' => number_format($pwt['jumlah'], 2), 'pwtCP' => number_format($pwt['cp'], 2), 'pwtIns' => number_format($pwt['ins'], 2), 'kecemasan' => number_format($kc['jumlah'], 2), 'kecemasanCP' => number_format($kc['cp'], 2), 'kecemasanIns' => number_format($kc['ins'], 2), 'bs' => number_format($bs['jumlah'], 2), 'rt' => number_format($rt['jumlah'], 2), 'tb' => number_format($tb['jumlah'], 2), 'tbCP' => number_format($tb['jumlah'], 2), 'ins' => number_format($ins['jumlah'], 2), 'jumlah' => number_format($jumlah, 2)]);
         $jumlahBesar += $jumlah;
     }
     $bil = 1;
     return View('members.laporan.cetak.lapGajiIndividu', compact('bil', 'bahagian', 'persons', 'jumlahBesar', 'bulan', 'tahun'));
 }
Ejemplo n.º 2
0
 public function lapPotonganGajiGenerate()
 {
     $month = Request::get('bulan');
     $year = Request::get('tahun');
     //        $tarikh = $year . '-' . $month . '-' . '01 00:00:00';
     if ($month < 10) {
         $month = '0' . $month;
     }
     $yuran = Yuran::where('bulan_tahun', 'like', $month . '-' . $year . '%')->first();
     $tarikh = $yuran->created_at;
     // dd($tarikh);
     $perkara = array();
     $zones = Zon::all();
     foreach ($zones as $zone) {
         // 1 - Yuran, pertaruhan, tka, takaful
         $perkara[$zone->kod]['yuran'] = 0.0;
         $perkara[$zone->kod]['per'] = 0.0;
         $perkara[$zone->kod]['tka'] = 0.0;
         $perkara[$zone->kod]['takaful'] = 0.0;
         $fees = Yuran::where('bulan_tahun', $month . '-' . $year)->get();
         // dd($fees);
         if ($fees->isEmpty()) {
             Session::flash('error', 'Gagal. Laporan tidak dapat dijana. Yuran Bulan ini belum diproses.');
             return Redirect::back();
         }
         $profiles = Profile::where('zon_gaji_id', (int) $zone->kod)->get();
         // Check profiles in the table. If null means no one in the table.
         if ($profiles->isEmpty()) {
             Session::flash('error', 'Gagal. Tiada maklumat profile ahli KOMADA. Sila hubungi Programmer');
             return Redirect::back();
         }
         foreach ($profiles as $profile) {
             $fee = Yuran::where('no_gaji', $profile->no_gaji)->where('bulan_tahun', $month . '-' . $year)->first();
             if ($fee == null) {
                 $perkara[$zone->kod]['yuran'] += 0.0;
                 $perkara[$zone->kod]['per'] += 0.0;
                 $perkara[$zone->kod]['tka'] += 0.0;
                 $perkara[$zone->kod]['takaful'] += 0.0;
             } else {
                 $perkara[$zone->kod]['yuran'] += $fee->yuran;
                 $perkara[$zone->kod]['per'] += $fee->pertaruhan;
                 $perkara[$zone->kod]['tka'] += $fee->tka;
                 $perkara[$zone->kod]['takaful'] += $fee->takaful;
             }
         }
         // 2 - Yuran Tambahan
         $perkara[$zone->kod]['sumbangan'] = 0.0;
         $sumbangans = Yurantambahan::where('created_at', '<=', $tarikh)->get();
         if (!$sumbangans->isEmpty()) {
             foreach ($sumbangans as $sumbangan) {
                 $profiles = Profile::where('zon_gaji_id', $zone->kod)->where('status', 1)->get();
                 if ($profiles->isEmpty()) {
                     Session::flash('error', 'Gagal. Tiada maklumat profile ahli KOMADA. Sila hubungi Programmer');
                     return Redirect::back();
                 }
                 foreach ($profiles as $profile) {
                     $perkara[$zone->kod]['sumbangan'] += $sumbangan->jumlah;
                 }
             }
         }
         // 3 - PWT -> perkhidmatan_id = 1
         $perkara[$zone->kod]['pwt'] = 0.0;
         $accounts = AkaunPotongan::where('status', 1)->where('perkhidmatan_id', 1)->where('created_at', '<=', $tarikh)->get();
         if (!$accounts->isEmpty()) {
             foreach ($accounts as $account) {
                 if ($zone->kod == $this->getZonGaji($account->no_gaji)) {
                     $perkara[$zone->kod]['pwt'] += $account->bulanan;
                 }
             }
         }
         // 4 - Buku Sekolah -> perkhidmatan_id = 2
         $perkara[$zone->kod]['bs'] = 0.0;
         $accounts = AkaunPotongan::where('status', 1)->where('perkhidmatan_id', 2)->where('created_at', '<=', $tarikh)->get();
         if (!$accounts->isEmpty()) {
             foreach ($accounts as $account) {
                 if ($zone->kod == $this->getZonGaji($account->no_gaji)) {
                     $perkara[$zone->kod]['bs'] += $account->bulanan;
                 }
             }
         }
         // 5 - RoadTax - perkhidmatan_id = 3
         $perkara[$zone->kod]['rt'] = 0.0;
         $accounts = AkaunPotongan::where('status', 1)->where('perkhidmatan_id', 3)->where('created_at', '<=', $tarikh)->get();
         if (!$accounts->isEmpty()) {
             foreach ($accounts as $account) {
                 if ($zone->kod == $this->getZonGaji($account->no_gaji)) {
                     $perkara[$zone->kod]['rt'] += $account->bulanan;
                 }
             }
         }
         // 6 - Insurans - perkhidmatan_id = 4
         $perkara[$zone->kod]['ins'] = 0.0;
         $accounts = AkaunPotongan::where('status', 1)->where('perkhidmatan_id', 4)->where('created_at', '<=', $tarikh)->get();
         if (!$accounts->isEmpty()) {
             foreach ($accounts as $account) {
                 if ($zone->kod == $this->getZonGaji($account->no_gaji)) {
                     $perkara[$zone->kod]['ins'] += $account->bulanan;
                 }
             }
         }
         // 7 - Tayar / Bayar - perkhidmatan_id = 5
         $perkara[$zone->kod]['tb'] = 0.0;
         $accounts = AkaunPotongan::where('status', 1)->where('perkhidmatan_id', 5)->where('created_at', '<=', $tarikh)->get();
         if (!$accounts->isEmpty()) {
             foreach ($accounts as $account) {
                 if ($zone->kod == $this->getZonGaji($account->no_gaji)) {
                     $perkara[$zone->kod]['tb'] += $account->bulanan;
                 }
             }
         }
         // 8 - Kecemasan - perkhidmatan_id = 6
         $perkara[$zone->kod]['kc'] = 0.0;
         $accounts = AkaunPotongan::where('status', 1)->where('perkhidmatan_id', 6)->where('created_at', '<=', $tarikh)->get();
         if (!$accounts->isEmpty()) {
             foreach ($accounts as $account) {
                 if ($zone->kod == $this->getZonGaji($account->no_gaji)) {
                     $perkara[$zone->kod]['kc'] += $account->bulanan;
                 }
             }
         }
     }
     return View('members.laporan.janaan.lapPotonganGajiGenerate', compact('zones', 'perkara'));
 }
Ejemplo n.º 3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     User::create(array('name' => 'Suhairi Abdul Hamid', 'email' => '*****@*****.**', 'password' => Hash::make('suhairi')));
     User::create(array('name' => 'Nona Azizah', 'email' => '*****@*****.**', 'password' => Hash::make('azizah')));
     Perkhidmatan::create(array("nama" => "WANG TUNAI"));
     Perkhidmatan::create(array("nama" => "BUKU SEKOLAH"));
     Perkhidmatan::create(array("nama" => "CUKAI JALAN"));
     Perkhidmatan::create(array("nama" => "INSURANS"));
     Perkhidmatan::create(array("nama" => "TAYAR / BATERI"));
     Perkhidmatan::create(array("nama" => "KECEMASAN"));
     Startup::create(['id' => 1, 'nama' => 'YURAN', 'nilai' => '4184963.80', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Startup::create(['id' => 2, 'nama' => 'TKA', 'nilai' => '90721.52', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Startup::create(['id' => 3, 'nama' => 'BIASA', 'nilai' => '00.00', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Startup::create(['id' => 4, 'nama' => 'PERTARUHAN', 'nilai' => '00.00', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Startup::create(['id' => 5, 'nama' => 'TAYAR / BATERI', 'nilai' => '00.00', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Startup::create(['id' => 6, 'nama' => 'INSURANS', 'nilai' => '00.00', 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Tka::create(['id' => 1, 'jumlah' => 6.0, 'status' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     Sumbangan::create(['id' => 1, 'nama' => 'Sumbangan Kematian']);
     Sumbangan::create(['id' => 2, 'nama' => 'Sumbangan IPTA']);
     Sumbangan::create(['id' => 3, 'nama' => 'Sumbangan Bencana']);
     Zon::create(['kod' => '01', 'nama' => 'BAHAGIAN KHIDMAT PENGURUSAN']);
     Zon::create(['kod' => '02', 'nama' => 'BAHAGIAN INDUSTRI PADI']);
     Zon::create(['kod' => '03', 'nama' => 'BAHAGIAN INDUSTRI PADI DAN BUKAN PADI']);
     Zon::create(['kod' => '04', 'nama' => 'BAHAGIAN PENGURUSAN INSTITUSI LADANG']);
     Zon::create(['kod' => '05', 'nama' => 'BAHAGIAN PERANCANGAN DAN TEKNOLOGI MAKLUMAT']);
     Zon::create(['kod' => '06', 'nama' => 'BAHAGIAN PENGURUSAN EMPANGAN DAN SUMBER AIR']);
     Zon::create(['kod' => '07', 'nama' => 'BAHAGIAN PENGAIRAN DAN SALIRAN']);
     Zon::create(['kod' => '08', 'nama' => 'BAHAGIAN KHIDMAT MEKANIKAL DAN INFRASTRUKTUR']);
     Zon::create(['kod' => '09', 'nama' => 'PERKHIDMATAN MEKANIKAL']);
     Zon::create(['kod' => '10', 'nama' => 'BAHAGIAN PENGURUSAN WILAYAH']);
     Zon::create(['kod' => '11', 'nama' => 'WILAYAH 1']);
     Zon::create(['kod' => '12', 'nama' => 'WILAYAH 2']);
     Zon::create(['kod' => '13', 'nama' => 'WILAYAH 3']);
     Zon::create(['kod' => '14', 'nama' => 'WILAYAH 4']);
     Zon::create(['kod' => '20', 'nama' => 'BAYARAN SENDIRI']);
     Jantina::create(['nama' => 'LELAKI']);
     Jantina::create(['nama' => 'PEREMPUAN']);
     Status::create(['nama' => 'AKTIF']);
     Status::create(['nama' => 'PENCEN']);
     Status::create(['nama' => 'TIDAK AKTIF']);
     Status::where('id', 3)->update(['id' => 0]);
     Takaful::create(['jumlah' => '10.00', 'status' => 1]);
     ProfileCategory::create(['id' => 1, 'nama' => 'AHLI BIASA', 'catatan' => '']);
     ProfileCategory::create(['id' => 2, 'nama' => 'PPK', 'catatan' => '']);
     ProfileCategory::create(['id' => 3, 'nama' => 'YPPPM', 'catatan' => 'Y']);
     ProfileCategory::create(['id' => 4, 'nama' => 'SPPM', 'catatan' => 'S']);
     ProfileCategory::create(['id' => 5, 'nama' => 'KOMADA', 'catatan' => '']);
     ProfileCategory::create(['id' => 6, 'nama' => 'PELADANG MART', 'catatan' => 'PM']);
     $profiles = Profile::all();
     foreach ($profiles as $profile) {
         $no_anggota = (int) $profile->no_anggota;
         if ($no_anggota != 0) {
             $profile->profile_category_id = 1;
             $profile->save();
         }
         if (strpos($profile->no_anggota, 'Y') !== false) {
             $profile->profile_category_id = 3;
             $profile->save();
         }
         if (strpos($profile->no_anggota, 'S') !== false) {
             $profile->profile_category_id = 4;
             $profile->save();
         }
         if (strpos($profile->no_anggota, 'PM') !== false) {
             $profile->profile_category_id = 6;
             $profile->save();
         }
         if (strpos($profile->no_anggota, 'A') !== false || strpos($profile->no_anggota, 'B') !== false || strpos($profile->no_anggota, 'C') !== false || strpos($profile->no_anggota, 'F') !== false) {
             $profile->profile_category_id = 2;
             $profile->save();
         }
     }
 }
Ejemplo n.º 4
0
 public function edit($id)
 {
     $anggota = [];
     // $anggota['aktif']
     $profiles = Profile::where('status', 1)->count();
     $active = $profiles;
     // $anggota['inactive']
     $inactive = Inactive::where('updated_at', 'like', Carbon::now()->format('Y') . '%')->where('status', 1)->count();
     // $anggota['keseluruhan']
     $profiles = Profile::all();
     $keseluruhan = $profiles->count();
     $max = 0;
     foreach ($profiles as $profile) {
         $profile->no_anggota = (int) $profile->no_anggota;
         if ($profile->no_anggota != 0 && $profile->no_anggota > $max) {
             $max = $profile->no_anggota;
         }
     }
     $anggota = ['keseluruhan' => $keseluruhan, 'aktif' => $active, 'inactive' => $inactive, 'no_akhir' => $max];
     $profile = Profile::where('no_gaji', $id)->first();
     $status = ['1' => 'AKTIF', '0' => 'TIDAK AKTIF', '2' => 'PENCEN'];
     $zon = Zon::lists('nama', 'kod');
     $jantina = Jantina::lists('nama', 'id');
     return View('members.profile.edit', compact('profile', 'status', 'anggota', 'zon', 'jantina'));
 }