-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `klx`
--

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

--
-- Table structure for table `arus_kas`
--

CREATE TABLE `arus_kas` (
  `id_arus_kas` int(11) NOT NULL,
  `no_arus_kas` varchar(25) NOT NULL,
  `id_bpb` int(11) DEFAULT NULL,
  `tanggal_arus_kas` date NOT NULL,
  `id_debit_arus_kas` int(11) NOT NULL,
  `id_kredit_arus_kas` int(11) NOT NULL,
  `jumlah_arus_kas` int(11) NOT NULL,
  `ket_arus_kas` text NOT NULL,
  `user_buat` int(11) NOT NULL,
  `masuk` int(11) NOT NULL DEFAULT 1,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `arus_kas`
--

INSERT INTO `arus_kas` (`id_arus_kas`, `no_arus_kas`, `id_bpb`, `tanggal_arus_kas`, `id_debit_arus_kas`, `id_kredit_arus_kas`, `jumlah_arus_kas`, `ket_arus_kas`, `user_buat`, `masuk`, `id_divisi`) VALUES
(1, '', NULL, '2020-10-29', 1, 60, 580000, '0', 0, 1, 1),
(2, 'KM/KL/1020/000001', NULL, '2020-10-29', 1, 26, 850000, 'test', 0, 1, 1),
(3, 'KM/KL/1020/000002', NULL, '2020-10-29', 1, 44, 685000, 'test', 0, 1, 1),
(4, 'KM/KL/1020/000003', NULL, '2020-10-29', 1, 25, 25000, 'coba', 0, 1, 1),
(5, 'KM/KL/1020/000004', NULL, '2020-10-29', 1, 43, 158, 'sadas', 0, 1, 1),
(6, 'KM/KL/1020/000005', NULL, '2020-10-31', 1, 45, 9630, 'sdfs', 0, 1, 1),
(7, 'KK/KL/1120/000001', 15, '2020-11-03', 9, 1, 75000, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 2020-06-30 dari PT. Fastrata Buana', 0, 0, 1),
(8, 'KK/KL/1120/000002', 15, '2020-11-03', 9, 1, 75000, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana', 0, 0, 1),
(9, 'KK/KL/1120/000003', 15, '2020-11-03', 9, 1, 75000, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana', 0, 0, 1);

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

--
-- Table structure for table `arus_persediaan_barang`
--

CREATE TABLE `arus_persediaan_barang` (
  `id_arus_persediaan_barang` int(11) NOT NULL,
  `no_arus_persediaan_barang` varchar(80) NOT NULL,
  `tanggal_arus_persediaan_barang` date NOT NULL,
  `id_partner` int(11) NOT NULL,
  `ket_arus_persediaan_barang` text NOT NULL,
  `jenis_arus` varchar(30) NOT NULL,
  `user_buat` varchar(80) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `arus_persediaan_barang`
--

INSERT INTO `arus_persediaan_barang` (`id_arus_persediaan_barang`, `no_arus_persediaan_barang`, `tanggal_arus_persediaan_barang`, `id_partner`, `ket_arus_persediaan_barang`, `jenis_arus`, `user_buat`, `id_divisi`) VALUES
(10, 'IN/KL/1120/000001', '2020-11-22', 1, 'INITIAL STOCK', '1', 'admin', 1),
(11, 'IN/KL/1120/000002', '2020-11-22', 1, 'BELI BAHAN BAKU', '1', 'admin', 1),
(12, 'IN/KL/1120/000003', '2020-11-22', 1, 'HALAH', '1', 'admin', 1),
(13, 'IN/KL/0724/000001', '2024-07-22', 1, 'TEST', '1', 'admin', 1),
(14, 'IN/KL/0724/000001', '2024-07-22', 1, 'TEST', '1', 'admin', 1),
(15, 'IN/KL/0824/000001', '2024-08-10', 0, 'TEST', '1', 'admin', 1);

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

--
-- Table structure for table `bank`
--

CREATE TABLE `bank` (
  `id_bank` int(11) NOT NULL,
  `nama_bank` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `bank`
--

INSERT INTO `bank` (`id_bank`, `nama_bank`) VALUES
(1, 'BCA'),
(2, 'MANDIRI');

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

--
-- Table structure for table `buku_besar`
--

CREATE TABLE `buku_besar` (
  `id_buku_besar` int(11) NOT NULL,
  `tanggal_buku_besar` date NOT NULL,
  `id_jurnal_umum` int(11) NOT NULL,
  `id_akun` int(11) NOT NULL,
  `id_pasangan` int(11) NOT NULL,
  `jumlah_debit` int(11) NOT NULL DEFAULT 0,
  `jumlah_kredit` int(11) NOT NULL DEFAULT 0,
  `ket_buku_besar` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `buku_besar`
--

INSERT INTO `buku_besar` (`id_buku_besar`, `tanggal_buku_besar`, `id_jurnal_umum`, `id_akun`, `id_pasangan`, `jumlah_debit`, `jumlah_kredit`, `ket_buku_besar`) VALUES
(1, '2020-06-23', 8, 60, 1, 50000, 0, 'coba buku besar'),
(2, '2020-06-23', 8, 1, 60, 0, 50000, 'coba buku besar'),
(3, '2020-06-24', 9, 26, 1, 20000, 0, 'test'),
(4, '2020-06-24', 9, 1, 26, 0, 20000, 'test'),
(5, '2020-10-29', 10, 1, 60, 580000, 0, 'tes kas masuk'),
(6, '2020-10-29', 10, 60, 1, 580000, 0, 'tes kas masuk'),
(7, '2020-10-29', 11, 1, 26, 850000, 0, 'test'),
(8, '2020-10-29', 11, 26, 1, 850000, 0, 'test'),
(9, '2020-10-29', 12, 1, 44, 685000, 0, 'test'),
(10, '2020-10-29', 12, 44, 1, 685000, 0, 'test'),
(11, '2020-10-29', 13, 1, 25, 25000, 0, 'coba'),
(12, '2020-10-29', 13, 25, 1, 25000, 0, 'coba'),
(13, '2020-10-29', 14, 1, 43, 158, 0, 'sadas'),
(14, '2020-10-29', 14, 43, 1, 158, 0, 'sadas'),
(15, '2020-10-31', 15, 1, 45, 9630, 0, 'sdfs'),
(16, '2020-10-31', 15, 45, 1, 9630, 0, 'sdfs'),
(17, '2020-11-03', 16, 9, 1, 75000, 0, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 2020-06-30 dari PT. Fastrata Buana'),
(18, '2020-11-03', 16, 1, 9, 75000, 0, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 2020-06-30 dari PT. Fastrata Buana'),
(19, '2020-11-03', 17, 9, 1, 75000, 0, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana'),
(20, '2020-11-03', 17, 1, 9, 75000, 0, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana'),
(21, '2020-11-03', 18, 9, 1, 75000, 0, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana'),
(22, '2020-11-03', 18, 1, 9, 75000, 0, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana');

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

--
-- Table structure for table `detail_arus_persediaan_barang`
--

CREATE TABLE `detail_arus_persediaan_barang` (
  `id_detail_arus_persediaan_barang` int(11) NOT NULL,
  `id_arus_persediaan_barang` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan_barang` int(11) NOT NULL,
  `harga_barang` bigint(20) NOT NULL,
  `jumlah_barang` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_arus_persediaan_barang`
--

INSERT INTO `detail_arus_persediaan_barang` (`id_detail_arus_persediaan_barang`, `id_arus_persediaan_barang`, `id_item`, `id_satuan_barang`, `harga_barang`, `jumlah_barang`) VALUES
(8, 10, 8, 2, 95000, 50),
(9, 10, 11, 2, 3250, 5.5),
(10, 11, 8, 2, 95000, 5.5),
(11, 11, 11, 2, 3250, 2.5),
(12, 12, 8, 2, 95000, 2),
(31, 14, 8, 2, 85000, 15),
(32, 15, 9, 2, 20000, 1);

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

--
-- Table structure for table `detail_hutang`
--

CREATE TABLE `detail_hutang` (
  `id_detail_hutang` int(11) NOT NULL,
  `id_partner` int(11) NOT NULL,
  `tanggal_detail_hutang` date NOT NULL,
  `debit_hutang` int(11) NOT NULL DEFAULT 0,
  `kredit_hutang` int(11) NOT NULL DEFAULT 0,
  `ket_detail_hutang` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_hutang`
--

INSERT INTO `detail_hutang` (`id_detail_hutang`, `id_partner`, `tanggal_detail_hutang`, `debit_hutang`, `kredit_hutang`, `ket_detail_hutang`) VALUES
(1, 1, '2020-06-30', 0, 150000, '0'),
(2, 1, '2020-06-30', 0, 75000, 'Pembelian no BPB/KL/0620/000003');

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

--
-- Table structure for table `detail_pembayaran_pembelian`
--

CREATE TABLE `detail_pembayaran_pembelian` (
  `id_detail_pembayaran_pembelian` int(11) NOT NULL,
  `id_pembayaran_pembelian` int(11) NOT NULL,
  `id_tanda_terima` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_pembayaran_pembelian`
--

INSERT INTO `detail_pembayaran_pembelian` (`id_detail_pembayaran_pembelian`, `id_pembayaran_pembelian`, `id_tanda_terima`) VALUES
(1, 2, 1),
(2, 3, 2),
(3, 10, 2),
(4, 11, 2),
(5, 12, 2),
(8, 15, 2),
(9, 16, 3),
(10, 17, 3),
(11, 18, 3),
(12, 19, 3),
(13, 20, 3),
(14, 21, 3),
(15, 22, 3),
(16, 23, 3);

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

--
-- Table structure for table `detail_pembelian`
--

CREATE TABLE `detail_pembelian` (
  `id_detail_pembelian` int(11) NOT NULL,
  `id_pembelian` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan_barang` int(11) NOT NULL,
  `jumlah_beli` float NOT NULL,
  `harga_beli` bigint(20) NOT NULL,
  `potongan_beli` bigint(20) NOT NULL DEFAULT 0,
  `total_harga_beli` bigint(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_pembelian`
--

INSERT INTO `detail_pembelian` (`id_detail_pembelian`, `id_pembelian`, `id_item`, `id_satuan_barang`, `jumlah_beli`, `harga_beli`, `potongan_beli`, `total_harga_beli`) VALUES
(5, 18, 9, 2, 10, 20000, 0, 200000);

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

--
-- Table structure for table `detail_penjualan`
--

CREATE TABLE `detail_penjualan` (
  `id_detail_penjualan` int(11) NOT NULL,
  `id_penjualan` int(11) DEFAULT NULL,
  `id_item` int(11) DEFAULT NULL,
  `id_resep` int(11) DEFAULT NULL,
  `id_satuan_barang` int(11) DEFAULT NULL,
  `jumlah_jual` float DEFAULT NULL,
  `harga_pokok` bigint(20) DEFAULT NULL,
  `harga_jual` bigint(20) DEFAULT NULL,
  `potongan_jual` bigint(20) DEFAULT NULL,
  `total_harga_jual` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_penjualan`
--

INSERT INTO `detail_penjualan` (`id_detail_penjualan`, `id_penjualan`, `id_item`, `id_resep`, `id_satuan_barang`, `jumlah_jual`, `harga_pokok`, `harga_jual`, `potongan_jual`, `total_harga_jual`) VALUES
(7, 8, 8, NULL, 2, 2, 95000, 95000, 0, 190000),
(8, 9, 8, NULL, 2, 2, 95000, 95000, 0, 190000);

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

--
-- Table structure for table `detail_penyusutan_stok`
--

CREATE TABLE `detail_penyusutan_stok` (
  `id_detail_penyusutan_stok` int(11) NOT NULL,
  `id_penyusutan_stok` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan_barang` int(11) NOT NULL,
  `total_susut` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_penyusutan_stok`
--

INSERT INTO `detail_penyusutan_stok` (`id_detail_penyusutan_stok`, `id_penyusutan_stok`, `id_item`, `id_satuan_barang`, `total_susut`) VALUES
(2, 5, 3, 1, 10),
(8, 11, 3, 1, 21),
(9, 12, 3, 1, 10),
(10, 13, 3, 1, 5),
(11, 14, 8, 2, 1),
(12, 14, 11, 2, 1),
(13, 15, 11, 2, 0.25);

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

--
-- Table structure for table `detail_pesanan_pembelian`
--

CREATE TABLE `detail_pesanan_pembelian` (
  `id_detail_pesanan_pembelian` bigint(20) NOT NULL,
  `id_pesanan_pembelian` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `jumlah_pesanan` float NOT NULL,
  `jumlah_sisa_pesanan` int(11) DEFAULT NULL,
  `id_satuan_barang` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_pesanan_pembelian`
--

INSERT INTO `detail_pesanan_pembelian` (`id_detail_pesanan_pembelian`, `id_pesanan_pembelian`, `id_item`, `jumlah_pesanan`, `jumlah_sisa_pesanan`, `id_satuan_barang`) VALUES
(2, 38, 9, 10, 0, 2),
(3, 39, 10, 0.015, 0, 2);

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

--
-- Table structure for table `detail_produksi`
--

CREATE TABLE `detail_produksi` (
  `id_detail_produksi` int(11) NOT NULL,
  `id_produksi` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `pemakaian_item` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `harga_item` bigint(20) NOT NULL,
  `total_penggunaan_item` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_produksi`
--

INSERT INTO `detail_produksi` (`id_detail_produksi`, `id_produksi`, `id_item`, `pemakaian_item`, `id_satuan`, `harga_item`, `total_penggunaan_item`) VALUES
(1, 2, 8, 1, 2, 95000, 95000),
(2, 2, 9, 250, 1, 20000, 5000000),
(3, 2, 10, 250, 1, 21000, 5250000),
(4, 2, 11, 7, 1, 3250, 22750),
(5, 2, 12, 10, 1, 33000, 330000),
(6, 2, 13, 16, 1, 11250, 180000),
(7, 2, 14, 4, 1, 79500, 318000),
(8, 3, 8, 1, 2, 95000, 95000),
(9, 3, 9, 250, 1, 20000, 5000000),
(10, 3, 10, 250, 1, 21000, 5250000),
(11, 3, 11, 7, 1, 3250, 22750),
(12, 3, 12, 10, 1, 33000, 330000),
(13, 3, 13, 16, 1, 11250, 180000),
(14, 3, 14, 4, 1, 79500, 318000),
(15, 4, 8, 1, 2, 95000, 95000),
(16, 4, 9, 250, 1, 20000, 5000000),
(17, 4, 10, 250, 1, 21000, 5250000),
(18, 4, 11, 7, 1, 3250, 22750),
(19, 4, 12, 10, 1, 33000, 330000),
(20, 4, 13, 16, 1, 11250, 180000),
(21, 4, 14, 4, 1, 79500, 318000),
(22, 13, 8, 1, 2, 95000, 95000),
(23, 13, 9, 1, 1, 20000, 20000),
(24, 13, 10, 1, 1, 21000, 21000),
(25, 13, 11, 1, 1, 3250, 3250),
(26, 13, 12, 1, 1, 33000, 33000),
(27, 13, 13, 1, 1, 11250, 11250),
(28, 13, 14, 1, 1, 79500, 79500);

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

--
-- Table structure for table `detail_resep`
--

CREATE TABLE `detail_resep` (
  `id_detail_resep` int(11) NOT NULL,
  `id_resep` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `jumlah` int(11) NOT NULL DEFAULT 0,
  `harga_satuan` decimal(10,0) NOT NULL,
  `subtotal` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_resep`
--

INSERT INTO `detail_resep` (`id_detail_resep`, `id_resep`, `id_item`, `id_satuan`, `jumlah`, `harga_satuan`, `subtotal`) VALUES
(44, 10, 8, 2, 1, 95000, 95000),
(45, 10, 9, 1, 250, 20, 5000),
(46, 10, 10, 1, 250, 21, 5250),
(47, 10, 11, 1, 14, 3, 46),
(48, 10, 12, 1, 10, 33, 330),
(49, 11, 11, 1, 50, 3, 163);

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

--
-- Table structure for table `detail_retur_pembelian`
--

CREATE TABLE `detail_retur_pembelian` (
  `id_detail_retur_pembelian` int(11) NOT NULL,
  `id_retur_pembelian` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan_barang` int(11) NOT NULL,
  `jumlah_retur` bigint(20) NOT NULL,
  `harga_beli` bigint(20) NOT NULL,
  `total_harga_retur` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `detail_stok`
--

CREATE TABLE `detail_stok` (
  `id_detail_stok` int(11) NOT NULL,
  `id_stok` int(11) NOT NULL,
  `tanggal_detail_stok` date NOT NULL,
  `masuk` int(11) NOT NULL DEFAULT 0,
  `keluar` int(11) NOT NULL DEFAULT 0,
  `ket_detail_penyusutan_stok` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_stok`
--

INSERT INTO `detail_stok` (`id_detail_stok`, `id_stok`, `tanggal_detail_stok`, `masuk`, `keluar`, `ket_detail_penyusutan_stok`) VALUES
(1, 1, '2020-06-23', 0, 21, ''),
(2, 1, '2020-06-23', 0, 10, 'Penyusutan Stok'),
(3, 1, '2020-06-28', 0, 5, 'Penyusutan Stok DS/KL/0620/000004'),
(4, 2, '2020-11-11', 0, 10, 'Penjualan No PJKL/1120/000001'),
(5, 2, '2020-11-11', 0, 10, 'Penjualan No PJKL/1120/000002'),
(6, 3, '2020-11-20', 50, 0, 'Pembelian No BPB/KL/1120/000001'),
(7, 4, '2020-11-20', 50000, 0, 'Pembelian No BPB/KL/1120/000002'),
(8, 4, '2020-11-20', 0, 0, 'Penjualan No PJKL/1120/000003'),
(9, 4, '2020-11-20', 0, 2000, 'Penjualan No PJKL/1120/000004'),
(10, 5, '2020-11-20', 1, 0, 'Proses Produksi'),
(11, 4, '2020-11-20', 0, 1000, 'Proses Produksi'),
(12, 6, '2020-11-20', 0, 250000, 'Proses Produksi'),
(13, 7, '2020-11-20', 0, 250000, 'Proses Produksi'),
(14, 8, '2020-11-20', 0, 7000, 'Proses Produksi'),
(15, 9, '2020-11-20', 0, 10000, 'Proses Produksi'),
(16, 10, '2020-11-20', 0, 16000, 'Proses Produksi'),
(17, 11, '2020-11-20', 0, 4000, 'Proses Produksi'),
(18, 12, '2020-11-20', 1, 0, 'Proses Produksi'),
(19, 4, '2020-11-20', 0, 1000, 'Proses Produksi'),
(20, 13, '2020-11-20', 0, 250000, 'Proses Produksi'),
(21, 14, '2020-11-20', 0, 250000, 'Proses Produksi'),
(22, 15, '2020-11-20', 0, 7000, 'Proses Produksi'),
(23, 16, '2020-11-20', 0, 10000, 'Proses Produksi'),
(24, 17, '2020-11-20', 0, 16000, 'Proses Produksi'),
(25, 18, '2020-11-20', 0, 4000, 'Proses Produksi'),
(26, 19, '2020-11-20', 1, 0, 'Proses Produksi'),
(27, 4, '2020-11-20', 0, 1000, 'Proses Produksi'),
(28, 20, '2020-11-20', 0, 250, 'Proses Produksi'),
(29, 21, '2020-11-20', 0, 250, 'Proses Produksi'),
(30, 22, '2020-11-20', 0, 7, 'Proses Produksi'),
(31, 23, '2020-11-20', 0, 10, 'Proses Produksi'),
(32, 24, '2020-11-20', 0, 16, 'Proses Produksi'),
(33, 25, '2020-11-20', 0, 4, 'Proses Produksi'),
(34, 20, '2020-11-22', 5000, 0, 'Arus Barang Masuk No IN/KL/1120/000001'),
(35, 22, '2020-11-22', 15000, 0, 'Arus Barang Masuk No IN/KL/1120/000001'),
(36, 23, '2020-11-22', 5000, 0, 'Arus Barang Masuk No IN/KL/1120/000001'),
(37, 4, '2020-11-22', 0, 1000, 'Penyusutan Stok No DS/KL/1120/000001'),
(38, 22, '2020-11-22', 0, 500, 'Penyusutan Stok No DS/KL/1120/000001'),
(39, 26, '2020-11-22', 50000, 0, 'Arus Barang Masuk No IN/KL/1120/000001'),
(40, 27, '2020-11-22', 5500, 0, 'Arus Barang Masuk No IN/KL/1120/000001'),
(41, 26, '2020-11-22', 5500, 0, 'Arus Barang Masuk No IN/KL/1120/000002'),
(42, 27, '2020-11-22', 2500, 0, 'Arus Barang Masuk No IN/KL/1120/000002'),
(43, 26, '2020-11-22', 2000, 0, 'Arus Barang Masuk No IN/KL/1120/000003'),
(44, 27, '2020-11-22', 0, 250, 'Penyusutan Stok No DS/KL/1120/000001'),
(45, 28, '2020-11-24', 10000, 0, 'Pembelian No BPB/KL/1120/000001'),
(46, 26, '2020-11-27', 0, 7500, 'Penyesuaian Stok Lebih Sedikit Sejumlah 7.5'),
(47, 26, '2020-11-27', 0, 1500, 'Penyesuaian Stok Lebih Banyak Sejumlah 1.5'),
(48, 29, '2024-07-11', 1, 0, 'Proses Produksi'),
(49, 26, '2024-07-11', 0, 1000, 'Proses Produksi'),
(50, 28, '2024-07-11', 0, 1, 'Proses Produksi'),
(51, 30, '2024-07-11', 0, 1, 'Proses Produksi'),
(52, 27, '2024-07-11', 0, 1, 'Proses Produksi'),
(53, 31, '2024-07-11', 0, 1, 'Proses Produksi'),
(54, 32, '2024-07-11', 0, 1, 'Proses Produksi'),
(55, 33, '2024-07-11', 0, 1, 'Proses Produksi'),
(56, 26, '2024-07-22', 0, 47454, 'Penyesuaian Stok Lebih Sedikit Sejumlah 47454'),
(75, 26, '2024-07-22', 15, 0, 'Arus Barang Masuk No IN/KL/0724/000001'),
(76, 28, '2024-08-10', 1000, 0, 'Arus Barang Masuk No IN/KL/0824/000001');

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

--
-- Table structure for table `detail_surat_jalan_umum`
--

CREATE TABLE `detail_surat_jalan_umum` (
  `id_detil_surat_jalan_umum` int(11) NOT NULL,
  `id_surat_jalan_umum` int(11) NOT NULL,
  `nama_barang` text NOT NULL,
  `jumlah` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_surat_jalan_umum`
--

INSERT INTO `detail_surat_jalan_umum` (`id_detil_surat_jalan_umum`, `id_surat_jalan_umum`, `nama_barang`, `jumlah`) VALUES
(1, 1, 'KOKAIN', '250 paket'),
(2, 1, 'HEROIN', '100 kg'),
(3, 2, 'BUFFET', '100 PAX');

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

--
-- Table structure for table `detail_tanda_terima`
--

CREATE TABLE `detail_tanda_terima` (
  `id_detail_tanda_terima` int(11) NOT NULL,
  `id_tanda_terima` int(11) NOT NULL,
  `id_pembelian` int(11) NOT NULL,
  `total_pembelian` bigint(20) NOT NULL,
  `total_retur` bigint(20) NOT NULL DEFAULT 0,
  `total_akhir` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `detail_tanda_terima`
--

INSERT INTO `detail_tanda_terima` (`id_detail_tanda_terima`, `id_tanda_terima`, `id_pembelian`, `total_pembelian`, `total_retur`, `total_akhir`) VALUES
(1, 1, 3, 0, 0, 0),
(2, 2, 14, 45000, 0, 45000),
(3, 3, 15, 375000, 0, 375000);

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

--
-- Table structure for table `divisi`
--

CREATE TABLE `divisi` (
  `id_divisi` int(11) NOT NULL,
  `nama_divisi` varchar(32) NOT NULL,
  `logo_divisi_pendek` varchar(128) NOT NULL,
  `logo_divisi_panjang` varchar(128) NOT NULL,
  `singkatan` varchar(20) NOT NULL,
  `img` varchar(20) NOT NULL,
  `title` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `divisi`
--

INSERT INTO `divisi` (`id_divisi`, `nama_divisi`, `logo_divisi_pendek`, `logo_divisi_panjang`, `singkatan`, `img`, `title`) VALUES
(1, 'KL Suki', 'img/kl-pendek.png', 'img/kl-panjang.png', 'KL', 'sk.jpg', 'KL SUKI'),
(2, 'KL Express', 'img/klx-pendek.png', 'img/klx-panjang.png', 'KLX', '', '0');

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

--
-- Table structure for table `gudang`
--

CREATE TABLE `gudang` (
  `id_gudang` int(11) NOT NULL,
  `nama_gudang` varchar(90) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `gudang`
--

INSERT INTO `gudang` (`id_gudang`, `nama_gudang`, `id_divisi`) VALUES
(1, 'GUDANG INDUK', 1),
(2, 'GUDANG GUDANGAN', 1);

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

--
-- Table structure for table `hutang_partner`
--

CREATE TABLE `hutang_partner` (
  `id_hutang_partner` int(11) NOT NULL,
  `tanggal_hutang_partner` date NOT NULL,
  `id_partner` int(11) NOT NULL,
  `debit_hutang` bigint(20) NOT NULL DEFAULT 0,
  `kredit_hutang` bigint(20) NOT NULL DEFAULT 0,
  `ket_hutang` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `hutang_partner`
--

INSERT INTO `hutang_partner` (`id_hutang_partner`, `tanggal_hutang_partner`, `id_partner`, `debit_hutang`, `kredit_hutang`, `ket_hutang`) VALUES
(4, '2020-02-17', 1, 0, 30000, 'Pembelian dengan No 1'),
(5, '2020-06-30', 1, 0, 150000, 'Pembelian dengan No '),
(6, '2020-06-30', 1, 0, 75000, 'Pembelian dengan No ');

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

--
-- Table structure for table `item`
--

CREATE TABLE `item` (
  `id_item` int(11) NOT NULL,
  `id_jenis` int(11) DEFAULT NULL,
  `id_satuan` int(11) NOT NULL,
  `id_divisi` int(11) NOT NULL,
  `nama_item` varchar(128) NOT NULL,
  `kode_item` varchar(64) NOT NULL,
  `harga_pokok` bigint(20) NOT NULL,
  `id_konversi_satuan` int(11) NOT NULL,
  `jumlah_konversi` float NOT NULL,
  `kode_bar` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `item`
--

INSERT INTO `item` (`id_item`, `id_jenis`, `id_satuan`, `id_divisi`, `nama_item`, `kode_item`, `harga_pokok`, `id_konversi_satuan`, `jumlah_konversi`, `kode_bar`) VALUES
(8, 3, 2, 1, 'UDANG', 'U0001', 85000, 1, 1, '3315470930'),
(9, 1, 2, 1, 'TEPUNG TANGMIN', 'U0002', 20000, 1, 1000, '2698003438'),
(10, 1, 2, 1, 'TEPUNG POTATO', 'U0003', 21000, 1, 1000, '3543604709'),
(11, 4, 2, 1, 'GARAM', 'U0004', 3250, 1, 1000, '9624013537'),
(12, 4, 2, 1, 'MICIN AJINOMOTO', 'U0005', 33000, 1, 1000, '7489253867'),
(13, 4, 2, 1, 'GULA', 'U0006', 11250, 1, 1000, '8574229030'),
(14, 4, 2, 1, 'KNOR', 'U0007', 79500, 1, 1000, '403383859'),
(15, 1, 1, 1, 'TEST BAR KODE', 'U00008', 15000, 2, 1000, '11326342745');

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

--
-- Table structure for table `jabatan`
--

CREATE TABLE `jabatan` (
  `id` int(11) NOT NULL,
  `kode_jabatan` varchar(64) NOT NULL,
  `nama_jabatan` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `jabatan`
--

INSERT INTO `jabatan` (`id`, `kode_jabatan`, `nama_jabatan`) VALUES
(1, 'DIREKTUR_OPERASIONAL', 'Direktur Operasional'),
(2, 'GENERAL_MANAGER', 'General Manager'),
(3, 'EXECUTIVE_ASSISTANT_MANAGER', 'Executive Assistant Manager'),
(4, 'ADMIN', 'Admin'),
(5, 'KASIR', 'Kasir');

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

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

CREATE TABLE `jenis` (
  `id_jenis` int(11) NOT NULL,
  `nama_jenis` varchar(50) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `jenis` (`id_jenis`, `nama_jenis`, `id_divisi`) VALUES
(1, 'TEPUNG', 1),
(2, 'SAUS', 1),
(3, 'DAGING', 1),
(4, 'BUMBU', 1),
(5, 'TEST', 1);

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

--
-- Table structure for table `jurnal_umum`
--

CREATE TABLE `jurnal_umum` (
  `id_jurnal_umum` int(11) NOT NULL,
  `tanggal_jurnal_umum` date NOT NULL,
  `no_transaksi` varchar(767) NOT NULL,
  `id_debit` int(11) NOT NULL,
  `id_kredit` int(11) NOT NULL,
  `id_anggota` int(11) DEFAULT 0,
  `jumlah_debit` bigint(20) DEFAULT NULL,
  `jumlah_kredit` bigint(20) DEFAULT NULL,
  `ket_jurnal_umum` text DEFAULT NULL,
  `id_divisi` int(11) NOT NULL,
  `user_buat` varchar(99) NOT NULL,
  `user_ubah` varchar(99) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `jurnal_umum`
--

INSERT INTO `jurnal_umum` (`id_jurnal_umum`, `tanggal_jurnal_umum`, `no_transaksi`, `id_debit`, `id_kredit`, `id_anggota`, `jumlah_debit`, `jumlah_kredit`, `ket_jurnal_umum`, `id_divisi`, `user_buat`, `user_ubah`) VALUES
(1, '2020-06-20', '1', 1, 32, 0, 50000, 50000, 'TEST\r\n', 1, '', NULL),
(2, '2020-06-23', '', 57, 60, 0, 50000, 50000, NULL, 0, '', NULL),
(3, '2020-06-23', '', 60, 60, 0, 0, 0, NULL, 1, '', NULL),
(4, '2020-06-23', '', 60, 60, 0, 0, 0, NULL, 1, 'admin', NULL),
(8, '2020-06-23', '', 60, 1, 0, 50000, 50000, 'coba buku besar', 1, 'admin', NULL),
(9, '2020-06-23', '', 26, 1, 0, 20000, 20000, 'test', 1, 'admin', NULL),
(10, '2020-10-29', '', 1, 60, 0, 580000, 580000, 'tes kas masuk', 1, 'admin', NULL),
(11, '2020-10-29', '', 1, 26, 0, 850000, 850000, 'test', 1, 'admin', NULL),
(12, '2020-10-29', '', 1, 44, 0, 685000, 685000, 'test', 1, 'admin', NULL),
(13, '2020-10-29', '', 1, 25, 0, 25000, 25000, 'coba', 1, 'admin', NULL),
(14, '2020-10-29', '', 1, 43, 0, 158, 158, 'sadas', 1, 'admin', NULL),
(15, '2020-10-31', '', 1, 45, 0, 9630, 9630, 'sdfs', 1, 'admin', NULL),
(16, '2020-11-03', '', 9, 1, 0, 75000, 75000, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 2020-06-30 dari PT. Fastrata Buana', 1, 'admin', NULL),
(17, '2020-11-03', '', 9, 1, 0, 75000, 75000, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana', 1, 'admin', NULL),
(18, '2020-11-03', '', 9, 1, 0, 75000, 75000, 'Pembayaran Pembelian No BPB/KL/0620/000003 tertanggal 30-06-2020 dari PT. Fastrata Buana', 1, 'admin', NULL);

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

--
-- Table structure for table `kategori_resep`
--

CREATE TABLE `kategori_resep` (
  `id_kategori_resep` int(11) NOT NULL,
  `nama_kategori_resep` varchar(100) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `kategori_resep`
--

INSERT INTO `kategori_resep` (`id_kategori_resep`, `nama_kategori_resep`, `id_divisi`) VALUES
(0, 'NO KATEGORI', 1);

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

--
-- Table structure for table `kelas_akuntansi`
--

CREATE TABLE `kelas_akuntansi` (
  `id_kelas_akuntansi` int(11) NOT NULL,
  `kelas_akuntansi` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `kelas_akuntansi`
--

INSERT INTO `kelas_akuntansi` (`id_kelas_akuntansi`, `kelas_akuntansi`) VALUES
(1, 'HARTA'),
(2, 'HUTANG'),
(3, 'MODAL'),
(4, 'PENJUALAN'),
(5, 'PEMBELIAN'),
(6, 'BEBAN'),
(7, 'PENDAPATAN LAIN-LAIN'),
(8, 'HARGA POKOK PENJUALAN');

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

--
-- Table structure for table `kode_akuntansi`
--

CREATE TABLE `kode_akuntansi` (
  `id` int(11) NOT NULL,
  `id_kode_akuntansi` int(11) NOT NULL,
  `kelas_akuntansi` int(11) NOT NULL,
  `nama_kode_akuntansi` varchar(767) NOT NULL,
  `saldo_normal` int(11) NOT NULL,
  `saldo_awal` int(11) NOT NULL,
  `sifat` int(11) NOT NULL,
  `id_divisi` int(11) NOT NULL,
  `kas_bank` int(11) NOT NULL,
  `borongan_tepung` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `kode_akuntansi`
--

INSERT INTO `kode_akuntansi` (`id`, `id_kode_akuntansi`, `kelas_akuntansi`, `nama_kode_akuntansi`, `saldo_normal`, `saldo_awal`, `sifat`, `id_divisi`, `kas_bank`, `borongan_tepung`) VALUES
(1, 11, 1, 'KAS KECIL', 1, 1, 1, 0, 1, 0),
(2, 30, 1, 'PIUTANG DAGANG', 1, 1, 1, 0, 0, 0),
(3, 31, 1, 'INVENTORY', 1, 1, 1, 0, 0, 0),
(4, 18, 2, 'HUTANG DAGANG', 2, 1, 2, 0, 0, 0),
(5, 11, 4, 'PENJUALAN', 2, 0, 2, 0, 0, 0),
(6, 12, 4, 'RETUR PENJUALAN', 2, 0, 2, 0, 0, 0),
(7, 13, 4, 'POTONGAN PENJUALAN', 2, 0, 2, 0, 0, 0),
(8, 14, 4, 'PESANAN PENJUALAN', 1, 0, 1, 0, 0, 0),
(9, 11, 5, 'PEMBELIAN', 1, 0, 1, 0, 0, 0),
(10, 12, 5, 'RETUR PEMBALIAN\r\n', 1, 0, 1, 0, 0, 0),
(11, 13, 5, 'POTONGAN PEMBELIAN', 2, 0, 2, 0, 0, 0),
(12, 14, 6, 'BEBAN PEMBELIAN', 1, 0, 1, 1, 0, 0),
(13, 32, 1, 'PEMBELIAN DIBAYAR DI MUKA', 1, 0, 1, 0, 0, 0),
(14, 19, 2, 'PENJUALAN DITERIMA DI MUKA', 2, 0, 2, 0, 0, 0),
(15, 23, 1, 'TANAH SOLO', 1, 1, 1, 1, 0, 0),
(16, 11, 3, 'MODAL', 2, 1, 3, 0, 0, 0),
(17, 12, 3, 'PRIVE', 1, 0, 3, 0, 0, 0),
(18, 11, 6, 'BEBAN GAJI', 1, 0, 1, 1, 0, 0),
(19, 12, 6, 'BEBAN MACAM-MACAM', 1, 0, 1, 1, 0, 0),
(20, 11, 7, 'PENDAPATAN LAIN', 2, 0, 2, 0, 0, 0),
(21, 12, 7, 'PENDAPATAN JASA', 2, 0, 2, 0, 0, 0),
(22, 31, 1, 'PERSEDIAAN BARANG', 1, 1, 1, 0, 0, 0),
(23, 11, 8, 'HPP', 2, 0, 2, 0, 0, 0),
(24, 14, 5, 'PESANAN PEMBELIAN', 1, 0, 1, 0, 0, 0),
(25, 31, 1, 'BILYET GIRO HUTANG', 2, 0, 2, 0, 0, 0),
(26, 12, 1, 'GIRO GANTUNG', 1, 0, 1, 0, 0, 0),
(27, 13, 6, 'KERUGIAN PADA PERSEDIAAN', 1, 0, 1, 1, 0, 0),
(28, 15, 6, 'BEBAN LISTRIK,AIR,TELP', 1, 0, 1, 0, 0, 0),
(29, 16, 6, 'BEBAN KENDARAAN', 1, 0, 1, 0, 0, 0),
(30, 15, 4, 'PPN', 2, 0, 2, 0, 0, 0),
(31, 17, 6, 'ONGKOS KULI', 1, 0, 1, 1, 0, 0),
(32, 18, 6, 'BEBAN THR', 1, 0, 1, 1, 0, 0),
(33, 19, 6, 'BEBAN PAJAK DAN PBB', 1, 0, 1, 1, 0, 0),
(34, 20, 6, 'BEBAN KOMISI', 1, 0, 1, 0, 0, 0),
(35, 21, 6, 'REVISI KENDARAAN', 1, 0, 1, 1, 0, 0),
(36, 22, 6, 'REVISI BANGUNAN', 1, 0, 1, 1, 0, 0),
(37, 23, 6, 'BEBAN ASURANSI', 1, 0, 1, 1, 0, 0),
(38, 24, 6, 'BEBAN SUMBANGAN', 1, 0, 1, 1, 0, 0),
(39, 25, 6, 'RUPA RUPA', 1, 0, 1, 1, 0, 0),
(40, 26, 6, 'ONGKOS EXP / IMP', 1, 0, 1, 1, 0, 0),
(41, 17, 1, 'NIAGA KTL - 8000.7654.8100', 1, 1, 1, 1, 1, 0),
(42, 19, 1, 'NIAGA STA - 8000.7656.5500', 1, 1, 1, 1, 1, 0),
(43, 22, 1, 'BNI HANSEN - 044.674.3766', 1, 1, 1, 1, 1, 0),
(44, 20, 1, 'NISP VALAS HANSEN - 200.810.253.555\r\n\r\n', 1, 1, 1, 1, 1, 0),
(45, 16, 1, 'NIAGA SOEHATMO - 281.01.0000.5000', 1, 1, 2, 1, 0, 0),
(46, 13, 1, 'BCA JONI - 011.377.5588', 1, 1, 2, 1, 1, 0),
(47, 20, 1, 'NISP JONI - 200.010.990.997', 1, 1, 2, 1, 1, 0),
(48, 14, 1, 'NIAGA JONI 1 - 8000.2087.3400', 1, 1, 2, 1, 1, 0),
(49, 15, 1, 'NIAGA JONI 2 - 8001.4274.5800', 1, 1, 2, 1, 1, 0),
(50, 21, 1, 'PERMATA JONI - 291.274.2930', 1, 1, 2, 1, 1, 0),
(51, 15, 1, 'BCA STA', 1, 1, 1, 2, 1, 0),
(52, 27, 6, 'BEBAN BUNGA', 1, 0, 1, 1, 0, 0),
(53, 32, 1, 'PIUTANG KENDARAAN', 1, 0, 1, 0, 0, 0),
(54, 28, 6, 'ONGKOS JALAN', 1, 0, 1, 1, 0, 0),
(55, 29, 6, 'ONGKOS TRUCK', 1, 0, 1, 0, 0, 0),
(56, 27, 6, 'ADMINISTRASI BANK', 1, 0, 1, 0, 0, 0),
(57, 24, 1, 'BANK PANIN ', 1, 1, 0, 0, 0, 0),
(58, 33, 1, 'AKUMULASI PENYUSUTAN', 1, 1, 0, 0, 0, 0),
(59, 30, 6, 'BEBAN PENYUSUTAN', 1, 1, 0, 0, 0, 0),
(60, 25, 1, 'BCA HANSEN - 4408.117.117', 1, 1, 0, 0, 0, 0),
(61, 31, 6, 'UPAH BORONGAN', 1, 1, 0, 2, 0, 1);

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

--
-- Table structure for table `nomor_dokumen`
--

CREATE TABLE `nomor_dokumen` (
  `id` int(11) NOT NULL,
  `jenis_dokumen` varchar(32) NOT NULL,
  `prefix` varchar(8) NOT NULL,
  `suffix` varchar(8) DEFAULT NULL,
  `periode` varchar(4) NOT NULL,
  `nomor` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `nomor_dokumen`
--

INSERT INTO `nomor_dokumen` (`id`, `jenis_dokumen`, `prefix`, `suffix`, `periode`, `nomor`) VALUES
(22, 'SUPPLY_IN', 'IN/', 'KL', '1120', 4),
(23, 'DEPRECIATION_STOCK', 'DS/', 'KL', '1120', 2),
(24, 'PURCHASE_ORDER', 'PO/', 'KL', '1120', 2),
(25, 'PURCHASE', 'BPB/', 'KL', '1120', 2),
(34, 'PRODUCTION', 'PR/', 'KL', '0724', 2),
(35, 'PURCHASE_ORDER', 'PO/', 'KL', '0724', 2),
(54, 'SUPPLY_IN', 'IN/', 'KL', '0724', 2),
(55, 'SUPPLY_IN', 'IN/', 'KL', '0824', 2);

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

--
-- Table structure for table `otorisasi_tanda_terima`
--

CREATE TABLE `otorisasi_tanda_terima` (
  `id_otorisasi` int(11) NOT NULL,
  `id_tanda_terima` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `waktu_otorisasi` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `otorisasi_tanda_terima`
--

INSERT INTO `otorisasi_tanda_terima` (`id_otorisasi`, `id_tanda_terima`, `id_user`, `waktu_otorisasi`) VALUES
(2, 3, 5, '2020-10-29 13:05:32');

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

--
-- Table structure for table `partner`
--

CREATE TABLE `partner` (
  `id_partner` int(11) NOT NULL,
  `nama_partner` varchar(50) NOT NULL,
  `alamat_partner` text NOT NULL,
  `kontak_partner` text NOT NULL,
  `no_kontak_partner` varchar(50) NOT NULL,
  `id_bank_rekening` int(11) NOT NULL,
  `no_rek_partner` text NOT NULL,
  `nama_rek_partner` varchar(50) NOT NULL,
  `hutang_partner` int(11) NOT NULL DEFAULT 0,
  `piutang_partner` int(11) NOT NULL DEFAULT 0,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `partner`
--

INSERT INTO `partner` (`id_partner`, `nama_partner`, `alamat_partner`, `kontak_partner`, `no_kontak_partner`, `id_bank_rekening`, `no_rek_partner`, `nama_rek_partner`, `hutang_partner`, `piutang_partner`, `id_divisi`) VALUES
(1, 'PT. Fastrata Buana', 'JL.Kenjeran No.559, Kalijudan, Kec. Mulyorejo, Kota SBY, Jawa Timur', 'NANANG', '081224041110', 1, '123456', 'TES', 725000, 10000, 1),
(2, 'PT. Fastrata Buana', 'JL.Kenjeran No.559, Kalijudan, Kec. Mulyorejo, Kota SBY, Jawa Timur', 'NANANGG', '081224041110', 1, '123456', 'TES', 0, 0, 0),
(3, 'PT. Fastrata Buana', 'JL.Kenjeran No.559, Kalijudan, Kec. Mulyorejo, Kota SBY, Jawa Timur', 'NANANGG', '081224041110', 1, '123456', 'TES', 0, 0, 0);

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

--
-- Table structure for table `pembayaran_pembelian`
--

CREATE TABLE `pembayaran_pembelian` (
  `id_pembayaran_pembelian` int(11) NOT NULL,
  `no_pembayaran_pembelian` varchar(500) NOT NULL,
  `id_partner` int(11) NOT NULL,
  `tanggal_dibuat` date NOT NULL,
  `dibayar_sebelum` date NOT NULL,
  `total_tagihan` int(11) NOT NULL,
  `status_tagihan` int(11) NOT NULL,
  `ket_tagihan` text DEFAULT NULL,
  `dibayarkan_ke` text NOT NULL,
  `acc_manager` int(11) NOT NULL DEFAULT 1,
  `tanggal_dibayar` date NOT NULL,
  `bukti_bayar` text NOT NULL,
  `user_buat` varchar(767) NOT NULL,
  `user_ubah` varchar(767) DEFAULT NULL,
  `id_divisi` int(11) NOT NULL,
  `batal` int(11) NOT NULL DEFAULT 0,
  `selesai` int(11) NOT NULL DEFAULT 0,
  `file_name` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `pembayaran_pembelian`
--

INSERT INTO `pembayaran_pembelian` (`id_pembayaran_pembelian`, `no_pembayaran_pembelian`, `id_partner`, `tanggal_dibuat`, `dibayar_sebelum`, `total_tagihan`, `status_tagihan`, `ket_tagihan`, `dibayarkan_ke`, `acc_manager`, `tanggal_dibayar`, `bukti_bayar`, `user_buat`, `user_ubah`, `id_divisi`, `batal`, `selesai`, `file_name`) VALUES
(2, 'PP/02/2020/001', 1, '2020-02-16', '2020-02-16', 45000, 1, NULL, 'BCA - 123456 A/N TES', 0, '2020-11-05', '', 'admin', 'pegawai', 1, 0, 0, ''),
(3, 'PP/02/2020/002', 1, '2020-02-16', '2020-02-16', 45000, 1, NULL, '', 0, '2020-11-05', '', 'admin', '', 1, 0, 0, ''),
(15, 'PP/0620/000002', 1, '2020-06-22', '2020-06-22', 45000, 1, NULL, 'BCA - 123456 A/N TES', 0, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(16, 'PP/KL/1020/000001', 1, '2020-10-29', '2020-10-29', 1500000, 1, '-', 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, 'Capture1.PNG'),
(17, 'PP/KL/1020/000002', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(18, 'PP/KL/1020/000003', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(19, 'PP/KL/1020/000004', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(20, 'PP/KL/1020/000005', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(21, 'PP/KL/1020/000006', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(22, 'PP/KL/1020/000007', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, ''),
(23, 'PP/KL/1020/000008', 1, '2020-10-29', '2020-10-29', 1500000, 1, NULL, 'BCA - 123456 A/N TES', 1, '2020-11-05', '', 'admin', NULL, 1, 0, 0, '');

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

--
-- Table structure for table `pembelian`
--

CREATE TABLE `pembelian` (
  `id_pembelian` int(11) NOT NULL,
  `no_pembelian` varchar(88) DEFAULT NULL,
  `tanggal_pembelian` date NOT NULL,
  `tanggal_jatuh_tempo` date DEFAULT NULL,
  `is_cash` tinyint(1) NOT NULL DEFAULT 0,
  `id_partner` int(11) NOT NULL,
  `id_pesanan_pembelian` int(11) DEFAULT NULL,
  `ket_pembelian` text DEFAULT NULL,
  `subtotal_pembelian` bigint(20) NOT NULL,
  `potongan_pembelian` bigint(20) NOT NULL,
  `pajak_pembelian` bigint(20) NOT NULL,
  `total_akhir_pembelian` bigint(20) NOT NULL,
  `titip_dp_pembelian` bigint(20) NOT NULL,
  `kekurangan_pembelian` bigint(20) NOT NULL,
  `ditagih` int(11) NOT NULL DEFAULT 0,
  `sudah_tanda_terima` int(11) NOT NULL DEFAULT 0,
  `pembayaran_pembelian` int(11) NOT NULL DEFAULT 0,
  `user_buat` varchar(50) NOT NULL,
  `user_ubah` varchar(50) DEFAULT NULL,
  `id_divisi` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `pembelian`
--

INSERT INTO `pembelian` (`id_pembelian`, `no_pembelian`, `tanggal_pembelian`, `tanggal_jatuh_tempo`, `is_cash`, `id_partner`, `id_pesanan_pembelian`, `ket_pembelian`, `subtotal_pembelian`, `potongan_pembelian`, `pajak_pembelian`, `total_akhir_pembelian`, `titip_dp_pembelian`, `kekurangan_pembelian`, `ditagih`, `sudah_tanda_terima`, `pembayaran_pembelian`, `user_buat`, `user_ubah`, `id_divisi`) VALUES
(18, 'BPB/KL/1120/000001', '2020-11-24', '2020-11-24', 1, 1, 38, NULL, 200000, 0, 0, 200000, 0, 200000, 0, 0, 0, 'admin', NULL, 1);

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

--
-- Table structure for table `penjualan`
--

CREATE TABLE `penjualan` (
  `id_penjualan` int(11) NOT NULL,
  `no_penjualan` varchar(3068) DEFAULT NULL,
  `tanggal_penjualan` date DEFAULT NULL,
  `ket_penjualan` varchar(4369) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `subtotal_penjualan` bigint(20) DEFAULT NULL,
  `potongan_penjualan` bigint(20) DEFAULT NULL,
  `biaya_lain` int(11) DEFAULT NULL,
  `pajak_penjualan` bigint(20) DEFAULT NULL,
  `total_akhir_penjualan` bigint(20) DEFAULT NULL,
  `user_buat` varchar(3068) DEFAULT NULL,
  `user_ubah` varchar(3068) DEFAULT NULL,
  `id_divisi` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `penjualan_moka`
--

CREATE TABLE `penjualan_moka` (
  `id_penjualan_moka` int(11) NOT NULL,
  `tanggal_penjualan_moka` date NOT NULL,
  `jumlah_penjualan` bigint(20) NOT NULL,
  `jumlah_nota` bigint(20) NOT NULL,
  `diskon_penjualan` bigint(20) NOT NULL,
  `total_penjualan` bigint(20) NOT NULL,
  `tunai` bigint(20) NOT NULL,
  `edc_bca` bigint(20) NOT NULL,
  `edc_bri` bigint(20) NOT NULL,
  `edc_cimb` bigint(20) NOT NULL,
  `online_payment` bigint(20) NOT NULL,
  `bon_putih` bigint(20) NOT NULL,
  `user_buat` varchar(50) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `penjualan_moka`
--

INSERT INTO `penjualan_moka` (`id_penjualan_moka`, `tanggal_penjualan_moka`, `jumlah_penjualan`, `jumlah_nota`, `diskon_penjualan`, `total_penjualan`, `tunai`, `edc_bca`, `edc_bri`, `edc_cimb`, `online_payment`, `bon_putih`, `user_buat`, `id_divisi`) VALUES
(6, '2020-11-24', 2000, 20, 0, 2000, 2000, 0, 0, 0, 0, 0, 'admin', 1);

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

--
-- Table structure for table `penyusutan_stok`
--

CREATE TABLE `penyusutan_stok` (
  `id_penyusutan_stok` int(11) NOT NULL,
  `no_penyusutan_stok` varchar(90) NOT NULL,
  `tanggal_penyusutan_stok` date NOT NULL,
  `ket_penyusutan_stok` text DEFAULT NULL,
  `id_divisi` int(11) NOT NULL,
  `user_buat` varchar(90) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `penyusutan_stok`
--

INSERT INTO `penyusutan_stok` (`id_penyusutan_stok`, `no_penyusutan_stok`, `tanggal_penyusutan_stok`, `ket_penyusutan_stok`, `id_divisi`, `user_buat`) VALUES
(15, 'DS/KL/1120/000001', '2020-11-22', 'HAHAHA', 1, 'admin');

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

--
-- Table structure for table `pesanan_pembelian`
--

CREATE TABLE `pesanan_pembelian` (
  `id_pesanan_pembelian` int(11) NOT NULL,
  `no_pesanan_pembelian` varchar(32) DEFAULT NULL,
  `tanggal_kirim` date NOT NULL,
  `tanggal_pesanan_pembelian` date NOT NULL,
  `user_buat` varchar(50) NOT NULL,
  `user_ubah` varchar(50) NOT NULL,
  `id_divisi` int(11) NOT NULL,
  `ket_pesanan_pembelian` varchar(256) DEFAULT NULL,
  `status` int(11) DEFAULT 0,
  `id_partner` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `pesanan_pembelian`
--

INSERT INTO `pesanan_pembelian` (`id_pesanan_pembelian`, `no_pesanan_pembelian`, `tanggal_kirim`, `tanggal_pesanan_pembelian`, `user_buat`, `user_ubah`, `id_divisi`, `ket_pesanan_pembelian`, `status`, `id_partner`) VALUES
(38, 'PO/KL/1120/000001', '2020-11-24', '2020-11-24', 'admin', '', 1, NULL, 1, 1),
(39, 'PO/KL/0724/000001', '2024-07-11', '2024-07-11', 'admin', '', 1, NULL, 0, 2);

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

--
-- Table structure for table `piutang_partner`
--

CREATE TABLE `piutang_partner` (
  `id_piutang_partner` int(11) NOT NULL,
  `tanggal_piutang_partner` date NOT NULL,
  `id_partner` int(11) NOT NULL,
  `debit_piutang` bigint(20) NOT NULL,
  `kredit_piutang` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `produksi`
--

CREATE TABLE `produksi` (
  `id_produksi` int(11) NOT NULL,
  `no_produksi` varchar(90) NOT NULL,
  `tanggal_produksi` date NOT NULL,
  `id_resep` int(11) NOT NULL,
  `hasil_jadi` float NOT NULL,
  `harga` bigint(20) NOT NULL,
  `total_harga_produksi` bigint(20) NOT NULL,
  `ket_produksi_resep` text DEFAULT NULL,
  `user_buat` varchar(90) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `produksi`
--

INSERT INTO `produksi` (`id_produksi`, `no_produksi`, `tanggal_produksi`, `id_resep`, `hasil_jadi`, `harga`, `total_harga_produksi`, `ket_produksi_resep`, `user_buat`, `id_divisi`) VALUES
(13, 'PR/KL/0724/000001', '2024-07-11', 10, 1, 106124, 106124, NULL, 'admin', 1);

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

--
-- Table structure for table `resep`
--

CREATE TABLE `resep` (
  `id_resep` int(11) NOT NULL,
  `kode_resep` varchar(16) NOT NULL,
  `nama_resep` varchar(128) NOT NULL,
  `id_kategori_resep` int(11) NOT NULL,
  `harga_pokok` bigint(20) NOT NULL,
  `harga_pokok_lama` bigint(20) DEFAULT 0,
  `jumlah_dihasilkan` int(11) NOT NULL,
  `id_satuan_jumlah_dihasilkan` int(11) NOT NULL,
  `harga_pokok_dasar` int(11) NOT NULL,
  `harga_pokok_dasar_lama` int(11) DEFAULT 0,
  `hpp_per_porsi` int(11) NOT NULL,
  `hpp_per_porsi_lama` int(11) DEFAULT 0,
  `status` int(11) NOT NULL DEFAULT 1,
  `id_divisi` int(11) NOT NULL,
  `harga_jual` bigint(20) NOT NULL,
  `harga_jual_lama` bigint(20) DEFAULT 0,
  `jumlah_per_porsi` int(11) NOT NULL,
  `overhead` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `resep`
--

INSERT INTO `resep` (`id_resep`, `kode_resep`, `nama_resep`, `id_kategori_resep`, `harga_pokok`, `harga_pokok_lama`, `jumlah_dihasilkan`, `id_satuan_jumlah_dihasilkan`, `harga_pokok_dasar`, `harga_pokok_dasar_lama`, `hpp_per_porsi`, `hpp_per_porsi_lama`, `status`, `id_divisi`, `harga_jual`, `harga_jual_lama`, `jumlah_per_porsi`, `overhead`) VALUES
(10, 'R0001', 'HAKAU', 0, 105626, 105626, 40, 4, 0, 0, 10616, 10616, 1, 1, 60000, 0, 4, 25000),
(11, 'RK001', 'SIPUT', 0, 163, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5000, 0, 0, 150);

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

--
-- Table structure for table `retur_pembelian`
--

CREATE TABLE `retur_pembelian` (
  `id_retur_pembelian` int(11) NOT NULL,
  `no_retur_pembelian` varchar(767) NOT NULL,
  `tanggal_retur_pembelian` date NOT NULL,
  `id_partner` int(11) NOT NULL,
  `total_akhir_retur_pembelian` bigint(20) NOT NULL,
  `ket_retur_pembelian` text NOT NULL,
  `user_buat` varchar(767) NOT NULL,
  `user_ubah` varchar(767) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `saldo_awal`
--

CREATE TABLE `saldo_awal` (
  `id_saldo_awal` int(11) NOT NULL,
  `id_akun` int(11) NOT NULL,
  `jumlah_saldo_awal` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `saldo_awal`
--

INSERT INTO `saldo_awal` (`id_saldo_awal`, `id_akun`, `jumlah_saldo_awal`) VALUES
(1, 1, 100000);

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

--
-- Table structure for table `saldo_awal_hutang`
--

CREATE TABLE `saldo_awal_hutang` (
  `id_saldo_awal_hutang` int(11) NOT NULL,
  `id_partner` int(11) NOT NULL,
  `jumlah` bigint(20) NOT NULL DEFAULT 0,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `saldo_awal_hutang`
--

INSERT INTO `saldo_awal_hutang` (`id_saldo_awal_hutang`, `id_partner`, `jumlah`, `id_divisi`) VALUES
(1, 1, 500000, 1);

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

--
-- Table structure for table `saldo_awal_item`
--

CREATE TABLE `saldo_awal_item` (
  `id_saldo_awal` int(11) NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `jumlah` int(11) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `saldo_awal_item`
--

INSERT INTO `saldo_awal_item` (`id_saldo_awal`, `id_item`, `id_satuan`, `jumlah`, `id_divisi`) VALUES
(1, 0, 0, 0, 1),
(2, 0, 0, 0, 1),
(7, 6, 2, 10000, 1);

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

--
-- Table structure for table `saldo_awal_piutang`
--

CREATE TABLE `saldo_awal_piutang` (
  `id_saldo_awal_piutang` int(11) NOT NULL,
  `id_partner` int(11) NOT NULL,
  `jumlah` int(11) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `saldo_awal_piutang`
--

INSERT INTO `saldo_awal_piutang` (`id_saldo_awal_piutang`, `id_partner`, `jumlah`, `id_divisi`) VALUES
(1, 1, 10000, 1);

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

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

CREATE TABLE `satuan` (
  `id_satuan` int(11) NOT NULL,
  `nama_satuan` varchar(50) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `satuan` (`id_satuan`, `nama_satuan`, `id_divisi`) VALUES
(1, 'GRAM2', 1),
(2, 'KG', 1),
(3, 'PORSI', 1),
(4, 'PCS', 1),
(5, 'LEPEK', 1),
(6, 'GRAM3', 1);

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

--
-- Table structure for table `stok`
--

CREATE TABLE `stok` (
  `id_stok` int(11) NOT NULL,
  `id_item` int(11) DEFAULT NULL,
  `id_resep` int(11) DEFAULT NULL,
  `id_satuan` int(11) NOT NULL,
  `jumlah_stok` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `stok`
--

INSERT INTO `stok` (`id_stok`, `id_item`, `id_resep`, `id_satuan`, `jumlah_stok`) VALUES
(26, 8, NULL, 1, 61),
(27, 11, NULL, 1, 7749),
(28, 9, NULL, 1, 10999),
(29, NULL, 10, 4, 1),
(30, 10, NULL, 1, -1),
(31, 12, NULL, 1, -1),
(32, 13, NULL, 1, -1),
(33, 14, NULL, 1, -1);

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

--
-- Table structure for table `stok_opname`
--

CREATE TABLE `stok_opname` (
  `id_stok_opname` int(11) NOT NULL,
  `tanggal_stok_opname` date NOT NULL,
  `id_item` int(11) NOT NULL,
  `id_satuan` int(11) NOT NULL,
  `jumlah_sistem` float NOT NULL,
  `jumlah_real` float NOT NULL,
  `user_buat` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `stok_opname`
--

INSERT INTO `stok_opname` (`id_stok_opname`, `tanggal_stok_opname`, `id_item`, `id_satuan`, `jumlah_sistem`, `jumlah_real`, `user_buat`) VALUES
(1, '2020-11-27', 8, 2, 58, 50, 'admin'),
(2, '2020-11-27', 8, 2, 50, 51.5, 'admin'),
(3, '2024-07-22', 8, 2, 47500, 46, 'admin');

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

--
-- Table structure for table `surat_jalan_umum`
--

CREATE TABLE `surat_jalan_umum` (
  `id_surat_jalan_umum` int(11) NOT NULL,
  `tanggal_surat_jalan_umum` date NOT NULL,
  `no_surat_jalan_umum` varchar(50) NOT NULL,
  `kepada` varchar(50) NOT NULL,
  `alamat` text NOT NULL,
  `dengan_kendaraan` varchar(50) NOT NULL,
  `user_buat` varchar(128) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `surat_jalan_umum`
--

INSERT INTO `surat_jalan_umum` (`id_surat_jalan_umum`, `tanggal_surat_jalan_umum`, `no_surat_jalan_umum`, `kepada`, `alamat`, `dengan_kendaraan`, `user_buat`, `id_divisi`) VALUES
(1, '2020-10-15', 'SJU/KL/1020/000001', 'BANDAR NARKOBA', 'Jl. Heroin No. 14', 'L300', 'admin', 1),
(2, '2020-11-10', 'SJU/KL/1120/000001', 'HOTEL', 'hotel', 'TRUK', 'admin', 1);

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

--
-- Table structure for table `tanda_terima`
--

CREATE TABLE `tanda_terima` (
  `id_tanda_terima` int(11) NOT NULL,
  `id_partner` int(11) NOT NULL,
  `no_tanda_terima` varchar(80) NOT NULL,
  `tanggal_tanda_terima` date NOT NULL,
  `ket_tanda_terima` text DEFAULT NULL,
  `user_buat` varchar(60) NOT NULL,
  `id_divisi` int(11) NOT NULL,
  `jumlah_tanda_terima` bigint(20) NOT NULL,
  `jumlah_nota` bigint(20) NOT NULL,
  `ditagih` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tanda_terima`
--

INSERT INTO `tanda_terima` (`id_tanda_terima`, `id_partner`, `no_tanda_terima`, `tanggal_tanda_terima`, `ket_tanda_terima`, `user_buat`, `id_divisi`, `jumlah_tanda_terima`, `jumlah_nota`, `ditagih`) VALUES
(1, 1, '0', '2020-02-16', NULL, 'admin', 1, 0, 0, 0),
(2, 1, 'TT/0620/KL/00005', '2020-06-12', NULL, 'admin', 1, 45000, 1, 1),
(3, 1, 'TT/KL/1020/000001', '2020-10-29', NULL, 'admin', 1, 1500000, 0, 1);

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

--
-- Table structure for table `tanda_terima_umum`
--

CREATE TABLE `tanda_terima_umum` (
  `id_tanda_terima_umum` int(11) NOT NULL,
  `no_tanda_terima_umum` varchar(30) NOT NULL DEFAULT 'TEST',
  `tanggal_tanda_terima_umum` date NOT NULL,
  `telah_terima` text NOT NULL,
  `dari` varchar(20) NOT NULL,
  `alamat` varchar(50) NOT NULL,
  `user_buat` varchar(20) NOT NULL,
  `id_divisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tanda_terima_umum`
--

INSERT INTO `tanda_terima_umum` (`id_tanda_terima_umum`, `no_tanda_terima_umum`, `tanggal_tanda_terima_umum`, `telah_terima`, `dari`, `alamat`, `user_buat`, `id_divisi`) VALUES
(10, 'TTU/KL/1020/000001', '2020-10-16', 'NARKOBA', 'BANDAR', 'Jl. Kokain No. 13', 'admin', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `arus_kas`
--
ALTER TABLE `arus_kas`
  ADD PRIMARY KEY (`id_arus_kas`);

--
-- Indexes for table `arus_persediaan_barang`
--
ALTER TABLE `arus_persediaan_barang`
  ADD PRIMARY KEY (`id_arus_persediaan_barang`);

--
-- Indexes for table `bank`
--
ALTER TABLE `bank`
  ADD PRIMARY KEY (`id_bank`);

--
-- Indexes for table `buku_besar`
--
ALTER TABLE `buku_besar`
  ADD PRIMARY KEY (`id_buku_besar`);

--
-- Indexes for table `detail_arus_persediaan_barang`
--
ALTER TABLE `detail_arus_persediaan_barang`
  ADD PRIMARY KEY (`id_detail_arus_persediaan_barang`),
  ADD KEY `detail_arus_persediaan_barang_fk` (`id_arus_persediaan_barang`);

--
-- Indexes for table `detail_hutang`
--
ALTER TABLE `detail_hutang`
  ADD PRIMARY KEY (`id_detail_hutang`);

--
-- Indexes for table `detail_pembayaran_pembelian`
--
ALTER TABLE `detail_pembayaran_pembelian`
  ADD PRIMARY KEY (`id_detail_pembayaran_pembelian`);

--
-- Indexes for table `detail_pembelian`
--
ALTER TABLE `detail_pembelian`
  ADD PRIMARY KEY (`id_detail_pembelian`),
  ADD KEY `detail_pembelian_item_id_item_fk` (`id_item`),
  ADD KEY `detail_pembelian_pembelian_id_pembelian_fk` (`id_pembelian`),
  ADD KEY `detail_pembelian_satuan_id_satuan_fk` (`id_satuan_barang`);

--
-- Indexes for table `detail_penjualan`
--
ALTER TABLE `detail_penjualan`
  ADD PRIMARY KEY (`id_detail_penjualan`),
  ADD KEY `detail_penjualan_item_id_item_fk` (`id_item`),
  ADD KEY `detail_penjualan_resep_id_resep_fk` (`id_resep`);

--
-- Indexes for table `detail_penyusutan_stok`
--
ALTER TABLE `detail_penyusutan_stok`
  ADD PRIMARY KEY (`id_detail_penyusutan_stok`);

--
-- Indexes for table `detail_pesanan_pembelian`
--
ALTER TABLE `detail_pesanan_pembelian`
  ADD PRIMARY KEY (`id_detail_pesanan_pembelian`),
  ADD KEY `detail_pesanan_pembelian_id_pesanan_pembelian_fk` (`id_pesanan_pembelian`),
  ADD KEY `detail_pesanan_pembelian_item_id_item_fk` (`id_item`),
  ADD KEY `detail_pesanan_pembelian_satuan_id_satuan_fk` (`id_satuan_barang`);

--
-- Indexes for table `detail_produksi`
--
ALTER TABLE `detail_produksi`
  ADD PRIMARY KEY (`id_detail_produksi`);

--
-- Indexes for table `detail_resep`
--
ALTER TABLE `detail_resep`
  ADD PRIMARY KEY (`id_detail_resep`),
  ADD KEY `detail_resep_item_id_item_fk` (`id_item`),
  ADD KEY `detail_resep_resep_id_resep_fk` (`id_resep`),
  ADD KEY `detail_resep_satuan_id_satuan_fk` (`id_satuan`);

--
-- Indexes for table `detail_retur_pembelian`
--
ALTER TABLE `detail_retur_pembelian`
  ADD PRIMARY KEY (`id_detail_retur_pembelian`);

--
-- Indexes for table `detail_stok`
--
ALTER TABLE `detail_stok`
  ADD PRIMARY KEY (`id_detail_stok`);

--
-- Indexes for table `detail_surat_jalan_umum`
--
ALTER TABLE `detail_surat_jalan_umum`
  ADD PRIMARY KEY (`id_detil_surat_jalan_umum`),
  ADD KEY `detail_surat_jalan_umum_surat_jalan_umum_id_surat_jalan_fk` (`id_surat_jalan_umum`);

--
-- Indexes for table `detail_tanda_terima`
--
ALTER TABLE `detail_tanda_terima`
  ADD PRIMARY KEY (`id_detail_tanda_terima`);

--
-- Indexes for table `divisi`
--
ALTER TABLE `divisi`
  ADD PRIMARY KEY (`id_divisi`);

--
-- Indexes for table `gudang`
--
ALTER TABLE `gudang`
  ADD PRIMARY KEY (`id_gudang`);

--
-- Indexes for table `hutang_partner`
--
ALTER TABLE `hutang_partner`
  ADD PRIMARY KEY (`id_hutang_partner`);

--
-- Indexes for table `item`
--
ALTER TABLE `item`
  ADD PRIMARY KEY (`id_item`),
  ADD KEY `item_divisi_id_divisi_fk` (`id_divisi`),
  ADD KEY `item_jenis_id_jenis_fk` (`id_jenis`),
  ADD KEY `item_satuan_id_satuan_fk` (`id_satuan`);

--
-- Indexes for table `jabatan`
--
ALTER TABLE `jabatan`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `jabatan_kode_jabatan_uindex` (`kode_jabatan`);

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

--
-- Indexes for table `jurnal_umum`
--
ALTER TABLE `jurnal_umum`
  ADD PRIMARY KEY (`id_jurnal_umum`);

--
-- Indexes for table `kategori_resep`
--
ALTER TABLE `kategori_resep`
  ADD PRIMARY KEY (`id_kategori_resep`);

--
-- Indexes for table `kelas_akuntansi`
--
ALTER TABLE `kelas_akuntansi`
  ADD PRIMARY KEY (`id_kelas_akuntansi`);

--
-- Indexes for table `kode_akuntansi`
--
ALTER TABLE `kode_akuntansi`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `nomor_dokumen`
--
ALTER TABLE `nomor_dokumen`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `otorisasi_tanda_terima`
--
ALTER TABLE `otorisasi_tanda_terima`
  ADD PRIMARY KEY (`id_otorisasi`),
  ADD KEY `otorisasi_tanda_terima_tanda_terima_id_tanda_terima_fk` (`id_tanda_terima`),
  ADD KEY `otorisasi_tanda_terima_user_id_user_fk` (`id_user`);

--
-- Indexes for table `partner`
--
ALTER TABLE `partner`
  ADD PRIMARY KEY (`id_partner`);

--
-- Indexes for table `pembayaran_pembelian`
--
ALTER TABLE `pembayaran_pembelian`
  ADD PRIMARY KEY (`id_pembayaran_pembelian`);

--
-- Indexes for table `pembelian`
--
ALTER TABLE `pembelian`
  ADD PRIMARY KEY (`id_pembelian`),
  ADD KEY `pembelian_divisi_id_divisi_fk` (`id_divisi`);

--
-- Indexes for table `penjualan`
--
ALTER TABLE `penjualan`
  ADD PRIMARY KEY (`id_penjualan`);

--
-- Indexes for table `penjualan_moka`
--
ALTER TABLE `penjualan_moka`
  ADD PRIMARY KEY (`id_penjualan_moka`);

--
-- Indexes for table `penyusutan_stok`
--
ALTER TABLE `penyusutan_stok`
  ADD PRIMARY KEY (`id_penyusutan_stok`);

--
-- Indexes for table `pesanan_pembelian`
--
ALTER TABLE `pesanan_pembelian`
  ADD PRIMARY KEY (`id_pesanan_pembelian`),
  ADD KEY `pesanan_pembelian_partner_id_partner_fk` (`id_partner`);

--
-- Indexes for table `piutang_partner`
--
ALTER TABLE `piutang_partner`
  ADD PRIMARY KEY (`id_piutang_partner`);

--
-- Indexes for table `produksi`
--
ALTER TABLE `produksi`
  ADD PRIMARY KEY (`id_produksi`);

--
-- Indexes for table `resep`
--
ALTER TABLE `resep`
  ADD PRIMARY KEY (`id_resep`),
  ADD KEY `resep_divisi_id_divisi_fk` (`id_divisi`);

--
-- Indexes for table `retur_pembelian`
--
ALTER TABLE `retur_pembelian`
  ADD PRIMARY KEY (`id_retur_pembelian`);

--
-- Indexes for table `saldo_awal`
--
ALTER TABLE `saldo_awal`
  ADD PRIMARY KEY (`id_saldo_awal`);

--
-- Indexes for table `saldo_awal_hutang`
--
ALTER TABLE `saldo_awal_hutang`
  ADD PRIMARY KEY (`id_saldo_awal_hutang`);

--
-- Indexes for table `saldo_awal_item`
--
ALTER TABLE `saldo_awal_item`
  ADD PRIMARY KEY (`id_saldo_awal`);

--
-- Indexes for table `saldo_awal_piutang`
--
ALTER TABLE `saldo_awal_piutang`
  ADD PRIMARY KEY (`id_saldo_awal_piutang`);

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

--
-- Indexes for table `stok`
--
ALTER TABLE `stok`
  ADD PRIMARY KEY (`id_stok`),
  ADD KEY `stok_item_id_item_fk` (`id_item`),
  ADD KEY `stok_resep_id_resep_fk` (`id_resep`),
  ADD KEY `stok_satuan_id_satuan_fk` (`id_satuan`);

--
-- Indexes for table `stok_opname`
--
ALTER TABLE `stok_opname`
  ADD PRIMARY KEY (`id_stok_opname`);

--
-- Indexes for table `surat_jalan_umum`
--
ALTER TABLE `surat_jalan_umum`
  ADD PRIMARY KEY (`id_surat_jalan_umum`);

--
-- Indexes for table `tanda_terima`
--
ALTER TABLE `tanda_terima`
  ADD PRIMARY KEY (`id_tanda_terima`);

--
-- Indexes for table `tanda_terima_umum`
--
ALTER TABLE `tanda_terima_umum`
  ADD PRIMARY KEY (`id_tanda_terima_umum`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `arus_kas`
--
ALTER TABLE `arus_kas`
  MODIFY `id_arus_kas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `arus_persediaan_barang`
--
ALTER TABLE `arus_persediaan_barang`
  MODIFY `id_arus_persediaan_barang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `bank`
--
ALTER TABLE `bank`
  MODIFY `id_bank` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `buku_besar`
--
ALTER TABLE `buku_besar`
  MODIFY `id_buku_besar` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `detail_arus_persediaan_barang`
--
ALTER TABLE `detail_arus_persediaan_barang`
  MODIFY `id_detail_arus_persediaan_barang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `detail_hutang`
--
ALTER TABLE `detail_hutang`
  MODIFY `id_detail_hutang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `detail_pembayaran_pembelian`
--
ALTER TABLE `detail_pembayaran_pembelian`
  MODIFY `id_detail_pembayaran_pembelian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `detail_pembelian`
--
ALTER TABLE `detail_pembelian`
  MODIFY `id_detail_pembelian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `detail_penjualan`
--
ALTER TABLE `detail_penjualan`
  MODIFY `id_detail_penjualan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `detail_penyusutan_stok`
--
ALTER TABLE `detail_penyusutan_stok`
  MODIFY `id_detail_penyusutan_stok` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `detail_pesanan_pembelian`
--
ALTER TABLE `detail_pesanan_pembelian`
  MODIFY `id_detail_pesanan_pembelian` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `detail_produksi`
--
ALTER TABLE `detail_produksi`
  MODIFY `id_detail_produksi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- AUTO_INCREMENT for table `detail_resep`
--
ALTER TABLE `detail_resep`
  MODIFY `id_detail_resep` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;

--
-- AUTO_INCREMENT for table `detail_retur_pembelian`
--
ALTER TABLE `detail_retur_pembelian`
  MODIFY `id_detail_retur_pembelian` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `detail_stok`
--
ALTER TABLE `detail_stok`
  MODIFY `id_detail_stok` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=77;

--
-- AUTO_INCREMENT for table `detail_surat_jalan_umum`
--
ALTER TABLE `detail_surat_jalan_umum`
  MODIFY `id_detil_surat_jalan_umum` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `detail_tanda_terima`
--
ALTER TABLE `detail_tanda_terima`
  MODIFY `id_detail_tanda_terima` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `divisi`
--
ALTER TABLE `divisi`
  MODIFY `id_divisi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `gudang`
--
ALTER TABLE `gudang`
  MODIFY `id_gudang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `hutang_partner`
--
ALTER TABLE `hutang_partner`
  MODIFY `id_hutang_partner` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `item`
--
ALTER TABLE `item`
  MODIFY `id_item` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `jabatan`
--
ALTER TABLE `jabatan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `jenis`
--
ALTER TABLE `jenis`
  MODIFY `id_jenis` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `jurnal_umum`
--
ALTER TABLE `jurnal_umum`
  MODIFY `id_jurnal_umum` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `kategori_resep`
--
ALTER TABLE `kategori_resep`
  MODIFY `id_kategori_resep` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `kelas_akuntansi`
--
ALTER TABLE `kelas_akuntansi`
  MODIFY `id_kelas_akuntansi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `kode_akuntansi`
--
ALTER TABLE `kode_akuntansi`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;

--
-- AUTO_INCREMENT for table `nomor_dokumen`
--
ALTER TABLE `nomor_dokumen`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;

--
-- AUTO_INCREMENT for table `otorisasi_tanda_terima`
--
ALTER TABLE `otorisasi_tanda_terima`
  MODIFY `id_otorisasi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `partner`
--
ALTER TABLE `partner`
  MODIFY `id_partner` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `pembayaran_pembelian`
--
ALTER TABLE `pembayaran_pembelian`
  MODIFY `id_pembayaran_pembelian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `pembelian`
--
ALTER TABLE `pembelian`
  MODIFY `id_pembelian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `penjualan`
--
ALTER TABLE `penjualan`
  MODIFY `id_penjualan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `penjualan_moka`
--
ALTER TABLE `penjualan_moka`
  MODIFY `id_penjualan_moka` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `penyusutan_stok`
--
ALTER TABLE `penyusutan_stok`
  MODIFY `id_penyusutan_stok` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `pesanan_pembelian`
--
ALTER TABLE `pesanan_pembelian`
  MODIFY `id_pesanan_pembelian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- AUTO_INCREMENT for table `piutang_partner`
--
ALTER TABLE `piutang_partner`
  MODIFY `id_piutang_partner` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `produksi`
--
ALTER TABLE `produksi`
  MODIFY `id_produksi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `resep`
--
ALTER TABLE `resep`
  MODIFY `id_resep` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `retur_pembelian`
--
ALTER TABLE `retur_pembelian`
  MODIFY `id_retur_pembelian` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `saldo_awal`
--
ALTER TABLE `saldo_awal`
  MODIFY `id_saldo_awal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `saldo_awal_hutang`
--
ALTER TABLE `saldo_awal_hutang`
  MODIFY `id_saldo_awal_hutang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `saldo_awal_item`
--
ALTER TABLE `saldo_awal_item`
  MODIFY `id_saldo_awal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `saldo_awal_piutang`
--
ALTER TABLE `saldo_awal_piutang`
  MODIFY `id_saldo_awal_piutang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `satuan`
--
ALTER TABLE `satuan`
  MODIFY `id_satuan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `stok`
--
ALTER TABLE `stok`
  MODIFY `id_stok` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `stok_opname`
--
ALTER TABLE `stok_opname`
  MODIFY `id_stok_opname` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `surat_jalan_umum`
--
ALTER TABLE `surat_jalan_umum`
  MODIFY `id_surat_jalan_umum` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `tanda_terima`
--
ALTER TABLE `tanda_terima`
  MODIFY `id_tanda_terima` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `tanda_terima_umum`
--
ALTER TABLE `tanda_terima_umum`
  MODIFY `id_tanda_terima_umum` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `detail_arus_persediaan_barang`
--
ALTER TABLE `detail_arus_persediaan_barang`
  ADD CONSTRAINT `detail_arus_persediaan_barang_fk` FOREIGN KEY (`id_arus_persediaan_barang`) REFERENCES `arus_persediaan_barang` (`id_arus_persediaan_barang`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_pembelian`
--
ALTER TABLE `detail_pembelian`
  ADD CONSTRAINT `detail_pembelian_item_id_item_fk` FOREIGN KEY (`id_item`) REFERENCES `item` (`id_item`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_pembelian_pembelian_id_pembelian_fk` FOREIGN KEY (`id_pembelian`) REFERENCES `pembelian` (`id_pembelian`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_pembelian_satuan_id_satuan_fk` FOREIGN KEY (`id_satuan_barang`) REFERENCES `satuan` (`id_satuan`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_penjualan`
--
ALTER TABLE `detail_penjualan`
  ADD CONSTRAINT `detail_penjualan_item_id_item_fk` FOREIGN KEY (`id_item`) REFERENCES `item` (`id_item`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_penjualan_resep_id_resep_fk` FOREIGN KEY (`id_resep`) REFERENCES `resep` (`id_resep`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_pesanan_pembelian`
--
ALTER TABLE `detail_pesanan_pembelian`
  ADD CONSTRAINT `detail_pesanan_pembelian_id_pesanan_pembelian_fk` FOREIGN KEY (`id_pesanan_pembelian`) REFERENCES `pesanan_pembelian` (`id_pesanan_pembelian`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_pesanan_pembelian_item_id_item_fk` FOREIGN KEY (`id_item`) REFERENCES `item` (`id_item`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_pesanan_pembelian_satuan_id_satuan_fk` FOREIGN KEY (`id_satuan_barang`) REFERENCES `satuan` (`id_satuan`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_resep`
--
ALTER TABLE `detail_resep`
  ADD CONSTRAINT `detail_resep_item_id_item_fk` FOREIGN KEY (`id_item`) REFERENCES `item` (`id_item`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_resep_resep_id_resep_fk` FOREIGN KEY (`id_resep`) REFERENCES `resep` (`id_resep`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `detail_resep_satuan_id_satuan_fk` FOREIGN KEY (`id_satuan`) REFERENCES `satuan` (`id_satuan`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `detail_surat_jalan_umum`
--
ALTER TABLE `detail_surat_jalan_umum`
  ADD CONSTRAINT `detail_surat_jalan_umum_surat_jalan_umum_id_surat_jalan_fk` FOREIGN KEY (`id_surat_jalan_umum`) REFERENCES `surat_jalan_umum` (`id_surat_jalan_umum`);

--
-- Constraints for table `item`
--
ALTER TABLE `item`
  ADD CONSTRAINT `item_divisi_id_divisi_fk` FOREIGN KEY (`id_divisi`) REFERENCES `divisi` (`id_divisi`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `item_jenis_id_jenis_fk` FOREIGN KEY (`id_jenis`) REFERENCES `jenis` (`id_jenis`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `item_satuan_id_satuan_fk` FOREIGN KEY (`id_satuan`) REFERENCES `satuan` (`id_satuan`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `otorisasi_tanda_terima`
--
ALTER TABLE `otorisasi_tanda_terima`
  ADD CONSTRAINT `otorisasi_tanda_terima_tanda_terima_id_tanda_terima_fk` FOREIGN KEY (`id_tanda_terima`) REFERENCES `tanda_terima` (`id_tanda_terima`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `otorisasi_tanda_terima_user_id_user_fk` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pembelian`
--
ALTER TABLE `pembelian`
  ADD CONSTRAINT `pembelian_divisi_id_divisi_fk` FOREIGN KEY (`id_divisi`) REFERENCES `divisi` (`id_divisi`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pesanan_pembelian`
--
ALTER TABLE `pesanan_pembelian`
  ADD CONSTRAINT `pesanan_pembelian_partner_id_partner_fk` FOREIGN KEY (`id_partner`) REFERENCES `partner` (`id_partner`);

--
-- Constraints for table `resep`
--
ALTER TABLE `resep`
  ADD CONSTRAINT `resep_divisi_id_divisi_fk` FOREIGN KEY (`id_divisi`) REFERENCES `divisi` (`id_divisi`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `stok`
--
ALTER TABLE `stok`
  ADD CONSTRAINT `stok_item_id_item_fk` FOREIGN KEY (`id_item`) REFERENCES `item` (`id_item`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `stok_resep_id_resep_fk` FOREIGN KEY (`id_resep`) REFERENCES `resep` (`id_resep`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `stok_satuan_id_satuan_fk` FOREIGN KEY (`id_satuan`) REFERENCES `satuan` (`id_satuan`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

