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

START TRANSACTION;



--
-- Database: `nahar-fabric-backend`
--

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

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

CREATE TABLE `categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `categories` (`id`, `name`, `status`, `created_at`, `updated_at`) VALUES
(6, 'Polyester viscose yarn', 'Active', '2023-06-13 10:59:31', '2023-06-13 10:59:31'),
(11, 'Pv', 'Active', '2024-08-13 17:52:44', '2024-08-21 19:51:41');

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

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

CREATE TABLE `customers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `address` varchar(191) DEFAULT NULL,
  `gst` varchar(191) DEFAULT NULL,
  `short_form` varchar(191) DEFAULT NULL,
  `contact_person_number` varchar(191) DEFAULT NULL,
  `bank_name` varchar(191) DEFAULT NULL,
  `ifsc` varchar(191) DEFAULT NULL,
  `ac_no` varchar(191) DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `customers` (`id`, `name`, `address`, `gst`, `short_form`, `contact_person_number`, `bank_name`, `ifsc`, `ac_no`, `status`, `created_at`, `updated_at`) VALUES
(3, 'Texwin Clothing Pvt Ltd', 'no 111 pallidora Road Dehiwala srilanka 400060', 'NA', 'NA', 'NA', 'n/a', 'n/a', 'n/a', 'Active', '2023-06-13 10:53:34', '2024-08-26 18:25:57'),
(7, 'YALE DE MEXICO S.A.P.I. DE C.V.', 'JAVIER ROJO GOMEZ # 1330 COL. BARRIO SAN MIGUEL', NULL, 'YALE', 'ANA LUCINA', NULL, NULL, NULL, 'Active', '2024-05-25 12:48:16', '2024-05-25 12:48:16');

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

--
-- Table structure for table `designs`
--

CREATE TABLE `designs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `design_master_id` bigint(20) UNSIGNED DEFAULT NULL,
  `order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `remarks` varchar(191) DEFAULT NULL,
  `expected_date` varchar(191) DEFAULT NULL,
  `expected_output` varchar(191) DEFAULT NULL,
  `shade` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `wastage_mtr` varchar(100) DEFAULT NULL,
  `wastage_percent` varchar(100) DEFAULT NULL,
  `expected_output_mtr` varchar(100) DEFAULT NULL,
  `expected_output_kgs` varchar(100) DEFAULT NULL,
  `actual_output_mtr` varchar(100) DEFAULT NULL,
  `actual_output_kgs` varchar(100) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL,
  `products` mediumtext DEFAULT NULL,
  `supplier_id` int(10) DEFAULT NULL,
  `production_no` varchar(100) DEFAULT NULL,
  `shrinkage` varchar(200) DEFAULT NULL,
  `wastage_percentage` varchar(20) DEFAULT NULL,
  `value_loss` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `designs`
--

INSERT INTO `designs` (`id`, `design_master_id`, `order_id`, `remarks`, `expected_date`, `expected_output`, `shade`, `created_at`, `updated_at`, `wastage_mtr`, `wastage_percent`, `expected_output_mtr`, `expected_output_kgs`, `actual_output_mtr`, `actual_output_kgs`, `status`, `products`, `supplier_id`, `production_no`, `shrinkage`, `wastage_percentage`, `value_loss`) VALUES
(49, 9, 39, 'NA', '2024-08-27', NULL, NULL, '2024-08-27 16:53:25', '2024-08-27 16:53:25', NULL, NULL, '500', '50', NULL, NULL, NULL, '[{\"id\":8,\"design_master_id\":9,\"product_id\":8,\"quantity\":-15}]', NULL, 'PROD00001', '100', '10', '1000');

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

--
-- Table structure for table `design_masters`
--

CREATE TABLE `design_masters` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `blend` varchar(191) DEFAULT NULL,
  `read` varchar(191) DEFAULT NULL,
  `pick` varchar(191) DEFAULT NULL,
  `glm` varchar(191) DEFAULT NULL,
  `read_space` varchar(191) DEFAULT NULL,
  `design_number` varchar(191) DEFAULT NULL,
  `weave` varchar(191) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `warp_pattern` text DEFAULT NULL,
  `weft_pattern` text DEFAULT NULL,
  `is_warp` tinyint(1) DEFAULT 0,
  `is_waf` tinyint(1) NOT NULL DEFAULT 0,
  `warp_pattern_file` varchar(100) DEFAULT NULL,
  `weft_pattern_file` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `supplier_id` int(10) DEFAULT NULL,
  `production_no` varchar(100) DEFAULT NULL,
  `finish_width` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `design_masters`
--

INSERT INTO `design_masters` (`id`, `blend`, `read`, `pick`, `glm`, `read_space`, `design_number`, `weave`, `remarks`, `warp_pattern`, `weft_pattern`, `is_warp`, `is_waf`, `warp_pattern_file`, `weft_pattern_file`, `created_at`, `updated_at`, `supplier_id`, `production_no`, `finish_width`) VALUES
(9, '70/30 PV', '52', '48', '360', '66', '9544 (without lycra)', 'twill', 'Color black', NULL, NULL, 0, 0, NULL, NULL, NULL, '2023-06-15 11:29:17', 5, NULL, ''),
(10, '70/30 blend', '60', '68', '290', '79', '9544/2', 'twill', 'color naavy', 'null', 'null', 0, 0, '1724656712_ud_it_logo.jpg', '1724656712_user_image1.jpg', '2023-07-18 10:47:47', '2024-08-26 18:11:12', NULL, NULL, 'null');

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

--
-- Table structure for table `design_master_details`
--

CREATE TABLE `design_master_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `design_master_id` bigint(20) UNSIGNED DEFAULT NULL,
  `product_id` bigint(20) UNSIGNED DEFAULT NULL,
  `quantity` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_warp` tinyint(1) NOT NULL DEFAULT 0,
  `remark` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `design_master_details`
--

INSERT INTO `design_master_details` (`id`, `design_master_id`, `product_id`, `quantity`, `created_at`, `updated_at`, `is_warp`, `remark`) VALUES
(8, 9, 8, '1000', '2023-06-17 13:29:11', '2023-07-19 08:40:53', 1, NULL),
(9, 10, 8, '1', '2023-07-18 10:47:47', '2023-07-18 10:50:28', 1, NULL),
(10, 10, 9, '1', '2023-07-18 10:50:28', '2023-07-18 10:50:28', 0, NULL),
(29, 10, 8, '1', '2024-08-26 18:11:12', '2024-08-26 18:11:12', 1, 'null'),
(30, 10, 8, '1', '2024-08-26 18:11:28', '2024-08-26 18:11:29', 1, 'null'),
(31, 10, 9, '1', '2024-08-26 18:11:29', '2024-08-26 18:11:29', 0, 'null'),
(32, 10, 8, '1', '2024-08-26 18:11:56', '2024-08-26 18:11:56', 1, 'null');

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

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

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `inventories`
--

CREATE TABLE `inventories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `product_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(191) DEFAULT NULL,
  `lot_no` varchar(191) DEFAULT NULL,
  `inward_date_auto` varchar(191) DEFAULT NULL,
  `remarks` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2023_05_05_105137_create_payments_table', 2),
(6, '2023_05_05_113506_create_suppliers_table', 2),
(7, '2023_05_08_135327_create_categories_table', 2),
(8, '2023_05_08_135335_create_products_table', 2),
(9, '2023_05_08_135404_create_customers_table', 2),
(10, '2023_05_08_135723_create_orders_table', 2),
(11, '2023_05_08_135731_create_order_details_table', 2),
(12, '2023_05_08_140542_create_processing_houses_table', 2),
(13, '2023_05_08_140618_create_purchase_orders_table', 2),
(14, '2023_05_08_140855_create_purchase_order_details_table', 2),
(15, '2023_05_08_141207_create_design_masters_table', 3),
(16, '2023_05_09_133836_create_design_master_details_table', 3),
(17, '2023_05_09_134102_create_designs_table', 3),
(18, '2023_05_09_134245_create_yarn_issues_table', 3),
(19, '2023_05_09_134427_create_yarn_issue_details_table', 3),
(20, '2023_05_09_134727_create_rolls_table', 3);

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

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

CREATE TABLE `orders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `order_id` varchar(191) DEFAULT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `payment_id` bigint(20) UNSIGNED DEFAULT NULL,
  `commission` varchar(191) DEFAULT NULL,
  `shipment_date` varchar(191) DEFAULT NULL,
  `transport_mode` varchar(191) DEFAULT NULL,
  `loading_port` varchar(191) DEFAULT NULL,
  `discharge_port` varchar(191) DEFAULT NULL,
  `payment_mode` varchar(191) DEFAULT NULL,
  `total` varchar(191) DEFAULT NULL,
  `signed_stamp` varchar(191) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `terms` text DEFAULT NULL,
  `is_approved` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `agent_name` varchar(191) DEFAULT NULL,
  `total_mtr` varchar(100) DEFAULT NULL,
  `shipping_address` varchar(100) DEFAULT NULL,
  `is_use_status` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `order_id`, `customer_id`, `user_id`, `payment_id`, `commission`, `shipment_date`, `transport_mode`, `loading_port`, `discharge_port`, `payment_mode`, `total`, `signed_stamp`, `remarks`, `terms`, `is_approved`, `created_at`, `updated_at`, `agent_name`, `total_mtr`, `shipping_address`, `is_use_status`) VALUES
(39, 'OR_24AUG0001', 3, 2, 1, '10', '2024-08-27', 'NA', 'Mumbai', 'Pune', 'NA', '1000', NULL, 'null', 'null', 0, '2024-08-27 15:25:29', '2024-08-27 20:19:28', 'Shelke Pradip', '10', 'Mumbai', 0);

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

--
-- Table structure for table `order_details`
--

CREATE TABLE `order_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `design_master_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(191) DEFAULT NULL,
  `rate` varchar(191) DEFAULT NULL,
  `product_total` varchar(191) DEFAULT NULL,
  `currency` varchar(100) DEFAULT NULL,
  `unit` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `shipping_address` varchar(100) DEFAULT NULL,
  `is_use` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_details`
--

INSERT INTO `order_details` (`id`, `order_id`, `design_master_id`, `qty`, `rate`, `product_total`, `currency`, `unit`, `created_at`, `updated_at`, `shipping_address`, `is_use`) VALUES
(37, 33, 9, '100', '100', '10000', 'INR', 'MTRS', '2024-03-04 11:07:34', '2024-03-04 11:07:34', NULL, 0),
(38, 34, 10, '10', '10', '100', 'INR', 'MTRS', '2024-03-23 07:36:36', '2024-03-23 07:37:17', NULL, 0),
(39, 34, 9, '20', '10', '200', 'INR', 'MTRS', '2024-03-23 07:36:36', '2024-03-23 07:37:17', NULL, 0),
(40, 35, 9, '1000', '5', '5000', 'USD', 'MTRS', '2024-08-13 17:27:21', '2024-08-13 17:27:21', NULL, 0),
(41, 36, 10, '3', '3', '9', 'USD', '', '2024-08-13 17:34:14', '2024-08-13 17:34:14', NULL, 0),
(42, 37, 9, '11111111111111', '25', '277777777777775', 'INR', 'MTRS', '2024-08-21 20:06:24', '2024-08-22 17:44:08', NULL, 0),
(43, 38, 9, '10', '400', '4000', 'INR', 'MTRS', '2024-08-22 17:50:40', '2024-08-22 17:50:40', NULL, 0),
(44, 39, 10, '10', '100', '1000', 'INR', 'MTRS', '2024-08-27 15:25:29', '2024-08-27 15:25:29', NULL, 0);

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

--
-- Table structure for table `packaging_lists`
--

CREATE TABLE `packaging_lists` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `design_id` bigint(20) UNSIGNED DEFAULT NULL,
  `manual_no` varchar(191) DEFAULT NULL,
  `sr_no` varchar(191) DEFAULT NULL,
  `design_no` varchar(191) DEFAULT NULL,
  `design_remark` varchar(191) DEFAULT NULL,
  `mtrs_yard` varchar(191) DEFAULT NULL,
  `gross_weight` varchar(191) DEFAULT NULL,
  `net_weight` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_approved` tinyint(1) NOT NULL DEFAULT 0,
  `shade` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packaging_lists`
--

INSERT INTO `packaging_lists` (`id`, `design_id`, `manual_no`, `sr_no`, `design_no`, `design_remark`, `mtrs_yard`, `gross_weight`, `net_weight`, `created_at`, `updated_at`, `is_approved`, `shade`) VALUES
(10, 32, 'MANUAL123444', 'PI_23JUN0008', 'DESIGN123', 'NA', '1000', '100', '100', '2023-06-17 14:17:41', '2023-06-17 14:18:56', 1, NULL),
(11, 36, 'NA', 'PI_24MAR0001', '12', 'NA', '600', '100', '109', '2024-03-01 06:42:33', '2024-03-01 06:42:33', 0, NULL),
(12, 36, '1', 'PI_24MAR0011', '3', '3', '3', '3', '3', '2024-03-01 06:46:23', '2024-03-04 11:24:10', 1, NULL),
(13, 37, '0', 'PI_24MAR0012', '0', '0', '0', '0', '0', '2024-03-01 07:15:15', '2024-03-01 07:15:15', 0, NULL);

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

--
-- Table structure for table `packaging_list_orders`
--

CREATE TABLE `packaging_list_orders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `packaging_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `roll_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(191) DEFAULT NULL,
  `rate` varchar(191) DEFAULT NULL,
  `product_total` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `receive_qty` varchar(100) DEFAULT NULL,
  `receive_rate` varchar(100) DEFAULT NULL,
  `diff_qty_percent` varchar(100) DEFAULT NULL,
  `diff_qty_rate` varchar(100) DEFAULT NULL,
  `shade` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packaging_list_orders`
--

INSERT INTO `packaging_list_orders` (`id`, `packaging_list_id`, `roll_id`, `qty`, `rate`, `product_total`, `created_at`, `updated_at`, `receive_qty`, `receive_rate`, `diff_qty_percent`, `diff_qty_rate`, `shade`) VALUES
(23, 10, NULL, NULL, NULL, NULL, '2023-06-17 14:17:57', '2023-06-17 14:17:57', NULL, NULL, NULL, NULL, NULL),
(24, 10, 24, NULL, NULL, NULL, '2023-06-17 14:18:38', '2023-06-17 14:18:38', NULL, NULL, NULL, NULL, NULL),
(25, 10, 23, NULL, NULL, NULL, '2023-07-21 08:09:59', '2023-07-21 08:09:59', NULL, NULL, NULL, NULL, NULL),
(26, 10, 24, NULL, NULL, NULL, '2023-07-21 08:09:59', '2023-07-21 08:09:59', NULL, NULL, NULL, NULL, NULL),
(27, 10, 25, NULL, NULL, NULL, '2023-07-21 08:09:59', '2023-07-21 08:09:59', NULL, NULL, NULL, NULL, NULL),
(29, 12, 61, NULL, NULL, NULL, '2024-03-04 11:23:53', '2024-03-04 11:23:53', NULL, NULL, NULL, NULL, NULL);

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

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

CREATE TABLE `payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `ac_name` varchar(191) NOT NULL,
  `swift_code` varchar(191) DEFAULT NULL,
  `swift_code_2` varchar(191) DEFAULT NULL,
  `bank_name` varchar(191) DEFAULT NULL,
  `ac_num` varchar(191) DEFAULT NULL,
  `bank` varchar(191) DEFAULT NULL,
  `branch` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `payments` (`id`, `ac_name`, `swift_code`, `swift_code_2`, `bank_name`, `ac_num`, `bank`, `branch`, `created_at`, `updated_at`) VALUES
(1, 'NAHAR ICIC', 'ICI', NULL, 'ICIC', '501002881', 'ICIC', 'Pune', NULL, '2023-09-20 20:36:26'),
(2, 'Nahar HDFc', 'HYVEDEMM300', 'as', 'HDFC', '501002881', 'HDFC', 'Shevgaon', '2023-05-12 12:58:04', '2024-08-21 19:57:57'),
(3, 'Pradip Federal', 'FED123', 'NA', 'Federal12', '0-809843095', 'Federal', 'Mumbai', '2024-03-01 05:04:16', '2024-03-01 05:07:20');

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

--
-- Table structure for table `processing_houses`
--

CREATE TABLE `processing_houses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `address` varchar(191) DEFAULT NULL,
  `gst` varchar(191) DEFAULT NULL,
  `short_form` varchar(191) DEFAULT NULL,
  `contact_person_number` varchar(191) DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `processing_houses`
--

INSERT INTO `processing_houses` (`id`, `name`, `address`, `gst`, `short_form`, `contact_person_number`, `status`, `created_at`, `updated_at`) VALUES
(3, 'Processing UseR', 'Mumbai', 'ABC123', 'v', '9767169605', 'Active', '2023-06-01 12:49:18', '2024-08-21 19:55:20'),
(6, 'test1', 'test1', '1', '1', 'test1', 'Active', '2024-08-21 19:55:46', '2024-08-27 14:50:12');

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

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

CREATE TABLE `products` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(191) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `quantity` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `products` (`id`, `category_id`, `name`, `description`, `status`, `created_at`, `updated_at`, `quantity`) VALUES
(8, 6, '2/30 Pv black', '2/30 67/33 PV', 'Active', '2023-06-13 11:00:30', '2024-08-27 16:54:26', 60),
(9, 6, '2/30 pv lycra', 'stretch 69/29/2', 'Active', '2023-07-18 10:49:48', '2024-08-27 16:54:26', 1391);

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

--
-- Table structure for table `purchase_orders`
--

CREATE TABLE `purchase_orders` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `po_id` varchar(191) DEFAULT NULL,
  `supplier_id` bigint(20) UNSIGNED DEFAULT NULL,
  `order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `total` varchar(191) DEFAULT NULL,
  `delivery_date` varchar(191) DEFAULT NULL,
  `is_approved` tinyint(1) NOT NULL DEFAULT 0,
  `is_inward_approved` tinyint(1) NOT NULL DEFAULT 0,
  `is_inward` tinyint(1) NOT NULL DEFAULT 0,
  `date` date DEFAULT NULL,
  `lot_no` int(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `purchase_order_details`
--

CREATE TABLE `purchase_order_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `purchase_order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `product_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` int(10) DEFAULT NULL,
  `rate` varchar(191) DEFAULT NULL,
  `product_total` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `receive_qty` varchar(100) DEFAULT NULL,
  `receive_rate` varchar(100) DEFAULT NULL,
  `diff_qty_percent` varchar(100) DEFAULT NULL,
  `diff_qty_rate` varchar(100) DEFAULT NULL,
  `category_id` int(20) DEFAULT NULL,
  `delivery_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `purchase_order_histories`
--

CREATE TABLE `purchase_order_histories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `purchase_order_id` bigint(20) UNSIGNED DEFAULT NULL,
  `product_id` bigint(20) UNSIGNED DEFAULT NULL,
  `purchase_order_detail_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` int(11) DEFAULT NULL,
  `rate` varchar(191) DEFAULT NULL,
  `date` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rolls`
--

CREATE TABLE `rolls` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `design_id` bigint(20) UNSIGNED DEFAULT NULL,
  `product_id` bigint(20) UNSIGNED DEFAULT NULL,
  `processing_house_id` bigint(20) UNSIGNED DEFAULT NULL,
  `roll_no` varchar(191) DEFAULT NULL,
  `weight` varchar(191) DEFAULT NULL,
  `mtrs` varchar(191) DEFAULT NULL,
  `lum_no` varchar(191) DEFAULT NULL,
  `creation_date` varchar(191) DEFAULT NULL,
  `received_date` varchar(191) DEFAULT NULL,
  `received_mtrs` varchar(191) DEFAULT NULL,
  `shrinkage_percent` varchar(191) DEFAULT NULL,
  `lot_no` varchar(191) DEFAULT NULL,
  `cut_report_status` varchar(191) DEFAULT NULL,
  `weight_after_cut` varchar(191) DEFAULT NULL,
  `mtrs_after_cut` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `wastage_mtr` varchar(100) DEFAULT NULL,
  `wastage_percent` varchar(100) DEFAULT NULL,
  `received_kg` varchar(100) DEFAULT NULL,
  `is_ready_to_dispatch` tinyint(1) NOT NULL DEFAULT 0,
  `cut_pack_mtr` varchar(100) DEFAULT NULL,
  `cut_diff_mtr` varchar(100) DEFAULT NULL,
  `cut_pack_yarn` varchar(100) DEFAULT NULL,
  `date` varchar(100) DEFAULT NULL,
  `cut_pack_percentage` varchar(100) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `roll_new_id` varchar(50) DEFAULT NULL,
  `split_roll` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `suppliers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `address` varchar(191) DEFAULT NULL,
  `gst` varchar(191) DEFAULT NULL,
  `short_form` varchar(191) DEFAULT NULL,
  `contact_person_number` varchar(191) DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `bank_name` varchar(100) DEFAULT NULL,
  `ifsc` varchar(100) DEFAULT NULL,
  `ac_no` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `suppliers` (`id`, `name`, `address`, `gst`, `short_form`, `contact_person_number`, `status`, `created_at`, `updated_at`, `bank_name`, `ifsc`, `ac_no`) VALUES
(10, 'Pradip', 'Mumbai', '0', 'NA', '9767169605', 'Active', '2024-08-26 18:18:17', '2024-08-26 18:25:31', 'HDFC Bank', 'IFSC1231', '5010028811'),
(11, 't', 't', 't', 't', 't', 'Active', '2024-08-26 18:27:36', '2024-08-26 18:27:36', 't', 't', 't');

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

--
-- Table structure for table `yarn_issues`
--

CREATE TABLE `yarn_issues` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `outward_date` varchar(191) DEFAULT NULL,
  `remarks` varchar(191) DEFAULT NULL,
  `process_type` varchar(191) DEFAULT NULL,
  `challan_number` varchar(191) DEFAULT NULL,
  `desgin_detail_id` int(20) DEFAULT NULL,
  `order_id` int(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `yarn_issues`
--

INSERT INTO `yarn_issues` (`id`, `outward_date`, `remarks`, `process_type`, `challan_number`, `desgin_detail_id`, `order_id`, `created_at`, `updated_at`) VALUES
(5, '2023-12-04', 'NA', 'Weft return', 'ABC@123', NULL, NULL, '2023-12-04 08:03:47', '2023-12-04 08:04:30'),
(6, '2024-03-01', 'NA', 'Warp issue', 'TEST123', NULL, NULL, '2024-03-01 06:40:48', '2024-03-01 06:40:48');

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

--
-- Table structure for table `yarn_issue_details`
--

CREATE TABLE `yarn_issue_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `design_id` bigint(20) UNSIGNED DEFAULT NULL,
  `product_id` bigint(20) UNSIGNED DEFAULT NULL,
  `yarn_issue_id` bigint(20) UNSIGNED DEFAULT NULL,
  `qty` varchar(191) DEFAULT NULL,
  `lot_no` int(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `yarn_issue_details`
--

INSERT INTO `yarn_issue_details` (`id`, `design_id`, `product_id`, `yarn_issue_id`, `qty`, `lot_no`, `created_at`, `updated_at`) VALUES
(8, NULL, 9, 5, '100', NULL, '2023-12-04 08:03:47', '2023-12-04 08:03:47'),
(9, NULL, 8, 6, '100', NULL, '2024-03-01 06:40:48', '2024-03-01 06:40:48');

--
-- Indexes for dumped tables
--

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

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

--
-- Indexes for table `designs`
--
ALTER TABLE `designs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `designs_design_master_id_foreign` (`design_master_id`),
  ADD KEY `designs_order_id_foreign` (`order_id`);

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

--
-- Indexes for table `design_master_details`
--
ALTER TABLE `design_master_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `design_master_details_design_master_id_foreign` (`design_master_id`),
  ADD KEY `design_master_details_product_id_foreign` (`product_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `inventories`
--
ALTER TABLE `inventories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventories_product_id_foreign` (`product_id`);

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

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `orders_payment_id_foreign` (`payment_id`);

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

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

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

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

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

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `products_category_id_foreign` (`category_id`);

--
-- Indexes for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_orders_supplier_id_foreign` (`supplier_id`),
  ADD KEY `purchase_orders_order_id_foreign` (`order_id`);

--
-- Indexes for table `purchase_order_details`
--
ALTER TABLE `purchase_order_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_order_details_purchase_order_id_foreign` (`purchase_order_id`),
  ADD KEY `purchase_order_details_product_id_foreign` (`product_id`);

--
-- Indexes for table `purchase_order_histories`
--
ALTER TABLE `purchase_order_histories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_order_histories_purchase_order_id_foreign` (`purchase_order_id`),
  ADD KEY `purchase_order_histories_product_id_foreign` (`product_id`),
  ADD KEY `purchase_order_histories_purchase_order_detail_id_foreign` (`purchase_order_detail_id`);

--
-- Indexes for table `rolls`
--
ALTER TABLE `rolls`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rolls_design_id_foreign` (`design_id`),
  ADD KEY `rolls_product_id_foreign` (`product_id`),
  ADD KEY `rolls_processing_house_id_foreign` (`processing_house_id`);

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

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

--
-- Indexes for table `yarn_issue_details`
--
ALTER TABLE `yarn_issue_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `yarn_issue_details_design_id_foreign` (`design_id`),
  ADD KEY `yarn_issue_details_product_id_foreign` (`product_id`),
  ADD KEY `yarn_issue_details_yarn_issue_id_foreign` (`yarn_issue_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `designs`
--
ALTER TABLE `designs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT for table `design_masters`
--
ALTER TABLE `design_masters`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `design_master_details`
--
ALTER TABLE `design_master_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `inventories`
--
ALTER TABLE `inventories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

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

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- AUTO_INCREMENT for table `order_details`
--
ALTER TABLE `order_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

--
-- AUTO_INCREMENT for table `packaging_lists`
--
ALTER TABLE `packaging_lists`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `packaging_list_orders`
--
ALTER TABLE `packaging_list_orders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `processing_houses`
--
ALTER TABLE `processing_houses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;

--
-- AUTO_INCREMENT for table `purchase_order_details`
--
ALTER TABLE `purchase_order_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `purchase_order_histories`
--
ALTER TABLE `purchase_order_histories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `rolls`
--
ALTER TABLE `rolls`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=63;

--
-- AUTO_INCREMENT for table `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `yarn_issues`
--
ALTER TABLE `yarn_issues`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `yarn_issue_details`
--
ALTER TABLE `yarn_issue_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `designs`
--
ALTER TABLE `designs`
  ADD CONSTRAINT `designs_design_master_id_foreign` FOREIGN KEY (`design_master_id`) REFERENCES `design_masters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `design_master_details`
--
ALTER TABLE `design_master_details`
  ADD CONSTRAINT `design_master_details_design_master_id_foreign` FOREIGN KEY (`design_master_id`) REFERENCES `design_masters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `design_master_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `inventories`
--
ALTER TABLE `inventories`
  ADD CONSTRAINT `inventories_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `orders_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `purchase_orders`
--
ALTER TABLE `purchase_orders`
  ADD CONSTRAINT `purchase_orders_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `purchase_order_details`
--
ALTER TABLE `purchase_order_details`
  ADD CONSTRAINT `purchase_order_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `purchase_order_details_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `purchase_order_histories`
--
ALTER TABLE `purchase_order_histories`
  ADD CONSTRAINT `purchase_order_histories_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `purchase_order_histories_purchase_order_detail_id_foreign` FOREIGN KEY (`purchase_order_detail_id`) REFERENCES `purchase_order_details` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `purchase_order_histories_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `rolls`
--
ALTER TABLE `rolls`
  ADD CONSTRAINT `rolls_design_id_foreign` FOREIGN KEY (`design_id`) REFERENCES `designs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `rolls_processing_house_id_foreign` FOREIGN KEY (`processing_house_id`) REFERENCES `processing_houses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `rolls_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `yarn_issue_details`
--
ALTER TABLE `yarn_issue_details`
  ADD CONSTRAINT `yarn_issue_details_design_id_foreign` FOREIGN KEY (`design_id`) REFERENCES `designs` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `yarn_issue_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `yarn_issue_details_yarn_issue_id_foreign` FOREIGN KEY (`yarn_issue_id`) REFERENCES `yarn_issues` (`id`) ON DELETE CASCADE;
COMMIT;

