-- https://www.phpmyadmin.net/
--
-- Waktu pembuatan: 19 Okt 2024 pada 18.54
-- Versi server: 10.2.44-MariaDB-cll-lve
-- Versi PHP: 8.1.30

START TRANSACTION;



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

--
-- Struktur dari tabel `tb_aktivitas`
--

CREATE TABLE `tb_aktivitas` (
  `id` int(11) NOT NULL,
  `id_admin` int(11) NOT NULL,
  `tgl` datetime NOT NULL DEFAULT current_timestamp(),
  `keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_aktivitas`
--

INSERT INTO `tb_aktivitas` (`id`, `id_admin`, `tgl`, `keterangan`) VALUES
(1, 1, '2023-10-07 05:31:04', 'Menambahkan satuan baru Pcs'),
(2, 1, '2023-10-07 05:31:11', 'Menambahkan satuan baru Botol'),
(3, 1, '2023-10-07 05:31:19', 'Menambahkan satuan baru Dus'),
(4, 2, '2023-10-07 06:47:01', 'Melakukan transaksi penjualan dengan kode TRJ231007064741'),
(5, 2, '2023-10-07 06:51:42', 'Melakukan transaksi penjualan dengan kode TRJ231007065110'),
(6, 2, '2023-10-07 14:09:49', 'Melakukan transaksi penjualan dengan kode TRJ231007020946'),
(7, 2, '2023-10-18 18:02:51', 'Melakukan transaksi penjualan dengan kode TRJ231018060219'),
(8, 3, '2023-10-25 09:05:33', 'Melakukan transaksi penjualan dengan kode TRJ231025090539'),
(9, 2, '2023-10-25 19:07:12', 'Menambahkan harga grosir baru'),
(10, 3, '2023-10-25 19:20:18', 'Melakukan transaksi penjualan dengan kode TRJ231025072016'),
(11, 4, '2023-10-25 19:27:35', 'Menghapus data barang Apple iPhone 15 Pro Max 5G 256GB - Blue Titanium'),
(12, 4, '2023-10-25 19:27:37', 'Menghapus data barang APPLE iPhone 15 Pro 5G 256GB - Natural Titanium'),
(13, 4, '2023-10-25 19:27:39', 'Menghapus data barang Teh Pucuk'),
(14, 4, '2023-10-25 19:27:40', 'Menghapus data barang T-Shirt'),
(15, 4, '2023-10-25 19:29:49', 'Menambahkan supplier baru g'),
(16, 1, '2023-11-03 13:55:54', 'Melakukan transaksi pembelian dengan kode TRB231103015597'),
(17, 1, '2023-11-03 13:57:23', 'Update data barang NARMADA AIR KEMASAN 220ML'),
(18, 1, '2023-11-03 13:58:21', 'Menambahkan multi satuan'),
(19, 1, '2023-11-03 14:01:35', 'Melakukan transaksi pembelian dengan kode TRB231103020165'),
(20, 1, '2023-11-03 14:03:40', 'Melakukan transaksi penjualan dengan kode TRJ231103020383'),
(21, 3, '2023-11-20 17:04:00', 'Melakukan transaksi penjualan dengan kode TRJ231120050465'),
(22, 2, '2023-11-23 03:38:13', 'Melakukan transaksi penjualan dengan kode TRJ231123033840'),
(23, 2, '2023-11-23 07:00:48', 'Melakukan transaksi penjualan dengan kode TRJ231123070094'),
(24, 2, '2023-11-23 07:20:38', 'Menambahkan barang baru Kue Talam'),
(25, 2, '2023-11-23 07:21:02', 'Menambahkan kategori baru Kue'),
(26, 2, '2023-11-23 07:21:13', 'Menambahkan kategori baru Snack'),
(27, 2, '2023-11-23 07:21:28', 'Menambahkan kategori baru Minuman'),
(28, 2, '2023-11-23 07:21:49', 'Menambahkan satuan baru Slice'),
(29, 2, '2023-11-23 07:22:18', 'Menambahkan supplier baru UMKM IBU Eka'),
(30, 2, '2023-11-23 07:22:33', 'Menambahkan supplier baru CV. Sedia kala'),
(31, 2, '2023-11-23 07:24:55', 'Melakukan transaksi penjualan dengan kode TRJ231123072423'),
(32, 2, '2023-11-25 00:44:22', 'Melakukan transaksi penjualan dengan kode TRJ231125124460'),
(33, 2, '2023-11-25 00:47:30', 'Melakukan transaksi penjualan dengan kode TRJ231125124741'),
(34, 4, '2023-11-28 17:00:26', 'Menambahkan barang baru ede'),
(35, 2, '2023-11-28 17:21:43', 'Melakukan transaksi penjualan dengan kode TRJ231128052132'),
(36, 2, '2023-11-28 17:23:37', 'Melakukan transaksi penjualan dengan kode TRJ231128052382'),
(37, 2, '2023-11-28 17:24:49', 'Melakukan transaksi penjualan dengan kode TRJ231128052432'),
(38, 3, '2023-11-28 22:08:36', 'Melakukan transaksi penjualan dengan kode TRJ231128100832'),
(39, 3, '2023-11-28 22:59:27', 'Melakukan transaksi penjualan dengan kode TRJ231128105964'),
(40, 3, '2023-11-28 23:22:45', 'Melakukan transaksi penjualan dengan kode TRJ231128112252'),
(41, 3, '2023-11-28 23:44:37', 'Melakukan transaksi penjualan dengan kode TRJ231128114417'),
(42, 3, '2023-11-28 23:55:49', 'Melakukan transaksi penjualan dengan kode TRJ231128115573'),
(43, 3, '2023-11-29 00:01:12', 'Melakukan transaksi penjualan dengan kode TRJ231129120112'),
(44, 3, '2023-11-29 00:10:30', 'Melakukan transaksi penjualan dengan kode TRJ231129121061'),
(45, 4, '2023-12-03 03:56:06', 'Melakukan transaksi pembelian dengan kode TRB231203035699'),
(46, 3, '2023-12-03 03:59:13', 'Melakukan transaksi penjualan dengan kode TRJ231203035936'),
(47, 2, '2023-12-03 18:40:50', 'Melakukan transaksi penjualan dengan kode TRJ231203064031'),
(48, 2, '2023-12-16 20:29:44', 'Melakukan transaksi penjualan dengan kode TRJ231216082940'),
(49, 4, '2024-01-12 12:10:33', 'Menambahkan barang baru Alfa '),
(50, 2, '2024-01-15 11:50:35', 'Menambahkan barang baru Nescafe Classic'),
(51, 2, '2024-01-15 11:52:04', 'Melakukan transaksi pembelian dengan kode TRB240115115294'),
(52, 2, '2024-01-15 11:52:59', 'Menghapus data barang Alfa '),
(53, 2, '2024-01-15 11:53:01', 'Menghapus data barang ede'),
(54, 2, '2024-01-15 11:53:03', 'Menghapus data barang Kue Talam'),
(55, 2, '2024-01-15 12:14:35', 'Menambahkan multi satuan'),
(56, 2, '2024-01-16 06:56:24', 'Update data barang Nescafe Classic'),
(57, 2, '2024-01-16 06:56:44', 'Update data barang Nescafe Classic'),
(58, 2, '2024-01-16 06:57:51', 'Menambahkan multi satuan'),
(59, 2, '2024-01-16 06:57:51', 'Update multi satuan'),
(60, 2, '2024-01-16 06:58:11', 'Menghapus data barang Nescafe Classic'),
(61, 2, '2024-01-16 08:26:00', 'Menambahkan barang baru Air Mineral Club'),
(62, 2, '2024-01-16 08:27:11', 'Menghapus data barang Air Mineral Club'),
(63, 2, '2024-01-16 08:28:11', 'Menambahkan barang baru Le Minerale Botol'),
(64, 2, '2024-01-16 08:28:42', 'Menambahkan multi satuan'),
(65, 2, '2024-01-16 08:29:31', 'Menambahkan harga grosir baru'),
(66, 2, '2024-01-16 08:32:12', 'Update multi satuan'),
(67, 2, '2024-01-16 08:36:04', 'Menambahkan multi satuan'),
(68, 2, '2024-01-16 08:36:04', 'Update multi satuan'),
(69, 2, '2024-01-16 08:37:12', 'Menghapus data pelanggan p'),
(70, 2, '2024-01-16 08:37:36', 'Menambahkan pelanggan baru Rifki'),
(71, 2, '2024-01-16 08:38:29', 'Menghapus multi satuan'),
(72, 2, '2024-01-16 08:43:01', 'Melakukan transaksi pembelian dengan kode TRB240116084362'),
(73, 2, '2024-01-16 09:09:53', 'Menghapus data barang Le Minerale Botol'),
(74, 2, '2024-01-16 09:10:35', 'Menambahkan barang baru Celebes air mineral'),
(75, 2, '2024-01-16 09:11:02', 'Menambahkan satuan baru Cup'),
(76, 2, '2024-01-16 09:24:30', 'Menambahkan multi satuan'),
(77, 2, '2024-01-16 09:25:18', 'Melakukan transaksi pembelian dengan kode TRB240116092559'),
(78, 2, '2024-01-16 09:27:05', 'Update data barang Celebes air mineral'),
(79, 2, '2024-01-16 09:27:45', 'Melakukan transaksi pembelian dengan kode TRB240116092770'),
(80, 2, '2024-01-16 09:33:01', 'Menambahkan harga grosir baru'),
(81, 2, '2024-01-16 09:33:23', 'Menambahkan harga grosir baru'),
(82, 2, '2024-01-16 09:34:26', 'Melakukan transaksi penjualan dengan kode TRJ240116093486'),
(83, 2, '2024-01-16 20:22:16', 'Melakukan transaksi penjualan dengan kode TRJ240116082265'),
(84, 2, '2024-01-17 09:01:19', 'Menambahkan barang baru Beng Beng'),
(85, 2, '2024-01-17 09:02:20', 'Menambahkan multi satuan'),
(86, 2, '2024-01-17 09:29:59', 'Melakukan transaksi pembelian dengan kode TRB240117092917'),
(87, 2, '2024-01-17 11:20:27', 'Melakukan transaksi penjualan dengan kode TRJ240117112015'),
(88, 2, '2024-01-17 11:49:08', 'Melakukan transaksi penjualan dengan kode TRJ240117114948'),
(89, 2, '2024-01-17 12:15:52', 'Menambahkan barang baru Nescafe Classic'),
(90, 2, '2024-01-17 12:16:24', 'Menambahkan multi satuan'),
(91, 2, '2024-01-17 12:16:53', 'Melakukan transaksi pembelian dengan kode TRB240117121639'),
(92, 2, '2024-01-19 12:49:53', 'Melakukan transaksi pembelian dengan kode TRB240119124979'),
(93, 2, '2024-01-19 12:51:02', 'Melakukan transaksi penjualan dengan kode TRJ240119125191'),
(94, 4, '2024-01-20 17:35:27', 'Menambahkan barang baru Air Mineral Sosro'),
(95, 3, '2024-01-20 17:38:13', 'Melakukan transaksi penjualan dengan kode TRJ240120053873'),
(96, 2, '2024-01-20 17:39:55', 'Update data barang Air Mineral Sosro'),
(97, 2, '2024-01-20 17:42:45', 'Melakukan transaksi pembelian dengan kode TRB240120054265'),
(98, 2, '2024-01-20 17:43:34', 'Melakukan transaksi pembelian dengan kode TRB240120054324'),
(99, 2, '2024-01-21 15:57:15', 'Melakukan transaksi pembelian dengan kode TRB240121035763'),
(100, 2, '2024-01-21 16:02:49', 'Melakukan transaksi penjualan dengan kode TRJ240121040221'),
(101, 2, '2024-02-23 10:43:39', 'Melakukan transaksi penjualan dengan kode TRJ240223104377'),
(102, 3, '2024-02-23 10:56:42', 'Melakukan transaksi penjualan dengan kode TRJ240223105615'),
(103, 3, '2024-02-23 10:58:23', 'Menambahkan pelanggan baru Bagus'),
(104, 2, '2024-02-23 11:06:23', 'Menambahkan barang baru Penjepit Kertas'),
(105, 2, '2024-02-23 11:07:32', 'Melakukan transaksi penjualan dengan kode TRJ240223110750'),
(106, 2, '2024-02-23 18:40:41', 'Menambahkan barang baru Indomie Goreng'),
(107, 1, '2024-02-23 19:08:48', 'Menambahkan barang baru buku'),
(108, 1, '2024-02-23 19:08:59', 'Menghapus data barang buku'),
(109, 1, '2024-02-23 19:14:00', 'Menambahkan barang baru buku'),
(110, 1, '2024-02-23 19:42:25', 'Menambahkan barang baru buku'),
(111, 1, '2024-02-23 19:42:31', 'Menghapus data barang buku'),
(112, 1, '2024-02-23 19:42:35', 'Menghapus data barang buku'),
(113, 1, '2024-03-07 12:31:15', 'Menambahkan barang baru tes'),
(114, 1, '2024-03-07 12:31:18', 'Menghapus data barang tes'),
(115, 2, '2024-03-07 12:47:11', 'Menambahkan barang baru Citra Ukuran Kecil'),
(116, 2, '2024-03-07 12:47:43', 'Menambahkan kategori baru Kosmetik'),
(117, 2, '2024-03-07 12:47:55', 'Update data barang Citra Ukuran Kecil'),
(118, 2, '2024-03-07 12:50:20', 'Melakukan transaksi pembelian dengan kode TRB240307125057'),
(119, 2, '2024-03-07 12:56:36', 'Melakukan transaksi penjualan dengan kode TRJ240307125661'),
(120, 1, '2024-03-09 10:57:19', 'Menambahkan barang baru kejrhewrh'),
(121, 1, '2024-03-09 13:39:24', 'Menambahkan barang baru kejrhewrh'),
(122, 1, '2024-03-09 13:39:34', 'Menghapus data barang kejrhewrh'),
(123, 1, '2024-05-25 12:51:14', 'Melakukan transaksi penjualan dengan kode TRJ240525125164'),
(124, 1, '2024-10-18 17:51:33', 'Melakukan transaksi penjualan dengan kode TRJ241018055113'),
(125, 1, '2024-10-18 17:54:49', 'Melakukan transaksi pembelian dengan kode TRB241018055420'),
(126, 1, '2024-10-18 18:13:43', 'Update data barang NARMADA AIR KEMASAN 220ML'),
(127, 1, '2024-10-18 18:14:48', 'Melakukan transaksi penjualan dengan kode TRJ241018061487'),
(128, 1, '2024-10-18 18:16:00', 'Melakukan transaksi penjualan dengan kode TRJ241018061634'),
(129, 1, '2024-10-18 20:28:21', 'Melakukan transaksi penjualan dengan kode TRJ241018082831'),
(130, 1, '2024-10-18 20:40:45', 'Melakukan transaksi pembelian dengan kode TRB241018084051'),
(131, 1, '2024-10-18 20:43:07', 'Melakukan transaksi penjualan dengan kode TRJ241018084357'),
(132, 1, '2024-10-18 20:44:21', 'Melakukan transaksi penjualan dengan kode TRJ241018084431'),
(133, 1, '2024-10-19 04:20:46', 'Melakukan transaksi penjualan dengan kode TRJ241019042070'),
(134, 1, '2024-10-19 04:32:25', 'Menambahkan karyawan baru cimart'),
(135, 1, '2024-10-19 04:33:44', 'Update data karyawan cimart'),
(136, 1, '2024-10-19 04:34:28', 'Update data karyawan cimart'),
(137, 1, '2024-10-19 04:34:38', 'Update data karyawan cimarto'),
(138, 1, '2024-10-19 04:34:53', 'Menghapus data karyawan cimarto'),
(139, 1, '2024-10-19 04:35:17', 'Menambahkan karyawan baru cimart'),
(140, 1, '2024-10-19 04:37:48', 'Update data karyawan cimart'),
(141, 1, '2024-10-19 04:37:59', 'Update data karyawan cimart'),
(142, 1, '2024-10-19 04:38:18', 'Update data karyawan cimart'),
(143, 6, '2024-10-19 04:39:17', 'Melakukan transaksi penjualan dengan kode TRJ241019043998'),
(144, 1, '2024-10-19 04:43:15', 'Update data karyawan cimart'),
(145, 1, '2024-10-19 04:43:51', 'Menambahkan karyawan baru adm'),
(146, 1, '2024-10-19 04:49:27', 'Update data karyawan adm'),
(147, 6, '2024-10-19 04:51:01', 'Melakukan transaksi penjualan dengan kode TRJ241019045147'),
(148, 6, '2024-10-19 04:53:43', 'Melakukan transaksi penjualan dengan kode TRJ241019045317'),
(149, 7, '2024-10-19 04:55:17', 'Melakukan transaksi pembelian dengan kode TRB241019045516'),
(150, 1, '2024-10-19 05:00:16', 'Update data karyawan cimart'),
(151, 1, '2024-10-19 05:00:29', 'Update data karyawan adm'),
(152, 1, '2024-10-19 05:01:31', 'Update data karyawan adm'),
(153, 1, '2024-10-19 05:01:42', 'Update data karyawan adm'),
(154, 1, '2024-10-19 05:02:28', 'Update data karyawan adm'),
(155, 1, '2024-10-19 05:02:44', 'Update data karyawan adm'),
(156, 1, '2024-10-19 05:03:38', 'Update data karyawan admi'),
(157, 1, '2024-10-19 05:04:51', 'Update data pelanggan Bagus'),
(158, 1, '2024-10-19 05:04:59', 'Update data pelanggan Baguss'),
(159, 1, '2024-10-19 05:05:06', 'Update data pelanggan Baguss'),
(160, 1, '2024-10-19 05:11:22', 'Update data barang kejrhewr'),
(161, 1, '2024-10-19 05:11:31', 'Update data barang kejrhewr'),
(162, 1, '2024-10-19 05:11:46', 'Update data barang kejrhewr'),
(163, 1, '2024-10-19 09:46:00', 'Update data pelanggan Baguss'),
(164, 1, '2024-10-19 09:52:03', 'Update data pelanggan Baguss'),
(165, 1, '2024-10-19 09:52:17', 'Update data pelanggan Bagus'),
(166, 1, '2024-10-19 09:54:44', 'Menambahkan karyawan baru SEPTIAN WAHYUDI RAHMAN'),
(167, 1, '2024-10-19 09:55:15', 'Update data karyawan SEPTIAN'),
(168, 1, '2024-10-19 09:58:13', 'Update data karyawan SEPTIAN WAHYUDI RAHMAN'),
(169, 1, '2024-10-19 09:58:41', 'Update data karyawan SEPTIAN WAHYUDI RAHMAN'),
(170, 1, '2024-10-19 10:46:23', 'Update data karyawan SEPTIAN WAHYUDI RAHMAN'),
(171, 1, '2024-10-19 10:46:34', 'Update data karyawan cimart'),
(172, 1, '2024-10-19 10:46:48', 'Update data karyawan SEPTIAN WAHYUDI RAHMAN'),
(173, 1, '2024-10-19 10:46:56', 'Update data karyawan cimart'),
(174, 1, '2024-10-19 10:47:17', 'Update data pelanggan Bagus'),
(175, 1, '2024-10-19 10:47:30', 'Update data karyawan SEPTIAN WAHYUDI RAHMAN'),
(176, 1, '2024-10-19 10:47:41', 'Update data karyawan admi'),
(177, 1, '2024-10-19 10:47:47', 'Update data karyawan admi'),
(178, 1, '2024-10-19 11:00:08', 'Melakukan transaksi penjualan dengan kode TRJ241019110064'),
(179, 1, '2024-10-19 11:17:45', 'Melakukan transaksi penjualan dengan kode TRJ241019111730');

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

--
-- Struktur dari tabel `tb_app`
--

CREATE TABLE `tb_app` (
  `thermal_size` int(3) NOT NULL COMMENT 'Satuan MM',
  `logo` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_app`
--

INSERT INTO `tb_app` (`thermal_size`, `logo`) VALUES
(72, '1703483030.jpg');

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

--
-- Struktur dari tabel `tb_barang`
--

CREATE TABLE `tb_barang` (
  `id` int(11) NOT NULL,
  `kode` varchar(20) NOT NULL,
  `nama` varchar(100) NOT NULL,
  `id_kategori` int(11) DEFAULT NULL,
  `id_supplier` int(11) DEFAULT NULL,
  `harga_beli` int(11) NOT NULL,
  `tgl_kadaluarsa` date DEFAULT NULL,
  `komisi` int(11) DEFAULT NULL,
  `is_retur` int(1) NOT NULL DEFAULT 0,
  `is_multi_satuan` int(1) NOT NULL DEFAULT 0,
  `is_grosir` int(1) NOT NULL DEFAULT 0,
  `id_toko` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_barang`
--

INSERT INTO `tb_barang` (`id`, `kode`, `nama`, `id_kategori`, `id_supplier`, `harga_beli`, `tgl_kadaluarsa`, `komisi`, `is_retur`, `is_multi_satuan`, `is_grosir`, `id_toko`) VALUES
(1, '8998866107143', 'POSH MEN PERFUMED BODY SPRAY 150ML', 2, NULL, 20000, NULL, NULL, 1, 0, 0, 1),
(2, '8995182400019', 'NARMADA AIR KEMASAN 220ML', NULL, NULL, 0, '2024-11-13', NULL, 1, 1, 1, 1),
(13, '899199943874', 'Celebes air mineral', 3, 3, 15000, NULL, NULL, 1, 1, 1, 1),
(14, '899199941454', 'Beng Beng', 2, 3, 32000, '2024-01-18', NULL, 1, 1, 1, 1),
(15, '899199928137', 'Nescafe Classic', 3, 3, 3000, NULL, NULL, 1, 1, 1, 1),
(16, '899199976869', 'Air Mineral Sosro', 3, 2, 1000, NULL, NULL, 1, 1, 1, 1),
(17, '6985778598703', 'Penjepit Kertas', 1, 3, 5000, NULL, NULL, 1, 0, 0, 1),
(18, '899199959033', 'Indomie Goreng', 3, NULL, 3000, NULL, NULL, 0, 0, 0, 1),
(23, '8999999528843', 'Citra Ukuran Kecil', 4, NULL, 12000, NULL, NULL, 0, 0, 0, 1),
(24, '899199999831', 'kejrhewr', NULL, NULL, 5000, NULL, NULL, 0, 1, 1, 1);

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

--
-- Struktur dari tabel `tb_barang_grosir`
--

CREATE TABLE `tb_barang_grosir` (
  `id` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `min` int(11) NOT NULL,
  `harga` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_barang_grosir`
--

INSERT INTO `tb_barang_grosir` (`id`, `id_brg`, `id_satuan`, `min`, `harga`, `id_toko`) VALUES
(3, 13, 5, 5, 450, 1),
(4, 13, 3, 2, 16000, 1);

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

--
-- Struktur dari tabel `tb_barang_satuan`
--

CREATE TABLE `tb_barang_satuan` (
  `id` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `stok` int(11) NOT NULL,
  `isi` int(11) NOT NULL,
  `harga_jual` int(11) NOT NULL,
  `harga_beli` int(11) NOT NULL,
  `jenis` int(1) NOT NULL DEFAULT 1 COMMENT '1 = Utama, 2 = Turunan',
  `id_toko` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_barang_satuan`
--

INSERT INTO `tb_barang_satuan` (`id`, `id_brg`, `id_satuan`, `stok`, `isi`, `harga_jual`, `harga_beli`, `jenis`, `id_toko`) VALUES
(1, 1, 3, 52, 0, 25000, 0, 1, 1),
(2, 2, 1, 124, 0, 2500, 0, 1, 1),
(7, 2, 3, 7, 40, 22000, 0, 2, 1),
(18, 13, 3, 9, 0, 20000, 0, 1, 1),
(19, 13, 5, 43, 1, 500, 0, 2, 1),
(20, 14, 3, 15, 0, 36000, 0, 1, 1),
(21, 14, 1, 4, 12, 3500, 0, 2, 1),
(22, 15, 1, 4, 0, 5000, 0, 1, 1),
(23, 15, 3, 5, 10, 20000, 0, 2, 1),
(24, 16, 5, 19, 0, 5000, 0, 1, 1),
(25, 17, 3, 19, 0, 7000, 5000, 1, 1),
(26, 18, 1, 8, 0, 3500, 3000, 1, 1),
(31, 23, 1, 3, 0, 15000, 12000, 1, 1),
(32, 24, 2, 50, 0, 100000, 5000, 1, 1);

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

--
-- Struktur dari tabel `tb_barang_stok`
--

CREATE TABLE `tb_barang_stok` (
  `id` int(11) NOT NULL,
  `id_brg_satuan` int(11) NOT NULL,
  `stok` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Struktur dari tabel `tb_kategori`
--

CREATE TABLE `tb_kategori` (
  `id` int(11) NOT NULL,
  `nama` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_kategori`
--

INSERT INTO `tb_kategori` (`id`, `nama`) VALUES
(1, 'Kue'),
(2, 'Snack'),
(3, 'Minuman'),
(4, 'Kosmetik');

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

--
-- Struktur dari tabel `tb_opname_data`
--

CREATE TABLE `tb_opname_data` (
  `id` int(11) NOT NULL,
  `kode` varchar(20) NOT NULL,
  `tgl` date NOT NULL DEFAULT current_timestamp(),
  `id_admin` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_opname_data`
--

INSERT INTO `tb_opname_data` (`id`, `kode`, `tgl`, `id_admin`, `id_toko`) VALUES
(1, 'OPN240427094457', '2024-04-27', 1, 1);

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

--
-- Struktur dari tabel `tb_opname_detail`
--

CREATE TABLE `tb_opname_detail` (
  `id` int(11) NOT NULL,
  `id_opname` int(11) NOT NULL,
  `stok_sistem` int(11) NOT NULL,
  `stok_fisik` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `id_admin` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `keterangan` varchar(120) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_opname_detail`
--

INSERT INTO `tb_opname_detail` (`id`, `id_opname`, `stok_sistem`, `stok_fisik`, `id_toko`, `id_admin`, `id_satuan`, `id_brg`, `keterangan`) VALUES
(4, 0, 90, 9, 1, 4, 1, 2, ''),
(5, 0, 83, 830, 1, 4, 3, 1, ''),
(6, 0, 48, 0, 1, 2, 2, 12, ''),
(7, 0, 43, 0, 1, 2, 5, 13, ''),
(8, 1, 2, 20, 1, 1, 5, 16, ''),
(9, 1, 3, 10, 1, 1, 3, 13, ''),
(11, 0, 16, 0, 1, 1, 3, 14, '');

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

--
-- Struktur dari tabel `tb_pelanggan`
--

CREATE TABLE `tb_pelanggan` (
  `id` int(11) NOT NULL,
  `nama` varchar(50) NOT NULL,
  `nohp` varchar(13) NOT NULL,
  `email` varchar(120) NOT NULL,
  `alamat` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_pelanggan`
--

INSERT INTO `tb_pelanggan` (`id`, `nama`, `nohp`, `email`, `alamat`) VALUES
(2, 'Rifki', '08112778110', '', 'Jakarta'),
(3, 'Bagus', '0811234566', '', 'Jkt-01');

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

--
-- Struktur dari tabel `tb_pembelian_data`
--

CREATE TABLE `tb_pembelian_data` (
  `id` int(11) NOT NULL,
  `kode` varchar(20) NOT NULL,
  `id_admin` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `tgl` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_pembelian_data`
--

INSERT INTO `tb_pembelian_data` (`id`, `kode`, `id_admin`, `id_toko`, `tgl`) VALUES
(1, 'TRB231103015597', 1, 1, '2023-11-03 13:55:54'),
(2, 'TRB231103020165', 1, 1, '2023-11-03 14:01:35'),
(3, 'TRB231203035699', 4, 1, '2023-12-03 03:56:06'),
(4, 'TRB240115115294', 2, 1, '2024-01-15 11:52:04'),
(5, 'TRB240116084362', 2, 1, '2024-01-16 08:43:01'),
(6, 'TRB240116092559', 2, 1, '2024-01-16 09:25:18'),
(7, 'TRB240116092770', 2, 1, '2024-01-16 09:27:45'),
(8, 'TRB240117092917', 2, 1, '2024-01-17 09:29:59'),
(9, 'TRB240117121639', 2, 1, '2024-01-17 12:16:53'),
(10, 'TRB240119124979', 2, 1, '2024-01-19 12:49:53'),
(11, 'TRB240120054265', 2, 1, '2024-01-20 17:42:45'),
(12, 'TRB240120054324', 2, 1, '2024-01-20 17:43:34'),
(13, 'TRB240121035763', 2, 1, '2024-01-21 15:57:15'),
(14, 'TRB240307125057', 2, 1, '2024-03-07 12:50:20'),
(15, 'TRB241018055420', 1, 1, '2024-10-18 17:54:49'),
(16, 'TRB241018084051', 1, 1, '2024-10-18 20:40:45'),
(17, 'TRB241019045516', 7, 1, '2024-10-19 04:55:17');

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

--
-- Struktur dari tabel `tb_pembelian_detail`
--

CREATE TABLE `tb_pembelian_detail` (
  `id` int(11) NOT NULL,
  `id_beli` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `qty` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `id_supplier` int(11) DEFAULT NULL,
  `harga_beli` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_pembelian_detail`
--

INSERT INTO `tb_pembelian_detail` (`id`, `id_beli`, `id_brg`, `qty`, `id_satuan`, `id_supplier`, `harga_beli`, `id_toko`) VALUES
(2, 1, 2, 50, 1, NULL, 2000, 1),
(3, 2, 2, 10, 3, NULL, 20000, 1),
(5, 3, 2, 12, 1, 1, 2000, 1),
(6, 3, 1, 4, 3, 1, 20000, 1),
(12, 4, 10, 10, 0, 3, 5000, 1),
(13, 5, 12, 5, 3, 3, 45000, 1),
(14, 6, 13, 48, 5, 3, 300, 1),
(15, 7, 13, 5, 3, 3, 15000, 1),
(16, 8, 14, 5, 1, 3, 2000, 1),
(17, 9, 15, 5, 3, 3, 3000, 1),
(18, 10, 14, 10, 3, 3, 32000, 1),
(19, 10, 2, 1, 1, NULL, 2000, 1),
(20, 11, 14, 1, 3, 3, 32000, 1),
(21, 12, 14, 5, 3, 3, 20000, 1),
(22, 13, 16, 1, 5, 2, 1000, 1),
(23, 13, 14, 1, 3, 3, 32000, 1),
(24, 13, 13, 1, 3, 3, 15000, 1),
(30, 14, 23, 5, 1, 3, 12000, 1),
(33, 15, 23, 2, 1, NULL, 12000, 1),
(34, 16, 18, 1, 1, NULL, 3000, 1),
(36, 17, 23, 3, 1, NULL, 12000, 1),
(37, 0, 13, 1, 3, 3, 0, 1);

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

--
-- Struktur dari tabel `tb_penjualan_data`
--

CREATE TABLE `tb_penjualan_data` (
  `id` int(11) NOT NULL,
  `kode` varchar(20) NOT NULL,
  `id_admin` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `tgl` datetime NOT NULL DEFAULT current_timestamp(),
  `total` int(11) NOT NULL,
  `bayar` int(11) NOT NULL,
  `diskon` int(11) NOT NULL,
  `id_plg` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_penjualan_data`
--

INSERT INTO `tb_penjualan_data` (`id`, `kode`, `id_admin`, `id_toko`, `tgl`, `total`, `bayar`, `diskon`, `id_plg`) VALUES
(1, 'TRJ231007064741', 2, 1, '2023-10-06 23:47:01', 25000, 50000, 0, 0),
(2, 'TRJ231007065110', 2, 1, '2023-10-06 23:51:42', 10000, 20000, 0, 0),
(3, 'TRJ231007020946', 2, 1, '2023-10-07 07:09:49', 25000, 50000, 0, 0),
(4, 'TRJ231018060219', 2, 1, '2023-10-18 11:02:51', 2000, 50000, 0, 0),
(5, 'TRJ231025090539', 3, 1, '2023-10-25 02:05:33', 25000, 50000, 0, 0),
(6, 'TRJ231025072016', 3, 1, '2023-10-25 12:20:18', 509500, 5000000, 0, 1),
(7, 'TRJ231103020383', 1, 1, '2023-11-03 07:03:40', 22000, 50000, 0, 0),
(8, 'TRJ231120050465', 3, 1, '2023-11-20 10:04:00', 50000, 100000, 0, 0),
(9, 'TRJ231123033840', 2, 1, '2023-11-22 20:38:13', 27500, 50000, 0, 0),
(10, 'TRJ231123070094', 2, 1, '2023-11-23 00:00:48', 25000, 100000, 0, 0),
(11, 'TRJ231123072423', 2, 1, '2023-11-23 00:24:55', 14500, 50000, 1, 0),
(12, 'TRJ231125124460', 2, 1, '2023-11-24 17:44:22', 31000, 50000, 0, 0),
(13, 'TRJ231125124741', 2, 1, '2023-11-24 17:47:30', 33500, 50000, 0, 0),
(14, 'TRJ231128052132', 2, 1, '2023-11-28 17:21:43', 366833, 400000, 0, 0),
(15, 'TRJ231128052382', 2, 1, '2023-11-28 17:23:37', 366833, 400000, 0, 0),
(16, 'TRJ231128052432', 2, 1, '2023-11-28 17:24:49', 8500, 10000, 0, 0),
(17, 'TRJ231128100832', 3, 1, '2023-11-28 22:08:36', 33500, 100000, 0, 0),
(18, 'TRJ231128105964', 3, 1, '2023-11-28 22:59:27', 33500, 100000, 0, 0),
(19, 'TRJ231128112252', 3, 1, '2023-11-28 23:22:45', 33500, 100000, 0, 0),
(20, 'TRJ231128114417', 3, 1, '2023-11-28 23:44:37', 30000, 50000, 0, 0),
(21, 'TRJ231128115573', 3, 1, '2023-11-28 23:55:49', 55000, 100000, 0, 0),
(22, 'TRJ231129120112', 3, 1, '2023-11-29 00:01:12', 142500, 200000, 0, 0),
(23, 'TRJ231129121061', 3, 1, '2023-11-29 00:10:30', 15000, 20000, 0, 0),
(24, 'TRJ231203035936', 3, 1, '2023-12-03 03:59:13', 322000, 500000, 0, 0),
(25, 'TRJ231203064031', 2, 1, '2023-12-03 18:40:50', 2500, 50000, 0, 0),
(26, 'TRJ231216082940', 2, 1, '2023-12-16 20:29:44', 27500, 50000, 0, 0),
(27, 'TRJ240116093486', 2, 1, '2024-01-16 09:34:26', 22250, 50000, 0, 2),
(28, 'TRJ240116082265', 2, 1, '2024-01-16 20:22:16', 20000, 20000, 500, 0),
(29, 'TRJ240117112015', 2, 1, '2024-01-17 11:20:27', 20000, 50000, 0, 0),
(30, 'TRJ240117114948', 2, 1, '2024-01-17 11:49:08', 3500, 20000, 5000, 0),
(31, 'TRJ240119125191', 2, 1, '2024-01-19 12:51:02', 36000, 100000, 0, 0),
(32, 'TRJ240120053873', 3, 1, '2024-01-20 17:38:13', 36000, 50000, 0, 0),
(33, 'TRJ240121040221', 2, 1, '2024-01-21 16:02:49', 41000, 100000, 0, 0),
(34, 'TRJ240223104377', 2, 1, '2024-02-23 10:43:39', 75000, 100000, 0, 2),
(35, 'TRJ240223105615', 3, 1, '2024-02-23 10:56:42', 99500, 100000, 5000, 0),
(36, 'TRJ240223110750', 2, 1, '2024-02-23 11:07:32', 7000, 7000, 0, 0),
(37, 'TRJ240307125661', 2, 1, '2024-03-07 12:56:36', 15000, 20000, 0, 0),
(38, 'TRJ240525125164', 1, 1, '2024-05-25 12:51:14', 22000, 50000, 10000, 0),
(39, 'TRJ241018055113', 1, 1, '2024-10-18 17:51:33', 15000, 20000, 0, 0),
(40, 'TRJ241018061487', 1, 1, '2024-10-18 18:14:48', 36000, 40000, 0, 0),
(41, 'TRJ241018061634', 1, 1, '2024-10-18 18:16:00', 36000, 100000, 0, 0),
(42, 'TRJ241018082831', 1, 1, '2024-10-18 20:28:21', 15000, 20000, 0, 0),
(43, 'TRJ241018084357', 1, 1, '2024-10-18 20:43:07', 3500, 4000, 0, 0),
(44, 'TRJ241018084431', 1, 1, '2024-10-18 20:44:21', 3500, 4500, 0, 0),
(45, 'TRJ241019042070', 1, 1, '2024-10-19 04:20:46', 3500, 50000, 0, 0),
(46, 'TRJ241019043998', 6, 1, '2024-10-19 04:39:17', 36000, 100000, 0, 0),
(47, 'TRJ241019045147', 6, 1, '2024-10-19 04:51:01', 15000, 20000, 0, 0),
(48, 'TRJ241019045317', 6, 1, '2024-10-19 04:53:43', 45000, 70000, 0, 0),
(49, 'TRJ241019110064', 1, 1, '2024-10-19 11:00:07', 5000, 10000, 0, 0),
(50, 'TRJ241019111730', 1, 1, '2024-10-19 11:17:45', 20000, 70000, 0, 0);

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

--
-- Struktur dari tabel `tb_penjualan_detail`
--

CREATE TABLE `tb_penjualan_detail` (
  `id` int(11) NOT NULL,
  `id_jual` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `qty` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `harga_jual` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `id_admin` int(11) NOT NULL,
  `is_grosir` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_penjualan_detail`
--

INSERT INTO `tb_penjualan_detail` (`id`, `id_jual`, `id_brg`, `qty`, `id_satuan`, `harga_jual`, `id_toko`, `id_admin`, `is_grosir`) VALUES
(2, 1, 1, 1, 3, 25000, 1, 2, 0),
(3, 2, 3, 5, 1, 2000, 1, 2, 0),
(4, 3, 1, 1, 3, 25000, 1, 2, 0),
(7, 4, 3, 1, 1, 2000, 1, 2, 0),
(8, 5, 1, 1, 3, 25000, 1, 3, 0),
(12, 6, 5, 1, 1, 350000, 1, 3, 0),
(13, 6, 2, 1, 1, 2500, 1, 3, 0),
(14, 6, 1, 1, 3, 25000, 1, 3, 0),
(15, 6, 6, 1, 1, 130000, 1, 3, 0),
(16, 6, 3, 1, 1, 2000, 1, 3, 0),
(19, 7, 2, 1, 3, 22000, 1, 1, 0),
(20, 8, 1, 2, 3, 25000, 1, 3, 0),
(22, 9, 2, 1, 1, 2500, 1, 2, 0),
(23, 9, 1, 1, 3, 25000, 1, 2, 0),
(24, 10, 1, 1, 3, 25000, 1, 2, 0),
(25, 11, 7, 2, 1, 6000, 1, 2, 0),
(26, 11, 2, 1, 1, 2500, 1, 2, 0),
(27, 12, 7, 1, 1, 6000, 1, 2, 0),
(28, 12, 1, 1, 3, 25000, 1, 2, 0),
(29, 13, 7, 1, 1, 6000, 1, 2, 0),
(30, 13, 1, 1, 3, 25000, 1, 2, 0),
(31, 13, 2, 1, 1, 2500, 1, 2, 0),
(32, 14, 1, 1, 3, 25000, 1, 2, 0),
(33, 14, 2, 1, 1, 2500, 1, 2, 0),
(34, 14, 7, 1, 1, 6000, 1, 2, 0),
(35, 14, 8, 1, 3, 333333, 1, 2, 0),
(36, 15, 8, 1, 3, 333333, 1, 2, 0),
(37, 15, 7, 1, 1, 6000, 1, 2, 0),
(38, 15, 2, 1, 1, 2500, 1, 2, 0),
(39, 15, 1, 1, 3, 25000, 1, 2, 0),
(40, 16, 7, 1, 1, 6000, 1, 2, 0),
(41, 16, 2, 1, 1, 2500, 1, 2, 0),
(42, 17, 1, 1, 3, 25000, 1, 3, 0),
(43, 17, 2, 1, 1, 2500, 1, 3, 0),
(44, 17, 7, 1, 1, 6000, 1, 3, 0),
(45, 18, 7, 1, 1, 6000, 1, 3, 0),
(46, 18, 2, 1, 1, 2500, 1, 3, 0),
(47, 18, 1, 1, 3, 25000, 1, 3, 0),
(48, 19, 7, 1, 1, 6000, 1, 3, 0),
(49, 19, 2, 1, 1, 2500, 1, 3, 0),
(50, 19, 1, 1, 3, 25000, 1, 3, 0),
(51, 20, 2, 2, 1, 2500, 1, 3, 0),
(52, 20, 1, 1, 3, 25000, 1, 3, 0),
(53, 21, 2, 2, 1, 2500, 1, 3, 0),
(54, 21, 1, 2, 3, 25000, 1, 3, 0),
(55, 22, 2, 7, 1, 2500, 1, 3, 0),
(56, 22, 1, 5, 3, 25000, 1, 3, 0),
(57, 23, 2, 6, 1, 2500, 1, 3, 0),
(60, 24, 2, 1, 3, 22000, 1, 3, 0),
(61, 24, 1, 12, 3, 25000, 1, 3, 0),
(62, 25, 2, 1, 1, 2500, 1, 2, 0),
(65, 26, 1, 1, 3, 25000, 1, 2, 0),
(66, 26, 2, 1, 1, 2500, 1, 2, 0),
(80, 27, 13, 5, 5, 450, 1, 2, 1),
(81, 27, 13, 1, 3, 20000, 1, 2, 0),
(82, 28, 13, 1, 3, 20000, 1, 2, 0),
(86, 29, 13, 1, 3, 20000, 1, 2, 0),
(88, 30, 14, 1, 1, 3500, 1, 2, 0),
(91, 31, 14, 1, 3, 36000, 1, 2, 0),
(94, 32, 14, 0, 3, 36000, 1, 3, 0),
(95, 33, 16, 1, 5, 5000, 1, 2, 0),
(96, 33, 14, 1, 3, 36000, 1, 2, 0),
(97, 34, 1, 3, 3, 25000, 1, 2, 0),
(100, 35, 14, 2, 3, 36000, 1, 3, 0),
(101, 35, 13, 1, 3, 20000, 1, 3, 0),
(102, 35, 2, 1, 1, 2500, 1, 3, 0),
(103, 35, 15, 1, 1, 5000, 1, 3, 0),
(104, 36, 17, 1, 3, 7000, 1, 2, 0),
(105, 0, 14, 1, 1, 3500, 1, 3, 0),
(108, 37, 23, 1, 1, 15000, 1, 2, 0),
(109, 38, 2, 1, 3, 22000, 1, 1, 0),
(112, 39, 23, 1, 1, 15000, 1, 1, 0),
(113, 40, 14, 1, 3, 36000, 1, 1, 0),
(114, 41, 14, 1, 3, 36000, 1, 1, 0),
(115, 42, 23, 1, 1, 15000, 1, 1, 0),
(117, 43, 18, 1, 1, 3500, 1, 1, 0),
(118, 44, 18, 1, 1, 3500, 1, 1, 0),
(119, 45, 18, 1, 1, 3500, 1, 1, 0),
(120, 46, 14, 1, 3, 36000, 1, 6, 0),
(121, 47, 23, 1, 1, 15000, 1, 6, 0),
(122, 48, 23, 3, 1, 15000, 1, 6, 0),
(124, 49, 16, 1, 5, 5000, 1, 1, 0),
(125, 50, 13, 1, 3, 20000, 1, 1, 0),
(126, 0, 13, 1, 5, 500, 1, 1, 0);

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

--
-- Struktur dari tabel `tb_penjualan_retur`
--

CREATE TABLE `tb_penjualan_retur` (
  `id` int(11) NOT NULL,
  `id_jual` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `qty` int(11) NOT NULL,
  `jenis` int(1) NOT NULL COMMENT '1 = Ganti Baru, 2 = uang Kembali',
  `ket` varchar(120) NOT NULL,
  `tgl` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_penjualan_retur`
--

INSERT INTO `tb_penjualan_retur` (`id`, `id_jual`, `id_brg`, `id_satuan`, `id_toko`, `qty`, `jenis`, `ket`, `tgl`) VALUES
(1, 8, 1, 3, 1, 1, 1, 'Produk rusak', '2023-10-25 19:17:51'),
(2, 95, 16, 5, 1, 1, 1, 'tes', '2024-01-28 09:41:39'),
(3, 95, 16, 5, 1, 1, 1, 'ter', '2024-01-28 09:42:08'),
(4, 94, 14, 3, 1, 1, 2, 'kmsnme', '2024-01-28 09:44:23');

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

--
-- Struktur dari tabel `tb_riwayat_stok`
--

CREATE TABLE `tb_riwayat_stok` (
  `id` int(11) NOT NULL,
  `id_brg` int(11) NOT NULL,
  `jml` int(11) NOT NULL,
  `stok_awal` int(11) NOT NULL,
  `stok_akhir` int(11) NOT NULL,
  `status` int(1) NOT NULL DEFAULT 1 COMMENT '1 = masuk, 2 = keluar',
  `id_satuan` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `id_admin` int(11) NOT NULL,
  `tgl` datetime NOT NULL DEFAULT current_timestamp(),
  `keterangan` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_riwayat_stok`
--

INSERT INTO `tb_riwayat_stok` (`id`, `id_brg`, `jml`, `stok_awal`, `stok_akhir`, `status`, `id_satuan`, `id_toko`, `id_admin`, `tgl`, `keterangan`) VALUES
(1, 1, 86, 0, 86, 0, 3, 1, 1, '2023-10-07 05:29:53', NULL),
(2, 2, 91, 0, 91, 0, 1, 1, 1, '2023-10-07 05:29:53', NULL),
(3, 3, 604, 0, 604, 0, 1, 1, 1, '2023-10-07 05:29:53', NULL),
(4, 4, 0, 0, 0, 0, 1, 1, 1, '2023-10-07 05:29:53', NULL),
(5, 5, 1, 0, 1, 0, 1, 1, 1, '2023-10-07 05:29:53', NULL),
(6, 6, 99, 0, 99, 0, 1, 1, 1, '2023-10-07 05:29:53', NULL),
(7, 1, 1, 86, 85, 2, 3, 1, 2, '2023-10-07 06:47:01', NULL),
(8, 3, 5, 604, 599, 2, 1, 1, 2, '2023-10-07 06:51:42', NULL),
(9, 1, 1, 85, 84, 2, 3, 1, 2, '2023-10-07 14:09:49', NULL),
(10, 3, 1, 599, 598, 2, 1, 1, 2, '2023-10-18 18:02:51', NULL),
(11, 1, 1, 84, 83, 2, 3, 1, 3, '2023-10-25 09:05:33', NULL),
(12, 5, 1, 1, 0, 2, 1, 1, 3, '2023-10-25 19:20:18', NULL),
(13, 2, 1, 91, 90, 2, 1, 1, 3, '2023-10-25 19:20:18', NULL),
(14, 1, 1, 84, 83, 2, 3, 1, 3, '2023-10-25 19:20:18', NULL),
(15, 6, 1, 99, 98, 2, 1, 1, 3, '2023-10-25 19:20:18', NULL),
(16, 3, 1, 598, 597, 2, 1, 1, 3, '2023-10-25 19:20:18', NULL),
(17, 2, 50, 90, 140, 1, 1, 1, 1, '2023-11-03 13:55:54', NULL),
(18, 2, 10, 0, 10, 1, 3, 1, 1, '2023-11-03 14:01:35', NULL),
(19, 2, 1, 10, 9, 2, 3, 1, 1, '2023-11-03 14:03:40', NULL),
(20, 1, 2, 83, 81, 2, 3, 1, 3, '2023-11-20 17:04:00', NULL),
(21, 2, 1, 140, 139, 2, 1, 1, 2, '2023-11-23 03:38:13', NULL),
(22, 1, 1, 81, 80, 2, 3, 1, 2, '2023-11-23 03:38:13', NULL),
(23, 1, 1, 80, 79, 2, 3, 1, 2, '2023-11-23 07:00:48', NULL),
(24, 7, 10, 0, 10, 1, 1, 1, 2, '2023-11-23 07:20:38', NULL),
(25, 7, 2, 10, 8, 2, 1, 1, 2, '2023-11-23 07:24:55', NULL),
(26, 2, 1, 139, 138, 2, 1, 1, 2, '2023-11-23 07:24:55', NULL),
(27, 7, 1, 8, 7, 2, 1, 1, 2, '2023-11-25 00:44:22', NULL),
(28, 1, 1, 79, 78, 2, 3, 1, 2, '2023-11-25 00:44:22', NULL),
(29, 7, 1, 7, 6, 2, 1, 1, 2, '2023-11-25 00:47:30', NULL),
(30, 1, 1, 78, 77, 2, 3, 1, 2, '2023-11-25 00:47:30', NULL),
(31, 2, 1, 138, 137, 2, 1, 1, 2, '2023-11-25 00:47:30', NULL),
(32, 8, 2, 0, 2, 1, 3, 1, 4, '2023-11-28 17:00:26', NULL),
(33, 1, 1, 77, 76, 2, 3, 1, 2, '2023-11-28 17:21:43', NULL),
(34, 2, 1, 137, 136, 2, 1, 1, 2, '2023-11-28 17:21:43', NULL),
(35, 7, 1, 6, 5, 2, 1, 1, 2, '2023-11-28 17:21:43', NULL),
(36, 8, 1, 2, 1, 2, 3, 1, 2, '2023-11-28 17:21:43', NULL),
(37, 8, 1, 1, 0, 2, 3, 1, 2, '2023-11-28 17:23:37', NULL),
(38, 7, 1, 5, 4, 2, 1, 1, 2, '2023-11-28 17:23:37', NULL),
(39, 2, 1, 136, 135, 2, 1, 1, 2, '2023-11-28 17:23:37', NULL),
(40, 1, 1, 76, 75, 2, 3, 1, 2, '2023-11-28 17:23:37', NULL),
(41, 7, 1, 4, 3, 2, 1, 1, 2, '2023-11-28 17:24:49', NULL),
(42, 2, 1, 135, 134, 2, 1, 1, 2, '2023-11-28 17:24:49', NULL),
(43, 1, 1, 75, 74, 2, 3, 1, 3, '2023-11-28 22:08:36', NULL),
(44, 2, 1, 134, 133, 2, 1, 1, 3, '2023-11-28 22:08:36', NULL),
(45, 7, 1, 3, 2, 2, 1, 1, 3, '2023-11-28 22:08:36', NULL),
(46, 7, 1, 2, 1, 2, 1, 1, 3, '2023-11-28 22:59:27', NULL),
(47, 2, 1, 133, 132, 2, 1, 1, 3, '2023-11-28 22:59:27', NULL),
(48, 1, 1, 74, 73, 2, 3, 1, 3, '2023-11-28 22:59:27', NULL),
(49, 7, 1, 1, 0, 2, 1, 1, 3, '2023-11-28 23:22:45', NULL),
(50, 2, 1, 132, 131, 2, 1, 1, 3, '2023-11-28 23:22:45', NULL),
(51, 1, 1, 73, 72, 2, 3, 1, 3, '2023-11-28 23:22:45', NULL),
(52, 2, 2, 131, 129, 2, 1, 1, 3, '2023-11-28 23:44:37', NULL),
(53, 1, 1, 72, 71, 2, 3, 1, 3, '2023-11-28 23:44:37', NULL),
(54, 2, 2, 129, 127, 2, 1, 1, 3, '2023-11-28 23:55:49', NULL),
(55, 1, 2, 71, 69, 2, 3, 1, 3, '2023-11-28 23:55:49', NULL),
(56, 2, 7, 127, 120, 2, 1, 1, 3, '2023-11-29 00:01:12', NULL),
(57, 1, 5, 69, 64, 2, 3, 1, 3, '2023-11-29 00:01:12', NULL),
(58, 2, 6, 120, 114, 2, 1, 1, 3, '2023-11-29 00:10:30', NULL),
(59, 2, 12, 114, 126, 1, 1, 1, 4, '2023-12-03 03:56:06', NULL),
(60, 1, 4, 64, 68, 1, 3, 1, 4, '2023-12-03 03:56:06', NULL),
(61, 2, 1, 9, 8, 2, 3, 1, 3, '2023-12-03 03:59:13', NULL),
(62, 1, 12, 68, 56, 2, 3, 1, 3, '2023-12-03 03:59:13', NULL),
(63, 2, 1, 126, 125, 2, 1, 1, 2, '2023-12-03 18:40:50', NULL),
(64, 1, 1, 56, 55, 2, 3, 1, 2, '2023-12-16 20:29:44', NULL),
(65, 2, 1, 125, 124, 2, 1, 1, 2, '2023-12-16 20:29:44', NULL),
(66, 10, 50, 0, 50, 1, 1, 1, 2, '2024-01-15 11:50:35', NULL),
(67, 11, 5, 0, 5, 1, 3, 1, 2, '2024-01-16 08:26:00', NULL),
(68, 12, 48, 0, 48, 1, 2, 1, 2, '2024-01-16 08:28:11', NULL),
(69, 12, 5, 0, 5, 1, 3, 1, 2, '2024-01-16 08:43:01', NULL),
(70, 13, 1, 0, 1, 1, 3, 1, 2, '2024-01-16 09:10:35', NULL),
(71, 13, 48, 0, 48, 1, 5, 1, 2, '2024-01-16 09:25:18', NULL),
(72, 13, 5, 1, 6, 1, 3, 1, 2, '2024-01-16 09:27:45', NULL),
(73, 13, 5, 48, 43, 2, 5, 1, 2, '2024-01-16 09:34:26', NULL),
(74, 13, 1, 6, 5, 2, 3, 1, 2, '2024-01-16 09:34:26', NULL),
(75, 13, 1, 5, 4, 2, 3, 1, 2, '2024-01-16 20:22:16', NULL),
(76, 14, 5, 0, 5, 1, 3, 1, 2, '2024-01-17 09:01:19', NULL),
(77, 14, 5, 0, 5, 1, 1, 1, 2, '2024-01-17 09:29:59', NULL),
(78, 13, 1, 4, 3, 2, 3, 1, 2, '2024-01-17 11:20:27', NULL),
(79, 14, 1, 5, 4, 2, 1, 1, 2, '2024-01-17 11:49:08', NULL),
(80, 15, 5, 0, 5, 1, 1, 1, 2, '2024-01-17 12:15:52', NULL),
(81, 15, 5, 0, 5, 1, 3, 1, 2, '2024-01-17 12:16:53', NULL),
(82, 14, 10, 5, 15, 1, 3, 1, 2, '2024-01-19 12:49:53', NULL),
(83, 2, 1, 124, 125, 1, 1, 1, 2, '2024-01-19 12:49:53', NULL),
(84, 14, 1, 15, 14, 2, 3, 1, 2, '2024-01-19 12:51:02', NULL),
(85, 14, 1, 14, 13, 2, 3, 1, 3, '2024-01-20 17:38:13', NULL),
(86, 14, 1, 13, 14, 1, 3, 1, 2, '2024-01-20 17:42:45', NULL),
(87, 14, 5, 14, 19, 1, 3, 1, 2, '2024-01-20 17:43:34', NULL),
(88, 16, 1, 0, 1, 1, 5, 1, 2, '2024-01-21 15:57:15', NULL),
(89, 14, 1, 19, 20, 1, 3, 1, 2, '2024-01-21 15:57:15', NULL),
(90, 13, 1, 3, 4, 1, 3, 1, 2, '2024-01-21 15:57:15', NULL),
(91, 16, 1, 1, 0, 2, 5, 1, 2, '2024-01-21 16:02:49', NULL),
(92, 14, 1, 20, 19, 2, 3, 1, 2, '2024-01-21 16:02:49', NULL),
(93, 1, 3, 55, 52, 2, 3, 1, 2, '2024-02-23 10:43:39', NULL),
(94, 14, 2, 20, 18, 2, 3, 1, 3, '2024-02-23 10:56:42', NULL),
(95, 13, 1, 4, 3, 2, 3, 1, 3, '2024-02-23 10:56:42', NULL),
(96, 2, 1, 125, 124, 2, 1, 1, 3, '2024-02-23 10:56:42', NULL),
(97, 15, 1, 5, 4, 2, 1, 1, 3, '2024-02-23 10:56:42', NULL),
(98, 17, 20, 0, 20, 1, 3, 1, 2, '2024-02-23 11:06:23', NULL),
(99, 17, 1, 20, 19, 2, 3, 1, 2, '2024-02-23 11:07:32', NULL),
(100, 18, 10, 0, 10, 1, 1, 1, 2, '2024-02-23 18:40:41', NULL),
(101, 19, 50, 0, 50, 1, 5, 1, 1, '2024-02-23 19:08:48', NULL),
(102, 20, 100, 0, 100, 1, 3, 1, 1, '2024-02-23 19:14:00', NULL),
(103, 21, 1231, 0, 1231, 1, 5, 1, 1, '2024-02-23 19:42:25', NULL),
(104, 22, 500, 0, 500, 1, 2, 1, 1, '2024-03-07 12:31:15', NULL),
(105, 23, 5, 0, 5, 1, 1, 1, 2, '2024-03-07 12:50:20', NULL),
(106, 23, 1, 5, 4, 2, 1, 1, 2, '2024-03-07 12:56:36', NULL),
(107, 24, 50, 0, 50, 1, 3, 1, 1, '2024-03-09 10:57:19', NULL),
(108, 25, 10, 0, 10, 1, 5, 1, 1, '2024-03-09 13:39:24', NULL),
(109, 16, 20, 2, 20, 20, 5, 1, 1, '2024-04-27 09:44:01', 'Stok Opname'),
(110, 13, 10, 3, 10, 10, 3, 1, 1, '2024-04-27 09:44:01', 'Stok Opname'),
(111, 2, 1, 8, 7, 2, 3, 1, 1, '2024-05-25 12:51:14', NULL),
(112, 23, 1, 4, 3, 2, 1, 1, 1, '2024-10-18 17:51:33', NULL),
(113, 23, 2, 3, 5, 1, 1, 1, 1, '2024-10-18 17:54:49', NULL),
(114, 14, 1, 18, 17, 2, 3, 1, 1, '2024-10-18 18:14:48', NULL),
(115, 14, 1, 17, 16, 2, 3, 1, 1, '2024-10-18 18:16:00', NULL),
(116, 23, 1, 5, 4, 2, 1, 1, 1, '2024-10-18 20:28:21', NULL),
(117, 18, 1, 10, 11, 1, 1, 1, 1, '2024-10-18 20:40:45', NULL),
(118, 18, 1, 11, 10, 2, 1, 1, 1, '2024-10-18 20:43:07', NULL),
(119, 18, 1, 10, 9, 2, 1, 1, 1, '2024-10-18 20:44:21', NULL),
(120, 18, 1, 9, 8, 2, 1, 1, 1, '2024-10-19 04:20:46', NULL),
(121, 14, 1, 16, 15, 2, 3, 1, 6, '2024-10-19 04:39:17', NULL),
(122, 23, 1, 4, 3, 2, 1, 1, 6, '2024-10-19 04:51:01', NULL),
(123, 23, 3, 3, 0, 2, 1, 1, 6, '2024-10-19 04:53:43', NULL),
(124, 23, 3, 0, 3, 1, 1, 1, 7, '2024-10-19 04:55:17', NULL),
(125, 16, 1, 20, 19, 2, 5, 1, 1, '2024-10-19 11:00:07', NULL),
(126, 13, 1, 10, 9, 2, 3, 1, 1, '2024-10-19 11:17:45', NULL);

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

--
-- Struktur dari tabel `tb_riwayat_transaksi`
--

CREATE TABLE `tb_riwayat_transaksi` (
  `id` int(11) NOT NULL,
  `kode` varchar(20) NOT NULL,
  `tgl` datetime NOT NULL DEFAULT current_timestamp(),
  `id_admin` int(11) NOT NULL,
  `total` int(11) NOT NULL,
  `id_toko` int(11) NOT NULL,
  `jenis` int(1) NOT NULL DEFAULT 1 COMMENT '1 = Penjualan, 2 = Pembelian'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_riwayat_transaksi`
--

INSERT INTO `tb_riwayat_transaksi` (`id`, `kode`, `tgl`, `id_admin`, `total`, `id_toko`, `jenis`) VALUES
(1, 'TRJ231007064741', '2023-10-07 06:47:01', 2, 25000, 1, 1),
(2, 'TRJ231007065110', '2023-10-07 06:51:42', 2, 10000, 1, 1),
(3, 'TRJ231007020946', '2023-10-07 14:09:49', 2, 25000, 1, 1),
(4, 'TRJ231018060219', '2023-10-18 18:02:51', 2, 2000, 1, 1),
(5, 'TRJ231025090539', '2023-10-25 09:05:33', 3, 25000, 1, 1),
(6, 'TRJ231025072016', '2023-10-25 19:20:18', 3, 509500, 1, 1),
(7, 'TRB231103015597', '2023-11-03 13:55:54', 1, 100000, 1, 2),
(8, 'TRB231103020165', '2023-11-03 14:01:35', 1, 200000, 1, 2),
(9, 'TRJ231103020383', '2023-11-03 14:03:40', 1, 22000, 1, 1),
(10, 'TRJ231120050465', '2023-11-20 17:04:00', 3, 50000, 1, 1),
(11, 'TRJ231123033840', '2023-11-23 03:38:13', 2, 27500, 1, 1),
(12, 'TRJ231123070094', '2023-11-23 07:00:48', 2, 25000, 1, 1),
(13, 'TRJ231123072423', '2023-11-23 07:24:55', 2, 14500, 1, 1),
(14, 'TRJ231125124460', '2023-11-25 00:44:22', 2, 31000, 1, 1),
(15, 'TRJ231125124741', '2023-11-25 00:47:30', 2, 33500, 1, 1),
(16, 'TRJ231128052132', '2023-11-28 17:21:43', 2, 366833, 1, 1),
(17, 'TRJ231128052382', '2023-11-28 17:23:37', 2, 366833, 1, 1),
(18, 'TRJ231128052432', '2023-11-28 17:24:49', 2, 8500, 1, 1),
(19, 'TRJ231128100832', '2023-11-28 22:08:36', 3, 33500, 1, 1),
(20, 'TRJ231128105964', '2023-11-28 22:59:27', 3, 33500, 1, 1),
(21, 'TRJ231128112252', '2023-11-28 23:22:45', 3, 33500, 1, 1),
(22, 'TRJ231128114417', '2023-11-28 23:44:37', 3, 30000, 1, 1),
(23, 'TRJ231128115573', '2023-11-28 23:55:49', 3, 55000, 1, 1),
(24, 'TRJ231129120112', '2023-11-29 00:01:12', 3, 142500, 1, 1),
(25, 'TRJ231129121061', '2023-11-29 00:10:30', 3, 15000, 1, 1),
(26, 'TRB231203035699', '2023-12-03 03:56:06', 4, 104000, 1, 2),
(27, 'TRJ231203035936', '2023-12-03 03:59:13', 3, 322000, 1, 1),
(28, 'TRJ231203064031', '2023-12-03 18:40:50', 2, 2500, 1, 1),
(29, 'TRJ231216082940', '2023-12-16 20:29:44', 2, 27500, 1, 1),
(30, 'TRB240115115294', '2024-01-15 11:52:04', 2, 50000, 1, 2),
(31, 'TRB240116084362', '2024-01-16 08:43:01', 2, 225000, 1, 2),
(32, 'TRB240116092559', '2024-01-16 09:25:18', 2, 14400, 1, 2),
(33, 'TRB240116092770', '2024-01-16 09:27:45', 2, 75000, 1, 2),
(34, 'TRJ240116093486', '2024-01-16 09:34:26', 2, 22250, 1, 1),
(35, 'TRJ240116082265', '2024-01-16 20:22:16', 2, 20000, 1, 1),
(36, 'TRB240117092917', '2024-01-17 09:29:59', 2, 10000, 1, 2),
(37, 'TRJ240117112015', '2024-01-17 11:20:27', 2, 20000, 1, 1),
(38, 'TRJ240117114948', '2024-01-17 11:49:08', 2, 3500, 1, 1),
(39, 'TRB240117121639', '2024-01-17 12:16:53', 2, 15000, 1, 2),
(40, 'TRB240119124979', '2024-01-19 12:49:53', 2, 322000, 1, 2),
(41, 'TRJ240119125191', '2024-01-19 12:51:02', 2, 36000, 1, 1),
(42, 'TRJ240120053873', '2024-01-20 17:38:13', 3, 0, 1, 1),
(43, 'TRB240120054265', '2024-01-20 17:42:45', 2, 32000, 1, 2),
(44, 'TRB240120054324', '2024-01-20 17:43:34', 2, 100000, 1, 2),
(45, 'TRB240121035763', '2024-01-21 15:57:15', 2, 48000, 1, 2),
(46, 'TRJ240121040221', '2024-01-21 16:02:49', 2, 41000, 1, 1),
(47, 'TRJ240223104377', '2024-02-23 10:43:39', 2, 75000, 1, 1),
(48, 'TRJ240223105615', '2024-02-23 10:56:42', 3, 99500, 1, 1),
(49, 'TRJ240223110750', '2024-02-23 11:07:32', 2, 7000, 1, 1),
(50, 'TRB240307125057', '2024-03-07 12:50:20', 2, 60000, 1, 2),
(51, 'TRJ240307125661', '2024-03-07 12:56:36', 2, 15000, 1, 1),
(52, 'TRJ240525125164', '2024-05-25 12:51:14', 1, 22000, 1, 1),
(53, 'TRJ241018055113', '2024-10-18 17:51:33', 1, 15000, 1, 1),
(54, 'TRB241018055420', '2024-10-18 17:54:49', 1, 24000, 1, 2),
(55, 'TRJ241018061487', '2024-10-18 18:14:48', 1, 36000, 1, 1),
(56, 'TRJ241018061634', '2024-10-18 18:16:00', 1, 36000, 1, 1),
(57, 'TRJ241018082831', '2024-10-18 20:28:21', 1, 15000, 1, 1),
(58, 'TRB241018084051', '2024-10-18 20:40:45', 1, 3000, 1, 2),
(59, 'TRJ241018084357', '2024-10-18 20:43:07', 1, 3500, 1, 1),
(60, 'TRJ241018084431', '2024-10-18 20:44:21', 1, 3500, 1, 1),
(61, 'TRJ241019042070', '2024-10-19 04:20:46', 1, 3500, 1, 1),
(62, 'TRJ241019043998', '2024-10-19 04:39:17', 6, 36000, 1, 1),
(63, 'TRJ241019045147', '2024-10-19 04:51:01', 6, 15000, 1, 1),
(64, 'TRJ241019045317', '2024-10-19 04:53:43', 6, 45000, 1, 1),
(65, 'TRB241019045516', '2024-10-19 04:55:17', 7, 36000, 1, 2),
(66, 'TRJ241019110064', '2024-10-19 11:00:07', 1, 5000, 1, 1),
(67, 'TRJ241019111730', '2024-10-19 11:17:45', 1, 20000, 1, 1);

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

--
-- Struktur dari tabel `tb_satuan`
--

CREATE TABLE `tb_satuan` (
  `id` int(11) NOT NULL,
  `nama` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_satuan`
--

INSERT INTO `tb_satuan` (`id`, `nama`) VALUES
(1, 'Pcs'),
(2, 'Botol'),
(3, 'Dus'),
(4, 'Slice'),
(5, 'Cup');

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

--
-- Struktur dari tabel `tb_supplier`
--

CREATE TABLE `tb_supplier` (
  `id` int(11) NOT NULL,
  `nama` varchar(100) NOT NULL,
  `nohp` varchar(13) NOT NULL,
  `alamat` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_supplier`
--

INSERT INTO `tb_supplier` (`id`, `nama`, `nohp`, `alamat`) VALUES
(1, 'g', '63', 'gsgs'),
(2, 'UMKM IBU Eka', '08', 'H'),
(3, 'CV. Sedia kala', '4', '3');

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

--
-- Struktur dari tabel `tb_toko`
--

CREATE TABLE `tb_toko` (
  `id` int(11) NOT NULL,
  `nama` varchar(120) NOT NULL,
  `alamat` varchar(150) NOT NULL,
  `cabang` int(1) NOT NULL DEFAULT 2 COMMENT '1 = Pusat, 2 = cabang'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data untuk tabel `tb_toko`
--

INSERT INTO `tb_toko` (`id`, `nama`, `alamat`, `cabang`) VALUES
(1, 'Ci Mart', 'Jln Raden Berneng No 29, Bentek, Lombok Utara', 1),
(2, 'Ci Mart 2', 'Jln Raya Tanjung, No 09, Desa Tanjung, Lombok Utara', 2),
(6, 'Ci Mart 3', 'Jl Yusuf Hamka, No 30, Lotim, NTB', 2);

--
-- Indeks untuk tabel `tb_aktivitas`
--
ALTER TABLE `tb_aktivitas`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_barang`
--
ALTER TABLE `tb_barang`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_barang_grosir`
--
ALTER TABLE `tb_barang_grosir`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_barang_satuan`
--
ALTER TABLE `tb_barang_satuan`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_barang_stok`
--
ALTER TABLE `tb_barang_stok`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_kategori`
--
ALTER TABLE `tb_kategori`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_opname_data`
--
ALTER TABLE `tb_opname_data`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_opname_detail`
--
ALTER TABLE `tb_opname_detail`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_pelanggan`
--
ALTER TABLE `tb_pelanggan`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_pembelian_data`
--
ALTER TABLE `tb_pembelian_data`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_pembelian_detail`
--
ALTER TABLE `tb_pembelian_detail`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_penjualan_data`
--
ALTER TABLE `tb_penjualan_data`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_penjualan_detail`
--
ALTER TABLE `tb_penjualan_detail`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_penjualan_retur`
--
ALTER TABLE `tb_penjualan_retur`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_riwayat_stok`
--
ALTER TABLE `tb_riwayat_stok`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_riwayat_transaksi`
--
ALTER TABLE `tb_riwayat_transaksi`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_satuan`
--
ALTER TABLE `tb_satuan`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_supplier`
--
ALTER TABLE `tb_supplier`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `tb_toko`
--
ALTER TABLE `tb_toko`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT untuk tabel `tb_aktivitas`
--
ALTER TABLE `tb_aktivitas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=180;

--
-- AUTO_INCREMENT untuk tabel `tb_barang`
--
ALTER TABLE `tb_barang`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT untuk tabel `tb_barang_grosir`
--
ALTER TABLE `tb_barang_grosir`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT untuk tabel `tb_barang_satuan`
--
ALTER TABLE `tb_barang_satuan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT untuk tabel `tb_barang_stok`
--
ALTER TABLE `tb_barang_stok`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `tb_kategori`
--
ALTER TABLE `tb_kategori`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT untuk tabel `tb_opname_data`
--
ALTER TABLE `tb_opname_data`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT untuk tabel `tb_opname_detail`
--
ALTER TABLE `tb_opname_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT untuk tabel `tb_pelanggan`
--
ALTER TABLE `tb_pelanggan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT untuk tabel `tb_pembelian_data`
--
ALTER TABLE `tb_pembelian_data`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT untuk tabel `tb_pembelian_detail`
--
ALTER TABLE `tb_pembelian_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT untuk tabel `tb_penjualan_data`
--
ALTER TABLE `tb_penjualan_data`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT untuk tabel `tb_penjualan_detail`
--
ALTER TABLE `tb_penjualan_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=127;

--
-- AUTO_INCREMENT untuk tabel `tb_penjualan_retur`
--
ALTER TABLE `tb_penjualan_retur`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT untuk tabel `tb_riwayat_stok`
--
ALTER TABLE `tb_riwayat_stok`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=127;

--
-- AUTO_INCREMENT untuk tabel `tb_riwayat_transaksi`
--
ALTER TABLE `tb_riwayat_transaksi`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;

--
-- AUTO_INCREMENT untuk tabel `tb_satuan`
--
ALTER TABLE `tb_satuan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT untuk tabel `tb_supplier`
--
ALTER TABLE `tb_supplier`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT untuk tabel `tb_toko`
--
ALTER TABLE `tb_toko`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
COMMIT;

