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

START TRANSACTION;



--
-- Database: `ssg`
--

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

--
-- Table structure for table `account_ledger`
--

CREATE TABLE IF NOT EXISTS `account_ledger` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `ledger_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ledger_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `group_id` bigint UNSIGNED NOT NULL,
  `ledgerable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ledgerable_id` bigint UNSIGNED DEFAULT NULL,
  `opening_balance` decimal(15,2) NOT NULL DEFAULT '0.00',
  `opening_balance_type` enum('Dr','Cr') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Dr',
  `current_balance` decimal(15,2) NOT NULL DEFAULT '0.00',
  `current_balance_type` enum('Dr','Cr') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Dr',
  `alias` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` bigint UNSIGNED DEFAULT NULL,
  `country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'India',
  `pincode` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_person` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_limit` decimal(15,2) NOT NULL DEFAULT '0.00',
  `credit_days` int NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_ledger_ledger_code_unique` (`ledger_code`),
  KEY `account_ledger_ledger_code_is_active_index` (`ledger_code`,`is_active`),
  KEY `account_ledger_group_id_is_active_index` (`group_id`,`is_active`),
  KEY `account_ledger_ledgerable_type_ledgerable_id_index` (`ledgerable_type`,`ledgerable_id`),
  KEY `account_ledger_ledger_name_index` (`ledger_name`),
  KEY `account_ledger_company_id_foreign` (`company_id`),
  KEY `account_ledger_state_id_foreign` (`state_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `account_ledger_group`
--

CREATE TABLE IF NOT EXISTS `account_ledger_group` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `group_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_group_id` bigint UNSIGNED DEFAULT NULL,
  `sort_order` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_ledger_group_group_code_unique` (`group_code`),
  KEY `account_ledger_group_parent_group_id_foreign` (`parent_group_id`),
  KEY `account_ledger_group_group_code_index` (`group_code`),
  KEY `account_ledger_group_sort_order_index` (`sort_order`),
  KEY `account_ledger_group_company_id_foreign` (`company_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_ledger_group`
--

INSERT INTO `account_ledger_group` (`id`, `group_code`, `group_name`, `parent_group_id`, `sort_order`, `created_at`, `updated_at`, `company_id`) VALUES
(1, 'SUNDRY_CREDITORS', 'Sundry Creditors', NULL, 1, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1),
(2, 'SUNDRY_DEBTORS', 'Sundry Debtors', NULL, 2, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1),
(3, 'CASH', 'Cash/Bank', NULL, 3, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1),
(4, 'DUTIES_TAXES', 'Duties & Taxes', NULL, 4, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1),
(5, 'EXPENSES', 'Expenses', NULL, 5, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1),
(6, 'SALES', 'Sales', NULL, 6, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1),
(7, 'PURCHASE', 'Purchase', NULL, 7, '2025-07-23 05:26:10', '2025-07-23 05:26:10', 1);

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

--
-- Table structure for table `account_transaction`
--

CREATE TABLE IF NOT EXISTS `account_transaction` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `transaction_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_date` date NOT NULL,
  `transaction_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `voucher_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference_date` date DEFAULT NULL,
  `transactionable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transactionable_id` bigint UNSIGNED DEFAULT NULL,
  `narration` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `total_amount` decimal(15,2) NOT NULL,
  `currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `exchange_rate` decimal(10,4) NOT NULL DEFAULT '1.0000',
  `status` enum('Draft','Posted','Cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Draft',
  `created_by` bigint UNSIGNED NOT NULL,
  `approved_by` bigint UNSIGNED DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_transaction_transaction_number_unique` (`transaction_number`),
  KEY `account_transaction_created_by_foreign` (`created_by`),
  KEY `account_transaction_approved_by_foreign` (`approved_by`),
  KEY `account_transaction_transaction_date_status_index` (`transaction_date`,`status`),
  KEY `account_transaction_transaction_type_voucher_type_index` (`transaction_type`,`voucher_type`),
  KEY `acct_trans_poly_idx` (`transactionable_type`,`transactionable_id`),
  KEY `account_transaction_transaction_number_index` (`transaction_number`),
  KEY `account_transaction_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `account_transaction_line`
--

CREATE TABLE IF NOT EXISTS `account_transaction_line` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `transaction_id` bigint UNSIGNED NOT NULL,
  `ledger_id` bigint UNSIGNED NOT NULL,
  `line_number` int NOT NULL DEFAULT '1',
  `debit_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `credit_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `particulars` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `reference_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference_date` date DEFAULT NULL,
  `quantity` decimal(12,3) DEFAULT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rate` decimal(12,2) DEFAULT NULL,
  `dimensions` json DEFAULT NULL,
  `line_narration` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `account_transaction_line_transaction_id_line_number_index` (`transaction_id`,`line_number`),
  KEY `account_transaction_line_ledger_id_index` (`ledger_id`),
  KEY `account_transaction_line_debit_amount_credit_amount_index` (`debit_amount`,`credit_amount`),
  KEY `account_transaction_line_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `address`
--

CREATE TABLE IF NOT EXISTS `address` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `party_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `party_id` bigint UNSIGNED NOT NULL,
  `address_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REGISTERED',
  `contact_person` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line1` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line2` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` bigint UNSIGNED DEFAULT NULL,
  `pincode` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'India',
  `phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `address_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `landmark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `longitude` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_primary_address` tinyint(1) NOT NULL DEFAULT '0',
  `is_shipping_address` tinyint(1) NOT NULL DEFAULT '0',
  `territory` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_notes` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'IN-STATE',
  `tax_applicable` json DEFAULT NULL,
  `is_validated` tinyint(1) NOT NULL DEFAULT '0',
  `validated_at` timestamp NULL DEFAULT NULL,
  `validated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_instructions` json DEFAULT NULL,
  `preferred_delivery_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `requires_appointment` tinyint(1) NOT NULL DEFAULT '0',
  `access_instructions` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `address_party_type_party_id_index` (`party_type`,`party_id`),
  KEY `address_address_type_index` (`address_type`),
  KEY `address_is_default_index` (`is_default`),
  KEY `address_state_id_foreign` (`state_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `attribute_masters`
--

CREATE TABLE IF NOT EXISTS `attribute_masters` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `attribute_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attribute_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attribute_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_required` tinyint NOT NULL DEFAULT '0',
  `sort_order` int NOT NULL DEFAULT '0',
  `is_active` tinyint NOT NULL DEFAULT '1',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attribute_masters_attribute_code_unique` (`attribute_code`),
  KEY `attribute_masters_attribute_code_index` (`attribute_code`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attribute_masters`
--

INSERT INTO `attribute_masters` (`id`, `attribute_code`, `attribute_name`, `attribute_type`, `is_required`, `sort_order`, `is_active`, `created_by`, `created_at`) VALUES
(1, 'COLORR', 'Colorr', 'DROPDOWN', 1, 0, 1, '1', '2025-07-27 05:50:22'),
(2, 'SHAPE', 'Shape', 'DROPDOWN', 1, 0, 1, '1', '2025-07-29 11:08:18'),
(3, 'BRAND', 'Brand', 'DROPDOWN', 1, 0, 1, '1', '2025-07-29 11:09:39'),
(4, 'MATERIAL', 'Material', 'DROPDOWN', 1, 0, 1, '1', '2025-07-29 11:10:18');

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

--
-- Table structure for table `attribute_values`
--

CREATE TABLE IF NOT EXISTS `attribute_values` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `attribute_id` int NOT NULL,
  `value_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `sort_order` int NOT NULL DEFAULT '0',
  `is_active` tinyint NOT NULL DEFAULT '1',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `attribute_values_attribute_id_value_code_unique` (`attribute_id`,`value_code`),
  KEY `attribute_values_attribute_id_index` (`attribute_id`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attribute_values`
--

INSERT INTO `attribute_values` (`id`, `attribute_id`, `value_code`, `value_name`, `sort_order`, `is_active`, `created_by`, `created_at`) VALUES
(14, 1, 'WH', 'White', 1, 1, 'AJIT HOGADE', '2025-07-29 16:42:41'),
(7, 2, 'SQ', 'Square', 2, 1, 'AJIT HOGADE', '2025-07-29 16:38:56'),
(6, 2, 'CO', 'Collar', 1, 1, 'AJIT HOGADE', '2025-07-29 16:38:56'),
(8, 2, 'SU', 'U Shape', 3, 1, 'AJIT HOGADE', '2025-07-29 16:38:56'),
(12, 3, 'SSG', 'SSG Brand', 1, 1, 'AJIT HOGADE', '2025-07-29 16:41:43'),
(10, 4, 'PVC', 'PVC', 1, 1, '1', '2025-07-29 11:10:18'),
(11, 4, 'MET', 'Metal', 2, 1, '1', '2025-07-29 11:10:18'),
(13, 3, 'NON', 'non Brand', 2, 1, 'AJIT HOGADE', '2025-07-29 16:41:43'),
(15, 1, 'BL', 'Blue', 2, 1, 'AJIT HOGADE', '2025-07-29 16:42:41'),
(16, 1, 'RED', 'Red', 3, 1, 'AJIT HOGADE', '2025-07-29 16:42:42'),
(17, 1, 'BLK', 'Black', 4, 1, 'AJIT HOGADE', '2025-07-29 16:42:42');

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

--
-- Table structure for table `brand_customer`
--

CREATE TABLE IF NOT EXISTS `brand_customer` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `brand_id` bigint UNSIGNED NOT NULL,
  `customer_id` bigint UNSIGNED NOT NULL,
  `is_exclusive` tinyint(1) NOT NULL DEFAULT '0',
  `since` date DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `brand_customer_brand_id_customer_id_unique` (`brand_id`,`customer_id`),
  KEY `brand_customer_customer_id_foreign` (`customer_id`),
  KEY `brand_customer_is_exclusive_index` (`is_exclusive`),
  KEY `brand_customer_since_index` (`since`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `brand_master`
--

CREATE TABLE IF NOT EXISTS `brand_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `brand_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `brand_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `website` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `brand_master_brand_code_unique` (`brand_code`),
  KEY `brand_master_brand_code_index` (`brand_code`),
  KEY `brand_master_status_index` (`status`),
  KEY `brand_master_brand_name_index` (`brand_name`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `brand_master`
--

INSERT INTO `brand_master` (`id`, `brand_code`, `brand_name`, `description`, `website`, `logo_url`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'SSD', 'ssg', '', '', NULL, 'ACTIVE', 'AJIT HOGADE', 'AJIT HOGADE', '2025-07-28 02:48:19', '2025-07-28 02:48:30');

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

--
-- Table structure for table `brand_vendor`
--

CREATE TABLE IF NOT EXISTS `brand_vendor` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `brand_id` bigint UNSIGNED NOT NULL,
  `vendor_id` bigint UNSIGNED NOT NULL,
  `is_authorized` tinyint(1) NOT NULL DEFAULT '1',
  `authorized_since` date DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `brand_vendor_brand_id_vendor_id_unique` (`brand_id`,`vendor_id`),
  KEY `brand_vendor_vendor_id_foreign` (`vendor_id`),
  KEY `brand_vendor_is_authorized_index` (`is_authorized`),
  KEY `brand_vendor_authorized_since_index` (`authorized_since`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `category_attributes`
--

CREATE TABLE IF NOT EXISTS `category_attributes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `category_master_id` bigint UNSIGNED NOT NULL,
  `attribute_master_id` bigint UNSIGNED NOT NULL,
  `is_required` tinyint(1) NOT NULL DEFAULT '0',
  `is_variant` tinyint(1) NOT NULL DEFAULT '0',
  `sort_order` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cat_attr_unique` (`category_master_id`,`attribute_master_id`),
  KEY `category_attributes_attribute_master_id_foreign` (`attribute_master_id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `category_attributes`
--

INSERT INTO `category_attributes` (`id`, `category_master_id`, `attribute_master_id`, `is_required`, `is_variant`, `sort_order`, `created_at`, `updated_at`, `created_by`, `updated_by`) VALUES
(3, 1, 1, 0, 0, 1, '2025-07-29 11:10:46', '2025-07-29 11:10:46', 'AJIT HOGADE', NULL),
(2, 2, 1, 0, 0, 1, '2025-07-27 07:42:34', '2025-07-27 07:42:34', 'AJIT HOGADE', NULL),
(4, 1, 3, 0, 0, 2, '2025-07-29 11:10:46', '2025-07-29 11:10:46', 'AJIT HOGADE', NULL),
(5, 1, 4, 0, 0, 3, '2025-07-29 11:10:46', '2025-07-29 11:10:46', 'AJIT HOGADE', NULL),
(6, 1, 2, 0, 0, 4, '2025-07-29 11:10:46', '2025-07-29 11:10:46', 'AJIT HOGADE', NULL);

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

--
-- Table structure for table `category_master`
--

CREATE TABLE IF NOT EXISTS `category_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `category_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_category_id` bigint UNSIGNED DEFAULT NULL,
  `category_type_id` int NOT NULL,
  `category_level` int NOT NULL DEFAULT '1',
  `hsn_id` bigint UNSIGNED DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `image_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort_order` int NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AjitHogade',
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `category_master_category_code_unique` (`category_code`),
  KEY `category_master_hsn_id_foreign` (`hsn_id`),
  KEY `category_master_category_code_index` (`category_code`),
  KEY `category_master_parent_category_id_index` (`parent_category_id`),
  KEY `category_master_category_level_index` (`category_level`),
  KEY `category_master_is_active_index` (`is_active`),
  KEY `category_master_sort_order_index` (`sort_order`),
  KEY `category_type_id` (`category_type_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `category_master`
--

INSERT INTO `category_master` (`id`, `category_code`, `category_name`, `parent_category_id`, `category_type_id`, `category_level`, `hsn_id`, `description`, `image_url`, `sort_order`, `is_active`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'ROLLER', 'Roller', NULL, 2, 1, NULL, 'ROLLER Cat', NULL, 1, 1, 'AJIT HOGADE', 'AJIT HOGADE', '2025-07-27 07:31:07', '2025-07-27 07:31:07'),
(2, 'ZEBRA', 'ZEBRA', NULL, 2, 1, NULL, 'dsfsd', NULL, 2, 1, 'AJIT HOGADE', 'AJIT HOGADE', '2025-07-27 07:42:34', '2025-07-27 07:42:34');

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

--
-- Table structure for table `category_types`
--

CREATE TABLE IF NOT EXISTS `category_types` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `category_type_code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `category_type_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `is_active` tinyint(1) DEFAULT '1',
  `created_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `category_type_code` (`category_type_code`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `category_types`
--

INSERT INTO `category_types` (`id`, `category_type_code`, `category_type_name`, `description`, `is_active`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES
(1, 'FINISHED_GOODS', 'Finished Goods', 'Products ready for sale or delivery', 1, 'system', '2025-07-07 09:37:41', NULL, '2025-07-07 09:37:41'),
(2, 'RAW_MATERIAL', 'Raw Material', 'Primary materials used in the production process', 1, 'system', '2025-07-07 09:37:41', NULL, '2025-07-07 09:37:41'),
(3, 'TRADING_GOODS', 'Trading Goods', 'Purchased goods for resale without processing', 1, 'system', '2025-07-07 09:37:41', NULL, '2025-07-07 09:37:41'),
(4, 'CONSUMABLES', 'Consumables', 'Goods consumed in operations but not part of final product', 1, 'system', '2025-07-07 09:37:41', NULL, '2025-07-07 09:37:41'),
(5, 'SERVICE', 'Service', 'Non-tangible offerings provided to customers', 1, 'system', '2025-07-07 09:37:41', NULL, '2025-07-07 09:37:41');

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

--
-- Table structure for table `company_gstin`
--

CREATE TABLE IF NOT EXISTS `company_gstin` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL COMMENT 'Foreign key to company_master table',
  `state_id` bigint UNSIGNED NOT NULL COMMENT 'Foreign key to state_master table',
  `gstin_number` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Complete 15-digit GSTIN number',
  `legal_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trade_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Trade name (optional)',
  `business_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Manufacturing/Trading/Services',
  `registration_date` date DEFAULT NULL COMMENT 'GSTIN registration date',
  `status` enum('ACTIVE','CANCELLED','SUSPENDED') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE' COMMENT 'GSTIN status',
  `address_line1` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Address line 1',
  `address_line2` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Address line 2',
  `city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'City',
  `pincode` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Pincode',
  `contact_person` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Contact person',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Phone number',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Email address',
  `is_primary_gstin` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is primary GSTIN for company',
  `is_active_for_sales` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Use for sales transactions',
  `is_active_for_purchases` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Use for purchase transactions',
  `location_type` enum('Plant','Warehouse','Office','Retail','Service Center','Branch') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Location type',
  `filing_frequency` enum('MONTHLY','QUARTERLY') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MONTHLY' COMMENT 'Filing frequency',
  `composition_scheme` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Under composition scheme',
  `is_verified` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is GSTIN verified',
  `verified_date` date DEFAULT NULL COMMENT 'Verification date',
  `is_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Is record active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AjitHogade',
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_company_state` (`company_id`,`state_id`),
  UNIQUE KEY `company_gstin_gstin_number_unique` (`gstin_number`),
  KEY `idx_company_gstin_company_id` (`company_id`),
  KEY `idx_company_gstin_state_id` (`state_id`),
  KEY `idx_gstin_number` (`gstin_number`),
  KEY `idx_status` (`status`),
  KEY `idx_is_primary` (`is_primary_gstin`),
  KEY `idx_is_active` (`is_active`),
  KEY `idx_company_status` (`company_id`,`status`),
  KEY `idx_state_status` (`state_id`,`status`),
  KEY `idx_location_type` (`location_type`),
  KEY `idx_business_type` (`business_type`),
  KEY `idx_created_by` (`created_by`),
  KEY `idx_created_updated` (`created_at`,`updated_at`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Company GSTIN records for multi-state operations';

--
-- Dumping data for table `company_gstin`
--

INSERT INTO `company_gstin` (`id`, `company_id`, `state_id`, `gstin_number`, `legal_name`, `trade_name`, `business_type`, `registration_date`, `status`, `address_line1`, `address_line2`, `city`, `pincode`, `contact_person`, `phone`, `email`, `is_primary_gstin`, `is_active_for_sales`, `is_active_for_purchases`, `location_type`, `filing_frequency`, `composition_scheme`, `is_verified`, `verified_date`, `is_active`, `created_at`, `updated_at`, `created_by`, `updated_by`) VALUES
(1, 1, 14, '27ADNPH1950L1Z1', 'SOD Manufacturing Ltd', 'SOD Manufacturing Ltd', 'Regular', '2025-08-01', 'ACTIVE', '202 OMKAR APT House No 829 10', 'Sector 20 Nerul west', 'Thane', '400706', NULL, NULL, NULL, 1, 1, 1, NULL, 'MONTHLY', 0, 0, NULL, 1, '2025-08-14 04:23:19', '2025-08-14 04:23:19', 'AJIT HOGADE', NULL),
(2, 1, 5, '22ADTHO1950Y1Z1', 'SOD Manufacturing Ltd', 'SOD Manufacturing Ltd', 'Regular', '2025-06-13', 'ACTIVE', '202 OMKAR APT House No 829 10', 'Sector 20 Nerul west', 'Thane', '400706', NULL, NULL, NULL, 0, 1, 1, NULL, 'MONTHLY', 0, 0, NULL, 1, '2025-08-14 04:23:20', '2025-08-14 04:23:20', 'AJIT HOGADE', NULL);

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

--
-- Table structure for table `company_infos`
--

CREATE TABLE IF NOT EXISTS `company_infos` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `legal_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `registration_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` bigint UNSIGNED DEFAULT NULL,
  `country` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pincode` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_path` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `company_infos_code_unique` (`code`),
  KEY `company_infos_state_id_foreign` (`state_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `company_master`
--

CREATE TABLE IF NOT EXISTS `company_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `pan` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cin` varchar(21) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tan` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `financial_year_start` int NOT NULL DEFAULT '4',
  `base_currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `is_main_company` tinyint(1) NOT NULL DEFAULT '0',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AjitHogade',
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `company_master_company_code_unique` (`company_code`),
  KEY `company_master_company_code_index` (`company_code`),
  KEY `company_master_status_index` (`status`),
  KEY `company_master_is_main_company_index` (`is_main_company`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `company_master`
--

INSERT INTO `company_master` (`id`, `company_code`, `company_name`, `pan`, `cin`, `tan`, `phone`, `email`, `website`, `logo_url`, `financial_year_start`, `base_currency`, `is_main_company`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'COMP001', 'SOD Manufacturing Ltd', 'ABCDE1234F', 'U74999DL2019PTC123456', 'ABCD12345E', '9876543210', 'info@sodmfg.com', 'https://www.sodmfg.com', 'https://www.sodmfg.com/logo.png', 4, 'INR', 1, 'ACTIVE', 'System', 'System', '2025-08-14 04:23:19', '2025-08-14 04:23:19');

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

--
-- Table structure for table `contact`
--

CREATE TABLE IF NOT EXISTS `contact` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `contactable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `contactable_id` bigint UNSIGNED NOT NULL,
  `contact_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Primary',
  `person_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `designation` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telegram` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `department` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reporting_to` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_decision_maker` tinyint(1) NOT NULL DEFAULT '0',
  `preferred_contact_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'EMAIL',
  `best_time_to_contact` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `linkedin_profile` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `anniversary_date` date DEFAULT NULL,
  `accepts_marketing_emails` tinyint(1) NOT NULL DEFAULT '1',
  `accepts_promotional_sms` tinyint(1) NOT NULL DEFAULT '1',
  `accepts_notifications` tinyint(1) NOT NULL DEFAULT '1',
  `communication_language` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en',
  `interests` json DEFAULT NULL,
  `years_of_experience` int DEFAULT NULL,
  `expertise_areas` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `education_background` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relationship_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `contact_rating` decimal(3,1) NOT NULL DEFAULT '0.0',
  `last_contacted_date` date DEFAULT NULL,
  `last_interaction_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `interaction_history` json DEFAULT NULL,
  `internal_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `tags` json DEFAULT NULL,
  `custom_fields` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `contact_contactable_type_contactable_id_index` (`contactable_type`,`contactable_id`),
  KEY `contact_contact_type_is_primary_index` (`contact_type`,`is_primary`),
  KEY `contact_email_index` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_master`
--

CREATE TABLE IF NOT EXISTS `customer_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `customer_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REGULAR',
  `customer_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'India',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `default_currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `payment_terms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_limit` decimal(18,2) DEFAULT NULL,
  `gst_registered` tinyint(1) NOT NULL DEFAULT '1',
  `website` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  `customer_group` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `aadhar_number` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_days` int NOT NULL DEFAULT '0',
  `price_list_id` bigint UNSIGNED DEFAULT NULL,
  `tax_preference` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TAXABLE',
  `territory` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sales_person` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_rating` decimal(3,1) NOT NULL DEFAULT '0.0',
  `is_frozen` tinyint(1) NOT NULL DEFAULT '0',
  `opening_balance` decimal(15,2) NOT NULL DEFAULT '0.00',
  `opening_balance_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DR',
  `industry_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `first_transaction_date` date DEFAULT NULL,
  `annual_revenue` decimal(15,2) DEFAULT NULL,
  `internal_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `custom_fields` json DEFAULT NULL,
  `marketing_emails` tinyint(1) NOT NULL DEFAULT '1',
  `promotional_sms` tinyint(1) NOT NULL DEFAULT '1',
  `preferred_language` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en',
  `communication_preference` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'EMAIL',
  PRIMARY KEY (`id`),
  UNIQUE KEY `customer_master_customer_code_unique` (`customer_code`),
  KEY `customer_master_customer_code_index` (`customer_code`),
  KEY `customer_master_customer_type_index` (`customer_type`),
  KEY `customer_master_status_index` (`status`),
  KEY `customer_master_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `department_masters`
--

CREATE TABLE IF NOT EXISTS `department_masters` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `department_type` enum('OFFICE','MANUFACTURING','WAREHOUSE','QA','MAINTENANCE','LOGISTICS','HR','FINANCE','IT','RND','SALES','PURCHASE') COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint UNSIGNED DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE','MAINTENANCE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `department_masters_company_id_code_unique` (`company_id`,`code`),
  KEY `department_masters_parent_id_foreign` (`parent_id`),
  KEY `department_masters_company_id_department_type_index` (`company_id`,`department_type`),
  KEY `department_masters_company_id_status_index` (`company_id`,`status`),
  KEY `department_masters_department_type_index` (`department_type`),
  KEY `department_masters_status_index` (`status`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `department_masters`
--

INSERT INTO `department_masters` (`id`, `company_id`, `code`, `name`, `department_type`, `parent_id`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 'D001', 'Mumbai Office', 'OFFICE', NULL, 'ACTIVE', '2025-08-15 01:39:09', '2025-08-15 01:39:09', NULL),
(2, 1, 'DW001', 'Warehouse', 'WAREHOUSE', NULL, 'ACTIVE', '2025-08-15 05:03:37', '2025-08-15 05:24:52', NULL);

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE IF NOT EXISTS `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `gstin`
--

CREATE TABLE IF NOT EXISTS `gstin` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `gstin_number` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `legal_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `trade_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` bigint UNSIGNED DEFAULT NULL,
  `state_code` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `business_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `registration_date` date DEFAULT NULL,
  `cancellation_date` date DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `pincode` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_nature` json DEFAULT NULL,
  `pan_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  `gstin_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REGULAR',
  `registration_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'VOLUNTARY',
  `taxpayer_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REGULAR',
  `constitution_of_business` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `annual_turnover` decimal(15,2) DEFAULT NULL,
  `jurisdiction` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `filing_frequency` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MONTHLY',
  `composition_scheme` tinyint(1) NOT NULL DEFAULT '0',
  `composition_rate` decimal(5,2) DEFAULT NULL,
  `compliance_rating` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'A',
  `delayed_filings_count` int NOT NULL DEFAULT '0',
  `pending_liabilities` decimal(15,2) NOT NULL DEFAULT '0.00',
  `verification_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `last_verified_at` timestamp NULL DEFAULT NULL,
  `verified_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `gstin_gstin_number_unique` (`gstin_number`),
  KEY `gstin_gstin_number_status_index` (`gstin_number`,`status`),
  KEY `gstin_state_code_index` (`state_code`),
  KEY `gstin_company_id_foreign` (`company_id`),
  KEY `gstin_state_id_foreign` (`state_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `hsn_codes`
--

CREATE TABLE IF NOT EXISTS `hsn_codes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `hsn_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `gst_rate` decimal(5,2) NOT NULL,
  `cess_rate` decimal(5,2) NOT NULL DEFAULT '0.00',
  `igst_rate` decimal(5,2) NOT NULL DEFAULT '0.00',
  `sgst_rate` decimal(5,2) NOT NULL DEFAULT '0.00',
  `cgst_rate` decimal(5,2) NOT NULL DEFAULT '0.00',
  `uqc_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hsn_codes_hsn_code_unique` (`hsn_code`),
  KEY `hsn_codes_hsn_code_index` (`hsn_code`),
  KEY `hsn_codes_status_index` (`status`),
  KEY `hsn_codes_gst_rate_index` (`gst_rate`),
  KEY `hsn_codes_sgst_rate_cgst_rate_index` (`sgst_rate`,`cgst_rate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `inventory_adjustments`
--

CREATE TABLE IF NOT EXISTS `inventory_adjustments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `adjustment_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `adjustment_date` datetime DEFAULT NULL,
  `warehouse_id` int DEFAULT NULL,
  `adjustment_type` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `reason_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `total_items` int DEFAULT NULL,
  `total_adjustment_value` decimal(16,4) DEFAULT NULL,
  `reference_document` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `prepared_by` int DEFAULT NULL,
  `approved_by` int DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `posted_at` datetime DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `updated_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `inventory_adjustments`
--

INSERT INTO `inventory_adjustments` (`id`, `adjustment_number`, `adjustment_date`, `warehouse_id`, `adjustment_type`, `reason_code`, `total_items`, `total_adjustment_value`, `reference_document`, `notes`, `status`, `prepared_by`, `approved_by`, `approved_at`, `posted_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'ADJ001', '2025-08-08 16:22:55', 1, 'count', 'cycle_count', 2, 100.0000, NULL, NULL, 'posted', NULL, NULL, NULL, '2025-08-08 11:39:41', NULL, 1, NULL, '2025-08-08 11:39:41');

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

--
-- Table structure for table `inventory_adjustment_items`
--

CREATE TABLE IF NOT EXISTS `inventory_adjustment_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `inventory_adjustment_id` int DEFAULT NULL,
  `product_variant_id` int DEFAULT NULL,
  `batch_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `serial_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `location_id` int DEFAULT NULL,
  `bin_location` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `current_quantity` decimal(16,4) DEFAULT NULL,
  `counted_quantity` decimal(16,4) DEFAULT NULL,
  `adjustment_quantity` decimal(16,4) DEFAULT NULL,
  `unit_cost` decimal(16,4) DEFAULT NULL,
  `adjustment_value` decimal(16,4) DEFAULT NULL,
  `reason_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `inventory_adjustment_items`
--

INSERT INTO `inventory_adjustment_items` (`id`, `inventory_adjustment_id`, `product_variant_id`, `batch_number`, `serial_number`, `location_id`, `bin_location`, `current_quantity`, `counted_quantity`, `adjustment_quantity`, `unit_cost`, `adjustment_value`, `reason_code`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL, NULL, NULL, 100.0000, 95.0000, -5.0000, 50.0000, -250.0000, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `inventory_movements`
--

CREATE TABLE IF NOT EXISTS `inventory_movements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `transaction_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `product_variant_id` int DEFAULT NULL,
  `warehouse_id` int DEFAULT NULL,
  `movement_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `movement_category` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `quantity` decimal(16,4) DEFAULT NULL,
  `unit_cost` decimal(16,4) DEFAULT NULL,
  `total_cost` decimal(16,4) DEFAULT NULL,
  `reference_document_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `reference_document_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `reference_document_id` int DEFAULT NULL,
  `movement_date` datetime DEFAULT NULL,
  `batch_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `serial_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `expiry_date` datetime DEFAULT NULL,
  `location_id` int DEFAULT NULL,
  `bin_location` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `from_warehouse_id` int DEFAULT NULL,
  `to_warehouse_id` int DEFAULT NULL,
  `reason_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `approved_by` int DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `updated_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `inventory_movements`
--

INSERT INTO `inventory_movements` (`id`, `transaction_number`, `product_variant_id`, `warehouse_id`, `movement_type`, `movement_category`, `quantity`, `unit_cost`, `total_cost`, `reference_document_type`, `reference_document_number`, `reference_document_id`, `movement_date`, `batch_number`, `serial_number`, `expiry_date`, `location_id`, `bin_location`, `from_warehouse_id`, `to_warehouse_id`, `reason_code`, `notes`, `approved_by`, `approved_at`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'MOV001', 1, 1, 'IN', 'purchase_receipt', 100.0000, 50.0000, 5000.0000, NULL, NULL, NULL, '2025-08-08 16:21:47', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'approved', NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `inventory_transfers`
--

CREATE TABLE IF NOT EXISTS `inventory_transfers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `transfer_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `transfer_date` datetime DEFAULT NULL,
  `from_warehouse_id` int DEFAULT NULL,
  `to_warehouse_id` int DEFAULT NULL,
  `transfer_type` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `priority` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `total_items` int DEFAULT NULL,
  `total_transfer_value` decimal(16,4) DEFAULT NULL,
  `reference_document` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `requested_by` int DEFAULT NULL,
  `approved_by` int DEFAULT NULL,
  `received_by` int DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `shipped_at` datetime DEFAULT NULL,
  `received_at` datetime DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `updated_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `inventory_transfers`
--

INSERT INTO `inventory_transfers` (`id`, `transfer_number`, `transfer_date`, `from_warehouse_id`, `to_warehouse_id`, `transfer_type`, `priority`, `total_items`, `total_transfer_value`, `reference_document`, `notes`, `status`, `requested_by`, `approved_by`, `received_by`, `approved_at`, `shipped_at`, `received_at`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'TRF001', '2025-08-08 16:23:34', 1, 2, 'inter-warehouse', NULL, 3, 1500.0000, NULL, NULL, 'shipped', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `inventory_transfer_items`
--

CREATE TABLE IF NOT EXISTS `inventory_transfer_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `inventory_transfer_id` int DEFAULT NULL,
  `product_variant_id` int DEFAULT NULL,
  `batch_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `serial_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `from_location_id` int DEFAULT NULL,
  `to_location_id` int DEFAULT NULL,
  `from_bin_location` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `to_bin_location` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `requested_quantity` decimal(16,4) DEFAULT NULL,
  `transferred_quantity` decimal(16,4) DEFAULT NULL,
  `received_quantity` decimal(16,4) DEFAULT NULL,
  `unit_cost` decimal(16,4) DEFAULT NULL,
  `transfer_value` decimal(16,4) DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `inventory_transfer_items`
--

INSERT INTO `inventory_transfer_items` (`id`, `inventory_transfer_id`, `product_variant_id`, `batch_number`, `serial_number`, `from_location_id`, `to_location_id`, `from_bin_location`, `to_bin_location`, `requested_quantity`, `transferred_quantity`, `received_quantity`, `unit_cost`, `transfer_value`, `notes`, `created_at`, `updated_at`) VALUES
(1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 50.0000, 50.0000, 50.0000, 30.0000, 1500.0000, NULL, NULL, NULL);

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

--
-- Table structure for table `jobs`
--

CREATE TABLE IF NOT EXISTS `jobs` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `queue` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint UNSIGNED NOT NULL,
  `reserved_at` int UNSIGNED DEFAULT NULL,
  `available_at` int UNSIGNED NOT NULL,
  `created_at` int UNSIGNED NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `job_batches`
--

CREATE TABLE IF NOT EXISTS `job_batches` (
  `id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `migrations`
--

CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_07_07_150245_create_attribute_masters_table', 2),
(5, '2025_07_07_150303_create_attribute_values_table', 2),
(6, '2025_07_07_150303_create_category_attributes_table', 2),
(7, '2025_07_07_150304_create_category_types_table', 2),
(8, '2025_07_07_150304_create_company_infos_table', 2),
(9, '2025_07_07_150305_create_number_series_table', 2),
(10, '2025_07_07_150305_create_plant_departments_table', 2),
(11, '2025_07_07_150306_create_plant_masters_table', 2),
(12, '2025_07_07_150307_create_plant_shifts_table', 2),
(13, '2025_07_07_150307_create_plant_work_centers_table', 2),
(14, '2025_07_07_150308_create_product_categories_table', 2),
(15, '2025_07_07_150308_create_product_masters_table', 2),
(16, '2025_07_07_150309_create_product_variants_table', 2),
(17, '2025_07_07_150310_create_product_variant_attributes_table', 2),
(18, '2025_07_07_152840_create_permission_tables', 2),
(19, '2025_07_15_142113_create_vendor_master_table', 2),
(20, '2025_07_15_142123_create_customer_master_table', 2),
(21, '2025_07_15_142138_create_address_table', 2),
(22, '2025_07_15_142217_create_gstin_table', 2),
(23, '2025_07_15_142241_create_contact_table', 3),
(24, '2025_07_15_142251_create_bank_table', 4),
(25, '2025_07_15_142302_create_account_ledger_table', 5),
(26, '2025_07_15_142311_create_account_ledger_group_table', 6),
(27, '2025_07_15_142324_create_account_transaction_table', 7),
(28, '2025_07_15_142335_create_account_transaction_line_table', 8),
(29, '2025_07_15_143353_fix_contact_and_bank_tables', 9),
(30, '2025_07_15_145305_fix_account_ledger_group_reference', 5),
(31, '2025_07_16_120041_update_product_masters_table_structure', 10),
(32, '2025_07_16_120736_update_product_variants_add_uom_foreign_key', 11),
(33, '2025_07_16_122407_create_uom_master_table', 12),
(34, '2025_07_16_123331_update_product_masters_uom_references', 13),
(35, '2025_07_16_123724_fix_product_masters_uom_foreign_keys', 14),
(36, '2025_07_16_124253_fix_all_tables_add_auto_increment_ids', 6),
(37, '2025_07_16_124917_fix_account_ledger_group_reference_only', 7),
(38, '2025_07_16_125345_fix_product_masters_add_auto_increment_id', 15),
(39, '2025_07_16_130000_add_category_id_to_product_masters', 16),
(40, '2025_07_16_143211_fix_product_masters_add_category_id_only', 17),
(41, '2025_07_17_140000_create_product_variant_purchase_prices_table', 18),
(42, '2025_07_17_140100_create_product_variant_sales_prices_table', 19),
(43, '2025_07_17_150000_create_brand_master_table', 20),
(44, '2025_07_17_150100_add_brand_id_to_product_masters', 21),
(45, '2025_07_17_150200_add_brand_id_to_product_variants', 22),
(46, '2025_07_17_150300_create_brand_vendor_table', 23),
(47, '2025_07_17_150400_create_brand_customer_table', 24),
(48, '2025_07_17_160000_create_hsn_codes_table', 25),
(49, '2025_07_17_160100_add_hsn_id_to_product_masters', 26),
(50, '2025_07_17_160200_add_hsn_id_to_product_variants', 27),
(51, '2025_07_17_170000_create_company_master_table', 28),
(52, '2025_07_17_170100_create_warehouse_master_table', 29),
(53, '2025_07_17_170200_create_category_master_table', 30),
(54, '2025_07_17_170300_create_product_attributes_table', 31),
(55, '2025_07_17_170400_create_product_attribute_values_table', 32),
(56, '2025_07_17_180000_enhance_product_masters_table', 33),
(57, '2025_07_17_180100_enhance_product_variants_table', 34),
(58, '2025_07_17_180200_enhance_vendor_master_table', 35),
(59, '2025_07_17_180300_enhance_customer_master_table', 36),
(60, '2025_07_17_180400_enhance_address_table', 37),
(61, '2025_07_17_180500_enhance_contact_table', 38),
(62, '2025_07_17_180600_enhance_bank_table', 39),
(63, '2025_07_17_180700_enhance_gstin_table', 40),
(64, '2025_07_17_181000_create_stock_ledger_table', 41),
(65, '2025_07_17_181100_create_stock_balance_table', 42),
(66, '2025_07_17_181200_create_product_variant_attributes_table', 8),
(67, '2025_07_17_181300_create_price_lists_table', 43),
(68, '2025_07_17_181400_create_terms_conditions_table', 43),
(69, '2025_07_17_190000_add_company_id_to_critical_tables', 43),
(70, '2025_07_17_190100_assign_default_company_to_existing_data', 43),
(71, '2025_07_17_200000_enhance_warehouse_plant_relationship', 43),
(72, '2025_07_17_220000_create_uom_master_table', 9),
(73, '2025_07_17_220001_create_uom_conversion_table', 44),
(74, '2025_07_17_220002_enhance_uom_master_table', 44),
(75, '2025_07_17_230000_refactor_uom_conversion_to_use_ids', 44),
(76, '2025_07_17_230001_cleanup_uom_conversion_columns', 10),
(77, '2025_07_25_100000_create_state_master_table', 45),
(78, '2025_07_25_100001_update_company_infos_state_to_foreign_key', 46),
(79, '2025_07_25_100002_update_plant_masters_state_to_foreign_key', 47),
(80, '2025_07_25_100003_update_address_state_to_foreign_key', 48),
(81, '2025_07_25_100004_update_account_ledger_state_to_foreign_key', 49),
(82, '2025_07_25_100005_update_gstin_state_to_foreign_key', 50),
(85, '2025_07_25_100006_remove_gstin_from_company_master', 51),
(86, '2025_07_25_100007_remove_gstin_column_raw_sql', 52),
(87, '2025_07_26_100709_create_company_gstin_table', 53),
(88, '2025_07_29_174627_make_legal_name_nullable_in_company_gstin_table', 54),
(89, '2025_08_12_100000_alter_plants_enhancements', 54),
(90, '2025_08_12_110000_create_warehouse_master_table', 54),
(91, '2025_08_12_110000_create_warehouse_masters_table', 54),
(92, '2025_08_14_000001_update_plant_masters_add_state_id_and_fix_company_fk', 55),
(93, '2025_08_14_000100_create_department_masters_table', 55),
(94, '2025_08_14_000110_create_plant_department_map_table', 56),
(95, '2025_08_14_001000_add_department_id_to_warehouse_master_table', 57),
(96, '2025_08_22_001500_update_address_fields_in_warehouse_master_table', 58),
(97, '2025_08_23_120500_add_state_code_to_warehouse_master_table', 59);

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

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE IF NOT EXISTS `model_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE IF NOT EXISTS `model_has_roles` (
  `role_id` bigint UNSIGNED NOT NULL,
  `model_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `number_series`
--

CREATE TABLE IF NOT EXISTS `number_series` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `prefix` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `suffix` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `next_number` int NOT NULL,
  `increment_by` int NOT NULL DEFAULT '1',
  `min_digits` int NOT NULL DEFAULT '4',
  `separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '-',
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `number_series_code_unique` (`code`),
  KEY `number_series_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `party_type`
--

CREATE TABLE IF NOT EXISTS `party_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `party_type`
--

INSERT INTO `party_type` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(1, 'Vendor', 'Supplier of goods or services', '2025-08-08 12:50:18', '2025-08-08 12:50:18'),
(2, 'Customer', 'Purchaser of goods or services', '2025-08-08 12:50:18', '2025-08-08 12:50:18'),
(3, 'Employee', 'Company staff member', '2025-08-08 12:50:18', '2025-08-08 12:50:18'),
(4, 'Contractor', 'External service provider', '2025-08-08 12:50:18', '2025-08-08 12:50:18'),
(5, 'Government', 'Government entity', '2025-08-08 12:50:18', '2025-08-08 12:50:18'),
(6, 'Partner', 'Business partner or affiliate', '2025-08-08 12:50:18', '2025-08-08 12:50:18');

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

--
-- Table structure for table `permissions`
--

CREATE TABLE IF NOT EXISTS `permissions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `perm_guard_unique` (`name`,`guard_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `plant_departments`
--

CREATE TABLE IF NOT EXISTS `plant_departments` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `plant_id` bigint UNSIGNED NOT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plant_departments_code_unique` (`code`),
  KEY `plant_departments_plant_id_foreign` (`plant_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `plant_department_map`
--

CREATE TABLE IF NOT EXISTS `plant_department_map` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `plant_id` bigint UNSIGNED NOT NULL,
  `department_id` bigint UNSIGNED NOT NULL,
  `effective_from` date DEFAULT NULL,
  `effective_to` date DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE','MAINTENANCE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `plant_department_map_plant_id_foreign` (`plant_id`),
  KEY `plant_department_map_department_id_foreign` (`department_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `plant_department_map`
--

INSERT INTO `plant_department_map` (`id`, `plant_id`, `department_id`, `effective_from`, `effective_to`, `status`, `created_at`, `updated_at`) VALUES
(1, 2, 1, '2025-08-01', '2025-08-31', 'ACTIVE', '2025-08-15 04:57:44', '2025-08-15 04:57:44'),
(2, 2, 2, '2025-08-01', '2027-05-15', 'ACTIVE', '2025-08-15 05:04:33', '2025-08-15 05:04:33');

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

--
-- Table structure for table `plant_masters`
--

CREATE TABLE IF NOT EXISTS `plant_masters` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` bigint UNSIGNED DEFAULT NULL,
  `country` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pincode` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` enum('MANUFACTURING','OFFICE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MANUFACTURING',
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `manager_user_id` bigint UNSIGNED DEFAULT NULL,
  `gstin_id` bigint UNSIGNED DEFAULT NULL,
  `geo_lat` decimal(10,7) DEFAULT NULL,
  `geo_long` decimal(10,7) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plant_masters_code_unique` (`code`),
  KEY `plant_masters_company_id_foreign` (`company_id`),
  KEY `plant_masters_state_id_foreign` (`state_id`),
  KEY `plant_masters_manager_user_id_foreign` (`manager_user_id`),
  KEY `plant_masters_gstin_id_foreign` (`gstin_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `plant_masters`
--

INSERT INTO `plant_masters` (`id`, `company_id`, `name`, `code`, `address`, `city`, `state_id`, `country`, `pincode`, `phone`, `email`, `type`, `status`, `created_at`, `updated_at`, `created_by`, `updated_by`, `deleted_at`, `manager_user_id`, `gstin_id`, `geo_lat`, `geo_long`) VALUES
(1, 1, 'Mumbai Plant', 'P001', '202 OMKAR APT House No 829 10', 'Thane', 14, 'India', '400706', '9004588982', 'dummy@dot-next.in', 'MANUFACTURING', 'ACTIVE', '2025-08-14 05:20:34', '2025-08-14 05:21:22', 'AJIT HOGADE', 'AJIT HOGADE', '2025-08-14 05:21:22', 1, 1, 2.2250000, 2.6588000),
(2, 1, 'Mumbai Plant', 'P002', 'Nerul', 'Navi Mumbai', 14, 'India', '400703', '9876543211', 'ap28@indiataekwondo.com', 'MANUFACTURING', 'ACTIVE', '2025-08-14 05:22:36', '2025-08-14 05:22:36', 'AJIT HOGADE', NULL, NULL, 1, 1, 0.0000000, 2.6588000);

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

--
-- Table structure for table `plant_shifts`
--

CREATE TABLE IF NOT EXISTS `plant_shifts` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `plant_id` bigint UNSIGNED NOT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `break_minutes` int NOT NULL DEFAULT '0',
  `is_night_shift` tinyint(1) NOT NULL DEFAULT '0',
  `working_days_mask` char(7) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1111100' COMMENT 'Mon-Sun as 1/0',
  `overlap_allowed` tinyint(1) NOT NULL DEFAULT '0',
  `grace_minutes` smallint NOT NULL DEFAULT '0',
  `color_code` varchar(7) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plant_shifts_code_unique` (`code`),
  KEY `plant_shifts_plant_id_foreign` (`plant_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `plant_work_centers`
--

CREATE TABLE IF NOT EXISTS `plant_work_centers` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `plant_id` bigint UNSIGNED NOT NULL,
  `department_id` bigint UNSIGNED NOT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `work_center_type` enum('MACHINE','LABOR','PACKING','QUALITY','MAINTENANCE','OUTSOURCE') COLLATE utf8mb4_unicode_ci NOT NULL,
  `standard_cycle_time_seconds` int DEFAULT NULL,
  `efficiency_target_percent` decimal(5,2) DEFAULT NULL,
  `cost_rate_per_hour` decimal(12,2) DEFAULT NULL,
  `is_critical` tinyint(1) NOT NULL DEFAULT '0',
  `capacity_per_hour` int NOT NULL DEFAULT '0',
  `workers_required` int NOT NULL DEFAULT '1',
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plant_work_centers_code_unique` (`code`),
  KEY `plant_work_centers_plant_id_foreign` (`plant_id`),
  KEY `plant_work_centers_department_id_foreign` (`department_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `price_lists`
--

CREATE TABLE IF NOT EXISTS `price_lists` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `price_list_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `price_list_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `price_list_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'SELLING',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `applicable_for` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ALL',
  `customer_groups` json DEFAULT NULL,
  `territories` json DEFAULT NULL,
  `vendor_groups` json DEFAULT NULL,
  `valid_from` date DEFAULT NULL,
  `valid_until` date DEFAULT NULL,
  `valid_from_time` time DEFAULT NULL,
  `valid_until_time` time DEFAULT NULL,
  `valid_days_of_week` json DEFAULT NULL,
  `base_price_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MANUAL',
  `price_determination` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FIXED',
  `default_markup_percentage` decimal(8,2) NOT NULL DEFAULT '0.00',
  `default_discount_percentage` decimal(8,2) NOT NULL DEFAULT '0.00',
  `pricing_formula` json DEFAULT NULL,
  `quantity_based_pricing` tinyint(1) NOT NULL DEFAULT '0',
  `tier_based_pricing` tinyint(1) NOT NULL DEFAULT '0',
  `quantity_tiers` json DEFAULT NULL,
  `prices_include_tax` tinyint(1) NOT NULL DEFAULT '0',
  `tax_template` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `apply_shipping_charges` tinyint(1) NOT NULL DEFAULT '1',
  `additional_charges` json DEFAULT NULL,
  `approval_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'APPROVED',
  `approved_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `approval_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `auto_update_from_supplier` tinyint(1) NOT NULL DEFAULT '0',
  `supplier_price_list_ref` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `update_frequency_days` int NOT NULL DEFAULT '30',
  `last_auto_update` timestamp NULL DEFAULT NULL,
  `items_count` int NOT NULL DEFAULT '0',
  `avg_margin_percentage` decimal(8,2) NOT NULL DEFAULT '0.00',
  `last_used_date` timestamp NULL DEFAULT NULL,
  `usage_count` int NOT NULL DEFAULT '0',
  `is_system_generated` tinyint(1) NOT NULL DEFAULT '0',
  `generated_from` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `generation_parameters` json DEFAULT NULL,
  `internal_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `price_lists_price_list_code_unique` (`price_list_code`),
  KEY `idx_price_lists_main` (`company_id`,`price_list_type`,`is_active`),
  KEY `idx_price_lists_validity` (`valid_from`,`valid_until`),
  KEY `idx_price_lists_currency` (`currency`,`applicable_for`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_masters`
--

CREATE TABLE IF NOT EXISTS `product_masters` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `product_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_master_id` bigint UNSIGNED DEFAULT NULL,
  `brand_id` bigint UNSIGNED DEFAULT NULL,
  `base_uom_id` bigint UNSIGNED NOT NULL,
  `hsn_id` bigint UNSIGNED DEFAULT NULL,
  `sku_pattern` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `description` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_uom_id` bigint UNSIGNED DEFAULT NULL,
  `sales_uom_id` bigint UNSIGNED DEFAULT NULL,
  `manufacturing_uom_id` bigint UNSIGNED DEFAULT NULL,
  `product_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_manufactured` tinyint(1) NOT NULL DEFAULT '0',
  `bom_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `batch_tracked` tinyint(1) NOT NULL DEFAULT '0',
  `serial_tracked` tinyint(1) NOT NULL DEFAULT '0',
  `manufacturer` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shelf_life_days` int DEFAULT NULL,
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `weight_per_unit` decimal(10,3) DEFAULT NULL,
  `weight_uom` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'KG',
  `length` decimal(10,2) DEFAULT NULL,
  `width` decimal(10,2) DEFAULT NULL,
  `height` decimal(10,2) DEFAULT NULL,
  `dimension_uom` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CM',
  `item_group` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_template` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_purchase_item` tinyint(1) NOT NULL DEFAULT '1',
  `is_sales_item` tinyint(1) NOT NULL DEFAULT '1',
  `is_service_item` tinyint(1) NOT NULL DEFAULT '0',
  `is_stock_item` tinyint(1) NOT NULL DEFAULT '1',
  `inspection_required` tinyint(1) NOT NULL DEFAULT '0',
  `quality_inspection_template` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inspection_criteria` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `valuation_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FIFO',
  `standard_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `last_purchase_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `last_sales_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `include_item_in_manufacturing` tinyint(1) NOT NULL DEFAULT '0',
  `default_bom` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `has_variants` tinyint(1) DEFAULT '0',
  `lead_time_days` int NOT NULL DEFAULT '0',
  `scrap_percentage` decimal(5,2) NOT NULL DEFAULT '0.00',
  `preferred_vendors` json DEFAULT NULL,
  `customer_restrictions` json DEFAULT NULL,
  `allow_alternative_item` tinyint(1) NOT NULL DEFAULT '0',
  `is_fixed_asset` tinyint(1) NOT NULL DEFAULT '0',
  `auto_create_assets` tinyint(1) NOT NULL DEFAULT '0',
  `asset_category` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `asset_naming_series` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `custom_fields` json DEFAULT NULL,
  `internal_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_template` tinyint(1) NOT NULL DEFAULT '0',
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_masters_product_code_unique` (`product_code`),
  KEY `product_masters_base_uom_id_foreign` (`base_uom_id`),
  KEY `product_masters_purchase_uom_id_foreign` (`purchase_uom_id`),
  KEY `product_masters_sales_uom_id_foreign` (`sales_uom_id`),
  KEY `product_masters_manufacturing_uom_id_foreign` (`manufacturing_uom_id`),
  KEY `product_masters_product_code_index` (`product_code`),
  KEY `product_masters_product_type_index` (`product_type`),
  KEY `product_masters_status_index` (`status`),
  KEY `product_masters_category_id_index` (`category_master_id`),
  KEY `product_masters_brand_id_foreign` (`brand_id`),
  KEY `product_masters_hsn_id_foreign` (`hsn_id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_masters`
--

INSERT INTO `product_masters` (`id`, `product_code`, `product_name`, `category_master_id`, `brand_id`, `base_uom_id`, `hsn_id`, `sku_pattern`, `status`, `description`, `purchase_uom_id`, `sales_uom_id`, `manufacturing_uom_id`, `product_type`, `is_manufactured`, `bom_code`, `batch_tracked`, `serial_tracked`, `manufacturer`, `shelf_life_days`, `created_by`, `created_at`, `updated_at`, `weight_per_unit`, `weight_uom`, `length`, `width`, `height`, `dimension_uom`, `item_group`, `tax_template`, `is_purchase_item`, `is_sales_item`, `is_service_item`, `is_stock_item`, `inspection_required`, `quality_inspection_template`, `inspection_criteria`, `valuation_method`, `standard_rate`, `last_purchase_rate`, `last_sales_rate`, `include_item_in_manufacturing`, `default_bom`, `has_variants`, `lead_time_days`, `scrap_percentage`, `preferred_vendors`, `customer_restrictions`, `allow_alternative_item`, `is_fixed_asset`, `auto_create_assets`, `asset_category`, `asset_naming_series`, `custom_fields`, `internal_notes`, `is_template`, `updated_by`) VALUES
(1, 'RO_FD', 'fdgdfg', 1, 1, 2, 1, 'RO_FD-{COLORR}-{SHAPE}-{BRAND}-{MATERIAL}', 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 'dfgdfg', NULL, 'AJIT HOGADE', '2025-07-30 02:14:21', '2025-07-30 02:14:21', NULL, 'KG', NULL, NULL, NULL, 'CM', NULL, NULL, 1, 1, 0, 1, 0, NULL, NULL, 'FIFO', 0.0000, 0.0000, 0.0000, 0, NULL, 1, 0, 0.00, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL),
(2, 'RO_ROCOUN', 'ROLLER CONTROL UNIT', 1, 1, 1, 1, 'RO_ROCOUN-{COLORR}-{SHAPE}-{BRAND}-{MATERIAL}', 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 'ddfd', NULL, 'AJIT HOGADE', '2025-07-31 00:23:30', '2025-07-31 00:23:30', NULL, 'KG', NULL, NULL, NULL, 'CM', NULL, NULL, 1, 1, 0, 1, 0, NULL, NULL, 'FIFO', 0.0000, 0.0000, 0.0000, 0, NULL, 1, 0, 0.00, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL),
(3, 'ZE_ZEMOTU', 'ZEBRA MOTORISED TUMBLER', 2, 1, 2, 1, 'ZE_ZEMOTU-{COLORR}', 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 'sfs', NULL, 'AJIT HOGADE', '2025-07-31 00:25:44', '2025-07-31 00:25:44', NULL, 'KG', NULL, NULL, NULL, 'CM', NULL, NULL, 1, 1, 0, 1, 0, NULL, NULL, 'FIFO', 0.0000, 0.0000, 0.0000, 0, NULL, 1, 0, 0.00, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL),
(4, 'RO_DS', 'dsdfsdf', 1, 1, 2, 1, 'RO_DS-{COLORR}-{SHAPE}-{BRAND}-{MATERIAL}', 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL, NULL, 'AJIT HOGADE', '2025-07-31 01:22:11', '2025-07-31 01:22:11', NULL, 'KG', NULL, NULL, NULL, 'CM', NULL, NULL, 1, 1, 0, 1, 0, NULL, NULL, 'FIFO', 0.0000, 0.0000, 0.0000, 0, NULL, 1, 0, 0.00, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL),
(5, 'RO_ROPR', 'Roller product', 1, 1, 1, 2, 'RO_ROPR-{COLORR}-{SHAPE}-{BRAND}-{MATERIAL}', 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 'dsfsdfsdf', NULL, 'AJIT HOGADE', '2025-07-31 04:38:08', '2025-07-31 07:44:54', NULL, 'KG', NULL, NULL, NULL, 'CM', NULL, NULL, 1, 1, 0, 1, 0, NULL, NULL, 'FIFO', 0.0000, 0.0000, 0.0000, 0, NULL, 1, 0, 0.00, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL),
(6, 'ZE_DF', 'dfgdfg', 2, 1, 2, 1, 'ZE_DF-{COLORR}', 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 'fdgdfg', NULL, 'AJIT HOGADE', '2025-08-06 23:33:51', '2025-08-06 23:33:51', NULL, 'KG', NULL, NULL, NULL, 'CM', NULL, NULL, 1, 1, 0, 1, 0, NULL, NULL, 'FIFO', 0.0000, 0.0000, 0.0000, 0, NULL, 1, 0, 0.00, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, NULL);

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

--
-- Table structure for table `product_variants`
--

CREATE TABLE IF NOT EXISTS `product_variants` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sku` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `product_master_id` int NOT NULL,
  `warehouse_id` bigint DEFAULT NULL,
  `uom_id` bigint DEFAULT NULL,
  `brand_id` bigint DEFAULT NULL,
  `hsn_id` bigint DEFAULT NULL,
  `variant_name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `full_name` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `unit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `purchase_price` decimal(12,2) DEFAULT '0.00',
  `selling_price` decimal(12,2) DEFAULT '0.00',
  `standard_cost` decimal(12,2) DEFAULT '0.00',
  `currency` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT 'INR',
  `current_stock` decimal(13,3) DEFAULT '0.000',
  `minimum_stock` decimal(13,3) DEFAULT '0.000',
  `maximum_stock` decimal(13,3) DEFAULT '0.000',
  `reorder_point` decimal(13,3) DEFAULT '0.000',
  `lead_time_days` int DEFAULT '0',
  `preferred_vendor_id` int DEFAULT NULL,
  `barcode` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `weight_kg` decimal(8,3) DEFAULT NULL,
  `dimensions_json` json DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT 'ACTIVE',
  `created_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_by` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sku` (`sku`),
  KEY `idx_product_variants_product` (`product_master_id`),
  KEY `idx_product_variants_sku` (`sku`),
  KEY `uom_id` (`uom_id`,`brand_id`,`hsn_id`),
  KEY `warehouse_id` (`warehouse_id`)
) ENGINE=MyISAM AUTO_INCREMENT=99 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin;

--
-- Dumping data for table `product_variants`
--

INSERT INTO `product_variants` (`id`, `sku`, `product_master_id`, `warehouse_id`, `uom_id`, `brand_id`, `hsn_id`, `variant_name`, `full_name`, `unit`, `purchase_price`, `selling_price`, `standard_cost`, `currency`, `current_stock`, `minimum_stock`, `maximum_stock`, `reorder_point`, `lead_time_days`, `preferred_vendor_id`, `barcode`, `weight_kg`, `dimensions_json`, `status`, `created_by`, `created_at`, `updated_by`, `updated_at`, `deleted_at`) VALUES
(46, 'RO_ROPR_WH_SQ_SSG_MET', 5, NULL, NULL, NULL, NULL, 'White Square SSG Brand Metal', 'Roller product - White Square SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(45, 'RO_ROPR_WH_SQ_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'White Square SSG Brand PVC', 'Roller product - White Square SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(3, 'RB-38DCU-WH', 2, NULL, NULL, NULL, NULL, 'White', 'Roller Double Control Unit - White', 'PCS', 160.00, 200.00, 0.00, 'INR', 12.000, 5.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(4, 'RO-TMBL-38', 3, NULL, NULL, NULL, NULL, '38mm Manual', 'Roller Tumbler 38mm (15 Feet)', 'PCS', 145.00, 180.00, 0.00, 'INR', 15.000, 8.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(5, 'RO-TMBL-38-MOT', 3, NULL, NULL, NULL, NULL, '38mm Motorised', 'Zebra Motorised Tumbler (15 Feet)', 'PCS', 280.00, 350.00, 0.00, 'INR', 8.000, 5.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(6, 'RB-38PLT-WH', 4, NULL, NULL, NULL, NULL, 'White', 'Pelmet - White (15 Feet)', 'PCS', 95.00, 120.00, 0.00, 'INR', 20.000, 10.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(7, 'RB-38PLT-BR', 4, NULL, NULL, NULL, NULL, 'Brown', 'Pelmet - Brown (15 Feet)', 'PCS', 95.00, 120.00, 0.00, 'INR', 15.000, 10.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(95, 'ZE_DF_BL', 6, NULL, NULL, NULL, NULL, 'Blue', 'dfgdfg - Blue', NULL, NULL, NULL, 0.00, 'INR', 111.000, 22.000, 44.000, 33.000, 10, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-08-06 23:33:51', NULL, '2025-08-06 23:33:51', NULL),
(94, 'RO_ROPR_SU_SSG_MET', 5, NULL, NULL, NULL, NULL, 'U Shape SSG Brand Metal', 'Roller product - U Shape SSG Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-08-05 05:54:08', NULL, '2025-08-05 05:54:08', NULL),
(93, 'RO_ROPR_SU_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'U Shape SSG Brand PVC', 'Roller product - U Shape SSG Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-08-05 05:54:08', NULL, '2025-08-05 05:54:08', NULL),
(11, 'IS-9MM-ADH', 6, NULL, NULL, NULL, NULL, '9mm', 'Insert Strip 9mm', 'PCS', 12.00, 15.00, 0.00, 'INR', 60.000, 25.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(12, 'IS-13MM-ADH', 6, NULL, NULL, NULL, NULL, '13mm', 'Insert Strip 13mm', 'PCS', 15.00, 18.00, 0.00, 'INR', 55.000, 25.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(13, 'RB-SC-CO-IV', 7, NULL, NULL, NULL, NULL, 'Collar Non Brand Ivory', 'Bottom Side Cap - Collar - Non Brand - Ivory', 'PCS', 16.00, 20.00, 0.00, 'INR', 85.000, 50.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(14, 'RB-SC-CO-WH', 7, NULL, NULL, NULL, NULL, 'Collar Non Brand White', 'Bottom Side Cap - Collar - Non Brand - White', 'PCS', 16.00, 20.00, 0.00, 'INR', 92.000, 50.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(15, 'RB-SC-CO-SSG-IV', 7, NULL, NULL, NULL, NULL, 'Collar SSG Brand Ivory', 'Bottom Side Cap - Collar - SSG Brand - Ivory', 'PCS', 18.00, 25.00, 0.00, 'INR', 78.000, 50.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(16, 'RB-SC-IV', 7, NULL, NULL, NULL, NULL, 'Non Brand Ivory', 'Bottom Side Cap - Non Brand - Ivory', 'PCS', 14.00, 18.00, 0.00, 'INR', 105.000, 50.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(17, 'RB-SC-SSG-IV', 7, NULL, NULL, NULL, NULL, 'SSG Brand Ivory', 'Bottom Side Cap - SSG Brand - Ivory', 'PCS', 16.00, 22.00, 0.00, 'INR', 88.000, 50.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(18, 'ZB-38MU-WH', 8, NULL, NULL, NULL, NULL, 'White', 'Zebra Main Clutch + Chain - White', 'PCS', 145.00, 180.00, 0.00, 'INR', 15.000, 8.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(19, 'ZB-38MU-BR', 8, NULL, NULL, NULL, NULL, 'Brown', 'Zebra Main Clutch + Chain - Brown', 'PCS', 145.00, 180.00, 0.00, 'INR', 12.000, 8.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(20, 'ZB-38DC-WH', 9, NULL, NULL, NULL, NULL, 'White', 'Zebra Dummy Clutch - White', 'PCS', 95.00, 120.00, 0.00, 'INR', 20.000, 10.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(21, 'ZB-38DC-BR', 9, NULL, NULL, NULL, NULL, 'Brown', 'Zebra Dummy Clutch - Brown', 'PCS', 95.00, 120.00, 0.00, 'INR', 18.000, 10.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(22, 'ZB-BC-SQ-WH', 10, NULL, NULL, NULL, NULL, 'Square White', 'Zebra Bottom Side Cap Set - Square - White', 'PCS', 35.00, 45.00, 0.00, 'INR', 35.000, 20.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(23, 'ZB-BC-SQ-BR', 10, NULL, NULL, NULL, NULL, 'Square Brown', 'Zebra Bottom Side Cap Set - Square - Brown', 'PCS', 35.00, 45.00, 0.00, 'INR', 32.000, 20.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(24, 'ZB-BC-US-WH', 10, NULL, NULL, NULL, NULL, 'U Shape White', 'Zebra Bottom Side Cap Set - U Shape - White', 'PCS', 35.00, 45.00, 0.00, 'INR', 28.000, 20.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(25, 'ZB-BC-US-BR', 10, NULL, NULL, NULL, NULL, 'U Shape Brown', 'Zebra Bottom Side Cap Set - U Shape - Brown', 'PCS', 35.00, 45.00, 0.00, 'INR', 25.000, 20.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(26, 'WB-50CU-EL-WH', 16, NULL, NULL, NULL, NULL, 'Easy Lift White', 'Wooden Control Unit Easy Lift White', 'PCS', 185.00, 230.00, 0.00, 'INR', 12.000, 6.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(27, 'WB-50CU-EL-BR', 16, NULL, NULL, NULL, NULL, 'Easy Lift Light Brown', 'Wooden Control Unit Easy Lift Light Brown', 'PCS', 185.00, 230.00, 0.00, 'INR', 10.000, 6.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(28, 'WB-50CU-EL-CFF', 16, NULL, NULL, NULL, NULL, 'Easy Lift Coffee', 'Wooden Control Unit Easy Lift Coffee', 'PCS', 185.00, 230.00, 0.00, 'INR', 8.000, 6.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(29, 'WB-50CU-EL-GR', 16, NULL, NULL, NULL, NULL, 'Easy Lift Grey', 'Wooden Control Unit Easy Lift Grey', 'PCS', 185.00, 230.00, 0.00, 'INR', 6.000, 6.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 10:55:31', NULL),
(30, 'SSG35RL-6/28', 36, NULL, NULL, NULL, NULL, 'Remote Model', 'Tubular Remote Motor (SSG35RL-6/28)', 'PCS', 2240.00, 2800.00, 0.00, 'INR', 5.000, 2.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 11:00:49', NULL),
(31, 'SSG35SL-6/28', 36, NULL, NULL, NULL, NULL, 'Switch Model', 'Tubular Switch Motor (SSG35SL-6/28)', 'PCS', 2080.00, 2600.00, 0.00, 'INR', 6.000, 2.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 11:00:49', NULL),
(32, 'SSG52E-75/20', 37, NULL, NULL, NULL, NULL, 'Remote 3Wire', 'Curtain Motor (SSG52E-75/20) (Remote) (3Wire)', 'PCS', 3360.00, 4200.00, 0.00, 'INR', 3.000, 2.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 11:00:49', NULL),
(33, 'SSG52S-75/20', 37, NULL, NULL, NULL, NULL, 'Switch 4Wire', 'Curtain Motor (SSG52S-75/20) (Switch) (4 Wire)', 'PCS', 3200.00, 4000.00, 0.00, 'INR', 4.000, 2.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 11:00:49', NULL),
(34, 'SSG72EV-75/20', 37, NULL, NULL, NULL, NULL, 'Remote/Switch 5Wire', 'Curtain Motor (SSG72EV-75/20) (Remote/Switch) 5 Wire', 'PCS', 3600.00, 4500.00, 0.00, 'INR', 2.000, 1.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 11:00:49', NULL),
(35, 'SSG3100', 38, NULL, NULL, NULL, NULL, 'Single Channel', 'Single Channel Remote', 'PCS', 360.00, 450.00, 0.00, 'INR', 12.000, 5.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AjitHogade', '2025-07-05 02:26:42', NULL, '2025-07-05 11:00:49', NULL),
(37, 'RO_FD_WH_SQ', 1, NULL, NULL, NULL, NULL, 'White Square', 'fdgdfg - White Square', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-30 02:14:21', NULL, '2025-07-30 02:14:21', NULL),
(38, 'RO_FD_WH_CO', 1, NULL, NULL, NULL, NULL, 'White Collar', 'fdgdfg - White Collar', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-30 02:14:21', NULL, '2025-07-30 02:14:21', NULL),
(39, 'RO_FD_BL_SQ', 1, NULL, NULL, NULL, NULL, 'Blue Square', 'fdgdfg - Blue Square', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-30 02:14:21', NULL, '2025-07-30 02:14:21', NULL),
(40, 'RO_FD_BL_CO', 1, NULL, NULL, NULL, NULL, 'Blue Collar', 'fdgdfg - Blue Collar', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-30 02:14:21', NULL, '2025-07-30 02:14:21', NULL),
(41, 'RO_ROCOUN_WH_SQ_SSG_PVC', 2, NULL, NULL, NULL, NULL, 'White Square SSG Brand PVC', 'ROLLER CONTROL UNIT - White Square SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 00:23:30', NULL, '2025-07-31 00:23:30', NULL),
(42, 'ZE_ZEMOTU_BL', 3, NULL, NULL, NULL, NULL, 'Blue', 'ZEBRA MOTORISED TUMBLER - Blue', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 00:25:44', NULL, '2025-07-31 00:25:44', NULL),
(43, 'ZE_ZEMOTU_BLK', 3, NULL, NULL, NULL, NULL, 'Black', 'ZEBRA MOTORISED TUMBLER - Black', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 00:25:44', NULL, '2025-07-31 00:25:44', NULL),
(44, 'RO_DS_BL_CO', 4, NULL, NULL, NULL, NULL, 'Blue Collar', 'dsdfsdf - Blue Collar', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 01:22:11', NULL, '2025-07-31 01:22:11', NULL),
(47, 'RO_ROPR_WH_SQ_NON_PVC', 5, NULL, NULL, NULL, NULL, 'White Square non Brand PVC', 'Roller product - White Square non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(48, 'RO_ROPR_WH_SQ_NON_MET', 5, NULL, NULL, NULL, NULL, 'White Square non Brand Metal', 'Roller product - White Square non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(49, 'RO_ROPR_WH_CO_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'White Collar SSG Brand PVC', 'Roller product - White Collar SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(50, 'RO_ROPR_WH_CO_SSG_MET', 5, NULL, NULL, NULL, NULL, 'White Collar SSG Brand Metal', 'Roller product - White Collar SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(51, 'RO_ROPR_WH_CO_NON_PVC', 5, NULL, NULL, NULL, NULL, 'White Collar non Brand PVC', 'Roller product - White Collar non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(52, 'RO_ROPR_WH_CO_NON_MET', 5, NULL, NULL, NULL, NULL, 'White Collar non Brand Metal', 'Roller product - White Collar non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(53, 'RO_ROPR_WH_SU_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'White U Shape SSG Brand PVC', 'Roller product - White U Shape SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(54, 'RO_ROPR_WH_SU_SSG_MET', 5, NULL, NULL, NULL, NULL, 'White U Shape SSG Brand Metal', 'Roller product - White U Shape SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(55, 'RO_ROPR_WH_SU_NON_PVC', 5, NULL, NULL, NULL, NULL, 'White U Shape non Brand PVC', 'Roller product - White U Shape non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:08', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(56, 'RO_ROPR_WH_SU_NON_MET', 5, NULL, NULL, NULL, NULL, 'White U Shape non Brand Metal', 'Roller product - White U Shape non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(57, 'RO_ROPR_BL_SQ_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Blue Square SSG Brand PVC', 'Roller product - Blue Square SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(58, 'RO_ROPR_BL_SQ_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Blue Square SSG Brand Metal', 'Roller product - Blue Square SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(59, 'RO_ROPR_BL_SQ_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Blue Square non Brand PVC', 'Roller product - Blue Square non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(60, 'RO_ROPR_BL_SQ_NON_MET', 5, NULL, NULL, NULL, NULL, 'Blue Square non Brand Metal', 'Roller product - Blue Square non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(61, 'RO_ROPR_BL_CO_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Blue Collar SSG Brand PVC', 'Roller product - Blue Collar SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(62, 'RO_ROPR_BL_CO_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Blue Collar SSG Brand Metal', 'Roller product - Blue Collar SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(63, 'RO_ROPR_BL_CO_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Blue Collar non Brand PVC', 'Roller product - Blue Collar non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(64, 'RO_ROPR_BL_CO_NON_MET', 5, NULL, NULL, NULL, NULL, 'Blue Collar non Brand Metal', 'Roller product - Blue Collar non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(65, 'RO_ROPR_BL_SU_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Blue U Shape SSG Brand PVC', 'Roller product - Blue U Shape SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(66, 'RO_ROPR_BL_SU_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Blue U Shape SSG Brand Metal', 'Roller product - Blue U Shape SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(67, 'RO_ROPR_BL_SU_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Blue U Shape non Brand PVC', 'Roller product - Blue U Shape non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(68, 'RO_ROPR_BL_SU_NON_MET', 5, NULL, NULL, NULL, NULL, 'Blue U Shape non Brand Metal', 'Roller product - Blue U Shape non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(69, 'RO_ROPR_RED_SQ_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Red Square SSG Brand PVC', 'Roller product - Red Square SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(70, 'RO_ROPR_RED_SQ_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Red Square SSG Brand Metal', 'Roller product - Red Square SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(71, 'RO_ROPR_RED_SQ_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Red Square non Brand PVC', 'Roller product - Red Square non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(72, 'RO_ROPR_RED_SQ_NON_MET', 5, NULL, NULL, NULL, NULL, 'Red Square non Brand Metal', 'Roller product - Red Square non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(73, 'RO_ROPR_RED_CO_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Red Collar SSG Brand PVC', 'Roller product - Red Collar SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(74, 'RO_ROPR_RED_CO_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Red Collar SSG Brand Metal', 'Roller product - Red Collar SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(75, 'RO_ROPR_RED_CO_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Red Collar non Brand PVC', 'Roller product - Red Collar non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(76, 'RO_ROPR_RED_CO_NON_MET', 5, NULL, NULL, NULL, NULL, 'Red Collar non Brand Metal', 'Roller product - Red Collar non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(77, 'RO_ROPR_RED_SU_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Red U Shape SSG Brand PVC', 'Roller product - Red U Shape SSG Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(78, 'RO_ROPR_RED_SU_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Red U Shape SSG Brand Metal', 'Roller product - Red U Shape SSG Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(79, 'RO_ROPR_RED_SU_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Red U Shape non Brand PVC', 'Roller product - Red U Shape non Brand PVC', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(80, 'RO_ROPR_RED_SU_NON_MET', 5, NULL, NULL, NULL, NULL, 'Red U Shape non Brand Metal', 'Roller product - Red U Shape non Brand Metal', NULL, 0.00, 0.00, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 04:38:09', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL),
(81, 'RO_ROPR_BLK_SQ_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Black Square SSG Brand PVC', 'Roller product - Black Square SSG Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(82, 'RO_ROPR_BLK_SQ_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Black Square SSG Brand Metal', 'Roller product - Black Square SSG Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(83, 'RO_ROPR_BLK_SQ_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Black Square non Brand PVC', 'Roller product - Black Square non Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(84, 'RO_ROPR_BLK_SQ_NON_MET', 5, NULL, NULL, NULL, NULL, 'Black Square non Brand Metal', 'Roller product - Black Square non Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(85, 'RO_ROPR_BLK_CO_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Black Collar SSG Brand PVC', 'Roller product - Black Collar SSG Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(86, 'RO_ROPR_BLK_CO_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Black Collar SSG Brand Metal', 'Roller product - Black Collar SSG Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(87, 'RO_ROPR_BLK_CO_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Black Collar non Brand PVC', 'Roller product - Black Collar non Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(88, 'RO_ROPR_BLK_CO_NON_MET', 5, NULL, NULL, NULL, NULL, 'Black Collar non Brand Metal', 'Roller product - Black Collar non Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(89, 'RO_ROPR_BLK_SU_SSG_PVC', 5, NULL, NULL, NULL, NULL, 'Black U Shape SSG Brand PVC', 'Roller product - Black U Shape SSG Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(90, 'RO_ROPR_BLK_SU_SSG_MET', 5, NULL, NULL, NULL, NULL, 'Black U Shape SSG Brand Metal', 'Roller product - Black U Shape SSG Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(91, 'RO_ROPR_BLK_SU_NON_PVC', 5, NULL, NULL, NULL, NULL, 'Black U Shape non Brand PVC', 'Roller product - Black U Shape non Brand PVC', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(92, 'RO_ROPR_BLK_SU_NON_MET', 5, NULL, NULL, NULL, NULL, 'Black U Shape non Brand Metal', 'Roller product - Black U Shape non Brand Metal', NULL, NULL, NULL, 0.00, 'INR', 0.000, 0.000, 0.000, 0.000, 0, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-07-31 07:44:54', NULL, '2025-07-31 07:44:54', NULL),
(96, 'ZE_DF_BLK', 6, NULL, NULL, NULL, NULL, 'Black', 'dfgdfg - Black', NULL, NULL, NULL, 0.00, 'INR', 111.000, 22.000, 44.000, 33.000, 10, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-08-06 23:33:51', NULL, '2025-08-06 23:33:51', NULL),
(97, 'ZE_DF_RED', 6, NULL, NULL, NULL, NULL, 'Red', 'dfgdfg - Red', NULL, NULL, NULL, 0.00, 'INR', 111.000, 22.000, 44.000, 33.000, 10, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-08-06 23:33:51', NULL, '2025-08-06 23:33:51', NULL),
(98, 'ZE_DF_WH', 6, NULL, NULL, NULL, NULL, 'White', 'dfgdfg - White', NULL, NULL, NULL, 0.00, 'INR', 111.000, 22.000, 44.000, 33.000, 10, NULL, NULL, NULL, NULL, 'ACTIVE', 'AJIT HOGADE', '2025-08-06 23:33:51', NULL, '2025-08-06 23:33:51', NULL);

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

--
-- Table structure for table `product_variants_11`
--

CREATE TABLE IF NOT EXISTS `product_variants_11` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_master_id` bigint UNSIGNED NOT NULL,
  `sku` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `full_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uom_id` bigint UNSIGNED DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `stock` int NOT NULL DEFAULT '0',
  `status` enum('ACTIVE','INACTIVE') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `brand_id` bigint UNSIGNED DEFAULT NULL,
  `hsn_id` bigint UNSIGNED DEFAULT NULL,
  `default_warehouse_id` bigint UNSIGNED DEFAULT NULL,
  `item_tax_template_id` bigint UNSIGNED DEFAULT NULL,
  `is_stock_item` tinyint(1) NOT NULL DEFAULT '1',
  `is_sales_item` tinyint(1) NOT NULL DEFAULT '1',
  `is_purchase_item` tinyint(1) NOT NULL DEFAULT '1',
  `opening_stock` decimal(13,3) NOT NULL DEFAULT '0.000',
  `opening_value` decimal(15,2) NOT NULL DEFAULT '0.00',
  `valuation_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FIFO',
  `default_uom_id` bigint UNSIGNED DEFAULT NULL,
  `reserved_qty` decimal(13,3) NOT NULL DEFAULT '0.000',
  `ordered_qty` decimal(13,3) NOT NULL DEFAULT '0.000',
  `available_qty` decimal(13,3) NOT NULL DEFAULT '0.000',
  `batch_number_series` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `serial_number_series` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `auto_create_serial` tinyint(1) NOT NULL DEFAULT '0',
  `auto_create_batch` tinyint(1) NOT NULL DEFAULT '0',
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_variants_sku_unique` (`sku`),
  KEY `product_variants_product_master_id_foreign` (`product_master_id`),
  KEY `product_variants_uom_id_index` (`uom_id`),
  KEY `product_variants_brand_id_foreign` (`brand_id`),
  KEY `product_variants_hsn_id_foreign` (`hsn_id`),
  KEY `product_variants_default_warehouse_id_foreign` (`default_warehouse_id`),
  KEY `product_variants_default_uom_id_foreign` (`default_uom_id`),
  KEY `product_variants_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_variant_attributes`
--

CREATE TABLE IF NOT EXISTS `product_variant_attributes` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_variant_id` bigint UNSIGNED NOT NULL,
  `attribute_master_id` bigint UNSIGNED NOT NULL,
  `attribute_value_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `updated_by` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `var_attr_unique` (`product_variant_id`,`attribute_master_id`),
  KEY `product_variant_attributes_attribute_master_id_foreign` (`attribute_master_id`),
  KEY `product_variant_attributes_attribute_value_id_foreign` (`attribute_value_id`)
) ENGINE=MyISAM AUTO_INCREMENT=363 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_variant_attributes`
--

INSERT INTO `product_variant_attributes` (`id`, `product_variant_id`, `attribute_master_id`, `attribute_value_id`, `created_at`, `updated_at`, `created_by`, `updated_by`) VALUES
(1, 37, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(2, 37, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(3, 38, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(4, 38, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(5, 39, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(6, 39, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(7, 40, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(8, 40, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(9, 41, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(10, 41, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(11, 41, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(12, 41, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(13, 42, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(14, 43, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(15, 44, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(16, 44, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(212, 45, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(211, 45, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(210, 45, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(209, 45, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(216, 46, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(215, 46, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(214, 46, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(213, 46, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(220, 47, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(219, 47, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(218, 47, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(217, 47, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(224, 48, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(223, 48, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(222, 48, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(221, 48, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(228, 49, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(227, 49, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(226, 49, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(225, 49, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(232, 50, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(231, 50, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(230, 50, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(229, 50, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(236, 51, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(235, 51, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(234, 51, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(233, 51, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(240, 52, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(239, 52, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(238, 52, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(237, 52, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(244, 53, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(243, 53, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(242, 53, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(241, 53, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(248, 54, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(247, 54, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(246, 54, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(245, 54, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(252, 55, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(251, 55, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(250, 55, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(249, 55, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(256, 56, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(255, 56, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(254, 56, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(253, 56, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL),
(260, 57, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(259, 57, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(258, 57, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(257, 57, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(264, 58, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(263, 58, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(262, 58, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(261, 58, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(268, 59, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(267, 59, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(266, 59, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(265, 59, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(272, 60, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(271, 60, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(270, 60, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(269, 60, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(276, 61, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(275, 61, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(274, 61, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(273, 61, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(280, 62, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(279, 62, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(278, 62, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(277, 62, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(284, 63, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(283, 63, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(282, 63, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(281, 63, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(288, 64, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(287, 64, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(286, 64, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(285, 64, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(292, 65, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(291, 65, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(290, 65, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(289, 65, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(296, 66, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(295, 66, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(294, 66, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(293, 66, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(300, 67, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(299, 67, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(298, 67, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(297, 67, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(304, 68, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(303, 68, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(302, 68, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(301, 68, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(308, 69, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(307, 69, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(306, 69, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(305, 69, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(312, 70, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(311, 70, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(310, 70, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(309, 70, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(316, 71, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(315, 71, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(314, 71, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(313, 71, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(320, 72, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(319, 72, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(318, 72, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(317, 72, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(324, 73, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(323, 73, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(322, 73, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(321, 73, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(328, 74, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(327, 74, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(326, 74, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(325, 74, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(332, 75, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(331, 75, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(330, 75, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(329, 75, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(336, 76, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(335, 76, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(334, 76, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(333, 76, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(340, 77, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(339, 77, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(338, 77, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(337, 77, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(344, 78, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(343, 78, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(342, 78, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(341, 78, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(348, 79, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(347, 79, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(346, 79, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(345, 79, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(352, 80, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(351, 80, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(350, 80, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(349, 80, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(161, 81, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(162, 81, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(163, 81, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(164, 81, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(165, 82, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(166, 82, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(167, 82, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(168, 82, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(169, 83, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(170, 83, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(171, 83, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(172, 83, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(173, 84, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(174, 84, 2, 7, NULL, NULL, 'AJIT HOGADE', NULL),
(175, 84, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(176, 84, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(177, 85, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(178, 85, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(179, 85, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(180, 85, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(181, 86, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(182, 86, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(183, 86, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(184, 86, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(185, 87, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(186, 87, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(187, 87, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(188, 87, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(189, 88, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(190, 88, 2, 6, NULL, NULL, 'AJIT HOGADE', NULL),
(191, 88, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(192, 88, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(193, 89, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(194, 89, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(195, 89, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(196, 89, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(197, 90, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(198, 90, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(199, 90, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(200, 90, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(201, 91, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(202, 91, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(203, 91, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(204, 91, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(205, 92, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(206, 92, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(207, 92, 3, 13, NULL, NULL, 'AJIT HOGADE', NULL),
(208, 92, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(353, 93, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(354, 93, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(355, 93, 4, 10, NULL, NULL, 'AJIT HOGADE', NULL),
(356, 94, 2, 8, NULL, NULL, 'AJIT HOGADE', NULL),
(357, 94, 3, 12, NULL, NULL, 'AJIT HOGADE', NULL),
(358, 94, 4, 11, NULL, NULL, 'AJIT HOGADE', NULL),
(359, 95, 1, 15, NULL, NULL, 'AJIT HOGADE', NULL),
(360, 96, 1, 17, NULL, NULL, 'AJIT HOGADE', NULL),
(361, 97, 1, 16, NULL, NULL, 'AJIT HOGADE', NULL),
(362, 98, 1, 14, NULL, NULL, 'AJIT HOGADE', NULL);

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

--
-- Table structure for table `product_variant_purchase_prices`
--

CREATE TABLE IF NOT EXISTS `product_variant_purchase_prices` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `variant_id` bigint UNSIGNED NOT NULL,
  `vendor_id` bigint UNSIGNED DEFAULT NULL,
  `rate` decimal(12,2) NOT NULL,
  `currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `valid_from` date DEFAULT NULL,
  `valid_to` date DEFAULT NULL,
  `min_qty` decimal(13,3) NOT NULL DEFAULT '1.000',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_variant_purchase_prices_vendor_id_foreign` (`vendor_id`),
  KEY `product_variant_purchase_prices_variant_id_vendor_id_index` (`variant_id`,`vendor_id`),
  KEY `product_variant_purchase_prices_valid_from_valid_to_index` (`valid_from`,`valid_to`),
  KEY `product_variant_purchase_prices_is_active_index` (`is_active`),
  KEY `product_variant_purchase_prices_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `product_variant_sales_prices`
--

CREATE TABLE IF NOT EXISTS `product_variant_sales_prices` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `variant_id` bigint UNSIGNED NOT NULL,
  `customer_id` bigint UNSIGNED DEFAULT NULL,
  `rate` decimal(12,2) NOT NULL,
  `currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `valid_from` date DEFAULT NULL,
  `valid_to` date DEFAULT NULL,
  `min_qty` decimal(13,3) NOT NULL DEFAULT '1.000',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_variant_sales_prices_customer_id_foreign` (`customer_id`),
  KEY `product_variant_sales_prices_variant_id_customer_id_index` (`variant_id`,`customer_id`),
  KEY `product_variant_sales_prices_valid_from_valid_to_index` (`valid_from`,`valid_to`),
  KEY `product_variant_sales_prices_is_active_index` (`is_active`),
  KEY `product_variant_sales_prices_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roles`
--

CREATE TABLE IF NOT EXISTS `roles` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_guard_unique` (`name`,`guard_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE IF NOT EXISTS `role_has_permissions` (
  `permission_id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sessions`
--

CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('kxZjqCzDOC31Ex3X9kPNnigEoj69DnLTJ2qm3Mcl', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiWWt3SU80NDlGTEJFOG1jM2piUkVpMWROUVZoREtRNUE0S2ZyOUswWiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDg6Imh0dHA6Ly9lcnAuc29kLm1lL29yZ2FuaXphdGlvbi93YXJlaG91c2UtbWFzdGVycyI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1755966035);

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

--
-- Table structure for table `shift_work_center`
--

CREATE TABLE IF NOT EXISTS `shift_work_center` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `shift_id` bigint UNSIGNED NOT NULL,
  `work_center_id` bigint UNSIGNED NOT NULL,
  `effective_from` date DEFAULT NULL,
  `effective_to` date DEFAULT NULL,
  `capacity_override` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_shift_work_center` (`shift_id`,`work_center_id`),
  KEY `shift_work_center_work_center_id_foreign` (`work_center_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `state_master`
--

CREATE TABLE IF NOT EXISTS `state_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `state_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `state_code` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `short_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'IND',
  `zone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'SYSTEM',
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `state_master_state_name_unique` (`state_name`),
  UNIQUE KEY `state_master_state_code_unique` (`state_code`),
  KEY `state_master_state_code_index` (`state_code`),
  KEY `state_master_is_active_index` (`is_active`),
  KEY `state_master_sort_order_index` (`sort_order`)
) ENGINE=MyISAM AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `state_master`
--

INSERT INTO `state_master` (`id`, `state_name`, `state_code`, `short_name`, `country_code`, `zone`, `is_active`, `sort_order`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Andhra Pradesh', '37', 'AP', 'IND', 'South', 1, 1, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(2, 'Arunachal Pradesh', '12', 'AR', 'IND', 'Northeast', 1, 2, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(3, 'Assam', '18', 'AS', 'IND', 'Northeast', 1, 3, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(4, 'Bihar', '10', 'BR', 'IND', 'East', 1, 4, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(5, 'Chhattisgarh', '22', 'CG', 'IND', 'Central', 1, 5, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(6, 'Goa', '30', 'GA', 'IND', 'West', 1, 6, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(7, 'Gujarat', '24', 'GJ', 'IND', 'West', 1, 7, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(8, 'Haryana', '06', 'HR', 'IND', 'North', 1, 8, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(9, 'Himachal Pradesh', '02', 'HP', 'IND', 'North', 1, 9, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(10, 'Jharkhand', '20', 'JH', 'IND', 'East', 1, 10, 'SYSTEM', NULL, '2025-07-25 09:15:58', '2025-07-25 09:15:58'),
(11, 'Karnataka', '29', 'KA', 'IND', 'South', 1, 11, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(12, 'Kerala', '32', 'KL', 'IND', 'South', 1, 12, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(13, 'Madhya Pradesh', '23', 'MP', 'IND', 'Central', 1, 13, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(14, 'Maharashtra', '27', 'MH', 'IND', 'West', 1, 14, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(15, 'Manipur', '14', 'MN', 'IND', 'Northeast', 1, 15, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(16, 'Meghalaya', '17', 'ML', 'IND', 'Northeast', 1, 16, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(17, 'Mizoram', '15', 'MZ', 'IND', 'Northeast', 1, 17, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(18, 'Nagaland', '13', 'NL', 'IND', 'Northeast', 1, 18, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(19, 'Odisha', '21', 'OD', 'IND', 'East', 1, 19, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(20, 'Punjab', '03', 'PB', 'IND', 'North', 1, 20, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(21, 'Rajasthan', '08', 'RJ', 'IND', 'North', 1, 21, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(22, 'Sikkim', '11', 'SK', 'IND', 'Northeast', 1, 22, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(23, 'Tamil Nadu', '33', 'TN', 'IND', 'South', 1, 23, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(24, 'Telangana', '36', 'TS', 'IND', 'South', 1, 24, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(25, 'Tripura', '16', 'TR', 'IND', 'Northeast', 1, 25, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(26, 'Uttar Pradesh', '09', 'UP', 'IND', 'North', 1, 26, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(27, 'Uttarakhand', '05', 'UK', 'IND', 'North', 1, 27, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(28, 'West Bengal', '19', 'WB', 'IND', 'East', 1, 28, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(29, 'Andaman and Nicobar Islands', '35', 'AN', 'IND', 'Islands', 1, 29, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(30, 'Chandigarh', '04', 'CH', 'IND', 'North', 1, 30, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(31, 'Dadra and Nagar Haveli and Daman and Diu', '26', 'DN', 'IND', 'West', 1, 31, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(32, 'Delhi', '07', 'DL', 'IND', 'North', 1, 32, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(33, 'Jammu and Kashmir', '01', 'JK', 'IND', 'North', 1, 33, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(34, 'Ladakh', '38', 'LA', 'IND', 'North', 1, 34, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(35, 'Lakshadweep', '31', 'LD', 'IND', 'Islands', 1, 35, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59'),
(36, 'Puducherry', '34', 'PY', 'IND', 'South', 1, 36, 'SYSTEM', NULL, '2025-07-25 09:15:59', '2025-07-25 09:15:59');

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

--
-- Table structure for table `stock_balance`
--

CREATE TABLE IF NOT EXISTS `stock_balance` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `product_variant_id` bigint UNSIGNED NOT NULL,
  `warehouse_id` bigint UNSIGNED NOT NULL,
  `actual_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `reserved_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `ordered_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `planned_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `available_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `stock_uom` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `stock_value` decimal(15,2) NOT NULL DEFAULT '0.00',
  `avg_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `valuation_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FIFO',
  `reorder_level` decimal(15,3) NOT NULL DEFAULT '0.000',
  `reorder_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `max_level` decimal(15,3) NOT NULL DEFAULT '0.000',
  `min_level` decimal(15,3) NOT NULL DEFAULT '0.000',
  `safety_stock` decimal(15,3) NOT NULL DEFAULT '0.000',
  `last_transaction_date` date DEFAULT NULL,
  `last_transaction_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_purchase_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `last_sales_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `qty_0_30_days` decimal(15,3) NOT NULL DEFAULT '0.000',
  `qty_31_60_days` decimal(15,3) NOT NULL DEFAULT '0.000',
  `qty_61_90_days` decimal(15,3) NOT NULL DEFAULT '0.000',
  `qty_over_90_days` decimal(15,3) NOT NULL DEFAULT '0.000',
  `good_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `damaged_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `expired_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `obsolete_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `quarantine_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `total_batches` int NOT NULL DEFAULT '0',
  `earliest_expiry_date` date DEFAULT NULL,
  `batch_summary` json DEFAULT NULL,
  `turnover_ratio` decimal(8,2) NOT NULL DEFAULT '0.00',
  `days_since_last_movement` int NOT NULL DEFAULT '0',
  `is_slow_moving` tinyint(1) NOT NULL DEFAULT '0',
  `is_fast_moving` tinyint(1) NOT NULL DEFAULT '0',
  `is_dead_stock` tinyint(1) NOT NULL DEFAULT '0',
  `below_reorder_level` tinyint(1) NOT NULL DEFAULT '0',
  `near_expiry` tinyint(1) NOT NULL DEFAULT '0',
  `overstock` tinyint(1) NOT NULL DEFAULT '0',
  `active_alerts` json DEFAULT NULL,
  `last_updated_from_ledger` timestamp NULL DEFAULT NULL,
  `requires_rebalancing` tinyint(1) NOT NULL DEFAULT '0',
  `reconciliation_notes` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_stock_balance` (`company_id`,`product_variant_id`,`warehouse_id`),
  KEY `stock_balance_product_variant_id_foreign` (`product_variant_id`),
  KEY `stock_balance_warehouse_id_foreign` (`warehouse_id`),
  KEY `idx_stock_balance_reorder` (`below_reorder_level`,`warehouse_id`),
  KEY `idx_stock_balance_movement` (`is_slow_moving`,`is_dead_stock`),
  KEY `idx_stock_balance_expiry` (`near_expiry`,`earliest_expiry_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `stock_ledger`
--

CREATE TABLE IF NOT EXISTS `stock_ledger` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `product_variant_id` bigint UNSIGNED NOT NULL,
  `warehouse_id` bigint UNSIGNED NOT NULL,
  `voucher_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `voucher_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `posting_date` date NOT NULL,
  `posting_time` timestamp NOT NULL,
  `actual_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `qty_after_transaction` decimal(15,3) NOT NULL DEFAULT '0.000',
  `stock_uom` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `stock_uom_rate` decimal(10,6) NOT NULL DEFAULT '1.000000',
  `incoming_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `outgoing_rate` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `stock_value` decimal(15,2) NOT NULL DEFAULT '0.00',
  `stock_value_difference` decimal(15,2) NOT NULL DEFAULT '0.00',
  `balance_stock_value` decimal(15,2) NOT NULL DEFAULT '0.00',
  `valuation_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FIFO',
  `batch_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `serial_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `manufacturing_date` date DEFAULT NULL,
  `reference_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference_details` json DEFAULT NULL,
  `quality_inspection` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACCEPTED',
  `stock_condition` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'GOOD',
  `project_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cost_center` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `department` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_cancelled` tinyint(1) NOT NULL DEFAULT '0',
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancelled_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cancellation_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `remarks` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_ledger_product_variant_id_foreign` (`product_variant_id`),
  KEY `stock_ledger_warehouse_id_foreign` (`warehouse_id`),
  KEY `idx_stock_ledger_main` (`company_id`,`product_variant_id`,`warehouse_id`,`posting_date`),
  KEY `idx_stock_ledger_voucher` (`voucher_type`,`voucher_number`),
  KEY `idx_stock_ledger_batch_serial` (`batch_no`,`serial_no`),
  KEY `idx_stock_ledger_time` (`posting_date`,`posting_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `terms_conditions`
--

CREATE TABLE IF NOT EXISTS `terms_conditions` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `template_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `template_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `template_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `version_number` int NOT NULL DEFAULT '1',
  `terms_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `terms_sections` json DEFAULT NULL,
  `header_text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `footer_text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `custom_fields` json DEFAULT NULL,
  `payment_terms` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_due_days` int NOT NULL DEFAULT '30',
  `early_payment_discount` decimal(5,2) NOT NULL DEFAULT '0.00',
  `early_payment_days` int NOT NULL DEFAULT '0',
  `late_payment_penalty` decimal(5,2) NOT NULL DEFAULT '0.00',
  `preferred_payment_method` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_terms` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_lead_time_days` int NOT NULL DEFAULT '0',
  `shipping_method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `packaging_instructions` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insurance_required` tinyint(1) NOT NULL DEFAULT '0',
  `risk_transfer_point` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `warranty_period` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `warranty_terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `support_level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `maintenance_terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `extended_warranty_available` tinyint(1) NOT NULL DEFAULT '0',
  `governing_law` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `jurisdiction` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dispute_resolution` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `limitation_of_liability` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `intellectual_property` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `confidentiality` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `cancellation_policy` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `return_policy` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `refund_policy` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `cancellation_charges` decimal(5,2) NOT NULL DEFAULT '0.00',
  `price_validity_days` int NOT NULL DEFAULT '30',
  `prices_subject_to_change` tinyint(1) NOT NULL DEFAULT '0',
  `quality_standards` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `inspection_terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `buyer_inspection_required` tinyint(1) NOT NULL DEFAULT '0',
  `inspection_period_days` int NOT NULL DEFAULT '7',
  `rejection_terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `force_majeure_clause` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `risk_mitigation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `insurance_requirements` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `covid_specific_terms` tinyint(1) NOT NULL DEFAULT '0',
  `performance_standards` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `penalty_structure` json DEFAULT NULL,
  `service_level_agreement` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `performance_bond_percentage` decimal(5,2) NOT NULL DEFAULT '0.00',
  `environmental_compliance` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `social_responsibility` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `sustainability_requirements` tinyint(1) NOT NULL DEFAULT '0',
  `ethical_standards` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `approval_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DRAFT',
  `approved_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `legal_review_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `legal_review_at` timestamp NULL DEFAULT NULL,
  `review_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `usage_count` int NOT NULL DEFAULT '0',
  `last_used_date` timestamp NULL DEFAULT NULL,
  `usage_statistics` json DEFAULT NULL,
  `auto_include_in_documents` tinyint(1) NOT NULL DEFAULT '0',
  `auto_include_conditions` json DEFAULT NULL,
  `requires_customer_acceptance` tinyint(1) NOT NULL DEFAULT '0',
  `digital_signature_required` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_terms_template` (`company_id`,`template_code`),
  KEY `idx_terms_conditions_main` (`template_type`,`document_type`,`is_active`),
  KEY `idx_terms_conditions_approval` (`approval_status`,`is_default`),
  KEY `idx_terms_conditions_version` (`company_id`,`version_number`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `uom_conversion`
--

CREATE TABLE IF NOT EXISTS `uom_conversion` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `from_uom_id` bigint UNSIGNED NOT NULL,
  `to_uom_id` bigint UNSIGNED NOT NULL,
  `multiply_factor` decimal(14,4) NOT NULL COMMENT 'Conversion factor (1 from_uom = factor * to_uom)',
  `product_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Optional: restrict conversion to specific product',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Additional conversion notes',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'system',
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_uom_conversion_ids` (`from_uom_id`,`to_uom_id`,`product_id`),
  KEY `uom_conversion_product_id_index` (`product_id`),
  KEY `uom_conversion_is_active_index` (`is_active`),
  KEY `uom_conversion_to_uom_id_foreign` (`to_uom_id`),
  KEY `uom_conversion_from_uom_id_to_uom_id_index` (`from_uom_id`,`to_uom_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `uom_master`
--

CREATE TABLE IF NOT EXISTS `uom_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uom_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `uom_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `uom_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'QUANTITY' COMMENT 'Type: LENGTH, WEIGHT, VOLUME, QUANTITY, AREA, TIME',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Detailed description of the UOM',
  `symbol` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Symbol like kg, m, pcs',
  `base_unit_factor` decimal(14,4) NOT NULL DEFAULT '1.0000' COMMENT 'Factor to convert to base unit',
  `base_uom_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Reference to base UOM for this type',
  `is_base_unit` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is this the base unit for its type?',
  `uom_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `sort_order` int NOT NULL DEFAULT '0',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uom_master_uom_code_unique` (`uom_code`),
  KEY `uom_master_is_active_index` (`is_active`),
  KEY `uom_master_uom_type_index` (`uom_type`),
  KEY `uom_master_uom_type_is_active_index` (`uom_type`,`is_active`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `uom_master`
--

INSERT INTO `uom_master` (`id`, `uom_code`, `uom_name`, `uom_type`, `description`, `symbol`, `base_unit_factor`, `base_uom_code`, `is_base_unit`, `uom_category`, `is_active`, `sort_order`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'KG', 'Kilogram', 'WEIGHT', 'sfsf', 'kg', 1.0000, NULL, 1, NULL, 1, 0, 'AJIT HOGADE', NULL, '2025-07-28 02:03:48', '2025-07-28 02:03:48'),
(2, 'QUINTAL', 'Quintal', 'WEIGHT', 'dfg', 'QTL', 100.0000, 'KG', 0, NULL, 1, 0, 'AJIT HOGADE', 'AJIT HOGADE', '2025-07-28 02:24:38', '2025-07-28 02:27:57');

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

--
-- Table structure for table `vendor_master`
--

CREATE TABLE IF NOT EXISTS `vendor_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `vendor_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendor_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendor_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REGULAR',
  `vendor_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'India',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `default_currency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'INR',
  `payment_terms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_limit` decimal(18,2) DEFAULT NULL,
  `tds_applicable` tinyint(1) NOT NULL DEFAULT '0',
  `tds_section` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `msme_registered` tinyint(1) NOT NULL DEFAULT '0',
  `msme_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `company_id` bigint UNSIGNED DEFAULT NULL,
  `msme_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `msme_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tds_category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_days` int NOT NULL DEFAULT '0',
  `price_list_id` bigint UNSIGNED DEFAULT NULL,
  `tax_preference` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'TAXABLE',
  `vendor_rating` decimal(3,1) NOT NULL DEFAULT '0.0',
  `is_sub_contractor` tinyint(1) NOT NULL DEFAULT '0',
  `opening_balance` decimal(15,2) NOT NULL DEFAULT '0.00',
  `opening_balance_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CR',
  `territory` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `industry_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `internal_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `is_frozen` tinyint(1) NOT NULL DEFAULT '0',
  `registration_date` date DEFAULT NULL,
  `custom_fields` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendor_master_vendor_code_unique` (`vendor_code`),
  KEY `vendor_master_vendor_code_index` (`vendor_code`),
  KEY `vendor_master_vendor_type_index` (`vendor_type`),
  KEY `vendor_master_status_index` (`status`),
  KEY `vendor_master_company_id_foreign` (`company_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `warehouse_master`
--

CREATE TABLE IF NOT EXISTS `warehouse_master` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `warehouse_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `warehouse_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_id` bigint UNSIGNED NOT NULL,
  `manager_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `capacity_info` json DEFAULT NULL,
  `is_main_warehouse` tinyint(1) NOT NULL DEFAULT '0',
  `is_sales_warehouse` tinyint(1) NOT NULL DEFAULT '1',
  `is_purchase_warehouse` tinyint(1) NOT NULL DEFAULT '1',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `created_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AjitHogade',
  `updated_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `plant_id` bigint UNSIGNED DEFAULT NULL,
  `department_id` bigint UNSIGNED DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state_id` bigint UNSIGNED DEFAULT NULL,
  `state_code` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pincode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relationship_type` enum('PLANT_BASED','INDEPENDENT','SHARED','THIRD_PARTY') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PLANT_BASED' COMMENT 'Defines how warehouse relates to organizational structure',
  `warehouse_function` enum('STORAGE','RAW_MATERIAL','WORK_IN_PROGRESS','FINISHED_GOODS','DISTRIBUTION','TRANSIT','QUARANTINE','RETURN_GOODS','GENERAL') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'GENERAL' COMMENT 'Specific function/purpose of the warehouse',
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouse_master_warehouse_code_unique` (`warehouse_code`),
  KEY `warehouse_master_warehouse_code_index` (`warehouse_code`),
  KEY `warehouse_master_status_index` (`status`),
  KEY `warehouse_master_is_main_warehouse_index` (`is_main_warehouse`),
  KEY `warehouse_master_plant_id_foreign` (`plant_id`),
  KEY `idx_warehouse_company_plant` (`company_id`,`plant_id`),
  KEY `idx_warehouse_type_relation` (`relationship_type`),
  KEY `idx_warehouse_status_function` (`status`,`warehouse_function`),
  KEY `warehouse_master_department_id_foreign` (`department_id`),
  KEY `warehouse_master_state_id_foreign` (`state_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouse_master`
--

INSERT INTO `warehouse_master` (`id`, `warehouse_code`, `warehouse_name`, `company_id`, `manager_name`, `phone`, `email`, `capacity_info`, `is_main_warehouse`, `is_sales_warehouse`, `is_purchase_warehouse`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`, `plant_id`, `department_id`, `address`, `city`, `state_id`, `state_code`, `pincode`, `relationship_type`, `warehouse_function`) VALUES
(1, 'WH001', 'mW', 1, NULL, NULL, NULL, NULL, 1, 1, 1, 'ACTIVE', 'AJIT HOGADE', NULL, '2025-08-23 07:55:53', '2025-08-23 07:55:53', 2, NULL, 'Nerul', 'Navi Mumbai', 14, '27', '400703', 'PLANT_BASED', 'STORAGE'),
(2, 'WH002', 'Nerul', 1, 'AJIT HOGADE', NULL, NULL, NULL, 1, 1, 1, 'ACTIVE', 'AJIT HOGADE', NULL, '2025-08-23 08:35:39', '2025-08-23 08:35:39', 2, NULL, 'Nerul', 'Navi Mumbai', 14, '27', '400703', 'PLANT_BASED', 'GENERAL'),
(3, 'WH003', 'GH', 1, 'AJIT HOGADE', NULL, NULL, NULL, 0, 1, 1, 'ACTIVE', 'AJIT HOGADE', NULL, '2025-08-23 08:57:23', '2025-08-23 08:57:23', 2, NULL, 'Nerul', 'Navi Mumbai', 14, '27', '400703', 'PLANT_BASED', 'GENERAL');

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

--
-- Table structure for table `warehouse_masters`
--

CREATE TABLE IF NOT EXISTS `warehouse_masters` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` bigint UNSIGNED NOT NULL,
  `plant_id` bigint UNSIGNED DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('RAW_MATERIAL','FINISHED_GOODS','WIP','SPARES','GENERAL','OTHER') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'GENERAL',
  `status` enum('ACTIVE','INACTIVE','MAINTENANCE') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ACTIVE',
  `manager_user_id` bigint UNSIGNED DEFAULT NULL,
  `gstin_id` bigint UNSIGNED DEFAULT NULL,
  `address_line1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pincode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `geo_lat` decimal(10,7) DEFAULT NULL,
  `geo_long` decimal(10,7) DEFAULT NULL,
  `capacity_volume` decimal(15,3) DEFAULT NULL,
  `temperature_controlled` tinyint(1) NOT NULL DEFAULT '0',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `created_by` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_by` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouse_masters_code_unique` (`code`),
  KEY `warehouse_masters_plant_id_foreign` (`plant_id`),
  KEY `warehouse_masters_manager_user_id_foreign` (`manager_user_id`),
  KEY `warehouse_masters_gstin_id_foreign` (`gstin_id`),
  KEY `warehouse_masters_company_id_plant_id_index` (`company_id`,`plant_id`),
  KEY `warehouse_masters_status_type_index` (`status`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
COMMIT;

