diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index 258a2c0..54ee934 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -90,3 +90,7 @@ function RemoveSpecialCharPlus($str) // Returning the result return $res; } + +function toDmy($date){ + return date("d-m-Y", strtotime($date)); +} \ No newline at end of file diff --git a/app/Http/Controllers/Admins/DashboardController.php b/app/Http/Controllers/Admins/DashboardController.php index b339bdb..48e924e 100644 --- a/app/Http/Controllers/Admins/DashboardController.php +++ b/app/Http/Controllers/Admins/DashboardController.php @@ -2,8 +2,16 @@ namespace App\Http\Controllers\Admins; +use App\Helpers\ResponseFormatter; use App\Http\Controllers\Controller; +use App\Http\Controllers\Kasir\Menu; +use App\Models\MenuTerlarisView; +use App\Models\Pengeluaran; +use App\Models\Pesanan; +use Carbon\Carbon; use Illuminate\Http\Request; +use Illuminate\Support\Facades\DB; +use Yajra\DataTables\Facades\DataTables; class DashboardController extends Controller { @@ -14,4 +22,302 @@ class DashboardController extends Controller { return view('pages.admin.dashboard'); } + + /** + * @Author: xelz + * @Date: 2024-01-26 18:59:12 + * @Desc: Display Menu Terlaris + */ + + public function menuTerlaris() + { + + $data = MenuTerlarisView::where([['kategori_produk_id', '=', 2], ['tgl_start_promo', '=', null]])->get(); + + return DataTables::of($data) + ->addIndexColumn() + ->make(true); + } + + public function getCalculationPendapatan() + { + $pendapatanBulan = $this->calculatePendapatanBulan(); + $pendapatanHari = $this->calculatePendapatanHari(); + $pengeluaranBulan = $this->calculatePengeluaranBulan(); + $pengeluaranHari = $this->calculatePengeluaranHari(); + + return ResponseFormatter::success(['pendapatanBulan' => $pendapatanBulan, 'pendapatanHari' => $pendapatanHari, 'pengeluaranBulan' => $pengeluaranBulan, 'pengeluaranHari' => $pengeluaranHari]); + } + + private function calculatePendapatanBulan() + { + // tanggal bulan ini + $first_day_of_the_current_month = Carbon::today()->startOfMonth(); + $last_day_of_the_current_month = $first_day_of_the_current_month->copy()->endOfMonth(); + + // tanggal bulan lalu + $first_day_of_the_previous_month = $first_day_of_the_current_month->copy()->subMonth()->startOfMonth(); + $last_day_of_the_previous_month = $first_day_of_the_current_month->copy()->subMonth()->endOfMonth(); + + // get data jumlah penjualan keseluruhan dalam satu bulan + $penjualanSatuBulan = Pesanan::whereBetween('tanggal_pesanan', [$first_day_of_the_current_month, $last_day_of_the_current_month])->sum('grand_total'); + $penjualanBulanLalu = Pesanan::whereBetween('tanggal_pesanan', [$first_day_of_the_previous_month, $last_day_of_the_previous_month])->sum('grand_total'); + + /** + * @Author: xelz + * @Date: 2024-01-30 15:52:41 + * @Desc: constant status + * 1 netral + * 2 plus + * 3 minus + */ + $statusCalculation = 1; + + // calculate percentage of sales growth in the last month and this month + if ($penjualanBulanLalu != 0) { + $statusCalculation = 2; + $percentageOfSalesGrowth = ($penjualanSatuBulan - $penjualanBulanLalu) / $penjualanBulanLalu * 100; + // minus or not + if ($percentageOfSalesGrowth < 0) { + $statusCalculation = 3; + $percentageOfSalesGrowth = $percentageOfSalesGrowth * -1; + } + } else { + $statusCalculation = 1; + $percentageOfSalesGrowth = 0; + } + + return [ + 'penjualanSatuBulan' => $penjualanSatuBulan, + 'penjualanBulanLalu' => $penjualanBulanLalu, + 'statusCalculation' => $statusCalculation, + 'percentageOfSalesGrowth' => $percentageOfSalesGrowth + ]; + } + + private function calculatePendapatanHari() + { + // tanggal hari ini + $first_day_of_the_current_day = Carbon::today()->startOfDay(); + + $last_day_of_the_current_day = $first_day_of_the_current_day->copy()->endOfDay(); + + // tanggal kemarin + $first_day_of_the_previous_day = $first_day_of_the_current_day->copy()->subDay()->startOfDay(); + $last_day_of_the_previous_day = $first_day_of_the_current_day->copy()->subDay()->endOfDay(); + + // get data jumlah penjualan keseluruhan dalam satu bulan + $penjualanHariIni = Pesanan::whereBetween('tanggal_pesanan', [$first_day_of_the_current_day, $last_day_of_the_current_day])->sum('grand_total'); + $penjualanKemarin = Pesanan::whereBetween('tanggal_pesanan', [$first_day_of_the_previous_day, $last_day_of_the_previous_day])->sum('grand_total'); + + /** + * @Author: xelz + * @Date: 2024-01-30 15:52:41 + * @Desc: constant status + * 1 netral + * 2 plus + * 3 minus + */ + $statusCalculation = 1; + + // calculate percentage of sales growth in the last month and this month + if ($penjualanKemarin != 0) { + $statusCalculation = 2; + $percentageOfSalesGrowth = ($penjualanHariIni - $penjualanKemarin) / $penjualanKemarin * 100; + // minus or not + if ($percentageOfSalesGrowth < 0) { + $statusCalculation = 3; + $percentageOfSalesGrowth = $percentageOfSalesGrowth * -1; + } + } else { + $statusCalculation = 1; + $percentageOfSalesGrowth = 0; + } + + return [ + 'penjualanHariIni' => $penjualanHariIni, + 'penjualanKemarin' => $penjualanKemarin, + 'statusCalculation' => $statusCalculation, + 'percentageOfSalesGrowth' => $percentageOfSalesGrowth + ]; + } + + private function calculatePengeluaranBulan() + { + // tanggal bulan ini + $first_day_of_the_current_month = Carbon::today()->startOfMonth(); + $last_day_of_the_current_month = $first_day_of_the_current_month->copy()->endOfMonth(); + + // tanggal bulan lalu + $first_day_of_the_previous_month = $first_day_of_the_current_month->copy()->subMonth()->startOfMonth(); + $last_day_of_the_previous_month = $first_day_of_the_current_month->copy()->subMonth()->endOfMonth(); + + // get data jumlah penjualan keseluruhan dalam satu bulan + $penjualanSatuBulan = pengeluaran::whereBetween('tanggal', [$first_day_of_the_current_month, $last_day_of_the_current_month])->sum('nominal'); + $penjualanBulanLalu = pengeluaran::whereBetween('tanggal', [$first_day_of_the_previous_month, $last_day_of_the_previous_month])->sum('nominal'); + + /** + * @Author: xelz + * @Date: 2024-01-30 15:52:41 + * @Desc: constant status + * 1 netral + * 2 plus + * 3 minus + */ + $statusCalculation = 1; + + // calculate percentage of sales growth in the last month and this month + if ($penjualanBulanLalu != 0) { + $statusCalculation = 2; + $percentageOfSalesGrowth = ($penjualanSatuBulan - $penjualanBulanLalu) / $penjualanBulanLalu * 100; + // minus or not + if ($percentageOfSalesGrowth < 0) { + $statusCalculation = 3; + $percentageOfSalesGrowth = $percentageOfSalesGrowth * -1; + } + } else { + $statusCalculation = 1; + $percentageOfSalesGrowth = 0; + } + + return [ + 'penjualanSatuBulan' => $penjualanSatuBulan, + 'penjualanBulanLalu' => $penjualanBulanLalu, + 'statusCalculation' => $statusCalculation, + 'percentageOfSalesGrowth' => $percentageOfSalesGrowth + ]; + } + + private function calculatePengeluaranHari() + { + // tanggal hari ini + $first_day_of_the_current_day = Carbon::today()->startOfDay(); + + $last_day_of_the_current_day = $first_day_of_the_current_day->copy()->endOfDay(); + + // tanggal kemarin + $first_day_of_the_previous_day = $first_day_of_the_current_day->copy()->subDay()->startOfDay(); + $last_day_of_the_previous_day = $first_day_of_the_current_day->copy()->subDay()->endOfDay(); + + // get data jumlah penjualan keseluruhan dalam satu bulan + $penjualanHariIni = Pengeluaran::whereBetween('tanggal', [$first_day_of_the_current_day, $last_day_of_the_current_day])->sum('nominal'); + $penjualanKemarin = pengeluaran::whereBetween('tanggal', [$first_day_of_the_previous_day, $last_day_of_the_previous_day])->sum('nominal'); + + /** + * @Author: xelz + * @Date: 2024-01-30 15:52:41 + * @Desc: constant status + * 1 netral + * 2 plus + * 3 minus + */ + $statusCalculation = 1; + + // calculate percentage of sales growth in the last month and this month + if ($penjualanKemarin != 0) { + $statusCalculation = 2; + $percentageOfSalesGrowth = ($penjualanHariIni - $penjualanKemarin) / $penjualanKemarin * 100; + + // minus or not + if ($percentageOfSalesGrowth < 0) { + $statusCalculation = 3; + $percentageOfSalesGrowth = $percentageOfSalesGrowth * -1; + } + } else { + $statusCalculation = 1; + $percentageOfSalesGrowth = 0; + } + + return [ + 'penjualanHariIni' => $penjualanHariIni, + 'penjualanKemarin' => $penjualanKemarin, + 'statusCalculation' => $statusCalculation, + 'percentageOfSalesGrowth' => $percentageOfSalesGrowth + ]; + } + + public function getChart() + { + $allPenjualan = Pesanan::sum('grand_total'); + + $weekThisMonth = $this->getDataEachWeekThisMonth(); + $weekLastMonth = $this->getDataEachWeekLastMonth(); + + return ResponseFormatter::success(['allPenjualan' => $allPenjualan, 'weekThisMonth' => $weekThisMonth, 'weekLastMonth' => $weekLastMonth]); + } + + private function getDataEachWeekThisMonth() + { + //format string + $f = 'Y-m-d'; + + //if you want to record time as well, then replace today() with now() + //and remove startOfDay() + $today = Carbon::today(); + $date = $today->copy()->firstOfMonth()->startOfDay(); + $eom = $today->copy()->endOfMonth()->startOfDay(); + + $dates = []; + + for ($i = 1; $date->lte($eom); $i++) { + + //record start date + $startDate = $date->copy(); + + //loop to end of the week while not crossing the last date of month + while ($date->dayOfWeek != Carbon::SUNDAY && $date->lte($eom)) { + $date->addDay(); + } + + $dates['Minggu ke ' . $i] = $startDate->format($f) . ' 00:00:00 |' . $date->format($f) . ' 23:59:59'; + $date->addDay(); + } + + $datapenjualan = []; + + foreach ($dates as $key => $value) { + $dataPenjualan = Pesanan::whereBetween('tanggal_pesanan', explode('|', $value))->sum('grand_total'); + + + $datapenjualan[$key] = $dataPenjualan; + } + + return $datapenjualan; + } + + private function getDataEachWeekLastMonth() + { + //format string + $f = 'Y-m-d'; + + //if you want to record time as well, then replace today() with now() + //and remove startOfDay() + $today = Carbon::today()->subMonth(); + $date = $today->copy()->firstOfMonth()->startOfDay(); + $eom = $today->copy()->endOfMonth()->startOfDay(); + + $dates = []; + + for ($i = 1; $date->lte($eom); $i++) { + + //record start date + $startDate = $date->copy(); + + //loop to end of the week while not crossing the last date of month + while ($date->dayOfWeek != Carbon::SUNDAY && $date->lte($eom)) { + $date->addDay(); + } + + $dates['Minggu ke ' . $i] = $startDate->format($f) . ' 00:00:00 |' . $date->format($f) . ' 23:59:59'; + $date->addDay(); + } + + $datapenjualan = []; + foreach ($dates as $key => $value) { + $dataPenjualan = Pesanan::whereBetween('tanggal_pesanan', explode('|', $value))->sum('grand_total'); + $datapenjualan[$key] = $dataPenjualan; + } + + return $datapenjualan; + } } diff --git a/app/Http/Controllers/Admins/Pengeluaran/PengeluaranController.php b/app/Http/Controllers/Admins/Pengeluaran/PengeluaranController.php new file mode 100644 index 0000000..aea18cf --- /dev/null +++ b/app/Http/Controllers/Admins/Pengeluaran/PengeluaranController.php @@ -0,0 +1,120 @@ +get(); + $rekeningCoaTf = RekeningCoa::where('kode_coa', 1)->where('sub_kode_coa', 200)->get(); + + return view('pages.admin.pengeluaran.index', compact('coaBiaya', 'rekeningCoaTf')); + } + + public function simpan(Request $request){ + try { + DB::beginTransaction(); + + $user = request()->user(); + + Pengeluaran::create([ + 'faktur' => "PG-".date('YmdHis'), + 'tanggal' => $request->tanggal, + 'jenis_transaksi' => $request->jenis_transaksi, + 'nominal' => $request->nominal, + 'keterangan' => $request->keterangan, + 'user_id' => $user->id + ]); + if ($request->jenis_transaksi == "1") { + BukuBesar::create([ + 'faktur' => "PG-".date('YmdHis'), + 'tanggal' => $request->tanggal, + 'rekening_coa_id' => "2", + 'kode_rekening_coa' => "1.100.01", + 'keterangan_coa' => "Kas Kasir", + 'keterangan' => $request->keterangan, + 'debet' => 0, + 'kredit' => $request->nominal + ]); + BukuBesar::create([ + 'faktur' => "PG-".date('YmdHis'), + 'tanggal' => $request->tanggal, + 'rekening_coa_id' => $request->id_rekening_coa, + 'kode_rekening_coa' => $request->kode_coa, + 'keterangan_coa' => $request->keterangan_coa, + 'keterangan' => $request->keterangan, + 'debet' => $request->nominal, + 'kredit' => 0, + ]); + }else{ + BukuBesar::create([ + 'faktur' => "PG-".date('YmdHis'), + 'tanggal' => $request->tanggal, + 'rekening_coa_id' => $request->id_rekening_coa_transfer, + 'kode_rekening_coa' => $request->kode_coa_transfer, + 'keterangan_coa' => $request->keterangan_coa_transfer, + 'keterangan' => $request->keterangan, + 'debet' => 0, + 'kredit' => $request->nominal + ]); + BukuBesar::create([ + 'faktur' => "PG-".date('YmdHis'), + 'tanggal' => $request->tanggal, + 'rekening_coa_id' => $request->id_rekening_coa, + 'kode_rekening_coa' => $request->kode_coa, + 'keterangan_coa' => $request->keterangan_coa, + 'keterangan' => $request->keterangan, + 'debet' => $request->nominal, + 'kredit' => 0, + ]); + } + + DB::commit(); + + return response()->json(['status' => true, 'message' => 'Data berhasil tersimpan']); + } catch (\Throwable $th) { + DB::rollBack(); + + dd($th->getMessage()); + return response()->json(['status' => false, 'message' => 'Kesalahan menyimpan data']); + } + } + + public function laporan(Request $request){ + $mpdf = new \Mpdf\Mpdf([ + 'mode' => 'utf-8', + 'format' => 'A4', + 'orientation' => 'portrait', + 'margin_left' => 15, + 'margin_right' => 15, + 'margin_top' => 10, + 'margin_bottom' => 10, + 'default_font_size' => 9, + 'default_font' => 'arial', + ]); + $mpdf->AddPage(); + $mpdf->setFooter('{PAGENO}'); + + $data = Pengeluaran::with('user')->whereDate('tanggal', '>=', $request->filter_tanggal_1) + ->whereDate('tanggal', '<=', $request->filter_tanggal_2) + ->get(); + $html = view('pages.admin.pengeluaran.laporan', [ + 'data' => $data, + 'filter_tanggal_1' => $request->filter_tanggal_1, + 'filter_tanggal_2' => $request->filter_tanggal_2, + ]); + $mpdf->writeHTML($html); + $mpdf->Output('Laporan_Pengeluaran.pdf', 'I'); + return response()->header('Content-Type', 'application/pdf'); + } +} diff --git a/app/Http/Controllers/Auths/AuthController.php b/app/Http/Controllers/Auths/AuthController.php index 71a0cee..55aae3e 100644 --- a/app/Http/Controllers/Auths/AuthController.php +++ b/app/Http/Controllers/Auths/AuthController.php @@ -102,6 +102,9 @@ class AuthController extends Controller try { if (Auth::attempt($validator->validated(), $request->has('remember_me') ? true : false)) { + $user = auth()->user(); + session()->put('id', $user->id); + session()->put('name', $user->name); Session::flash('login-message', [ 'type' => 'success', 'msg' => 'Anda berhasil melakukan Login!' diff --git a/app/Http/Controllers/Kasir/History.php b/app/Http/Controllers/Kasir/History.php index f673b86..883da52 100644 --- a/app/Http/Controllers/Kasir/History.php +++ b/app/Http/Controllers/Kasir/History.php @@ -22,15 +22,15 @@ class History extends Controller $filter_tanggal_2 = $request->filter_tanggal_2; $data = Pesanan::with(['detailPesanan', 'user']) ->when($filter_tanggal_1, function ($query) use ($filter_tanggal_1) { - return $query->whereDate('created_at', '>=', $filter_tanggal_1); + return $query->whereDate('tanggal_pesanan', '>=', $filter_tanggal_1); }) ->when($filter_tanggal_2, function ($query) use ($filter_tanggal_2) { - return $query->whereDate('created_at', '<=', $filter_tanggal_2); + return $query->whereDate('tanggal_pesanan', '<=', $filter_tanggal_2); }) ->when(!$filter_tanggal_1 && !$filter_tanggal_2, function ($query) { - return $query->whereDate('created_at', Carbon::today()); + return $query->whereDate('tanggal_pesanan', Carbon::today()); }) - ->orderBy('created_at', 'desc') + ->orderBy('tanggal_pesanan', 'desc') ->get(); return datatables() @@ -70,7 +70,8 @@ class History extends Controller return view('pages.Kasir.print_dapur', compact('pesanan')); } - public function getDataDetailHistory(Request $request){ + public function getDataDetailHistory(Request $request) + { $data = DetailPesanan::with('pesanan')->where('pesanan_id', $request->id_pesanan)->get(); return response()->json(['status' => true, 'data' => $data]); diff --git a/app/Models/MenuTerlarisView.php b/app/Models/MenuTerlarisView.php new file mode 100644 index 0000000..9cb238e --- /dev/null +++ b/app/Models/MenuTerlarisView.php @@ -0,0 +1,13 @@ +belongsTo(User::class, 'user_id'); + } +} diff --git a/composer.json b/composer.json index d06ead0..24d9779 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "laravel/framework": "^10.10", "laravel/sanctum": "^3.3", "laravel/tinker": "^2.8", + "mpdf/mpdf": "^8.2", "realrashid/sweet-alert": "^6.0", "spatie/laravel-permission": "^6.3", "yajra/laravel-datatables": "^10.1" diff --git a/composer.lock b/composer.lock index 1b0357e..1917c2b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c2a087156cf7cdb5fbd03918562d593c", + "content-hash": "622a1b44adad65bf17c6308f5e4f8fe0", "packages": [ { "name": "brick/math", @@ -2387,6 +2387,238 @@ ], "time": "2023-10-27T15:32:31+00:00" }, + { + "name": "mpdf/mpdf", + "version": "v8.2.2", + "source": { + "type": "git", + "url": "https://github.com/mpdf/mpdf.git", + "reference": "596a87b876d7793be7be060a8ac13424de120dd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/596a87b876d7793be7be060a8ac13424de120dd5", + "reference": "596a87b876d7793be7be060a8ac13424de120dd5", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-mbstring": "*", + "mpdf/psr-http-message-shim": "^1.0 || ^2.0", + "mpdf/psr-log-aware-trait": "^2.0 || ^3.0", + "myclabs/deep-copy": "^1.7", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "setasign/fpdi": "^2.1" + }, + "require-dev": { + "mockery/mockery": "^1.3.0", + "mpdf/qrcode": "^1.1.0", + "squizlabs/php_codesniffer": "^3.5.0", + "tracy/tracy": "~2.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-bcmath": "Needed for generation of some types of barcodes", + "ext-xml": "Needed mainly for SVG manipulation", + "ext-zlib": "Needed for compression of embedded resources, such as fonts" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Mpdf\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "Matěj Humpál", + "role": "Developer, maintainer" + }, + { + "name": "Ian Back", + "role": "Developer (retired)" + } + ], + "description": "PHP library generating PDF files from UTF-8 encoded HTML", + "homepage": "https://mpdf.github.io", + "keywords": [ + "pdf", + "php", + "utf-8" + ], + "support": { + "docs": "http://mpdf.github.io", + "issues": "https://github.com/mpdf/mpdf/issues", + "source": "https://github.com/mpdf/mpdf" + }, + "funding": [ + { + "url": "https://www.paypal.me/mpdf", + "type": "custom" + } + ], + "time": "2023-11-07T13:52:14+00:00" + }, + { + "name": "mpdf/psr-http-message-shim", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-http-message-shim.git", + "reference": "f25a0153d645e234f9db42e5433b16d9b113920f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/f25a0153d645e234f9db42e5433b16d9b113920f", + "reference": "f25a0153d645e234f9db42e5433b16d9b113920f", + "shasum": "" + }, + "require": { + "psr/http-message": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrHttpMessageShim\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + }, + { + "name": "Nigel Cunningham", + "email": "nigel.cunningham@technocrat.com.au" + } + ], + "description": "Shim to allow support of different psr/message versions.", + "support": { + "issues": "https://github.com/mpdf/psr-http-message-shim/issues", + "source": "https://github.com/mpdf/psr-http-message-shim/tree/v2.0.1" + }, + "time": "2023-10-02T14:34:03+00:00" + }, + { + "name": "mpdf/psr-log-aware-trait", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-log-aware-trait.git", + "reference": "a633da6065e946cc491e1c962850344bb0bf3e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/a633da6065e946cc491e1c962850344bb0bf3e78", + "reference": "a633da6065e946cc491e1c962850344bb0bf3e78", + "shasum": "" + }, + "require": { + "psr/log": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrLogAwareTrait\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + } + ], + "description": "Trait to allow support of different psr/log versions.", + "support": { + "issues": "https://github.com/mpdf/psr-log-aware-trait/issues", + "source": "https://github.com/mpdf/psr-log-aware-trait/tree/v3.0.0" + }, + "time": "2023-05-03T06:19:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, { "name": "nesbot/carbon", "version": "2.72.1", @@ -2879,6 +3111,56 @@ ], "time": "2024-01-09T09:30:37+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, { "name": "phpoffice/phpspreadsheet", "version": "1.29.0", @@ -3865,6 +4147,78 @@ ], "time": "2023-02-15T07:13:11+00:00" }, + { + "name": "setasign/fpdi", + "version": "v2.6.0", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDI.git", + "reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6db878129ec6c7e141316ee71872923e7f1b7ad", + "reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad", + "shasum": "" + }, + "require": { + "ext-zlib": "*", + "php": "^5.6 || ^7.0 || ^8.0" + }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, + "require-dev": { + "phpunit/phpunit": "~5.7", + "setasign/fpdf": "~1.8.6", + "setasign/tfpdf": "~1.33", + "squizlabs/php_codesniffer": "^3.5", + "tecnickcom/tcpdf": "~6.2" + }, + "suggest": { + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." + }, + "type": "library", + "autoload": { + "psr-4": { + "setasign\\Fpdi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" + }, + { + "name": "Maximilian Kresse", + "email": "maximilian.kresse@setasign.com", + "homepage": "https://www.setasign.com" + } + ], + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", + "keywords": [ + "fpdf", + "fpdi", + "pdf" + ], + "support": { + "issues": "https://github.com/Setasign/FPDI/issues", + "source": "https://github.com/Setasign/FPDI/tree/v2.6.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/setasign/fpdi", + "type": "tidelift" + } + ], + "time": "2023-12-11T16:03:32+00:00" + }, { "name": "spatie/laravel-permission", "version": "6.3.0", @@ -7388,65 +7742,6 @@ }, "time": "2023-12-10T02:24:34+00:00" }, - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, { "name": "nunomaduro/collision", "version": "v7.10.0", diff --git a/database/migrations/2024_01_26_133430_create_pengeluarans_table.php b/database/migrations/2024_01_26_133430_create_pengeluarans_table.php new file mode 100644 index 0000000..cc73607 --- /dev/null +++ b/database/migrations/2024_01_26_133430_create_pengeluarans_table.php @@ -0,0 +1,33 @@ +id(); + $table->string('faktur')->nullable(); + $table->date('tanggal')->nullable(); + $table->integer('jenis_transaksi')->nullable()->comment('1 = Tunai, 2 = Transfer'); + $table->integer('nominal')->nullable(); + $table->string('keterangan')->nullable(); + $table->foreignId('user_id')->nullable()->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('pengeluaran'); + } +}; diff --git a/database/migrations/2024_01_27_090709_create_menu_terlaris_view.php b/database/migrations/2024_01_27_090709_create_menu_terlaris_view.php new file mode 100644 index 0000000..4d943e1 --- /dev/null +++ b/database/migrations/2024_01_27_090709_create_menu_terlaris_view.php @@ -0,0 +1,38 @@ + @endcan
- 820 - Visitors Over Time -
-- - 12.5% - - Since last week -
-Product | -Price | -Sales | -More | +No | +Menu | +Harga | +Terjual |
---|---|---|---|---|---|---|---|
- ![]() |
- $13 USD | -- - - 12% - - 12,000 Sold - | -- - - - | -||||
- ![]() |
- $29 USD | -- - - 0.5% - - 123,234 Sold - | -- - - - | -||||
- ![]() |
- $1,230 USD | -- - - 3% - - 198 Sold - | -- - - - | -||||
- ![]() |
- $199 USD | -- - - 63% - - 87 Sold - | -- - - - | -
- $18,230.00 - Sales Over Time + + Penjualan Keseluruhan
- + 33.1% - Since last month + dari bulan lalu
Tanggal Unduh: {{ date('d-m-Y H:i:s') }} | +
Dicetak Oleh: {{ Session::get('name') }} | +
Laporan Pengeluaran | +
Pencarian: {{ 'Antara Tanggal '.toDmy($filter_tanggal_1).' s/d Tanggal '.toDmy($filter_tanggal_2).'' }} | +
No | +Faktur | +Tanggal | +Jenis Transaksi | +Nominal | +Keterangan | +User | +
---|---|---|---|---|---|---|
{{ $key+1 }} | +{{ $val->faktur }} | +{{ toDmy($val->tanggal) }} | +{{ $val->jenis_transaksi == "1" ? "Tunai" : "Transfer" }} | +Rp {{ format_uang($val->nominal) }} | +{{ $val->keterangan }} | +{{ $val->user->name }} | +