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

START TRANSACTION;



--
-- Database: `saanvi`
--

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

--
-- Table structure for table `tbl_customers`
--

CREATE TABLE `tbl_customers` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `mobile_no` varchar(15) DEFAULT NULL,
  `alter_mobile_no` varchar(15) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `gst_no` varchar(50) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=active, 0=inactive',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_customers`
--

INSERT INTO `tbl_customers` (`id`, `name`, `mobile_no`, `alter_mobile_no`, `address`, `email`, `gst_no`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Ganesan', '8124455952', '8667887997', NULL, 'ganesh@gmail.com', '234568', 1, '2025-10-28 08:24:24', '2026-05-14 07:17:37'),
(2, 'John Doe', '9876543210', '9123456789', NULL, 'john.doe@example.com', NULL, 1, '2025-10-28 08:26:14', '2026-05-13 08:31:02'),
(6, 'Test Customer', '9555555555', NULL, NULL, NULL, NULL, 1, '2025-11-11 23:14:50', '2026-05-13 08:31:02'),
(7, 'Test Customer 2', '9444444444', NULL, NULL, 'test@example.com', NULL, 1, '2025-11-11 23:14:59', '2026-05-13 08:31:02'),
(9, 'Test Customer 4', '9222222222', NULL, NULL, NULL, NULL, 1, '2025-11-11 23:15:16', '2026-05-13 08:31:02'),
(10, 'dfghjk Ganesan', '8124455953', NULL, NULL, NULL, NULL, 1, '2025-11-11 23:16:21', '2026-05-13 08:31:02'),
(11, 'Test Auto Login', '9555566666', NULL, NULL, 'testautologin@example.com', NULL, 1, '2025-11-11 23:31:11', '2026-05-13 08:31:02'),
(12, 'Test Network', '9333388888', '', NULL, 'testnetwork@example.com', NULL, 1, '2025-11-11 23:48:23', '2026-05-13 08:31:02'),
(13, 'Gan', '9368184875', '', NULL, '', NULL, 1, '2025-11-12 00:14:48', '2026-05-13 08:31:02'),
(15, 'Monisha', '6380171735', NULL, 'RCC Complex, Angammal Colony', NULL, 'gst234568', 1, '2026-05-14 08:20:02', '2026-05-14 08:20:02'),
(16, 'TEST', '9025151757', NULL, 'SALE', 'monisha@firstmatrix.in', 'GST', 1, '2026-05-16 06:31:48', '2026-05-16 06:31:48'),
(17, 'walkin customer', NULL, NULL, NULL, NULL, NULL, 1, '2026-05-21 12:32:18', '2026-05-21 12:32:18');

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

--
-- Table structure for table `tbl_customer_payments`
--

CREATE TABLE `tbl_customer_payments` (
  `id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `payment_mode` varchar(50) DEFAULT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_customer_payments`
--

INSERT INTO `tbl_customer_payments` (`id`, `customer_id`, `payment_date`, `amount`, `payment_mode`, `reference_no`, `notes`, `created_at`) VALUES
(1, 10, '2026-05-21', 10.00, 'Cash', '', '', '2026-05-21 10:01:38');

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

--
-- Table structure for table `tbl_poulinfra_quotations`
--

CREATE TABLE `tbl_poulinfra_quotations` (
  `id` int(10) UNSIGNED NOT NULL,
  `quotation_no` varchar(64) NOT NULL DEFAULT '',
  `quotation_date` date NOT NULL,
  `client_name` varchar(255) NOT NULL,
  `kind_attn` varchar(255) DEFAULT NULL,
  `client_address` text DEFAULT NULL,
  `client_mobile` varchar(20) DEFAULT NULL,
  `client_email` varchar(255) DEFAULT NULL,
  `proposal_title` varchar(255) NOT NULL DEFAULT 'PROPOSAL FOR POULTRY EQUIPMENTS',
  `intro_text` text DEFAULT NULL,
  `terms_text` text DEFAULT NULL,
  `house_params_json` text DEFAULT NULL,
  `installation_amount` decimal(15,2) DEFAULT 0.00,
  `no_of_houses` int(11) DEFAULT 1,
  `status` varchar(32) NOT NULL DEFAULT 'draft',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_poulinfra_quotations`
--

INSERT INTO `tbl_poulinfra_quotations` (`id`, `quotation_no`, `quotation_date`, `client_name`, `kind_attn`, `client_address`, `client_mobile`, `client_email`, `proposal_title`, `intro_text`, `terms_text`, `house_params_json`, `installation_amount`, `no_of_houses`, `status`, `created_at`, `updated_at`) VALUES
(1, 'SPF001', '2026-05-16', 'Poultry', 'Mr. Prakashh', 'Andhra Pradeshh', '98765432100', 'sample.client@example.com', 'PROPOSAL FOR POULTRY EQUIPMENTS', 'Thank you for your enquiry. This is a seeded sample quotation for layout and testing...', '1. Payment : 80% Advance , 20% Before Dispatch\n2. Delivery : 30Days After Receiving Advance\n3. freight : INCLUDE\n4. Tax : GST Include\n5. Food and Accommodation for Technicians will be provided by Customer\n6. Civil and Welding Work will be Done by Customer\n7. Installation, Electrical and Plumbing : INCLUDE', '{\"house_length_ft\":\"350\",\"house_length_m\":\"107\",\"house_width_ft\":\"40\",\"house_width_m\":\"12\",\"side_height_ft\":\"8\",\"side_height_m\":\"2\",\"total_sqft\":\"14000.0\",\"no_of_birds\":\"14000\",\"sqft_per_bird\":\"1\",\"no_feeding_lines\":\"4\",\"no_drinking_lines\":\"5\",\"ventilation_type\":\"TUNNEL\",\"voltage\":\"415 VOLT 3 PHASE 50 HZ\",\"type_of_controller\":\"SAANVI CLIMATE CONTROLLER\"}', 76000.00, 1, 'draft', '2026-05-13 13:34:36', '2026-05-16 09:23:53');

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

--
-- Table structure for table `tbl_poulinfra_quotation_steps`
--

CREATE TABLE `tbl_poulinfra_quotation_steps` (
  `id` int(10) UNSIGNED NOT NULL,
  `quotation_id` int(10) UNSIGNED NOT NULL,
  `step_no` tinyint(3) UNSIGNED NOT NULL,
  `section_title` varchar(255) NOT NULL,
  `amount` decimal(15,2) DEFAULT 0.00,
  `items_json` text NOT NULL,
  `image1` varchar(512) DEFAULT NULL,
  `image2` varchar(512) DEFAULT NULL,
  `image3` varchar(512) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_poulinfra_quotation_steps`
--

INSERT INTO `tbl_poulinfra_quotation_steps` (`id`, `quotation_id`, `step_no`, `section_title`, `amount`, `items_json`, `image1`, `image2`, `image3`) VALUES
(1, 1, 1, '1) FEEDING SYSTEM FOR :', 543990.00, '[{\"item\":\"FEEDING PANS\",\"qty\":\"544\"},{\"item\":\"AUGER WITH PIPE (PER LINE)\",\"qty\":\"340\"},{\"item\":\"MOTOR AND DRIVE UNIT\",\"qty\":\"4\"},{\"item\":\"WIRE ROPES(GI ROPES - PER LINE) 5mm, 3mm\",\"qty\":\"410\"},{\"item\":\"HANGING SUPPORT\",\"qty\":\"4\"},{\"item\":\"HOPPER\",\"qty\":\"4\"},{\"item\":\"WINCH\",\"qty\":\"4\"},{\"item\":\"FEED SENSOR\",\"qty\":\"4\"}]', 'uploads/poulinfra/1/s1_img1_1252f437.jpg', 'uploads/poulinfra/1/s1_img2_9c2c2b96.png', 'uploads/poulinfra/1/s1_img3_4fc651c0.jpg'),
(2, 1, 2, '2) NIPPLE DRINKING SYSTEM :', 235138.00, '[{\"item\":\"NIPPLES\",\"qty\":\"2040\"},{\"item\":\"DRIP CUPS\",\"qty\":\"2040\"},{\"item\":\"WATER REGULATOR\",\"qty\":\"5\"},{\"item\":\"WIRE ROPES(GI ROPE) 3mm, 2mm\",\"qty\":\"4000\"},{\"item\":\"HANGING SUPPORT\",\"qty\":\"5\"},{\"item\":\"WINCH\",\"qty\":\"5\"},{\"item\":\"WINCH HANDLE\",\"qty\":\"5\"},{\"item\":\"WATER REGULATOR END KIT\",\"qty\":\"5\"}]', 'uploads/poulinfra/1/s2_img1.png', 'uploads/poulinfra/1/s2_img2.png', NULL),
(3, 1, 3, '3) VENTILATION, COOLING PAD', 189000.00, '[{\"item\":\"54 INCH BOX FAN\",\"qty\":\"8\"},{\"item\":\"COOLING PAD WITH FRAME\",\"qty\":\"80\"},{\"item\":\"CLIMATE CONTROLLER\",\"qty\":\"1\"},{\"item\":\"TEMPERATURE SENSOR\",\"qty\":\"4\"},{\"item\":\"CONTROL PANEL\",\"qty\":\"1\"},{\"item\":\"DIESEL HEATER\",\"qty\":\"2\"}]', 'uploads/poulinfra/1/s3_img1.png', NULL, NULL),
(4, 1, 4, '4) COOLING PAD WITH GUTTER SYSTEM', 247500.00, '[{\"item\":\"COOLING PAD SECTION\",\"qty\":\"1 lot\"},{\"item\":\"GUTTER & RECIRCULATION (sample)\",\"qty\":\"1 lot\"}]', NULL, NULL, NULL),
(5, 1, 5, '5) CONTROL PANEL WITH CONTROLLER', 215000.00, '[{\"item\":\"MAIN CONTROL PANEL\",\"qty\":\"1\"},{\"item\":\"CLIMATE \\/ CURTAIN CONTROLLER\",\"qty\":\"1\"}]', 'uploads/poulinfra/1/s5_img1.png', NULL, NULL),
(6, 1, 6, '6) DIESEL HEATER', 90000.00, '[{\"item\":\"DIESEL HEATER UNIT\",\"qty\":\"2\"}]', NULL, NULL, NULL),
(7, 1, 7, '7) ELECTRICAL AND PLUMBING', 210000.00, '[{\"item\":\"ELECTRICAL MATERIAL & LABOUR (sample)\",\"qty\":\"1 lot\"},{\"item\":\"PLUMBING MATERIAL & LABOUR (sample)\",\"qty\":\"1 lot\"}]', 'uploads/poulinfra/1/s7_img1.png', 'uploads/poulinfra/1/s7_img2.png', NULL);

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

--
-- Table structure for table `tbl_poultry_company`
--

CREATE TABLE `tbl_poultry_company` (
  `id` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `name` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `proprietor_name` varchar(255) DEFAULT NULL,
  `mobile_no` varchar(15) DEFAULT NULL,
  `alter_mobile_no` varchar(15) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `gstin` varchar(32) DEFAULT NULL,
  `bank_account_name` varchar(255) DEFAULT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `bank_account_no` varchar(64) DEFAULT NULL,
  `bank_branch` varchar(128) DEFAULT NULL,
  `bank_ifsc` varchar(32) DEFAULT NULL,
  `quotation_tagline` varchar(255) DEFAULT NULL,
  `terms_json` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_poultry_company`
--

INSERT INTO `tbl_poultry_company` (`id`, `name`, `address`, `proprietor_name`, `mobile_no`, `alter_mobile_no`, `website`, `gstin`, `bank_account_name`, `bank_name`, `bank_account_no`, `bank_branch`, `bank_ifsc`, `quotation_tagline`, `terms_json`, `created_at`, `updated_at`) VALUES
(1, 'Saanvi Poultry Equipments', 'Manjunathreddy Complex, 4 Roads, Ganagavaram Mandal, Chittoor Dist. - 517432', 'L.Pakash', '9482445566', '9972011016', 'www.saanvienterprises.com', '37CDSPC6490F1Z6', 'Saanvi Poultry Equipments', 'Canara bank', '25001839210', 'Palamaner', 'CNRB0005830', 'Saanvi Poultry Equipments', '[\"\",\"\",\"\",\"\",\"\",\"\",\"\"]', '2026-05-13 10:26:32', '2026-05-16 05:28:59');

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

--
-- Table structure for table `tbl_poultry_estimates`
--

CREATE TABLE `tbl_poultry_estimates` (
  `id` int(10) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED DEFAULT NULL,
  `cust_name` varchar(255) NOT NULL,
  `cust_mobile` varchar(20) DEFAULT NULL,
  `cust_address` text DEFAULT NULL,
  `estimate_date` date NOT NULL,
  `length_ft` decimal(12,2) DEFAULT NULL,
  `width_ft` decimal(12,2) DEFAULT NULL,
  `no_lines` int(10) UNSIGNED DEFAULT NULL,
  `no_plumbings` int(10) UNSIGNED DEFAULT NULL,
  `no_sheds` int(10) UNSIGNED DEFAULT NULL,
  `no_feed_room` int(10) UNSIGNED DEFAULT NULL,
  `nc1` varchar(255) DEFAULT NULL,
  `nc2` varchar(255) DEFAULT NULL,
  `nc3` varchar(255) DEFAULT NULL,
  `lines_subtotal` decimal(14,2) NOT NULL DEFAULT 0.00,
  `gst_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `gst_percent` decimal(6,2) NOT NULL DEFAULT 0.00,
  `gst_type` enum('GST','IGST') NOT NULL DEFAULT 'GST',
  `gst_mode` enum('Inclusive','Exclusive') NOT NULL DEFAULT 'Exclusive',
  `gst_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `discount_type` enum('none','percentage','fixed') NOT NULL DEFAULT 'none',
  `discount_input` decimal(14,4) NOT NULL DEFAULT 0.0000,
  `total_discount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `round_off` decimal(14,2) NOT NULL DEFAULT 0.00,
  `net_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `amount_paid` decimal(10,2) DEFAULT 0.00,
  `balance_due` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_poultry_estimates`
--

INSERT INTO `tbl_poultry_estimates` (`id`, `customer_id`, `cust_name`, `cust_mobile`, `cust_address`, `estimate_date`, `length_ft`, `width_ft`, `no_lines`, `no_plumbings`, `no_sheds`, `no_feed_room`, `nc1`, `nc2`, `nc3`, `lines_subtotal`, `gst_enabled`, `gst_percent`, `gst_type`, `gst_mode`, `gst_amount`, `discount_type`, `discount_input`, `total_discount`, `round_off`, `net_amount`, `amount_paid`, `balance_due`, `created_at`, `updated_at`) VALUES
(1, 9, 'Test Customer 4', '9222222222', NULL, '2026-05-13', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 13300.00, 1, 18.00, 'GST', 'Inclusive', 2028.81, 'percentage', 0.0000, 0.00, 0.00, 13300.00, 0.00, 13300.00, '2026-05-13 10:46:45', '2026-05-21 10:41:41'),
(2, 10, 'dfghjk Ganesan', '8124455953', NULL, '2026-05-13', 20.00, 20.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 131779.00, 0, 18.00, 'GST', 'Exclusive', 0.00, 'none', 0.0000, 0.00, 0.00, 131779.00, 0.00, 131779.00, '2026-05-13 12:18:30', '2026-05-21 10:41:41'),
(3, 14, 'Jayasri', '8667887995', NULL, '2026-05-13', 20.00, 20.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 126487.00, 0, 18.00, 'GST', 'Exclusive', 0.00, 'none', 0.0000, 0.00, 0.00, 126487.00, 0.00, 126487.00, '2026-05-13 14:09:55', '2026-05-21 10:41:41'),
(4, 13, 'Gan', '9368184875', NULL, '2026-05-14', 400.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 126487.00, 1, 18.00, 'GST', 'Inclusive', 19294.63, 'none', 0.0000, 0.00, 0.00, 126487.00, 1264.00, 125223.00, '2026-05-14 08:25:59', '2026-05-21 10:47:23');

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

--
-- Table structure for table `tbl_poultry_estimate_lines`
--

CREATE TABLE `tbl_poultry_estimate_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `estimate_id` int(10) UNSIGNED NOT NULL,
  `product_id` tinyint(3) UNSIGNED NOT NULL,
  `qty` decimal(14,3) NOT NULL DEFAULT 0.000,
  `rate` decimal(14,2) NOT NULL DEFAULT 0.00,
  `line_subtotal` decimal(14,2) NOT NULL DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tbl_poultry_estimate_lines`
--

INSERT INTO `tbl_poultry_estimate_lines` (`id`, `estimate_id`, `product_id`, `qty`, `rate`, `line_subtotal`) VALUES
(37, 1, 1, 10.000, 430.00, 4300.00),
(38, 1, 2, 30.000, 300.00, 9000.00),
(39, 1, 3, 0.000, 270.00, 0.00),
(40, 1, 4, 0.000, 10.00, 0.00),
(41, 1, 5, 0.000, 27.00, 0.00),
(42, 1, 6, 0.000, 10.00, 0.00),
(43, 1, 7, 0.000, 25.00, 0.00),
(44, 1, 8, 0.000, 450.00, 0.00),
(45, 1, 9, 0.000, 50.00, 0.00),
(46, 1, 10, 0.000, 200.00, 0.00),
(47, 1, 11, 0.000, 15.00, 0.00),
(48, 1, 12, 0.000, 17.00, 0.00),
(49, 1, 13, 0.000, 16.00, 0.00),
(50, 1, 14, 0.000, 3.00, 0.00),
(51, 1, 15, 0.000, 2.50, 0.00),
(52, 1, 16, 0.000, 115.00, 0.00),
(53, 1, 17, 0.000, 175.00, 0.00),
(54, 1, 18, 0.000, 275.00, 0.00),
(55, 1, 19, 0.000, 60.00, 0.00),
(56, 1, 20, 0.000, 10.00, 0.00),
(57, 1, 21, 0.000, 0.00, 0.00),
(58, 1, 22, 0.000, 500.00, 0.00),
(59, 1, 23, 0.000, 30.00, 0.00),
(60, 1, 24, 0.000, 0.00, 0.00),
(61, 1, 25, 0.000, 13.00, 0.00),
(62, 1, 26, 0.000, 10.00, 0.00),
(63, 1, 27, 0.000, 12.00, 0.00),
(64, 1, 28, 0.000, 170.00, 0.00),
(65, 1, 29, 0.000, 12.00, 0.00),
(66, 1, 30, 0.000, 0.00, 0.00),
(67, 1, 31, 0.000, 0.00, 0.00),
(68, 1, 32, 0.000, 0.00, 0.00),
(69, 1, 33, 0.000, 0.00, 0.00),
(70, 1, 34, 0.000, 0.00, 0.00),
(71, 1, 35, 0.000, 0.00, 0.00),
(72, 1, 36, 0.000, 0.00, 0.00),
(110, 2, 1, 80.000, 430.00, 34400.00),
(111, 2, 2, 80.000, 0.00, 0.00),
(112, 2, 3, 80.000, 270.00, 21600.00),
(113, 2, 4, 80.000, 10.00, 800.00),
(114, 2, 5, 64.000, 27.00, 1728.00),
(115, 2, 6, 1600.000, 10.00, 16000.00),
(116, 2, 7, 8.000, 25.00, 200.00),
(117, 2, 8, 8.000, 450.00, 3600.00),
(118, 2, 9, 8.000, 50.00, 400.00),
(119, 2, 10, 16.000, 200.00, 3200.00),
(120, 2, 11, 8.000, 15.00, 120.00),
(121, 2, 12, 533.000, 17.00, 9061.00),
(122, 2, 13, 266.000, 16.00, 4256.00),
(123, 2, 14, 798.000, 3.00, 2394.00),
(124, 2, 15, 1064.000, 2.50, 2660.00),
(125, 2, 16, 32.000, 115.00, 3680.00),
(126, 2, 17, 16.000, 175.00, 2800.00),
(127, 2, 18, 32.000, 275.00, 8800.00),
(128, 2, 19, 64.000, 60.00, 3840.00),
(129, 2, 20, 0.000, 10.00, 0.00),
(130, 2, 21, 0.000, 0.00, 0.00),
(131, 2, 22, 1.000, 500.00, 500.00),
(132, 2, 23, 32.000, 30.00, 960.00),
(133, 2, 24, 0.000, 0.00, 0.00),
(134, 2, 25, 64.000, 13.00, 832.00),
(135, 2, 26, 40.000, 10.00, 400.00),
(136, 2, 27, 512.000, 12.00, 6144.00),
(137, 2, 28, 16.000, 170.00, 2720.00),
(138, 2, 29, 32.000, 12.00, 384.00),
(139, 2, 30, 0.000, 0.00, 0.00),
(140, 2, 31, 0.000, 0.00, 0.00),
(141, 2, 32, 0.000, 0.00, 0.00),
(142, 2, 33, 0.000, 0.00, 0.00),
(143, 2, 34, 0.000, 0.00, 0.00),
(144, 2, 35, 0.000, 0.00, 0.00),
(145, 2, 36, 1.000, 300.00, 300.00),
(146, 2, 37, 1.000, 0.00, 0.00),
(147, 3, 1, 80.000, 430.00, 34400.00),
(148, 3, 2, 80.000, 0.00, 0.00),
(149, 3, 3, 80.000, 270.00, 21600.00),
(150, 3, 4, 80.000, 10.00, 800.00),
(151, 3, 5, 64.000, 27.00, 1728.00),
(152, 3, 6, 1600.000, 10.00, 16000.00),
(153, 3, 7, 8.000, 25.00, 200.00),
(154, 3, 8, 8.000, 450.00, 3600.00),
(155, 3, 9, 8.000, 50.00, 400.00),
(156, 3, 10, 16.000, 200.00, 3200.00),
(157, 3, 11, 8.000, 15.00, 120.00),
(158, 3, 12, 533.000, 17.00, 9061.00),
(159, 3, 13, 266.000, 16.00, 4256.00),
(160, 3, 14, 798.000, 3.00, 2394.00),
(161, 3, 15, 1064.000, 2.50, 2660.00),
(162, 3, 16, 32.000, 115.00, 3680.00),
(163, 3, 17, 16.000, 175.00, 2800.00),
(164, 3, 18, 32.000, 275.00, 8800.00),
(165, 3, 19, 64.000, 60.00, 3840.00),
(166, 3, 20, 0.000, 10.00, 0.00),
(167, 3, 21, 0.000, 0.00, 0.00),
(168, 3, 22, 1.000, 500.00, 500.00),
(169, 3, 23, 32.000, 30.00, 960.00),
(170, 3, 24, 0.000, 0.00, 0.00),
(171, 3, 25, 64.000, 13.00, 832.00),
(172, 3, 26, 40.000, 10.00, 400.00),
(173, 3, 27, 96.000, 12.00, 1152.00),
(174, 3, 28, 16.000, 170.00, 2720.00),
(175, 3, 29, 32.000, 12.00, 384.00),
(176, 3, 30, 0.000, 0.00, 0.00),
(177, 3, 31, 0.000, 0.00, 0.00),
(178, 3, 32, 0.000, 0.00, 0.00),
(179, 3, 33, 0.000, 0.00, 0.00),
(180, 3, 34, 0.000, 0.00, 0.00),
(181, 3, 35, 0.000, 0.00, 0.00),
(182, 3, 36, 1.000, 0.00, 0.00),
(183, 3, 37, 1.000, 0.00, 0.00),
(479, 4, 1, 80.000, 430.00, 34400.00),
(480, 4, 2, 80.000, 0.00, 0.00),
(481, 4, 3, 80.000, 270.00, 21600.00),
(482, 4, 4, 80.000, 10.00, 800.00),
(483, 4, 5, 64.000, 27.00, 1728.00),
(484, 4, 6, 1600.000, 10.00, 16000.00),
(485, 4, 7, 8.000, 25.00, 200.00),
(486, 4, 8, 8.000, 450.00, 3600.00),
(487, 4, 9, 8.000, 50.00, 400.00),
(488, 4, 10, 16.000, 200.00, 3200.00),
(489, 4, 11, 8.000, 15.00, 120.00),
(490, 4, 12, 533.000, 17.00, 9061.00),
(491, 4, 13, 266.000, 16.00, 4256.00),
(492, 4, 14, 798.000, 3.00, 2394.00),
(493, 4, 15, 1064.000, 2.50, 2660.00),
(494, 4, 16, 32.000, 115.00, 3680.00),
(495, 4, 17, 16.000, 175.00, 2800.00),
(496, 4, 18, 32.000, 275.00, 8800.00),
(497, 4, 19, 64.000, 60.00, 3840.00),
(498, 4, 20, 0.000, 10.00, 0.00),
(499, 4, 21, 0.000, 0.00, 0.00),
(500, 4, 22, 1.000, 500.00, 500.00),
(501, 4, 23, 32.000, 30.00, 960.00),
(502, 4, 24, 0.000, 0.00, 0.00),
(503, 4, 25, 64.000, 13.00, 832.00),
(504, 4, 26, 40.000, 10.00, 400.00),
(505, 4, 27, 96.000, 12.00, 1152.00),
(506, 4, 28, 16.000, 170.00, 2720.00),
(507, 4, 29, 32.000, 12.00, 384.00),
(508, 4, 30, 0.000, 0.00, 0.00),
(509, 4, 31, 0.000, 0.00, 0.00),
(510, 4, 32, 0.000, 0.00, 0.00),
(511, 4, 33, 0.000, 0.00, 0.00),
(512, 4, 34, 0.000, 0.00, 0.00),
(513, 4, 35, 0.000, 0.00, 0.00),
(514, 4, 36, 1.000, 0.00, 0.00),
(515, 4, 37, 1.000, 0.00, 0.00);

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

--
-- Table structure for table `tbl_poultry_estimate_payments`
--

CREATE TABLE `tbl_poultry_estimate_payments` (
  `id` int(11) NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `payment_mode` varchar(50) DEFAULT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_poultry_estimate_payments`
--

INSERT INTO `tbl_poultry_estimate_payments` (`id`, `estimate_id`, `payment_date`, `amount`, `payment_mode`, `reference_no`, `notes`, `created_at`) VALUES
(1, 4, '2026-05-21', 1264.00, 'Cash', '', '', '2026-05-21 10:47:23');

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

--
-- Table structure for table `tbl_products`
--

CREATE TABLE `tbl_products` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `rate` decimal(12,2) NOT NULL DEFAULT 0.00,
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=active, 0=inactive',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_products`
--

INSERT INTO `tbl_products` (`id`, `name`, `rate`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Gi Pipe 20 ft', 430.00, 1, '2026-05-13 10:14:22', '2026-05-21 07:14:08'),
(2, 'Sq Pipe 20 ft', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(3, 'Sq to Sq Coupling', 270.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(4, 'Gi Coupling', 10.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(5, 'Sq to R Coupling', 27.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(6, 'All Direction Nipple', 10.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(7, '20 Liter Sub Tank', 25.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(8, 'Tank Nipple', 450.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(9, '3/4 Float Valve', 50.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(10, '3/4 (Thr) Elbow', 200.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(11, 'M.S. Tank Stand', 15.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(12, 'GI Clamp', 17.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(13, 'Chain', 16.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(14, 'Shook', 3.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(15, 'Nylon Rope', 2.50, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(16, 'Water Level Indicator Set', 115.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(17, '3/4 Hose Pipe', 175.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(18, '2 Inch Hosepipe', 275.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(19, '3/4 Ball Valve', 60.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(20, 'Tefflan Tape', 10.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(21, 'Square Saddles', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 12:46:48'),
(22, '1\" Screen Filter', 500.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(23, '3/4 1/2 (Thr) Tee', 30.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(24, '3/4 1/2 Plain Tee', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(25, '3/4 Tee', 13.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(26, '3/4 Elbow', 10.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(27, '3/4 FTA', 12.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(28, '3/4 PVC Pipe', 170.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(29, '3/4 MTA + End Cap', 12.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(30, 'Paste', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(31, '8 Kg Feeder', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(32, 'Turbo Feeder', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(33, 'Chick Drinker', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(34, '1\" PVC Pipe', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(35, 'MTA 3/4', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(36, 'Transport Charge', 0.00, 1, '2026-05-13 10:14:22', '2026-05-13 10:14:22'),
(37, 'Labour Charge', 0.00, 1, '2026-05-13 11:20:02', '2026-05-13 11:20:02');

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

--
-- Table structure for table `tbl_sales`
--

CREATE TABLE `tbl_sales` (
  `id` int(11) NOT NULL,
  `invoice_no` varchar(50) DEFAULT NULL,
  `sale_date` date DEFAULT NULL,
  `customer_id` int(11) DEFAULT NULL,
  `cust_name` varchar(255) DEFAULT NULL,
  `cust_mobile` varchar(20) DEFAULT NULL,
  `cust_address` text DEFAULT NULL,
  `estimate_id` int(11) DEFAULT NULL,
  `sale_type` varchar(10) DEFAULT 'GST',
  `subtotal` decimal(12,2) DEFAULT 0.00,
  `discount_type` varchar(20) DEFAULT 'none',
  `discount_input` decimal(12,2) DEFAULT 0.00,
  `total_discount` decimal(12,2) DEFAULT 0.00,
  `sum_after_disc` decimal(12,2) DEFAULT 0.00,
  `global_gst_percent` decimal(5,2) DEFAULT 0.00,
  `global_gst_mode` varchar(20) DEFAULT 'Exclusive',
  `total_gst` decimal(12,2) DEFAULT 0.00,
  `round_off` decimal(12,2) DEFAULT 0.00,
  `net_amount` decimal(12,2) DEFAULT 0.00,
  `amount_paid` decimal(10,2) DEFAULT 0.00,
  `balance_due` decimal(10,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_sales`
--

INSERT INTO `tbl_sales` (`id`, `invoice_no`, `sale_date`, `customer_id`, `cust_name`, `cust_mobile`, `cust_address`, `estimate_id`, `sale_type`, `subtotal`, `discount_type`, `discount_input`, `total_discount`, `sum_after_disc`, `global_gst_percent`, `global_gst_mode`, `total_gst`, `round_off`, `net_amount`, `amount_paid`, `balance_due`, `created_at`, `updated_at`) VALUES
(1, '1', '2026-05-14', 14, 'Jayasri', '8667887995', NULL, 3, 'GST', 126767.00, 'none', 0.00, 0.00, 126767.00, 0.00, 'Exclusive', 13.50, 0.50, 126781.00, 0.00, 0.00, '2026-05-14 07:10:53', '2026-05-14 07:10:53'),
(2, '0003', '2026-05-14', 15, 'Monisha', '6380171735', 'RCC Complex, Angammal Colony', NULL, 'GST', 1460.00, 'none', 0.00, 0.00, 1460.00, 5.00, 'Inclusive', 69.52, 0.00, 1460.00, 0.00, 0.00, '2026-05-14 08:21:10', '2026-05-14 08:21:10'),
(3, '0008', '2026-05-14', 13, 'Gan', '9368184875', NULL, NULL, 'GST', 300.00, 'none', 0.00, 0.00, 300.00, 5.00, 'Inclusive', 14.29, 0.00, 300.00, 300.00, 0.00, '2026-05-14 11:23:36', '2026-05-21 09:36:32'),
(4, '001', '2026-05-21', 10, 'dfghjk Ganesan', '8124455953', NULL, NULL, 'GST', 10.00, 'none', 0.00, 0.00, 10.00, 0.00, 'Exclusive', 0.00, 0.00, 10.00, 0.00, 0.00, '2026-05-21 09:13:38', '2026-05-21 09:13:38');

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

--
-- Table structure for table `tbl_sale_items`
--

CREATE TABLE `tbl_sale_items` (
  `id` int(11) NOT NULL,
  `sale_id` int(11) NOT NULL,
  `product_id` int(11) DEFAULT NULL,
  `product_name` varchar(255) DEFAULT NULL,
  `hsn` varchar(50) DEFAULT NULL,
  `qty` decimal(10,2) DEFAULT 0.00,
  `rate` decimal(10,2) DEFAULT 0.00,
  `gst_percent` decimal(5,2) DEFAULT 0.00,
  `gst_mode` varchar(20) DEFAULT 'Exclusive',
  `gst_amount` decimal(10,2) DEFAULT 0.00,
  `net_amount` decimal(10,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_sale_items`
--

INSERT INTO `tbl_sale_items` (`id`, `sale_id`, `product_id`, `product_name`, `hsn`, `qty`, `rate`, `gst_percent`, `gst_mode`, `gst_amount`, `net_amount`) VALUES
(1, 1, 1, 'Gi Pipe 20 ft', NULL, 80.00, 430.00, 0.00, 'Exclusive', 0.00, 34400.00),
(2, 1, 2, 'Sq Pipe 20 ft', NULL, 80.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(3, 1, 3, 'Sq to Sq Coupling', NULL, 80.00, 270.00, 0.00, 'Exclusive', 0.00, 21600.00),
(4, 1, 4, 'Gi Coupling', NULL, 80.00, 10.00, 0.00, 'Exclusive', 0.00, 800.00),
(5, 1, 5, 'Sq to R Coupling', NULL, 64.00, 27.00, 0.00, 'Exclusive', 0.00, 1728.00),
(6, 1, 6, 'All Direction Nipple', NULL, 1600.00, 10.00, 0.00, 'Exclusive', 0.00, 16000.00),
(7, 1, 7, '20 Liter Sub Tank', NULL, 8.00, 25.00, 0.00, 'Exclusive', 0.00, 200.00),
(8, 1, 8, 'Tank Nipple', NULL, 8.00, 450.00, 0.00, 'Exclusive', 0.00, 3600.00),
(9, 1, 9, '3/4 Float Valve', NULL, 8.00, 50.00, 0.00, 'Exclusive', 0.00, 400.00),
(10, 1, 10, '3/4 (Thr) Elbow', NULL, 16.00, 200.00, 0.00, 'Exclusive', 0.00, 3200.00),
(11, 1, 11, 'M.S. Tank Stand', NULL, 8.00, 15.00, 0.00, 'Exclusive', 0.00, 120.00),
(12, 1, 12, 'GI Clamp', NULL, 533.00, 17.00, 0.00, 'Exclusive', 0.00, 9061.00),
(13, 1, 13, 'Chain', NULL, 266.00, 16.00, 0.00, 'Exclusive', 0.00, 4256.00),
(14, 1, 14, 'Shook', NULL, 798.00, 3.00, 0.00, 'Exclusive', 0.00, 2394.00),
(15, 1, 15, 'Nylon Rope', NULL, 1064.00, 2.50, 0.00, 'Exclusive', 0.00, 2660.00),
(16, 1, 16, 'Water Level Indicator Set', NULL, 32.00, 115.00, 0.00, 'Exclusive', 0.00, 3680.00),
(17, 1, 17, '3/4 Hose Pipe', NULL, 16.00, 175.00, 0.00, 'Exclusive', 0.00, 2800.00),
(18, 1, 18, '2 Inch Hosepipe', NULL, 32.00, 275.00, 0.00, 'Exclusive', 0.00, 8800.00),
(19, 1, 19, '3/4 Ball Valve', NULL, 64.00, 60.00, 0.00, 'Exclusive', 0.00, 3840.00),
(20, 1, 20, 'Tefflan Tape', NULL, 1.00, 10.00, 0.00, 'Exclusive', 0.00, 10.00),
(21, 1, 21, 'Square Saddles', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(22, 1, 22, '1\" Screen Filter', NULL, 1.00, 500.00, 0.00, 'Exclusive', 0.00, 500.00),
(23, 1, 23, '3/4 1/2 (Thr) Tee', NULL, 32.00, 30.00, 0.00, 'Exclusive', 0.00, 960.00),
(24, 1, 24, '3/4 1/2 Plain Tee', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(25, 1, 25, '3/4 Tee', NULL, 64.00, 13.00, 0.00, 'Exclusive', 0.00, 832.00),
(26, 1, 26, '3/4 Elbow', NULL, 40.00, 10.00, 0.00, 'Exclusive', 0.00, 400.00),
(27, 1, 27, '3/4 FTA', NULL, 96.00, 12.00, 0.00, 'Exclusive', 0.00, 1152.00),
(28, 1, 28, '3/4 PVC Pipe', NULL, 16.00, 170.00, 0.00, 'Exclusive', 0.00, 2720.00),
(29, 1, 29, '3/4 MTA + End Cap', NULL, 32.00, 12.00, 0.00, 'Exclusive', 0.00, 384.00),
(30, 1, 30, 'Paste', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(31, 1, 31, '8 Kg Feeder', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(32, 1, 32, 'Turbo Feeder', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(33, 1, 33, 'Chick Drinker', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(34, 1, 34, '1\" PVC Pipe', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(35, 1, 35, 'MTA 3/4', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(36, 1, 36, 'Transport Charge', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(37, 1, 37, 'Labour Charge', NULL, 1.00, 0.00, 0.00, 'Exclusive', 0.00, 0.00),
(38, 1, 3, 'Sq to Sq Coupling', NULL, 1.00, 270.00, 5.00, 'Exclusive', 13.50, 283.50),
(39, 2, 3, 'Sq to Sq Coupling', NULL, 3.00, 270.00, 0.00, 'Exclusive', 0.00, 810.00),
(40, 2, NULL, 'test', NULL, 2.00, 100.00, 0.00, 'Exclusive', 0.00, 200.00),
(41, 2, NULL, 'cable', NULL, 10.00, 45.00, 0.00, 'Exclusive', 0.00, 450.00),
(44, 4, 4, 'Gi Coupling', '235', 1.00, 10.00, 0.00, 'Exclusive', 0.00, 10.00),
(45, 3, 7, '20 Liter Sub Tank', '12', 10.00, 25.00, 0.00, 'Exclusive', 0.00, 250.00),
(46, 3, NULL, 'TEST', '123', 5.00, 10.00, 0.00, 'Exclusive', 0.00, 50.00);

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

--
-- Table structure for table `tbl_sale_payments`
--

CREATE TABLE `tbl_sale_payments` (
  `id` int(11) NOT NULL,
  `sale_id` int(11) NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `payment_mode` varchar(50) DEFAULT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_sale_payments`
--

INSERT INTO `tbl_sale_payments` (`id`, `sale_id`, `payment_date`, `amount`, `payment_mode`, `reference_no`, `notes`, `created_at`) VALUES
(1, 3, '2026-05-14', 200.00, 'Cash', 'Initial Payment (System Auto-Recovery)', '', '2026-05-21 09:34:46'),
(2, 3, '2026-05-21', 100.00, 'Cash', '', '', '2026-05-21 09:36:32');

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

--
-- Table structure for table `tbl_settings`
--

CREATE TABLE `tbl_settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text NOT NULL,
  `setting_group` varchar(50) DEFAULT 'general',
  `description` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_by` int(11) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_settings`
--

INSERT INTO `tbl_settings` (`id`, `setting_key`, `setting_value`, `setting_group`, `description`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES
(1, 'software_name', 'Saanvi Poultry Equipments', 'software', 'Main software/application name', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:43'),
(2, 'software_version', '1.0.0', 'software', 'Current software version', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:44'),
(3, 'company_name', 'Saanvi Poultry Equipments', 'company', 'Company/organization name', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:44'),
(4, 'login_title', 'Login | Saanvi Poultry Equipments', 'ui', 'Title shown on login page', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:44'),
(5, 'dashboard_title', 'Dashboard - Saanvi Poultry Equipments', 'ui', 'Title shown on dashboard page', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:44'),
(6, 'panel_title', 'Saanvi Poultry Equipments - Panel', 'ui', 'Title shown in panel/browser tab', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:44'),
(7, 'tagline', 'Saanvi Poultry Equipments', 'software', 'Software tagline/description', NULL, '2025-10-28 10:49:31', 1, '2026-05-13 07:28:32'),
(8, 'copyright_text', '© 2026 Saanvi Poultry Equipments All Rights Received.', 'footer', 'Copyright text for footer', NULL, '2025-10-28 10:49:31', 1, '2026-05-16 06:30:44'),
(9, 'support_email', 'support@gmail.com', 'contact', 'Support email address', NULL, '2025-10-28 10:49:31', 1, '2026-05-13 07:28:32'),
(10, 'support_phone', '+91-XXXXXXXXXX', 'contact', 'Support phone number', NULL, '2025-10-28 10:49:31', 1, '2026-05-13 07:28:32'),
(15, 'brand_logo', 'uploads/branding/logo_e67bb7833d75c690.png', 'general', NULL, NULL, '2026-05-13 07:43:45', 1, '2026-05-16 06:30:27'),
(16, 'brand_favicon', 'uploads/branding/favicon_b29100e789466f69.png', 'general', NULL, NULL, '2026-05-13 07:43:46', 1, '2026-05-16 06:30:27'),
(32, 'brand_short_name', 'SPE', 'general', NULL, NULL, '2026-05-16 06:30:27', 1, '2026-05-16 06:30:44');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tbl_customers`
--
ALTER TABLE `tbl_customers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `mobile_no` (`mobile_no`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `tbl_customer_payments`
--
ALTER TABLE `tbl_customer_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_id` (`customer_id`);

--
-- Indexes for table `tbl_poulinfra_quotations`
--
ALTER TABLE `tbl_poulinfra_quotations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_poulinfra_q_date` (`quotation_date`),
  ADD KEY `idx_poulinfra_q_no` (`quotation_no`(32));

--
-- Indexes for table `tbl_poulinfra_quotation_steps`
--
ALTER TABLE `tbl_poulinfra_quotation_steps`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_quotation_step` (`quotation_id`,`step_no`);

--
-- Indexes for table `tbl_poultry_company`
--
ALTER TABLE `tbl_poultry_company`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tbl_poultry_estimates`
--
ALTER TABLE `tbl_poultry_estimates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_estimate_date` (`estimate_date`),
  ADD KEY `idx_customer_id` (`customer_id`);

--
-- Indexes for table `tbl_poultry_estimate_lines`
--
ALTER TABLE `tbl_poultry_estimate_lines`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_est_product` (`estimate_id`,`product_id`),
  ADD KEY `idx_estimate_id` (`estimate_id`);

--
-- Indexes for table `tbl_poultry_estimate_payments`
--
ALTER TABLE `tbl_poultry_estimate_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `estimate_id` (`estimate_id`);

--
-- Indexes for table `tbl_products`
--
ALTER TABLE `tbl_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_name` (`name`);

--
-- Indexes for table `tbl_sales`
--
ALTER TABLE `tbl_sales`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tbl_sale_items`
--
ALTER TABLE `tbl_sale_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sale_id` (`sale_id`);

--
-- Indexes for table `tbl_sale_payments`
--
ALTER TABLE `tbl_sale_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sale_id` (`sale_id`);

--
-- Indexes for table `tbl_settings`
--
ALTER TABLE `tbl_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_setting_key` (`setting_key`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tbl_customers`
--
ALTER TABLE `tbl_customers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `tbl_customer_payments`
--
ALTER TABLE `tbl_customer_payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `tbl_poulinfra_quotations`
--
ALTER TABLE `tbl_poulinfra_quotations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `tbl_poulinfra_quotation_steps`
--
ALTER TABLE `tbl_poulinfra_quotation_steps`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `tbl_poultry_estimates`
--
ALTER TABLE `tbl_poultry_estimates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `tbl_poultry_estimate_lines`
--
ALTER TABLE `tbl_poultry_estimate_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=516;

--
-- AUTO_INCREMENT for table `tbl_poultry_estimate_payments`
--
ALTER TABLE `tbl_poultry_estimate_payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `tbl_products`
--
ALTER TABLE `tbl_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- AUTO_INCREMENT for table `tbl_sales`
--
ALTER TABLE `tbl_sales`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `tbl_sale_items`
--
ALTER TABLE `tbl_sale_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `tbl_sale_payments`
--
ALTER TABLE `tbl_sale_payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `tbl_settings`
--
ALTER TABLE `tbl_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `tbl_poulinfra_quotation_steps`
--
ALTER TABLE `tbl_poulinfra_quotation_steps`
  ADD CONSTRAINT `fk_poulinfra_step_quotation` FOREIGN KEY (`quotation_id`) REFERENCES `tbl_poulinfra_quotations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tbl_poultry_estimate_lines`
--
ALTER TABLE `tbl_poultry_estimate_lines`
  ADD CONSTRAINT `fk_poultry_lines_estimate` FOREIGN KEY (`estimate_id`) REFERENCES `tbl_poultry_estimates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tbl_sale_items`
--
ALTER TABLE `tbl_sale_items`
  ADD CONSTRAINT `tbl_sale_items_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `tbl_sales` (`id`) ON DELETE CASCADE;
COMMIT;

