-- Table structure for table `em_investigation`
--

CREATE TABLE `em_investigation` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `emreport_no` varchar(25) NOT NULL,
  `intimation_date` date NOT NULL,
  `batch_no` varchar(50) NOT NULL,
  `description` varchar(500) NOT NULL,
  `given_by` int NOT NULL,
  `issue_by` varchar(25) NOT NULL,
  `status` varchar(20) NOT NULL,
  `inv_date` date NOT NULL,
  `remark` varchar(500) NOT NULL,
  `entry_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `engi_stock`
--

CREATE TABLE `engi_stock` (
  `id` int NOT NULL,
  `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,
  `grn_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` decimal(10,2) NOT NULL,
  `containers` decimal(10,2) NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `unit` 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 'Approved',
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `enquiry`
--

CREATE TABLE `enquiry` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `enquiry_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `i_no` int NOT NULL,
  `client_code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `through` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `region` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reference` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `country` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `products` text 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 'processing',
  `end_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complete_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complete_date` datetime DEFAULT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `enquiry_actions`
--

CREATE TABLE `enquiry_actions` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `enquiry_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `action` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `Environment`
--

CREATE TABLE `Environment` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `sampling_date` date NOT NULL,
  `medium_used` varchar(50) NOT NULL,
  `media_no` varchar(50) NOT NULL,
  `incubation_temp` varchar(50) NOT NULL,
  `incubation_id` varchar(50) NOT NULL,
  `incubation_start` varchar(50) NOT NULL,
  `incubation_end` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `environment`
--

CREATE TABLE `environment` (
  `id` int NOT NULL,
  `isolates` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `organism` 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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `environment_check`
--

CREATE TABLE `environment_check` (
  `id` int NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activity` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bmr_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(255) 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,
  `entry_time` time NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `env_isolate`
--

CREATE TABLE `env_isolate` (
  `id` int NOT NULL,
  `source` varchar(50) NOT NULL,
  `isolate_date` varchar(50) NOT NULL,
  `enrichment_obs_date` varchar(50) NOT NULL,
  `enrichment_observation` varchar(50) NOT NULL,
  `enrichment_positive` varchar(50) NOT NULL,
  `enrichment_negative` varchar(50) NOT NULL,
  `subcluture_obs_date` varchar(50) NOT NULL,
  `subcluture_observation` varchar(50) NOT NULL,
  `subcluture_positive` varchar(50) NOT NULL,
  `subcluture_negative` varchar(50) NOT NULL,
  `morphological_size` varchar(50) NOT NULL,
  `morphological_shape` varchar(50) NOT NULL,
  `morphological_color` varchar(50) NOT NULL,
  `morphological_elevation` varchar(50) NOT NULL,
  `morphological_margin` varchar(50) NOT NULL,
  `morphological_opacity` varchar(50) NOT NULL,
  `morphological_texture` varchar(50) NOT NULL,
  `gram_observation` varchar(50) NOT NULL,
  `identified_microorganism` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `plant_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `equipment`
--

CREATE TABLE `equipment` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '1',
  `equipment_category` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `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` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` decimal(10,2) 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_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Not Required',
  `preventive_maintenance` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `daily` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'false',
  `fourthnightly` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'false',
  `monthly` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'false',
  `quarterly` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'false',
  `half_yearly` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'false',
  `yearly` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'false',
  `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,
  `preventive` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `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,
  `reqv_required` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requalification` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `revalidation` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_name` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `calibration_frequency` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `calibration_frequency_inhouse` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `calibration_frequency_external` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `revalidation_frequency` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `split_into` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `weights` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `previous_preventive` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `calibration_required` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lastcalibration_date` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inpection_freequency` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `prev_maint_frequency` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `last_inspection_date` date NOT NULL,
  `last_prev_maint_date` date NOT NULL,
  `working_capacity` varchar(900) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `equipment`
--

INSERT INTO `equipment` (`id`, `user_no`, `plant_id`, `equipment_category`, `equipment_type`, `equipment_code`, `equipment_name`, `make`, `capacity`, `min_capacity`, `max_capacity`, `unit`, `category`, `department`, `section`, `purchase_date`, `installation_date`, `model`, `equipment_sr_no`, `equipment_used`, `e_no1`, `status`, `entry_by`, `entry_date`, `approve_by`, `approve_date`, `calibration_type`, `preventive_maintenance`, `daily`, `fourthnightly`, `monthly`, `quarterly`, `half_yearly`, `yearly`, `calibration_parameter`, `process`, `preventive`, `from_range`, `from_range_uom`, `to_range`, `to_range_uom`, `reqv_required`, `requalification`, `revalidation`, `plant_name`, `location`, `type`, `calibration_frequency`, `calibration_frequency_inhouse`, `calibration_frequency_external`, `revalidation_frequency`, `split_into`, `weights`, `previous_preventive`, `calibration_required`, `lastcalibration_date`, `inpection_freequency`, `prev_maint_frequency`, `last_inspection_date`, `last_prev_maint_date`, `working_capacity`) VALUES
(67, 'gmpdemo1', '60', 'New', 'Dust Collector', '001', 'Vaccum1', '', 0.00, '', '', '', 'Fix', 'Store', '', '0000-00-00', '0000-00-00', '', '', NULL, 0, 'approve', 'master', '2023-08-02 14:57:18', '', NULL, '', '', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', '', '', '', '', 'location', '', '', 'null', 'null', '', '', 'null', '', '', '', '', '', '0000-00-00', '0000-00-00', ''),
(68, 'gmpdemo1', '60', 'New', 'Balance(Weighing)', '002', 'Bal001', '', 0.00, '', '', '', 'Fix', 'Store', '', '0000-00-00', '0000-00-00', '', '', NULL, 0, 'approve', 'master', '2023-08-02 15:03:59', '', NULL, '', '', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', '', '', '', '', 'location', '', '', 'null', 'null', '', '', 'null', '', '', '', '', '', '0000-00-00', '0000-00-00', ''),
(69, 'gmpdemo1', '60', 'New', 'Balance(Weighing)', '003', 'Bal02', '99', 0.00, '', '', '', 'Fix', 'Store', '', '0000-00-00', '0000-00-00', '99', '', NULL, 0, 'approve', 'master', '2023-08-02 15:16:26', '', NULL, 'Inhouse', 'Applicable', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', '', '', '', '', 'location', '', '', 'null', 'null', '', '', 'null', '', 'Yes', '', '', '', '0000-00-00', '0000-00-00', ''),
(70, 'gmpdemo1', '60', 'New', 'Balance(Weighing)', '004', 'Balance', '', 0.00, '', '', '', 'Fix', 'Store', '', '0000-00-00', '0000-00-00', '', '', NULL, 0, 'approve', 'master', '2023-08-02 15:40:17', '', NULL, '', '', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', '', '', '', '', 'location', '', '', 'null', 'null', '', '', 'null', '', '', '', '', '', '0000-00-00', '0000-00-00', ''),
(71, 'gmpdemo1', '60', 'New', 'LAF', '54', 'equ1', '', 0.00, '', '', '', 'Fix', 'Quality Control', '', '0000-00-00', '0000-00-00', '', '', NULL, 0, 'approve', 'master', '2023-08-02 18:02:57', '', NULL, '', '', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', '', '', '', '', 'location', '', '', 'null', 'null', '', '', 'null', '', '', '', '', '', '0000-00-00', '0000-00-00', ''),
(72, 'gmpdemo1', '60', 'New', 'Sampling Equipment', '12', 'Samp equ.', '', 0.00, '', '', '', 'Fix', 'Quality Control', '', '0000-00-00', '0000-00-00', '', '', NULL, 0, 'approve', 'master', '2023-08-03 14:49:50', '', NULL, '', '', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', '', '', '', '', 'location', '', '', 'null', 'null', '', '', 'null', '', '', '', '', '', '0000-00-00', '0000-00-00', ''),
(73, 'gmpdemo1', '60', 'New', 'Sampling Equipment', 'E006', 'Test', '4', 0.00, '', '', '', 'Fix', 'Quality Control', '', '2023-08-24', '0000-00-00', '5', '', NULL, 0, 'approve', 'master', '2023-08-31 14:28:59', '', NULL, 'Inhouse', 'Applicable', 'false', 'false', 'false', 'false', 'false', 'false', 'pending', '', 'pending', 0.00, '', 0.00, '', 'Requalific', 'Half Annual', '', '', 'location', '', '', '[{\"name\":\"Daily Calibration\"}]', 'null', '', '', 'null', '', 'Yes', '', '', '', '0000-00-00', '0000-00-00', '');

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

--
-- Table structure for table `equipments1`
--

CREATE TABLE `equipments1` (
  `id` int NOT NULL,
  `department` varchar(100) NOT NULL,
  `equipment_code` int NOT NULL,
  `equipment_name` varchar(100) NOT NULL,
  `equipment_sr_no` int NOT NULL,
  `capacity` varchar(100) NOT NULL,
  `unit` int NOT NULL,
  `location` varchar(100) NOT NULL,
  `description` varchar(100) NOT NULL,
  `make` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `equipment_cleaning`
--

CREATE TABLE `equipment_cleaning` (
  `id` int NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `equipment_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `clean_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cleaning_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `clean_from` datetime NOT NULL,
  `clean_to` datetime 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,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `equipment_maintenance`
--

CREATE TABLE `equipment_maintenance` (
  `id` int NOT NULL,
  `due_type` varchar(50) NOT NULL,
  `frequency` varchar(25) NOT NULL,
  `equipment_id` int NOT NULL,
  `due_date` date NOT NULL,
  `checklist` text NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `equipment_names`
--

CREATE TABLE `equipment_names` (
  `id` int NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `equipment_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'General',
  `equipment_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `format_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inspection_format` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Monthly` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'NO',
  `monthly_checklist` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quaterly_checklist` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `yearly_checklist` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Quarterly` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'NO',
  `Yearly` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'NO',
  `inspection` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'NO',
  `preventive` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `checklist` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inspection_checklist` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preventive_frequency` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preventive_entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preventive_entry_date` datetime DEFAULT NULL,
  `preventive_approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preventive_approve_date` datetime DEFAULT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `equipment_requirement`
--

CREATE TABLE `equipment_requirement` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `vendor_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expected_output` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipments_no` int 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,
  `dq_status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `dq_file` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `specifications` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_by` varchar(100) 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 `equipment_usages`
--

CREATE TABLE `equipment_usages` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `bmr_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `operator` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activity` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `usage_from` datetime NOT NULL,
  `usage_to` datetime NOT NULL,
  `stop_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stop_date` date DEFAULT 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,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `etp_inprocess`
--

CREATE TABLE `etp_inprocess` (
  `id` int NOT NULL,
  `ti_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `previous_product` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `next_product` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sample_from` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `etp_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sample_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(20) 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,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `tests` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `send_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `send_date` date NOT NULL,
  `send_time` time NOT NULL,
  `analysis_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `analysis_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `euipment_prevent_checklist_dtl`
--

CREATE TABLE `euipment_prevent_checklist_dtl` (
  `id` int NOT NULL,
  `hdr_id` int NOT NULL,
  `check_point` varchar(150) NOT NULL,
  `description` varchar(250) NOT NULL,
  `evaluation_parameter` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `euipment_prevent_checklist_hdr`
--

CREATE TABLE `euipment_prevent_checklist_hdr` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `ch_id` varchar(20) NOT NULL,
  `department` varchar(50) NOT NULL,
  `equipment_name` varchar(50) NOT NULL,
  `equipment_id` varchar(50) NOT NULL,
  `frequency_type` varchar(25) NOT NULL,
  `frequency` varchar(25) NOT NULL,
  `partname` varchar(50) NOT NULL,
  `entry_by` varchar(25) NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `excavation`
--

CREATE TABLE `excavation` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department_from` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department_to` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `details_work` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `validity_from` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `validity_to` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `conditions` 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,
  `check_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime NOT NULL,
  `approve_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL,
  `comment` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `expense`
--

CREATE TABLE `expense` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `category` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pay_mode` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `amount` decimal(10,0) NOT NULL,
  `particulars` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `notes` 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,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `expense_categories`
--

CREATE TABLE `expense_categories` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `user_no` varchar(50) NOT NULL DEFAULT 'gmpdemo1',
  `category` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `externaltrainer`
--

CREATE TABLE `externaltrainer` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `trainer_type` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL,
  `trainer_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qualification` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `organisation` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `experience` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contact_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `certificate` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `resume` 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` date NOT NULL,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `factory_primises`
--

CREATE TABLE `factory_primises` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `date` date NOT NULL,
  `road` varchar(50) NOT NULL,
  `wall` varchar(50) NOT NULL,
  `drainage` varchar(50) NOT NULL,
  `done_by` varchar(50) NOT NULL,
  `checked_by` varchar(50) NOT NULL,
  `remark` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `fg_stock_book`
--

CREATE TABLE `fg_stock_book` (
  `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',
  `inword_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inword_date` date NOT NULL,
  `grn_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `ar_no` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stock_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Normal',
  `market_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `manufacturer_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `lod_per` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `rate_per` 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,
  `containers` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `receiving_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grn_date` date NOT NULL,
  `release_date` date NOT NULL,
  `retest_date` date NOT NULL,
  `assay` decimal(10,2) NOT NULL,
  `required_for` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `section` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rack_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'quarantine',
  `pack_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tare_wt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `total_containers` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `undertest_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dispatch_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dis_client` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dispatch_date` date NOT NULL,
  `closing_stock` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `yield` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `finish_indend`
--

CREATE TABLE `finish_indend` (
  `id` int NOT NULL,
  `user_no` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `indend_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dosage_type` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dosage_form` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `size` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grade` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `req_qty` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requirement` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purpose` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor_no` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `required_for` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `required_days` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` 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` datetime NOT NULL,
  `no` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `quotation_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quotation_amt` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `quotation_per` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci 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,
  `approve_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expected_vendor` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_indend` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `finish_indend`
--
DELIMITER $$
CREATE TRIGGER `indend_finish_no` BEFORE INSERT ON `finish_indend` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `finish_product`
--

CREATE TABLE `finish_product` (
  `id` int NOT NULL,
  `stock_type` 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,
  `batch_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mfg_date` date NOT NULL,
  `exp_date` date NOT NULL,
  `batch_size` decimal(10,2) NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pack_size` decimal(10,2) NOT NULL,
  `pack_unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `yield_percent` decimal(10,2) NOT NULL,
  `materials` 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,
  `batch_release` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `market_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rel_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `fire_extinguisher`
--

CREATE TABLE `fire_extinguisher` (
  `id` int NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `size` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fire_class` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `refill_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frequency` 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 DEFAULT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `fisrt_aid`
--

CREATE TABLE `fisrt_aid` (
  `id` int NOT NULL,
  `entry_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `department` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `aider` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `employee` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(52) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `incident` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `details` varchar(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `treatment` varchar(51) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `treatment_accept` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `incident_date` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `item_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `available_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `consum_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bal_qty` 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',
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `fogging`
--

CREATE TABLE `fogging` (
  `id` int NOT NULL,
  `fumigation_agent` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `conentration` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `volume_fumigent` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `volime_water` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `final_volume` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `area` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `laf_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `priamry_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `airlock1` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `airlock2` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `in_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `de_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `st_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `media_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `corridor` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `secondary_room` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `airlock` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `due_date` date NOT NULL,
  `done_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` datetime NOT NULL,
  `ahu5_of` time NOT NULL,
  `ahu5_on` time NOT NULL,
  `ahu6_of` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ahu6_on` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fumigation_time` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `formulas`
--

CREATE TABLE `formulas` (
  `id` int NOT NULL,
  `formula_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `image` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `parameters` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `frequency_master`
--

CREATE TABLE `frequency_master` (
  `id` int NOT NULL,
  `entry_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `type` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frequency` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `deviation_after` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `gardan_plant`
--

CREATE TABLE `gardan_plant` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `plant_name` varchar(100) NOT NULL,
  `count` varchar(100) NOT NULL,
  `plantation_date` date NOT NULL,
  `plant_age` int NOT NULL,
  `i_no1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `gardan_resource`
--

CREATE TABLE `gardan_resource` (
  `id` int NOT NULL,
  `resource_id` int NOT NULL,
  `date` date NOT NULL,
  `required_resources` varchar(100) NOT NULL,
  `details` varchar(100) NOT NULL,
  `required_urgent` varchar(100) NOT NULL,
  `required_usual` varchar(100) NOT NULL,
  `i_no1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `gatepass`
--

CREATE TABLE `gatepass` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `pass_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `photo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `company` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mobile` bigint NOT NULL,
  `meeting_with` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `reason1` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purpose` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `address` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `other_purpose` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `other_meeting` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `other_present_country` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `in_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `out_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT ' ',
  `inentry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `outentry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci 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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `gaussmeter_test`
--

CREATE TABLE `gaussmeter_test` (
  `id` int NOT NULL,
  `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,
  `rod_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `magnetic_field` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `general_material`
--

CREATE TABLE `general_material` (
  `id` int NOT NULL,
  `material_sub_type_id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `general_material_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_subtype` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hsn` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gst_id` int 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` date NOT NULL,
  `unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lead_time` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exceed_limit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_type` varchar(35) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipment_capacity` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity_unit` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_of_construction` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `part_size` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `general_material`
--
DELIMITER $$
CREATE TRIGGER `genaral` BEFORE INSERT ON `general_material` FOR EACH ROW BEGIN
SET @cur_year = DATE_FORMAT(CURDATE(), '%y');
SET @lastID = (SELECT id FROM general_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('GM',LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `general_primises`
--

CREATE TABLE `general_primises` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `date` date NOT NULL,
  `ceilings` varchar(50) NOT NULL,
  `windows` varchar(50) NOT NULL,
  `doors` varchar(50) NOT NULL,
  `done_by` varchar(50) NOT NULL,
  `checked_by` varchar(50) NOT NULL,
  `remark` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `glassware`
--

CREATE TABLE `glassware` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `glassware_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` decimal(10,2) 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,
  `gst` decimal(10,2) NOT NULL,
  `hsn` 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(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,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `glassware`
--

INSERT INTO `glassware` (`id`, `user_no`, `glassware_no`, `name`, `capacity`, `unit`, `glassware_class`, `description`, `make`, `gst`, `hsn`, `status`, `entry_by`, `entry_date`, `approve_by`, `approve_date`, `plant_id`) VALUES
(10, 'gmpdemo1', 'G10001', 'test', 3.00, 'ml', 'type A', 'test', '', 12.00, '4244', 'pending', 'master', '2023-08-02 05:42:24', '', NULL, '60');

--
-- Triggers `glassware`
--
DELIMITER $$
CREATE TRIGGER `glassware_no_insert` BEFORE INSERT ON `glassware` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM 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 `glassware_cleaning`
--

CREATE TABLE `glassware_cleaning` (
  `id` int NOT NULL,
  `glassware_no` int NOT NULL,
  `cleaning_from` varchar(50) NOT NULL,
  `cleaning_to` varchar(50) NOT NULL,
  `dry_from` varchar(50) NOT NULL,
  `dry_to` varchar(50) NOT NULL,
  `done_by` varchar(50) NOT NULL,
  `check_by` varchar(50) NOT NULL,
  `remark` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `gmp_monitoring_checklist`
--

CREATE TABLE `gmp_monitoring_checklist` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `gmp_id` int NOT NULL,
  `department` varchar(100) NOT NULL,
  `area` varchar(100) NOT NULL,
  `section` varchar(100) NOT NULL,
  `checkpoint` varchar(50) NOT NULL,
  `entry_date` date NOT NULL,
  `created_by` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `gmp_monitoring_checkpoints`
--

CREATE TABLE `gmp_monitoring_checkpoints` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `checkpoint_id` int NOT NULL,
  `checkpoint` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `govagency`
--

CREATE TABLE `govagency` (
  `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',
  `authority_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `address` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `office_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `phone_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,
  `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;

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

--
-- Table structure for table `grade`
--

CREATE TABLE `grade` (
  `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',
  `grade` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `phamacopoeia_name` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'active',
  `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;

--
-- Dumping data for table `grade`
--

INSERT INTO `grade` (`id`, `plant_id`, `user_no`, `grade`, `phamacopoeia_name`, `status`, `entry_by`, `entry_date`) VALUES
(80, '60', 'gmpdemo1', 'IP', 'Indian Pharmacopoeia', 'active', 'master', '2023-08-02'),
(81, '60', 'gmpdemo1', 'BP', 'British Pharmacopoeia', 'active', 'master', '2023-08-02'),
(82, '60', 'gmpdemo1', 'USP', 'United States Pharmacopei', 'active', 'master', '2023-08-02'),
(83, '60', 'gmpdemo1', 'Food Grade ', '', 'active', 'master', '2023-08-04');

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

--
-- Table structure for table `gst_per`
--

CREATE TABLE `gst_per` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst_type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gst` decimal(2,0) NOT NULL,
  `igst` decimal(5,2) NOT NULL,
  `cgst` decimal(5,2) NOT NULL,
  `sgst` decimal(5,2) NOT NULL,
  `description` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approve',
  `entry_by` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `gst_per`
--

INSERT INTO `gst_per` (`id`, `plant_id`, `gst_type`, `gst`, `igst`, `cgst`, `sgst`, `description`, `status`, `entry_by`, `entry_date`) VALUES
(117, '60', '', 12, 0.00, 0.00, 0.00, 'undefined + undefine', 'approve', 'master', '2023-08-02 02:56:27'),
(118, '60', '', 18, 0.00, 0.00, 0.00, 'undefined + undefine', 'approve', 'master', '2023-08-02 02:56:30'),
(119, '60', '', 8, 0.00, 0.00, 0.00, 'undefined + undefine', 'approve', 'master', '2023-08-02 02:56:38');

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

--
-- Table structure for table `hdpe_cleaning`
--

CREATE TABLE `hdpe_cleaning` (
  `id` int NOT NULL,
  `rinse` varchar(50) NOT NULL,
  `cleaning_time` time NOT NULL,
  `cleaning_by` varchar(50) NOT NULL,
  `remark` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL,
  `entry_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `hot_water`
--

CREATE TABLE `hot_water` (
  `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,
  `date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department_from` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department_to` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `details_work` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `validity_from` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `validity_to` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `conditions` 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,
  `check_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime NOT NULL,
  `approve_by` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime NOT NULL,
  `comment` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `housekeeping_management`
--

CREATE TABLE `housekeeping_management` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `material_id` int NOT NULL DEFAULT '20',
  `material` varchar(50) NOT NULL,
  `no_required` int NOT NULL,
  `company` varchar(100) NOT NULL,
  `details` varchar(100) NOT NULL,
  `checked_by` varchar(50) NOT NULL,
  `i_no1` int NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'approve'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `hplc`
--

CREATE TABLE `hplc` (
  `id` int NOT NULL,
  `column_no` varchar(50) 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` decimal(10,2) NOT NULL,
  `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `length` 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 NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `hplc`
--
DELIMITER $$
CREATE TRIGGER `hplc_column_no` BEFORE INSERT ON `hplc` FOR EACH ROW BEGIN

SET @lastID = (SELECT id FROM 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.column_no = concat('HC', LPAD(CONVERT(@lastID, CHAR), 4, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `hygine`
--

CREATE TABLE `hygine` (
  `id` int NOT NULL,
  `entry_date` date NOT NULL,
  `name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `garments` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `jewellery` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `hairs` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `nails` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fever` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `eye` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `eatables` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sanitize` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `incident`
--

CREATE TABLE `incident` (
  `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',
  `incident_no` varchar(6) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `document_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `document_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `related_to` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `type` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `classification` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `immediate_action` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `initiate_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `initiate_date` date NOT NULL,
  `investigation` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `impact_assessment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `other_assessment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `corrective_action` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preventive_action` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `customer_notification` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qa_comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `reject_reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `check_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `verify_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `verify_date` datetime DEFAULT NULL,
  `verify_remark` text 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,
  `approve_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `close_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `close_date` datetime NOT NULL,
  `capa` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `capa_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `isextension` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension_in` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension_justification` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `completion_date` date NOT NULL,
  `extension_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension_date` datetime DEFAULT NULL,
  `extension_verify_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `extension_verify_date` datetime DEFAULT NULL,
  `evaluate1_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `evaluate1_date` datetime DEFAULT NULL,
  `evaluate1_comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `evaluate2_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `evaluate2_date` datetime DEFAULT NULL,
  `evaluate2_comment` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `justification` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cause` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `affecting_product` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `affecting_equipment` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_details` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equip_details` 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` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `incident`
--
DELIMITER $$
CREATE TRIGGER `incident_no_insert` BEFORE INSERT ON `incident` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `incident_comments`
--

CREATE TABLE `incident_comments` (
  `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',
  `incident_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` text 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 DEFAULT NULL,
  `inc_no` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `incident_files`
--

CREATE TABLE `incident_files` (
  `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,
  `incident_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `particular` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `file` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `incoming_courier`
--

CREATE TABLE `incoming_courier` (
  `id` int NOT NULL,
  `date` date NOT NULL,
  `party_name` varchar(50) NOT NULL,
  `courier_name` varchar(50) NOT NULL,
  `docket_no` varchar(50) NOT NULL,
  `receiver_name` varchar(50) NOT NULL,
  `plant_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `incubator_bod_usage`
--

CREATE TABLE `incubator_bod_usage` (
  `id` int NOT NULL,
  `equipment_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activity` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `date_on` date NOT NULL,
  `time_on` time NOT NULL,
  `remark` 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(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `complete_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complete_date` date DEFAULT NULL,
  `complete_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `incubator_usage`
--

CREATE TABLE `incubator_usage` (
  `id` int NOT NULL,
  `equipment_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activity` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `date_on` date NOT NULL,
  `time_on` time NOT NULL,
  `done_on` varchar(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `remark` 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(22) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime NOT NULL,
  `complete_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `complete_date` date DEFAULT NULL,
  `complete_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `indend_chemical`
--

CREATE TABLE `indend_chemical` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) NOT NULL DEFAULT 'pending',
  `indend_no` varchar(10) NOT NULL,
  `chemical_no` varchar(10) NOT NULL,
  `req_qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) NOT NULL,
  `requirement` varchar(20) NOT NULL,
  `purpose` varchar(20) NOT NULL,
  `expected_vendor` varchar(10) NOT NULL,
  `required_for` varchar(20) NOT NULL,
  `client_code` varchar(10) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `department` varchar(50) NOT NULL,
  `check_by` varchar(10) NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `vendor_no` varchar(10) NOT NULL,
  `quotation_no` varchar(10) NOT NULL,
  `quotation_amt` decimal(10,2) NOT NULL,
  `quotation_per` varchar(10) NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `gst_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `approve_by` varchar(10) NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `manufacturer_no` varchar(30) NOT NULL,
  `no` varchar(30) NOT NULL,
  `order_qty` varchar(30) NOT NULL,
  `po_indend` varchar(30) NOT NULL DEFAULT 'pending',
  `other_purpose` varchar(60) NOT NULL,
  `purchase_type` varchar(50) NOT NULL DEFAULT 'Local Purchase',
  `tax_type` varchar(50) NOT NULL DEFAULT 'GST'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `indend_equipment`
--

CREATE TABLE `indend_equipment` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) NOT NULL DEFAULT 'pending',
  `indend_no` varchar(10) NOT NULL,
  `equipment_type` varchar(50) NOT NULL,
  `equipment_for` varchar(10) NOT NULL,
  `equipment_name` varchar(255) NOT NULL,
  `capacity` varchar(100) NOT NULL,
  `unit` varchar(10) NOT NULL,
  `req_qty` decimal(10,2) NOT NULL,
  `requirement` varchar(20) NOT NULL,
  `purpose` varchar(20) NOT NULL,
  `expected_vendor` varchar(10) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `department` varchar(50) NOT NULL,
  `check_by` varchar(10) NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `approve_by` varchar(10) NOT NULL,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Triggers `indend_equipment`
--
DELIMITER $$
CREATE TRIGGER `indend_equipment_no_insert` BEFORE INSERT ON `indend_equipment` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `indend_general`
--

CREATE TABLE `indend_general` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) NOT NULL DEFAULT 'pending',
  `indend_no` varchar(10) NOT NULL,
  `material_code` varchar(10) NOT NULL,
  `req_qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) NOT NULL,
  `requirement` varchar(20) NOT NULL,
  `purpose` varchar(20) NOT NULL,
  `expected_vendor` varchar(10) NOT NULL,
  `required_for` varchar(20) NOT NULL,
  `client_code` varchar(10) NOT NULL,
  `make` varchar(100) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `department` varchar(50) NOT NULL,
  `check_by` varchar(10) NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `vendor_no` varchar(10) NOT NULL,
  `quotation_no` varchar(10) NOT NULL,
  `quotation_amt` decimal(10,2) NOT NULL,
  `quotation_per` varchar(10) NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `gst_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `approve_by` varchar(10) NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `no` varchar(20) NOT NULL,
  `vendor_type` varchar(30) NOT NULL,
  `manufacturer_no` varchar(20) NOT NULL,
  `specific_vendor` varchar(20) NOT NULL,
  `material_nature` varchar(20) NOT NULL,
  `exp_date` varchar(20) NOT NULL,
  `order_qty` varchar(20) NOT NULL,
  `po_indend` varchar(30) NOT NULL DEFAULT 'pending',
  `purchase_type` varchar(50) NOT NULL DEFAULT 'Local Purchase',
  `tax_type` varchar(50) NOT NULL DEFAULT 'GST'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `indend_glassware`
--

CREATE TABLE `indend_glassware` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) NOT NULL DEFAULT 'pending',
  `indend_no` varchar(10) NOT NULL,
  `glassware_no` varchar(10) NOT NULL,
  `req_qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) NOT NULL,
  `requirement` varchar(20) NOT NULL,
  `purpose` varchar(20) NOT NULL,
  `expected_vendor` varchar(10) NOT NULL,
  `required_for` varchar(20) NOT NULL,
  `client_code` varchar(10) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `department` varchar(50) NOT NULL,
  `check_by` varchar(10) NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `vendor_no` varchar(10) NOT NULL,
  `quotation_no` varchar(10) NOT NULL,
  `quotation_amt` decimal(10,2) NOT NULL,
  `quotation_per` varchar(10) NOT NULL,
  `make` varchar(30) NOT NULL,
  `qty` decimal(10,2) NOT NULL,
  `order_qty` varchar(10) NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `gst_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `approve_by` varchar(10) NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `no` varchar(20) NOT NULL,
  `manufacturer_no` varchar(30) NOT NULL,
  `po_indend` varchar(50) NOT NULL DEFAULT 'pending',
  `purchase_type` varchar(50) NOT NULL DEFAULT 'Local Purchase',
  `tax_type` varchar(50) NOT NULL DEFAULT 'GST'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `indend_packing`
--

CREATE TABLE `indend_packing` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `indend_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `req_qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `requirement` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `purpose` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `expected_vendor` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `required_for` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `client_code` 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` datetime NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `make` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime DEFAULT 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,
  `qty` decimal(10,2) NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `gst_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `approve_by` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `vendor_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `manufacturer_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `specific_vendor` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_nature` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `exp_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_subtype` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sub_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sub_category` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `printing_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `vendor` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `order_qty` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `po_indend` varchar(50) NOT NULL DEFAULT 'pending',
  `other_purpose` varchar(60) NOT NULL,
  `purchase_type` varchar(50) NOT NULL DEFAULT 'Local Purchase',
  `tax_type` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `indend_raw`
--

CREATE TABLE `indend_raw` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `user_no` varchar(10) NOT NULL DEFAULT 'pending',
  `no` varchar(22) NOT NULL,
  `request_no` varchar(10) NOT NULL,
  `indend_no` varchar(10) NOT NULL,
  `material_type` varchar(50) NOT NULL,
  `material_code` varchar(10) NOT NULL,
  `material_id` int NOT NULL,
  `req_qty` decimal(10,2) NOT NULL,
  `unit` varchar(10) NOT NULL,
  `requirement` varchar(20) NOT NULL,
  `purpose` varchar(20) NOT NULL,
  `expected_vendor` varchar(10) NOT NULL,
  `required_for` varchar(20) NOT NULL,
  `client_code` varchar(10) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `department` varchar(50) NOT NULL,
  `check_by` varchar(10) NOT NULL,
  `check_date` datetime DEFAULT NULL,
  `vendor_no` varchar(20) NOT NULL,
  `quotation_no` varchar(10) NOT NULL,
  `quotation_amt` decimal(10,2) NOT NULL,
  `quotation_per` varchar(10) NOT NULL,
  `qty` decimal(10,0) NOT NULL,
  `gst` decimal(10,2) NOT NULL,
  `gross_total` decimal(10,2) NOT NULL,
  `gst_total` decimal(10,2) NOT NULL,
  `net_total` decimal(10,2) NOT NULL,
  `approve_by` varchar(10) NOT NULL,
  `approve_date` datetime DEFAULT NULL,
  `material_nature` varchar(22) NOT NULL,
  `material_subtype` varchar(50) NOT NULL,
  `vendor_type` int NOT NULL,
  `manufacturer_no` varchar(40) NOT NULL,
  `specific_vendor` varchar(40) NOT NULL,
  `exp_date` date NOT NULL,
  `order_qty` varchar(20) NOT NULL,
  `po_indend` varchar(50) NOT NULL DEFAULT 'pending',
  `other_purpose` varchar(60) NOT NULL,
  `purchase_type` varchar(50) NOT NULL DEFAULT 'Local Purchase',
  `tax_type` varchar(50) NOT NULL DEFAULT 'GST'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `indend_raw`
--

INSERT INTO `indend_raw` (`id`, `plant_id`, `user_no`, `no`, `request_no`, `indend_no`, `material_type`, `material_code`, `material_id`, `req_qty`, `unit`, `requirement`, `purpose`, `expected_vendor`, `required_for`, `client_code`, `status`, `entry_by`, `entry_date`, `department`, `check_by`, `check_date`, `vendor_no`, `quotation_no`, `quotation_amt`, `quotation_per`, `qty`, `gst`, `gross_total`, `gst_total`, `net_total`, `approve_by`, `approve_date`, `material_nature`, `material_subtype`, `vendor_type`, `manufacturer_no`, `specific_vendor`, `exp_date`, `order_qty`, `po_indend`, `other_purpose`, `purchase_type`, `tax_type`) VALUES
(516, '60', 'gmpdemo1', '20230802124732', 'RQ0001', 'RM0001', 'Raw Material', 'RM00012', 635, 100.00, 'Kg', 'Regular', 'Testing', '', 'Own', '', 'approve', 'master', '2023-08-02 12:47:32', 'Store', '', NULL, 'V10001', '', 400.00, '', 0, 12.00, 40000.00, 4800.00, 44800.00, 'master', '2023-08-02 12:47:42', '', 'Raw material', 0, 'Array', '', '0000-00-00', '100', 'Approve', '', 'Local Purchase', 'GST'),
(517, '60', 'gmpdemo1', '20230803160122', 'RQ0002', 'RM0002', 'Raw Material', 'RM00013', 636, 300.00, 'Kg', 'Regular', 'Production', '', 'Own', '', 'approve', 'master', '2023-08-03 04:01:22', 'Store', '', NULL, 'V10646', '', 520.00, '', 0, 18.00, 156000.00, 28080.00, 184080.00, 'master', '2023-08-03 04:01:37', '', 'Raw material', 0, '', '', '0000-00-00', '300', 'Approve', '', 'Local Purchase', 'GST'),
(518, '60', 'gmpdemo1', '20230807170634', 'RQ0003', 'RM0003', 'Raw Material', 'RM00014', 637, 200.00, 'Kg', 'Urgent', 'Testing', '', 'Own', '', 'approve', 'master', '2023-08-07 05:06:34', 'Store', '', NULL, 'V10647', '', 200.00, '', 0, 7.00, 40000.00, 2800.00, 42800.00, 'master', '2023-08-07 05:07:06', '', 'Raw material', 0, 'Array', '', '0000-00-00', '200', 'Approve', '', 'Local Purchase', 'GST'),
(519, '60', 'gmpdemo1', '20230808153218', 'RQ0004', 'RM0004', 'Raw Material', 'RM00015', 638, 300.00, 'Kg', 'Urgent', 'Testing', '', 'Own', '', 'approve', 'master', '2023-08-08 03:32:18', 'Store', '', NULL, 'V10648', '', 300.00, '', 0, 6.00, 60000.00, 3600.00, 63600.00, 'master', '2023-08-08 03:32:39', '', 'Raw material', 0, 'Array', '', '0000-00-00', '200', 'Approve', '', 'Local Purchase', 'GST'),
(520, '60', 'gmpdemo1', '20230831120535', 'RQ0005', 'RM0005', 'Raw Material', 'RM000653', 643, 500.00, 'Kg', 'Urgent', 'Testing', '', 'Own', '', 'approve', 'master', '2023-08-31 12:05:35', 'Store', '', NULL, 'V10651', '', 200.00, '', 0, 4.00, 60000.00, 2400.00, 62400.00, 'master', '2023-08-31 12:05:47', '', 'Raw material', 0, 'Array', '', '0000-00-00', '300', 'Approve', '', 'Local Purchase', 'GST');

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

--
-- Table structure for table `indicator`
--

CREATE TABLE `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` decimal(10,2) NOT NULL,
  `pka` 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,
  `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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `indicator`
--
DELIMITER $$
CREATE TRIGGER `indicator_no_insert` BEFORE INSERT ON `indicator` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `induction`
--

CREATE TABLE `induction` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activities` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime NOT NULL,
  `learning` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `equipments` 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,
  `approve_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `ini_mfr`
--

CREATE TABLE `ini_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;

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

--
-- Table structure for table `inprocess_check`
--

CREATE TABLE `inprocess_check` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activity` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bmr_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `stage` varchar(255) 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,
  `entry_time` time NOT NULL,
  `check_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `inprocess_sampling`
--

CREATE TABLE `inprocess_sampling` (
  `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,
  `batch_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `batch_size` int NOT NULL,
  `lot_no` int NOT NULL,
  `stage` 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',
  `request_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `request_date` datetime NOT NULL,
  `sampled_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `sampled_date` datetime NOT NULL,
  `check_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `check_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `inspection_plan`
--

CREATE TABLE `inspection_plan` (
  `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',
  `p_id` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `from_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `to_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inspection_requirement` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qc` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `qa` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `production` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `store` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `rnd` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `ipqa` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'no',
  `proposal_outcome` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `accept_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `p_id1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `instructions`
--

CREATE TABLE `instructions` (
  `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,
  `product_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `instructions` 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 `instruments`
--

CREATE TABLE `instruments` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `instrument_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `location` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tag_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `instrument_from` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `instrument_to` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `operating_from` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `operating_to` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tolerance_from` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tolerance_to` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frequency` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `calibration_mode` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'approve',
  `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;

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

--
-- Table structure for table `interviewers`
--

CREATE TABLE `interviewers` (
  `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',
  `candidate_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `employee` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `emp_status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `college_name` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `passing_year` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `experience_year` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `experience_month` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `key_role` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `no_of_members` int DEFAULT NULL,
  `family_occupation` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `financial_background` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `attitude` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `confidence` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `willingness` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `data` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `rating` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `interviewers`
--

INSERT INTO `interviewers` (`id`, `plant_id`, `user_no`, `candidate_id`, `department`, `designation`, `employee`, `emp_status`, `college_name`, `passing_year`, `experience_year`, `experience_month`, `key_role`, `no_of_members`, `family_occupation`, `financial_background`, `attitude`, `confidence`, `willingness`, `remark`, `data`, `rating`) VALUES
(103, '', 'gmpdemo1', '76', 'Engineering', 'EXECUTIVE', 'master', 'pending', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 0.00);

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

--
-- Table structure for table `investigation_report`
--

CREATE TABLE `investigation_report` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `material_code` varchar(25) NOT NULL,
  `initiation_date` date NOT NULL,
  `investigation_type` varchar(50) NOT NULL,
  `investigation_reportno` varchar(500) NOT NULL,
  `sample_type` int NOT NULL,
  `sample_date` date NOT NULL,
  `sampling_point` varchar(20) NOT NULL,
  `area` varchar(25) NOT NULL,
  `grade` varchar(50) NOT NULL,
  `water_type` varchar(50) NOT NULL,
  `ar_no` varchar(50) NOT NULL,
  `standard_limit` varchar(50) NOT NULL,
  `alter_limit` varchar(50) NOT NULL,
  `action_limit` varchar(50) NOT NULL,
  `result` varchar(50) NOT NULL,
  `product_details` varchar(50) NOT NULL,
  `product_code` varchar(50) NOT NULL,
  `product_type` varchar(50) NOT NULL,
  `batch_no` varchar(50) NOT NULL,
  `investigaton_date` date NOT NULL,
  `mfg_date` varchar(50) NOT NULL,
  `in_startdate` date NOT NULL,
  `description` varchar(50) NOT NULL,
  `ass_batch_no` varchar(50) NOT NULL,
  `ass_item_code` varchar(50) NOT NULL,
  `ass_material` varchar(50) NOT NULL,
  `ass_event` varchar(50) NOT NULL,
  `ass_product` varchar(50) NOT NULL,
  `classification` varchar(50) NOT NULL,
  `regular_impact` varchar(50) NOT NULL,
  `ext_impact` varchar(50) NOT NULL,
  `impact_ass` varchar(50) NOT NULL,
  `entry_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `invoice_entry`
--

CREATE TABLE `invoice_entry` (
  `id` int NOT NULL,
  `invoice_no` varchar(50) NOT NULL,
  `po_no` varchar(50) NOT NULL,
  `invoice_date` varchar(50) NOT NULL,
  `invoice_amt` varchar(50) NOT NULL,
  `tax_amt` varchar(50) NOT NULL,
  `net_amt` varchar(50) NOT NULL,
  `plant_id` varchar(50) NOT NULL,
  `payment_recieved` varchar(50) NOT NULL,
  `payment_recived_dt` varchar(50) NOT NULL,
  `invoice_balance` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `invoice_entry`
--

INSERT INTO `invoice_entry` (`id`, `invoice_no`, `po_no`, `invoice_date`, `invoice_amt`, `tax_amt`, `net_amt`, `plant_id`, `payment_recieved`, `payment_recived_dt`, `invoice_balance`) VALUES
(426, 'T876', 'RM/PURHO/0051/2022-23', '2023-08-02', '5000', '5000', '10000', '60', '', '', ''),
(427, 'T02', 'RM/PURHO/0052/2022-23', '2023-08-03', '1000', '2000', '3000', '60', '', '', ''),
(428, '80', 'RM/PURHO/0053/2022-23', '2023-08-23', '5000', '2000', '7000', '60', '', '', ''),
(429, '80', 'RM/PURHO/0054/2022-23', '2023-08-31', '5000', '3000', '8000', '60', '', '', ''),
(430, '60', 'RM/PURHO/0055/2022-23', '2023-08-31', '3000', '1000', '4000', '60', '', '', ''),
(431, '30', 'RM/PURHO/0056/2023-24', '2023-09-08', '5000', '2000', '7000', '60', '', '', '');

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

--
-- Table structure for table `invoice_entry_history`
--

CREATE TABLE `invoice_entry_history` (
  `tid` int NOT NULL,
  `pay_mode` varchar(50) NOT NULL,
  `invoice_no` varchar(50) NOT NULL,
  `po_no` varchar(50) NOT NULL,
  `received_amt` varchar(50) NOT NULL,
  `transaction_no` varchar(50) NOT NULL,
  `entry_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `vendor_no` varchar(50) NOT NULL,
  `entry_by` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ipqc_spec`
--

CREATE TABLE `ipqc_spec` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `specification` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `limit_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lower_limit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `upper_limit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `limit_unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `frequency` decimal(10,2) NOT NULL,
  `freq_unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'APPROVED'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `issuance`
--

CREATE TABLE `issuance` (
  `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,
  `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,
  `req_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qty_issued` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `issued_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `issued_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `issued_to` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `issued_for` 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 `issuance_material`
--

CREATE TABLE `issuance_material` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `material_type` varchar(70) NOT NULL,
  `material_name` varchar(80) NOT NULL,
  `material_code` varchar(50) NOT NULL,
  `qty` varchar(50) NOT NULL,
  `product` varchar(50) NOT NULL,
  `product_name` varchar(50) NOT NULL,
  `purpose` varchar(50) NOT NULL,
  `justification` varchar(50) NOT NULL,
  `dispensed_qty` varchar(50) NOT NULL,
  `unit` varchar(50) NOT NULL,
  `dispend_by` varchar(50) NOT NULL,
  `ar_no` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `jobwork`
--

CREATE TABLE `jobwork` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `jobwork_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `inward_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,
  `client_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `issue_qty` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `unit` varchar(10) 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,
  `remark` 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` date NOT NULL,
  `address` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `joiningreport`
--

CREATE TABLE `joiningreport` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `candidate` varchar(50) NOT NULL,
  `letter_date` date NOT NULL,
  `department` varchar(50) NOT NULL,
  `designation` varchar(50) NOT NULL,
  `join_date` date NOT NULL,
  `emp_no` varchar(50) NOT NULL,
  `location` varchar(500) NOT NULL,
  `reporting` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `journal_vouch`
--

CREATE TABLE `journal_vouch` (
  `id` int NOT NULL,
  `jv_no` int NOT NULL,
  `jv_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `dr_total` float NOT NULL,
  `cr_total` float NOT NULL,
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_by` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `narration` varchar(50) NOT NULL,
  `status` bit(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ju_drk`
--

CREATE TABLE `ju_drk` (
  `id` int NOT NULL,
  `jv_id` int NOT NULL,
  `s/no` int NOT NULL,
  `narration` varchar(100) NOT NULL,
  `debit` float NOT NULL,
  `credit` float NOT NULL,
  `status` bit(50) NOT NULL,
  `account_code` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `key_master`
--

CREATE TABLE `key_master` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `department` varchar(50) NOT NULL,
  `key_no` varchar(50) NOT NULL,
  `section` varchar(50) NOT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `key_register`
--

CREATE TABLE `key_register` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `key_no` varchar(50) NOT NULL,
  `activity` varchar(50) NOT NULL,
  `department` varchar(50) NOT NULL,
  `emp_name` varchar(50) NOT NULL,
  `date` date NOT NULL,
  `time` time(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `kilosker_chilling`
--

CREATE TABLE `kilosker_chilling` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `run_hr` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `comp_amp` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gas_pr_lp` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gas_pr_hp` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `comp_oil` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cooling_in` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cooling_out` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chilled_in` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chilled_out` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `oil_level` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_supply` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tank_level_hot` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `tank_level_cold` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `kwh` varchar(20) 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 `label`
--

CREATE TABLE `label` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `label_no` varchar(10) NOT NULL,
  `label_for` varchar(50) NOT NULL,
  `document_no` varchar(10) NOT NULL,
  `label_type` varchar(30) NOT NULL,
  `inward_no` varchar(20) NOT NULL,
  `material_code` varchar(10) NOT NULL,
  `batch_no` varchar(10) NOT NULL,
  `label_count` int NOT NULL,
  `entry_by` varchar(10) NOT NULL,
  `entry_date` datetime NOT NULL,
  `reason` text NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `challan_no` varchar(20) NOT NULL,
  `mfg_date` date NOT NULL,
  `exp_date` date NOT NULL,
  `recv_qty` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `label`
--

INSERT INTO `label` (`id`, `plant_id`, `label_no`, `label_for`, `document_no`, `label_type`, `inward_no`, `material_code`, `batch_no`, `label_count`, `entry_by`, `entry_date`, `reason`, `status`, `challan_no`, `mfg_date`, `exp_date`, `recv_qty`) VALUES
(376, '', 'L10001', 'Receving', '', 'Receving Label', '', 'RM00012', '1', 2, 'master', '2023-08-02 02:42:39', '', 'pending', 'C763', '2023-07-05', '2024-06-04', '100'),
(377, '', 'L10377', 'Receving', '', 'Receving Label', '', 'RM00013', '1', 3, 'master', '2023-08-03 04:19:48', '', 'pending', 'C02', '2023-06-21', '2024-10-16', '300'),
(378, '', 'L10378', 'Receving', '', 'Receving Label', '', 'RM00014', 'B031', 2, 'master', '2023-08-07 05:25:35', '', 'pending', 'C098', '2023-08-07', '2023-08-31', '200'),
(379, '', 'L10379', 'Receving', '', 'Receving Label', '', 'RM00015', 'B012', 40, 'master', '2023-08-08 03:37:30', '', 'pending', 'C086', '2023-08-08', '2023-08-31', '200'),
(380, '', 'L10380', 'Receving', '', 'Receving Label', '', 'RM00015', 'B087', 16, 'master', '2023-08-08 03:45:13', '', 'pending', 'C084', '2023-08-08', '2023-08-31', '100'),
(381, '', 'L10381', 'Receving', '', 'Receving Label', '', 'RM000653', 'B077', 3, 'master', '2023-08-31 12:11:35', '', 'pending', 'C0654', '2023-08-31', '2023-09-30', '300');

--
-- Triggers `label`
--
DELIMITER $$
CREATE TRIGGER `label_no_insert` BEFORE INSERT ON `label` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `labels`
--

CREATE TABLE `labels` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `label_for` varchar(100) NOT NULL,
  `document_no` int NOT NULL,
  `category` varchar(100) NOT NULL,
  `label_type` varchar(100) NOT NULL,
  `no` int NOT NULL,
  `reason` varchar(100) NOT NULL,
  `entry_by` varchar(100) NOT NULL,
  `entry_date` date NOT NULL,
  `status` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `labour`
--

CREATE TABLE `labour` (
  `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',
  `labour_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `labour_id` int NOT NULL,
  `labour_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dob` date NOT NULL,
  `address` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contractor_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `daily_wages` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gender` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `scan_upload` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `front_side` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `back_side` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `photo` 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` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `approve_by` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `labour`
--

INSERT INTO `labour` (`id`, `plant_id`, `user_no`, `labour_no`, `labour_id`, `labour_name`, `dob`, `address`, `contractor_name`, `daily_wages`, `gender`, `scan_upload`, `category`, `front_side`, `back_side`, `photo`, `status`, `entry_by`, `entry_date`, `approve_by`, `approve_date`) VALUES
(16, '', 'gmpdemo1', 'LB0001', 0, 'Lalit Mehta', '1993-06-09', 'Pune', '', '400', 'Male', '', 'Labour', 'front_side.jpeg', 'back_side.jpeg', 'photo.png', 'pending', 'master', '2023-08-03 16:33:24', '', NULL);

--
-- Triggers `labour`
--
DELIMITER $$
CREATE TRIGGER `labour_no_insert` BEFORE INSERT ON `labour` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `labour_attendance`
--

CREATE TABLE `labour_attendance` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `labour_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `in_time` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `out_time` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 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 DEFAULT NULL,
  `entry_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `out_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `out_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `correction_reason` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `labour_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `labour_attendance`
--

INSERT INTO `labour_attendance` (`id`, `plant_id`, `user_no`, `labour_id`, `in_time`, `out_time`, `status`, `entry_by`, `entry_date`, `out_by`, `out_date`, `correction_reason`, `labour_no`) VALUES
(49, '60', 'gmpdemo1', NULL, '2023-09-05 13:28:15', '2023-09-05 13:28:24', 'pending', 'master', '2023-09-05 13:28:15', 'master', '2023-09-05 13:28:24', NULL, 'LB0001');

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

--
-- Table structure for table `labour_contractor`
--

CREATE TABLE `labour_contractor` (
  `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',
  `entry_date` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contractor_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'CC001',
  `contract_firm` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `person` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `address` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `place` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `landmark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pincode` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `phone_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `file_pf` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `file_esic_no` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `file_gst_no` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `file_labour_lic` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `capacity` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `bank` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `branch` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ac_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ifsc` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `i_no1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `labour_contractor`
--

INSERT INTO `labour_contractor` (`id`, `plant_id`, `user_no`, `entry_date`, `contractor_id`, `contract_firm`, `person`, `address`, `place`, `landmark`, `pincode`, `phone_no`, `email`, `file_pf`, `file_esic_no`, `file_gst_no`, `file_labour_lic`, `capacity`, `bank`, `branch`, `ac_no`, `ifsc`, `status`, `i_no1`) VALUES
(7, '', 'gmpdemo1', '2023-08-03 11:53:34', 'CC001', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'reject', 1),
(8, '', 'gmpdemo1', '2023-08-03 12:00:40', 'CC001', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'reject', 2);

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

--
-- Table structure for table `labour_daily_work`
--

CREATE TABLE `labour_daily_work` (
  `id` int NOT NULL,
  `work_id` int NOT NULL DEFAULT '49',
  `entry_date` date NOT NULL,
  `activity` varchar(50) NOT NULL,
  `approx_time` time NOT NULL,
  `checked_by` varchar(50) NOT NULL,
  `i_no1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `labour_data`
--

CREATE TABLE `labour_data` (
  `id` int NOT NULL,
  `work_id` int NOT NULL,
  `labour_name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `labour_management`
--

CREATE TABLE `labour_management` (
  `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',
  `labour_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `labour_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `dob` date NOT NULL,
  `address` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contractor_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `daily_wages` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `gender` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `scan_upload` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `photo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `category` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `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 DEFAULT NULL,
  `approve_date` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `isapprove` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `labs`
--

CREATE TABLE `labs` (
  `id` int NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `lab_no` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lab_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contact_no` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `address` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `contact_person` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fda_approved` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'No',
  `certificate` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fda_lic_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `fda_lic_file` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `branches` 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(50) 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,
  `acreditation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lice_no` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lic_validity` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `international_acreditation` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `branch` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `labs`
--
DELIMITER $$
CREATE TRIGGER `labs_no_insert` BEFORE INSERT ON `labs` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `lab_cleaning`
--

CREATE TABLE `lab_cleaning` (
  `id` int NOT NULL,
  `laf_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pass_box1` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pass_box2` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ph_meter` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `balance_id` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `colony_counter` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `autoclave` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `microscope` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `floor` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `work_benches` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `door_window` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `light` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `clean_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `laf`
--

CREATE TABLE `laf` (
  `id` int NOT NULL,
  `equipment_code` int NOT NULL,
  `before_uv_on` time NOT NULL,
  `beforeUVstart_by` time NOT NULL,
  `status` varchar(100) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `language`
--

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

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

--
-- Table structure for table `laundry`
--

CREATE TABLE `laundry` (
  `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',
  `date` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `laundry_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department_name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `uniform_type` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `no_units` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `size` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `i_no1` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `leadunit`
--

CREATE TABLE `leadunit` (
  `uid` int NOT NULL,
  `unit` varchar(50) NOT NULL,
  `plant_id` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `leaveform`
--

CREATE TABLE `leaveform` (
  `id` int NOT NULL,
  `plant_id` varchar(20) NOT NULL,
  `department_name` varchar(100) NOT NULL,
  `leave_from` varchar(50) NOT NULL,
  `leave_to` varchar(50) NOT NULL,
  `no_day` varchar(50) NOT NULL,
  `leave_type` varchar(50) NOT NULL,
  `leave_available` varchar(50) NOT NULL,
  `reason_leave` varchar(50) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` datetime NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'pending',
  `balance_leave` varchar(50) NOT NULL,
  `approver` varchar(50) NOT NULL,
  `charge_handover` varchar(50) NOT NULL,
  `alternate_person` varchar(50) NOT NULL,
  `contact_no` varchar(50) NOT NULL,
  `pendingList` text NOT NULL,
  `remark` varchar(50) NOT NULL,
  `modi_no_day` varchar(500) NOT NULL,
  `modi_leave_from` varchar(500) NOT NULL,
  `modi_leave_to` varchar(500) NOT NULL,
  `charge_status` varchar(500) NOT NULL,
  `charge_accepted_by` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `leavepolicy`
--

CREATE TABLE `leavepolicy` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leave_title` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation_heading` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `designation` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Eefective_from` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `Eefective_to` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cf_days` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cf_mintime` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cf_maxtime` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cf_crforward` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cf_accumulation` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cf_encashment` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pl_days` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pl_mintime` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pl_maxtime` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pl_crforward` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pl_accumulation` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pl_encashment` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `entry_by` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime(6) NOT NULL,
  `emp_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `total_leave` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `allow_leave` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leave_deduct` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `salary_day` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `over_time` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leaveList` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leave_taken` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leave_balance` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `leave_application`
--

CREATE TABLE `leave_application` (
  `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,
  `emp_dept` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leave_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `leavefrom` date NOT NULL,
  `leaveto` date NOT NULL,
  `emergency_contact` bigint NOT NULL,
  `reason` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `document` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `chargeto` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chargedesc` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `chargestatus` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_date` datetime 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,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `approve_from` date NOT NULL,
  `approve_to` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `leave_card`
--

CREATE TABLE `leave_card` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `firstname` varchar(100) NOT NULL,
  `emp_id` varchar(50) NOT NULL,
  `leave_title` varchar(50) NOT NULL,
  `designation_heading` varchar(50) NOT NULL,
  `Eefective_from` varchar(50) NOT NULL,
  `Eefective_to` varchar(50) NOT NULL,
  `total_leave` varchar(50) NOT NULL,
  `allow_leave` varchar(50) NOT NULL,
  `leave_deduct` varchar(50) NOT NULL,
  `salary_day` varchar(50) NOT NULL,
  `over_time` varchar(50) NOT NULL,
  `leave_taken` varchar(50) NOT NULL,
  `leave_balance` varchar(50) NOT NULL,
  `leaveList` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `leave_types`
--

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

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

--
-- Table structure for table `leave_type_details`
--

CREATE TABLE `leave_type_details` (
  `id` int NOT NULL,
  `leave_policy_id` int NOT NULL,
  `leave_type` varchar(50) NOT NULL,
  `days` int NOT NULL,
  `min_days` int NOT NULL,
  `max_days` int NOT NULL,
  `forward` int NOT NULL,
  `accumulation` varchar(5) NOT NULL,
  `encashment` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ledger`
--

CREATE TABLE `ledger` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL DEFAULT '64',
  `user_no` varchar(20) NOT NULL DEFAULT 'gmpdemo1',
  `client_code` varchar(20) NOT NULL,
  `particular` varchar(100) NOT NULL,
  `entry_for` varchar(100) NOT NULL,
  `amount` int NOT NULL,
  `pay_mode` varchar(100) NOT NULL,
  `entry_by` varchar(20) NOT NULL DEFAULT 'master',
  `entry_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Triggers `ledgers`
--
DELIMITER $$
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.client_code = concat('CL-', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;
DELIMITER $$
IF @lastID IS NULL OR @lastID = '' THEN
    SET @lastID = 0;
END IF;
SET @lastID = @lastID +1;
SET NEW.foliono = concat('F-', LPAD(CONVERT(@lastID, CHAR), 3, '0'));
END
$$
DELIMITER ;

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

--
-- Table structure for table `letter`
--

CREATE TABLE `letter` (
  `id` int NOT NULL,
  `plant_id` int NOT NULL,
  `letter_type` varchar(50) NOT NULL,
  `department` varchar(50) NOT NULL,
  `designation` varchar(50) NOT NULL,
  `emp_name` varchar(50) NOT NULL,
  `emp_id` varchar(50) NOT NULL,
  `subject` varchar(500) NOT NULL,
  `body` varchar(5000) NOT NULL,
  `goverment` varchar(50) NOT NULL,
  `letter_to` varchar(500) NOT NULL,
  `address` varchar(5000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `lineclearance`
--

CREATE TABLE `lineclearance` (
  `id` int NOT NULL,
  `plant_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `work_order_id` int NOT NULL,
  `bfr_no` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mfr_no` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `pleasure_diff_reading` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `laf_eqip_code` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `balance_eqip_code` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `line_clearance_type` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `qc_checkpoints` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `line_clearance_remarks` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_no` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'gmpdemo1',
  `clearance_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `department` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `section` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `activity` 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(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `material_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `grn_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `batch_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `lot_no` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `request_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `request_date` date NOT NULL,
  `status` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending',
  `accept_remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `equipment_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `area_cleaned` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `product_traces` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sanitization_done` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `sanitization_time` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `temperature` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `humidity` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `status_label` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `balance_cleaned` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `checkpoints` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `entry_by` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `entry_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `remark` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  `cid` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `product_code` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Triggers `lineclearance`
--
DELIMITER $$
CREATE TRIGGER `clearance_no_insert` BEFORE INSERT ON `lineclearance` FOR EACH ROW BEGIN

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

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

--
-- Table structure for table `liquid_media`
--

CREATE TABLE `liquid_media` (
  `id` int NOT NULL,
  `batch_no` int NOT NULL,
  `inc_date` date NOT NULL,
  `inc_id` int NOT NULL,
  `inc_temp` int NOT NULL,
  `incubation_complete` varchar(50) NOT NULL,
  `lot_no` int NOT NULL,
  `media_code` varchar(100) NOT NULL,
  `observations` varchar(100) NOT NULL,
  `prepared_date` date NOT NULL,
  `suspension_no` date NOT NULL,
  `satisfactory` varchar(100) NOT NULL,
  `entry_by` varchar(50) NOT NULL,
  `entry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `location`
--

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

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

--
-- 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_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 `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 `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;

--
