INSERT INTO `log` (`id`, `plant_id`, `user_no`, `process`, `token`, `action`, `actiontime`, `department`, `emp_id`, `frontend_url`, `method`, `REMOTE_ADDR`) VALUES
(50672, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'saveTestMethodMaster1', '2023-08-31 01:06:54', 'master', 'master', '', 'POST', '103.178.207.52'),
(50673, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getPRawMOA', '2023-08-31 01:06:57', 'master', 'master', '', 'GET', '103.178.207.52'),
(50674, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getMaterialDetails', '2023-08-31 01:07:00', 'master', 'master', '', 'GET', '103.178.207.52'),
(50675, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getMedia', '2023-08-31 01:07:01', 'master', 'master', '', 'GET', '103.178.207.52'),
(50676, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCEquipments', '2023-08-31 01:07:01', 'master', 'master', '', 'GET', '103.178.207.52'),
(50677, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getweighingbalance', '2023-08-31 01:07:01', 'master', 'master', '', 'GET', '103.178.207.52'),
(50678, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getHPLCs', '2023-08-31 01:07:01', 'master', 'master', '', 'GET', '103.178.207.52'),
(50679, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getGlasswares', '2023-08-31 01:07:01', 'master', 'master', '', 'GET', '103.178.207.52'),
(50680, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'saveTestMethodMaster1', '2023-08-31 01:07:24', 'master', 'master', '', 'POST', '103.178.207.52'),
(50681, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getPRawMOA', '2023-08-31 01:07:29', 'master', 'master', '', 'GET', '103.178.207.52'),
(50682, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getMaterialDetails', '2023-08-31 01:07:32', 'master', 'master', '', 'GET', '103.178.207.52'),
(50683, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCEquipments', '2023-08-31 01:07:33', 'master', 'master', '', 'GET', '103.178.207.52'),
(50684, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getGlasswares', '2023-08-31 01:07:33', 'master', 'master', '', 'GET', '103.178.207.52'),
(50685, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getweighingbalance', '2023-08-31 01:07:33', 'master', 'master', '', 'GET', '103.178.207.52'),
(50686, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getHPLCs', '2023-08-31 01:07:33', 'master', 'master', '', 'GET', '103.178.207.52'),
(50687, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getMedia', '2023-08-31 01:07:33', 'master', 'master', '', 'GET', '103.178.207.52'),
(50688, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'saveTestMethodMaster1', '2023-08-31 01:07:58', 'master', 'master', '', 'POST', '103.178.207.52'),
(50689, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getPRawMOA', '2023-08-31 01:08:00', 'master', 'master', '', 'GET', '103.178.207.52'),
(50690, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getEmployeesbyDpt', '2023-08-31 02:13:38', 'master', 'master', '', 'GET', '103.178.207.52'),
(50691, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:26:08', 'master', 'master', '', 'GET', '103.178.207.52'),
(50692, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getEmployeesbyDpt', '2023-08-31 02:26:55', 'master', 'master', '', 'GET', '103.178.207.52'),
(50693, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getLAFEquipments', '2023-08-31 02:27:43', 'master', 'master', '', 'GET', '103.178.207.52'),
(50694, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:27:43', 'master', 'master', '', 'GET', '103.178.207.52'),
(50695, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:27:46', 'master', 'master', '', 'GET', '103.178.207.52'),
(50696, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:27:53', 'master', 'master', '', 'GET', '103.178.207.52'),
(50697, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getEmployeesbyDpt', '2023-08-31 02:30:35', 'master', 'master', '', 'GET', '103.178.207.52'),
(50698, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:31:17', 'master', 'master', '', 'GET', '103.178.207.52'),
(50699, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getEmployeesbyDpt', '2023-08-31 02:35:02', 'master', 'master', '', 'GET', '103.178.207.52'),
(50700, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:36:04', 'master', 'master', '', 'GET', '103.178.207.52'),
(50701, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:36:29', 'master', 'master', '', 'GET', '103.178.207.52'),
(50702, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:36:38', 'master', 'master', '', 'GET', '103.178.207.52'),
(50703, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:37:05', 'master', 'master', '', 'GET', '103.178.207.52'),
(50704, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:37:14', 'master', 'master', '', 'GET', '103.178.207.52'),
(50705, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getEmployeesbyDpt', '2023-08-31 02:37:58', 'master', 'master', '', 'GET', '103.178.207.52'),
(50706, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:38:51', 'master', 'master', '', 'GET', '103.178.207.52'),
(50707, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:39:00', 'master', 'master', '', 'GET', '103.178.207.52'),
(50708, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getEmployeesbyDpt', '2023-08-31 02:41:36', 'master', 'master', '', 'GET', '103.178.207.52'),
(50709, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:42:16', 'master', 'master', '', 'GET', '103.178.207.52'),
(50710, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getLAFEquipments', '2023-08-31 02:42:37', 'master', 'master', '', 'GET', '103.178.207.52'),
(50711, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getQCLAfRAF', '2023-08-31 02:42:37', 'master', 'master', '', 'GET', '103.178.207.52'),
(50712, '', 'gmpdemo1', 'FRONTEND', 'cjQ1RDJqbStybHRMZEpxOWxoT0ZSQ0tOOUxBU3dUZmtxK0pMVi9NNzg0WTFkNEZEcWJLOUFJSnRIUlo2OGpMbw==', 'getSamplingBalances', '2023-08-31 02:42:39', 'master', 'master', '', 'GET', '103.178.207.52'),
(50713, '', 'gmpdemo1', 'FRONTEND', 'ZzFVVVdnU09ZSTJZM3ZLL2hKWUJFS3NFc3JXdEZ3L1F5MVJoRXJ2MzdJbDJyeFZyVWRHNTJtSW9zazh4U29aSg==', 'getGownsReceivedEntry', '2023-09-02 11:29:24', 'Production', 'master', '', 'GET', '103.155.206.78'),
(50714, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getEmployeesbyDpt', '2023-09-04 02:09:37', 'master', 'master', '', 'GET', '103.155.206.78'),
(50715, '', 'gmpdemo1', 'FRONTEND', 'S0tBbWZDZnBlQ0tZZ2JjakNJR2xoS1ljQm9WdU8xVEM5VTh6ZkVEREw1SVo4Sjc2VWdTWTZLSWdkYWdoZzJJVg==', 'getMedicalCheckupReport', '2023-09-04 02:32:13', 'master', 'master', '', 'GET', '103.178.207.52'),
(50716, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getSecurityDetails', '2023-09-05 01:26:14', 'master', 'master', '', 'GET', '103.155.206.78'),
(50717, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getKeymaster', '2023-09-05 01:26:50', 'master', 'master', '', 'GET', '103.155.206.78'),
(50718, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getKeyregister', '2023-09-05 01:26:52', 'master', 'master', '', 'GET', '103.155.206.78'),
(50719, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getOUTWARD', '2023-09-05 01:26:59', 'master', 'master', '', 'GET', '103.155.206.78'),
(50720, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getOUTWARD', '2023-09-05 01:27:03', 'master', 'master', '', 'GET', '103.155.206.78'),
(50721, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getKeyregister', '2023-09-05 01:27:26', 'master', 'master', '', 'GET', '103.155.206.78'),
(50722, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getKeyregister', '2023-09-05 01:27:46', 'master', 'master', '', 'GET', '103.155.206.78'),
(50723, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getVechileDetails', '2023-09-05 01:28:34', 'master', 'master', '', 'GET', '103.155.206.78'),
(50724, '', 'gmpdemo1', 'FRONTEND', 'OTB1UUNqdXI0YjdaeEFpOTBQR2N3WDdQQWR6V3RJeXdrWHpGM25rbVVYSGp3ZWRyZytPRnFSRTh4bTlHOExFZQ==', 'getRequestsLog', '2023-09-05 13:29:50', 'master', 'master', '', 'GET', '103.155.206.78');

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

--
-- Table structure for table `luxmeter_monitoring`
--

CREATE TABLE `luxmeter_monitoring` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `luxmeter_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `l1` decimal(10,2) NOT NULL,
  `l2` decimal(10,2) NOT NULL,
  `l3` decimal(10,2) NOT NULL,
  `l4` decimal(10,2) NOT NULL,
  `l5` decimal(10,2) NOT NULL,
  `average` decimal(10,2) NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `check_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `maintenance`
--

CREATE TABLE `maintenance` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `section` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `maintenance_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `urgency_level` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `problem` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `breakdown_time` time NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `allocated_person` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `descriptions` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `check_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `attend_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `attend_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `manpower`
--

CREATE TABLE `manpower` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) NOT NULL DEFAULT 'gmpdemo1',
  `department` varchar(50) NOT NULL,
  `type` varchar(100) NOT NULL,
  `designation` varchar(100) NOT NULL,
  `description` text NOT NULL,
  `candidates` int NOT NULL,
  `qualification` varchar(50) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `accept_reject_by` varchar(25) NOT NULL,
  `accept_reject_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `manpower`
--

INSERT INTO `manpower` (`id`, `plant_id`, `user_no`, `department`, `type`, `designation`, `description`, `candidates`, `qualification`, `status`, `entry_by`, `entry_date`, `accept_reject_by`, `accept_reject_on`) VALUES
(84, '60', 'gmpdemo1', 'Engineering', 'Officer', 'EXECUTIVE', 'test..', 1, 'MBA', 'approve', 'master', '2023-08-03 11:03:30', 'master', '2023-08-03 11:03:38');

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

--
-- Table structure for table `manual_fg_entry`
--

CREATE TABLE `manual_fg_entry` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `stock_type` varchar(50) NOT NULL,
  `market_type` varchar(50) NOT NULL,
  `dosage_form` varchar(50) NOT NULL,
  `product_name` varchar(50) NOT NULL,
  `product_code` varchar(50) NOT NULL,
  `ar_no` varchar(50) NOT NULL,
  `rel_date` varchar(50) NOT NULL,
  `batch_no` varchar(50) NOT NULL,
  `batch_size` varchar(50) NOT NULL,
  `yield` varchar(50) NOT NULL,
  `pack_size` varchar(50) NOT NULL,
  `total_containers` varchar(50) NOT NULL,
  `mfg_date` varchar(50) NOT NULL,
  `exp_date` varchar(50) NOT NULL,
  `entry_for` varchar(50) NOT NULL,
  `client_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `manufacturing_process`
--

CREATE TABLE `manufacturing_process` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dosage_form` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `process_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `step` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `manufacturing_process_step`
--

CREATE TABLE `manufacturing_process_step` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `dosage_form` varchar(50) NOT NULL,
  `process_type` varchar(50) NOT NULL,
  `process_stage` varchar(25) NOT NULL,
  `step` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `temp` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `marketing_advice`
--

CREATE TABLE `marketing_advice` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `name` varchar(100) NOT NULL,
  `address` varchar(100) NOT NULL,
  `batch_no` int NOT NULL,
  `product_name` varchar(100) NOT NULL,
  `date` date NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'approve'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `market_complaint`
--

CREATE TABLE `market_complaint` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `complaint_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `received_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complaint_nature` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complaint_sample` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mfg_date` date NOT NULL,
  `exp_date` date NOT NULL,
  `complaint_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `control_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `serevity` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `send_sample` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime DEFAULT NULL,
  `check_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `investigation_start` date NOT NULL,
  `investigation_complete` date NOT NULL,
  `complaintent_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `received_from` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contact_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sendsample_to` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `severity` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `forward` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `physcian_email` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `departments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `documents` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `observation` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `primary_observation` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `assessment` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `massage`
--

CREATE TABLE `massage` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `incoming_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `outgoing_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `message` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `masterformula`
--

CREATE TABLE `masterformula` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `mfr_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ownership_type` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Kg',
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stages` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `mf_id1` int NOT NULL,
  `entry_by` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `check_by` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `check_date` date DEFAULT NULL,
  `approve_by` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `approve_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `masters`
--

CREATE TABLE `masters` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `standard_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chemical_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `strength` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime(6) NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `master_checklist`
--

CREATE TABLE `master_checklist` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `heading` varchar(20) NOT NULL,
  `department` varchar(25) NOT NULL,
  `form_name` varchar(50) NOT NULL,
  `module` varchar(50) NOT NULL,
  `ch_id` varchar(20) NOT NULL,
  `master_ch_dtl` varchar(2000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `master_checklist`
--

INSERT INTO `master_checklist` (`id`, `plant_id`, `heading`, `department`, `form_name`, `module`, `ch_id`, `master_ch_dtl`) VALUES
(80, 60, 'heading 1', 'Store', 'Receiving', 'Receiving', 'CH-01', ''),
(81, 60, 'Primary round', 'HR', 'Primary HR Round', 'Primary', 'CH-081', ''),
(82, 60, 'Interview form', 'HR', 'Interviewer Round', 'Interviewer', 'CH-082', ''),
(83, 60, 'Final round', 'HR', 'Final', 'Final', 'CH-083', ''),
(84, 60, 'Manager', 'Store', 'Weighing', 'Weighing', 'CH-084', '');

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

--
-- Table structure for table `master_culture`
--

CREATE TABLE `master_culture` (
  `id` int NOT NULL,
  `name_of_organism` varchar(150) NOT NULL,
  `atcc_no` varchar(10) NOT NULL,
  `macroscopic_features` varchar(150) NOT NULL,
  `macroscopic_features_gram_staining` varchar(150) NOT NULL,
  `maintenance_medium` varchar(150) NOT NULL,
  `temperature_incubation_time` varchar(150) NOT NULL,
  `gst_per` decimal(6,2) NOT NULL,
  `hsn_code` varchar(8) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `entry_by` varchar(50) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `master_fg_types`
--

CREATE TABLE `master_fg_types` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `product_nature` varchar(50) NOT NULL,
  `dosage_form_type` varchar(50) NOT NULL,
  `dosage_sizes` varchar(2000) NOT NULL,
  `dosage_shapes` varchar(2000) NOT NULL,
  `fg_sampling_plan` varchar(50) NOT NULL,
  `fg_sampling_qty` varchar(50) NOT NULL,
  `fg_control_reserve_type` varchar(20) NOT NULL,
  `fg_control_sample_criteria` varchar(20) NOT NULL,
  `dosage_sub_form` varchar(2000) NOT NULL,
  `entered_by` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL,
  `approved_by` varchar(50) NOT NULL,
  `approved_date` datetime NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'Pending',
  `test` json NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `master_fg_types`
--

INSERT INTO `master_fg_types` (`id`, `plant_id`, `product_nature`, `dosage_form_type`, `dosage_sizes`, `dosage_shapes`, `fg_sampling_plan`, `fg_sampling_qty`, `fg_control_reserve_type`, `fg_control_sample_criteria`, `dosage_sub_form`, `entered_by`, `entry_date`, `approved_by`, `approved_date`, `status`, `test`) VALUES
(88, 60, 'SOLID', 'Capsule', '\"\"', '\"\"', '', 'Test Specific', 'Applicable', 'Two Times (of single', '[{\"dosage_sub_form\":\"Tablet\"}]', 'master', '2023-08-04 11:38:19', '', '0000-00-00 00:00:00', 'Pending', 'null');

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

--
-- Table structure for table `master_index`
--

CREATE TABLE `master_index` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `country_name` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `dossier_dmf` varchar(25) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `particular` varchar(50) NOT NULL,
  `index_id` varchar(50) NOT NULL,
  `document` varchar(100) NOT NULL,
  `multiple_upload` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `ch_id` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Stand-in structure for view `master_material`
-- (See below for the actual view)
--
CREATE TABLE `master_material` (
`grade` varchar(50)
,`gst_id` bigint
,`gst_percent` decimal(10,2)
,`hsn` varchar(20)
,`id` int
,`material_code` varchar(100)
,`material_name` varchar(151)
,`material_nature` varchar(100)
,`material_sub_type_id` int
,`material_subtype` varchar(100)
,`material_type` varchar(100)
,`plant_id` varchar(20)
,`status` varchar(100)
,`testing_required` varchar(3)
,`unit` varchar(100)
);

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

--
-- Stand-in structure for view `master_material_bkp`
-- (See below for the actual view)
--
CREATE TABLE `master_material_bkp` (
`gst_id` int
,`gst_percent` decimal(5,2)
,`hsn` varchar(20)
,`id` int
,`material_code` varchar(100)
,`material_name` varchar(100)
,`material_nature` varchar(100)
,`material_sub_type_id` int
,`material_subtype` varchar(40)
,`material_type` varchar(30)
,`plant_id` varchar(20)
,`status` varchar(100)
,`testing_required` varchar(3)
);

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

--
-- Table structure for table `master_media`
--

CREATE TABLE `master_media` (
  `id` int NOT NULL,
  `media_name` varchar(150) NOT NULL,
  `media_code` varchar(10) NOT NULL,
  `media_description` varchar(150) NOT NULL,
  `hsn_code` varchar(8) NOT NULL,
  `gst_per` decimal(5,2) NOT NULL,
  `entered_by` varchar(50) NOT NULL,
  `entry_date` int NOT NULL,
  `status` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `material`
--

CREATE TABLE `material` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `material_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_sub_type_id` int NOT NULL,
  `gst_id` int NOT NULL,
  `micro` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_subtype` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cas_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `upac_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_nature` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inventory` decimal(10,2) NOT NULL DEFAULT '10.00',
  `location` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `storage_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` decimal(10,2) NOT NULL,
  `order_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inv_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `density` decimal(10,2) NOT NULL,
  `unit` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `retest` decimal(10,2) NOT NULL,
  `shelf_life` decimal(10,2) NOT NULL,
  `min_shelf` decimal(10,2) NOT NULL,
  `lead_time` decimal(10,2) NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hsn` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `ml_generated` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ml_transfer_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approve',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sub_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sub_category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `printing_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equivalancy_applicable` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equivalancy_factor` decimal(6,2) NOT NULL,
  `equivalent_to` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `molecular_wt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `molecular_formula` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_appearance` varchar(100) NOT NULL,
  `sub_grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purchase_limit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `retest_month` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rda` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `max_limit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `appearance` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `salt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `specification` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `art_work` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `weight` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `length` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `width` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `height` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image1` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image2` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image3` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '1',
  `grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Inhouse',
  `cas_no` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_master` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `general_material_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_type` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_size` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `uom` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `alternate_uom` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_requirement` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `safety` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ce_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `color_index` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(50) NOT NULL,
  `product_n` varchar(50) NOT NULL,
  `artwork_no` varchar(50) NOT NULL,
  `artwork_file` varchar(50) NOT NULL,
  `shadecard` varchar(50) NOT NULL,
  `shadecard_no` varchar(50) NOT NULL,
  `shadecard_type` varchar(50) NOT NULL,
  `shadecard_file` varchar(50) NOT NULL,
  `m_photo` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `material`
--

INSERT INTO `material` (`id`, `user_no`, `material_type`, `material_code`, `material_sub_type_id`, `gst_id`, `micro`, `material_subtype`, `material_name`, `cas_name`, `upac_name`, `material_nature`, `inventory`, `location`, `storage_condition`, `order_qty`, `order_unit`, `inv_unit`, `density`, `unit`, `retest`, `shelf_life`, `min_shelf`, `lead_time`, `category`, `hsn`, `gst`, `ml_generated`, `ml_transfer_qty`, `status`, `entry_by`, `entry_date`, `approve_by`, `approve_date`, `sub_type`, `sub_category`, `printing_type`, `product_name`, `equivalancy_applicable`, `equivalancy_factor`, `equivalent_to`, `molecular_wt`, `molecular_formula`, `material_appearance`, `sub_grade`, `purchase_limit`, `retest_month`, `rda`, `max_limit`, `appearance`, `salt`, `description`, `rate`, `specification`, `client_code`, `art_work`, `weight`, `length`, `width`, `height`, `image1`, `image2`, `image3`, `plant_id`, `grade`, `cas_no`, `material_master`, `general_material_type`, `part_type`, `part_size`, `part_no`, `equipment`, `uom`, `alternate_uom`, `pack_size`, `packing_requirement`, `safety`, `ce_number`, `color_index`, `type`, `product_n`, `artwork_no`, `artwork_file`, `shadecard`, `shadecard_no`, `shadecard_type`, `shadecard_file`, `m_photo`) VALUES
(635, 'gmpdemo1', 'Raw Material', 'RM00012', 270, 0, '', 'Raw material', 'Cranberry Fruit Powder', '', '', 'SOLID', 0.00, '', 'STORE IN COOL PLACE', 0.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 0.00, 'Active', '3546', 12.00, '', '', 'approve', 'master', '2023-08-02 12:43:00', '', '', '', '', '', '', 'No', 0.00, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '60', '80,81', '', '', '', '', '', '', '', '', 'Kg', '[]', '', 'Refer Material Safety Data Sheet', '', '', '', '', '', '', '', '', '', '', ''),
(636, 'gmpdemo1', 'Raw Material', 'RM00013', 270, 0, '', 'Raw material', ' Dried Strawberry Powder', '', '', 'SOLID', 1000.00, '', 'STORE IN COOL PLACE', 100.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 0.00, 'Active', '3543', 18.00, '', '', 'approve', 'master', '2023-08-03 15:53:34', '', '', '', '', '', '', 'No', 0.00, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', '', 'Kg', '[]', 'Material should be packed in paper bag ', 'Refer Material Safety Data Sheet', '', '', '', '', '', '', '', '', '', '', ''),
(637, 'gmpdemo1', 'Raw Material', 'RM00014', 270, 0, '', 'Raw material', 'Polyethylene Glycols', '', '', 'SOLID', 90.00, '', 'normal temperature', 60.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 5.00, 'Active', '7684', 7.00, '', '', 'approve', 'master', '2023-08-07 16:46:37', '', '', '', '', '', '', 'Yes', 60.00, '', '', '', 'Amorphous', '', '100', '', '', '', '', '', 'Not required', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', '100', 'Carefully read ', '', '', '', '', '', '', '', '', '', '', ''),
(638, 'gmpdemo1', 'Raw Material', 'RM00015', 270, 0, '', 'Raw material', 'Glyceryl Monostearate', '', '', 'SOLID', 90.00, '', 'normal temperature', 80.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 8.00, 'Active', '3245', 6.00, '', '', 'approve', 'master', '2023-08-08 14:13:58', '', '', '', '', '', '', 'Yes', 80.00, '', '', '', 'Amorphous', '', '100', '', '', '', '', '', 'Not required', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', '200', 'Carefully read ', '', '', '', '', '', '', '', '', '', '', ''),
(639, 'gmpdemo1', 'Raw Material', 'RM00016', 270, 0, '', 'Raw material', 'Sodium Methoxide Powder', '', '', 'SOLID', 90.00, '', 'normal temperature', 70.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 3.00, 'Active', '5674', 6.00, '', '', 'approve', 'master', '2023-08-10 16:01:50', '', '', '', '', '', '', 'Yes', 60.00, '', '', '', 'Hydroscopic', '', '100', '', '', '', '', '', 'Not required', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', '10', 'Carefully read ', '', '', '', '', '', '', '', '', '', '', ''),
(640, 'gmpdemo1', 'Raw Material', 'RM00017', 270, 0, '', 'Raw material', ' L-Arginine HCl', '', '', 'SOLID', 90.00, '', 'normal temperature', 80.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 4.00, 'Active', '7654', 7.00, '', '', 'approve', 'master', '2023-08-11 10:24:46', '', '', '', '', '', '', 'Yes', 50.00, '', '', '', 'Crystaline', '', '100', '', '', '', '', '', 'Not required', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', '100', 'Carefully read ', '', '', '', '', '', '', '', '', '', '', ''),
(641, 'gmpdemo1', 'Raw Material', 'RM000651', 270, 0, '', 'Raw material', 'Ammonium Silicofluoride', '', '', 'SOLID', 80.00, '', 'Store protected from moisture Avoid contact with aluminum preserve in well closed containers ', 60.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 4.00, 'Active', '7543', 7.00, '', '', 'approve', 'master', '2023-08-29 18:43:53', '', '', '', '', '', '', 'Yes', 20.00, '', '', '', 'Amorphous', '', '100', '', '', '', '', '', 'Not Requried', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', 'Material should be Packed in food grade fiber bags', 'normal', '', '', '', '', '', '', '', '', '', '', ''),
(642, 'gmpdemo1', 'Raw Material', 'RM000652', 270, 0, '', 'Raw material', 'Polyethylene Glycols ', '', '', 'SOLID', 70.00, '', '', 60.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 0.00, 'Active', '7565', 3.00, '', '', 'approve', 'master', '2023-08-31 10:57:21', '', '', '', '', '', '', '', 0.00, '', '', '', '', '', '100', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '60', '80,81,82', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(643, 'gmpdemo1', 'Raw Material', 'RM000653', 270, 0, '', 'Raw material', 'Calcium Hydroxide ', '', '', 'SOLID', 80.00, '', 'normal ', 60.00, '', '', 0.00, '', 0.00, 0.00, 0.00, 2.00, 'Active', '6543', 4.00, '', '', 'approve', 'master', '2023-08-31 11:41:01', '', '', '', '', '', '', 'Yes', 1.00, '', '', '', 'Amorphous', '', '100', '', '', '', '', '', 'Not Requried', '', '', '', '', '', '', '', '', '', '', '', '60', '80', '', '', '', '', '', '', '', 'Kg', 'Kg', '[]', 'Material should be Packed in food grade fiber bags', 'normal', '', '', '', '', '', '', '', '', '', '', '');

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

--
-- Table structure for table `material_bkp`
--

CREATE TABLE `material_bkp` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `material_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_sub_type_id` int NOT NULL,
  `gst_id` int NOT NULL,
  `micro` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_subtype` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cas_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `upac_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_nature` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inventory` decimal(10,2) NOT NULL DEFAULT '10.00',
  `location` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `storage_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` decimal(10,2) NOT NULL,
  `order_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inv_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `density` decimal(10,2) NOT NULL,
  `unit` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `retest` decimal(10,2) NOT NULL,
  `shelf_life` decimal(10,2) NOT NULL,
  `min_shelf` decimal(10,2) NOT NULL,
  `lead_time` decimal(10,2) NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hsn` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `ml_generated` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ml_transfer_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approve',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sub_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sub_category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `printing_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equivalancy_applicable` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equivalancy_factor` decimal(6,2) NOT NULL,
  `equivalent_to` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `molecular_wt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `molecular_formula` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_appearance` varchar(100) NOT NULL,
  `sub_grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purchase_limit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `retest_month` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rda` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `max_limit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `appearance` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `salt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `specification` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `art_work` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `weight` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `length` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `width` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `height` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image1` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image2` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image3` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '1',
  `grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Inhouse',
  `cas_no` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_master` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `general_material_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_type` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_size` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `uom` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `alternate_uom` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_requirement` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `safety` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ce_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `color_index` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(50) NOT NULL,
  `product_n` varchar(50) NOT NULL,
  `artwork_no` varchar(50) NOT NULL,
  `artwork_file` varchar(50) NOT NULL,
  `shadecard` varchar(50) NOT NULL,
  `shadecard_no` varchar(50) NOT NULL,
  `shadecard_type` varchar(50) NOT NULL,
  `shadecard_file` varchar(50) NOT NULL,
  `m_photo` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `material_issue`
--

CREATE TABLE `material_issue` (
  `id` int NOT NULL,
  `work_order_id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `grn_no` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ar_no` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_tr_0900_ai_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `issue_for` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `prod_batch_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `material_type`
--

CREATE TABLE `material_type` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_type` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_subtype` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampling_criteria` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampling_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `control_sample_type` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `control_reserve_criteria` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `retest_type` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `restest_months` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `weighing_criteria` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `eng_category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Short_Code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `has_nature_of_material` bit(1) NOT NULL DEFAULT b'1',
  `testing_required` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `status` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Pending',
  `approved_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approved_on` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `material_type`
--

INSERT INTO `material_type` (`id`, `plant_id`, `material_type`, `material_subtype`, `category`, `sampling_criteria`, `sampling_qty`, `control_sample_type`, `control_reserve_criteria`, `retest_type`, `restest_months`, `entry_by`, `entry_date`, `weighing_criteria`, `eng_category`, `Short_Code`, `has_nature_of_material`, `testing_required`, `status`, `approved_by`, `approved_on`) VALUES
(270, '60', 'Raw Material', 'Raw material', '', '10%', 'Test Specific', 'Applicable', 'Two Times (of single anal', 'Applicable', '18', 'master', '2023-08-02 12:14:48', '10%', '', '', b'1', 'No', 'Pending', '', '0000-00-00 00:00:00');

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

--
-- Table structure for table `media`
--

CREATE TABLE `media` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `media_name` varchar(100) NOT NULL,
  `media_code` varchar(11) NOT NULL,
  `media_specification` varchar(200) NOT NULL,
  `sterilization` varchar(100) NOT NULL,
  `entry_date` date NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `media_consumption`
--

CREATE TABLE `media_consumption` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `stock_id` int NOT NULL,
  `media_code` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lot_no` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plate_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `prepare_on` date NOT NULL,
  `use_before` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `used_on` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quantity` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `used_for` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remaining_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `used_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `media_decontamination`
--

CREATE TABLE `media_decontamination` (
  `id` int NOT NULL,
  `media_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lot_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `decontaminated_cycle_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `incubator_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `incubator_temp` decimal(10,2) NOT NULL,
  `incubation_date` date NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'PENDING',
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `obseravation24` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `obseravation24_negative` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `obseravation24_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `obseravation24_date` date DEFAULT NULL,
  `obseravation48` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `obseravation48_negative` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `obseravation48_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `obseravation48_date` date DEFAULT NULL,
  `conclusion` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `media_prepartion`
--

CREATE TABLE `media_prepartion` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `media_code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lot_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty_taken` decimal(10,2) NOT NULL,
  `volume_prepared` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `volume_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `containers` int NOT NULL,
  `qty_per_containers` int NOT NULL,
  `quantity` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `volume` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cumm_qty` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cycle_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ph_medium_before` date NOT NULL,
  `ph_medium_after` date NOT NULL,
  `ph_value` decimal(6,2) NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `media_stock`
--

CREATE TABLE `media_stock` (
  `id` int NOT NULL,
  `plant_id` varchar(100) NOT NULL,
  `media_code` varchar(11) NOT NULL,
  `bottle_qty` varchar(50) NOT NULL,
  `unit` varchar(11) NOT NULL,
  `make` varchar(50) NOT NULL,
  `vendor_name` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  `batch_no` varchar(50) NOT NULL,
  `qty_received` varchar(50) NOT NULL,
  `before_date` date NOT NULL,
  `expiry_date` date NOT NULL,
  `receive_by` varchar(50) NOT NULL,
  `issue_date` date NOT NULL,
  `qty_issue` varchar(50) NOT NULL,
  `balance_qty` varchar(50) NOT NULL,
  `issue_by` varchar(50) NOT NULL,
  `review_by` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `medicalcheckup`
--

CREATE TABLE `medicalcheckup` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `form_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Medical',
  `emp_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `phisician_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tests` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frequency` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chekup_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `mfg_work_order_dtl`
--

CREATE TABLE `mfg_work_order_dtl` (
  `id` int NOT NULL,
  `work_order_id` int NOT NULL,
  `pack_size_id` int NOT NULL DEFAULT '0',
  `material_code` varchar(25) NOT NULL,
  `grade` varchar(50) NOT NULL,
  `unit_qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) NOT NULL,
  `overages` decimal(10,2) NOT NULL,
  `total_unit_qty` decimal(10,2) NOT NULL,
  `batch_qty` decimal(10,2) NOT NULL,
  `batch_overages` decimal(10,2) NOT NULL,
  `total_batch_qty` decimal(10,2) NOT NULL,
  `lod_status` varchar(3) NOT NULL,
  `assay_status` varchar(3) NOT NULL,
  `physical_stock` varchar(3) NOT NULL,
  `status` varchar(10) NOT NULL,
  `containers` text NOT NULL,
  `ars` text NOT NULL,
  `operator_name` varchar(50) NOT NULL,
  `done_by` varchar(15) NOT NULL,
  `check_by` varchar(15) NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mfg_work_order_hdr`
--

CREATE TABLE `mfg_work_order_hdr` (
  `id` int NOT NULL,
  `material_type` varchar(100) NOT NULL,
  `plant_id` int NOT NULL,
  `batch_plan_id` int NOT NULL,
  `batch_id` int NOT NULL,
  `work_order_no` varchar(15) NOT NULL,
  `ebmr_status` varchar(50) NOT NULL,
  `lod_status` varchar(30) NOT NULL,
  `assay_status` varchar(30) NOT NULL,
  `equivalency_status` varchar(30) NOT NULL,
  `batch_overages` varchar(3) NOT NULL,
  `overages_percent` decimal(10,2) NOT NULL,
  `componsentate_excipients` varchar(3) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(30) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approved_by` varchar(30) NOT NULL,
  `approved_date` datetime NOT NULL,
  `qa_person` varchar(25) NOT NULL,
  `qa_date` datetime NOT NULL,
  `stability` varchar(25) NOT NULL,
  `stability_reason` varchar(25) NOT NULL,
  `process_validation` varchar(25) NOT NULL,
  `hard_copy_issued` varchar(3) NOT NULL,
  `hard_copy_issued_by` varchar(25) NOT NULL,
  `ebmr_number` varchar(25) NOT NULL,
  `batch_number` varchar(10) NOT NULL,
  `dispense_request_sent_by` varchar(25) NOT NULL,
  `dispense_request_sent_on` datetime NOT NULL,
  `dispensing_status` varchar(25) NOT NULL,
  `rm_store_status` varchar(25) NOT NULL,
  `pm_store_status` varchar(50) NOT NULL,
  `rm_store_status_entry_by` varchar(25) NOT NULL,
  `rm_store_status_entry_date` datetime NOT NULL,
  `rm_store_remarks` varchar(250) NOT NULL,
  `pm_store_status_entry_by` varchar(25) NOT NULL,
  `pm_store_status_entry_date` datetime NOT NULL,
  `pm_store_remarks` varchar(250) NOT NULL,
  `rm_store_lc_status` varchar(15) NOT NULL DEFAULT 'Pending',
  `rm_dispensing_lc_by` varchar(15) NOT NULL,
  `rm_dispensing_lc_date` datetime NOT NULL,
  `rm_qa_dislc_by` varchar(15) NOT NULL,
  `rm_qa_dislc_date` datetime NOT NULL,
  `rm_qa_dislc_status` varchar(15) NOT NULL DEFAULT 'pending',
  `pm_store_lc_status` varchar(15) NOT NULL DEFAULT 'Pending',
  `pm_dispensing_lc_by` varchar(15) NOT NULL,
  `pm_dispensing_lc_date` datetime NOT NULL,
  `pm_qa_dislc_by` varchar(15) NOT NULL,
  `pm_qa_dislc_date` datetime NOT NULL,
  `pm_qa_dislc_status` varchar(15) NOT NULL DEFAULT 'pending',
  `no_of_lots` int NOT NULL,
  `calculation_type` varchar(25) NOT NULL,
  `rm_disp_completed_by` varchar(15) NOT NULL,
  `rm_disp_completed_date` datetime NOT NULL,
  `rm_received_by` varchar(15) NOT NULL,
  `rm_received_date` datetime NOT NULL,
  `rm_receiving_remarks` varchar(250) NOT NULL,
  `rm_receiving_status` varchar(50) NOT NULL,
  `stage_completed_by` varchar(25) NOT NULL,
  `stage_complete_date` datetime NOT NULL,
  `stage_checked_by` varchar(25) NOT NULL,
  `stage_checked_date` datetime NOT NULL,
  `stage_checked_remarks` varchar(250) NOT NULL,
  `tr_to_packing_dept_by` varchar(25) NOT NULL,
  `tr_to_packing_dept_date` datetime NOT NULL,
  `actual_yeild` double NOT NULL,
  `yeild_percentage` decimal(6,2) NOT NULL,
  `batch_commence_date` date NOT NULL,
  `batch_complete_date` date NOT NULL,
  `no_of_days` int NOT NULL,
  `allocate_batch_no` varchar(3) NOT NULL,
  `receiving` varchar(50) NOT NULL,
  `receive_by` varchar(50) NOT NULL,
  `receive_date` varchar(50) NOT NULL,
  `bpr_status` varchar(50) NOT NULL,
  `sampling_intimation` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mfr`
--

CREATE TABLE `mfr` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `mfr_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dosage_form` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `process_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `average_wt` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `color` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_style` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `primary_subtype` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit_wt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `shipper_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `shipper_unit` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `primary_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `primary_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mono_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mono_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `outer_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `outer_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ismono` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isouter` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `israw` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `raw_materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `additional_materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ispacking` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `packing_materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isequipment` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `equipments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isstages` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `stages` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isstep` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `steps` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isbatch` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `batch_size` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lots` int NOT NULL,
  `batch_materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `mfr` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `mfr`
--
DELIMITER $$
CREATE TRIGGER `mfr_no_insert1` BEFORE INSERT ON `mfr` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM mfr ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.mfr_no = concat('MFR', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `mgmt_meeting`
--

CREATE TABLE `mgmt_meeting` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `meeting_in` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `meeting_date` date NOT NULL,
  `meeting_time` time NOT NULL,
  `director` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `representative` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `managers` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `agenda` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `start_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `start_date` datetime NOT NULL,
  `complete_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complete_date` datetime NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `microbiology_documents`
--

CREATE TABLE `microbiology_documents` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `document_name` varchar(150) NOT NULL,
  `document_type` varchar(15) NOT NULL,
  `format_number` varchar(15) NOT NULL,
  `copies` int NOT NULL,
  `revision_no` varchar(15) NOT NULL,
  `effective_date` date NOT NULL,
  `entered_by` varchar(50) NOT NULL,
  `entry_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `micro_laf_pressurediff`
--

CREATE TABLE `micro_laf_pressurediff` (
  `id` int NOT NULL,
  `plant_id` varchar(10) NOT NULL,
  `checked_by` varchar(10) NOT NULL,
  `entry_time` datetime NOT NULL,
  `laf_room_pressure` int NOT NULL,
  `airlock1_press` int NOT NULL,
  `secondary_change_press` int NOT NULL,
  `airlock2_pressurre` int NOT NULL,
  `entry_by` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `micro_pressure`
--

CREATE TABLE `micro_pressure` (
  `id` int NOT NULL,
  `laf_room` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `secondary_room` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `airlock2` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `airlock1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `record_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `entry_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `micro_spec_test`
--

CREATE TABLE `micro_spec_test` (
  `id` int NOT NULL,
  `micro_test_id` int NOT NULL,
  `spec_test_id` varchar(50) NOT NULL,
  `alternate_chemist` varchar(100) NOT NULL,
  `calculation` varchar(100) NOT NULL,
  `conditions` varchar(100) NOT NULL,
  `description` varchar(100) NOT NULL,
  `for_micro` varchar(100) NOT NULL,
  `instruments` varchar(100) NOT NULL,
  `ismethod` varchar(100) NOT NULL,
  `is_outside` varchar(100) NOT NULL,
  `less_than` varchar(100) NOT NULL,
  `limit_type` varchar(100) NOT NULL,
  `limits` varchar(100) NOT NULL,
  `method_details` varchar(50000) NOT NULL,
  `more_than` varchar(100) NOT NULL,
  `outside_testing` varchar(100) NOT NULL,
  `person` varchar(100) NOT NULL,
  `plant_id` varchar(100) NOT NULL,
  `procedures` varchar(100) NOT NULL,
  `reagents` varchar(100) NOT NULL,
  `reference_type` varchar(100) NOT NULL,
  `release_stability` varchar(100) NOT NULL,
  `remark` varchar(100) NOT NULL,
  `retest` varchar(100) NOT NULL,
  `sample_qty` varchar(100) NOT NULL,
  `solutions` varchar(100) NOT NULL,
  `specification_no` varchar(100) NOT NULL,
  `stage` varchar(100) NOT NULL,
  `status` varchar(100) NOT NULL,
  `subtest_test` varchar(100) NOT NULL,
  `test_type` varchar(100) NOT NULL,
  `tm_no` varchar(100) NOT NULL,
  `unit` varchar(100) NOT NULL,
  `upper_limit` varchar(100) NOT NULL,
  `user_no` varchar(100) NOT NULL,
  `checker_action` varchar(500) NOT NULL,
  `checked_by` varchar(50) NOT NULL,
  `checked_date` varchar(50) NOT NULL,
  `result` varchar(50) NOT NULL,
  `end_time` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `micro_test`
--

CREATE TABLE `micro_test` (
  `id` int NOT NULL,
  `alalsis_end_date` varchar(100) NOT NULL,
  `alalsis_end_time` varchar(100) NOT NULL,
  `alalsis_start_date` varchar(100) NOT NULL,
  `alalsis_start_time` varchar(100) NOT NULL,
  `approve_by` varchar(100) NOT NULL,
  `approve_date` varchar(100) NOT NULL,
  `ar_no` varchar(100) NOT NULL,
  `check_by` varchar(100) NOT NULL,
  `check_date` varchar(100) NOT NULL,
  `entry_by` varchar(100) NOT NULL,
  `entry_date` varchar(100) NOT NULL,
  `grade` varchar(100) NOT NULL,
  `gradeName` varchar(100) NOT NULL,
  `grn_grade` varchar(100) NOT NULL,
  `grn_grade_name` varchar(100) NOT NULL,
  `grn_no` varchar(100) NOT NULL,
  `inward_no` varchar(100) NOT NULL,
  `is_RDS` varchar(100) NOT NULL,
  `iscoa` varchar(100) NOT NULL,
  `material_code` varchar(100) NOT NULL,
  `recheck` varchar(100) NOT NULL,
  `sampling_no` varchar(100) NOT NULL,
  `specification_no` varchar(100) NOT NULL,
  `status` varchar(100) NOT NULL,
  `testing_no` varchar(100) NOT NULL,
  `testing_person` varchar(100) NOT NULL,
  `testing_type_s` varchar(100) NOT NULL,
  `user_no` varchar(100) NOT NULL,
  `vendor_coa` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `micr_laf_log`
--

CREATE TABLE `micr_laf_log` (
  `id` int NOT NULL,
  `plant_id` varchar(10) NOT NULL,
  `uv_on_time` datetime NOT NULL,
  `uv_off_time` datetime NOT NULL,
  `laf_on_time` datetime NOT NULL,
  `laf_off_time` datetime NOT NULL,
  `activity_start` datetime NOT NULL,
  `activity_end` datetime NOT NULL,
  `activity_details` varchar(100) NOT NULL,
  `post_activity_uv_on` datetime NOT NULL,
  `post_activity_uv_off` datetime NOT NULL,
  `uv_burning_hours` int NOT NULL,
  `entry_by` varchar(10) NOT NULL,
  `checked_by` varchar(10) NOT NULL,
  `equipment_id` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `moa_procdeatil`
--

CREATE TABLE `moa_procdeatil` (
  `id` int NOT NULL,
  `moa_id` int NOT NULL,
  `category` varchar(100) DEFAULT NULL,
  `data` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mrp`
--

CREATE TABLE `mrp` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `mrp` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `manufactured_under` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `mst_batch_checklist`
--

CREATE TABLE `mst_batch_checklist` (
  `id` int NOT NULL,
  `chklist_id` int NOT NULL,
  `checkpoints` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mst_chlist_dtl`
--

CREATE TABLE `mst_chlist_dtl` (
  `id` int NOT NULL,
  `chklist_id` int NOT NULL,
  `check_point` varchar(50) NOT NULL,
  `ch_description` varchar(500) NOT NULL,
  `evl_pr` varchar(50) NOT NULL,
  `evl_type` varchar(50) NOT NULL,
  `options` varchar(200) NOT NULL,
  `qs_dtl` varchar(100) NOT NULL,
  `update_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `date_peparation` datetime DEFAULT CURRENT_TIMESTAMP,
  `approved_by` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `mst_chlist_dtl`
--

INSERT INTO `mst_chlist_dtl` (`id`, `chklist_id`, `check_point`, `ch_description`, `evl_pr`, `evl_type`, `options`, `qs_dtl`, `update_date`, `date_peparation`, `approved_by`, `entry_by`, `status`) VALUES
(103, 80, 'Check 1', 'check test1', '3', '', '', '', '2023-08-02 05:11:14', '2023-08-02 05:11:14', '', '', 'active'),
(104, 81, 'Communication skill', 'communication skill', '10', '', '', '', '2023-08-03 01:40:43', '2023-08-03 01:40:43', '', '', 'active'),
(105, 82, 'Communication skill', 'Communication skill', '10', '', '', '', '2023-08-03 01:44:30', '2023-08-03 01:44:30', '', '', 'active'),
(106, 83, 'Positive attitude', 'Positive attitude', '2', '', '', '', '2023-08-03 01:46:05', '2023-08-03 01:46:05', '', '', 'active'),
(107, 84, 'Primary ', 'Store ', '5', '', '', '', '2023-08-07 08:01:59', '2023-08-07 08:01:59', '', '', 'active');

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

--
-- Table structure for table `mst_documentData`
--

CREATE TABLE `mst_documentData` (
  `id` int NOT NULL,
  `chklist_id` int NOT NULL,
  `A_particular` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `A_index_id` varchar(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `A_document` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `A_multiple_upload` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mst_holidays`
--

CREATE TABLE `mst_holidays` (
  `id` int NOT NULL,
  `cal_year` varchar(10) NOT NULL,
  `holiday_date` date NOT NULL,
  `holiday_name` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `entry_by` varchar(25) NOT NULL,
  `status` varchar(15) NOT NULL DEFAULT 'Active',
  `plant_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mst_shift`
--

CREATE TABLE `mst_shift` (
  `id` int NOT NULL,
  `shift_name` varchar(150) NOT NULL,
  `plant_id` int NOT NULL,
  `entry_by` varchar(25) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` varchar(15) NOT NULL DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mst_vendor_materials`
--

CREATE TABLE `mst_vendor_materials` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `supplier_code` varchar(25) NOT NULL,
  `manufacturer_code` varchar(25) NOT NULL,
  `material_code` varchar(25) NOT NULL,
  `vendor_material_code` varchar(25) NOT NULL,
  `entry_by` varchar(25) NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `mst_vendor_materials`
--

INSERT INTO `mst_vendor_materials` (`id`, `plant_id`, `supplier_code`, `manufacturer_code`, `material_code`, `vendor_material_code`, `entry_by`, `entry_date`) VALUES
(613, 60, '', 'V10001', 'RM00012', '32546', 'master', '2023-08-02 12:45:21'),
(614, 60, 'V10646', '', 'RM00013', '5445', 'master', '2023-08-03 15:58:04'),
(615, 60, '', 'V10647', 'RM00014', 'VC023', 'master', '2023-08-07 17:04:31'),
(616, 60, '', 'V10648', 'RM00015', 'VC054', 'master', '2023-08-08 15:28:07'),
(617, 60, '', 'V10651', 'RM000653', 'VC0589', 'master', '2023-08-31 11:44:21');

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

--
-- Table structure for table `need_training`
--

CREATE TABLE `need_training` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `department` varchar(50) NOT NULL,
  `subject` varchar(50) NOT NULL,
  `training_on` varchar(50) NOT NULL,
  `equipment` varchar(50) NOT NULL,
  `equipment_id` varchar(50) NOT NULL,
  `description` text NOT NULL,
  `employeeList` mediumtext NOT NULL,
  `proposed_date` date NOT NULL,
  `proposed_trainer` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `nitrogen_operation`
--

CREATE TABLE `nitrogen_operation` (
  `id` int NOT NULL,
  `air_pressure` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `nitrogen_flow` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `oxygen_per` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `nitrogen_pressure` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `entry_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `nitrogen_pressure`
--

CREATE TABLE `nitrogen_pressure` (
  `id` int NOT NULL,
  `plant_name` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `filter_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pressure_before` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pressure_after` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `Non_registration`
--

CREATE TABLE `Non_registration` (
  `id` int NOT NULL,
  `plant_id` varchar(50) NOT NULL,
  `vendor_no` varchar(50) NOT NULL,
  `reg_vendor` varchar(500) NOT NULL,
  `reg_pan` varchar(500) NOT NULL,
  `reg_gst` varchar(500) NOT NULL,
  `reg_address` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `onjob_training`
--

CREATE TABLE `onjob_training` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `department` varchar(50) NOT NULL,
  `subject` varchar(50) NOT NULL,
  `training_on` varchar(50) NOT NULL,
  `equipment` varchar(50) NOT NULL,
  `equipment_id` varchar(50) NOT NULL,
  `description` text NOT NULL,
  `employeeList` mediumtext NOT NULL,
  `proposed_date` date NOT NULL,
  `proposed_trainer` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `oos`
--

CREATE TABLE `oos` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `oos_id` varchar(50) NOT NULL,
  `entry_date` varchar(100) NOT NULL,
  `timezone` varchar(1000) NOT NULL,
  `product_name` text NOT NULL,
  `batch_no` varchar(100) NOT NULL,
  `grn_no` varchar(50) NOT NULL,
  `analytical_no` varchar(50) NOT NULL,
  `mfg_date` varchar(100) NOT NULL,
  `mfg_stage` text NOT NULL,
  `exp_date` varchar(100) NOT NULL,
  `status` varchar(100) NOT NULL DEFAULT 'pending',
  `i_no1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `oos_questions`
--

CREATE TABLE `oos_questions` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `oos_id` varchar(50) NOT NULL,
  `ques` text NOT NULL,
  `ans` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `oos_tests`
--

CREATE TABLE `oos_tests` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `oos_id` varchar(50) NOT NULL,
  `oos_test` text NOT NULL,
  `results` text NOT NULL,
  `limits` text NOT NULL,
  `status` varchar(100) NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `standard_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `req_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `std_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime(6) NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `order_materials`
--

CREATE TABLE `order_materials` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `order_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `currency` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `amount_inr` decimal(10,2) NOT NULL,
  `amount_usd` decimal(10,2) NOT NULL,
  `usd_rate` decimal(10,2) NOT NULL,
  `packing_configuration` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_style` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `outdoor_duty`
--

CREATE TABLE `outdoor_duty` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `emp_id` varchar(50) NOT NULL,
  `emp_name` varchar(50) NOT NULL,
  `department` varchar(50) NOT NULL,
  `designation` varchar(50) NOT NULL,
  `duty_details` varchar(50) NOT NULL,
  `checker` varchar(50) NOT NULL,
  `approver` varchar(50) NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  `total_days` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `outgoing_courier`
--

CREATE TABLE `outgoing_courier` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `date` date NOT NULL,
  `party_name` varchar(50) NOT NULL,
  `description` varchar(50) NOT NULL,
  `department` varchar(50) NOT NULL,
  `courier_agency` varchar(50) NOT NULL,
  `docket_no` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `outword`
--

CREATE TABLE `outword` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `send_to` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `outword_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gatepass_no` varchar(500) COLLATE utf8mb3_unicode_ci NOT NULL,
  `out_status` varchar(500) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Pending',
  `request_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `transport_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vehicle_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `department` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `addresss` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pin_code` int NOT NULL,
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requiredQty` int NOT NULL,
  `address` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `driver_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `driver_mobile` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `transport_company` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `out_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `packing`
--

CREATE TABLE `packing` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bmr_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `yield_per` decimal(10,2) NOT NULL,
  `yield_qty` decimal(10,2) NOT NULL,
  `manufacturer_for` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'PENDING',
  `send_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `send_date` date NOT NULL,
  `receive_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `receive_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `packing_batch_stages_ipqc_dtl`
--

CREATE TABLE `packing_batch_stages_ipqc_dtl` (
  `id` int NOT NULL,
  `ti_no` varchar(50) NOT NULL,
  `stage_hdr_id` int NOT NULL,
  `stage_dtl_id` int NOT NULL,
  `plan_no` varchar(250) NOT NULL,
  `bfr_no` varchar(250) NOT NULL,
  `lot_no` varchar(250) NOT NULL,
  `remarks` varchar(250) NOT NULL,
  `remarks_entry_by` varchar(20) NOT NULL,
  `remarks_entry_date` datetime NOT NULL,
  `equipment_code` varchar(25) NOT NULL,
  `equipment` varchar(50) NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `operator_code` varchar(25) NOT NULL,
  `process_entry_by` varchar(25) NOT NULL,
  `process_entry_date` datetime NOT NULL,
  `recording_date` date NOT NULL,
  `recording_time` time(6) NOT NULL,
  `stage_yield` decimal(8,2) NOT NULL,
  `stage_yield_unit` varchar(25) NOT NULL,
  `stage_yield_percent` decimal(6,2) NOT NULL,
  `expected_yield` varchar(50) NOT NULL,
  `yeild_entry_by` varchar(25) NOT NULL,
  `yeild_entry_date` datetime NOT NULL,
  `ti_recd_by` varchar(15) NOT NULL,
  `test_result` varchar(25) NOT NULL,
  `test_remarks` varchar(250) NOT NULL,
  `ti_recd_date` datetime NOT NULL,
  `test_result_status` varchar(25) NOT NULL DEFAULT 'Pending',
  `limit_type` varchar(50) NOT NULL,
  `description` varchar(5000) NOT NULL,
  `lower_limit` varchar(50) NOT NULL,
  `upper_limit` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `packing_category`
--

CREATE TABLE `packing_category` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approve'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `packing_manufacturing_process`
--

CREATE TABLE `packing_manufacturing_process` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dosage_form` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `process_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `step` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `packing_stage`
--

CREATE TABLE `packing_stage` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `material_type` varchar(25) NOT NULL,
  `product_type` varchar(50) NOT NULL,
  `product_name` varchar(50) NOT NULL,
  `product_code` varchar(20) NOT NULL,
  `exp_yeild_min` varchar(20) NOT NULL,
  `exp_yeild_max` varchar(20) NOT NULL,
  `stages_test` text NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `user_no` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `packing_stages_ipqc_dtl`
--

CREATE TABLE `packing_stages_ipqc_dtl` (
  `id` int NOT NULL,
  `stage_hdr_id` int NOT NULL,
  `process_type` varchar(50) NOT NULL,
  `stage_name` varchar(50) NOT NULL,
  `stage` varchar(50) NOT NULL,
  `ipqc_testing` varchar(3) NOT NULL,
  `next_stage` varchar(3) NOT NULL,
  `exp_yeild_percent` varchar(15) NOT NULL,
  `yeild_unit` varchar(50) NOT NULL,
  `split_into_lots` varchar(5) NOT NULL,
  `blending_mixing` varchar(5) NOT NULL,
  `test_name` varchar(25) NOT NULL,
  `sub_test` varchar(25) NOT NULL,
  `result_type` varchar(25) NOT NULL,
  `unit` varchar(25) NOT NULL,
  `lower_limit` varchar(25) NOT NULL,
  `upper_limit` varchar(25) NOT NULL,
  `less_than_value` varchar(15) NOT NULL,
  `more_than_value` varchar(15) NOT NULL,
  `fg_sampling` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `packing_stage_master`
--

CREATE TABLE `packing_stage_master` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `dosage_type` varchar(50) NOT NULL,
  `dosage_form` varchar(50) NOT NULL,
  `product_type` varchar(50) NOT NULL,
  `product_name` varchar(50) NOT NULL,
  `product_code` varchar(50) NOT NULL,
  `packing_type` varchar(50) NOT NULL,
  `exp_yeild_min` varchar(50) NOT NULL,
  `exp_yeild_max` varchar(50) NOT NULL,
  `process_type` varchar(50) NOT NULL,
  `stage_name` varchar(50) NOT NULL,
  `split_into_lots` varchar(50) NOT NULL,
  `next_stage` varchar(50) NOT NULL,
  `exp_yeild_percent` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `packing_stage_type`
--

CREATE TABLE `packing_stage_type` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `dosage_form` varchar(50) NOT NULL,
  `process_type` varchar(50) NOT NULL,
  `stage` varchar(50) NOT NULL,
  `step` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `packing_style`
--

CREATE TABLE `packing_style` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `style` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approve'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `packsize`
--

CREATE TABLE `packsize` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `p_size` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `pack_size`
--

CREATE TABLE `pack_size` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `pack_size` varchar(25) NOT NULL,
  `unit_id` int NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` varchar(10) NOT NULL DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `password`
--

CREATE TABLE `password` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `emp_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `old_password` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `new_password` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `pending_document`
--

CREATE TABLE `pending_document` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `document_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `document_no` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `pending_document`
--
DELIMITER $$
CREATE TRIGGER `document_no_insert` BEFORE INSERT ON `pending_document` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM pending_document ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.document_no = concat('D1', LPAD(CONVERT(@lastID, CHAR), 2, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `physician`
--

CREATE TABLE `physician` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'GMP0016',
  `doctor_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qualification` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `clinic_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `address` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contact_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `password` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contract_agreement` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `plant`
--

CREATE TABLE `plant` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `plant_code` varchar(20) NOT NULL,
  `client_name` varchar(100) NOT NULL,
  `plant_name` varchar(40) NOT NULL,
  `entry_by` varchar(20) NOT NULL,
  `entry_date` date NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'active',
  `is_corporate` tinyint(1) NOT NULL DEFAULT '0',
  `plant_full_name` varchar(200) NOT NULL,
  `plant_full_address` varchar(200) NOT NULL,
  `gst_no` int NOT NULL,
  `logo_path` varchar(250) NOT NULL,
  `licence_no` varchar(22) NOT NULL,
  `copy_type` varchar(20) NOT NULL,
  `version no` int NOT NULL,
  `licence_date` date NOT NULL,
  `expiry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `po_entry`
--

CREATE TABLE `po_entry` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `order_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_date` date NOT NULL,
  `valid_till` date NOT NULL,
  `products` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `configurations` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `terms` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `freight_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `required_date` date NOT NULL,
  `file` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `approve_date` datetime NOT NULL,
  `workorder` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `ammendment_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ammendment_date` datetime DEFAULT NULL,
  `received_date` date NOT NULL,
  `company_unit` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plan_no` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(500) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT ' '
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `po_entry`
--
DELIMITER $$
CREATE TRIGGER `client_order_no_insert` BEFORE INSERT ON `po_entry` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM po_entry ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.order_no = concat('O1', LPAD(CONVERT(@lastID, CHAR), 6, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `po_material`
--

CREATE TABLE `po_material` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `po_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_date` datetime NOT NULL,
  `material_id` int NOT NULL,
  `gst_id` int NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requirement` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `days` int NOT NULL,
  `quotation` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `required_for` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quotation_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quotation_amt` decimal(10,2) NOT NULL,
  `quotation_per` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_per` decimal(6,2) NOT NULL,
  `disc_amt` decimal(10,2) NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `tax_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `indend_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `isreceive` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `po_indend` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `chemical_no` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `delivery_schedule_date` date NOT NULL,
  `descriptions_list` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `po_material`
--

INSERT INTO `po_material` (`id`, `plant_id`, `user_no`, `po_no`, `po_date`, `material_id`, `gst_id`, `material_code`, `qty`, `unit`, `requirement`, `days`, `quotation`, `required_for`, `client_code`, `vendor_no`, `quotation_no`, `quotation_amt`, `quotation_per`, `disc_per`, `disc_amt`, `gst`, `gross_total`, `tax_total`, `net_total`, `indend_no`, `isreceive`, `po_indend`, `po_type`, `material_status`, `chemical_no`, `delivery_schedule_date`, `descriptions_list`) VALUES
(941, '60', 'gmpdemo1', '546', '0000-00-00 00:00:00', 635, 0, 'RM00012', 100.00, 'Kg', 'Regular', 0, '', 'Own', '', '', '', 400.00, '', 10.00, 4000.00, 12.00, 40000.00, 4320.00, 40320.00, 'RM0001', 'No', 'Approve', 'Raw Material', 'pending', '', '2023-08-12', ''),
(942, '60', 'gmpdemo1', '547', '0000-00-00 00:00:00', 636, 0, 'RM00013', 300.00, 'Kg', 'Regular', 0, '', 'Own', '', '', '', 520.00, '', 5.00, 7800.00, 18.00, 156000.00, 26676.00, 174876.00, 'RM0002', 'No', 'Approve', 'Raw Material', 'pending', '', '2023-08-08', ''),
(943, '60', 'gmpdemo1', '548', '0000-00-00 00:00:00', 637, 0, 'RM00014', 200.00, 'Kg', 'Urgent', 0, '', 'Own', '', '', '', 200.00, '', 6.00, 2400.00, 7.00, 40000.00, 2632.00, 40232.00, 'RM0003', 'No', 'Approve', 'Raw Material', 'pending', '', '2023-08-07', ''),
(944, '60', 'gmpdemo1', '549', '0000-00-00 00:00:00', 638, 0, 'RM00015', 200.00, 'Kg', 'Urgent', 0, '', 'Own', '', '', '', 300.00, '', 5.00, 3000.00, 6.00, 60000.00, 3420.00, 60420.00, 'RM0004', 'No', 'Approve', 'Raw Material', 'pending', '', '2023-08-08', ''),
(945, '60', 'gmpdemo1', '550', '2023-08-08 03:40:57', 0, 0, 'RM00015', 100.00, 'Kg', 'Urgent', 0, '', '', '', '', '', 300.00, '', 0.00, 0.00, 6.00, 30000.00, 1800.00, 31800.00, NULL, 'No', '', 'Raw Material', 'pending', '', '2023-08-08', '[]'),
(946, '60', 'gmpdemo1', '551', '0000-00-00 00:00:00', 643, 0, 'RM000653', 300.00, 'Kg', 'Urgent', 0, '', 'Own', '', '', '', 200.00, '', 3.00, 1800.00, 4.00, 60000.00, 2328.00, 60528.00, 'RM0005', 'No', 'Approve', 'Raw Material', 'pending', '', '2023-08-31', '');

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

--
-- Table structure for table `premises_preventive`
--

CREATE TABLE `premises_preventive` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `area` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `floor` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `checkpoints` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `check_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `pressure`
--

CREATE TABLE `pressure` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `pressure` decimal(10,2) NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `section` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bmr_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `entry_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `pressure_master`
--

CREATE TABLE `pressure_master` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `section_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `section` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lower_limit` decimal(10,2) NOT NULL,
  `upper_limit` decimal(10,2) NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `pressure_plenum`
--

CREATE TABLE `pressure_plenum` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'PRESSURE1',
  `plant_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `primary_filter` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `secondary_filter` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hepa_filter` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `entry_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `product`
--

CREATE TABLE `product` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'gmpdemo1',
  `plant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1',
  `product_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_code1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `generic_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `fssai_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `uom` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `alt_uom` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cas_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mopcup_file` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `artwork_file` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `molecular_weight` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `molecular_formula` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `packing_style` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `testing_time` decimal(10,2) NOT NULL,
  `retest_period` decimal(10,2) NOT NULL,
  `hsn` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pack_desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `tsize` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `storage_condition` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `market` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mrp` decimal(10,2) NOT NULL,
  `manufactured_under` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `manufactured_for` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_lic` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `fsc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `copp` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `artwork` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mopcup` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `photo` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `artwork_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending',
  `manufactured_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'approve',
  `entry_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `similar_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `copy_from` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `tshape` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `apperance` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `division` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_apperance` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `other_description` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `safety_instructions` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `color_index` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ce_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `qc_lead_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pka_value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `market_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `micro` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Non Regulatory',
  `product_nature` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_form` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_sub_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_size` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_shape` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `packing_mode` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `label_claim` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `shelf_life` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `min_shelf` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `thera` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gtin` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mfg_lic` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `plant` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `sale_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `expiry` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_group` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `market_group` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `asin_no` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `nrv_value` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `sku_no` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `packing_charges` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `retain_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `retest` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `min_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mfg_charges` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `max_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `configuration` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `primary_packing` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `primary_subtype` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ismono` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `primary_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `unit_wt` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mono_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `outer_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `shipper_qty` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `isouter` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pack_sizes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mrp_list` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `selling_price_list` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dose_unit_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dose_unit_qty` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dose_unit_qty_unit` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `each_unit_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `punch_tool` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cp_machine_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `change_part` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `conversion_cost` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `packing_cost` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `other_charges` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `fixed_charges` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `design_charges` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `license_charges` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dossier_charges` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `fixed_analytical_cost` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dealer_price` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `retailer_margin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dealer_margin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `short_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `batch_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `brand_generic` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product`
--

INSERT INTO `product` (`id`, `user_no`, `plant_id`, `product_code`, `product_code1`, `product_type`, `product_name`, `generic_name`, `grade`, `fssai_number`, `uom`, `alt_uom`, `cas_number`, `mopcup_file`, `artwork_file`, `molecular_weight`, `molecular_formula`, `packing_style`, `testing_time`, `retest_period`, `hsn`, `gst`, `category`, `pack_desc`, `tsize`, `storage_condition`, `market`, `mrp`, `manufactured_under`, `manufactured_for`, `product_lic`, `fsc`, `copp`, `artwork`, `mopcup`, `photo`, `artwork_status`, `manufactured_type`, `status`, `entry_by`, `entry_date`, `approve_by`, `approve_date`, `unit`, `rate`, `similar_name`, `copy_from`, `tshape`, `apperance`, `division`, `product_apperance`, `other_description`, `safety_instructions`, `color_index`, `ce_number`, `qc_lead_time`, `pka_value`, `market_type`, `micro`, `type`, `product_nature`, `dosage_type`, `dosage_form`, `dosage_sub_type`, `dosage_size`, `dosage_shape`, `packing_mode`, `label_claim`, `shelf_life`, `min_shelf`, `thera`, `gtin`, `mfg_lic`, `plant`, `sale_type`, `expiry`, `product_group`, `market_group`, `asin_no`, `nrv_value`, `sku_no`, `packing_charges`, `retain_qty`, `retest`, `min_qty`, `mfg_charges`, `max_qty`, `configuration`, `primary_packing`, `primary_subtype`, `ismono`, `primary_qty`, `unit_wt`, `mono_qty`, `outer_qty`, `shipper_qty`, `isouter`, `pack_sizes`, `mrp_list`, `selling_price_list`, `dose_unit_type`, `dose_unit_qty`, `dose_unit_qty_unit`, `each_unit_type`, `punch_tool`, `cp_machine_name`, `change_part`, `conversion_cost`, `packing_cost`, `other_charges`, `fixed_charges`, `design_charges`, `license_charges`, `dossier_charges`, `fixed_analytical_cost`, `dealer_price`, `retailer_margin`, `dealer_margin`, `short_code`, `batch_type`, `brand_generic`) VALUES
(105, 'gmpdemo1', '60', 'P1782', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0.00, 0.00, '', 0.00, '', '', '', '', '', 0.00, '', '', '', '', '', '', '', '', 'pending', '', 'approve', 'master', '2023-08-04 11:56:08', '', NULL, '', 0.00, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Non Regulatory', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(106, 'gmpdemo1', '60', 'P1783', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0.00, 0.00, '', 0.00, '', '', '', '', '', 0.00, '', '', '', '', '', '', '', '', 'pending', '', 'approve', 'master', '2023-08-04 12:21:35', '', NULL, '', 0.00, '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Non Regulatory', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');

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

--
-- Table structure for table `production_report`
--

CREATE TABLE `production_report` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `lmr_no` int NOT NULL,
  `product_type` varchar(100) NOT NULL,
  `product_code` varchar(100) NOT NULL,
  `product_name` varchar(100) NOT NULL,
  `lot_size` varchar(11) NOT NULL,
  `prepared_by` varchar(100) NOT NULL,
  `started_date` date NOT NULL,
  `completed_date` date NOT NULL,
  `entry_by` varchar(100) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `product_commercial_info`
--

CREATE TABLE `product_commercial_info` (
  `id` int NOT NULL,
  `product_id` int NOT NULL,
  `conversion_cost_per_unit` decimal(8,2) NOT NULL,
  `packing_cost_per_unit` decimal(8,2) NOT NULL,
  `other_charges` decimal(8,2) NOT NULL,
  `fixed_charges` decimal(8,2) NOT NULL,
  `design_charges` decimal(8,2) NOT NULL,
  `licence_charges` decimal(8,2) NOT NULL,
  `dossier_charges` decimal(8,2) NOT NULL,
  `fixed_analytical_cost` decimal(10,2) NOT NULL,
  `change_part_cost` decimal(10,2) NOT NULL,
  `dealer_price` decimal(10,2) NOT NULL,
  `retailer_margin` decimal(10,2) NOT NULL,
  `dealer_margin` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `product_dev`
--

CREATE TABLE `product_dev` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `generic_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dev_nature` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_brand` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_strength` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_dosage_form` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_color` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_primary` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_secondary` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `c_details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_brand` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_strength` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_dosage_form` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_color` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_primary` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_secondary` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `e_details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dev_requirement` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dev_details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `estimate_time` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `country` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dev_project` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `dev_study` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `dev_analytical` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `dev_package` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `raws` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `staff` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `books` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `requirement` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `requirement_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requirement_date` datetime DEFAULT NULL,
  `requirements_list` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `product_mrp`
--

CREATE TABLE `product_mrp` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `mrp` decimal(10,0) NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `product_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `product_other_information_api`
--

CREATE TABLE `product_other_information_api` (
  `id` int NOT NULL,
  `product_id` int NOT NULL,
  `product_code` varchar(25) NOT NULL,
  `cas_number` varchar(50) NOT NULL,
  `structure_file_path` varchar(500) NOT NULL,
  `molecular_weight` varchar(25) NOT NULL,
  `molecular_formula` varchar(25) NOT NULL,
  `storage_condition` varchar(150) NOT NULL,
  `safety_instructions` varchar(250) NOT NULL,
  `material_appearance` varchar(25) NOT NULL,
  `m_photo` varchar(500) NOT NULL,
  `other_description` varchar(250) NOT NULL,
  `ce_number` varchar(25) NOT NULL,
  `color_index` varchar(15) NOT NULL,
  `msds_file_path` varchar(500) NOT NULL,
  `product_license_path` varchar(500) NOT NULL,
  `who_copp_path` varchar(500) NOT NULL,
  `ce_certificate_path` varchar(500) NOT NULL,
  `qc_lead_time` varchar(15) NOT NULL,
  `pka_value` varchar(15) NOT NULL,
  `market_type` varchar(20) NOT NULL,
  `storage_location` varchar(50) NOT NULL,
  `material_apperance` varchar(50) NOT NULL,
  `product_apperance` varchar(100) NOT NULL,
  `sub_type` varchar(50) NOT NULL,
  `client_code` varchar(50) NOT NULL,
  `sub_category` varchar(50) NOT NULL,
  `product_n` varchar(50) NOT NULL,
  `art_work` varchar(50) NOT NULL,
  `artwork` text NOT NULL,
  `artwork_no` varchar(50) NOT NULL,
  `artwork_file` varchar(50) NOT NULL,
  `shadecard` text NOT NULL,
  `shadecard_no` varchar(50) NOT NULL,
  `shadecard_type` varchar(50) NOT NULL,
  `shadecard_file` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `product_other_information_api`
--

INSERT INTO `product_other_information_api` (`id`, `product_id`, `product_code`, `cas_number`, `structure_file_path`, `molecular_weight`, `molecular_formula`, `storage_condition`, `safety_instructions`, `material_appearance`, `m_photo`, `other_description`, `ce_number`, `color_index`, `msds_file_path`, `product_license_path`, `who_copp_path`, `ce_certificate_path`, `qc_lead_time`, `pka_value`, `market_type`, `storage_location`, `material_apperance`, `product_apperance`, `sub_type`, `client_code`, `sub_category`, `product_n`, `art_work`, `artwork`, `artwork_no`, `artwork_file`, `shadecard`, `shadecard_no`, `shadecard_type`, `shadecard_file`) VALUES
(770, 635, '', '', '', '', '', 'STORE IN COOL PLACE', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(771, 636, '', '', '', '', '', 'STORE IN COOL PLACE', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(772, 637, '', '', '', '', '', 'normal temperature', '', 'Amorphous', '6014_img20220218_14151434.pdf', '', '', '', '6014_PHARMA_ERP_GOLD_SILVER_3.pdf', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(773, 638, '', '', '', '', '', 'normal temperature', '', 'Amorphous', '6015_GST CERTIFICATE.pdf', '', '', '', '6015_Medical Council Certificate20221013_12535999.pdf', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(774, 639, '', '', '', '', '', 'normal temperature', '', 'Hydroscopic', '6016_GST CERTIFICATE.pdf', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(775, 640, '', '', '', '', '', 'normal temperature', '', 'Crystaline', '6017_img20220218_14151434.pdf', '', '', '', '6017_live slip20221004_12072302.pdf', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(776, 641, '', '', '', '', '', 'Store protected from moisture Avoid contact with aluminum preserve in well closed containers ', '', 'Amorphous', '60651_img20220218_14151434.pdf', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(777, 642, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
(778, 643, '', '', '', '', '', 'normal ', '', 'Amorphous', '60653_img20220218_14151434.pdf', '', '', '', '60653_GST CERTIFICATE.pdf', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');

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

--
-- Table structure for table `product_recall`
--

CREATE TABLE `product_recall` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `product_name` varchar(100) NOT NULL,
  `batch_no` int NOT NULL,
  `mfg_date` date NOT NULL,
  `exp_date` date NOT NULL,
  `coordinator` varchar(100) NOT NULL,
  `company_person` varchar(100) NOT NULL,
  `clients_person` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `mobile` int NOT NULL,
  `mock_recall` int NOT NULL,
  `public_recall` int NOT NULL,
  `professional_recall` int NOT NULL,
  `enforcement_auth_recall` int NOT NULL,
  `television` int NOT NULL,
  `radio` int NOT NULL,
  `newspaper` int NOT NULL,
  `cfagents` int NOT NULL,
  `stockiest` int NOT NULL,
  `distributors` int NOT NULL,
  `mfg_error` int NOT NULL,
  `packing_error` int NOT NULL,
  `side_effect` int NOT NULL,
  `abnormal_stability` varchar(100) NOT NULL,
  `degradation` varchar(100) NOT NULL,
  `contamination_product` varchar(100) NOT NULL,
  `release_change` varchar(100) NOT NULL,
  `packing_defect` varchar(100) NOT NULL,
  `overprint_error_price` int NOT NULL,
  `overprint_error_batch` int NOT NULL,
  `overprint_error_exp` int NOT NULL,
  `other_reason` varchar(100) NOT NULL,
  `product_receive` varchar(100) NOT NULL,
  `received_quantity` varchar(100) NOT NULL,
  `examination_report` varchar(100) NOT NULL,
  `destruction_report` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `prod_dev_request`
--

CREATE TABLE `prod_dev_request` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `request_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `detail` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `nature` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_brand` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_strength` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_dosage` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_colour` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_primary` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_secondary` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `com_other` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_brand` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_strength` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_dosage` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_colour` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_primary` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_secondary` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_other` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rodf_country` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rodf` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rodf_brief` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `timeframe` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rod_a` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rod_b` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rod_c` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rod_d` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rod_e` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `purchaseorder`
--

CREATE TABLE `purchaseorder` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `po_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `indent_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `broker_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `broker_per` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `discount` decimal(10,2) NOT NULL,
  `requirement_days` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `delivery_schedule_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `delivery_address` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `gst_total` decimal(10,2) NOT NULL,
  `other_charges` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `terms_conditions` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isgeneral` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `p_no1` int NOT NULL,
  `is_security_receive` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL,
  `vendor` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `accept_date` date NOT NULL,
  `delivery_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `booking_location` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_amt` decimal(10,2) NOT NULL,
  `shipping_handling` decimal(10,2) NOT NULL,
  `shipping_gst` int DEFAULT NULL,
  `final_total` decimal(10,2) NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `transport` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `local_transport` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `billcompany_code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `shipcompany_code` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purchase_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `currancy` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `currancy_rate` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `term_local_transport` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Po_Group` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Fin_Year` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rounding` decimal(10,2) NOT NULL,
  `additional_term` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `gstSplitData` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `narration` varchar(5000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cancel_hold_date` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cancel_hold_by` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cancel_hold_reason` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `purchaseorder`
--

INSERT INTO `purchaseorder` (`id`, `plant_id`, `user_no`, `po_type`, `po_no`, `indent_no`, `vendor_no`, `broker_name`, `broker_per`, `discount`, `requirement_days`, `delivery_schedule_date`, `delivery_address`, `gross_total`, `gst_total`, `other_charges`, `net_total`, `terms_conditions`, `isgeneral`, `status`, `entry_by`, `entry_date`, `p_no1`, `is_security_receive`, `remark`, `approve_by`, `approve_date`, `vendor`, `accept_date`, `delivery_type`, `booking_location`, `disc_amt`, `shipping_handling`, `shipping_gst`, `final_total`, `department`, `transport`, `local_transport`, `billcompany_code`, `shipcompany_code`, `email`, `purchase_type`, `currancy`, `currancy_rate`, `term_local_transport`, `Po_Group`, `Fin_Year`, `rounding`, `additional_term`, `gstSplitData`, `narration`, `cancel_hold_date`, `cancel_hold_by`, `cancel_hold_reason`) VALUES
(546, '60', 'gmpdemo1', 'Raw Material', 'RM/PURHO/0051/2022-23', 'RM0001', 'V10001', '', '', 0.00, '', '', '', 40000.00, 4320.00, 0.00, 40320.00, '[{\"id\":\"17\",\"plant_id\":\"\",\"term_heading\":\"Terms and Condition\",\"term\":\"Product Quality should be Checked and Maintained\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:51:56\",\"status\":\"approve\",\"selected\":true},{\"id\":\"19\",\"plant_id\":\"\",\"term_heading\":\"Payment Terms\",\"term\":\"60 days\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:53:27\",\"status\":\"approve\",\"selected\":true}]', 'no', 'Approved', 'master', '2023-08-02 12:54:12', 0, 'No', 'ok', 'master', '2023-08-02 12:54:38', 'pending', '0000-00-00', '', '', 4000.00, 105.00, 5, 40425.00, '', '', '', 'C0001', 'C0001', '', 'Local Purchase', 'INR', '', '', 'RM', '2002-23', 0.00, '[{\"id\":\"9\",\"plant_id\":\"60\",\"additional_term\":\"Transportation Extra applicable.\",\"entry_date\":\"2023-08-02\",\"status\":\"\",\"entry_by\":\"master\",\"selected\":true}]', '[{\"id\":\"516\",\"percentage\":\"12.00\",\"igst\":0,\"sgst\":\"2160.00\",\"cgst\":\"2160.00\",\"totalGST\":\"4320.00\"}]', '', '', '', ''),
(547, '60', 'gmpdemo1', 'Raw Material', 'RM/PURHO/0052/2022-23', 'RM0002', 'V10646', '', '', 0.00, '', '', '', 156000.00, 26676.00, 0.00, 174876.00, '[{\"id\":\"17\",\"plant_id\":\"\",\"term_heading\":\"Terms and Condition\",\"term\":\"Product Quality should be Checked and Maintained\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:51:56\",\"status\":\"approve\",\"selected\":true},{\"id\":\"18\",\"plant_id\":\"\",\"term_heading\":\"Shipping\",\"term\":\"Should be shipped on the given timeline\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:52:38\",\"status\":\"approve\",\"selected\":true}]', 'no', 'Approved', 'master', '2023-08-03 04:16:03', 0, 'No', 'ok', 'master', '2023-08-03 04:16:11', 'pending', '0000-00-00', '', '', 7800.00, 0.00, 0, 174876.00, '', '', '', 'C0001', 'C0001', '', 'Local Purchase', 'INR', '', '', 'RM', '2002-23', 0.00, '[{\"id\":\"8\",\"plant_id\":\"60\",\"additional_term\":\"Refusal to accept increased payment term\",\"entry_date\":\"2023-08-02\",\"status\":\"\",\"entry_by\":\"master\",\"selected\":true}]', '[{\"id\":\"517\",\"percentage\":\"18.00\",\"igst\":0,\"sgst\":\"13338.00\",\"cgst\":\"13338.00\",\"totalGST\":\"26676.00\"}]', '', '', '', ''),
(548, '60', 'gmpdemo1', 'Raw Material', 'RM/PURHO/0053/2022-23', 'RM0003', 'V10647', '', '', 0.00, '', '', '', 40000.00, 2632.00, 0.00, 40232.00, '[{\"id\":\"18\",\"plant_id\":\"\",\"term_heading\":\"Shipping\",\"term\":\"Should be shipped on the given timeline\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:52:38\",\"status\":\"approve\",\"selected\":true}]', 'no', 'Approved', 'master', '2023-08-07 05:19:52', 0, 'No', 'ok', 'master', '2023-08-07 05:20:39', 'pending', '0000-00-00', '', '', 2400.00, 336.00, 12, 40568.00, '', 'Local Transport', '', 'C0001', 'C0001', '', 'Local Purchase', 'INR', '', '', 'RM', '2002-23', 0.00, '[{\"id\":\"8\",\"plant_id\":\"60\",\"additional_term\":\"Refusal to accept increased payment term\",\"entry_date\":\"2023-08-02\",\"status\":\"\",\"entry_by\":\"master\",\"selected\":true}]', '[{\"id\":\"518\",\"percentage\":\"7.00\",\"igst\":0,\"sgst\":\"1316.00\",\"cgst\":\"1316.00\",\"totalGST\":\"2632.00\"}]', '', '', '', ''),
(549, '60', 'gmpdemo1', 'Raw Material', 'RM/PURHO/0054/2022-23', 'RM0004', 'V10648', '', '', 0.00, '', '', '', 60000.00, 3420.00, 0.00, 60420.00, '[{\"id\":\"18\",\"plant_id\":\"\",\"term_heading\":\"Shipping\",\"term\":\"Should be shipped on the given timeline\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:52:38\",\"status\":\"approve\",\"selected\":true}]', 'no', 'Approved', 'master', '2023-08-08 03:33:31', 0, 'No', 'OK', 'master', '2023-08-08 03:34:16', 'pending', '0000-00-00', '', '', 3000.00, 336.00, 12, 60756.00, '', 'Local Transport', '', 'C0001', 'C0001', '', 'Local Purchase', 'INR', '', '', 'RM', '2002-23', 0.00, '[{\"id\":\"8\",\"plant_id\":\"60\",\"additional_term\":\"Refusal to accept increased payment term\",\"entry_date\":\"2023-08-02\",\"status\":\"\",\"entry_by\":\"master\",\"selected\":true}]', '[{\"id\":\"519\",\"percentage\":\"6.00\",\"igst\":0,\"sgst\":\"1710.00\",\"cgst\":\"1710.00\",\"totalGST\":\"3420.00\"}]', '', '', '', ''),
(550, '60', 'gmpdemo1', 'Raw Material', 'RM/PURHO/0055/2022-23', '', 'V10648', '', '0', 6.00, '', '', '', 30000.00, 1800.00, 0.00, 31800.00, '[{\"id\":\"18\",\"plant_id\":\"\",\"term_heading\":\"Shipping\",\"term\":\"Should be shipped on the given timeline\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:52:38\",\"status\":\"approve\",\"selected\":true}]', 'no', 'Approved', 'master', '2023-08-08 03:40:57', 0, 'No', 'OK', 'master', '2023-08-08 03:41:10', 'pending', '0000-00-00', '', '', 6.00, 336.00, 36, 32136.00, 'purchase', 'Local Transport', '', 'C0001', 'C0001', '', 'Local Purchase', '', '0', '', 'RM', '2002-23', 0.00, '[{\"id\":\"8\",\"plant_id\":\"60\",\"additional_term\":\"Refusal to accept increased payment term\",\"entry_date\":\"2023-08-02\",\"status\":\"\",\"entry_by\":\"master\",\"selected\":true}]', '[{\"percentage\":\"6.00\",\"igst\":0,\"sgst\":\"900.00\",\"cgst\":\"900.00\",\"totalGST\":\"1800.00\"}]', '', '', '', ''),
(551, '60', 'gmpdemo1', 'Raw Material', 'RM/PURHO/0056/2023-24', 'RM0005', 'V10651', '', '', 0.00, '', '', '', 60000.00, 2328.00, 0.00, 60528.00, '[{\"id\":\"18\",\"plant_id\":\"\",\"term_heading\":\"Shipping\",\"term\":\"Should be shipped on the given timeline\",\"entry_by\":\"master\",\"entry_date\":\"2023-08-02 12:52:38\",\"status\":\"approve\",\"selected\":true}]', 'no', 'Approved', 'master', '2023-08-31 12:07:15', 0, 'No', 'OK', 'master', '2023-08-31 12:07:50', 'pending', '0000-00-00', '', '', 1800.00, 210.00, 5, 60738.00, '', 'Local Transport', '', 'C0001', 'C0001', '', 'Local Purchase', 'INR', '', '', 'RM', '2002-23', 0.00, '[{\"id\":\"8\",\"plant_id\":\"60\",\"additional_term\":\"Refusal to accept increased payment term\",\"entry_date\":\"2023-08-02\",\"status\":\"\",\"entry_by\":\"master\",\"selected\":true}]', '[{\"id\":\"520\",\"percentage\":\"4.00\",\"igst\":0,\"sgst\":\"1164.00\",\"cgst\":\"1164.00\",\"totalGST\":\"2328.00\"}]', '', '', '', '');

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

--
-- Table structure for table `qa_master`
--

CREATE TABLE `qa_master` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `qa_tn_employees`
--

CREATE TABLE `qa_tn_employees` (
  `id` int NOT NULL,
  `Plant_id` int NOT NULL,
  `user_no` int NOT NULL,
  `tn_no` varchar(20) NOT NULL,
  `emp_id` varchar(20) NOT NULL,
  `attendance` varchar(50) NOT NULL,
  `exam` varchar(50) NOT NULL,
  `total_marks` varchar(50) NOT NULL,
  `result` varchar(50) NOT NULL,
  `feedback` varchar(50) NOT NULL,
  `question` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `qa_training_needs`
--

CREATE TABLE `qa_training_needs` (
  `id` int NOT NULL,
  `Plant_id` int NOT NULL,
  `user_no` int NOT NULL,
  `department` varchar(50) NOT NULL,
  `subject` varchar(100) NOT NULL,
  `other_subject` varchar(100) NOT NULL,
  `reference_document` varchar(150) NOT NULL,
  `training_needs` varchar(150) NOT NULL,
  `proposed_trainer` varchar(100) NOT NULL,
  `proposed_date` date NOT NULL,
  `status` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL,
  `training_date` date NOT NULL,
  `training_time` time(6) NOT NULL,
  `trainer_name` varchar(50) NOT NULL,
  `venue` varchar(50) NOT NULL,
  `approve_by` varchar(50) NOT NULL,
  `approve_date` varchar(50) NOT NULL,
  `attendance` varchar(50) NOT NULL,
  `training_tools` varchar(100) NOT NULL,
  `training_start_time` time(6) NOT NULL,
  `training_end_time` time(6) NOT NULL,
  `questinaries` varchar(200) NOT NULL,
  `evaluator_name` varchar(50) NOT NULL,
  `duration` varchar(50) NOT NULL,
  `total_marks` varchar(50) NOT NULL,
  `question` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `qc_testing_results`
--

CREATE TABLE `qc_testing_results` (
  `id` int NOT NULL,
  `test_no` int NOT NULL,
  `test_name` int NOT NULL,
  `sub_test` int NOT NULL,
  `description` int NOT NULL,
  `reference_type` int NOT NULL,
  `limits` int NOT NULL,
  `result` int NOT NULL,
  `status` int NOT NULL,
  `tested_by` int NOT NULL,
  `checked_by` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `qms_training`
--

CREATE TABLE `qms_training` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `department` varchar(50) NOT NULL,
  `subject` varchar(50) NOT NULL,
  `training_on` varchar(50) NOT NULL,
  `equipment` varchar(50) NOT NULL,
  `equipment_id` varchar(50) NOT NULL,
  `description` text NOT NULL,
  `employeeList` mediumtext NOT NULL,
  `proposed_date` date NOT NULL,
  `proposed_trainer` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `qualification`
--

CREATE TABLE `qualification` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `qualification` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `qualification`
--

INSERT INTO `qualification` (`id`, `plant_id`, `user_no`, `qualification`, `status`, `entry_by`, `entry_date`, `approve_by`, `approve_date`) VALUES
(24, '', 'gmpdemo1', 'BBA', 'active', 'master', '2023-08-02 10:59:59', '', ''),
(25, '', 'gmpdemo1', 'BCA', 'active', 'master', '2023-08-03 11:02:12', '', ''),
(26, '', 'gmpdemo1', 'MCA', 'active', 'master', '2023-08-03 11:02:18', '', ''),
(27, '', 'gmpdemo1', 'MBA', 'active', 'master', '2023-08-03 11:02:26', '', ''),
(28, '', 'gmpdemo1', 'M.COM', 'active', 'master', '2023-08-23 12:36:49', '', ''),
(29, '', 'gmpdemo1', 'BSC', 'active', 'master', '2023-08-23 12:37:12', '', ''),
(30, '', 'gmpdemo1', 'MSC', 'active', 'master', '2023-08-23 12:37:22', '', ''),
(31, '', 'gmpdemo1', 'BCOM', 'active', 'master', '2023-08-23 12:37:32', '', ''),
(36, '', 'gmpdemo1', 'B.TECH.', 'active', 'master', '2023-08-26 13:22:56', '', '');

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

--
-- Table structure for table `qualification_request`
--

CREATE TABLE `qualification_request` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `department_name` varchar(50) NOT NULL,
  `section_name` varchar(50) NOT NULL,
  `equip_name` varchar(50) NOT NULL,
  `make` varchar(50) NOT NULL,
  `capacity` int NOT NULL,
  `entry_date` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `quotation`
--

CREATE TABLE `quotation` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `quotation_no` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `documents` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `status` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `q_no1` int NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `selected_approver` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `quotation`
--
DELIMITER $$
CREATE TRIGGER `quotation_no_insert` BEFORE INSERT ON `quotation` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM quotation ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.quotation_no = concat('QO-', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `quotation_dtl`
--

CREATE TABLE `quotation_dtl` (
  `id` int NOT NULL,
  `quotation_type` varchar(25) NOT NULL,
  `quotation_hdr_id` int NOT NULL,
  `material_id` int NOT NULL,
  `material_code` varchar(25) NOT NULL,
  `quotation_amt` decimal(6,2) NOT NULL,
  `tax_applicable` varchar(3) NOT NULL,
  `gst_per` int NOT NULL,
  `pack_size` varchar(15) NOT NULL,
  `pack_unit` varchar(15) NOT NULL,
  `quotation_per` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quotation_dtl`
--

INSERT INTO `quotation_dtl` (`id`, `quotation_type`, `quotation_hdr_id`, `material_id`, `material_code`, `quotation_amt`, `tax_applicable`, `gst_per`, `pack_size`, `pack_unit`, `quotation_per`) VALUES
(645, 'Local', 651, 635, 'RM00012', 400.00, 'Yes', 12, '30', 'Kg', 'Kg'),
(646, 'Local', 652, 636, 'RM00013', 520.00, 'Yes', 18, '30', 'Kg', 'Kg'),
(647, 'Local', 653, 637, 'RM00014', 200.00, 'Yes', 7, '100', 'Kg', 'Kg'),
(648, 'Local', 654, 638, 'RM00015', 300.00, 'Yes', 6, '5', 'Kg', 'Kg'),
(649, 'Local', 655, 643, 'RM000653', 200.00, 'Yes', 4, '100', 'Kg', 'Kg');

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

--
-- Table structure for table `quotation_hdr`
--

CREATE TABLE `quotation_hdr` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `material_type` varchar(50) NOT NULL,
  `quotation_no` varchar(15) NOT NULL,
  `vendor_quotation_no` varchar(15) NOT NULL,
  `vendor_id` int NOT NULL,
  `entry_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `entry_by` varchar(10) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `doc_url` varchar(1000) NOT NULL,
  `approve_by` varchar(25) NOT NULL,
  `approve_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quotation_hdr`
--

INSERT INTO `quotation_hdr` (`id`, `plant_id`, `material_type`, `quotation_no`, `vendor_quotation_no`, `vendor_id`, `entry_date`, `entry_by`, `status`, `doc_url`, `approve_by`, `approve_date`) VALUES
(651, 60, 'Raw Material', 'Q-0001', '35', 645, '2023-08-02 12:46:53', 'master', 'approve', 'quotation-Ankita Bhausaheb Godase Resume.pdf', 'master', '2023-08-02 12:46:58'),
(652, 60, 'Raw Material', 'Q-0002', '243', 646, '2023-08-03 03:59:36', 'master', 'approve', '', 'master', '2023-08-03 03:59:41'),
(653, 60, 'Raw Material', 'Q-0003', 'QC035', 647, '2023-08-07 05:05:45', 'master', 'approve', 'quotation-NEW TAKRAR ARJA.pdf', 'master', '2023-08-07 05:05:55'),
(654, 60, 'Raw Material', 'Q-0004', 'QC032', 648, '2023-08-08 03:31:10', 'master', 'approve', '', 'master', '2023-08-08 03:31:16'),
(655, 60, 'Raw Material', 'Q-0005', 'QC06682', 651, '2023-08-31 11:45:08', 'master', 'approve', 'quotation-Preventive maintenance schedule.pdf', 'master', '2023-08-31 11:45:13');

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

--
-- Stand-in structure for view `quotation_rates_by_product`
-- (See below for the actual view)
--
CREATE TABLE `quotation_rates_by_product` (
`gst_per` int
,`material_code` varchar(25)
,`material_id` int
,`quotation_amt` decimal(6,2)
,`quotation_no` varchar(15)
,`quotation_per` varchar(15)
,`tax_applicable` varchar(3)
,`vendor_id` int
,`vendor_name` varchar(100)
,`vendor_no` varchar(20)
);

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

--
-- Table structure for table `rack`
--

CREATE TABLE `rack` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `section` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rack_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rack_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` decimal(10,2) NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `empty` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'yes',
  `material_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `material_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `ratemrp`
--

CREATE TABLE `ratemrp` (
  `id` int NOT NULL,
  `product_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `entry_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate_for` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `raw_material`
--

CREATE TABLE `raw_material` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `material_code` varchar(20) NOT NULL,
  `batch_no` varchar(20) NOT NULL,
  `vendor_no` varchar(20) NOT NULL,
  `order_qty` decimal(10,2) NOT NULL,
  `unit` varchar(20) NOT NULL,
  `received_qty` decimal(10,2) NOT NULL,
  `accept_qty` decimal(10,2) NOT NULL,
  `containers` int NOT NULL,
  `mfg_date` varchar(20) NOT NULL,
  `exp_date` varchar(20) NOT NULL,
  `inword_details` text NOT NULL,
  `received_by` varchar(20) NOT NULL,
  `entry_date` datetime DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `receiving` varchar(20) NOT NULL DEFAULT 'pending',
  `coa_received` varchar(20) NOT NULL,
  `receiving_details` text NOT NULL,
  `dedusting` varchar(20) NOT NULL DEFAULT 'pending',
  `dedusting_details` text NOT NULL,
  `damage` varchar(20) NOT NULL DEFAULT 'pending',
  `damage_details` text NOT NULL,
  `weighing` varchar(20) NOT NULL DEFAULT 'pending',
  `weighing_details` text NOT NULL,
  `grn` varchar(20) NOT NULL DEFAULT 'pending',
  `labels` varchar(20) NOT NULL DEFAULT 'pending',
  `grn_details` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `raw_materials_table`
--

CREATE TABLE `raw_materials_table` (
  `material_subtype` varchar(1000) NOT NULL,
  `material_name` varchar(1000) NOT NULL,
  `material_Code` varchar(500) NOT NULL,
  `plant_id` varchar(50) NOT NULL,
  `product_code` varchar(500) NOT NULL,
  `uid` varchar(500) NOT NULL,
  `id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `receving`
--

CREATE TABLE `receving` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `standard_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `challan_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `challan_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tax_invoice` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime(6) NOT NULL,
  `gross_total` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst_total` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `net_total` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `standards` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `batches` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `received_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `containerTotal` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `challan_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_condition` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `outer_packing` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `container_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `container_subtype` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `refregirator_temp_record`
--

CREATE TABLE `refregirator_temp_record` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `refrig_id` varchar(20) NOT NULL,
  `thermometer_id` varchar(20) NOT NULL,
  `observed_temp` int NOT NULL,
  `min_temp` int NOT NULL,
  `max_temp` int NOT NULL,
  `entry_by` varchar(20) NOT NULL,
  `checked_by` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `refrigerator_cleaning`
--

CREATE TABLE `refrigerator_cleaning` (
  `id` int NOT NULL,
  `disinfect` varchar(50) NOT NULL,
  `clean_by` varchar(50) NOT NULL,
  `remark` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_time` time NOT NULL,
  `entry_date` date NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `refrigerator_log`
--

CREATE TABLE `refrigerator_log` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `equipment_id` varchar(20) NOT NULL,
  `entry_date` date NOT NULL,
  `entry_time` datetime NOT NULL,
  `disinfectant_used` varchar(50) NOT NULL,
  `remark` varchar(50) NOT NULL,
  `cleaned_by` varchar(20) NOT NULL,
  `used_by` varchar(20) NOT NULL,
  `checked_by` varchar(20) NOT NULL,
  `approved_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rejection`
--

CREATE TABLE `rejection` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `receiving_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `containers` decimal(10,2) NOT NULL,
  `rejected_qty` decimal(10,2) NOT NULL,
  `reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `action_taken` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rejected_area` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inform` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rejection_destruction`
--

CREATE TABLE `rejection_destruction` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `rejection_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `steps` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rejection_online`
--

CREATE TABLE `rejection_online` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `department` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_type` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lot_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rejected_quantity` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_id` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rejection_type` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime DEFAULT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `qa_approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qa_approve_date` datetime DEFAULT NULL,
  `equipment_used` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `detailofcemical` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rejection_rawpacking`
--

CREATE TABLE `rejection_rawpacking` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_type` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `arno` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grn` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `containers_total` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `containers_rejected` int NOT NULL,
  `quantity_received` int NOT NULL,
  `rejected_quantity` int NOT NULL,
  `rejection_reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `receiving_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isRejectionArea` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `storage_location` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `supplier_inform` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reject_action` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `store_approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `store_approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qa_approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qa_approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `requisition`
--

CREATE TABLE `requisition` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `item_name` varchar(50) NOT NULL,
  `stock_qty` varchar(50) NOT NULL,
  `indend_qty` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `resignation`
--

CREATE TABLE `resignation` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `emp_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `emp_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expected_notice` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expected_releaving` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `resignation_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `resignation_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `resignation_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `resignation_date` date NOT NULL,
  `exitinterview_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `releaving_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_letter` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `department` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dept_resignation_remark` mediumtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `dept_resignation_status` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `resignation_clearnace`
--

CREATE TABLE `resignation_clearnace` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `resignation_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `due_status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `emp_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `subject` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `releaving_date` date NOT NULL,
  `emp_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `retest`
--

CREATE TABLE `retest` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grn_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ar_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `release_date` date NOT NULL,
  `retest_date` date NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mfg_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qc_person` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qc_alternate_person` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `micro_person` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `micro_alternate_person` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `retraining`
--

CREATE TABLE `retraining` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `emp_id` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `training_date` date NOT NULL,
  `reason` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `trainer` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `trainer_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `marks` decimal(10,2) NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dept_approval` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rinse_analysis`
--

CREATE TABLE `rinse_analysis` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `equip_name` varchar(50) NOT NULL,
  `batch_code` varchar(50) NOT NULL,
  `doa` date NOT NULL,
  `dor` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rinse_analysis_dtl`
--

CREATE TABLE `rinse_analysis_dtl` (
  `id` int NOT NULL,
  `ra_id` varchar(20) NOT NULL,
  `micro_organism` varchar(50) NOT NULL,
  `observation_control` varchar(50) NOT NULL,
  `incubation_period` varchar(50) NOT NULL,
  `entry_by` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `risk_departments`
--

CREATE TABLE `risk_departments` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `risk_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `risk_identification`
--

CREATE TABLE `risk_identification` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `department` varchar(50) NOT NULL,
  `section` varchar(50) NOT NULL,
  `identification` varchar(200) NOT NULL,
  `usages_for` varchar(200) NOT NULL,
  `risk_form` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `justification` text NOT NULL,
  `qty_impact` varchar(20) NOT NULL,
  `impact_strength` varchar(20) NOT NULL,
  `human_impact` varchar(20) NOT NULL,
  `risk_strength` varchar(20) NOT NULL,
  `product_code` varchar(20) NOT NULL,
  `batch_no` varchar(20) NOT NULL,
  `lot_no` varchar(20) NOT NULL,
  `equipment_code` varchar(20) NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) NOT NULL,
  `entry_date` datetime NOT NULL,
  `details` text NOT NULL,
  `assessment` varchar(20) NOT NULL DEFAULT 'pending',
  `analysis` varchar(20) NOT NULL DEFAULT 'pending',
  `evaluation` varchar(20) NOT NULL DEFAULT 'pending',
  `control` varchar(20) NOT NULL DEFAULT 'pending',
  `review` varchar(20) NOT NULL DEFAULT 'pending',
  `review_by` varchar(20) NOT NULL,
  `review_date` datetime DEFAULT NULL,
  `comment` text NOT NULL,
  `capa` varchar(5) NOT NULL,
  `risk_control` varchar(5) NOT NULL,
  `impact_quality` varchar(5) NOT NULL,
  `close_comment` text NOT NULL,
  `close_by` varchar(20) NOT NULL,
  `close_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rnd_chemical`
--

CREATE TABLE `rnd_chemical` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `chemical_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chemical_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `molecular_wt` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cas_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grade` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `make` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_chemical`
--
DELIMITER $$
CREATE TRIGGER `rnd_chemical_no_insert` BEFORE INSERT ON `rnd_chemical` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_chemical ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.chemical_no = concat('C1', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_controlsample_rack`
--

CREATE TABLE `rnd_controlsample_rack` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `rack_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rack_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `subrack` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_control_sample`
--

CREATE TABLE `rnd_control_sample` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `cs_id` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ar_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `analysis_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `release_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mfg_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `done_by` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampling_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sample_quantity` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sample_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rack_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `checked_by` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `room_temp` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `humidity` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `cs_id1` int NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_control_sample`
--
DELIMITER $$
CREATE TRIGGER `rnd_control_sample_no_insert` BEFORE INSERT ON `rnd_control_sample` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_control_sample ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.cs_id = concat('CS-', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_dev_optimisation`
--

CREATE TABLE `rnd_dev_optimisation` (
  `id` int NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dev_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `trial_title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `objective` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `procedures` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `testings` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `observations` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `optimisation` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_dev_optimisation`
--
DELIMITER $$
CREATE TRIGGER `rnd_dev_optimisation_no` BEFORE INSERT ON `rnd_dev_optimisation` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_dev_optimisation ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.dev_no = concat('DEV', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_dev_trial`
--

CREATE TABLE `rnd_dev_trial` (
  `id` int NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dev_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'kg',
  `trial_title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `objective` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `optimisation` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_dev_trial`
--
DELIMITER $$
CREATE TRIGGER `rnd_dev_trial_no` BEFORE INSERT ON `rnd_dev_trial` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_dev_trial ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.dev_no = concat('DEV', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_dev_trials`
--

CREATE TABLE `rnd_dev_trials` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dev_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `procedures` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `testings` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `observations` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `optimisation` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_equipment`
--

CREATE TABLE `rnd_equipment` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `equipment_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `make` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `min_capacity` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `max_capacity` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Fix',
  `department` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `section` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purchase_date` date NOT NULL,
  `installation_date` date NOT NULL,
  `model` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_sr_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_used` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `e_no1` int NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `calibration` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Not Required',
  `calibration_parameter` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `process` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `from_range` decimal(10,2) NOT NULL,
  `from_range_uom` varchar(6) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `to_range` decimal(10,2) NOT NULL,
  `to_range_uom` varchar(6) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` int NOT NULL DEFAULT '28'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_glassware`
--

CREATE TABLE `rnd_glassware` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `glassware_no` varchar(6) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `glassware_class` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `make` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_glassware`
--
DELIMITER $$
CREATE TRIGGER `rnd_glassware_no_insert` BEFORE INSERT ON `rnd_glassware` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_glassware ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.glassware_no = concat('G1', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_hplc`
--

CREATE TABLE `rnd_hplc` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `hplc_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `brand` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `particle_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_hplc`
--
DELIMITER $$
CREATE TRIGGER `rnd_hplc_no_insert` BEFORE INSERT ON `rnd_hplc` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_hplc ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.hplc_no = concat('H1', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_indicator`
--

CREATE TABLE `rnd_indicator` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `indicator_no` char(6) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `indicator` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `acid_color` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `base_color` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ph_range` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pka` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_material`
--

CREATE TABLE `rnd_material` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `material_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_subtype` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grade` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cas_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `upac_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_nature` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `standard_qty` decimal(10,2) NOT NULL,
  `role` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Active',
  `country` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ownership` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `artwork_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inventory` int NOT NULL DEFAULT '10',
  `location` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `thera` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `storage_condition` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `special_grade` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` decimal(10,2) NOT NULL,
  `unit` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `retest` decimal(10,2) NOT NULL,
  `shelf_life` decimal(10,2) NOT NULL,
  `min_shelf` decimal(10,2) NOT NULL,
  `lead_time` decimal(10,2) NOT NULL,
  `equivalent` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hsn` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isprinted` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `for_product` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `m_id1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_material`
--
DELIMITER $$
CREATE TRIGGER `rnd_material_code` BEFORE INSERT ON `rnd_material` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_material ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.material_code = concat('M1', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_optimisation_trials`
--

CREATE TABLE `rnd_optimisation_trials` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dev_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `procedures` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipments` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `testings` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `observations` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `optimisation` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_predev`
--

CREATE TABLE `rnd_predev` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `dev_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `proposed_route` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dosage_form` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `delivery_system` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `strength` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `container_closure` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quality_criteria` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sterility` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stability` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `temp` decimal(10,0) NOT NULL,
  `humidity` decimal(10,0) NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `rnd_predev`
--
DELIMITER $$
CREATE TRIGGER `predev_no_insert` BEFORE INSERT ON `rnd_predev` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_predev ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.dev_no = concat('DEV', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_product`
--

CREATE TABLE `rnd_product` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'gmpdemo1',
  `product_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `generic_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `packing_style` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `dosage_form` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `label_claim` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `packing_mode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `min_shelf` decimal(10,2) NOT NULL,
  `thera` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `testing_time` decimal(10,2) NOT NULL,
  `retest_period` decimal(10,2) NOT NULL,
  `division` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `sale_ts` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `shelf_life` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `hsn` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gtin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gst` int NOT NULL,
  `category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mfg_lic` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pack_desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `apperance` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `storage_condition` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `market` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mrp` decimal(10,2) NOT NULL,
  `manufactured_under` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `manufactured_for` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `product_lic` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `fsc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `copp` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `artwork` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `artwork_status` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending',
  `manufactured_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Triggers `rnd_product`
--
DELIMITER $$
CREATE TRIGGER `rnd_product_code_insert` BEFORE INSERT ON `rnd_product` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_product ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.product_code = concat('P1', LPAD(CONVERT(@lastID, CHAR), 5, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `rnd_risk_departments`
--

CREATE TABLE `rnd_risk_departments` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `risk_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_risk_identification`
--

CREATE TABLE `rnd_risk_identification` (
  `id` int NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `department` varchar(50) NOT NULL,
  `section` varchar(50) NOT NULL,
  `identification` varchar(200) NOT NULL,
  `usages_for` varchar(200) NOT NULL,
  `risk_form` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `justification` text NOT NULL,
  `qty_impact` varchar(20) NOT NULL,
  `impact_strength` varchar(20) NOT NULL,
  `human_impact` varchar(20) NOT NULL,
  `risk_strength` varchar(20) NOT NULL,
  `product_code` varchar(20) NOT NULL,
  `batch_no` varchar(20) NOT NULL,
  `lot_no` varchar(20) NOT NULL,
  `equipment_code` varchar(20) NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) NOT NULL,
  `entry_date` datetime NOT NULL,
  `details` text NOT NULL,
  `assessment` varchar(20) NOT NULL DEFAULT 'pending',
  `analysis` varchar(20) NOT NULL DEFAULT 'pending',
  `evaluation` varchar(20) NOT NULL DEFAULT 'pending',
  `control` varchar(20) NOT NULL DEFAULT 'pending',
  `review` varchar(20) NOT NULL DEFAULT 'pending',
  `review_by` varchar(20) NOT NULL,
  `review_date` datetime DEFAULT NULL,
  `comment` text NOT NULL,
  `capa` varchar(5) NOT NULL,
  `risk_control` varchar(5) NOT NULL,
  `impact_quality` varchar(5) NOT NULL,
  `close_comment` text NOT NULL,
  `close_by` varchar(20) NOT NULL,
  `close_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `rnd_techtransfer`
--

CREATE TABLE `rnd_techtransfer` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tech_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `receive_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` decimal(10,2) NOT NULL,
  `documentations` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `raw_materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendors` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activities` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `rnd_volumetric_master`
--

CREATE TABLE `rnd_volumetric_master` (
  `id` int NOT NULL,
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `master_no` varchar(10) NOT NULL,
  `solution_name` varchar(200) NOT NULL,
  `percentage` decimal(10,2) NOT NULL,
  `unit` varchar(20) NOT NULL,
  `strength` varchar(100) NOT NULL,
  `standard_type` varchar(20) NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) NOT NULL,
  `entry_date` datetime NOT NULL,
  `approve_by` varchar(20) NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Triggers `rnd_volumetric_master`
--
DELIMITER $$
CREATE TRIGGER `rnd_volumetric_master_no` BEFORE INSERT ON `rnd_volumetric_master` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM rnd_volumetric_master ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.master_no = concat('S1', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `salary_annexure`
--

CREATE TABLE `salary_annexure` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `emp_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `employee_type` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `medical_checkup` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gross_salary` decimal(8,2) NOT NULL,
  `fixed_earnings_total` decimal(10,2) NOT NULL,
  `calculateble_gross` decimal(10,2) NOT NULL,
  `total_earnings` double(10,2) NOT NULL,
  `total_deductions` double(10,2) NOT NULL,
  `ctc_deductions` decimal(10,2) NOT NULL,
  `total_ctc` decimal(10,2) NOT NULL,
  `take_home_salary` decimal(10,2) NOT NULL,
  `ctc_annual` decimal(10,2) NOT NULL,
  `entry_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `salary_annexure`
--

INSERT INTO `salary_annexure` (`id`, `plant_id`, `user_no`, `emp_id`, `type`, `employee_type`, `medical_checkup`, `gross_salary`, `fixed_earnings_total`, `calculateble_gross`, `total_earnings`, `total_deductions`, `ctc_deductions`, `total_ctc`, `take_home_salary`, `ctc_annual`, `entry_by`, `entry_date`, `status`) VALUES
(9, '60', 'gmpdemo1', '76', 'Employee', 'Officer', 'Post Joini', 25000.00, 0.00, 0.00, 24805.00, 195.00, 290.00, 25000.00, 24515.00, 300000.00, 'master', '2023-08-03 11:19:31', 'Pending'),
(10, '60', 'gmpdemo1', '511', 'Employee', 'Officer', '', 25000.00, 0.00, 0.00, 24805.00, 195.00, 290.00, 25000.00, 24515.00, 300000.00, 'master', '2023-08-03 11:34:33', 'Pending'),
(11, '60', 'gmpdemo1', 'EC06', 'Employee', 'Officer', '', 25000.00, 0.00, 0.00, 23998.84, 1001.16, 290.00, 25000.00, 23708.84, 300000.00, 'master', '2023-08-03 11:38:04', 'Pending'),
(12, '60', 'gmpdemo1', 'EC04', 'Employee', 'Manager', '', 20000.00, 0.00, 0.00, 19169.67, 830.33, 302.00, 20000.00, 18867.67, 240000.00, 'master', '2023-08-03 12:57:47', 'Pending'),
(13, '60', 'gmpdemo1', 'EC002', 'Employee', 'Manager', '', 20000.00, 0.00, 0.00, 19169.67, 830.33, 302.00, 20000.00, 18867.67, 240000.00, 'master', '2023-09-04 02:33:53', 'Pending');

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

--
-- Table structure for table `salary_annexure_details`
--

CREATE TABLE `salary_annexure_details` (
  `id` int NOT NULL,
  `salary_annexure_id` int NOT NULL,
  `salary_group` varchar(150) NOT NULL,
  `description` varchar(150) NOT NULL,
  `per_month` decimal(10,2) NOT NULL,
  `per_annum` decimal(10,2) NOT NULL,
  `emp_id` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `salary_annexure_details`
--

INSERT INTO `salary_annexure_details` (`id`, `salary_annexure_id`, `salary_group`, `description`, `per_month`, `per_annum`, `emp_id`) VALUES
(93, 9, 'Earnings', 'Basic Salary', 750.00, 9000.00, ''),
(94, 9, 'Earnings', 'HRA', 15.00, 180.00, ''),
(95, 9, 'Earnings', 'Special Allowance', 24040.00, 288480.00, ''),
(96, 9, 'Deductions', 'Professional Tax', 200.00, 2400.00, ''),
(97, 9, 'Deductions', 'PF Contribution By Employee', 90.00, 1080.00, ''),
(98, 9, 'CTC Calculations', 'PF Contribution By Employer', 97.00, 1164.00, ''),
(99, 9, 'CTC Calculations', 'Bonus', 62.00, 744.00, ''),
(100, 9, 'CTC Calculations', 'Gratuity', 36.00, 432.00, ''),
(101, 10, 'Earnings', 'Basic Salary', 750.00, 9000.00, ''),
(102, 10, 'Earnings', 'HRA', 15.00, 180.00, ''),
(103, 10, 'Earnings', 'Special Allowance', 24040.00, 288480.00, ''),
(104, 10, 'Deductions', 'Professional Tax', 200.00, 2400.00, ''),
(105, 10, 'Deductions', 'PF Contribution By Employee', 90.00, 1080.00, ''),
(106, 10, 'CTC Calculations', 'PF Contribution By Employer', 97.00, 1164.00, ''),
(107, 10, 'CTC Calculations', 'Bonus', 62.00, 744.00, ''),
(108, 10, 'CTC Calculations', 'Gratuity', 36.00, 432.00, ''),
(109, 11, 'Earnings', 'Basic Salary', 750.00, 9000.00, ''),
(110, 11, 'Earnings', 'HRA', 15.00, 180.00, ''),
(111, 11, 'Earnings', 'Special Allowance', 23233.84, 278806.08, ''),
(112, 11, 'Deductions', 'Professional Tax', 200.00, 2400.00, ''),
(113, 11, 'Deductions', 'PF Contribution By Employee', 90.00, 1080.00, ''),
(114, 11, 'CTC Calculations', 'PF Contribution By Employer', 97.00, 1164.00, ''),
(115, 11, 'CTC Calculations', 'ESI Contribution By Employer', 806.16, 806.16, ''),
(116, 11, 'CTC Calculations', 'Bonus', 62.00, 744.00, ''),
(117, 11, 'CTC Calculations', 'Gratuity', 36.00, 432.00, ''),
(118, 12, 'Earnings', 'Basic Salary', 800.00, 9600.00, ''),
(119, 12, 'Earnings', 'HRA', 24.00, 288.00, ''),
(120, 12, 'Earnings', 'Special Allowance', 18345.67, 220148.04, ''),
(121, 12, 'Deductions', 'Professional Tax', 200.00, 2400.00, ''),
(122, 12, 'Deductions', 'PF Contribution By Employee', 96.00, 1152.00, ''),
(123, 12, 'Deductions', 'ESI Contribution By Employee', 6.00, 72.00, ''),
(124, 12, 'CTC Calculations', 'PF Contribution By Employer', 104.00, 1248.00, ''),
(125, 12, 'CTC Calculations', 'ESI Contribution By Employer', 622.33, 622.33, ''),
(126, 12, 'CTC Calculations', 'Bonus', 66.00, 792.00, ''),
(127, 12, 'CTC Calculations', 'Gratuity', 38.00, 456.00, ''),
(128, 13, 'Earnings', 'Basic Salary', 800.00, 9600.00, ''),
(129, 13, 'Earnings', 'HRA', 24.00, 288.00, ''),
(130, 13, 'Earnings', 'Special Allowance', 18345.67, 220148.04, ''),
(131, 13, 'Deductions', 'Professional Tax', 200.00, 2400.00, ''),
(132, 13, 'Deductions', 'PF Contribution By Employee', 96.00, 1152.00, ''),
(133, 13, 'Deductions', 'ESI Contribution By Employee', 6.00, 72.00, ''),
(134, 13, 'CTC Calculations', 'PF Contribution By Employer', 104.00, 1248.00, ''),
(135, 13, 'CTC Calculations', 'ESI Contribution By Employer', 622.33, 622.33, ''),
(136, 13, 'CTC Calculations', 'Bonus', 66.00, 792.00, ''),
(137, 13, 'CTC Calculations', 'Gratuity', 38.00, 456.00, '');

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

--
-- Table structure for table `salary_head`
--

CREATE TABLE `salary_head` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL,
  `emp_type` varchar(50) NOT NULL,
  `salary_type` varchar(25) NOT NULL,
  `salary_calculate_on` varchar(25) NOT NULL,
  `pf_applicable` varchar(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `salary_head`
--

INSERT INTO `salary_head` (`id`, `plant_id`, `entry_by`, `entry_date`, `emp_type`, `salary_type`, `salary_calculate_on`, `pf_applicable`) VALUES
(5, 60, 'master', '2023-08-03', 'Officer', '', '', 'YES'),
(6, 60, 'master', '2023-08-03', 'Manager', '', '', 'YES');

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

--
-- Table structure for table `salary_head_details`
--

CREATE TABLE `salary_head_details` (
  `id` int NOT NULL,
  `salary_hdr_id` int NOT NULL,
  `salary_head_group` varchar(15) NOT NULL,
  `calc_type` varchar(25) NOT NULL,
  `salary_head` varchar(150) NOT NULL,
  `percent` decimal(5,2) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `type_flag` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `salary_head_details`
--

INSERT INTO `salary_head_details` (`id`, `salary_hdr_id`, `salary_head_group`, `calc_type`, `salary_head`, `percent`, `amount`, `type_flag`) VALUES
(47, 5, 'Earnings', 'Percentage', 'Basic Salary', 3.00, 3.00, 'BASIC'),
(48, 5, 'Earnings', 'Percentage', 'HRA', 2.00, 2.00, 'HRA'),
(49, 5, 'Deductions', 'Amount', 'Professional Tax', 0.00, 200.00, 'PT'),
(50, 5, 'Deductions', 'Percentage', 'PF Contribution By Employee', 12.00, 0.00, 'PF'),
(51, 5, 'Deductions', 'Percentage', 'ESI Contribution By Employee', 0.75, 0.00, 'ESIC'),
(52, 5, 'CTC Calculation', 'Percentage', 'PF Contribution By Employer', 13.00, 0.00, 'PF'),
(53, 5, 'CTC Calculation', 'Percentage', 'ESI Contribution By Employer', 3.25, 0.00, 'ESIC'),
(54, 5, 'CTC Calculation', 'Percentage', 'Bonus', 8.33, 0.00, 'BONUS'),
(55, 5, 'CTC Calculation', 'Percentage', 'Gratuity', 4.81, 0.00, 'GRATUITY'),
(56, 6, 'Earnings', 'Percentage', 'Basic Salary', 4.00, 4.00, 'BASIC'),
(57, 6, 'Earnings', 'Percentage', 'HRA', 3.00, 3.00, 'HRA'),
(58, 6, 'Deductions', 'Amount', 'Professional Tax', 0.00, 200.00, 'PT'),
(59, 6, 'Deductions', 'Percentage', 'PF Contribution By Employee', 12.00, 0.00, 'PF'),
(60, 6, 'Deductions', 'Percentage', 'ESI Contribution By Employee', 0.75, 0.00, 'ESIC'),
(61, 6, 'CTC Calculation', 'Percentage', 'PF Contribution By Employer', 13.00, 0.00, 'PF'),
(62, 6, 'CTC Calculation', 'Percentage', 'ESI Contribution By Employer', 3.25, 0.00, 'ESIC'),
(63, 6, 'CTC Calculation', 'Percentage', 'Bonus', 8.33, 0.00, 'BONUS'),
(64, 6, 'CTC Calculation', 'Percentage', 'Gratuity', 4.81, 0.00, 'GRATUITY');

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

--
-- Table structure for table `salary_types`
--

CREATE TABLE `salary_types` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `payroll_type` varchar(25) NOT NULL,
  `entry_by` varchar(15) NOT NULL,
  `entry_date` datetime DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `salary_types`
--

INSERT INTO `salary_types` (`id`, `plant_id`, `payroll_type`, `entry_by`, `entry_date`) VALUES
(26, 60, 'Manager', 'master', '2023-08-03 01:30:47'),
(27, 60, 'Officer', 'master', '2023-08-03 01:31:03');

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

--
-- Table structure for table `sales`
--

CREATE TABLE `sales` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `order_type` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst_app` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bill_curr` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `branch` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `curr_rate` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_percent` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `val_in_inr` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pay_mode` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `materials` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `po_date` datetime NOT NULL,
  `gross_total` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_total` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tax_total` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `net_total` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `final_total` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sales_data` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `taxable` decimal(10,2) NOT NULL,
  `CgstVal` decimal(10,2) NOT NULL,
  `SgstVal` decimal(10,2) NOT NULL,
  `IgstVal` decimal(10,2) NOT NULL,
  `OthChrg` decimal(10,2) NOT NULL,
  `RndOffAmt` decimal(10,2) NOT NULL,
  `TotInvVal` decimal(10,2) NOT NULL,
  `approve_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL,
  `invoice` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `order_qty` int NOT NULL,
  `other` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `sales`
--
DELIMITER $$
CREATE TRIGGER `sales_order_no_insert` BEFORE INSERT ON `sales` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM sales ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.order_no = concat('SO', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `salesmrp`
--

CREATE TABLE `salesmrp` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mrp` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `approve_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `sales_product`
--

CREATE TABLE `sales_product` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `order_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `f_qty` decimal(10,2) NOT NULL,
  `sale_rate` decimal(10,2) NOT NULL,
  `mrp` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_per` decimal(10,2) NOT NULL,
  `gst_per` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `disc_total` decimal(10,2) NOT NULL,
  `tax_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `taxable` decimal(10,2) NOT NULL,
  `SgstAmt` decimal(10,2) NOT NULL,
  `CgstAmt` decimal(10,2) NOT NULL,
  `IgstAmt` decimal(10,2) NOT NULL,
  `OthChrg` decimal(10,2) NOT NULL,
  `free_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_percent` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `other` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `sales_product_dtl`
--

CREATE TABLE `sales_product_dtl` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `order_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `f_qty` decimal(10,2) NOT NULL,
  `sale_rate` decimal(10,2) NOT NULL,
  `mrp` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_per` decimal(10,2) NOT NULL,
  `gst_per` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `disc_total` decimal(10,2) NOT NULL,
  `tax_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `taxable` decimal(10,2) NOT NULL,
  `SgstAmt` decimal(10,2) NOT NULL,
  `CgstAmt` decimal(10,2) NOT NULL,
  `IgstAmt` decimal(10,2) NOT NULL,
  `OthChrg` decimal(10,2) NOT NULL,
  `free_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `disc_percent` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `other` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` int NOT NULL,
  `dosage_type` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dosage_form` varchar(99) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_name` varchar(99) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hsn` varchar(99) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requiredQty` varchar(99) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `packing_style` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `singleProduct` varchar(9999) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `sample_request`
--

CREATE TABLE `sample_request` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `name_client` varchar(50) NOT NULL,
  `address` varchar(50) NOT NULL,
  `temp_name` varchar(50) NOT NULL,
  `temp_address` varchar(50) NOT NULL,
  `temp_country` varchar(50) NOT NULL,
  `temp_no` varchar(50) NOT NULL,
  `temp_email` varchar(50) NOT NULL,
  `coa` varchar(50) NOT NULL,
  `fssai` varchar(50) NOT NULL,
  `requirement` varchar(50) NOT NULL,
  `type` varchar(50) NOT NULL,
  `avd_country` varchar(50) NOT NULL,
  `vendor_coa` varchar(50) NOT NULL,
  `stp` varchar(50) NOT NULL,
  `grade` varchar(50) NOT NULL,
  `testing` varchar(50) NOT NULL,
  `unit` varchar(50) NOT NULL,
  `solvent_system` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `color` varchar(50) NOT NULL,
  `core_tablet` varchar(50) NOT NULL,
  `enter` varchar(50) NOT NULL,
  `enter_stp` varchar(50) NOT NULL,
  `equip_avail` varchar(50) NOT NULL,
  `expected` varchar(50) NOT NULL,
  `requried` varchar(50) NOT NULL,
  `recommeded` varchar(50) NOT NULL,
  `status` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `sample_withdrawal`
--

CREATE TABLE `sample_withdrawal` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `cs_id` int NOT NULL,
  `sw_id` int NOT NULL,
  `product_name` varchar(100) NOT NULL,
  `batch_no` int NOT NULL,
  `date` date NOT NULL,
  `department_name` varchar(100) NOT NULL,
  `request_by_employee` varchar(100) NOT NULL,
  `reason_for_request` varchar(100) NOT NULL,
  `required_qty` varchar(50) NOT NULL,
  `required_pack` varchar(50) NOT NULL,
  `balance` varchar(100) NOT NULL,
  `checked_by` varchar(100) NOT NULL,
  `department` varchar(100) NOT NULL,
  `sw_id1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `sampling`
--

CREATE TABLE `sampling` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampling_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `material_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `specification_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `containers` decimal(10,2) NOT NULL,
  `grn_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grn_date` date NOT NULL,
  `mfg_date` date NOT NULL,
  `exp_date` date NOT NULL,
  `urgency` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `change_unit` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `change_grade` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `change_qty` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampling_person` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `allocation_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `micro_person` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `alternate_qc_person` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `alternate_micro_person` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `request_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `request_date` datetime NOT NULL,
  `area_status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `area_details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `laf_start` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pressure_difference` int NOT NULL,
  `clearance_status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `clearance_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sample_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `sampling_details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `testing_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `check_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `approve_date` datetime DEFAULT NULL,
  `batches` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `supplier_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inward_no` int NOT NULL,
  `manufacturer_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `received_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `received_unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grn_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `undertest_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `laf_stop` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ar_no` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `checklist` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `balance_qeuipment_code` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `laf_qeuipment_code` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampling_start_time` datetime NOT NULL,
  `sampling_end_time` datetime NOT NULL,
  `batch_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `label` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sample_qty` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `samplerId` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `remark1` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `retest_status` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `sampling`
--

INSERT INTO `sampling` (`id`, `plant_id`, `sampling_no`, `user_no`, `material_code`, `batch_no`, `specification_no`, `containers`, `grn_no`, `grn_date`, `mfg_date`, `exp_date`, `urgency`, `change_unit`, `change_grade`, `change_qty`, `sampling_person`, `allocation_date`, `micro_person`, `alternate_qc_person`, `alternate_micro_person`, `request_by`, `request_date`, `area_status`, `area_details`, `laf_start`, `pressure_difference`, `clearance_status`, `clearance_no`, `sample_status`, `sampling_details`, `status`, `testing_status`, `entry_by`, `entry_date`, `check_by`, `check_date`, `approve_by`, `approve_date`, `batches`, `supplier_no`, `inward_no`, `manufacturer_no`, `received_qty`, `received_unit`, `grn_by`, `undertest_qty`, `laf_stop`, `ar_no`, `checklist`, `balance_qeuipment_code`, `laf_qeuipment_code`, `sampling_start_time`, `sampling_end_time`, `batch_size`, `label`, `sample_qty`, `samplerId`, `remark1`, `retest_status`) VALUES
(259, '60', 'S0001', 'gmpdemo1', 'RM00012', '1', '', 2.00, 'GRN/22/R/0522', '2023-08-02', '2023-07-05', '2024-06-04', '', '', '', '', 'EC04', '2023-08-02', 'EC04', 'EC04', 'EC04', '', '0000-00-00 00:00:00', 'complete', '{\"equipment_code\":\"54\",\"cleaning_status\":\"Satisfactory\",\"temp\":\"28\",\"humidity\":\"26\"}', '', 0, 'pending', '', 'complete', '{\"identication_qty\":\"\",\"composite_qty\":0,\"reserve_composite\":0,\"additional_qty\":0,\"actual_indentification\":0,\"actual_composite\":0,\"withdrawal_identication\":\"\",\"withdrawal_composite\":0,\"sample_qty\":\"4\",\"reserve_qty\":0,\"sample_unit\":\"gm\",\"start_time\":\"2023-08-03T09:31:39.352Z\",\"stop_date\":\"2023-08-03T09:48:24.047Z\",\"laf_start_date\":null,\"laf_stop_date\":\"2023-08-03T09:48:28.639Z\",\"lafOtion\":1,\"samplerId\":\"12\",\"container_no\":2,\"Remark\":\"ok\",\"undertest_qty\":0,\"container_details\":[{\"container_no\":1,\"sample_qty\":0,\"reserve_qty\":0,\"total_qty\":\"0.00\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":2,\"sample_qty\":0,\"reserve_qty\":0,\"total_qty\":\"0.00\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"}],\"checklist\":[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}],\"equipment_code\":\"\",\"checkPointData\":[],\"balance_eqip_code\":0,\"laf_eqip_code\":0}', 'approve', 'active', 'master', '2023-08-03', 'master', '2023-08-03 03:21:43', 'master', '2023-08-03 03:21:59', '\"\"', 'V10001', 0, '', '', '', '', '0', '', 'AR-01', '[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}]', '0', '', '2023-08-03 09:31:39', '2023-08-03 09:48:24', '', '', '0', '12', '', 'Pending'),
(260, '60', 'S0260', 'gmpdemo1', 'RM00013', '1', '', 3.00, 'GRN/22/R/0523', '2023-08-03', '2023-06-21', '2024-10-16', '', '', '', '', 'EC07', '2023-08-03', 'EC07', 'EC07', 'EC07', '', '0000-00-00 00:00:00', 'complete', '{\"equipment_code\":\"54\",\"cleaning_status\":\"Satisfactory\",\"temp\":\"28\",\"humidity\":\"26\"}', '', 0, 'pending', '', 'complete', '{\"identication_qty\":\"10\",\"composite_qty\":0,\"reserve_composite\":0,\"additional_qty\":0,\"actual_indentification\":30,\"actual_composite\":10,\"withdrawal_identication\":\"10\",\"withdrawal_composite\":3.3300000000000000710542735760100185871124267578125,\"reserve_qty\":0,\"start_time\":\"2023-08-03T11:56:56.195Z\",\"stop_date\":\"2023-08-03T11:59:18.307Z\",\"laf_start_date\":null,\"laf_stop_date\":\"2023-08-03T11:59:21.219Z\",\"container_no\":3,\"Remark\":\"ok\",\"lafOtion\":1,\"samplerId\":\"12\",\"undertest_qty\":12.330000000000001847411112976260483264923095703125,\"container_details\":[{\"container_no\":1,\"sample_qty\":3,\"reserve_qty\":1.1100000000000000976996261670137755572795867919921875,\"total_qty\":\"4.11\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":2,\"sample_qty\":3,\"reserve_qty\":1.1100000000000000976996261670137755572795867919921875,\"total_qty\":\"4.11\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":3,\"sample_qty\":3,\"reserve_qty\":1.1100000000000000976996261670137755572795867919921875,\"total_qty\":\"4.11\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"}],\"checklist\":[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}],\"equipment_code\":\"\",\"checkPointData\":[],\"balance_eqip_code\":0,\"laf_eqip_code\":0}', 'approve', 'active', 'master', '2023-08-03', 'master', '2023-08-03 05:31:02', 'master', '2023-08-03 05:33:08', '\"\"', 'V10646', 0, '', '', '', '', '12.33', '', 'AR-02', '[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}]', '0', '', '2023-08-03 11:56:56', '2023-08-03 11:59:18', '', '', '12.33', '12', '', 'Pending'),
(261, '60', 'S0261', 'gmpdemo1', 'RM00014', 'B031', '', 2.00, 'GRN/22/R/0524', '2023-08-07', '2023-08-07', '2023-08-31', '', '', '', '', 'EC07', '2023-08-07', 'EC07', 'EC07', 'EC07', '', '0000-00-00 00:00:00', 'complete', '{\"equipment_code\":\"54\",\"cleaning_status\":\"Satisfactory\",\"temp\":\"30\",\"humidity\":\"50\"}', '', 0, 'pending', '', 'complete', '{\"identication_qty\":\"0\",\"composite_qty\":0,\"reserve_composite\":0,\"additional_qty\":0,\"actual_indentification\":0,\"actual_composite\":0,\"withdrawal_identication\":\"0\",\"withdrawal_composite\":0,\"reserve_qty\":0,\"sample_unit\":\"Kg\",\"start_time\":\"2023-08-07T12:34:51.313Z\",\"stop_date\":\"2023-08-07T12:35:38.002Z\",\"laf_start_date\":null,\"laf_stop_date\":\"2023-08-07T12:35:41.249Z\",\"lafOtion\":1,\"samplerId\":\"12\",\"container_no\":2,\"Remark\":\"ok\",\"undertest_qty\":0,\"container_details\":[{\"container_no\":1,\"sample_qty\":0,\"reserve_qty\":0,\"total_qty\":\"0.00\",\"unit\":\"gm\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":2,\"sample_qty\":0,\"reserve_qty\":0,\"total_qty\":\"0.00\",\"unit\":\"gm\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"}],\"checklist\":[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}],\"equipment_code\":\"\",\"checkPointData\":[],\"balance_eqip_code\":0,\"laf_eqip_code\":0}', 'approve', 'active', 'master', '2023-08-07', 'master', '2023-08-07 06:05:55', 'master', '2023-08-07 06:06:07', '\"\"', 'V10647', 0, '', '', '', '', '0', '', 'AR-03', '[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}]', '0', '', '2023-08-07 12:34:51', '2023-08-07 12:35:38', '', '', '0', '12', 'ok', 'Pending'),
(262, '60', 'S0262', 'gmpdemo1', 'RM00015', 'B087', '', 16.00, 'GRN/22/R/0526', '2023-08-08', '2023-08-08', '2023-08-31', '', '', '', '', 'EC07', '2023-08-08', 'EC07', 'EC07', 'EC07', '', '0000-00-00 00:00:00', 'complete', '{\"equipment_code\":\"54\",\"cleaning_status\":\"Satisfactory\",\"temp\":\"30\",\"humidity\":\"50\"}', '', 0, 'pending', '', 'complete', '{\"identication_qty\":\"0\",\"composite_qty\":60,\"reserve_composite\":160,\"additional_qty\":20,\"actual_indentification\":0,\"actual_composite\":180,\"withdrawal_identication\":\"0\",\"withdrawal_composite\":3.910000000000000142108547152020037174224853515625,\"sample_qty\":\"10\",\"reserve_qty\":60,\"sample_unit\":\"gm\",\"start_time\":\"2023-08-08T10:32:09.330Z\",\"stop_date\":\"2023-08-08T10:38:27.126Z\",\"laf_start_date\":null,\"laf_stop_date\":\"2023-08-08T10:38:25.959Z\",\"lafOtion\":1,\"samplerId\":\"12\",\"container_no\":46,\"Remark\":\"ok\",\"undertest_qty\":3.909999999999998809840917601832188665866851806640625,\"container_details\":[{\"container_no\":1,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":2,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":3,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":4,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":5,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":6,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":7,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":8,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":9,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":10,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":11,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":12,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":13,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":14,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":15,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":16,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":17,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":18,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":19,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":20,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":21,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":22,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":23,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":24,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":25,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":26,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":27,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":28,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":29,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":30,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":31,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":32,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":33,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":34,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":35,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":36,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":37,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":38,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":39,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":40,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":41,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":42,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":43,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":44,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":45,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":46,\"sample_qty\":0,\"reserve_qty\":0.08500000000000000610622663543836097232997417449951171875,\"total_qty\":\"0.09\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"}],\"checklist\":[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}],\"equipment_code\":\"\",\"checkPointData\":[],\"balance_eqip_code\":0,\"laf_eqip_code\":0}', 'approve', 'active', 'master', '2023-08-08', 'master', '2023-08-08 04:08:46', 'master', '2023-08-08 04:08:59', '\"\"', 'V10648', 0, '', '', '', '', '3.91', '', 'AR-04', '[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}]', '0', '', '2023-08-08 10:32:09', '2023-08-08 10:38:27', '', '', '3.91', '12', 'ok', 'Pending'),
(263, '60', 'S0263', 'gmpdemo1', 'RM000653', 'B077', '', 3.00, 'GRN/22/R/0527', '2023-08-31', '2023-08-31', '2023-09-30', '', '', '', '', 'EC002', '2023-08-31', 'EC002', 'EC002', 'EC002', '', '0000-00-00 00:00:00', 'complete', '{\"equipment_code\":\"54\",\"cleaning_status\":\"Satisfactory\",\"temp\":\"40\",\"humidity\":\"60\"}', '', 0, 'pending', '', 'complete', '{\"identication_qty\":\"50\",\"composite_qty\":80,\"reserve_composite\":200,\"additional_qty\":20,\"actual_indentification\":0,\"actual_composite\":220,\"withdrawal_identication\":\"50\",\"withdrawal_composite\":73.3299999999999982946974341757595539093017578125,\"reserve_qty\":80,\"start_time\":\"2023-08-31T09:12:56.019Z\",\"stop_date\":\"2023-08-31T09:13:21.547Z\",\"laf_start_date\":null,\"laf_stop_date\":\"2023-08-31T09:13:23.434Z\",\"container_no\":3,\"Remark\":\"ok\",\"lafOtion\":1,\"samplerId\":\"12\",\"undertest_qty\":73.3299999999999982946974341757595539093017578125,\"container_details\":[{\"container_no\":1,\"sample_qty\":0,\"reserve_qty\":24.443333333333331580661251791752874851226806640625,\"total_qty\":\"24.44\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":2,\"sample_qty\":0,\"reserve_qty\":24.443333333333331580661251791752874851226806640625,\"total_qty\":\"24.44\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"},{\"container_no\":3,\"sample_qty\":0,\"reserve_qty\":24.443333333333331580661251791752874851226806640625,\"total_qty\":\"24.44\",\"unit\":\"\",\"status\":\"done\",\"remarks\":\"\",\"remark\":\"ok\"}],\"checklist\":[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}],\"equipment_code\":\"\",\"checkPointData\":[],\"balance_eqip_code\":0,\"laf_eqip_code\":0}', 'approve', 'active', 'master', '2023-08-31', 'master', '2023-08-31 02:43:42', 'master', '2023-08-31 02:43:53', '\"\"', 'V10651', 0, '', '', '', '', '73.33', '', 'AR-05', '[{\"observation\":\"All are the containers properly segregated?\",\"check\":\"\"},{\"observation\":\"All are the containers properly Labeled (Supplier/Mfg., Approved label, Quarantine Label?\",\"check\":\"\"},{\"observation\":\"Is the information given on Quarantine label as per GRN?\",\"check\":\"\"},{\"observation\":\"Are there any damage/leakage/outer seals intact of the Drums/Containers/Bags?\",\"check\":\"\"},{\"observation\":\"Is sampling area properly cleaned\",\"check\":\"\"},{\"observation\":\"Is there any extraneous material observed on surface of Polybags\",\"check\":\"\"},{\"observation\":\"Are all the Drums/Containers sampled one by one and ls are closed properly after sampling?\",\"check\":\"\"},{\"observation\":\"Whether u201cSampledu201d labels with Container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether u201cSample for Analysisu201d labels with container No. are affix on polybags/Bottles containing sample?\",\"check\":\"\"},{\"observation\":\"Whether the used sampling tools are kept in Polybags and closed properly for transferring it to laboratory for cleaning?\",\"check\":\"\"},{\"observation\":\"Are all the safety precautions have been taken during Sampling?\",\"check\":\"\"},{\"observation\":\"Are all the containers taken for sampling kept back to designated places?\",\"check\":\"\"},{\"observation\":\"Whether tanker number mentioned in tanker receipt intimation is matched with tanker to be sampled?\",\"check\":\"\"},{\"observation\":\"Are the entire compartment sealed of tanker?\",\"check\":\"\"},{\"observation\":\"Is the tanker cleaning record available with tanker?\",\"check\":\"\"}]', '0', '', '2023-08-31 09:12:56', '2023-08-31 09:13:22', '', '', '73.33', '12', 'ok', 'approve');

--
-- Triggers `sampling`
--
DELIMITER $$
CREATE TRIGGER `sampling_no_insert` BEFORE INSERT ON `sampling` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM sampling ORDER BY id DESC LIMIT 1);
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.sampling_no = concat('S', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
