dashboard tipis"
commit
2724413e20
|
@ -90,3 +90,7 @@ function RemoveSpecialCharPlus($str)
|
||||||
// Returning the result
|
// Returning the result
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toDmy($date){
|
||||||
|
return date("d-m-Y", strtotime($date));
|
||||||
|
}
|
|
@ -2,8 +2,16 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers\Admins;
|
namespace App\Http\Controllers\Admins;
|
||||||
|
|
||||||
|
use App\Helpers\ResponseFormatter;
|
||||||
use App\Http\Controllers\Controller;
|
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\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Yajra\DataTables\Facades\DataTables;
|
||||||
|
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -14,4 +22,302 @@ class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
return view('pages.admin.dashboard');
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,120 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admins\Pengeluaran;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\BukuBesar;
|
||||||
|
use App\Models\Pengeluaran;
|
||||||
|
use App\Models\RekeningCoa;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class PengeluaranController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index(){
|
||||||
|
$coaBiaya = RekeningCoa::where('kode_coa', 5)->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');
|
||||||
|
}
|
||||||
|
}
|
|
@ -102,6 +102,9 @@ class AuthController extends Controller
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Auth::attempt($validator->validated(), $request->has('remember_me') ? true : false)) {
|
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', [
|
Session::flash('login-message', [
|
||||||
'type' => 'success',
|
'type' => 'success',
|
||||||
'msg' => 'Anda berhasil melakukan Login!'
|
'msg' => 'Anda berhasil melakukan Login!'
|
||||||
|
|
|
@ -22,15 +22,15 @@ class History extends Controller
|
||||||
$filter_tanggal_2 = $request->filter_tanggal_2;
|
$filter_tanggal_2 = $request->filter_tanggal_2;
|
||||||
$data = Pesanan::with(['detailPesanan', 'user'])
|
$data = Pesanan::with(['detailPesanan', 'user'])
|
||||||
->when($filter_tanggal_1, function ($query) use ($filter_tanggal_1) {
|
->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) {
|
->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) {
|
->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();
|
->get();
|
||||||
|
|
||||||
return datatables()
|
return datatables()
|
||||||
|
@ -70,7 +70,8 @@ class History extends Controller
|
||||||
return view('pages.Kasir.print_dapur', compact('pesanan'));
|
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();
|
$data = DetailPesanan::with('pesanan')->where('pesanan_id', $request->id_pesanan)->get();
|
||||||
|
|
||||||
return response()->json(['status' => true, 'data' => $data]);
|
return response()->json(['status' => true, 'data' => $data]);
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class MenuTerlarisView extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $table = 'menu_terlaris_view';
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Pengeluaran extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $table = 'pengeluaran';
|
||||||
|
protected $guarded = [];
|
||||||
|
|
||||||
|
public function user(){
|
||||||
|
return $this->belongsTo(User::class, 'user_id');
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,6 +13,7 @@
|
||||||
"laravel/framework": "^10.10",
|
"laravel/framework": "^10.10",
|
||||||
"laravel/sanctum": "^3.3",
|
"laravel/sanctum": "^3.3",
|
||||||
"laravel/tinker": "^2.8",
|
"laravel/tinker": "^2.8",
|
||||||
|
"mpdf/mpdf": "^8.2",
|
||||||
"realrashid/sweet-alert": "^6.0",
|
"realrashid/sweet-alert": "^6.0",
|
||||||
"spatie/laravel-permission": "^6.3",
|
"spatie/laravel-permission": "^6.3",
|
||||||
"yajra/laravel-datatables": "^10.1"
|
"yajra/laravel-datatables": "^10.1"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "c2a087156cf7cdb5fbd03918562d593c",
|
"content-hash": "622a1b44adad65bf17c6308f5e4f8fe0",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
|
@ -2387,6 +2387,238 @@
|
||||||
],
|
],
|
||||||
"time": "2023-10-27T15:32:31+00:00"
|
"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",
|
"name": "nesbot/carbon",
|
||||||
"version": "2.72.1",
|
"version": "2.72.1",
|
||||||
|
@ -2879,6 +3111,56 @@
|
||||||
],
|
],
|
||||||
"time": "2024-01-09T09:30:37+00:00"
|
"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",
|
"name": "phpoffice/phpspreadsheet",
|
||||||
"version": "1.29.0",
|
"version": "1.29.0",
|
||||||
|
@ -3865,6 +4147,78 @@
|
||||||
],
|
],
|
||||||
"time": "2023-02-15T07:13:11+00:00"
|
"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",
|
"name": "spatie/laravel-permission",
|
||||||
"version": "6.3.0",
|
"version": "6.3.0",
|
||||||
|
@ -7388,65 +7742,6 @@
|
||||||
},
|
},
|
||||||
"time": "2023-12-10T02:24:34+00:00"
|
"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",
|
"name": "nunomaduro/collision",
|
||||||
"version": "v7.10.0",
|
"version": "v7.10.0",
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('pengeluaran', function (Blueprint $table) {
|
||||||
|
$table->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');
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
DB::statement('CREATE OR REPLACE VIEW menu_terlaris_view AS
|
||||||
|
SELECT
|
||||||
|
detail_pesanans.produk_id,
|
||||||
|
produks.*,
|
||||||
|
COUNT(detail_pesanans.produk_id) AS jumlah_produk_terjual
|
||||||
|
FROM
|
||||||
|
detail_pesanans
|
||||||
|
JOIN produks ON produks.id = detail_pesanans.produk_id
|
||||||
|
GROUP BY
|
||||||
|
detail_pesanans.produk_id,
|
||||||
|
produks.nama_produk
|
||||||
|
ORDER BY
|
||||||
|
jumlah_produk_terjual DESC
|
||||||
|
');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
DB::statement('DROP VIEW IF EXISTS menu_terlaris_view');
|
||||||
|
}
|
||||||
|
};
|
|
@ -15,11 +15,11 @@
|
||||||
</li>
|
</li>
|
||||||
@endcan
|
@endcan
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a id="dropdownSubMenu1" href="#" data-toggle="dropdown" aria-haspopup="true"
|
<a id="dropdownSubMenu1" href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true"
|
||||||
aria-expanded="false" class="nav-link dropdown-toggle">Transaksi</a>
|
aria-expanded="false" class="nav-link dropdown-toggle">Transaksi</a>
|
||||||
<ul aria-labelledby="dropdownSubMenu1" class="dropdown-menu border-0 shadow">
|
<ul aria-labelledby="dropdownSubMenu1" class="dropdown-menu border-0 shadow">
|
||||||
<li><a href="#" class="dropdown-item">Order </a></li>
|
<li><a href="#" class="dropdown-item">Order </a></li>
|
||||||
<li><a href="#" class="dropdown-item">Pengeluaran</a></li>
|
<li><a href="{{ route('pengeluaran.index') }}" class="dropdown-item">Pengeluaran</a></li>
|
||||||
<li class="dropdown-divider"></li>
|
<li class="dropdown-divider"></li>
|
||||||
<li><a href="{{ route('laporan.index') }}" class="dropdown-item">Laporan</a></li>
|
<li><a href="{{ route('laporan.index') }}" class="dropdown-item">Laporan</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -93,10 +93,7 @@
|
||||||
.reduce((a, b) => intVal(a) + intVal(b), 0);
|
.reduce((a, b) => intVal(a) + intVal(b), 0);
|
||||||
|
|
||||||
// GrandTotal over all pages
|
// GrandTotal over all pages
|
||||||
diskonTotal = api
|
|
||||||
.column(7)
|
|
||||||
.data()
|
|
||||||
.reduce((a, b) => intVal(a) + intVal(b), 0);
|
|
||||||
|
|
||||||
// Total over this page
|
// Total over this page
|
||||||
pageTotal = api
|
pageTotal = api
|
||||||
|
@ -116,7 +113,6 @@
|
||||||
api.column(5).footer().innerHTML = totalPesanan + ' Item';
|
api.column(5).footer().innerHTML = totalPesanan + ' Item';
|
||||||
api.column(6).footer().innerHTML =
|
api.column(6).footer().innerHTML =
|
||||||
'Rp. ' + pageTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
'Rp. ' + pageTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||||
api.column(7).footer().innerHTML = diskonTotal + ' %';
|
|
||||||
api.column(8).footer().innerHTML =
|
api.column(8).footer().innerHTML =
|
||||||
'Rp. ' + totalAll.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
'Rp. ' + totalAll.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,100 +18,64 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<!-- Small boxes (Stat box) -->
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-4 col-6">
|
<div class="col-md-12">
|
||||||
<!-- small box -->
|
<div class="card" id="calculationPendapatan">
|
||||||
<div class="small-box bg-info">
|
<div class="card-header">
|
||||||
<div class="inner">
|
<h5 class="card-title">Laporan Pendapatan dan Pengeluaran</h5>
|
||||||
<h3>150</h3>
|
</div>
|
||||||
|
<!-- /.card-header -->
|
||||||
|
|
||||||
<p>New Orders</p>
|
<!-- ./card-body -->
|
||||||
|
<div class="card-footer">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3 col-6">
|
||||||
|
<div class="description-block border-right">
|
||||||
|
<span class="description-percentage" id="penjualanHaripercentageOfSalesGrowth">
|
||||||
|
</span>
|
||||||
|
<h5 class="description-header" id="penjualanHari"></h5>
|
||||||
|
<span class="description-text">Pendapatan Hari ini</span>
|
||||||
|
</div>
|
||||||
|
<!-- /.description-block -->
|
||||||
|
</div>
|
||||||
|
<!-- /.col -->
|
||||||
|
<div class="col-sm-3 col-6">
|
||||||
|
<div class="description-block border-right">
|
||||||
|
<span class="description-percentage" id="pengeluaranHaripercentageOfSalesGrowth">
|
||||||
|
</span>
|
||||||
|
<h5 class="description-header" id="pengeluaranHari"></h5>
|
||||||
|
<span class="description-text">Pengeluaran Hari ini</span>
|
||||||
|
</div>
|
||||||
|
<!-- /.description-block -->
|
||||||
|
</div>
|
||||||
|
<!-- /.col -->
|
||||||
|
<div class="col-sm-3 col-6">
|
||||||
|
<div class="description-block border-right">
|
||||||
|
<span class="description-percentage" id="penjualanBulanpercentageOfSalesGrowth">
|
||||||
|
</span>
|
||||||
|
<h5 class="description-header" id="penjualanBulan"></h5>
|
||||||
|
<span class="description-text">Pendapatan Bulan ini</span>
|
||||||
|
</div>
|
||||||
|
<!-- /.description-block -->
|
||||||
|
</div>
|
||||||
|
<!-- /.col -->
|
||||||
|
<div class="col-sm-3 col-6">
|
||||||
|
<div class="description-block">
|
||||||
|
<span class="description-percentage" id="pengeluaranBulanpercentageOfSalesGrowth">
|
||||||
|
</span>
|
||||||
|
<h5 class="description-header" id="pengeluaranBulan"></h5>
|
||||||
|
<span class="description-text">Pengeluaran Bulan ini</span>
|
||||||
|
</div>
|
||||||
|
<!-- /.description-block -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.row -->
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<!-- /.card-footer -->
|
||||||
<i class="ion ion-bag"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- /.card -->
|
||||||
</div>
|
</div>
|
||||||
<!-- ./col -->
|
<!-- /.col -->
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-success">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>53<sup style="font-size: 20px">%</sup></h3>
|
|
||||||
|
|
||||||
<p>Bounce Rate</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-stats-bars"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-warning">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>44</h3>
|
|
||||||
|
|
||||||
<p>User Registrations</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-person-add"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-danger">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>65</h3>
|
|
||||||
|
|
||||||
<p>Unique Visitors</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-pie-graph"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-danger">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>65</h3>
|
|
||||||
|
|
||||||
<p>Unique Visitors</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-pie-graph"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
|
|
||||||
<div class="col-lg-4 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-danger">
|
|
||||||
<div class="inner">
|
|
||||||
<h3>65</h3>
|
|
||||||
|
|
||||||
<p>Unique Visitors</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-pie-graph"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
|
|
||||||
|
@ -120,45 +84,6 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="card">
|
|
||||||
<div class="card-header border-0">
|
|
||||||
<div class="d-flex justify-content-between">
|
|
||||||
<h3 class="card-title">Online Store Visitors</h3>
|
|
||||||
<a href="javascript:void(0);">View Report</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="d-flex">
|
|
||||||
<p class="d-flex flex-column">
|
|
||||||
<span class="text-bold text-lg">820</span>
|
|
||||||
<span>Visitors Over Time</span>
|
|
||||||
</p>
|
|
||||||
<p class="ml-auto d-flex flex-column text-right">
|
|
||||||
<span class="text-success">
|
|
||||||
<i class="fas fa-arrow-up"></i> 12.5%
|
|
||||||
</span>
|
|
||||||
<span class="text-muted">Since last week</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- /.d-flex -->
|
|
||||||
|
|
||||||
<div class="position-relative mb-4">
|
|
||||||
<canvas id="visitors-chart" height="200"></canvas>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-flex flex-row justify-content-end">
|
|
||||||
<span class="mr-2">
|
|
||||||
<i class="fas fa-square text-primary"></i> This Week
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span>
|
|
||||||
<i class="fas fa-square text-gray"></i> Last Week
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /.card -->
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header border-0">
|
<div class="card-header border-0">
|
||||||
<h3 class="card-title">Menu Terlaris</h3>
|
<h3 class="card-title">Menu Terlaris</h3>
|
||||||
|
@ -172,98 +97,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body table-responsive p-0">
|
<div class="card-body table-responsive p-0">
|
||||||
<table class="table table-striped table-valign-middle">
|
<table class="table table-striped table-valign-middle" id="table-terlaris">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Product</th>
|
<th>No</th>
|
||||||
<th>Price</th>
|
<th>Menu</th>
|
||||||
<th>Sales</th>
|
<th>Harga</th>
|
||||||
<th>More</th>
|
<th>Terjual</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<img src="dist/img/default-150x150.png" alt="Product 1"
|
|
||||||
class="img-circle img-size-32 mr-2">
|
|
||||||
Some Product
|
|
||||||
</td>
|
|
||||||
<td>$13 USD</td>
|
|
||||||
<td>
|
|
||||||
<small class="text-success mr-1">
|
|
||||||
<i class="fas fa-arrow-up"></i>
|
|
||||||
12%
|
|
||||||
</small>
|
|
||||||
12,000 Sold
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="#" class="text-muted">
|
|
||||||
<i class="fas fa-search"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<img src="dist/img/default-150x150.png" alt="Product 1"
|
|
||||||
class="img-circle img-size-32 mr-2">
|
|
||||||
Another Product
|
|
||||||
</td>
|
|
||||||
<td>$29 USD</td>
|
|
||||||
<td>
|
|
||||||
<small class="text-warning mr-1">
|
|
||||||
<i class="fas fa-arrow-down"></i>
|
|
||||||
0.5%
|
|
||||||
</small>
|
|
||||||
123,234 Sold
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="#" class="text-muted">
|
|
||||||
<i class="fas fa-search"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<img src="dist/img/default-150x150.png" alt="Product 1"
|
|
||||||
class="img-circle img-size-32 mr-2">
|
|
||||||
Amazing Product
|
|
||||||
</td>
|
|
||||||
<td>$1,230 USD</td>
|
|
||||||
<td>
|
|
||||||
<small class="text-danger mr-1">
|
|
||||||
<i class="fas fa-arrow-down"></i>
|
|
||||||
3%
|
|
||||||
</small>
|
|
||||||
198 Sold
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="#" class="text-muted">
|
|
||||||
<i class="fas fa-search"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<img src="dist/img/default-150x150.png" alt="Product 1"
|
|
||||||
class="img-circle img-size-32 mr-2">
|
|
||||||
Perfect Item
|
|
||||||
<span class="badge bg-danger">NEW</span>
|
|
||||||
</td>
|
|
||||||
<td>$199 USD</td>
|
|
||||||
<td>
|
|
||||||
<small class="text-success mr-1">
|
|
||||||
<i class="fas fa-arrow-up"></i>
|
|
||||||
63%
|
|
||||||
</small>
|
|
||||||
87 Sold
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="#" class="text-muted">
|
|
||||||
<i class="fas fa-search"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -271,24 +113,25 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col-md-6 -->
|
<!-- /.col-md-6 -->
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
<!-- /.card -->
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header border-0">
|
<div class="card-header border-0">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<h3 class="card-title">Sales</h3>
|
<h3 class="card-title">Penjualan</h3>
|
||||||
<a href="javascript:void(0);">View Report</a>
|
<a href="javascript:void(0);">View Report</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<p class="d-flex flex-column">
|
<p class="d-flex flex-column">
|
||||||
<span class="text-bold text-lg">$18,230.00</span>
|
<span class="text-bold text-lg" id="penjualanSepanjangWaktu"></span>
|
||||||
<span>Sales Over Time</span>
|
<span>Penjualan Keseluruhan</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="ml-auto d-flex flex-column text-right">
|
<p class="ml-auto d-flex flex-column text-right">
|
||||||
<span class="text-success">
|
<span class="text-success" id="persentaseSepanjangWaktu">
|
||||||
<i class="fas fa-arrow-up"></i> 33.1%
|
<i class="fas fa-arrow-up"></i> 33.1%
|
||||||
</span>
|
</span>
|
||||||
<span class="text-muted">Since last month</span>
|
<span class="text-muted">dari bulan lalu</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.d-flex -->
|
<!-- /.d-flex -->
|
||||||
|
@ -299,68 +142,15 @@
|
||||||
|
|
||||||
<div class="d-flex flex-row justify-content-end">
|
<div class="d-flex flex-row justify-content-end">
|
||||||
<span class="mr-2">
|
<span class="mr-2">
|
||||||
<i class="fas fa-square text-primary"></i> This year
|
<i class="fas fa-square text-primary"></i> Bulan ini
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<i class="fas fa-square text-gray"></i> Last year
|
<i class="fas fa-square text-gray"></i> Bulan Kemarin
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.card -->
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header border-0">
|
|
||||||
<h3 class="card-title">Online Store Overview</h3>
|
|
||||||
<div class="card-tools">
|
|
||||||
<a href="#" class="btn btn-sm btn-tool">
|
|
||||||
<i class="fas fa-download"></i>
|
|
||||||
</a>
|
|
||||||
<a href="#" class="btn btn-sm btn-tool">
|
|
||||||
<i class="fas fa-bars"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="d-flex justify-content-between align-items-center border-bottom mb-3">
|
|
||||||
<p class="text-success text-xl">
|
|
||||||
<i class="ion ion-ios-refresh-empty"></i>
|
|
||||||
</p>
|
|
||||||
<p class="d-flex flex-column text-right">
|
|
||||||
<span class="font-weight-bold">
|
|
||||||
<i class="ion ion-android-arrow-up text-success"></i> 12%
|
|
||||||
</span>
|
|
||||||
<span class="text-muted">CONVERSION RATE</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- /.d-flex -->
|
|
||||||
<div class="d-flex justify-content-between align-items-center border-bottom mb-3">
|
|
||||||
<p class="text-warning text-xl">
|
|
||||||
<i class="ion ion-ios-cart-outline"></i>
|
|
||||||
</p>
|
|
||||||
<p class="d-flex flex-column text-right">
|
|
||||||
<span class="font-weight-bold">
|
|
||||||
<i class="ion ion-android-arrow-up text-warning"></i> 0.8%
|
|
||||||
</span>
|
|
||||||
<span class="text-muted">SALES RATE</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- /.d-flex -->
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-0">
|
|
||||||
<p class="text-danger text-xl">
|
|
||||||
<i class="ion ion-ios-people-outline"></i>
|
|
||||||
</p>
|
|
||||||
<p class="d-flex flex-column text-right">
|
|
||||||
<span class="font-weight-bold">
|
|
||||||
<i class="ion ion-android-arrow-down text-danger"></i> 1%
|
|
||||||
</span>
|
|
||||||
<span class="text-muted">REGISTRATION RATE</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- /.d-flex -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col-md-6 -->
|
<!-- /.col-md-6 -->
|
||||||
</div>
|
</div>
|
||||||
|
@ -371,8 +161,16 @@
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('styles')
|
||||||
|
<link rel="stylesheet" href="{{ asset('assets/datatables/datatables.min.css') }} ">
|
||||||
|
@endpush
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script src="{{ asset('assets/datatables/datatables.min.js') }}"></script>
|
||||||
|
<!-- ChartJS -->
|
||||||
|
<script src="{{ asset('assets/plugins/chart.js/Chart.min.js') }}"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
@ -384,137 +182,184 @@
|
||||||
var mode = 'index'
|
var mode = 'index'
|
||||||
var intersect = true
|
var intersect = true
|
||||||
|
|
||||||
var $salesChart = $('#sales-chart')
|
$.ajax({
|
||||||
// eslint-disable-next-line no-unused-vars
|
url: "{{ route('dashboard.getChart') }}",
|
||||||
var salesChart = new Chart($salesChart, {
|
type: "GET",
|
||||||
type: 'bar',
|
cache: false,
|
||||||
data: {
|
async: false,
|
||||||
labels: ['JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],
|
success: function(response) {
|
||||||
datasets: [{
|
var data = response.data;
|
||||||
backgroundColor: '#007bff',
|
console.log(data);
|
||||||
borderColor: '#007bff',
|
$('#penjualanSepanjangWaktu').append(converRp(data.allPenjualan));
|
||||||
data: [1000, 2000, 3000, 2500, 2700, 2500, 3000]
|
var $salesChart = $('#sales-chart')
|
||||||
},
|
var salesChart = new Chart($salesChart, {
|
||||||
{
|
type: 'bar',
|
||||||
backgroundColor: '#ced4da',
|
data: {
|
||||||
borderColor: '#ced4da',
|
labels: Object.keys(data.weekThisMonth),
|
||||||
data: [700, 1700, 2700, 2000, 1800, 1500, 2000]
|
datasets: [{
|
||||||
}
|
backgroundColor: '#007bff',
|
||||||
]
|
borderColor: '#007bff',
|
||||||
},
|
data: Object.values(data.weekThisMonth)
|
||||||
options: {
|
},
|
||||||
maintainAspectRatio: false,
|
{
|
||||||
tooltips: {
|
backgroundColor: '#ced4da',
|
||||||
mode: mode,
|
borderColor: '#ced4da',
|
||||||
intersect: intersect
|
data: Object.values(data.weekLastMonth)
|
||||||
},
|
|
||||||
hover: {
|
|
||||||
mode: mode,
|
|
||||||
intersect: intersect
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
// display: false,
|
|
||||||
gridLines: {
|
|
||||||
display: true,
|
|
||||||
lineWidth: '4px',
|
|
||||||
color: 'rgba(0, 0, 0, .2)',
|
|
||||||
zeroLineColor: 'transparent'
|
|
||||||
},
|
|
||||||
ticks: $.extend({
|
|
||||||
beginAtZero: true,
|
|
||||||
|
|
||||||
// Include a dollar sign in the ticks
|
|
||||||
callback: function(value) {
|
|
||||||
if (value >= 1000) {
|
|
||||||
value /= 1000
|
|
||||||
value += 'k'
|
|
||||||
}
|
|
||||||
|
|
||||||
return '$' + value
|
|
||||||
}
|
}
|
||||||
}, ticksStyle)
|
]
|
||||||
}],
|
|
||||||
xAxes: [{
|
|
||||||
display: true,
|
|
||||||
gridLines: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
ticks: ticksStyle
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
var $visitorsChart = $('#visitors-chart')
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
var visitorsChart = new Chart($visitorsChart, {
|
|
||||||
data: {
|
|
||||||
labels: ['18th', '20th', '22nd', '24th', '26th', '28th', '30th'],
|
|
||||||
datasets: [{
|
|
||||||
type: 'line',
|
|
||||||
data: [100, 120, 170, 167, 180, 177, 160],
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
borderColor: '#007bff',
|
|
||||||
pointBorderColor: '#007bff',
|
|
||||||
pointBackgroundColor: '#007bff',
|
|
||||||
fill: false
|
|
||||||
// pointHoverBackgroundColor: '#007bff',
|
|
||||||
// pointHoverBorderColor : '#007bff'
|
|
||||||
},
|
},
|
||||||
{
|
options: {
|
||||||
type: 'line',
|
maintainAspectRatio: false,
|
||||||
data: [60, 80, 70, 67, 80, 77, 100],
|
tooltips: {
|
||||||
backgroundColor: 'tansparent',
|
mode: mode,
|
||||||
borderColor: '#ced4da',
|
intersect: intersect
|
||||||
pointBorderColor: '#ced4da',
|
|
||||||
pointBackgroundColor: '#ced4da',
|
|
||||||
fill: false
|
|
||||||
// pointHoverBackgroundColor: '#ced4da',
|
|
||||||
// pointHoverBorderColor : '#ced4da'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
tooltips: {
|
|
||||||
mode: mode,
|
|
||||||
intersect: intersect
|
|
||||||
},
|
|
||||||
hover: {
|
|
||||||
mode: mode,
|
|
||||||
intersect: intersect
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
yAxes: [{
|
|
||||||
// display: false,
|
|
||||||
gridLines: {
|
|
||||||
display: true,
|
|
||||||
lineWidth: '4px',
|
|
||||||
color: 'rgba(0, 0, 0, .2)',
|
|
||||||
zeroLineColor: 'transparent'
|
|
||||||
},
|
},
|
||||||
ticks: $.extend({
|
hover: {
|
||||||
beginAtZero: true,
|
mode: mode,
|
||||||
suggestedMax: 200
|
intersect: intersect
|
||||||
}, ticksStyle)
|
},
|
||||||
}],
|
legend: {
|
||||||
xAxes: [{
|
|
||||||
display: true,
|
|
||||||
gridLines: {
|
|
||||||
display: false
|
display: false
|
||||||
},
|
},
|
||||||
ticks: ticksStyle
|
scales: {
|
||||||
}]
|
yAxes: [{
|
||||||
}
|
// display: false,
|
||||||
|
gridLines: {
|
||||||
|
display: true,
|
||||||
|
lineWidth: '4px',
|
||||||
|
color: 'rgba(0, 0, 0, .2)',
|
||||||
|
zeroLineColor: 'transparent'
|
||||||
|
},
|
||||||
|
ticks: $.extend({
|
||||||
|
beginAtZero: true,
|
||||||
|
// Include a dollar sign in the ticks
|
||||||
|
callback: function(value, index,
|
||||||
|
values) {
|
||||||
|
return converRp(value)
|
||||||
|
}
|
||||||
|
}, ticksStyle)
|
||||||
|
}],
|
||||||
|
xAxes: [{
|
||||||
|
display: true,
|
||||||
|
gridLines: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
ticks: ticksStyle
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
error: function(response) {
|
||||||
|
console.log(response);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#table-terlaris').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
searching: false,
|
||||||
|
"bLengthChange": false,
|
||||||
|
"bFilter": true,
|
||||||
|
"bInfo": false,
|
||||||
|
ajax: "{{ route('dashboard.menuTerlaris') }}",
|
||||||
|
columns: [{
|
||||||
|
data: 'DT_RowIndex',
|
||||||
|
name: 'DT_RowIndex',
|
||||||
|
className: 'text-center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'nama_produk',
|
||||||
|
name: 'nama_produk'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'harga_produk',
|
||||||
|
name: 'harga_produk',
|
||||||
|
'render': function(data, type, full, meta) {
|
||||||
|
// change to IDR
|
||||||
|
return 'Rp. ' + data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
||||||
|
},
|
||||||
|
className: 'text-right'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'jumlah_produk_terjual',
|
||||||
|
name: 'jumlah_produk_terjual'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
getCalculationPendapatan();
|
||||||
|
})
|
||||||
|
|
||||||
|
function getCalculationPendapatan() {
|
||||||
|
$.ajax({
|
||||||
|
url: "{{ route('dashboard.getCalculationPendapatan') }}",
|
||||||
|
type: "GET",
|
||||||
|
cache: false,
|
||||||
|
async: false,
|
||||||
|
success: function(response) {
|
||||||
|
var data = response.data;
|
||||||
|
changeDataFromCalculate('penjualanBulan', data.pendapatanBulan
|
||||||
|
.penjualanSatuBulan, data.pendapatanBulan.percentageOfSalesGrowth,
|
||||||
|
data.pendapatanBulan.statusCalculation)
|
||||||
|
changeDataFromCalculate('penjualanHari', data.pendapatanHari
|
||||||
|
.penjualanHariIni, data.pendapatanHari.percentageOfSalesGrowth,
|
||||||
|
data.pendapatanHari.statusCalculation)
|
||||||
|
changeDataFromCalculate('pengeluaranBulan', data.pengeluaranBulan
|
||||||
|
.pengeluaranSatuBulan, data.pengeluaranBulan.percentageOfSalesGrowth,
|
||||||
|
data.pengeluaranBulan.statusCalculation)
|
||||||
|
changeDataFromCalculate('pengeluaranHari', data.pengeluaranHari
|
||||||
|
.pengeluaranHariIni, data.pengeluaranHari.percentageOfSalesGrowth,
|
||||||
|
data.pengeluaranHari.statusCalculation)
|
||||||
|
},
|
||||||
|
error: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeDataFromCalculate(id, penjualanSatuBulan, percentageOfSalesGrowth, statusCalculation) {
|
||||||
|
// change to IDR
|
||||||
|
if (penjualanSatuBulan == null) {
|
||||||
|
penjualanSatuBulan = 0;
|
||||||
|
} else {
|
||||||
|
penjualanSatuBulan;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#' + id).append(converRp(penjualanSatuBulan));
|
||||||
|
|
||||||
|
// pembulatan 2 angka di belakang koma
|
||||||
|
percentageOfSalesGrowth = percentageOfSalesGrowth.toFixed(2);
|
||||||
|
switch (statusCalculation) {
|
||||||
|
case 1:
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').append('<i class="fas fa-caret-left"></i> ' +
|
||||||
|
percentageOfSalesGrowth + '%')
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').addClass('text-warning')
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').append('<i class="fas fa-caret-up"></i> ' +
|
||||||
|
percentageOfSalesGrowth + '%')
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').addClass('text-success')
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').append('<i class="fas fa-caret-down"></i> ' +
|
||||||
|
percentageOfSalesGrowth + '%')
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').addClass('text-danger')
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').append('<i class="fas fa-caret-left"></i> ' +
|
||||||
|
percentageOfSalesGrowth + '%')
|
||||||
|
$('#' + id + 'percentageOfSalesGrowth').addClass('text-warning')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function converRp(params) {
|
||||||
|
return ('Rp. ' + params.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.') ?? 0);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
|
@ -0,0 +1,126 @@
|
||||||
|
@extends('layouts.base')
|
||||||
|
|
||||||
|
@section('content-header')
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="container" style="display: contents">
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h1 class="m-0"> Pengeluaran</h1>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<ol class="breadcrumb float-sm-right">
|
||||||
|
<li class="breadcrumb-item">Home</li>
|
||||||
|
<li class="breadcrumb-item">Transaksi</li>
|
||||||
|
<li class="breadcrumb-item active">Pengeluaran</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="content__boxed">
|
||||||
|
<div class="content__wrap">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 mt-2">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h5>Form Input Data</h5>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 mt-3">
|
||||||
|
<label>Tanggal</label>
|
||||||
|
<input type="date" class="form-control" id="tanggal" value="{{ date('Y-m-d') }}">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 mt-3">
|
||||||
|
<label>Jenis Transaksi</label>
|
||||||
|
<select class="form-control" id="jenis_transaksi">
|
||||||
|
<option value="" selected>--Pilih Jenis Transkasi--</option>
|
||||||
|
<option value="1">Tunai</option>
|
||||||
|
<option value="2">Transfer</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 mt-3">
|
||||||
|
<label>Rekening Coa Kebutuhan</label>
|
||||||
|
<select class="form-control" id="rekening_coa_kebutuhan">
|
||||||
|
<option value="" selected>--Pilih Rekening Coa--</option>
|
||||||
|
@foreach ($coaBiaya as $biaya)
|
||||||
|
@if ($biaya->status == 0)
|
||||||
|
<optgroup label="{{ $biaya->coa }} | {{ $biaya->keterangan_coa }}">
|
||||||
|
@else
|
||||||
|
<option
|
||||||
|
value="{{ $biaya->id }}|{{ $biaya->coa }}|{{ $biaya->keterangan_coa }}">
|
||||||
|
{{ $biaya->coa }} | {{ $biaya->keterangan_coa }}</option>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 mt-3">
|
||||||
|
<label>Nominal</label>
|
||||||
|
<input type="number" min="0" class="form-control" id="nominal" placeholder="Nominal Pengeluaran">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 mt-3">
|
||||||
|
<label>Keterangan</label>
|
||||||
|
<textarea class="form-control" id="keterangan" placeholder="Keterangan"></textarea>
|
||||||
|
</div>
|
||||||
|
<div hidden class="transfer col-6 mt-3">
|
||||||
|
<label class="form-label">Rekening Coa Jenis Transaksi</label>
|
||||||
|
<select class="form-control" id="rekening_coa_transfer">
|
||||||
|
<option selected disabled>--Pilih Rekening Coa--</option>
|
||||||
|
@foreach ($rekeningCoaTf as $coaTf)
|
||||||
|
@if ($coaTf->status == 0)
|
||||||
|
<optgroup label="{{ $coaTf->coa }} | {{ $coaTf->keterangan_coa }}">
|
||||||
|
@else
|
||||||
|
<option value="{{ $biaya->id }}|{{ $coaTf->coa }}|{{ $coaTf->keterangan_coa }}">
|
||||||
|
{{ $coaTf->coa }} | {{ $coaTf->keterangan_coa }}</option>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<a href="javascript:void(0)" class="btn btn-warning" id="simpan_pengeluaran">Simpan Data</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 mt-2">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<form action="{{ route('pengeluaran.laporan') }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h5>Form Laporan</h5>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 mt-3">
|
||||||
|
<label>Dari Tanggal</label>
|
||||||
|
<input type="date" class="form-control" name="filter_tanggal_1" value="{{ date('Y-m-d') }}">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 mt-3">
|
||||||
|
<label>Sampai Tanggal</label>
|
||||||
|
<input type="date" class="form-control" name="filter_tanggal_2" value="{{ date('Y-m-d') }}">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 mt-5">
|
||||||
|
<button type="submit" class="btn btn-warning" id="filter_laporan">Preview</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@include('pages.admin.pengeluaran.js')
|
|
@ -0,0 +1,92 @@
|
||||||
|
@push('scripts')
|
||||||
|
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready( function () {
|
||||||
|
$('#jenis_transaksi').on('change', function(){
|
||||||
|
if ($("#jenis_transaksi").val() == "1") {
|
||||||
|
$(".transfer").prop('hidden', true)
|
||||||
|
}else if($("#jenis_transaksi").val() == "2"){
|
||||||
|
$(".transfer").prop('hidden', false)
|
||||||
|
}else{
|
||||||
|
$(".transfer").prop('hidden', true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#simpan_pengeluaran').on('click', function() {
|
||||||
|
// Jika jenis transaksi tunai
|
||||||
|
if($("#jenis_transaksi").val() == "1"){
|
||||||
|
let rekening_coa_kebutuhan = $("#rekening_coa_kebutuhan").val()
|
||||||
|
let split_rekening_coa_kebutuhan = rekening_coa_kebutuhan.split("|")
|
||||||
|
let id_rekening_coa = split_rekening_coa_kebutuhan[0]
|
||||||
|
let kode_coa = split_rekening_coa_kebutuhan[1]
|
||||||
|
let keterangan_coa = split_rekening_coa_kebutuhan[2]
|
||||||
|
let dataTunai = {
|
||||||
|
tanggal : $("#tanggal").val(),
|
||||||
|
jenis_transaksi : $("#jenis_transaksi").val(),
|
||||||
|
nominal : $("#nominal").val(),
|
||||||
|
keterangan : $("#keterangan").val(),
|
||||||
|
id_rekening_coa : id_rekening_coa,
|
||||||
|
kode_coa : kode_coa,
|
||||||
|
keterangan_coa : keterangan_coa,
|
||||||
|
}
|
||||||
|
// return console.log(dataTunai);
|
||||||
|
$.ajax({
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
url: "{{ route('pengeluaran.simpan') }}",
|
||||||
|
data: dataTunai,
|
||||||
|
success: function(result) {
|
||||||
|
if (result) {
|
||||||
|
alert(result.message)
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let rekening_coa_kebutuhan = $("#rekening_coa_kebutuhan").val()
|
||||||
|
let split_rekening_coa_kebutuhan = rekening_coa_kebutuhan.split("|")
|
||||||
|
let id_rekening_coa = split_rekening_coa_kebutuhan[0]
|
||||||
|
let kode_coa = split_rekening_coa_kebutuhan[1]
|
||||||
|
let keterangan_coa = split_rekening_coa_kebutuhan[2]
|
||||||
|
let rekening_coa_transfer = $("#rekening_coa_transfer").val()
|
||||||
|
let split_rekening_coa_transfer = rekening_coa_transfer.split("|")
|
||||||
|
let id_rekening_coa_transfer = split_rekening_coa_transfer[0]
|
||||||
|
let kode_coa_transfer = split_rekening_coa_transfer[1]
|
||||||
|
let keterangan_coa_transfer = split_rekening_coa_transfer[2]
|
||||||
|
let dataTranfer = {
|
||||||
|
tanggal : $("#tanggal").val(),
|
||||||
|
jenis_transaksi : $("#jenis_transaksi").val(),
|
||||||
|
nominal : $("#nominal").val(),
|
||||||
|
keterangan : $("#keterangan").val(),
|
||||||
|
id_rekening_coa : id_rekening_coa,
|
||||||
|
kode_coa : kode_coa,
|
||||||
|
keterangan_coa : keterangan_coa,
|
||||||
|
id_rekening_coa_transfer : id_rekening_coa_transfer,
|
||||||
|
kode_coa_transfer : kode_coa_transfer,
|
||||||
|
keterangan_coa_transfer : keterangan_coa_transfer,
|
||||||
|
}
|
||||||
|
// return console.log(dataTranfer);
|
||||||
|
$.ajax({
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
url: "{{ route('pengeluaran.simpan') }}",
|
||||||
|
data: dataTranfer,
|
||||||
|
success: function(result) {
|
||||||
|
if (result) {
|
||||||
|
alert(result.message)
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
@endpush
|
|
@ -0,0 +1,55 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Laporan Pengeluaran</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table style="width: 100%;">
|
||||||
|
<tr>
|
||||||
|
<td>Tanggal Unduh: {{ date('d-m-Y H:i:s') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Dicetak Oleh: {{ Session::get('name') }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<hr>
|
||||||
|
<table style="width: 100%;">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center; font-size: 20px; font-weight: bold;">Laporan Pengeluaran</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center;">Pencarian: {{ 'Antara Tanggal '.toDmy($filter_tanggal_1).' s/d Tanggal '.toDmy($filter_tanggal_2).'' }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<br>
|
||||||
|
<table style="width: 100%; border-collapse:collapse; border:1px solid black;">
|
||||||
|
<thead style="border-collapse:collapse; border:1px solid black;">
|
||||||
|
<tr style="border-collapse:collapse; border:1px solid black;">
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">No</th>
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">Faktur</th>
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">Tanggal</th>
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">Jenis Transaksi</th>
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">Nominal</th>
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">Keterangan</th>
|
||||||
|
<th style="border-collapse:collapse; border:1px solid black;">User</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody style="border-collapse:collapse; border:1px solid black;">
|
||||||
|
@foreach ($data as $key => $val)
|
||||||
|
<tr>
|
||||||
|
<td style="text-align: center; border-collapse:collapse; border:1px solid black;">{{ $key+1 }}</td>
|
||||||
|
<td style="border-collapse:collapse; border:1px solid black;">{{ $val->faktur }}</td>
|
||||||
|
<td style="text-align:center; border-collapse:collapse; border:1px solid black;">{{ toDmy($val->tanggal) }}</td>
|
||||||
|
<td style="text-align:center; border-collapse:collapse; border:1px solid black;">{{ $val->jenis_transaksi == "1" ? "Tunai" : "Transfer" }}</td>
|
||||||
|
<td style="text-align: left; border-collapse:collapse; border:1px solid black;">Rp {{ format_uang($val->nominal) }}</td>
|
||||||
|
<td style="border-collapse:collapse; border:1px solid black;">{{ $val->keterangan }}</td>
|
||||||
|
<td style="text-align:center; border-collapse:collapse; border:1px solid black;">{{ $val->user->name }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -216,6 +216,7 @@
|
||||||
@push('styles')
|
@push('styles')
|
||||||
<!-- Toastr -->
|
<!-- Toastr -->
|
||||||
<link rel="stylesheet" href="{{ asset('assets/plugins/toastr/toastr.min.css') }}">
|
<link rel="stylesheet" href="{{ asset('assets/plugins/toastr/toastr.min.css') }}">
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ asset('assets/datatables/datatables.min.css') }}">
|
<link rel="stylesheet" href="{{ asset('assets/datatables/datatables.min.css') }}">
|
||||||
|
|
||||||
<!-- Select2 -->
|
<!-- Select2 -->
|
||||||
|
@ -227,6 +228,7 @@
|
||||||
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
||||||
<!-- Select2 -->
|
<!-- Select2 -->
|
||||||
<script src="{{ asset('assets/plugins/select2/js/select2.full.min.js') }}"></script>
|
<script src="{{ asset('assets/plugins/select2/js/select2.full.min.js') }}"></script>
|
||||||
|
|
||||||
<script src="{{ asset('assets/datatables/datatables.min.js') }}"></script>
|
<script src="{{ asset('assets/datatables/datatables.min.js') }}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Http\Controllers\Admins\DashboardController;
|
use App\Http\Controllers\Admins\DashboardController;
|
||||||
|
use App\Http\Controllers\Admins\Pengeluaran\PengeluaranController;
|
||||||
use App\Http\Controllers\Admins\Users\RoleController;
|
use App\Http\Controllers\Admins\Users\RoleController;
|
||||||
use App\Http\Controllers\Admins\Users\UserController;
|
use App\Http\Controllers\Admins\Users\UserController;
|
||||||
use App\Http\Controllers\Auths\AuthController;
|
use App\Http\Controllers\Auths\AuthController;
|
||||||
|
@ -60,7 +61,13 @@ Route::group(['middleware' => ['auth', 'permission']], function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Dashboard
|
// Dashboard
|
||||||
Route::get('dashboard', [DashboardController::class, 'index'])->name('dashboard.index')->comment('Halaman Dashboard');
|
Route::group(['prefix' => 'dashboard'], function () {
|
||||||
|
Route::get('/', [DashboardController::class, 'index'])->name('dashboard.index')->comment('Halaman Dashboard');
|
||||||
|
Route::get('/menuTerlaris', [DashboardController::class, 'menuTerlaris'])->name('dashboard.menuTerlaris')->comment("Ambil data Menu Terlaris");
|
||||||
|
Route::get('/getCalculationPendapatan', [DashboardController::class, 'getCalculationPendapatan'])->name('dashboard.getCalculationPendapatan')->comment("Ambil data Total Penjualan");
|
||||||
|
Route::get('/getChart', [DashboardController::class, 'getChart'])->name('dashboard.getChart')->comment("Ambil data Total Penjualan");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Profile
|
// Profile
|
||||||
// Route::get('profile', [ProfileController::class, 'index'])->name('profile.index')->comment('Halaman Profile');
|
// Route::get('profile', [ProfileController::class, 'index'])->name('profile.index')->comment('Halaman Profile');
|
||||||
|
@ -98,4 +105,11 @@ Route::group(['middleware' => ['auth', 'permission']], function () {
|
||||||
Route::delete('/delete/{id}', [LaporanController::class, 'destroy'])->name('laporan.delete')->comment('Menghapus Laporan');
|
Route::delete('/delete/{id}', [LaporanController::class, 'destroy'])->name('laporan.delete')->comment('Menghapus Laporan');
|
||||||
Route::get('/refresh-routes', [LaporanController::class, 'refreshRoutes'])->name('laporan.refresh-routes')->comment('Refresh Permission Routes');
|
Route::get('/refresh-routes', [LaporanController::class, 'refreshRoutes'])->name('laporan.refresh-routes')->comment('Refresh Permission Routes');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Pengeluaran
|
||||||
|
Route::group(['prefix' => 'pengeluaran'], function () {
|
||||||
|
Route::get('/', [PengeluaranController::class, 'index'])->name('pengeluaran.index')->comment('Halaman Pengeluaran');
|
||||||
|
Route::post('/simpan', [PengeluaranController::class, 'simpan'])->name('pengeluaran.simpan')->comment('Halaman Simpan Pengeluaran');
|
||||||
|
Route::post('/laporan', [PengeluaranController::class, 'laporan'])->name('pengeluaran.laporan')->comment('Halaman Laporan');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue