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

START TRANSACTION;



--
-- Database: `acc_bims`
--

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

--
-- Table structure for table `categories`
--

CREATE TABLE IF NOT EXISTS `categories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `description`, `status`, `created_at`) VALUES
(1, 'General', 'General Products', 'active', '2025-09-11 15:05:54'),
(2, 'Electronics', 'Electronic Items', 'active', '2025-09-11 15:05:54'),
(3, 'Clothing', 'Clothing & Apparel', 'active', '2025-09-11 15:05:54'),
(4, 'Food & Beverages', 'Food Items', 'active', '2025-09-11 15:05:54'),
(5, 'STATIONERY', 'STATIONERY', 'active', '2026-01-20 07:34:59'),
(6, 'HOUSE KEEPING', '', 'active', '2026-01-20 07:35:14'),
(7, 'CHEMICALS ', '', 'active', '2026-01-20 07:36:25'),
(8, 'Dairy', '', 'active', '2026-01-27 09:00:39');

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

--
-- Table structure for table `companies`
--

CREATE TABLE IF NOT EXISTS `companies` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gstin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `tan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `state` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `state_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bank_branch` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `account_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ifsc_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `logo_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `invoice_prefix` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'INV',
  `purchase_prefix` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'PUR',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `signature_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `companies`
--

INSERT INTO `companies` (`id`, `company_name`, `address`, `phone`, `email`, `gstin`, `pan`, `tan`, `state`, `state_code`, `bank_name`, `bank_branch`, `account_number`, `ifsc_code`, `logo_path`, `invoice_prefix`, `purchase_prefix`, `created_at`, `updated_at`, `signature_image`) VALUES
(1, 'CREATION', 'H-138, SHYAM LAL LANE, GARDEN REACH ROAD,KOLKATA-700024.', '8334829291', 'creationid2013@gmail.com', '19AMCPD9826H1ZW', '', '', 'WB', '19', 'BANK OF INDIA', 'GARDEN REACH', '400820110000297', 'BKID0004008', NULL, 'CRT', 'PUR', '2025-09-11 15:05:54', '2026-01-30 07:55:46', 'uploads/signatures/sig_1769759746.png'),
(2, 'M/s, NATRAJ IRON & CASTINGS PVT. LTD.', 'JALPAIGURI', '8697251609', 'info@techduple.in', '19AACCCG65RF', NULL, NULL, 'WB', '19', NULL, NULL, NULL, NULL, NULL, 'INV', 'PUR', '2026-01-15 02:31:08', '2026-01-16 02:11:33', NULL);

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

--
-- Table structure for table `company_bank_accounts`
--

CREATE TABLE IF NOT EXISTS `company_bank_accounts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int NOT NULL,
  `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `bank_branch` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `account_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `account_holder_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ifsc_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `account_type` enum('current','savings','cash_credit','overdraft') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'current',
  `opening_balance` decimal(15,2) DEFAULT '0.00',
  `current_balance` decimal(15,2) DEFAULT '0.00',
  `is_default` tinyint(1) DEFAULT '0',
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `is_default` (`is_default`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `company_bank_accounts`
--

INSERT INTO `company_bank_accounts` (`id`, `company_id`, `bank_name`, `bank_branch`, `account_number`, `account_holder_name`, `ifsc_code`, `account_type`, `opening_balance`, `current_balance`, `is_default`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'SBI', 'BALLYGAUNGE', '1234567890', 'CREATION', 'SBIN001298', 'current', 90000.00, 100116.00, 0, 'active', '2026-03-21 03:32:49', '2026-03-21 03:38:27');

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

--
-- Table structure for table `company_stock`
--

CREATE TABLE IF NOT EXISTS `company_stock` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int NOT NULL,
  `product_id` int NOT NULL,
  `stock_quantity` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `company_product` (`company_id`,`product_id`)
) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `company_stock`
--

INSERT INTO `company_stock` (`id`, `company_id`, `product_id`, `stock_quantity`, `created_at`) VALUES
(1, 1, 1, 2, '2026-01-14 08:17:14'),
(2, 1, 2, 8, '2026-01-14 08:17:14'),
(3, 1, 3, -4, '2026-01-14 08:17:14'),
(4, 1, 4, 33, '2026-01-14 08:17:14'),
(5, 1, 5, -47, '2026-01-14 08:17:14'),
(6, 1, 6, 98, '2026-01-14 08:17:14'),
(7, 1, 7, 6, '2026-01-14 08:17:14'),
(8, 2, 6, -40, '2026-01-15 02:33:27'),
(9, 1, 8, -525, '2026-01-20 07:27:13'),
(10, 1, 11, -16, '2026-01-21 16:12:23'),
(11, 1, 20, -13, '2026-01-21 17:51:53'),
(12, 1, 21, -5, '2026-01-21 17:51:53'),
(13, 1, 22, -5, '2026-01-21 17:51:53'),
(14, 1, 32, -5, '2026-01-21 17:51:53'),
(15, 1, 33, -5, '2026-01-21 17:51:53'),
(16, 1, 25, -40, '2026-01-21 17:51:53'),
(17, 1, 34, -100, '2026-01-21 17:51:53'),
(18, 1, 15, -20, '2026-01-21 17:51:53'),
(19, 1, 35, -13, '2026-01-21 17:51:53'),
(20, 1, 36, -1, '2026-01-21 17:51:53'),
(21, 1, 38, -100, '2026-01-28 05:27:22'),
(22, 1, 17, -18, '2026-02-05 09:45:56'),
(23, 1, 9, -10, '2026-03-02 05:53:58');

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

--
-- Table structure for table `customers`
--

CREATE TABLE IF NOT EXISTS `customers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `gstin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `tin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `state_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `state_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `consignee_gstin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_tin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_pan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_tan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_state_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_state_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `tan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `customers`
--

INSERT INTO `customers` (`id`, `name`, `company`, `phone`, `email`, `address`, `gstin`, `tin`, `state_name`, `state_code`, `consignee_name`, `consignee_phone`, `consignee_email`, `consignee_address`, `consignee_gstin`, `consignee_tin`, `consignee_pan`, `consignee_tan`, `consignee_state_name`, `consignee_state_code`, `pan`, `tan`, `status`, `created_at`, `updated_at`) VALUES
(1, 'RG KAR MEDICAL COLLEGE  & HOSPITAL', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', '', ' Belgachia Road, Kolkata-700004.', '19CALR00914E1DJ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', '2025-09-12 03:00:24', '2026-01-20 07:21:26'),
(2, 'MS NATARAJ', NULL, '8697251609', NULL, 'JALPAIGURI', '19CJIPJ2551A1VF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', '2026-01-15 02:33:27', '2026-01-15 02:33:27'),
(3, 'MS PRAYAGRAJ', NULL, '7003815406', NULL, 'PUNE MAIN ROAD, MAHARASTRA - 711167', '19CJIBB2551A1ZI', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', '2026-01-16 02:51:27', '2026-01-16 02:51:27'),
(4, 'Managing Director, West Bengal Livestock Development Corporation Limited (A Govt. of West Bengal Undertaking)in Customer', NULL, '', NULL, 'WBLDCL, LB-2, Sector-III, Salt Lake, Kolkata', '19AABCT0907D1ZP', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'active', '2026-01-21 16:12:23', '2026-01-21 16:12:23');

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

--
-- Table structure for table `expenses`
--

CREATE TABLE IF NOT EXISTS `expenses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int DEFAULT NULL,
  `expense_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `expense_head_id` int DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `amount` decimal(12,2) NOT NULL,
  `gst_type` enum('inclusive','exclusive','none') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'none',
  `gst_percentage` decimal(5,2) DEFAULT '0.00',
  `gst_amount` decimal(12,2) DEFAULT '0.00',
  `total_amount` decimal(12,2) NOT NULL,
  `payment_mode` enum('cash','card','upi','bank_transfer','cheque') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'cash',
  `expense_date` date NOT NULL,
  `voucher_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `expense_no` (`expense_no`),
  UNIQUE KEY `voucher_no` (`voucher_no`),
  KEY `expense_head_id` (`expense_head_id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `expense_heads`
--

CREATE TABLE IF NOT EXISTS `expense_heads` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `expense_heads`
--

INSERT INTO `expense_heads` (`id`, `name`, `description`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Office Rent', 'Monthly office rent expenses', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(2, 'Electricity Bill', 'Electricity and power consumption charges', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(3, 'Internet & Phone', 'Internet and telephone expenses', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(4, 'Stationery', 'Office stationery and supplies', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(5, 'Travel & Conveyance', 'Travel and conveyance expenses', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(6, 'Professional Fees', 'Legal, audit, and professional service fees', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(7, 'Marketing & Advertising', 'Marketing and advertising expenses', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(8, 'Repairs & Maintenance', 'Equipment and facility maintenance', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(9, 'Insurance', 'Insurance premiums', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34'),
(10, 'Miscellaneous', 'Other miscellaneous expenses', 'active', '2025-09-12 03:17:34', '2025-09-12 03:17:34');

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

--
-- Table structure for table `payments`
--

CREATE TABLE IF NOT EXISTS `payments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int DEFAULT NULL,
  `reference_type` enum('sale','purchase') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `reference_id` int NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_date` date NOT NULL,
  `payment_mode` enum('cash','card','upi','bank_transfer','cheque') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'cash',
  `bank_account_id` int DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `user_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `reference_type` (`reference_type`,`reference_id`),
  KEY `user_id` (`user_id`),
  KEY `bank_account_id` (`bank_account_id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payments`
--

INSERT INTO `payments` (`id`, `company_id`, `reference_type`, `reference_id`, `amount`, `payment_date`, `payment_mode`, `bank_account_id`, `notes`, `user_id`, `created_at`) VALUES
(1, 1, 'purchase', 1, 30000.00, '2025-09-12', 'card', NULL, '', 1, '2025-09-12 07:19:29'),
(2, 1, 'sale', 10, 830.00, '2025-10-13', 'cash', NULL, '', 1, '2025-10-13 08:53:52'),
(3, 1, 'purchase', 2, 18357.00, '2025-12-20', 'cash', NULL, '', 1, '2025-12-20 11:17:28'),
(4, 1, 'sale', 17, 18880.00, '2025-12-20', 'cash', NULL, '', 1, '2025-12-20 11:18:37'),
(5, 1, 'sale', 36, 1092.00, '2026-03-21', '', 1, '', 1, '2026-03-21 03:33:21'),
(6, 1, 'sale', 35, 1264.00, '2026-03-21', '', 1, '123456', 1, '2026-03-21 03:35:52'),
(7, 1, 'sale', 33, 10000.00, '2026-03-21', 'cheque', 1, '876543', 1, '2026-03-21 03:37:58'),
(8, 1, 'purchase', 3, 2240.00, '2026-03-21', 'cheque', 1, '876543', 1, '2026-03-21 03:38:27');

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

--
-- Table structure for table `products`
--

CREATE TABLE IF NOT EXISTS `products` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `category_id` int DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'PCS',
  `buying_price` decimal(10,2) DEFAULT '0.00',
  `selling_price` decimal(10,2) NOT NULL,
  `mrp` decimal(10,2) DEFAULT '0.00',
  `tax_percentage` decimal(5,2) DEFAULT '0.00',
  `hsn_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `barcode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `stock_quantity` int DEFAULT '0',
  `min_stock_level` int DEFAULT '5',
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `barcode` (`barcode`),
  KEY `category_id` (`category_id`)
) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `category_id`, `description`, `unit`, `buying_price`, `selling_price`, `mrp`, `tax_percentage`, `hsn_code`, `barcode`, `stock_quantity`, `min_stock_level`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Godrej Fridge 220 Litre', 2, '', 'PCS', 0.00, 28990.00, 0.00, 18.00, '1871827', '202509112047011467', 6, 5, 'active', '2025-09-11 15:17:41', '2025-10-13 07:52:29'),
(2, 'Videocon AC', 2, '', 'PCS', 0.00, 45000.00, 0.00, 18.00, '123455545', '202509120740468761', 8, 5, 'active', '2025-09-12 02:11:35', '2025-10-13 07:52:29'),
(3, 'polycarbonized ', 1, NULL, 'PCS', 0.00, 600.00, 0.00, 18.00, 'BAGSGAGSA', '202510101648025289', -3, 5, 'active', '2025-10-10 11:18:02', '2025-10-13 07:52:29'),
(4, 'test', 2, NULL, 'PCS', 440.00, 0.00, 0.00, 5.00, '', '202510130808054400', 33, 5, 'active', '2025-10-13 02:38:25', '2025-10-13 07:47:43'),
(5, 'respect baby diaper', 1, NULL, 'PCS', 0.00, 230.00, 0.00, 5.00, '', '202510130910003258', -47, 5, 'active', '2025-10-13 03:40:00', '2025-12-28 17:13:45'),
(6, 'DOMS DIAPER ', 3, '', 'PCS', 0.00, 99.00, 0.00, 12.00, '', '202512201617273097', 78, 5, 'active', '2025-12-20 10:56:35', '2026-03-20 09:42:16'),
(7, 'RESPECT PREMIUM BABY WIPES', 3, '', 'PCS', 15557.00, 16000.00, 17000.00, 18.00, '', '202512201634187985', 6, 5, 'active', '2025-12-20 11:05:34', '2025-12-28 11:54:01'),
(8, 'PEN', 5, '', 'PCS', 0.00, 2.20, 0.00, 18.00, '9608', '202601201256529965', -510, 5, 'active', '2026-01-20 07:26:52', '2026-02-05 09:50:32'),
(9, 'S. S. Spoon (Medium) ', 5, '', 'PCS', 0.00, 14.50, 0.00, 12.00, '8215', '202601201326464533', 0, 5, 'active', '2026-01-20 07:57:37', '2026-01-20 07:57:37'),
(10, 'MIRROR SPL TYPE with frame size 22\"x18\"', 5, '', 'PCS', 0.00, 349.00, 0.00, 18.00, '7009', '202601201329584379', 0, 5, 'active', '2026-01-20 08:01:57', '2026-01-20 08:01:57'),
(11, 'BINDER CLIP ', 5, NULL, 'PCS', 0.00, 34.70, 0.00, 18.00, '83059020', '202601212141254574', 0, 5, 'active', '2026-01-21 16:11:25', '2026-02-05 06:47:19'),
(12, 'Envelop', 5, NULL, 'PCS', 0.00, 10.00, 0.00, 18.00, '481719', '202601212144466248', -40, 5, 'active', '2026-01-21 16:14:46', '2026-02-05 06:47:19'),
(13, 'eraser ', 5, NULL, 'PCS', 0.00, 49.00, 0.00, 18.00, '4016', '202601212149066677', -1, 5, 'active', '2026-01-21 16:19:06', '2026-02-05 06:47:19'),
(14, 'eraser ', 5, NULL, 'PCS', 0.00, 49.00, 0.00, 18.00, '4016', '202601212149061929', 0, 5, 'active', '2026-01-21 16:19:06', '2026-01-21 16:19:06'),
(15, 'file', 5, NULL, 'PCS', 0.00, 18.90, 0.00, 18.00, '48203000', '202601212152264345', -60, 5, 'active', '2026-01-21 16:22:26', '2026-02-05 06:47:19'),
(16, 'keyboar', 5, NULL, 'PCS', 0.00, 218.00, 0.00, 18.00, '8471', '202601212154242560', -6, 5, 'active', '2026-01-21 16:24:24', '2026-02-05 06:47:19'),
(17, 'knife', 5, NULL, 'PCS', 0.00, 22.80, 0.00, 18.00, '8208', '202601212158066124', -18, 5, 'active', '2026-01-21 16:28:06', '2026-02-05 09:50:32'),
(18, 'mouse', 5, NULL, 'PCS', 0.00, 153.70, 0.00, 18.00, '8473', '202601212200534500', -12, 5, 'active', '2026-01-21 16:30:53', '2026-02-05 06:47:19'),
(19, 'pad writing', 5, NULL, 'PCS', 0.00, 16.50, 0.00, 18.00, '4820', '202601212203593961', -12, 5, 'active', '2026-01-21 16:33:59', '2026-02-05 06:47:19'),
(20, 'register', 6, NULL, 'PCS', 0.00, 93.90, 0.00, 18.00, '4820', '202601212208337936', -4, 5, 'active', '2026-01-21 16:38:33', '2026-02-05 09:50:32'),
(32, 'register 18', 5, NULL, 'PCS', 0.00, 168.60, 0.00, 18.00, '8420', '202601212311482328', 0, 5, 'active', '2026-01-21 17:41:48', '2026-01-29 19:22:20'),
(21, 'register  06', 5, NULL, 'PCS', 0.00, 53.80, 0.00, 18.00, '4820', '202601212214049577', -18, 5, 'active', '2026-01-21 16:44:04', '2026-02-05 06:47:19'),
(22, 'register 08 no', 5, NULL, 'PCS', 0.00, 73.50, 0.00, 18.00, '8420', '202601212214562183', -6, 5, 'active', '2026-01-21 16:44:56', '2026-02-05 06:47:19'),
(23, 'Highlighter pen', 5, NULL, 'PCS', 0.00, 80.50, 0.00, 18.00, '9608', '202601212216282119', -4, 5, 'active', '2026-01-21 16:46:28', '2026-02-05 06:47:19'),
(24, 'scotch brite (medium), make: best quality', 6, NULL, 'PCS', 0.00, 11.24, 0.00, 18.00, '6805', '202601212220167977', -12, 5, 'active', '2026-01-21 16:50:16', '2026-02-05 06:47:19'),
(25, 'soap - detergent (500gm) [sunlight], make: branded', 6, NULL, 'PCS', 0.00, 47.80, 0.00, 18.00, '34025000', '202601212223174616', 0, 5, 'active', '2026-01-21 16:53:17', '2026-01-29 19:22:20'),
(26, 'soap - detergent (500gm) [sunlight], make: branded', 6, NULL, 'PCS', 0.00, 47.80, 0.00, 18.00, '34025000', '202601212223173010', 0, 5, 'active', '2026-01-21 16:53:17', '2026-01-21 16:53:17'),
(27, 'soap - detergent (500gm) [sunlight], make: branded', 6, NULL, 'PCS', 0.00, 47.80, 0.00, 18.00, '34025000', '202601212223179436', 0, 5, 'active', '2026-01-21 16:53:17', '2026-01-21 16:53:17'),
(28, 'soap - detergent (500gm) [sunlight], make: branded', 6, NULL, 'PCS', 0.00, 47.80, 0.00, 18.00, '34025000', '202601212223175040', 0, 5, 'active', '2026-01-21 16:53:17', '2026-01-21 16:53:17'),
(29, 'soap - detergent (500gm) [sunlight], make: branded', 6, NULL, 'PCS', 0.00, 47.80, 0.00, 18.00, '34025000', '202601212223175689', -510, 5, 'active', '2026-01-21 16:53:17', '2026-02-05 06:47:19'),
(30, 'hitener (20 pcs.) [faber castell], make: faber castell', 5, NULL, 'PCS', 0.00, 198.00, 0.00, 18.00, '9608', '202601212225302991', 0, 5, 'active', '2026-01-21 16:55:30', '2026-01-21 17:00:10'),
(31, 'hitener (20 pcs.) [faber castell], make: faber castell', 5, NULL, 'PCS', 0.00, 198.00, 0.00, 18.00, '9608', '202601212225319547', -1, 5, 'active', '2026-01-21 16:55:31', '2026-02-05 06:47:19'),
(33, 'register 12', 5, NULL, 'PCS', 0.00, 115.80, 0.00, 18.00, '8420', '202601212312583033', 0, 5, 'active', '2026-01-21 17:42:58', '2026-01-29 19:22:20'),
(34, 'old news paper', 5, NULL, 'PCS', 0.00, 50.00, 0.00, 5.00, '4707', '202601212314457056', 0, 5, 'active', '2026-01-21 17:44:45', '2026-01-29 19:22:20'),
(35, 'binder clip 51 mm', 5, NULL, 'PCS', 0.00, 60.00, 0.00, 18.00, '8305', '202601212317563253', 0, 5, 'active', '2026-01-21 17:47:56', '2026-01-29 19:22:20'),
(36, 'caclculator', 5, NULL, 'PCS', 0.00, 140.00, 0.00, 18.00, '8470', '202601212319448606', -1, 5, 'active', '2026-01-21 17:49:44', '2026-01-29 19:22:20'),
(37, 'Ghee 500ml', 8, '', 'PCS', 0.00, 620.00, 0.00, 5.00, '12345678', '202601271430494973', 0, 5, 'active', '2026-01-27 09:01:41', '2026-01-27 09:01:41'),
(38, 'HAND WASH DISPENSER( WALL MOUNTED)', 6, NULL, 'PCS', 0.00, 180.00, 0.00, 18.00, '3924', '202601281056595674', 0, 5, 'active', '2026-01-28 05:26:59', '2026-01-28 05:36:41');

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

--
-- Table structure for table `product_units`
--

CREATE TABLE IF NOT EXISTS `product_units` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` int NOT NULL,
  `unit_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pieces_per_unit` int NOT NULL DEFAULT '1',
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_unit` (`product_id`,`unit_name`),
  KEY `product_id` (`product_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_units`
--

INSERT INTO `product_units` (`id`, `product_id`, `unit_name`, `pieces_per_unit`, `status`, `created_at`) VALUES
(1, 12, 'DOZEN', 1, 'active', '2026-01-21 16:15:29'),
(2, 11, 'DOZEN', 1, 'active', '2026-01-21 16:15:49');

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

--
-- Table structure for table `purchases`
--

CREATE TABLE IF NOT EXISTS `purchases` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int DEFAULT NULL,
  `purchase_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `supplier_id` int DEFAULT NULL,
  `total_amount` decimal(12,2) NOT NULL,
  `tax_amount` decimal(12,2) DEFAULT '0.00',
  `discount` decimal(12,2) DEFAULT '0.00',
  `grand_total` decimal(12,2) NOT NULL,
  `paid_amount` decimal(12,2) DEFAULT '0.00',
  `payment_mode` enum('cash','card','upi','bank_transfer') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'cash',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `user_id` int DEFAULT NULL,
  `purchase_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_no` (`purchase_no`),
  KEY `supplier_id` (`supplier_id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `purchases`
--

INSERT INTO `purchases` (`id`, `company_id`, `purchase_no`, `supplier_id`, `total_amount`, `tax_amount`, `discount`, `grand_total`, `paid_amount`, `payment_mode`, `notes`, `user_id`, `purchase_date`, `created_at`) VALUES
(1, 1, 'PUR2025090001', 1, 98960.00, 748.00, 0.00, 114828.00, 30000.00, 'bank_transfer', '', 1, '2025-09-12', '2025-09-12 02:11:55'),
(2, 1, 'PUR2025120001', 1, 15557.00, 2800.26, 0.00, 18357.26, 18357.00, 'cash', '', 1, '2025-12-20', '2025-12-20 11:17:12'),
(3, 1, 'PUR2026030001', 1, 2000.00, 240.00, 0.00, 2240.00, 2240.00, 'cash', '', 1, '2026-03-20', '2026-03-20 09:41:03');

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

--
-- Table structure for table `purchase_items`
--

CREATE TABLE IF NOT EXISTS `purchase_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `purchase_id` int DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `quantity` int NOT NULL,
  `unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'PCS',
  `pieces_per_unit` int DEFAULT '1',
  `unit_price` decimal(10,2) NOT NULL,
  `total_price` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_id` (`purchase_id`),
  KEY `product_id` (`product_id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `purchase_items`
--

INSERT INTO `purchase_items` (`id`, `purchase_id`, `product_id`, `quantity`, `unit`, `pieces_per_unit`, `unit_price`, `total_price`) VALUES
(13, 1, 4, 34, 'PCS', 1, 440.00, 15708.00),
(12, 1, 2, 2, 'PCS', 1, 30000.00, 70800.00),
(11, 1, 1, 1, 'PCS', 1, 20000.00, 23600.00),
(10, 1, 3, 1, 'PCS', 1, 4000.00, 4720.00),
(14, 2, 7, 1, 'PCS', 1, 15557.00, 18357.26),
(15, 3, 6, 100, 'PCS', 1, 20.00, 2240.00);

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

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

CREATE TABLE IF NOT EXISTS `sales` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int DEFAULT NULL,
  `invoice_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `challan_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `challan_date` date DEFAULT NULL,
  `order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `order_date` date DEFAULT NULL,
  `customer_id` int DEFAULT NULL,
  `invoice_type` enum('GST','NON GST') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `customer_gstin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_pan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_tan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `subtotal` decimal(12,2) NOT NULL,
  `tax_amount` decimal(12,2) DEFAULT '0.00',
  `cgst` decimal(15,2) DEFAULT '0.00',
  `sgst` decimal(15,2) DEFAULT '0.00',
  `igst` decimal(15,2) DEFAULT '0.00',
  `discount` decimal(12,2) DEFAULT '0.00',
  `discount_type` enum('amount','percent') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'amount',
  `round_off` decimal(10,2) DEFAULT '0.00',
  `grand_total` decimal(12,2) NOT NULL,
  `paid_amount` decimal(12,2) DEFAULT '0.00',
  `payment_mode` enum('cash','card','upi','bank_transfer') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'cash',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `user_id` int DEFAULT NULL,
  `sale_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `carrier_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `vehicle_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `place_of_supply` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_tin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `consignee_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_gstin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_pan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_tan` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_tin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_state` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `customer_state_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_state` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `consignee_state_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `invoice_no` (`invoice_no`),
  KEY `customer_id` (`customer_id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sales`
--

INSERT INTO `sales` (`id`, `company_id`, `invoice_no`, `challan_no`, `challan_date`, `order_no`, `order_date`, `customer_id`, `invoice_type`, `customer_name`, `customer_phone`, `customer_address`, `customer_gstin`, `customer_pan`, `customer_tan`, `subtotal`, `tax_amount`, `cgst`, `sgst`, `igst`, `discount`, `discount_type`, `round_off`, `grand_total`, `paid_amount`, `payment_mode`, `notes`, `user_id`, `sale_date`, `created_at`, `carrier_name`, `vehicle_no`, `place_of_supply`, `customer_email`, `customer_tin`, `consignee_name`, `consignee_phone`, `consignee_address`, `consignee_email`, `consignee_gstin`, `consignee_pan`, `consignee_tan`, `consignee_tin`, `customer_state`, `customer_state_code`, `consignee_state`, `consignee_state_code`) VALUES
(1, 1, 'INV2025090001', NULL, NULL, NULL, NULL, 1, 'NON GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 102980.00, 8046.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 121462.40, 0.00, 'card', '', 1, '2025-09-11', '2025-09-11 15:18:39', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 1, 'INV2025090002', NULL, NULL, NULL, NULL, NULL, 'NON GST', 'Walk-in Customer', '9062060072', 'Kolkata', '', NULL, NULL, 28990.00, 5218.20, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 34208.20, 0.00, 'cash', '', 1, '2025-09-12', '2025-09-12 03:01:21', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6, 1, 'INV-00003', NULL, NULL, NULL, NULL, NULL, 'NON GST', 'Walk-in Customer', '', '', '', NULL, NULL, 5000.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 5000.00, 0.00, 'cash', '', 1, '2025-09-22', '2025-09-22 12:30:52', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(7, 1, 'INV-00004', NULL, NULL, NULL, NULL, 1, 'NON GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 73990.00, 5218.20, 0.00, 0.00, 0.00, 10.00, 'percent', 0.00, 87298.20, 0.00, 'cash', '', 1, '2025-09-22', '2025-09-22 13:07:34', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(8, 1, 'INVG-00001', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 600.00, 108.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 708.00, 0.00, 'cash', '', 1, '2025-10-10', '2025-10-10 11:18:43', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 1, 'INVG-00002', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 5200.00, 338.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 5538.00, 0.00, 'cash', '', 1, '2025-10-13', '2025-10-13 03:41:12', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10, 1, 'INV-00007', NULL, NULL, NULL, NULL, 1, 'NON GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 830.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 830.00, 830.00, 'cash', '', 1, '2025-10-13', '2025-10-13 07:40:55', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(11, 1, 'INV-00008', NULL, NULL, NULL, NULL, 1, 'NON GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 230.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 230.00, 0.00, 'cash', '', 1, '2025-10-13', '2025-10-13 07:40:55', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(12, 1, 'INV-00009', NULL, NULL, NULL, NULL, NULL, 'NON GST', 'Walk-in Customer', '', '', '', NULL, NULL, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 0.00, 0.00, 'cash', '', 1, '2025-10-13', '2025-10-13 07:47:43', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(13, 1, 'INVG-00003', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 88257.70, 13437.70, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 88257.70, 0.00, 'cash', '', 1, '2025-10-13', '2025-10-13 07:52:29', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(14, 1, 'INVG-00004', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 110.88, 11.88, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 110.88, 0.00, 'cash', '', 1, '2025-12-20', '2025-12-20 11:03:45', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(15, 1, 'INVG-00005', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 16000.00, 2880.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 18880.00, 0.00, 'cash', '', 1, '2025-12-20', '2025-12-20 11:09:04', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(16, 1, 'INVG-00006', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 16000.00, 2440.68, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 16000.00, 0.00, 'cash', '', 1, '2025-12-20', '2025-12-20 11:12:43', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(17, 1, 'INVG-00007', NULL, NULL, NULL, NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 18880.00, 2880.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 18880.00, 18880.00, 'cash', '', 1, '2025-12-20', '2025-12-20 11:17:59', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(18, 1, 'INVG-00008', NULL, NULL, '12345', '2025-12-23', 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 19121.50, 2891.50, 0.00, 0.00, 0.00, 0.00, 'amount', 0.50, 19122.00, 0.00, 'cash', '', 1, '2025-12-23', '2025-12-23 09:08:40', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(19, 1, 'INVG-00009', NULL, NULL, '12345', '2025-12-27', 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 19121.50, 2891.50, 0.00, 0.00, 0.00, 100.00, 'amount', 0.50, 19022.00, 0.00, 'cash', '', 1, '2025-12-28', '2025-12-28 11:54:01', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(20, 1, 'INVG-00010', NULL, NULL, '12345', '2025-12-27', 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '', NULL, NULL, 1420.02, 67.62, 0.00, 0.00, 0.00, 5.00, 'percent', 0.60, 1349.62, 0.00, 'cash', '', 1, '2025-12-28', '2025-12-28 11:56:52', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(21, 1, 'INVG-00011', NULL, NULL, '12345', '2025-12-27', 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba Rathtala', '', NULL, NULL, 2366.70, 112.70, 0.00, 0.00, 0.00, 0.00, 'amount', 0.30, 2367.00, 0.00, 'cash', '', 1, '2025-12-28', '2025-12-28 12:24:47', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(22, 1, 'INVG-00012', NULL, NULL, '', NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba rathtala', '', NULL, NULL, 1420.02, 67.62, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 1420.02, 0.00, 'cash', '', 1, '2025-12-28', '2025-12-28 13:05:57', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(23, 1, 'INVG-00013', 'CH-00001', NULL, '', NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '19CJIPJ2551A1ZI', NULL, NULL, 708.00, 108.00, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 708.00, 0.00, 'cash', '', 1, '2026-01-15', '2026-01-15 02:29:38', '', '', '', '', '', 'ABC Supplier', '9062060072', 'Kasba', '', '19CJIPJ2551A1ZI', NULL, NULL, '', 'WB', '19', 'WB', '19'),
(24, 2, 'INVG-00014', 'CH-00002', NULL, '34', NULL, 2, 'GST', 'MS NATARAJ', '8697251609', 'JALPAIGURI', '19CJIPJ2551A1VF', NULL, NULL, 2217.60, 237.60, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 2217.60, 0.00, 'cash', '', 1, '2026-01-15', '2026-01-15 02:33:27', '', 'WB-04123456', 'JALPAIGURI', '', '', 'MS NATARAJ', '8697251609', 'JALPAIGURI', '', '19CJIPJ2551A1VF', NULL, NULL, '', 'WB', '19', 'WB', '19'),
(25, 1, 'INVG-00015', 'CH-00003', NULL, '', NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '19CJIPJ2551A1ZI', NULL, NULL, 29089.00, 4432.81, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 29089.00, 0.00, 'cash', '', 1, '2026-01-15', '2026-01-15 18:11:08', '', '', '', '', '', 'ABC Supplier', '9062060072', 'Kasba', '', '19CJIPJ2551A1ZI', NULL, NULL, '', 'WB', '19', 'WB', '19'),
(26, 1, 'INVG/ 16 / 26', 'CH-00004', NULL, '', NULL, 1, 'GST', 'ABC Supplier', '9062060072', 'Kasba', '19CJIPJ2551A1ZI', NULL, NULL, 34208.20, 5218.20, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 34208.20, 0.00, 'cash', '', 1, '2026-01-16', '2026-01-16 02:06:05', '', '', '', '', '', 'ABC Supplier', '9062060072', 'Kasba', '', '19CJIPJ2551A1ZI', NULL, NULL, '', 'WB', '19', 'WB', '19'),
(27, 1, 'INVG/17/26', 'CH-00005', NULL, '', NULL, 2, 'GST', 'MS NATARAJ', '8697251609', 'JALPAIGURI', '19CJIPJ2551A1VF', NULL, NULL, 34208.20, 5218.20, 0.00, 0.00, 0.00, 0.00, 'amount', 0.00, 34208.20, 0.00, 'cash', '', 1, '2026-01-16', '2026-01-16 02:20:43', '', '', '', '', '', 'MS NATARAJ', '8697251609', 'JALPAIGURI', '', '19CJIPJ2551A1VF', NULL, NULL, '', 'Maharastra', '27', 'Maharastra', '27'),
(28, 1, 'INVG/18/26', 'CH-00006', NULL, '', NULL, 3, 'GST', 'MS PRAYAGRAJ', '7003815406', 'PUNE MAIN ROAD, MAHARASTRA - 711167', '19CJIBB2551A1ZI', NULL, NULL, 34208.20, 5218.20, 0.00, 0.00, 5218.20, 0.00, 'amount', 0.00, 34208.20, 0.00, 'cash', '', 1, '2026-01-16', '2026-01-16 02:51:27', '', '', '', '', '', 'MS PRAYAGRAJ', '7003815406', 'PUNE MAIN ROAD, MAHARASTRA - 711167', '', '19CJIBB2551A1ZI', NULL, NULL, '', 'Maharastra', '27', 'Maharastra', '27'),
(29, 1, 'CRT/25-26/G-00001', 'CH-00007', NULL, 'RGKH/FS/266', '2025-12-02', 1, 'GST', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', ' Belgachia Road, Kolkata-700004.', '19CALR00914E1DJ', NULL, NULL, 1298.00, 198.00, 99.00, 99.00, 0.00, 0.00, 'amount', 0.00, 1298.00, 0.00, 'cash', '', 1, '2026-01-20', '2026-01-20 07:27:13', 'CHALLA NO :118', '', 'KOLKATA', '', '', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', ' Belgachia Road, Kolkata-700004.', '', '19CALR00914E1DJ', NULL, NULL, '', '', '', '', ''),
(30, 1, 'CRTG/159/25-26', 'CH-JAN-8', NULL, '25', '2026-01-08', 4, 'GST', 'Managing Director, West Bengal Livestock Development Corporation Limited (A Govt. of West Bengal Undertaking)in Customer', '', 'WBLDCL, LB-2, Sector-III, Salt Lake, Kolkata', '19AABCT0907D1ZP', '', '', 32743.58, 4994.78, 2497.39, 2497.39, 0.00, 0.00, 'amount', 0.42, 32744.00, 0.00, 'cash', '', 1, '2026-01-28', '2026-01-21 16:12:23', '', '', '', '', '', 'Manager & In-charge,', ' 9875633158', 'Kalyani Feed Milling Plant,D-23, Industrial Area, P.O. - Kalyani, Dist. - Nadia, Pin: 741235,', 'epickalyani@wbldc.in', '19ААВСТ0907D1ZP', 'ААВСТ0907D', '', '', '', '', 'West Bengal', '19'),
(31, 1, 'CRT/158/25-26  Dt:29-01-26', 'JAN-02', NULL, '02/WBLDC/HLF/07-Stationary/2025-26', '2026-02-01', 4, 'GST', 'Managing Director, West Bengal Livestock Development Corporation Limited (A Govt. of West Bengal Undertaking)in Customer', '', 'WBLDCL, LB-2, Sector-III, Salt Lake, Kolkata', '19AABCT0907D1ZP', '', '', 10817.10, 1125.45, 562.72, 562.72, 0.00, 0.00, 'amount', -0.10, 10817.00, 0.00, 'cash', 'Order No:02/WBLDC/HLF/07-Stationary/2025-26', 1, '2026-01-21', '2026-01-21 17:51:53', '', '', 'WBLDC', '', '', 'MANAGER ( FARM) & INCHARGE-WBLDC', '9609221503', 'HARINGHATA LAYER FARM, MOHANPUR, DIST NADIA', '', '19AABCT0907D1ZP', '', '', '', '', '', '', ''),
(33, 1, 'CRTG/3/26', '133', NULL, 'RGKH/M/209', '2026-01-19', 1, 'GST', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', ' Belgachia Road, Kolkata-700004.', '19CALR00914E1DJ', '', '', 21240.00, 3240.00, 1620.00, 1620.00, 0.00, 0.00, 'amount', 0.00, 21240.00, 10000.00, 'cash', '', 1, '2026-01-28', '2026-01-28 05:27:22', '', '', '', '', '', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', ' Belgachia Road, Kolkata-700004.', '', '19CALR00914E1DJ', '', '', '', '', '', '', ''),
(35, 1, 'CRTG/3/27', 'CH-00009', NULL, '', NULL, 1, 'GST', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', ' Belgachia Road, Kolkata-700004.', '19CALR00914E1DJ', '', '', 1263.80, 192.78, 96.39, 96.39, 0.00, 0.00, 'amount', 0.20, 1264.00, 1264.00, 'cash', '', 1, '2026-02-05', '2026-02-05 09:45:56', '', '', '', '', '', 'RG KAR MEDICAL COLLEGE  & HOSPITAL', '7003786490', ' Belgachia Road, Kolkata-700004.', '', '19CALR00914E1DJ', '', '', '', '', '', '', ''),
(36, 1, 'CRTG/4/26', 'CH-00010', '2026-02-26', '', NULL, 2, 'GST', 'MS NATARAJ', '8697251609', 'JALPAIGURI', '19CJIPJ2551A1VF', '', '', 1092.00, 159.99, 80.00, 80.00, 0.00, 0.00, 'amount', 0.00, 1092.00, 1092.00, 'cash', '', 1, '2026-03-01', '2026-03-02 05:53:58', '', '', '', '', '', 'MS NATARAJ', '8697251609', 'JALPAIGURI', '', '19CJIPJ2551A1VF', '', '', '', '', '', '', '');

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

--
-- Table structure for table `sale_items`
--

CREATE TABLE IF NOT EXISTS `sale_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sale_id` int DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `hsn_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `quantity` int NOT NULL,
  `unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'PCS',
  `pieces_per_unit` int DEFAULT '1',
  `unit_price` decimal(10,2) NOT NULL,
  `tax_percentage` decimal(5,2) DEFAULT '0.00',
  `tax_amount` decimal(10,2) DEFAULT '0.00',
  `cgst_amount` decimal(15,2) DEFAULT '0.00',
  `sgst_amount` decimal(15,2) DEFAULT '0.00',
  `igst_amount` decimal(15,2) DEFAULT '0.00',
  `total_price` decimal(12,2) NOT NULL,
  `mrp` decimal(10,2) DEFAULT '0.00',
  `discount_value` decimal(10,2) DEFAULT '0.00',
  `discount_type` enum('amount','percent') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'amount',
  PRIMARY KEY (`id`),
  KEY `sale_id` (`sale_id`),
  KEY `product_id` (`product_id`)
) ENGINE=MyISAM AUTO_INCREMENT=752 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sale_items`
--

INSERT INTO `sale_items` (`id`, `sale_id`, `product_id`, `product_name`, `description`, `hsn_code`, `quantity`, `unit`, `pieces_per_unit`, `unit_price`, `tax_percentage`, `tax_amount`, `cgst_amount`, `sgst_amount`, `igst_amount`, `total_price`, `mrp`, `discount_value`, `discount_type`) VALUES
(13, 1, 1, 'Godrej Fridge 220 Litre', '', '1871827', 2, 'PCS', 1, 28990.00, 18.00, 10436.40, 0.00, 0.00, 0.00, 68416.40, 28990.00, 0.00, 'amount'),
(5, 2, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 5218.20, 0.00, 0.00, 0.00, 34208.20, 0.00, 0.00, 'amount'),
(6, 2, 2, 'Videocon AC', '', '123455545', 1, 'PCS', 1, 0.00, 18.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'amount'),
(10, 6, 2, 'Videocon AC', '', '123455545', 1, 'PCS', 1, 5000.00, 18.00, 0.00, 0.00, 0.00, 0.00, 5000.00, 0.00, 0.00, 'amount'),
(15, 7, 2, 'Videocon AC', '', '123455545', 1, 'PCS', 1, 45000.00, 18.00, 8100.00, 0.00, 0.00, 0.00, 53100.00, 45000.00, 0.00, 'amount'),
(12, 8, 3, 'polycarbonized ', '', 'BAGSGAGSA', 1, 'PCS', 1, 600.00, 18.00, 108.00, 0.00, 0.00, 0.00, 708.00, 600.00, 0.00, 'amount'),
(14, 1, 2, 'Videocon AC', '', '123455545', 1, 'PCS', 1, 45000.00, 18.00, 8046.00, 0.00, 0.00, 0.00, 52746.00, 45000.00, 300.00, 'amount'),
(16, 7, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 5218.20, 0.00, 0.00, 0.00, 34208.20, 28990.00, 0.00, 'amount'),
(17, 9, 3, 'polycarbonized ', '', 'BAGSGAGSA', 1, 'PCS', 1, 600.00, 18.00, 108.00, 0.00, 0.00, 0.00, 708.00, 600.00, 0.00, 'amount'),
(18, 9, 5, 'respect baby diaper', '', '', 2, 'BOX', 10, 2300.00, 5.00, 230.00, 0.00, 0.00, 0.00, 4830.00, 230.00, 0.00, 'amount'),
(19, 10, 5, 'respect baby diaper', '', '', 1, 'PCS', 1, 230.00, 5.00, 0.00, 0.00, 0.00, 0.00, 230.00, 230.00, 0.00, 'amount'),
(20, 10, 3, 'polycarbonized ', '', 'BAGSGAGSA', 1, 'PCS', 1, 600.00, 18.00, 0.00, 0.00, 0.00, 0.00, 600.00, 600.00, 0.00, 'amount'),
(21, 11, 5, 'respect baby diaper', '', '', 1, 'PCS', 1, 230.00, 5.00, 0.00, 0.00, 0.00, 0.00, 230.00, 230.00, 0.00, 'amount'),
(22, 12, 4, 'test', '', '', 1, 'PCS', 1, 0.00, 5.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'amount'),
(23, 13, 5, 'respect baby diaper', '', '', 1, 'PCS', 1, 230.00, 5.00, 11.50, 0.00, 0.00, 0.00, 241.50, 230.00, 0.00, 'amount'),
(24, 13, 3, 'polycarbonized ', '', 'BAGSGAGSA', 1, 'PCS', 1, 600.00, 18.00, 108.00, 0.00, 0.00, 0.00, 708.00, 600.00, 0.00, 'amount'),
(25, 13, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 5218.20, 0.00, 0.00, 0.00, 34208.20, 28990.00, 0.00, 'amount'),
(26, 13, 2, 'Videocon AC', '', '123455545', 1, 'PCS', 1, 45000.00, 18.00, 8100.00, 0.00, 0.00, 0.00, 53100.00, 45000.00, 0.00, 'amount'),
(27, 14, 6, 'DOMS DIAPER ', '', '', 1, 'PCS', 1, 99.00, 12.00, 11.88, 0.00, 0.00, 0.00, 110.88, 99.00, 0.00, 'amount'),
(29, 15, 7, 'RESPECT PREMIUM BABY WIPES', '', '', 1, 'PCS', 1, 16000.00, 18.00, 2880.00, 0.00, 0.00, 0.00, 18880.00, 16000.00, 0.00, 'amount'),
(30, 16, 7, 'RESPECT PREMIUM BABY WIPES', '', '', 1, 'PCS', 1, 16000.00, 18.00, 2440.68, 0.00, 0.00, 0.00, 16000.00, 16000.00, 0.00, 'amount'),
(31, 17, 7, 'RESPECT PREMIUM BABY WIPES', '', '', 1, 'PCS', 1, 16000.00, 18.00, 2880.00, 0.00, 0.00, 0.00, 18880.00, 16000.00, 0.00, 'amount'),
(32, 18, 7, 'RESPECT PREMIUM BABY WIPES', '', '', 1, 'PCS', 1, 16000.00, 18.00, 2880.00, 0.00, 0.00, 0.00, 18880.00, 16000.00, 0.00, 'amount'),
(33, 18, 5, 'respect baby diaper', '', '', 1, 'PCS', 1, 230.00, 5.00, 11.50, 0.00, 0.00, 0.00, 241.50, 230.00, 0.00, 'amount'),
(34, 19, 5, 'respect baby diaper', '', '', 1, 'PCS', 1, 230.00, 5.00, 11.50, 0.00, 0.00, 0.00, 241.50, 230.00, 0.00, 'amount'),
(35, 19, 7, 'RESPECT PREMIUM BABY WIPES', '', '', 1, 'PCS', 1, 16000.00, 18.00, 2880.00, 0.00, 0.00, 0.00, 18880.00, 16000.00, 0.00, 'amount'),
(36, 20, 5, 'respect baby diaper', '', '', 6, 'BOX', 1, 230.00, 5.00, 67.62, 0.00, 0.00, 0.00, 1420.02, 230.00, 2.00, 'percent'),
(46, 21, 5, 'respect baby diaper', '', '', 10, 'BOX', 1, 230.00, 5.00, 112.70, 0.00, 0.00, 0.00, 2366.70, 230.00, 2.00, 'percent'),
(45, 22, 5, 'respect baby diaper', '', '', 6, 'BOX', 1, 230.00, 5.00, 67.62, 0.00, 0.00, 0.00, 1420.02, 230.00, 2.00, 'percent'),
(47, 23, 3, 'polycarbonized ', '', 'BAGSGAGSA', 1, 'PCS', 1, 600.00, 18.00, 108.00, 0.00, 0.00, 0.00, 708.00, 600.00, 0.00, 'amount'),
(48, 24, 6, 'DOMS DIAPER ', '', '', 20, 'PACKET', 2, 99.00, 12.00, 237.60, 0.00, 0.00, 0.00, 2217.60, 99.00, 0.00, 'amount'),
(49, 25, 6, 'DOMS DIAPER ', '', '', 1, 'PCS', 1, 99.00, 12.00, 10.61, 0.00, 0.00, 0.00, 99.00, 99.00, 0.00, 'amount'),
(50, 25, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 4422.20, 0.00, 0.00, 0.00, 28990.00, 28990.00, 0.00, 'amount'),
(51, 26, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 5218.20, 0.00, 0.00, 0.00, 34208.20, 28990.00, 0.00, 'amount'),
(52, 27, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 5218.20, 0.00, 0.00, 0.00, 34208.20, 28990.00, 0.00, 'amount'),
(53, 28, 1, 'Godrej Fridge 220 Litre', '', '1871827', 1, 'PCS', 1, 28990.00, 18.00, 5218.20, 0.00, 0.00, 5218.20, 34208.20, 28990.00, 0.00, 'amount'),
(56, 29, 8, 'PEN', '', '9608', 500, 'PCS', 1, 2.20, 18.00, 198.00, 99.00, 99.00, 0.00, 1298.00, 2.20, 0.00, 'amount'),
(740, 30, 17, 'knife', 'Knife (6\"), Make: Best Quality', '8208', 18, 'PCS', 1, 22.80, 18.00, 62.60, 31.30, 31.30, 0.00, 410.40, 22.80, 0.00, 'amount'),
(742, 30, 8, 'PEN', 'Pen Ball (10 Pcs.) [AGNI 4G 0.5mm), Colour: Blue, Make: Agni', '9608', 10, 'PACKET', 1, 29.00, 18.00, 44.24, 22.12, 22.12, 0.00, 290.00, 2.20, 0.00, 'amount'),
(741, 30, 20, 'register', 'Register -10 No, Make: Best Quality', '4820', 6, 'PCS', 1, 93.90, 18.00, 85.94, 42.97, 42.97, 0.00, 563.40, 93.90, 0.00, 'amount'),
(738, 30, 22, 'register 08 no', 'Register - 08 No, Make: Best Quality', '8420', 6, 'PCS', 1, 73.50, 18.00, 67.27, 33.64, 33.64, 0.00, 441.00, 73.50, 0.00, 'amount'),
(739, 30, 18, 'mouse', 'Mouse (HP/Frontech), Make: hp/Frontech ', '8473', 12, 'PCS', 1, 153.70, 18.00, 281.35, 140.67, 140.67, 0.00, 1844.40, 153.70, 0.00, 'amount'),
(736, 30, 19, 'pad writing', 'Pad Writing (48 pages) [Size: 8\"x5.5\"], Make : Best Quality ', '4820', 12, 'PCS', 1, 16.50, 18.00, 30.20, 15.10, 15.10, 0.00, 198.00, 16.50, 0.00, 'amount'),
(737, 30, 24, 'scotch brite (medium), make: best quality', 'Scotch brite (Medium), Make: Best Quality', '6805', 12, 'PCS', 1, 11.24, 18.00, 20.57, 10.29, 10.29, 0.00, 134.88, 11.24, 0.00, 'amount'),
(734, 30, 15, 'file', 'File - 4 fold file (with lamination), Make: Best Quality', '48203000', 60, 'PCS', 1, 18.90, 18.00, 172.98, 86.49, 86.49, 0.00, 1134.00, 18.90, 0.00, 'amount'),
(735, 30, 31, 'hitener (20 pcs.) [faber castell], make: faber castell', 'Whitener (20 Pcs.) [Faber Castell], Make: Faber Castell', '9608', 1, 'PCS', 1, 198.00, 18.00, 30.20, 15.10, 15.10, 0.00, 198.00, 198.00, 0.00, 'amount'),
(733, 30, 29, 'soap - detergent (500gm) [sunlight], make: branded', 'Soap - Detergent (500gm) [Sunlight], Make: Branded', '34025000', 510, 'PACKET', 1, 47.80, 18.00, 3718.68, 1859.34, 1859.34, 0.00, 24378.00, 47.80, 0.00, 'amount'),
(732, 30, 21, 'register  06', 'Register - 06 No, Make: Best Qualit', '4820', 18, 'PCS', 1, 53.80, 18.00, 147.72, 73.86, 73.86, 0.00, 968.40, 53.80, 0.00, 'amount'),
(731, 30, 16, 'keyboar', 'Keyboard (Computer) HP/Frontech, Make: hp/Frontech', '8471', 6, 'PCS', 1, 218.00, 18.00, 199.53, 99.76, 99.76, 0.00, 1308.00, 218.00, 0.00, 'amount'),
(730, 30, 11, 'BINDER CLIP ', 'Binder Clip (Size: 32mm), Make: Best Quality', '83059020', 3, 'BOX', 1, 34.70, 18.00, 15.88, 7.94, 7.94, 0.00, 104.10, 34.70, 0.00, 'amount'),
(729, 30, 12, 'Envelop', 'Envelop (10\" x 4.5\") Brown Colour, Make: Good Quality', '481719', 40, 'PCS', 1, 10.00, 18.00, 61.02, 30.51, 30.51, 0.00, 400.00, 10.00, 0.00, 'amount'),
(728, 30, 13, 'eraser ', 'Eraser 20 Pcs. (Apsara), Make: Apsar', '4016', 1, 'BOX', 1, 49.00, 18.00, 7.47, 3.74, 3.74, 0.00, 49.00, 49.00, 0.00, 'amount'),
(596, 31, 22, 'register 08 no', '', '8420', 5, 'PCS', 1, 73.50, 18.00, 56.06, 28.03, 28.03, 0.00, 367.50, 73.50, 0.00, 'amount'),
(597, 31, 8, 'PEN', 'Agni', '9608', 15, 'PCS', 1, 29.00, 18.00, 66.36, 33.18, 33.18, 0.00, 435.00, 2.20, 0.00, 'amount'),
(589, 31, 36, 'caclculator', 'orpat', '8470', 2, 'PCS', 1, 140.00, 18.00, 42.71, 21.36, 21.36, 0.00, 280.00, 140.00, 0.00, 'amount'),
(590, 31, 21, 'register  06', '', '4820', 5, 'PCS', 1, 53.80, 18.00, 41.03, 20.52, 20.52, 0.00, 269.00, 53.80, 0.00, 'amount'),
(591, 31, 35, 'binder clip 51 mm', '', '8305', 3, 'PACKET', 1, 60.00, 18.00, 27.46, 13.73, 13.73, 0.00, 180.00, 60.00, 0.00, 'amount'),
(592, 31, 32, 'register 18', '', '8420', 5, 'PCS', 1, 168.60, 18.00, 128.59, 64.30, 64.30, 0.00, 843.00, 168.60, 0.00, 'amount'),
(593, 31, 34, 'old news paper', '100 kg ', '4707', 100, 'PCS', 1, 50.00, 5.00, 238.10, 119.05, 119.05, 0.00, 5000.00, 50.00, 0.00, 'amount'),
(594, 31, 11, 'BINDER CLIP ', '', '83059020', 3, 'PACKET', 1, 34.70, 18.00, 15.88, 7.94, 7.94, 0.00, 104.10, 34.70, 0.00, 'amount'),
(595, 31, 33, 'register 12', '', '8420', 5, 'PCS', 1, 115.80, 18.00, 88.32, 44.16, 44.16, 0.00, 579.00, 115.80, 0.00, 'amount'),
(588, 31, 15, 'file', 'LAMIANTION', '48203000', 20, 'PCS', 1, 18.90, 18.00, 57.66, 28.83, 28.83, 0.00, 378.00, 18.90, 0.00, 'amount'),
(587, 31, 25, 'soap - detergent (500gm) [sunlight], make: branded', '', '34025000', 40, 'PCS', 1, 47.80, 18.00, 291.66, 145.83, 145.83, 0.00, 1912.00, 47.80, 0.00, 'amount'),
(549, 33, 38, 'HAND WASH DISPENSER( WALL MOUNTED)', '', '3924', 100, 'PCS', 1, 180.00, 18.00, 3240.00, 1620.00, 1620.00, 0.00, 21240.00, 180.00, 0.00, 'amount'),
(586, 31, 20, 'register', '10 no', '4820', 5, 'PCS', 1, 93.90, 18.00, 71.62, 35.81, 35.81, 0.00, 469.50, 93.90, 0.00, 'amount'),
(727, 30, 23, 'Highlighter pen', 'Pen Highliter (5 Pcs.) [Faber Castell], Make: Faber Castell', '9608', 4, 'PACKET', 1, 80.50, 18.00, 49.12, 24.56, 24.56, 0.00, 322.00, 80.50, 0.00, 'amount'),
(748, 35, 20, 'register', 'Register -10 No, Make: Best Quality', '4820', 6, 'PCS', 1, 93.90, 18.00, 85.94, 42.97, 42.97, 0.00, 563.40, 93.90, 0.00, 'amount'),
(747, 35, 8, 'PEN', 'Pen Ball (10 Pcs.) [AGNI 4G 0.5mm), Colour: Blue, Make: Agni', '9608', 10, 'PCS', 1, 29.00, 18.00, 44.24, 22.12, 22.12, 0.00, 290.00, 2.20, 0.00, 'amount'),
(746, 35, 17, 'knife', 'Knife (6\"), Make: Best Quality', '8208', 18, 'PCS', 1, 22.80, 18.00, 62.60, 31.30, 31.30, 0.00, 410.40, 22.80, 0.00, 'amount'),
(749, 36, 11, 'BINDER CLIP ', '', '83059020', 10, 'PCS', 1, 34.70, 18.00, 52.93, 26.47, 26.47, 0.00, 347.00, 34.70, 0.00, 'amount'),
(750, 36, 35, 'binder clip 51 mm', '', '8305', 10, 'PCS', 1, 60.00, 18.00, 91.53, 45.76, 45.76, 0.00, 600.00, 60.00, 0.00, 'amount'),
(751, 36, 9, 'S. S. Spoon (Medium) ', '', '8215', 10, 'PCS', 1, 14.50, 12.00, 15.54, 7.77, 7.77, 0.00, 145.00, 14.50, 0.00, 'amount');

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

--
-- Table structure for table `stock_movements`
--

CREATE TABLE IF NOT EXISTS `stock_movements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `company_id` int DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `movement_type` enum('in','out') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `quantity` int NOT NULL,
  `reference_type` enum('purchase','sale','adjustment') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `reference_id` int DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `user_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `product_id` (`product_id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=768 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `stock_movements`
--

INSERT INTO `stock_movements` (`id`, `company_id`, `product_id`, `movement_type`, `quantity`, `reference_type`, `reference_id`, `notes`, `user_id`, `created_at`) VALUES
(15, 1, 1, 'out', 2, 'sale', 1, NULL, 1, '2025-10-12 13:26:46'),
(29, 1, 4, 'in', 34, 'purchase', 1, NULL, 1, '2025-10-13 02:50:36'),
(28, 1, 2, 'in', 2, 'purchase', 1, NULL, 1, '2025-10-13 02:50:36'),
(7, 1, 1, 'out', 1, 'sale', 2, NULL, 1, '2025-09-12 03:01:21'),
(8, 1, 2, 'out', 1, 'sale', 2, NULL, 1, '2025-09-12 03:01:21'),
(12, 1, 2, 'out', 1, 'sale', 6, NULL, 1, '2025-09-22 12:30:52'),
(17, 1, 2, 'out', 1, 'sale', 7, NULL, 1, '2025-10-12 13:27:47'),
(14, 1, 3, 'out', 1, 'sale', 8, NULL, 1, '2025-10-10 11:18:43'),
(16, 1, 2, 'out', 1, 'sale', 1, NULL, 1, '2025-10-12 13:26:46'),
(18, 1, 1, 'out', 1, 'sale', 7, NULL, 1, '2025-10-12 13:27:47'),
(27, 1, 1, 'in', 1, 'purchase', 1, NULL, 1, '2025-10-13 02:50:36'),
(26, 1, 3, 'in', 1, 'purchase', 1, NULL, 1, '2025-10-13 02:50:36'),
(30, 1, 3, 'out', 1, 'sale', 9, NULL, 1, '2025-10-13 03:41:12'),
(31, 1, 5, 'out', 2, 'sale', 9, NULL, 1, '2025-10-13 03:41:12'),
(32, 1, 5, 'out', 1, 'sale', 10, NULL, 1, '2025-10-13 07:40:55'),
(33, 1, 3, 'out', 1, 'sale', 10, NULL, 1, '2025-10-13 07:40:55'),
(34, 1, 5, 'out', 1, 'sale', 11, NULL, 1, '2025-10-13 07:40:55'),
(35, 1, 4, 'out', 1, 'sale', 12, NULL, 1, '2025-10-13 07:47:43'),
(36, 1, 5, 'out', 1, 'sale', 13, NULL, 1, '2025-10-13 07:52:29'),
(37, 1, 3, 'out', 1, 'sale', 13, NULL, 1, '2025-10-13 07:52:29'),
(38, 1, 1, 'out', 1, 'sale', 13, NULL, 1, '2025-10-13 07:52:29'),
(39, 1, 2, 'out', 1, 'sale', 13, NULL, 1, '2025-10-13 07:52:29'),
(40, 1, 6, 'out', 1, 'sale', 14, NULL, 1, '2025-12-20 11:03:45'),
(41, 1, 7, 'in', 10, 'adjustment', NULL, 'PURCHASE ADJUST', 1, '2025-12-20 11:07:07'),
(43, 1, 7, 'out', 1, 'sale', 15, NULL, 1, '2025-12-20 11:11:23'),
(44, 1, 7, 'out', 1, 'sale', 16, NULL, 1, '2025-12-20 11:12:43'),
(45, 1, 7, 'in', 1, 'purchase', 2, NULL, 1, '2025-12-20 11:17:13'),
(46, 1, 7, 'out', 1, 'sale', 17, NULL, 1, '2025-12-20 11:17:59'),
(47, 1, 7, 'out', 1, 'sale', 18, NULL, 1, '2025-12-23 09:08:40'),
(48, 1, 5, 'out', 1, 'sale', 18, NULL, 1, '2025-12-23 09:08:40'),
(49, 1, 5, 'out', 1, 'sale', 19, NULL, 1, '2025-12-28 11:54:01'),
(50, 1, 7, 'out', 1, 'sale', 19, NULL, 1, '2025-12-28 11:54:01'),
(51, 1, 5, 'out', 6, 'sale', 20, NULL, 1, '2025-12-28 11:56:52'),
(61, 1, 5, 'out', 10, 'sale', 21, NULL, 1, '2025-12-28 17:13:45'),
(60, 1, 5, 'out', 6, 'sale', 22, NULL, 1, '2025-12-28 17:13:29'),
(62, 1, 3, 'out', 1, 'sale', 23, NULL, 1, '2026-01-15 02:29:38'),
(63, 2, 6, 'out', 20, 'sale', 24, NULL, 1, '2026-01-15 02:33:27'),
(64, 1, 6, 'out', 1, 'sale', 25, NULL, 1, '2026-01-15 18:11:08'),
(65, 1, 1, 'out', 1, 'sale', 25, NULL, 1, '2026-01-15 18:11:08'),
(66, 1, 1, 'out', 1, 'sale', 26, NULL, 1, '2026-01-16 02:06:05'),
(67, 1, 1, 'out', 1, 'sale', 27, NULL, 1, '2026-01-16 02:20:43'),
(68, 1, 1, 'out', 1, 'sale', 28, NULL, 1, '2026-01-16 02:51:27'),
(71, NULL, 8, 'out', 500, 'sale', 29, NULL, 1, '2026-01-20 07:45:03'),
(612, NULL, 8, 'out', 15, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(757, NULL, 8, 'out', 10, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(756, NULL, 20, 'out', 6, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(755, NULL, 17, 'out', 18, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(754, NULL, 18, 'out', 12, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(753, NULL, 22, 'out', 6, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(752, NULL, 24, 'out', 12, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(751, NULL, 19, 'out', 12, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(750, NULL, 31, 'out', 1, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(749, NULL, 15, 'out', 60, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(748, NULL, 29, 'out', 510, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(747, NULL, 21, 'out', 18, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(746, NULL, 16, 'out', 6, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(745, NULL, 11, 'out', 3, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(744, NULL, 12, 'out', 40, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(743, NULL, 13, 'out', 1, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(742, NULL, 23, 'out', 4, 'sale', 30, NULL, 1, '2026-02-05 06:47:19'),
(611, NULL, 22, 'out', 5, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(610, NULL, 33, 'out', 5, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(609, NULL, 11, 'out', 3, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(608, NULL, 34, 'out', 100, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(607, NULL, 32, 'out', 5, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(606, NULL, 35, 'out', 3, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(605, NULL, 21, 'out', 5, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(604, NULL, 36, 'out', 2, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(603, NULL, 15, 'out', 20, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(602, NULL, 25, 'out', 40, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(601, NULL, 20, 'out', 5, 'sale', 31, NULL, 1, '2026-01-29 19:22:20'),
(564, NULL, 38, 'out', 100, 'sale', 33, NULL, 1, '2026-01-28 05:36:41'),
(763, NULL, 20, 'out', 6, 'sale', 35, NULL, 1, '2026-02-05 09:50:32'),
(762, NULL, 8, 'out', 10, 'sale', 35, NULL, 1, '2026-02-05 09:50:32'),
(761, NULL, 17, 'out', 18, 'sale', 35, NULL, 1, '2026-02-05 09:50:32'),
(764, 1, 11, 'out', 10, 'sale', 36, NULL, 1, '2026-03-02 05:53:58'),
(765, 1, 35, 'out', 10, 'sale', 36, NULL, 1, '2026-03-02 05:53:58'),
(766, 1, 9, 'out', 10, 'sale', 36, NULL, 1, '2026-03-02 05:53:58'),
(767, 1, 6, 'in', 100, 'purchase', 3, NULL, 1, '2026-03-20 09:41:03');

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

--
-- Table structure for table `suppliers`
--

CREATE TABLE IF NOT EXISTS `suppliers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `gstin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `suppliers`
--

INSERT INTO `suppliers` (`id`, `name`, `company`, `phone`, `email`, `address`, `gstin`, `status`, `created_at`, `updated_at`) VALUES
(1, 'ABC Supplier', '', '', '', 'Kolkata', '', 'active', '2025-09-12 01:56:20', '2025-09-12 01:56:20');
COMMIT;

