-- ----------------------------
-- Table structure for quotations 
-- ----------------------------
DROP TABLE IF EXISTS `quotations`;
CREATE TABLE `quotations`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `client_id` int NOT NULL,
  `client_ordered_date` date NOT NULL,
  `project_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `project_type` enum('O','C') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'O', /* 'O' => 'one time', 'C' => Contractual */ 
  `duration_unit` enum('M','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,  /* 'M' => 'Month','Y' => 'Year'  */
  `duration_value` int NULL DEFAULT NULL,
  `mobilization_period_till` date NULL DEFAULT NULL,
  `feasible_quotation_sent_date` date NOT NULL,
  `order_valid_till` date NOT NULL,
  `total_billing` decimal(15, 2) NULL DEFAULT NULL,
  `disc_p` decimal(2, 2) NULL DEFAULT NULL,
  `total_discount_amount` decimal(15, 2) NULL DEFAULT NULL,
  `net_amt` decimal(15, 2) NULL DEFAULT NULL,
  `status` enum('IO','CO','FA','QG','QA','QS','NU','NA','B','CN','C','On') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'IO',  /* 'IO' => 'Incomplete Order', 'CO' => 'Completed Order', 'FA' => 'Feasibility Approved' ,'QG' => 'Quotation Generated', 'QA' => 'Quotation Approved', 'QS' => 'Quotation Sent', 'NU' => 'Negotitaion Update', 'NA' => 'Negotitaion Approved','B' => 'Marked As Booked' ,'CN' => 'Cancelled' ,'C' => 'Completed','On' => 'On Going' */
  `created_at` datetime(0) NULL DEFAULT NULL,
  `created_by` int NULL DEFAULT NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `updated_by` int NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;



-- ----------------------------
-- Table structure for quotation_samples
-- ----------------------------
DROP TABLE IF EXISTS `quotation_samples`;
CREATE TABLE `quotation_samples`  (
  `id` int(0) NOT NULL AUTO_INCREMENT,
  `quotation_id` int(0) NOT NULL,
  `sample_id` int(0) NOT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `frequency` int(0) NULL DEFAULT NULL,
  `freq_unit` enum('d','w','m','y') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `total_frequency` int(0) NULL DEFAULT NULL COMMENT 'Total frequency against each sample',
  `status` enum('O','Q','B') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'O',
  `created_at` datetime(0) NULL DEFAULT NULL,
  `created_by` int(0) NULL DEFAULT NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `updated_by` int(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC;