-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 12, 2026 at 04:15 PM
-- Server version: 10.6.22-MariaDB
-- PHP Version: 8.3.23

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


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

--
-- Database: `persadal_db_smartlab2_live`
--

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

--
-- Table structure for table `t_po`
--

CREATE TABLE `t_po` (
  `id` int(11) NOT NULL,
  `m_group_po` int(3) DEFAULT 1,
  `m_cabang` int(11) DEFAULT 0,
  `m_cabang_ro` int(11) DEFAULT 0,
  `is_po_parents` int(11) DEFAULT 0,
  `nomor_po_induk` varchar(150) DEFAULT NULL,
  `m_ref_marketing` int(11) DEFAULT 0,
  `m_periode_penawaran` int(1) DEFAULT 0,
  `id_pic_sales_productivity` int(11) DEFAULT 0,
  `tanggal` date DEFAULT NULL,
  `nomor` varchar(150) NOT NULL,
  `nomor_urut` int(11) DEFAULT 0,
  `nomor_bulan` int(11) DEFAULT 0,
  `nomor_tahun` int(11) DEFAULT 0,
  `nomor_rev` int(11) DEFAULT 0,
  `is_rev` int(11) DEFAULT 0,
  `is_re_check` int(11) DEFAULT 0,
  `is_percepatan` int(11) DEFAULT 0,
  `perihal` varchar(150) DEFAULT NULL,
  `parent_m_customer` int(11) DEFAULT 0,
  `m_customer` int(11) DEFAULT 0,
  `m_kategori_customer` int(11) DEFAULT 0,
  `m_kategori_industri` int(11) DEFAULT 0,
  `is_sampel_dikirim_cust` int(11) DEFAULT 0,
  `lokasi_sampling` mediumtext DEFAULT NULL,
  `m_provinsi_lokasi_sampling` int(11) DEFAULT 0,
  `m_kabupaten_lokasi_sampling` int(11) DEFAULT 0,
  `perkiraan_tanggal_sampling` timestamp NULL DEFAULT NULL,
  `perkiraan_tanggal_sampling_akhir` timestamp NULL DEFAULT NULL,
  `is_plan_sampling` tinyint(1) DEFAULT 0,
  `propose_tanggal_sampling` date DEFAULT NULL,
  `propose_tanggal_sampling_akhir` date DEFAULT NULL,
  `tanggal_sampling` timestamp NULL DEFAULT NULL,
  `tanggal_sampling_akhir` timestamp NULL DEFAULT NULL,
  `tanggal_validasi_sampling` timestamp NULL DEFAULT NULL,
  `tanggal_realisasi_sampling_plan` timestamp NULL DEFAULT NULL,
  `tanggal_realisasi_sampling` timestamp NULL DEFAULT NULL,
  `tanggal_realisasi_sampling_akhir` timestamp NULL DEFAULT NULL,
  `tanggal_validasi_realisasi_sampling` timestamp NULL DEFAULT NULL,
  `id_pegawai_validasi_realisasi_sampling` int(11) DEFAULT 0,
  `m_kategori_lead_validasi_sampling` int(1) DEFAULT 0,
  `m_cabang_akuisisi` int(11) DEFAULT 0,
  `note_teknis` mediumtext DEFAULT NULL,
  `note_administrasi` mediumtext DEFAULT NULL,
  `note_internal_marketing` mediumtext DEFAULT NULL,
  `note_realisasi_sampling` mediumtext DEFAULT NULL,
  `sub_total` double DEFAULT 0,
  `disc_persen` float DEFAULT 0,
  `disc` double DEFAULT 0,
  `total` double DEFAULT 0,
  `dpp_lain` double DEFAULT 0,
  `ppn_persen` float DEFAULT 12,
  `ppn` double DEFAULT 0,
  `grand_total` double DEFAULT 0,
  `piutang` double DEFAULT 0,
  `cashback` double DEFAULT 0,
  `total_cou` double DEFAULT 0,
  `persen_gpm` double DEFAULT 0,
  `tanggal_pembayaran_cashback` timestamp NULL DEFAULT NULL,
  `m_status_pembayaran_cashback` int(11) DEFAULT 1,
  `bea_transfer` double DEFAULT 0,
  `m_status_pembayaran` int(11) DEFAULT 1,
  `is_lunas_manual` int(11) DEFAULT 0,
  `tanggal_lunas_manual` timestamp NULL DEFAULT NULL,
  `m_status_penawaran` int(11) DEFAULT 1,
  `m_status_cek_penawaran` int(11) DEFAULT 1,
  `tanggal_status_cek_penawaran` timestamp NULL DEFAULT NULL,
  `id_pegawai_cek_penawaran` int(11) DEFAULT 0,
  `tanggal_approved` timestamp NULL DEFAULT NULL,
  `m_status_validasi_sampel_dikirim` int(11) DEFAULT 1,
  `tanggal_validasi_sampel_dikirim` timestamp NULL DEFAULT NULL,
  `id_pegawai_validasi_sampel_dikirim` int(11) DEFAULT 0,
  `catatan_validasi_sampel_dikirim` text DEFAULT NULL,
  `m_status_cetak_po` int(11) DEFAULT 1,
  `tanggal_cetak_po` timestamp NULL DEFAULT NULL,
  `nomor_spp` varchar(50) DEFAULT NULL,
  `m_status_cetak_spp` int(11) DEFAULT 1,
  `tanggal_cetak_spp` timestamp NULL DEFAULT NULL,
  `nomor_invoice` varchar(50) DEFAULT NULL,
  `nomor_urut_invoice` int(11) DEFAULT 0,
  `m_status_cetak_invoice` int(11) DEFAULT 1,
  `tanggal_cetak_invoice` timestamp NULL DEFAULT NULL,
  `tanggal_due_date_invoice` timestamp NULL DEFAULT NULL,
  `m_status_kirim_invoice` int(11) DEFAULT 1,
  `tanggal_kirim_invoice` timestamp NULL DEFAULT NULL,
  `nomor_resi_invoice` varchar(50) DEFAULT NULL,
  `m_status_terima_invoice` int(11) DEFAULT 1,
  `tanggal_terima_invoice` timestamp NULL DEFAULT NULL,
  `penerima_invoice` varchar(50) DEFAULT NULL,
  `m_status_cetak_kwitansi` int(11) DEFAULT 1,
  `tanggal_cetak_kwitansi` timestamp NULL DEFAULT NULL,
  `nomor_faktur` varchar(100) DEFAULT NULL,
  `m_status_cetak_faktur` int(11) DEFAULT 1,
  `tanggal_cetak_faktur` timestamp NULL DEFAULT NULL,
  `m_status_kirim_faktur` int(11) DEFAULT 1,
  `tanggal_kirim_faktur` timestamp NULL DEFAULT NULL,
  `m_status_cetak_lhu` int(11) DEFAULT 1,
  `tanggal_cetak_lhu` timestamp NULL DEFAULT NULL,
  `m_status_kirim` int(11) DEFAULT 1,
  `tanggal_kirim` timestamp NULL DEFAULT NULL,
  `nomor_resi` varchar(50) DEFAULT NULL,
  `alamat_kirim_dokumen` mediumtext DEFAULT NULL,
  `narahubung_nama_lhu` varchar(100) DEFAULT NULL,
  `narahubung_telp_lhu` varchar(25) DEFAULT NULL,
  `alamat_kirim_lhu` mediumtext DEFAULT NULL,
  `m_status_terima` int(11) DEFAULT 1,
  `tanggal_terima_dokumen` date DEFAULT NULL,
  `penerima_dokumen` varchar(50) DEFAULT NULL,
  `keterangan` varchar(500) DEFAULT NULL,
  `reason_perubahan_po` varchar(1000) DEFAULT NULL,
  `reason_rejected` mediumtext DEFAULT NULL,
  `tanggal_penawaran_cancelled` timestamp NULL DEFAULT NULL,
  `is_cetak_po_teknis` int(11) DEFAULT 1,
  `tanggal_cetak_po_teknis` timestamp NULL DEFAULT NULL,
  `user_cetak_po_teknis` int(11) DEFAULT 0,
  `nomor_sj` varchar(50) DEFAULT NULL,
  `sj_nomor_urut` int(11) DEFAULT 0,
  `sj_bulan` int(11) DEFAULT 0,
  `sj_tahun` int(11) DEFAULT 0,
  `sj_created_user` int(11) DEFAULT 0,
  `sj_created_date` timestamp NULL DEFAULT NULL,
  `m_cabang_pelaksana` int(11) DEFAULT 0,
  `nomor_io` varchar(50) DEFAULT NULL,
  `is_sampling_gmp` int(3) DEFAULT 0,
  `tanggal_sampling_saved_before` timestamp NULL DEFAULT NULL,
  `tanggal_sampling_akhir_saved_before` timestamp NULL DEFAULT NULL,
  `m_status_validasi_po_drafting` int(1) DEFAULT 1,
  `tanggal_validasi_po_drafting` timestamp NULL DEFAULT NULL,
  `id_pegawai_validasi_po_drafting` int(11) DEFAULT 0,
  `coupon_disc` int(11) DEFAULT 0,
  `tanggal_cetak_dokumen` timestamp NULL DEFAULT NULL,
  `tanggal_reminder_dokumen` timestamp NULL DEFAULT NULL,
  `is_non_pendamping_lk` int(1) DEFAULT 0,
  `created_user` int(11) DEFAULT 0,
  `created_date` timestamp NULL DEFAULT current_timestamp(),
  `updated_user` int(11) DEFAULT 0,
  `updated_date` timestamp NULL DEFAULT current_timestamp(),
  `is_delete` int(11) DEFAULT 0,
  `deleted_user` int(11) DEFAULT 0,
  `deleted_date` timestamp NULL DEFAULT NULL,
  `is_approvedsampling` tinyint(4) DEFAULT 0,
  `request_tim` int(11) DEFAULT 0,
  `prioritas` char(20) DEFAULT NULL,
  `tanggal_terima_sampel` datetime DEFAULT NULL,
  `id_user_terima_sampel` bigint(20) DEFAULT NULL,
  `duplicate_from` int(11) DEFAULT 0,
  `reason_gpm` text DEFAULT NULL,
  `jumlah_so_sharing_biaya` int(2) DEFAULT 1,
  `id_transaction_accurate` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

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

--
-- Table structure for table `t_po_det`
--

CREATE TABLE `t_po_det` (
  `id` int(11) NOT NULL,
  `t_po` int(11) DEFAULT 0,
  `m_jenis_pengujian` int(11) DEFAULT 0,
  `provide_by_client` int(11) DEFAULT 0,
  `m_peraturan` int(11) DEFAULT 0,
  `m_parameter_uji` varchar(750) DEFAULT NULL,
  `titik` int(11) DEFAULT 0,
  `tarif` double DEFAULT 0,
  `jumlah` double DEFAULT 0,
  `disc_persen` double DEFAULT 0,
  `disc_rupiah` double DEFAULT 0,
  `cou_param` double DEFAULT 0,
  `sum_cou_param` double DEFAULT 0,
  `is_subkon` tinyint(1) DEFAULT 0,
  `note` text DEFAULT NULL,
  `is_hide` tinyint(1) DEFAULT 0,
  `created_user` int(11) DEFAULT 0,
  `created_date` timestamp NULL DEFAULT current_timestamp(),
  `updated_user` int(11) DEFAULT 0,
  `updated_date` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `is_delete` int(11) DEFAULT 0,
  `deleted_user` int(11) DEFAULT 0,
  `deleted_date` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

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

--
-- Table structure for table `t_po_det_param`
--

CREATE TABLE `t_po_det_param` (
  `id` int(11) NOT NULL,
  `t_po_det` int(11) DEFAULT 0,
  `m_parameter_uji` varchar(750) DEFAULT NULL,
  `is_parameter_tambahan` int(11) DEFAULT 0,
  `harga` double DEFAULT 0,
  `cou` double DEFAULT 0,
  `created_user` int(11) DEFAULT 0,
  `created_date` timestamp NULL DEFAULT current_timestamp(),
  `updated_user` int(11) DEFAULT 0,
  `updated_date` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `is_delete` int(11) DEFAULT 0,
  `deleted_user` int(11) DEFAULT 0,
  `deleted_date` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci ROW_FORMAT=DYNAMIC;

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

--
-- Table structure for table `t_po_pembayaran`
--

CREATE TABLE `t_po_pembayaran` (
  `id` int(11) NOT NULL,
  `t_po` int(11) DEFAULT 0,
  `nomor_bukti_bayar` varchar(100) DEFAULT NULL,
  `tanggal_bayar` date DEFAULT NULL,
  `jumlah` double DEFAULT 0,
  `diskon` int(11) DEFAULT 0,
  `pph` int(11) DEFAULT 0,
  `keterangan` varchar(500) DEFAULT NULL,
  `created_user` int(11) NOT NULL,
  `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_user` int(11) NOT NULL,
  `updated_date` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `is_delete` int(11) DEFAULT 0,
  `deleted_user` int(11) DEFAULT 0,
  `deleted_date` timestamp NULL DEFAULT NULL,
  `idempotency_key` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `t_po`
--
ALTER TABLE `t_po`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_t_po_1` (`id`),
  ADD UNIQUE KEY `idx_t_po_2` (`id`,`m_cabang`),
  ADD KEY `created_user` (`created_user`),
  ADD KEY `updated_user` (`updated_user`),
  ADD KEY `deleted_user` (`deleted_user`),
  ADD KEY `idx_t_po_3` (`m_cabang`,`tanggal_approved`),
  ADD KEY `idx_po_id_nomor` (`id`,`nomor`);

--
-- Indexes for table `t_po_det`
--
ALTER TABLE `t_po_det`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_t_po_det_1` (`id`),
  ADD UNIQUE KEY `idx_t_po_det_2` (`id`,`t_po`),
  ADD KEY `created_user` (`created_user`),
  ADD KEY `updated_user` (`updated_user`),
  ADD KEY `deleted_user` (`deleted_user`),
  ADD KEY `fk_t_po_det_1` (`t_po`);

--
-- Indexes for table `t_po_det_param`
--
ALTER TABLE `t_po_det_param`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_t_po_det_param_1` (`id`),
  ADD UNIQUE KEY `idx_t_po_det_param_2` (`id`,`t_po_det`),
  ADD UNIQUE KEY `idx_t_po_det_param_3` (`id`,`t_po_det`,`m_parameter_uji`),
  ADD KEY `fk_t_po_det_param_1` (`t_po_det`);

--
-- Indexes for table `t_po_pembayaran`
--
ALTER TABLE `t_po_pembayaran`
  ADD PRIMARY KEY (`id`),
  ADD KEY `created_user` (`created_user`),
  ADD KEY `updated_user` (`updated_user`),
  ADD KEY `deleted_user` (`deleted_user`),
  ADD KEY `idx_pembayaran_nomor_bukti_id` (`nomor_bukti_bayar`,`id`,`t_po`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `t_po`
--
ALTER TABLE `t_po`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `t_po_det`
--
ALTER TABLE `t_po_det`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `t_po_det_param`
--
ALTER TABLE `t_po_det_param`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `t_po_pembayaran`
--
ALTER TABLE `t_po_pembayaran`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `t_po_det`
--
ALTER TABLE `t_po_det`
  ADD CONSTRAINT `fk_t_po_det_1` FOREIGN KEY (`t_po`) REFERENCES `t_po` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `t_po_det_param`
--
ALTER TABLE `t_po_det_param`
  ADD CONSTRAINT `fk_t_po_det_param_1` FOREIGN KEY (`t_po_det`) REFERENCES `t_po_det` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
COMMIT;

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