From 724212f7140cfe1235ada5951ec56a0483b230fc Mon Sep 17 00:00:00 2001 From: ajikamaludin Date: Sun, 24 Jul 2022 22:01:11 +0700 Subject: [PATCH] done next login --- app/Http/Controllers/GeneralController.php | 10 + package-lock.json | 51 ++++ package.json | 1 + resources/css/app.css | 14 + resources/js/Components/Modal.jsx | 5 +- resources/js/Layouts/Authenticated.jsx | 29 +- resources/js/Pages/Absensi/FormModal.jsx | 2 +- resources/js/Pages/Absensi/Index.jsx | 81 +++++- resources/js/Pages/Gaji/FormModal.jsx | 129 +++++++++ resources/js/Pages/Gaji/Index.jsx | 265 ++++++++++++++++++ resources/js/Pages/Gaji/Slip.jsx | 195 +++++++++++++ resources/js/Pages/Jabatan/Index.jsx | 4 +- .../js/Pages/SettingPotongGaji/Index.jsx | 3 +- resources/js/Services/DataGaji.js | 56 ++++ resources/js/Services/Gaji.js | 33 --- resources/js/Services/Karyawan.js | 1 - resources/js/Services/SettingPotonganGaji.js | 1 - routes/web.php | 2 + 18 files changed, 831 insertions(+), 51 deletions(-) create mode 100644 resources/js/Pages/Gaji/FormModal.jsx create mode 100644 resources/js/Pages/Gaji/Index.jsx create mode 100644 resources/js/Pages/Gaji/Slip.jsx create mode 100644 resources/js/Services/DataGaji.js delete mode 100644 resources/js/Services/Gaji.js diff --git a/app/Http/Controllers/GeneralController.php b/app/Http/Controllers/GeneralController.php index 8f6276b..b762872 100644 --- a/app/Http/Controllers/GeneralController.php +++ b/app/Http/Controllers/GeneralController.php @@ -31,4 +31,14 @@ class GeneralController extends Controller { return Inertia::render('SettingPotongGaji/Index'); } + + public function dataGaji() + { + return Inertia::render('Gaji/Index'); + } + + public function slipGaji() + { + return Inertia::render('Gaji/Slip'); + } } diff --git a/package-lock.json b/package-lock.json index e7f69e6..c0ed876 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,7 @@ "": { "dependencies": { "firebase": "^9.9.1", + "react-to-print": "^2.14.7", "react-toastify": "^9.0.7" }, "devDependencies": { @@ -2919,6 +2920,16 @@ "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.3.tgz", "integrity": "sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==" }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, "node_modules/protobufjs": { "version": "6.11.3", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", @@ -3016,6 +3027,11 @@ "react": "17.0.2" } }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/react-refresh": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", @@ -3025,6 +3041,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-to-print": { + "version": "2.14.7", + "resolved": "https://registry.npmjs.org/react-to-print/-/react-to-print-2.14.7.tgz", + "integrity": "sha512-lWVVAs9Co25uyE0toxcWeFsmaZObwUozXrJD9WMpDPclpBgk+WIzxlt3Q3omL/BCBG/cpf0XNvhayUWa+99YGw==", + "dependencies": { + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-toastify": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.0.7.tgz", @@ -5702,6 +5730,16 @@ "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.3.tgz", "integrity": "sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==" }, + "prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, "protobufjs": { "version": "6.11.3", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", @@ -5762,12 +5800,25 @@ "scheduler": "^0.20.2" } }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "react-refresh": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", "dev": true }, + "react-to-print": { + "version": "2.14.7", + "resolved": "https://registry.npmjs.org/react-to-print/-/react-to-print-2.14.7.tgz", + "integrity": "sha512-lWVVAs9Co25uyE0toxcWeFsmaZObwUozXrJD9WMpDPclpBgk+WIzxlt3Q3omL/BCBG/cpf0XNvhayUWa+99YGw==", + "requires": { + "prop-types": "^15.8.1" + } + }, "react-toastify": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.0.7.tgz", diff --git a/package.json b/package.json index 1b90daa..cc8b5a0 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ }, "dependencies": { "firebase": "^9.9.1", + "react-to-print": "^2.14.7", "react-toastify": "^9.0.7" } } diff --git a/resources/css/app.css b/resources/css/app.css index 4a69c71..f4d5788 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -4,4 +4,18 @@ .select { @apply border mt-1 border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-28 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 +} + +.print-only{ + display: none; +} + +@media print { + .no-print { + display: none; + } + + .print-only{ + display: block; + } } \ No newline at end of file diff --git a/resources/js/Components/Modal.jsx b/resources/js/Components/Modal.jsx index a904acb..7e9c595 100644 --- a/resources/js/Components/Modal.jsx +++ b/resources/js/Components/Modal.jsx @@ -1,13 +1,14 @@ import React from 'react' -export function Modal({ isOpen, toggleModal = () => {}, children, size = 'lg' }) { +export function Modal({ isOpen, toggleModal = () => {}, children, size = "md" }) { + return (
-
+
@@ -136,18 +154,13 @@ export default function Authenticated({ auth, children }) {
  • - + Data Gaji
  • - - Cetak Laporan Gaji - -
  • -
  • - - Cetak Laporan Presensi + + Slip Gaji
  • diff --git a/resources/js/Pages/Absensi/FormModal.jsx b/resources/js/Pages/Absensi/FormModal.jsx index f0b4780..4679eaf 100644 --- a/resources/js/Pages/Absensi/FormModal.jsx +++ b/resources/js/Pages/Absensi/FormModal.jsx @@ -59,7 +59,7 @@ export default function FormModal({ modalState, periode }) { } return ( - +
    Absensi Karyawan
    Periode : {periode}
    diff --git a/resources/js/Pages/Absensi/Index.jsx b/resources/js/Pages/Absensi/Index.jsx index 6daa4d7..b165365 100644 --- a/resources/js/Pages/Absensi/Index.jsx +++ b/resources/js/Pages/Absensi/Index.jsx @@ -1,15 +1,88 @@ -import React, { useEffect, useState } from 'react'; +import React, { useRef, useState } from 'react'; import Authenticated from '@/Layouts/Authenticated'; import { Head, useForm } from '@inertiajs/inertia-react'; import { useModalState } from '@/Hooks' import Button from '@/Components/Button'; import FormModal from './FormModal'; +import { useReactToPrint } from 'react-to-print'; import { getByPeriode } from '@/Services/Absensi'; import { toast } from 'react-toastify'; +const ComponentToPrint = React.forwardRef(({ absensi, month, year }, ref) => { + const date = new Date() + return ( +
    +
    +

    Koro Koro Family Karaoke

    +

    Periode Absen Bulan {month} Tahun {year}

    +
    + + + + + + + + + + + + + + {absensi.data?.users?.map(item => ( + + + + + + + + + + ))} + +
    + NIK + + Nama + + Jenis Kelamin + + Jabatan + HadirSakitAlfa
    + {item.nik} + + {item.name} + + {item.jenisKelamin} + + {item.jabatan} + + {item.hadir} + + {item.sakit} + + {item.alfa} +
    +
    +
    +

    Pekanbaru, {date.getDate()}-{date.getMonth()}-{date.getFullYear()}

    +

    Finance

    +
    +
    +
    +
    + ) +}) + export default function Karyawan(props) { const formModal = useModalState(false) + const componentRef = useRef(); + const handlePrint = useReactToPrint({ + content: () => componentRef.current, + }); + const month = (new Date()).getMonth() const year = (new Date()).getFullYear() const months = [1,2,3,4,5,6,7,8,9,10,11,12] @@ -125,6 +198,12 @@ export default function Karyawan(props) { ))} + + {absensi.data?.users?.length > 0 && ( +
    + +
    + )}
    diff --git a/resources/js/Pages/Gaji/FormModal.jsx b/resources/js/Pages/Gaji/FormModal.jsx new file mode 100644 index 0000000..4679eaf --- /dev/null +++ b/resources/js/Pages/Gaji/FormModal.jsx @@ -0,0 +1,129 @@ +import React, { useEffect, useState } from 'react' +import { toast } from 'react-toastify' +import { Modal } from '@/Components/Modal' +import { useForm } from '@inertiajs/inertia-react' +import Button from '@/Components/Button' +import Input from '@/Components/Input' +import { getAll } from '@/Services/Karyawan' +import { create } from '@/Services/Absensi' + +export default function FormModal({ modalState, periode }) { + const [loading, setLoading] = useState(false) + const { data, setData, reset } = useForm({ + users: [] + }) + + useEffect(() => { + getAll() + .then(items => setData({ + users: items.filter(item => item.data.jabatan.id != "1").map(item => { + return { + id: item.id, + name: item.data.name, + nik: item.data.nik, + jenisKelamin: item.data.jenisKelamin, + jabatan: item.data.jabatan.nama, + jabatan_id: item.data.jabatan.id, + hadir: 0, + sakit: 0, + alfa: 0, + } + }) + })) + },[modalState]) + + const onHandleChange = (item, event) => { + setData({ + users: data.users.map(user => { + if (user.id == item.id) { + user[event.target.name] = event.target.value + } + return user + }) + }) + } + + const submit = (e) => { + e.preventDefault() + setLoading(true) + create({ + ...data, + periode: periode, + }) + .then(() => { + reset() + modalState.toggle() + toast.success("berhasil menambahkan absensi") + }) + .finally(() => setLoading(false)) + } + + return ( + +
    Absensi Karyawan
    +
    Periode : {periode}
    +
    + + + + + + + + + + + + + + {data.users.map(item => ( + + + + + + + + + + ))} + +
    + NIK + + Nama + + Jenis Kelamin + + Jabatan + HadirSakitAlfa
    + {item.nik} + + {item.name} + + {item.jenisKelamin} + + {item.jabatan} + + onHandleChange(item, e)}/> + + onHandleChange(item, e)}/> + + onHandleChange(item, e)}/> +
    +
    + +
    + ) +} \ No newline at end of file diff --git a/resources/js/Pages/Gaji/Index.jsx b/resources/js/Pages/Gaji/Index.jsx new file mode 100644 index 0000000..931413d --- /dev/null +++ b/resources/js/Pages/Gaji/Index.jsx @@ -0,0 +1,265 @@ +import React, { useRef, useState } from 'react'; +import Authenticated from '@/Layouts/Authenticated'; +import { Head, useForm } from '@inertiajs/inertia-react'; +import { useModalState } from '@/Hooks' +import Button from '@/Components/Button'; +import FormModal from './FormModal'; +import { getDataGaji } from '@/Services/DataGaji'; +import { useReactToPrint } from 'react-to-print'; +import { formatIDR } from '@/Utils'; + +const ComponentToPrint = React.forwardRef(({ items, month, year }, ref) => { + const date = new Date() + return ( +
    +
    +

    Koro Koro Family Karaoke

    +

    Periode Gaji Bulan {month} Tahun {year}

    +
    + + + + + + + + + + + + + + + + + + {items.map(item => ( + + + + + + + + + + + + + + ))} + +
    + NIK + + Nama + + Jabatan + + Gaji Pokok + + Tunjangan + + Fee Penjualan + + Uang Transport + + Uang Makan + + Bonus + + Potongan + + Total +
    + {item.nik} + + {item.name} + + {item.jabatan} + + Rp. {formatIDR(item.gajiPokok)} + + Rp. {formatIDR(item.tunjangan)} + + Rp. {formatIDR(item.feePenjualan)} + + Rp. {formatIDR(item.transport)} + + Rp. {formatIDR(item.uangMakan)} + + Rp. {formatIDR(item.bonus)} + + Rp. {formatIDR(item.potongan)} + + Rp. {formatIDR(item.total)} +
    +
    +
    +

    Pekanbaru, {date.getDate()}-{date.getMonth()}-{date.getFullYear()}

    +

    Finance

    +
    +
    +
    +
    + ) +}) + +export default function Gaji(props) { + const formModal = useModalState(false) + + const componentRef = useRef(); + const handlePrint = useReactToPrint({ + content: () => componentRef.current, + }); + + const month = (new Date()).getMonth() + const year = (new Date()).getFullYear() + const months = [1,2,3,4,5,6,7,8,9,10,11,12] + const years = [+year-2, +year-1, year, +year+1, +year+2] + + const {data, setData} = useForm({ + month: month, + year: year + }) + + const onHandleChange = (event) => { + setData( + event.target.name, + event.target.type === 'checkbox' + ? event.target.checked + : event.target.value + ) + } + + const [items, setItems] = useState([]) + const onClickShow = () => { + getDataGaji(`${data.month}_${data.year}`, setItems) + } + + return ( + + + +
    +
    +
    +
    +
    + Data Gaji +
    +
    +
    +

    Periode Data :

    + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + {items.map(item => ( + + + + + + + + + + + + + + ))} + +
    + NIK + + Nama + + Jabatan + + Gaji Pokok + + Tunjangan + + Fee Penjualan + + Uang Transport + + Uang Makan + + Bonus + + Potongan + + Total +
    + {item.nik} + + {item.name} + + {item.jabatan} + + Rp. {formatIDR(item.gajiPokok)} + + Rp. {formatIDR(item.tunjangan)} + + Rp. {formatIDR(item.feePenjualan)} + + Rp. {formatIDR(item.transport)} + + Rp. {formatIDR(item.uangMakan)} + + Rp. {formatIDR(item.bonus)} + + Rp. {formatIDR(item.potongan)} + + Rp. {formatIDR(item.total)} +
    + {items.length > 0 && ( +
    + +
    + )} +
    +
    +
    +
    + +
    + ); +} diff --git a/resources/js/Pages/Gaji/Slip.jsx b/resources/js/Pages/Gaji/Slip.jsx new file mode 100644 index 0000000..a1e549e --- /dev/null +++ b/resources/js/Pages/Gaji/Slip.jsx @@ -0,0 +1,195 @@ +import React, { useEffect, useRef, useState } from 'react'; +import Authenticated from '@/Layouts/Authenticated'; +import { Head, useForm } from '@inertiajs/inertia-react'; +import { useModalState } from '@/Hooks' +import Button from '@/Components/Button'; +import FormModal from './FormModal'; +import { getDataGaji } from '@/Services/DataGaji'; +import { useReactToPrint } from 'react-to-print'; +import { formatIDR } from '@/Utils'; + +const ComponentToPrint = React.forwardRef(({ user, month, year }, ref) => { + const date = new Date() + return ( +
    +
    +

    Koro Koro Family Karaoke

    +

    Slip Gaji Pegawai

    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Nama Karyawan : {user?.name}
    NIK : {user?.nik}
    Jabatan : {user?.jabatan}
    Bulan : {month}
    Tahun: {year}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NoKeteranganJumlah
    1Gaji PokokRp. {formatIDR(user?.gajiPokok)}
    2Tunjangan JabatanRp. {formatIDR(user?.tunjangan)}
    3Fee PenjualanRp. {formatIDR(user?.feePenjualan)}
    4Tunjangan TransaportasiRp. {formatIDR(user?.transport)}
    5Uang MakanRp. {formatIDR(user?.uangMakan)}
    6BonusRp. {formatIDR(user?.bonus)}
    7PotonganRp. {formatIDR(user?.potongan)}
    Total GajiRp. {formatIDR(user?.total)}
    +
    +
    +

    Pegawai

    +
    {user?.name}
    +
    +
    +

    Pekanbaru, {date.getDate()}-{date.getMonth()}-{date.getFullYear()}

    +

    Finance

    +
    +
    +
    +
    + ) +}) + +export default function Gaji(props) { + const formModal = useModalState(false) + + const componentRef = useRef(); + const handlePrint = useReactToPrint({ + content: () => componentRef.current, + }); + + const month = (new Date()).getMonth() + const year = (new Date()).getFullYear() + const months = [1,2,3,4,5,6,7,8,9,10,11,12] + const years = [+year-2, +year-1, year, +year+1, +year+2] + + const {data, setData} = useForm({ + month: month, + year: year, + userId: '', + }) + console.log(data.userId) + const onHandleChange = (event) => { + setData( + event.target.name, + event.target.type === 'checkbox' + ? event.target.checked + : event.target.value + ) + } + + const [items, setItems] = useState([]) + const user = items.find(item => item.id == data.userId) + + useEffect(() => { + getDataGaji(`${data.month}_${data.year}`, setItems) + }, [data]) + + return ( + + + +
    +
    +
    +
    +
    + Slip Gaji +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + ); +} diff --git a/resources/js/Pages/Jabatan/Index.jsx b/resources/js/Pages/Jabatan/Index.jsx index 2f57a44..ed7fb2f 100644 --- a/resources/js/Pages/Jabatan/Index.jsx +++ b/resources/js/Pages/Jabatan/Index.jsx @@ -43,7 +43,7 @@ export default function Jabatan(props) {
    -
    +
    @@ -51,7 +51,7 @@ export default function Jabatan(props) {
    - +
    diff --git a/resources/js/Pages/SettingPotongGaji/Index.jsx b/resources/js/Pages/SettingPotongGaji/Index.jsx index 9bad3ef..9cd1d54 100644 --- a/resources/js/Pages/SettingPotongGaji/Index.jsx +++ b/resources/js/Pages/SettingPotongGaji/Index.jsx @@ -4,7 +4,7 @@ import { Head } from '@inertiajs/inertia-react'; import { useModalState } from '@/Hooks' import Button from '@/Components/Button'; import FormModal from './FormModal'; -import { getAll } from '@/Services/SettingPotonganGaji'; +import { getAll, deleteById } from '@/Services/SettingPotonganGaji'; import { toast } from 'react-toastify'; import { formatIDR } from '@/Utils'; @@ -30,7 +30,6 @@ export default function Karyawan(props) { const fetchData = () => { getAll() .then(items => { - console.log(items) setItems(items) }) } diff --git a/resources/js/Services/DataGaji.js b/resources/js/Services/DataGaji.js new file mode 100644 index 0000000..105daf2 --- /dev/null +++ b/resources/js/Services/DataGaji.js @@ -0,0 +1,56 @@ +import { getByPeriode } from './Absensi' +import { getAll as getJabatan } from './Jabatan' +import { getAll as getPotongan } from './SettingPotonganGaji' +import { toast } from "react-toastify"; + +async function getDataGaji(periode, setLists) { + let potongan = [] + getJabatan() + .then(jabatans => { + getByPeriode(periode).then(items => { + if(items[0] == undefined) { + setLists([]) + toast.error("data tidak tersedia") + return + } + getPotongan() + .then(p => p.map(item => { + potongan.push(item) + })) + .finally(() => { + let alfa = potongan.find(pot => pot.data.jenis == 'alfa') + let sakit = potongan.find(pot => pot.data.jenis == 'sakit') + + let employees = items[0].data.users.map(employee => { + let jab = jabatans.find(item => item.id == employee.jabatan_id) + + let potong = 0 + if(alfa != undefined) { + potong += +alfa.data.potongan * +employee.alfa + } + if(sakit != undefined) { + potong += +sakit.data.potongan * +employee.sakit + } + + return { + ...employee, + gajiPokok: jab.data.gajiPokok, + tunjangan: jab.data.tunjangan, + feePenjualan: jab.data.feePenjualan, + transport: jab.data.transport, + uangMakan: jab.data.uangMakan, + bonus: jab.data.bonus, + potongan: potong, + total: +jab.data.total - +potong + } + }) + setLists(employees) + }) + + }) + }) +} + +export { + getDataGaji +} \ No newline at end of file diff --git a/resources/js/Services/Gaji.js b/resources/js/Services/Gaji.js deleted file mode 100644 index 3f3c700..0000000 --- a/resources/js/Services/Gaji.js +++ /dev/null @@ -1,33 +0,0 @@ -import { useState } from "react"; -import db from "@/firebase"; -import { collection, getDocs, doc, addDoc, deleteDoc, updateDoc, query, where } from "firebase/firestore"; -import { getAll as getKaryawan } from './Karyawan' -import { getAll as getJabatan } from './Jabatan' - -async function getDataGaji() { - const [lists, setLists] = useState([]) - const [jabatans, setJabatan] = useState([]) - Promise.all([ - () => getJabatan().then(items => setJabatan(items)), - () => getKaryawan().then(items => { - const employees = items.map(employee => { - const jab = jabatans.find(item => item.id == employee.data.jabatan.id) - // TODO: fetch potongan - return { - ...employee, - gajiPokok: jab.gajiPokok, - tunjangan: jab.tunjangan, - feePenjualan: jab.feePenjualan, - transport: jab.transport, - uangMakan: jab.uangMakan, - bonus: jab.bonus, - total: jab.total - } - }) - - setLists(employees) - }), - ]) - - return lists -} \ No newline at end of file diff --git a/resources/js/Services/Karyawan.js b/resources/js/Services/Karyawan.js index f63f274..cc8bbc9 100644 --- a/resources/js/Services/Karyawan.js +++ b/resources/js/Services/Karyawan.js @@ -27,7 +27,6 @@ async function update(payload, id){ } async function deleteById(id) { - console.log(id) const docRef = doc(db, COLLECTION, id) const result = await deleteDoc(docRef); return result diff --git a/resources/js/Services/SettingPotonganGaji.js b/resources/js/Services/SettingPotonganGaji.js index 16ae2bc..9ea88d3 100644 --- a/resources/js/Services/SettingPotonganGaji.js +++ b/resources/js/Services/SettingPotonganGaji.js @@ -27,7 +27,6 @@ async function update(payload, id){ } async function deleteById(id) { - console.log(id) const docRef = doc(db, COLLECTION, id) const result = await deleteDoc(docRef); return result diff --git a/routes/web.php b/routes/web.php index fedbeae..fe0884e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -33,5 +33,7 @@ Route::middleware([IsSessionAuth::class])->group(function () { Route::get('/karyawan', [GeneralController::class, 'karyawan'])->name('karyawan'); Route::get('/absensi', [GeneralController::class, 'absensi'])->name('absensi'); Route::get('/setting-potong-gaji', [GeneralController::class, 'settingPotongGaji'])->name('setting.potongan.gaji'); + Route::get('/data-gaji', [GeneralController::class, 'dataGaji'])->name('gaji'); + Route::get('/slip-gaji', [GeneralController::class, 'slipGaji'])->name('slip.gaji'); Route::post('/logout', [AuthController::class, 'destroy'])->name('logout'); });