-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 22, 2025 at 05:07 PM
-- Server version: 8.0.30
-- PHP Version: 7.4.33

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `inventori`
--

-- --------------------------------------------------------

--
-- Table structure for table `barang`
--

CREATE TABLE `barang` (
  `id_barang` char(7) NOT NULL,
  `nama_barang` varchar(255) NOT NULL,
  `batas` int NOT NULL,
  `satuan_id` int NOT NULL,
  `jenis_id` int NOT NULL,
  `tgl` date DEFAULT NULL,
  `stokawal` bigint DEFAULT NULL,
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `barang`
--

INSERT INTO `barang` (`id_barang`, `nama_barang`, `batas`, `satuan_id`, `jenis_id`, `tgl`, `stokawal`, `date_created`) VALUES
('B000001', 'CCTV Dahua', 0, 4, 5, '2025-09-10', 0, '2025-09-10 12:31:14'),
('B000002', 'AC Daikin', 0, 1, 1, '2025-09-10', 0, '2025-09-10 15:09:18'),
('B000003', 'APAR 123', 0, 1, 3, '2025-09-16', 0, '2025-09-16 10:24:13');

-- --------------------------------------------------------

--
-- Table structure for table `barang_keluar`
--

CREATE TABLE `barang_keluar` (
  `id_barang_keluar` char(16) NOT NULL,
  `user_id` int NOT NULL,
  `tanggal_keluar` date NOT NULL,
  `cabang_id` int DEFAULT NULL,
  `ket` text NOT NULL,
  `id_impor` int DEFAULT NULL,
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `barang_keluar`
--

INSERT INTO `barang_keluar` (`id_barang_keluar`, `user_id`, `tanggal_keluar`, `cabang_id`, `ket`, `id_impor`, `date_created`, `date_updated`) VALUES
('BK-25091800001', 1, '2025-09-18', 3, 'tes', NULL, '2025-09-18 23:36:25', NULL),
('BK-25091900001', 1, '2025-09-18', 3, 'Tes', 8, '2025-09-19 21:51:56', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `barang_masuk`
--

CREATE TABLE `barang_masuk` (
  `id_barang_masuk` char(16) NOT NULL,
  `user_id_pemilik` int NOT NULL,
  `user_id` int NOT NULL,
  `tanggal_masuk` date NOT NULL,
  `cabang_id` int DEFAULT NULL,
  `stts_perolehan` text NOT NULL,
  `stts_penggunaan` text NOT NULL,
  `ket` text NOT NULL,
  `id_impor` int DEFAULT NULL,
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `barang_masuk`
--

INSERT INTO `barang_masuk` (`id_barang_masuk`, `user_id_pemilik`, `user_id`, `tanggal_masuk`, `cabang_id`, `stts_perolehan`, `stts_penggunaan`, `ket`, `id_impor`, `date_created`, `date_updated`) VALUES
('BM-25091000001', 18, 1, '2025-09-10', 3, 'Tes', 'Tes', '', NULL, '2025-09-10 15:45:55', '2025-09-12 21:13:31'),
('BM-25091200001', 19, 1, '2025-09-12', 3, 'Tes', 'Tes', 'Tes', NULL, '2025-09-12 16:02:10', '2025-09-13 15:04:35'),
('BM-25091800001', 18, 1, '2025-09-18', 3, 'Tes', 'Tes', 'Tes', 5, '2025-09-18 23:03:23', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `cabang`
--

CREATE TABLE `cabang` (
  `id_cabang` int NOT NULL,
  `nama_cabang` varchar(100) DEFAULT NULL,
  `alamat_cabang` text,
  `flag_pusat` smallint DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `cabang`
--

INSERT INTO `cabang` (`id_cabang`, `nama_cabang`, `alamat_cabang`, `flag_pusat`) VALUES
(3, 'Office', 'Magetan', 0),
(4, 'Logistik', 'Magetan', 0),
(10, 'Gudang 1', 'Magetan', 0),
(11, 'Gudang 2', 'Magetan', 0),
(12, 'Gudang 3', 'Magetan', 0);

-- --------------------------------------------------------

--
-- Table structure for table `cabang_detail`
--

CREATE TABLE `cabang_detail` (
  `id_cabang_detail` int NOT NULL,
  `id_cabang` int DEFAULT NULL,
  `id_barang` char(7) NOT NULL,
  `stok` int DEFAULT '0',
  `stok_awal` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Table structure for table `customer`
--

CREATE TABLE `customer` (
  `id_customer` int NOT NULL,
  `cabang_id` int NOT NULL,
  `nama_customer` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `no_telp` varchar(15) COLLATE utf8mb4_general_ci NOT NULL,
  `alamat` text COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `departemen`
--

CREATE TABLE `departemen` (
  `id_depart` int NOT NULL,
  `nama_depart` varchar(288) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `departemen`
--

INSERT INTO `departemen` (`id_depart`, `nama_depart`) VALUES
(1, 'Accounting'),
(2, 'BM'),
(3, 'Finance'),
(4, 'HR'),
(5, 'INPP'),
(6, 'IT'),
(7, 'Leasing'),
(8, 'LEGALOG'),
(9, 'Marcomm'),
(10, 'Operational'),
(11, 'Purchasing'),
(12, 'RDD'),
(13, 'Safety'),
(15, 'TCR');

-- --------------------------------------------------------

--
-- Table structure for table `detail_barang_keluar`
--

CREATE TABLE `detail_barang_keluar` (
  `id_detail` int NOT NULL,
  `id_detail_masuk` int NOT NULL,
  `user_id_pemilik` int NOT NULL,
  `id_barang_keluar` char(16) DEFAULT NULL,
  `id_barang` char(7) DEFAULT NULL,
  `jumlah` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `detail_barang_keluar`
--

INSERT INTO `detail_barang_keluar` (`id_detail`, `id_detail_masuk`, `user_id_pemilik`, `id_barang_keluar`, `id_barang`, `jumlah`) VALUES
(17, 9, 18, 'BK-25091800001', 'B000001', 1),
(20, 25, 18, 'BK-25091900001', 'B000003', 1),
(21, 9, 18, 'BK-25091900001', 'B000001', 1);

-- --------------------------------------------------------

--
-- Table structure for table `detail_barang_masuk`
--

CREATE TABLE `detail_barang_masuk` (
  `id_detail` int NOT NULL,
  `id_barang_masuk` char(16) DEFAULT NULL,
  `id_barang` char(7) DEFAULT NULL,
  `jumlah` int DEFAULT NULL,
  `merk` varchar(288) NOT NULL,
  `spesifikasi` text NOT NULL,
  `barcode` varchar(288) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `sn` varchar(288) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `detail_barang_masuk`
--

INSERT INTO `detail_barang_masuk` (`id_detail`, `id_barang_masuk`, `id_barang`, `jumlah`, `merk`, `spesifikasi`, `barcode`, `sn`) VALUES
(9, 'BM-25091000001', 'B000001', 4, 'Hixvision', 'Camera 2MP', '', ''),
(10, 'BM-25091000001', 'B000002', 3, 'Daikin', 'Freon R35', '', ''),
(12, 'BM-25091200001', 'B000001', 3, 'Dahua', 'CCTV IP Camera', '123', '1123131'),
(25, 'BM-25091800001', 'B000003', 2, 'Viking', 'Berat 23 Kg', NULL, NULL),
(26, 'BM-25091800001', 'B000001', 4, 'Interluc', 'Camera 2MP', NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `detail_retur`
--

CREATE TABLE `detail_retur` (
  `id_detail` int NOT NULL,
  `id_retur` char(16) DEFAULT NULL,
  `id_barang` char(7) DEFAULT NULL,
  `jumlah` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Table structure for table `detail_stock_op_name`
--

CREATE TABLE `detail_stock_op_name` (
  `id_detail` int NOT NULL,
  `id_stock_op_name` char(16) DEFAULT NULL,
  `id_detail_masuk` int NOT NULL,
  `user_id_pemilik` int NOT NULL,
  `id_barang` char(7) DEFAULT NULL,
  `jumlah` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `detail_stock_op_name`
--

INSERT INTO `detail_stock_op_name` (`id_detail`, `id_stock_op_name`, `id_detail_masuk`, `user_id_pemilik`, `id_barang`, `jumlah`) VALUES
(8, 'SO-25091900001', 25, 18, 'B000003', 2),
(9, 'SO-25091900001', 9, 18, 'B000001', 3);

-- --------------------------------------------------------

--
-- Table structure for table `detail_transfer_barang`
--

CREATE TABLE `detail_transfer_barang` (
  `id_detail_transfer` int NOT NULL,
  `id_transfer` int NOT NULL,
  `id_detail_masuk` int NOT NULL,
  `user_id_pemilik` int NOT NULL,
  `id_barang` char(7) NOT NULL,
  `jumlah` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `detail_transfer_barang`
--

INSERT INTO `detail_transfer_barang` (`id_detail_transfer`, `id_transfer`, `id_detail_masuk`, `user_id_pemilik`, `id_barang`, `jumlah`) VALUES
(8, 3, 9, 18, 'B000001', 1),
(9, 3, 10, 18, 'B000002', 1),
(11, 6, 10, 18, 'B000002', 1);

-- --------------------------------------------------------

--
-- Table structure for table `impor`
--

CREATE TABLE `impor` (
  `id_impor` int NOT NULL,
  `tgl` date NOT NULL,
  `file` varchar(288) CHARACTER SET utf8mb4 NOT NULL,
  `stts` int NOT NULL,
  `id_cabang` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `impor`
--

INSERT INTO `impor` (`id_impor`, `tgl`, `file`, `stts`, `id_cabang`) VALUES
(5, '2025-09-18', 'dt_impor_stts_1_20250918230322.xlsx', 1, 3),
(8, '2025-09-19', 'dt_impor_stts_2_20250919215042.xlsx', 2, 3),
(15, '2025-09-19', 'dt_impor_stts_3_20250919224437.xlsx', 3, 3),
(19, '2025-09-19', 'dt_impor_stts_4_20250919230534.xlsx', 4, 3);

-- --------------------------------------------------------

--
-- Table structure for table `jenis`
--

CREATE TABLE `jenis` (
  `id_jenis` int NOT NULL,
  `nama_jenis` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `jenis`
--

INSERT INTO `jenis` (`id_jenis`, `nama_jenis`) VALUES
(1, 'AC'),
(2, 'AHU'),
(3, 'APAR'),
(4, 'Blower'),
(5, 'CCTV'),
(6, 'Chiller');

-- --------------------------------------------------------

--
-- Table structure for table `profile`
--

CREATE TABLE `profile` (
  `id_profile` int NOT NULL,
  `nama` varchar(288) NOT NULL,
  `almt` text NOT NULL,
  `notelp` varchar(20) CHARACTER SET utf8mb4 NOT NULL,
  `deskripsi` text NOT NULL,
  `foto` varchar(288) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `profile`
--

INSERT INTO `profile` (`id_profile`, `nama`, `almt`, `notelp`, `deskripsi`, `foto`) VALUES
(1, '23 PASKAL', 'Bandung, Jawa Barat', '0895396051690', 'Gudang Inventori yang berlokasi di Jawa Barat, Indonesia', 'logo.png');

-- --------------------------------------------------------

--
-- Table structure for table `retur`
--

CREATE TABLE `retur` (
  `id_retur` char(16) NOT NULL,
  `tanggal` date DEFAULT NULL,
  `tujuan_cabang` int DEFAULT NULL,
  `asal_cabang` int DEFAULT NULL,
  `keterangan` text,
  `id_user` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Table structure for table `satuan`
--

CREATE TABLE `satuan` (
  `id_satuan` int NOT NULL,
  `nama_satuan` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `satuan`
--

INSERT INTO `satuan` (`id_satuan`, `nama_satuan`) VALUES
(1, 'Unit'),
(4, 'Pcs'),
(5, 'Box'),
(6, 'Roll');

-- --------------------------------------------------------

--
-- Table structure for table `sa_barang`
--

CREATE TABLE `sa_barang` (
  `id_sa` int NOT NULL,
  `barang_id` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `cabang_id` int NOT NULL,
  `tgl` date NOT NULL,
  `user_id` int NOT NULL,
  `saldo` bigint NOT NULL,
  `hpp` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `stock_op_name`
--

CREATE TABLE `stock_op_name` (
  `id_stock_op_name` char(16) NOT NULL,
  `user_id` int NOT NULL,
  `tanggal_stock_op_name` date NOT NULL,
  `cabang_id` int DEFAULT NULL,
  `ket` text NOT NULL,
  `id_impor` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `stock_op_name`
--

INSERT INTO `stock_op_name` (`id_stock_op_name`, `user_id`, `tanggal_stock_op_name`, `cabang_id`, `ket`, `id_impor`) VALUES
('SO-25091900001', 1, '2025-09-18', 3, 'Tes', 19);

-- --------------------------------------------------------

--
-- Table structure for table `supplier`
--

CREATE TABLE `supplier` (
  `id_supplier` int NOT NULL,
  `cabang_id` int NOT NULL,
  `nama_supplier` varchar(50) NOT NULL,
  `no_telp` varchar(15) NOT NULL,
  `alamat` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Table structure for table `transfer_barang`
--

CREATE TABLE `transfer_barang` (
  `id_transfer` int NOT NULL,
  `kode_transfer` char(16) DEFAULT NULL,
  `tgl_transfer` date DEFAULT NULL,
  `keterangan` text,
  `asal_cabang` int DEFAULT NULL,
  `tujuan_cabang` int DEFAULT NULL,
  `jumlah` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `id_impor` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `transfer_barang`
--

INSERT INTO `transfer_barang` (`id_transfer`, `kode_transfer`, `tgl_transfer`, `keterangan`, `asal_cabang`, `tujuan_cabang`, `jumlah`, `user_id`, `id_impor`) VALUES
(3, 'TR-25091400001', '2025-09-14', 'Tes', 3, 4, NULL, 1, NULL),
(6, 'TR-25091900001', '2025-09-18', 'Tes', 3, 4, NULL, 1, 15);

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `id_user` int NOT NULL,
  `cabang_id` int NOT NULL,
  `nama` varchar(50) NOT NULL,
  `username` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `no_telp` varchar(15) NOT NULL,
  `jabatan` varchar(288) NOT NULL,
  `role` int NOT NULL,
  `id_depart` int NOT NULL,
  `password` varchar(255) NOT NULL,
  `created_at` int NOT NULL,
  `foto` text NOT NULL,
  `is_active` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`id_user`, `cabang_id`, `nama`, `username`, `email`, `no_telp`, `jabatan`, `role`, `id_depart`, `password`, `created_at`, `foto`, `is_active`) VALUES
(1, 3, 'Administrator', 'administrator', 'administrator@admin.com', '025123456789', 'Web App Developer', 1, 6, '$2y$10$JodvxUjmwLX/Z0QgM6JbE.HRVk5qNS0KVVDyH3BB6fIwSTDmq02mq', 1568689561, 'admin.png', 1),
(18, 3, 'Andi', 'andi', 'andi@gmail.com', '1234567891011', 'Staff Finance', 3, 3, '$2y$10$iP16dGFY2LSjd2HxfgXKaOwmMIMdyJzF2umROu7h48wUB0uQ4JLtK', 1728015878, 'admin.png', 1),
(19, 3, 'Budi', 'budi', 'budi@gmail.com', '1234567891011', 'Staff Accounting', 3, 1, '$2y$10$ytqdCSk5nslH0B0CH2csgORJIWBeXWjzzSZG5b5rrY4qDxz0M8Rfy', 1748501288, 'admin.png', 1),
(22, 3, 'Yoga', 'petugas1', 'yoga@gmail.com', '123456', 'Staff Gudang', 2, 10, '$2y$10$mXYtI0InQE.xs04GFXiXpuIvb/wKfAOV3SRQQR9cmgt9VpPayJwkS', 1758432439, 'admin.png', 1);

-- --------------------------------------------------------

--
-- Table structure for table `user_menu`
--

CREATE TABLE `user_menu` (
  `id_menu` int NOT NULL,
  `nama` varchar(288) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `user_menu`
--

INSERT INTO `user_menu` (`id_menu`, `nama`) VALUES
(1, 'Dashboard'),
(2, 'Lokasi'),
(3, 'Menu'),
(4, 'User Management'),
(5, 'Departemen'),
(6, 'Barang'),
(7, 'Category'),
(8, 'Satuan'),
(9, 'Barang Masuk'),
(10, 'Barang Keluar'),
(11, 'Transfer Barang'),
(12, 'Stock Opname'),
(13, 'Laporan'),
(14, 'Impor');

-- --------------------------------------------------------

--
-- Table structure for table `user_role`
--

CREATE TABLE `user_role` (
  `id_role` int NOT NULL,
  `role` varchar(288) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `user_role`
--

INSERT INTO `user_role` (`id_role`, `role`) VALUES
(1, 'Administrator'),
(2, 'Petugas'),
(3, 'User');

-- --------------------------------------------------------

--
-- Table structure for table `user_sub_menu`
--

CREATE TABLE `user_sub_menu` (
  `id_sub_menu` int NOT NULL,
  `id_menu` int NOT NULL,
  `nm_sub_menu` varchar(288) CHARACTER SET utf8mb4 NOT NULL,
  `link` varchar(288) NOT NULL,
  `is_active` int NOT NULL,
  `is_admin` int NOT NULL,
  `is_petugas` int NOT NULL,
  `is_user` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `user_sub_menu`
--

INSERT INTO `user_sub_menu` (`id_sub_menu`, `id_menu`, `nm_sub_menu`, `link`, `is_active`, `is_admin`, `is_petugas`, `is_user`) VALUES
(1, 1, 'dashboard', 'dashboard/', 1, 1, 1, 1),
(2, 2, 'Lokasi', 'cabang/', 1, 1, 1, 0),
(3, 2, 'edit', 'cabang/edit', 1, 1, 1, 0),
(4, 2, 'delete', 'cabang/delete', 1, 1, 1, 0),
(5, 3, 'index', 'menu/', 1, 1, 0, 0),
(6, 3, 'tambah', 'menu/tambah', 1, 1, 0, 0),
(7, 3, 'ubah', 'menu/ubah', 1, 1, 0, 0),
(8, 3, 'hapus', 'menu/hapus', 1, 1, 0, 0),
(9, 3, 'sub menu', 'menu/submenu', 1, 1, 0, 0),
(10, 3, 'tambah_sub_menu', 'menu/tambah_sub_menu', 1, 1, 0, 0),
(11, 3, 'ubah_sub_menu', 'menu/ubah_sub_menu', 1, 1, 0, 0),
(12, 3, 'hapus_sub_menu', 'menu/hapus_sub_menu', 1, 1, 0, 0),
(13, 3, 'ubah_stts', 'menu/ubah_stts', 1, 1, 0, 0),
(14, 4, 'user', 'user/', 1, 1, 0, 0),
(15, 4, 'add', 'user/add', 1, 1, 0, 0),
(16, 4, 'edit', 'user/edit', 1, 1, 0, 0),
(17, 4, 'delete', 'user/delete', 1, 1, 0, 0),
(18, 4, 'toggle', 'user/toggle', 1, 1, 0, 0),
(19, 5, 'departemen', 'departemen/', 1, 1, 0, 0),
(20, 5, 'add', 'departemen/add', 1, 1, 0, 0),
(21, 5, 'edit', 'departemen/edit', 1, 1, 0, 0),
(22, 5, 'delete', 'departemen/delete', 1, 1, 0, 0),
(23, 6, 'index', 'barang/', 1, 1, 1, 0),
(24, 6, 'add', 'barang/add', 1, 1, 1, 0),
(25, 6, 'edit', 'barang/edit', 1, 1, 1, 0),
(26, 6, 'delete', 'barang/delete', 1, 1, 1, 0),
(27, 6, 'barang_by_cabang', 'barang/barang_by_cabang', 1, 1, 1, 0),
(28, 6, 'detail_barang_by_cabang', 'barang/detail_barang_by_cabang', 1, 1, 1, 0),
(29, 6, 'getUserUniq', 'barang/getUserUniq', 1, 1, 1, 0),
(30, 6, 'mutasi_barang_cabang_by_user', 'barang/mutasi_barang_cabang_by_user', 1, 1, 1, 0),
(31, 6, 'mutasi_barang_cabang', 'barang/mutasi_barang_cabang', 1, 1, 1, 0),
(32, 7, 'index', 'jenis/', 1, 1, 1, 0),
(33, 7, 'add', 'jenis/add', 1, 1, 1, 0),
(34, 7, 'edit', 'jenis/edit', 1, 1, 1, 0),
(35, 7, 'delete', 'jenis/delete', 1, 1, 1, 0),
(36, 8, 'index', 'satuan/', 1, 1, 1, 0),
(37, 8, 'add', 'satuan/add', 1, 1, 1, 0),
(38, 8, 'edit', 'satuan/edit', 1, 1, 1, 0),
(39, 8, 'delete', 'satuan/delete', 1, 1, 1, 0),
(40, 9, 'index', 'barangmasuk/', 1, 1, 1, 0),
(41, 9, 'add', 'barangmasuk/add', 1, 1, 1, 0),
(42, 9, 'edit', 'barangmasuk/edit', 1, 1, 1, 0),
(43, 9, 'delete', 'barangmasuk/delete', 1, 1, 1, 0),
(44, 9, 'print', 'barangmasuk/print', 1, 1, 1, 0),
(45, 9, 'show_barangmasuk', 'barangmasuk/show_barangmasuk', 1, 1, 1, 0),
(46, 9, 'getStokAkhirBarangById', 'barangmasuk/getStokAkhirBarangById', 1, 1, 1, 0),
(47, 9, 'get_barang_masuk_by_user', 'barangmasuk/get_barang_masuk_by_user', 1, 1, 1, 0),
(48, 9, 'get_barang_masuk_by_user2', 'barangmasuk/get_barang_masuk_by_user2', 1, 1, 1, 0),
(49, 10, 'index', 'barangkeluar/', 1, 1, 1, 0),
(50, 10, 'add', 'barangkeluar/add', 1, 1, 1, 0),
(51, 10, 'edit', 'barangkeluar/edit', 1, 1, 1, 0),
(52, 10, 'delete', 'barangkeluar/delete', 1, 1, 1, 0),
(53, 10, 'print', 'barangkeluar/print', 1, 1, 1, 0),
(54, 10, 'show_barangkeluar', 'barangkeluar/show_barangkeluar', 1, 1, 1, 0),
(55, 11, 'index', 'transferbarang/', 1, 1, 1, 0),
(56, 11, 'add', 'transferbarang/add', 1, 1, 1, 0),
(57, 11, 'edit', 'transferbarang/edit', 1, 1, 1, 0),
(58, 11, 'delete', 'transferbarang/delete', 1, 1, 1, 0),
(59, 11, 'print', 'transferbarang/print', 1, 1, 1, 0),
(60, 11, 'show_detailtransfer', 'transferbarang/show_detailtransfer', 1, 1, 1, 0),
(61, 12, 'index', 'stockopname/', 1, 1, 1, 0),
(62, 12, 'add', 'stockopname/add', 1, 1, 1, 0),
(63, 12, 'edit', 'stockopname/edit', 1, 1, 1, 0),
(64, 12, 'delete', 'stockopname/delete', 1, 1, 1, 0),
(65, 12, 'print', 'stockopname/print', 1, 1, 1, 0),
(66, 12, 'show_stockopname', 'stockopname/show_stockopname', 1, 1, 1, 0),
(67, 13, 'index', 'laporan/', 1, 1, 1, 0),
(68, 1, 'save_gudang', 'dashboard/save_gudang', 1, 1, 1, 1),
(69, 14, 'laporan', 'impor/laporan', 1, 1, 0, 0),
(70, 14, 'detail', 'impor/detail', 1, 1, 0, 0),
(71, 14, 'add', 'impor/add', 1, 1, 0, 0),
(72, 14, 'review_impor', 'impor/review_impor', 1, 1, 0, 0),
(73, 14, 'delete', 'impor/delete', 1, 1, 0, 0),
(74, 6, 'get_barang_by_user', 'barang/get_barang_by_user', 1, 1, 1, 1),
(75, 6, 'mutasi_barang_by_user_pemilik', 'barang/mutasi_barang_by_user_pemilik', 1, 1, 1, 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `barang`
--
ALTER TABLE `barang`
  ADD PRIMARY KEY (`id_barang`),
  ADD KEY `satuan_id` (`satuan_id`),
  ADD KEY `kategori_id` (`jenis_id`);

--
-- Indexes for table `barang_keluar`
--
ALTER TABLE `barang_keluar`
  ADD PRIMARY KEY (`id_barang_keluar`),
  ADD KEY `id_user` (`user_id`),
  ADD KEY `id_cabang` (`cabang_id`);

--
-- Indexes for table `barang_masuk`
--
ALTER TABLE `barang_masuk`
  ADD PRIMARY KEY (`id_barang_masuk`),
  ADD KEY `id_user` (`user_id`),
  ADD KEY `id_cabang` (`cabang_id`);

--
-- Indexes for table `cabang`
--
ALTER TABLE `cabang`
  ADD PRIMARY KEY (`id_cabang`);

--
-- Indexes for table `cabang_detail`
--
ALTER TABLE `cabang_detail`
  ADD PRIMARY KEY (`id_cabang_detail`),
  ADD KEY `id_cabang` (`id_cabang`),
  ADD KEY `id_barang` (`id_barang`);

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
  ADD PRIMARY KEY (`id_customer`);

--
-- Indexes for table `departemen`
--
ALTER TABLE `departemen`
  ADD PRIMARY KEY (`id_depart`);

--
-- Indexes for table `detail_barang_keluar`
--
ALTER TABLE `detail_barang_keluar`
  ADD PRIMARY KEY (`id_detail`),
  ADD KEY `detail_barang_keluar_ibfk_1` (`id_barang_keluar`);

--
-- Indexes for table `detail_barang_masuk`
--
ALTER TABLE `detail_barang_masuk`
  ADD PRIMARY KEY (`id_detail`),
  ADD KEY `id_barang_masuk` (`id_barang_masuk`);

--
-- Indexes for table `detail_retur`
--
ALTER TABLE `detail_retur`
  ADD PRIMARY KEY (`id_detail`),
  ADD KEY `detail_retur_beli_ibfk_1` (`id_retur`),
  ADD KEY `detail_retur_beli_ibfk_2` (`id_barang`);

--
-- Indexes for table `detail_stock_op_name`
--
ALTER TABLE `detail_stock_op_name`
  ADD PRIMARY KEY (`id_detail`),
  ADD KEY `detail_stock_op_name_ibfk_1` (`id_stock_op_name`);

--
-- Indexes for table `detail_transfer_barang`
--
ALTER TABLE `detail_transfer_barang`
  ADD PRIMARY KEY (`id_detail_transfer`),
  ADD KEY `id_transfer` (`id_transfer`),
  ADD KEY `id_barang` (`id_barang`);

--
-- Indexes for table `impor`
--
ALTER TABLE `impor`
  ADD PRIMARY KEY (`id_impor`);

--
-- Indexes for table `jenis`
--
ALTER TABLE `jenis`
  ADD PRIMARY KEY (`id_jenis`);

--
-- Indexes for table `profile`
--
ALTER TABLE `profile`
  ADD PRIMARY KEY (`id_profile`);

--
-- Indexes for table `retur`
--
ALTER TABLE `retur`
  ADD PRIMARY KEY (`id_retur`),
  ADD KEY `retur_beli_ibfk_2` (`id_user`),
  ADD KEY `retur_beli_ibfk_1` (`asal_cabang`),
  ADD KEY `tujuan_cabang` (`tujuan_cabang`);

--
-- Indexes for table `satuan`
--
ALTER TABLE `satuan`
  ADD PRIMARY KEY (`id_satuan`);

--
-- Indexes for table `sa_barang`
--
ALTER TABLE `sa_barang`
  ADD PRIMARY KEY (`id_sa`);

--
-- Indexes for table `stock_op_name`
--
ALTER TABLE `stock_op_name`
  ADD PRIMARY KEY (`id_stock_op_name`),
  ADD KEY `id_user` (`user_id`),
  ADD KEY `id_cabang` (`cabang_id`);

--
-- Indexes for table `supplier`
--
ALTER TABLE `supplier`
  ADD PRIMARY KEY (`id_supplier`);

--
-- Indexes for table `transfer_barang`
--
ALTER TABLE `transfer_barang`
  ADD PRIMARY KEY (`id_transfer`),
  ADD KEY `asal_cabang` (`asal_cabang`),
  ADD KEY `tujuan_cabang` (`tujuan_cabang`),
  ADD KEY `transfer_barang_ibfk_3` (`user_id`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`id_user`);

--
-- Indexes for table `user_menu`
--
ALTER TABLE `user_menu`
  ADD PRIMARY KEY (`id_menu`);

--
-- Indexes for table `user_role`
--
ALTER TABLE `user_role`
  ADD PRIMARY KEY (`id_role`);

--
-- Indexes for table `user_sub_menu`
--
ALTER TABLE `user_sub_menu`
  ADD PRIMARY KEY (`id_sub_menu`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `cabang`
--
ALTER TABLE `cabang`
  MODIFY `id_cabang` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `cabang_detail`
--
ALTER TABLE `cabang_detail`
  MODIFY `id_cabang_detail` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
  MODIFY `id_customer` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `departemen`
--
ALTER TABLE `departemen`
  MODIFY `id_depart` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `detail_barang_keluar`
--
ALTER TABLE `detail_barang_keluar`
  MODIFY `id_detail` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `detail_barang_masuk`
--
ALTER TABLE `detail_barang_masuk`
  MODIFY `id_detail` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT for table `detail_retur`
--
ALTER TABLE `detail_retur`
  MODIFY `id_detail` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `detail_stock_op_name`
--
ALTER TABLE `detail_stock_op_name`
  MODIFY `id_detail` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `detail_transfer_barang`
--
ALTER TABLE `detail_transfer_barang`
  MODIFY `id_detail_transfer` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `impor`
--
ALTER TABLE `impor`
  MODIFY `id_impor` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `jenis`
--
ALTER TABLE `jenis`
  MODIFY `id_jenis` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `profile`
--
ALTER TABLE `profile`
  MODIFY `id_profile` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `satuan`
--
ALTER TABLE `satuan`
  MODIFY `id_satuan` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sa_barang`
--
ALTER TABLE `sa_barang`
  MODIFY `id_sa` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `supplier`
--
ALTER TABLE `supplier`
  MODIFY `id_supplier` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transfer_barang`
--
ALTER TABLE `transfer_barang`
  MODIFY `id_transfer` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
  MODIFY `id_user` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `user_menu`
--
ALTER TABLE `user_menu`
  MODIFY `id_menu` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `user_role`
--
ALTER TABLE `user_role`
  MODIFY `id_role` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `user_sub_menu`
--
ALTER TABLE `user_sub_menu`
  MODIFY `id_sub_menu` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=76;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `barang`
--
ALTER TABLE `barang`
  ADD CONSTRAINT `barang_ibfk_1` FOREIGN KEY (`satuan_id`) REFERENCES `satuan` (`id_satuan`),
  ADD CONSTRAINT `barang_ibfk_2` FOREIGN KEY (`jenis_id`) REFERENCES `jenis` (`id_jenis`);

--
-- Constraints for table `barang_keluar`
--
ALTER TABLE `barang_keluar`
  ADD CONSTRAINT `barang_keluar_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id_user`),
  ADD CONSTRAINT `barang_keluar_ibfk_3` FOREIGN KEY (`cabang_id`) REFERENCES `cabang` (`id_cabang`);

--
-- Constraints for table `barang_masuk`
--
ALTER TABLE `barang_masuk`
  ADD CONSTRAINT `barang_masuk_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id_user`),
  ADD CONSTRAINT `barang_masuk_ibfk_6` FOREIGN KEY (`cabang_id`) REFERENCES `cabang` (`id_cabang`);

--
-- Constraints for table `cabang_detail`
--
ALTER TABLE `cabang_detail`
  ADD CONSTRAINT `cabang_detail_ibfk_1` FOREIGN KEY (`id_cabang`) REFERENCES `cabang` (`id_cabang`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `cabang_detail_ibfk_2` FOREIGN KEY (`id_barang`) REFERENCES `barang` (`id_barang`);

--
-- Constraints for table `detail_barang_keluar`
--
ALTER TABLE `detail_barang_keluar`
  ADD CONSTRAINT `detail_barang_keluar_ibfk_1` FOREIGN KEY (`id_barang_keluar`) REFERENCES `barang_keluar` (`id_barang_keluar`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_barang_masuk`
--
ALTER TABLE `detail_barang_masuk`
  ADD CONSTRAINT `detail_barang_masuk_ibfk_1` FOREIGN KEY (`id_barang_masuk`) REFERENCES `barang_masuk` (`id_barang_masuk`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_retur`
--
ALTER TABLE `detail_retur`
  ADD CONSTRAINT `detail_retur_ibfk_1` FOREIGN KEY (`id_retur`) REFERENCES `retur` (`id_retur`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_retur_ibfk_2` FOREIGN KEY (`id_barang`) REFERENCES `barang` (`id_barang`);

--
-- Constraints for table `detail_stock_op_name`
--
ALTER TABLE `detail_stock_op_name`
  ADD CONSTRAINT `detail_stock_op_name_ibfk_1` FOREIGN KEY (`id_stock_op_name`) REFERENCES `stock_op_name` (`id_stock_op_name`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_transfer_barang`
--
ALTER TABLE `detail_transfer_barang`
  ADD CONSTRAINT `detail_transfer_barang_ibfk_1` FOREIGN KEY (`id_transfer`) REFERENCES `transfer_barang` (`id_transfer`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `retur`
--
ALTER TABLE `retur`
  ADD CONSTRAINT `retur_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`),
  ADD CONSTRAINT `retur_ibfk_4` FOREIGN KEY (`tujuan_cabang`) REFERENCES `cabang` (`id_cabang`),
  ADD CONSTRAINT `retur_ibfk_5` FOREIGN KEY (`asal_cabang`) REFERENCES `cabang` (`id_cabang`);

--
-- Constraints for table `stock_op_name`
--
ALTER TABLE `stock_op_name`
  ADD CONSTRAINT `stock_op_name_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id_user`),
  ADD CONSTRAINT `stock_op_name_ibfk_3` FOREIGN KEY (`cabang_id`) REFERENCES `cabang` (`id_cabang`);

--
-- Constraints for table `transfer_barang`
--
ALTER TABLE `transfer_barang`
  ADD CONSTRAINT `transfer_barang_ibfk_1` FOREIGN KEY (`asal_cabang`) REFERENCES `cabang` (`id_cabang`),
  ADD CONSTRAINT `transfer_barang_ibfk_2` FOREIGN KEY (`tujuan_cabang`) REFERENCES `cabang` (`id_cabang`),
  ADD CONSTRAINT `transfer_barang_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `user` (`id_user`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
