--
-- Host: localhost    Database: teamwayomantelx_manufacture
-- ------------------------------------------------------


--
-- Table structure for table `Edama_businessesaccounts`
--

CREATE TABLE `Edama_businessesaccounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `acc_name` varchar(255) NOT NULL,
  `acc_code` varchar(255) DEFAULT NULL,
  `acc_parent` int(11) NOT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT '0',
  `is_inactive` int(11) NOT NULL DEFAULT '0',
  `acc_description` text,
  `module_id` int(11) DEFAULT '0',
  `module` enum('suppliers','team_members','clients','expenses','assets') DEFAULT NULL,
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesaccounts`
--

INSERT INTO `Edama_businessesaccounts` VALUES (1,'Assets','1',0,1,0,NULL,0,NULL,0),(2,'Non-Current Assets','1-1',1,0,0,NULL,0,NULL,0),(3,'Office Devices, Furniture and Fixtures','1-1-1',2,0,0,NULL,0,NULL,0),(4,'Office Devices, Furniture and Fixtures','1-1-1-1',3,0,0,NULL,0,NULL,0),(5,'Machinery, Tools & Equipments','1-1-2',2,0,0,NULL,0,NULL,0),(6,'Machinery, Tools & Equipments','1-1-2-1',5,0,0,NULL,0,NULL,0),(7,'Motor Vehicles','1-1-3',2,0,0,NULL,0,NULL,0),(8,'Motor Vehicles','1-1-3-1',7,0,0,NULL,0,NULL,0),(9,'Long Term Investments ','1-1-4',2,0,0,NULL,0,NULL,0),(10,'Long Term Investments ','1-1-4-1',9,0,0,NULL,0,NULL,0),(11,'Intangible Assets','1-1-5',2,0,0,NULL,0,NULL,0),(12,'Intangible Assets','1-1-5-1',11,0,0,NULL,0,NULL,0),(13,'Current Assets','1-2',1,0,0,NULL,0,NULL,0),(14,'Employees Payments','1-2-1',13,0,0,NULL,0,NULL,0),(15,'Employees loans','1-2-1-1',14,0,0,NULL,0,NULL,0),(16,'Employees petty cash','1-2-1-2',14,0,0,NULL,0,NULL,0),(17,'Inventories','1-2-2',13,0,0,NULL,0,NULL,0),(18,'Default Inventory','1-2-2-1',17,0,0,NULL,0,NULL,0),(19,'Account Receivable - Customers','1-2-3',13,0,0,NULL,0,NULL,0),(20,'Account Receivable - Cheques On Hand','1-2-4',13,0,0,NULL,0,NULL,0),(21,'PDC Receivable','1-2-4-1',20,0,0,NULL,0,NULL,0),(22,'RD Receivable Cheques','1-2-4-2',20,0,0,NULL,0,NULL,0),(23,'Legal Cheques','1-2-4-3',20,0,0,NULL,0,NULL,0),(24,'Cash-On-Hand(Safes)','1-2-5',13,0,0,NULL,0,NULL,0),(25,'Bank Accounts','1-2-6',13,0,0,NULL,0,NULL,0),(26,'Deferred Taxes','1-2-7',13,0,0,NULL,0,NULL,0),(27,'VAT-In','1-2-7-1',26,0,0,NULL,0,NULL,0),(28,'Liabilities','2',0,1,0,NULL,0,NULL,0),(29,'Non-Current Liability','2-1',28,0,0,NULL,0,NULL,0),(30,'Mortgage Loan Payable','2-1-1',29,0,0,NULL,0,NULL,0),(31,'Mortgage Loan Payable','2-1-1-1',30,0,0,NULL,0,NULL,0),(32,'Othor -Longe term - Liabilities','2-1-2',29,0,0,NULL,0,NULL,0),(33,'Othor -Longe term - Liabilities','2-1-2-1',32,0,0,NULL,0,NULL,0),(34,'Deferred Taxes','2-1-3',29,0,0,NULL,0,NULL,0),(35,'VAT-Out','2-1-3-1',34,0,0,NULL,0,NULL,0),(36,'Current Liability','2-2',28,0,0,NULL,0,NULL,0),(37,'Account Payables - Suppliers','2-2-1',36,0,0,NULL,0,NULL,0),(38,'Accumulated Depreciation ','2-2-2',36,0,0,NULL,0,NULL,0),(39,'Accumulated Depreciation ','2-2-2-1',38,0,0,NULL,0,NULL,0),(40,'Service Providers','2-2-3',36,0,0,NULL,0,NULL,0),(41,'Default Service Provider','2-2-3-1',40,0,0,NULL,0,NULL,0),(42,'Account Payable - Cheques','2-2-4',36,0,0,NULL,0,NULL,0),(43,'PDC Payables','2-2-4-1',42,0,0,NULL,0,NULL,0),(44,'RD Payables Cheques','2-2-4-2',43,0,0,NULL,0,NULL,0),(45,'Employees Payments','2-2-5',36,0,0,NULL,0,NULL,0),(46,'Payable Salaries','2-2-5-1',45,0,0,NULL,0,NULL,0),(47,'Equity','3',0,1,0,NULL,0,NULL,0),(48,'Owners Equity','3-1',47,0,0,NULL,0,NULL,0),(49,'SHARE HOLDERS A/C','3-1-1',48,0,0,NULL,0,NULL,0),(50,'SHARE HOLDERS A/C','3-1-1-1',49,0,0,NULL,0,NULL,0),(51,'OWNER CURRENT A/C','3-1-2',48,0,0,NULL,0,NULL,0),(52,'OWNER CURRENT A/C','3-1-2-1',51,0,0,NULL,0,NULL,0),(53,'PROFIT & LOSS A/C','3-1-3',48,0,0,NULL,0,NULL,0),(54,'Retained Profit & Loss','3-1-3-1',53,0,0,NULL,0,NULL,0),(55,'Current Profit & Loss','3-1-3-2',53,0,0,NULL,0,NULL,0),(56,'Expenses','4',0,1,0,NULL,0,NULL,0),(57,'Direct Expenses','4-1',56,0,0,NULL,0,NULL,0),(58,'Sales Returns And Allowances','4-1-1',57,0,0,NULL,0,NULL,0),(59,'Sales Returns','4-1-1-1',58,0,0,NULL,0,NULL,0),(60,'Sales Discount','4-1-1-2',58,0,0,NULL,0,NULL,0),(61,'Cost of Revenue','4-1-2',57,0,0,NULL,0,NULL,0),(62,'Default Cost Of Good Sold','4-1-2-1',61,0,0,NULL,0,NULL,0),(63,'Indirect Expenses','4-2',56,0,0,NULL,0,NULL,0),(64,'Employees & Benefits Expenses','4-2-1',63,0,0,NULL,0,NULL,0),(65,'Salaries','4-2-1-1',64,0,0,NULL,0,NULL,0),(66,'Advance Salaries','4-2-1-2',64,0,0,NULL,0,NULL,0),(67,'Income','5',0,1,0,NULL,0,NULL,0),(68,'Direct Income','5-1',67,0,0,NULL,0,NULL,0),(69,'Sales Revenue','5-1-1',68,0,0,NULL,0,NULL,0),(70,'Default Sales','5-1-1-1',69,0,0,NULL,0,NULL,0),(71,'Indirect Income','5-2',67,0,0,NULL,0,NULL,0),(72,'Other Revenue','5-2-1',71,0,0,NULL,0,NULL,0),(73,'Other Revenue','5-2-1-1',72,0,0,NULL,0,NULL,0),(74,'GIT','1-2-8',13,0,0,NULL,0,NULL,0),(75,'Default Git','1-2-8-1',74,0,0,NULL,0,NULL,0),(76,'Client 1','1-2-3-1',19,0,0,NULL,0,NULL,0),(77,'Test Bank','1-2-6-1',25,0,0,'Test Bank',NULL,NULL,0),(78,'TetraObject','2-2-1-1',37,0,0,NULL,0,NULL,0),(79,'Intelligent Projects','1-2-3-2',19,0,0,NULL,0,NULL,0);

--
-- Table structure for table `Edama_businessesactivity_logs`
--

CREATE TABLE `Edama_businessesactivity_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `action` enum('created','updated','deleted') COLLATE utf8_unicode_ci NOT NULL,
  `log_type` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `log_type_title` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `log_type_id` int(11) NOT NULL DEFAULT '0',
  `changes` mediumtext COLLATE utf8_unicode_ci,
  `log_for` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `log_for_id` int(11) NOT NULL DEFAULT '0',
  `log_for2` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `log_for_id2` int(11) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesactivity_logs`
--


--
-- Table structure for table `Edama_businessesannouncements`
--

CREATE TABLE `Edama_businessesannouncements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `created_by` int(11) NOT NULL,
  `share_with` mediumtext COLLATE utf8_unicode_ci,
  `created_at` datetime NOT NULL,
  `files` text COLLATE utf8_unicode_ci NOT NULL,
  `read_by` mediumtext COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesannouncements`
--


--
-- Table structure for table `Edama_businessesattendance`
--

CREATE TABLE `Edama_businessesattendance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` enum('incomplete','pending','approved','rejected','deleted') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'incomplete',
  `user_id` int(11) NOT NULL,
  `in_time` datetime NOT NULL,
  `out_time` datetime DEFAULT NULL,
  `checked_by` int(11) DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `checked_at` datetime DEFAULT NULL,
  `reject_reason` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `checked_by` (`checked_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesattendance`
--


--
-- Table structure for table `Edama_businessesbudgeting`
--

CREATE TABLE `Edama_businessesbudgeting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) DEFAULT NULL,
  `estimate_request_id` int(11) NOT NULL DEFAULT '0',
  `estimate_date` date NOT NULL,
  `valid_until` date DEFAULT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','sent','accepted','declined','approved','request_approval') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci DEFAULT NULL,
  `discount_amount` double DEFAULT NULL,
  `profit` double DEFAULT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci DEFAULT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesbudgeting`
--


--
-- Table structure for table `Edama_businessesbudgeting_forms`
--

CREATE TABLE `Edama_businessesbudgeting_forms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `public` tinyint(1) NOT NULL DEFAULT '0',
  `enable_attachment` tinyint(4) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesbudgeting_forms`
--


--
-- Table structure for table `Edama_businessesbudgeting_items`
--

CREATE TABLE `Edama_businessesbudgeting_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `estimate_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `quotation_uom` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `quotation_quantity` double DEFAULT NULL,
  `item_price` double DEFAULT NULL,
  `quotation_selling_rate` double DEFAULT NULL,
  `quotation_total` double DEFAULT NULL,
  `cost_uom` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cost_quantity` double DEFAULT NULL,
  `cost_rate` double DEFAULT NULL,
  `cost_total` double DEFAULT NULL,
  `material_cost` double DEFAULT NULL,
  `labour_cost` double DEFAULT NULL,
  `machinery` double DEFAULT NULL,
  `others` double DEFAULT NULL,
  `profit` double DEFAULT NULL,
  `total` double DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesbudgeting_items`
--


--
-- Table structure for table `Edama_businessesbudgeting_requests`
--

CREATE TABLE `Edama_businessesbudgeting_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `estimate_form_id` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `client_id` int(11) NOT NULL,
  `lead_id` int(11) NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `status` enum('new','processing','hold','canceled','estimated') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'new',
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesbudgeting_requests`
--


--
-- Table structure for table `Edama_businesseschecklist_items`
--

CREATE TABLE `Edama_businesseschecklist_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `is_checked` int(11) NOT NULL DEFAULT '0',
  `task_id` int(11) NOT NULL DEFAULT '0',
  `sort` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businesseschecklist_items`
--


--
-- Table structure for table `Edama_businessesci_sessions`
--

CREATE TABLE `Edama_businessesci_sessions` (
  `id` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `ip_address` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `timestamp` int(10) unsigned NOT NULL DEFAULT '0',
  `data` blob NOT NULL,
  KEY `ci_sessions_timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesci_sessions`
--

INSERT INTO `Edama_businessesci_sessions` VALUES ('e78e440939676a353269b29a04eca5c2639bf8ce','161.8.109.180',1731228747,_binary '__ci_last_regenerate|i:1731228746;');

--
-- Table structure for table `Edama_businessesclient_groups`
--

CREATE TABLE `Edama_businessesclient_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesclient_groups`
--


--
-- Table structure for table `Edama_businessesclients`
--

CREATE TABLE `Edama_businessesclients` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_date` date NOT NULL,
  `website` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `currency_symbol` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `starred_by` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `group_ids` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `is_lead` tinyint(1) NOT NULL DEFAULT '0',
  `lead_status_id` int(11) NOT NULL,
  `owner_id` int(11) NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `lead_source_id` int(11) NOT NULL,
  `last_lead_status` text COLLATE utf8_unicode_ci NOT NULL,
  `client_migration_date` date NOT NULL,
  `vat_number` text COLLATE utf8_unicode_ci,
  `currency` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `disable_online_payment` tinyint(1) NOT NULL DEFAULT '0',
  `geo_location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `advance_account_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesclients`
--


--
-- Table structure for table `Edama_businessescontacts`
--

CREATE TABLE `Edama_businessescontacts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alternative_phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `job_title` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `created_date` date NOT NULL,
  `created_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessescontacts`
--


--
-- Table structure for table `Edama_businessescustom_field_values`
--

CREATE TABLE `Edama_businessescustom_field_values` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `related_to_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `related_to_id` int(11) NOT NULL,
  `custom_field_id` int(11) NOT NULL,
  `value` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessescustom_field_values`
--


--
-- Table structure for table `Edama_businessescustom_fields`
--

CREATE TABLE `Edama_businessescustom_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `placeholder` text COLLATE utf8_unicode_ci NOT NULL,
  `example_variable_name` text COLLATE utf8_unicode_ci,
  `options` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `field_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `related_to` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `required` tinyint(1) NOT NULL DEFAULT '0',
  `show_in_table` tinyint(1) NOT NULL DEFAULT '0',
  `show_in_invoice` tinyint(1) NOT NULL DEFAULT '0',
  `show_in_estimate` tinyint(1) NOT NULL DEFAULT '0',
  `visible_to_admins_only` tinyint(1) NOT NULL DEFAULT '0',
  `hide_from_clients` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessescustom_fields`
--


--
-- Table structure for table `Edama_businessescustom_widgets`
--

CREATE TABLE `Edama_businessescustom_widgets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci,
  `content` text COLLATE utf8_unicode_ci,
  `show_title` tinyint(1) NOT NULL DEFAULT '0',
  `show_border` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessescustom_widgets`
--


--
-- Table structure for table `Edama_businessesdashboards`
--

CREATE TABLE `Edama_businessesdashboards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci,
  `data` text COLLATE utf8_unicode_ci,
  `color` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesdashboards`
--


--
-- Table structure for table `Edama_businessesdelivery_note_items`
--

CREATE TABLE `Edama_businessesdelivery_note_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) DEFAULT '0',
  `invoice_item_id` int(11) DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `delivery_note_id` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesdelivery_note_items`
--


--
-- Table structure for table `Edama_businessesdelivery_notes`
--

CREATE TABLE `Edama_businessesdelivery_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `project_id` int(11) NOT NULL DEFAULT '0',
  `delivery_note_date` date NOT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `status` enum('draft','approved','request_approval') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesdelivery_notes`
--


--
-- Table structure for table `Edama_businessesdepartments`
--

CREATE TABLE `Edama_businessesdepartments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesdepartments`
--


--
-- Table structure for table `Edama_businessesemail_templates`
--

CREATE TABLE `Edama_businessesemail_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `template_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `email_subject` text COLLATE utf8_unicode_ci NOT NULL,
  `default_message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `custom_message` mediumtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesemail_templates`
--


--
-- Table structure for table `Edama_businessesenteries`
--

CREATE TABLE `Edama_businessesenteries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `trans_id` int(11) NOT NULL,
  `account` int(11) NOT NULL,
  `type` enum('dr','cr') NOT NULL,
  `amount` double NOT NULL,
  `narration` text NOT NULL,
  `branch_id` int(11) DEFAULT '0',
  `concerned_person` int(11) DEFAULT '0',
  `unit` text,
  `reference` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=179 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Edama_businessesenteries`
--


--
-- Table structure for table `Edama_businessesestimate_forms`
--

CREATE TABLE `Edama_businessesestimate_forms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `public` tinyint(1) NOT NULL DEFAULT '0',
  `enable_attachment` tinyint(4) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesestimate_forms`
--


--
-- Table structure for table `Edama_businessesestimate_items`
--

CREATE TABLE `Edama_businessesestimate_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesestimate_items`
--

INSERT INTO `Edama_businessesestimate_items` VALUES (1,2,'Product 2','asdasd',10,'pc',150,1500,2,1,0,0),(2,3,'product 3','',20,'pc',75,1500,2,1,0,0),(3,3,'product 3','',10,'pc',75,750,3,1,0,0),(4,3,'product 3','',20,'pc',75,1500,4,1,0,0),(5,2,'Product 2','asdasd',10,'pc',150,1500,4,0,0,0),(6,2,'Product 2','asdasd',20,'pc',150,3000,5,1,0,0),(7,3,'product 3','',20,'pc',75,1500,5,1,0,0),(8,3,'product 3','',10,'pc',75,750,6,1,0,0),(9,3,'product 3','',10,'pc',75,750,7,1,0,0),(10,3,'product 3','',2,'pc',75,150,8,0,0,0),(11,3,'product 3','',5,'pc',75,375,8,0,0,0),(12,2,'Product 2','asdasd',2,'pc',150,300,9,1,0,0),(13,3,'product 3','asdasd',5,'pc',150,750,9,0,0,0),(14,2,'Product 2','asdasd',3,'pc',150,450,10,1,0,0),(15,3,'product 3','',4,'pc',75,300,10,0,0,0),(16,2,'Product 2','asdasd',10,'pc',150,1500,11,0,0,0),(17,3,'product 3','',6,'pc',75,450,11,0,0,0),(18,2,'Product 2','asdasd',10,'pc',150,1500,12,0,0,0),(19,3,'product 3','',6,'pc',75,450,12,0,0,0),(20,1,'Product 1cdsfds','Product 1',1,'pc',250,250,13,0,0,0),(21,4,'product not raw','desc',6,'kg',11,66,13,0,0,0),(22,5,'product raw','desc',1,'meter ',120,120,13,0,0,0),(23,4,'product not raw','desc',45645,'pc',75,3423375,13,1,0,0),(24,7,'paper cup 1','',210,'pack',250,52500,14,0,0,0),(25,4,'product not raw','asdasd',999,'pc',150,149850,15,0,0,0),(26,14,'P33','dfsf',2,'PC',15,30,16,0,0,0),(27,8,'Test SALEABLE item','Test',10,'PC',20,200,17,0,0,0),(28,20,'Test P11222','',10,'pc',50,500,18,0,0,0);

--
-- Table structure for table `Edama_businessesestimate_requests`
--

CREATE TABLE `Edama_businessesestimate_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `estimate_form_id` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `client_id` int(11) NOT NULL,
  `lead_id` int(11) NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `status` enum('new','processing','hold','canceled','estimated') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'new',
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesestimate_requests`
--


--
-- Table structure for table `Edama_businessesestimates`
--

CREATE TABLE `Edama_businessesestimates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `estimate_request_id` int(11) NOT NULL DEFAULT '0',
  `estimate_date` date NOT NULL,
  `valid_until` date NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','sent','accepted','declined','approved','request_approval') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci NOT NULL,
  `discount_amount` double NOT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesestimates`
--

INSERT INTO `Edama_businessesestimates` VALUES (1,1,0,'2022-12-22','2022-12-24','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(2,2,0,'2022-12-27','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(3,2,0,'2022-12-28','2022-12-31','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(4,2,0,'2022-12-27','2022-12-31','',NULL,'approved',0,0,'before_tax',0,'percentage',0,0),(5,2,0,'2022-12-27','2022-12-28','',NULL,'approved',0,0,'before_tax',0,'percentage',0,0),(6,2,0,'2022-12-27','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(7,2,0,'2023-01-04','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(8,2,0,'2022-12-29','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(9,2,0,'2022-12-28','2022-12-28','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(10,2,0,'2023-01-03','2023-01-10','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(11,1,0,'2023-01-03','2023-01-19','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(12,2,0,'2023-01-11','2023-01-27','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(13,1,0,'2023-01-04','2023-01-11','jgghj',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(14,2,0,'2023-01-04','2023-01-11','',NULL,'draft',0,0,'before_tax',0,'percentage',0,0),(15,1,0,'2023-01-04','2023-01-05','kkkk',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(16,1,0,'2023-01-20','2023-01-19','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(17,2,0,'2023-01-20','2023-01-21','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(18,2,0,'2023-01-19','2023-01-20','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0);

--
-- Table structure for table `Edama_businessesevents`
--

CREATE TABLE `Edama_businessesevents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `location` mediumtext COLLATE utf8_unicode_ci,
  `files` mediumtext COLLATE utf8_unicode_ci,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci NOT NULL,
  `share_with` mediumtext COLLATE utf8_unicode_ci,
  `editable_google_event` tinyint(1) NOT NULL DEFAULT '0',
  `google_event_id` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  `color` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `recurring` int(1) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `last_start_date` date DEFAULT NULL,
  `recurring_dates` longtext COLLATE utf8_unicode_ci NOT NULL,
  `confirmed_by` text COLLATE utf8_unicode_ci NOT NULL,
  `rejected_by` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesevents`
--


--
-- Table structure for table `Edama_businessesexpense_categories`
--

CREATE TABLE `Edama_businessesexpense_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_parent` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesexpense_categories`
--


--
-- Table structure for table `Edama_businessesexpense_items`
--

CREATE TABLE `Edama_businessesexpense_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `parent` int(11) NOT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesexpense_items`
--


--
-- Table structure for table `Edama_businessesexpenses`
--

CREATE TABLE `Edama_businessesexpenses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `expense_date` date NOT NULL,
  `category_id` int(11) NOT NULL,
  `item_id` int(11) DEFAULT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `amount` double NOT NULL,
  `payment_mode` enum('bank','cash_on_hand','cheque','reimbursement','pt_cash') COLLATE utf8_unicode_ci NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` int(11) DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `invoice_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `status` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `transaction_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `bank` int(11) NOT NULL DEFAULT '0',
  `treasury` int(11) NOT NULL DEFAULT '0',
  `pt_cash` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesexpenses`
--


--
-- Table structure for table `Edama_businessesexpires`
--

CREATE TABLE `Edama_businessesexpires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item` text COLLATE utf8_unicode_ci,
  `type` text COLLATE utf8_unicode_ci,
  `department_id` int(11) DEFAULT NULL,
  `expiry` date DEFAULT NULL,
  `recurring_charges` int(11) DEFAULT NULL,
  `responsible_id` int(11) DEFAULT NULL,
  `client_id` int(11) DEFAULT NULL,
  `status` enum('alert','ignore') COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesexpires`
--


--
-- Table structure for table `Edama_businessesgeneral_files`
--

CREATE TABLE `Edama_businessesgeneral_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_name` text COLLATE utf8_unicode_ci NOT NULL,
  `file_id` text COLLATE utf8_unicode_ci,
  `service_type` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `file_size` double NOT NULL,
  `created_at` datetime NOT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `eroom_id` int(11) NOT NULL DEFAULT '0',
  `uploaded_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesgeneral_files`
--


--
-- Table structure for table `Edama_businesseshelp_articles`
--

CREATE TABLE `Edama_businesseshelp_articles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `category_id` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `files` text COLLATE utf8_unicode_ci NOT NULL,
  `total_views` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businesseshelp_articles`
--


--
-- Table structure for table `Edama_businesseshelp_categories`
--

CREATE TABLE `Edama_businesseshelp_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `type` enum('help','knowledge_base') COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businesseshelp_categories`
--


--
-- Table structure for table `Edama_businessesinternal_transactions`
--

CREATE TABLE `Edama_businessesinternal_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `from_employee` int(11) NOT NULL,
  `to_employee` int(11) NOT NULL,
  `amount` float(10,3) NOT NULL,
  `note` text COLLATE utf8_bin NOT NULL,
  `status` enum('draft','approved') COLLATE utf8_bin NOT NULL DEFAULT 'draft',
  `transaction_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `bank` int(11) NOT NULL DEFAULT '0',
  `treasury` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Dumping data for table `Edama_businessesinternal_transactions`
--


--
-- Table structure for table `Edama_businessesinvoice_items`
--

CREATE TABLE `Edama_businessesinvoice_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `cost` double DEFAULT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `invoice_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesinvoice_items`
--


--
-- Table structure for table `Edama_businessesinvoice_payments`
--

CREATE TABLE `Edama_businessesinvoice_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `files` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `invoice_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` tinytext COLLATE utf8_unicode_ci,
  `account_transaction_id` int(11) NOT NULL DEFAULT '0',
  `advance_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `bank` int(11) DEFAULT '0',
  `treasury` int(11) DEFAULT '0',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesinvoice_payments`
--


--
-- Table structure for table `Edama_businessesinvoices`
--

CREATE TABLE `Edama_businessesinvoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `bill_date` date NOT NULL,
  `due_date` date NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `files` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `labels` text COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','not_paid','cancelled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `delivery_status` enum('delivered','not_delivered') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_delivered',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `confirm_status` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_confirmed',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `recurring` tinyint(4) NOT NULL DEFAULT '0',
  `recurring_invoice_id` int(11) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `next_recurring_date` date DEFAULT NULL,
  `no_of_cycles_completed` int(11) NOT NULL DEFAULT '0',
  `due_reminder_date` date DEFAULT NULL,
  `recurring_reminder_date` date DEFAULT NULL,
  `discount_amount` double NOT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci NOT NULL,
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci NOT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `sale_item` int(11) NOT NULL DEFAULT '0',
  `sale_account_id` int(11) NOT NULL DEFAULT '0',
  `sale_cost_account_id` int(11) NOT NULL DEFAULT '0',
  `sale_status` enum('Pending','Ready','In Progress','Finished') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Pending',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesinvoices`
--


--
-- Table structure for table `Edama_businessesitem_categories`
--

CREATE TABLE `Edama_businessesitem_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesitem_categories`
--


--
-- Table structure for table `Edama_businessesitem_uom`
--

CREATE TABLE `Edama_businessesitem_uom` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesitem_uom`
--


--
-- Table structure for table `Edama_businessesitems`
--

CREATE TABLE `Edama_businessesitems` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cost` double NOT NULL,
  `rate` double NOT NULL,
  `category_id` int(11) NOT NULL,
  `item_type` enum('product','service') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'product',
  `raw_material` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesitems`
--


--
-- Table structure for table `Edama_businessesitems_levels`
--

CREATE TABLE `Edama_businessesitems_levels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesitems_levels`
--


--
-- Table structure for table `Edama_businessesjob_orders`
--

CREATE TABLE `Edama_businessesjob_orders` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `invoice_item_id` int(8) NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  `quantity` int(8) NOT NULL,
  `scheduled_start_date` date DEFAULT NULL,
  `expected_duration` int(8) DEFAULT NULL,
  `actual_duration` date DEFAULT NULL,
  `worksheet` text,
  `priority` enum('1','2','3','4','5') DEFAULT NULL,
  `stages` text,
  `current_stage` varchar(50) DEFAULT NULL,
  `operation_cost` int(8) DEFAULT NULL,
  `total_cost` int(8) DEFAULT NULL,
  `team_member` int(8) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_by` int(8) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Edama_businessesjob_orders`
--


--
-- Table structure for table `Edama_businessesjoborder_status`
--

CREATE TABLE `Edama_businessesjoborder_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `key_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesjoborder_status`
--

INSERT INTO `Edama_businessesjoborder_status` VALUES (1,'In Progress','in_progress','#F9A52D',0,0),(2,'Waiting For A Step','stepa','#1672B9',1,0),(3,'Ready','ready','#00B393',2,0),(4,'Finished','finished','#aab7b7',3,0);

--
-- Table structure for table `Edama_businesseslead_source`
--

CREATE TABLE `Edama_businesseslead_source` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businesseslead_source`
--


--
-- Table structure for table `Edama_businesseslead_status`
--

CREATE TABLE `Edama_businesseslead_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businesseslead_status`
--


--
-- Table structure for table `Edama_businessesleads`
--

CREATE TABLE `Edama_businessesleads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `first_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `last_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_date` date NOT NULL,
  `website` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesleads`
--


--
-- Table structure for table `Edama_businessesleave_applications`
--

CREATE TABLE `Edama_businessesleave_applications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `leave_type_id` int(11) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `total_hours` decimal(7,2) NOT NULL,
  `total_days` decimal(5,2) NOT NULL,
  `applicant_id` int(11) NOT NULL,
  `reason` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected','canceled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `checked_at` datetime DEFAULT NULL,
  `checked_by` int(11) NOT NULL DEFAULT '0',
  `paid_unpaid` tinyint(1) DEFAULT '1',
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `leave_type_id` (`leave_type_id`),
  KEY `user_id` (`applicant_id`),
  KEY `checked_by` (`checked_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesleave_applications`
--


--
-- Table structure for table `Edama_businessesleave_types`
--

CREATE TABLE `Edama_businessesleave_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `max_allowed` int(11) DEFAULT '1',
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesleave_types`
--


--
-- Table structure for table `Edama_businessesloans`
--

CREATE TABLE `Edama_businessesloans` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `amount` double DEFAULT NULL,
  `date` date DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesloans`
--


--
-- Table structure for table `Edama_businessesmaterial_request`
--

CREATE TABLE `Edama_businessesmaterial_request` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) DEFAULT '0',
  `material_request_date` date NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `status` enum('draft','not_paid') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesmaterial_request`
--


--
-- Table structure for table `Edama_businessesmaterial_request_items`
--

CREATE TABLE `Edama_businessesmaterial_request_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double DEFAULT NULL,
  `total` double DEFAULT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `material_request_id` int(11) DEFAULT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesmaterial_request_items`
--


--
-- Table structure for table `Edama_businessesmaterial_request_payments`
--

CREATE TABLE `Edama_businessesmaterial_request_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `material_request_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `prepayment_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesmaterial_request_payments`
--


--
-- Table structure for table `Edama_businessesmaterials_bill`
--

CREATE TABLE `Edama_businessesmaterials_bill` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `item_id` int(8) NOT NULL,
  `quantity` int(8) NOT NULL,
  `cost` int(8) NOT NULL,
  `current_stock` float DEFAULT NULL,
  `job_id` int(8) NOT NULL,
  `is_used` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Edama_businessesmaterials_bill`
--


--
-- Table structure for table `Edama_businessesmessages`
--

CREATE TABLE `Edama_businessesmessages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Untitled',
  `message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `from_user_id` int(11) NOT NULL,
  `to_user_id` int(11) NOT NULL,
  `status` enum('unread','read') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unread',
  `message_id` int(11) NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `files` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted_by_users` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `message_from` (`from_user_id`),
  KEY `message_to` (`to_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesmessages`
--


--
-- Table structure for table `Edama_businessesmilestones`
--

CREATE TABLE `Edama_businessesmilestones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL,
  `due_date` date NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesmilestones`
--


--
-- Table structure for table `Edama_businessesnationality`
--

CREATE TABLE `Edama_businessesnationality` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessesnationality`
--


--
-- Table structure for table `Edama_businessesnotes`
--

CREATE TABLE `Edama_businessesnotes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci,
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `is_public` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesnotes`
--


--
-- Table structure for table `Edama_businessesnotification_settings`
--

CREATE TABLE `Edama_businessesnotification_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `event` varchar(250) NOT NULL,
  `category` varchar(50) NOT NULL,
  `enable_email` int(1) NOT NULL DEFAULT '0',
  `enable_web` int(1) NOT NULL DEFAULT '0',
  `notify_to_team` text NOT NULL,
  `notify_to_team_members` text NOT NULL,
  `notify_to_terms` text NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `event` (`event`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Edama_businessesnotification_settings`
--

INSERT INTO `Edama_businessesnotification_settings` VALUES (1,'project_created','project',0,1,'1','5','client_primary_contact,client_all_contacts',1,0),(2,'project_deleted','project',0,1,'1','5','project_members,client_primary_contact,client_all_contacts',2,0),(3,'project_task_created','project',0,1,'','5','project_members,task_assignee',3,0),(4,'project_task_updated','project',0,1,'','','task_assignee',4,0),(5,'project_task_assigned','project',0,1,'','','task_assignee',5,0),(7,'project_task_started','project',0,1,'','5','project_members,client_primary_contact,client_all_contacts',7,0),(8,'project_task_finished','project',0,0,'','','',8,0),(9,'project_task_reopened','project',0,0,'','','',9,0),(10,'project_task_deleted','project',0,1,'','','task_assignee',10,0),(11,'project_task_commented','project',0,1,'','','task_assignee',11,0),(12,'project_member_added','project',0,1,'','','project_members',12,0),(13,'project_member_deleted','project',0,1,'','','project_members',13,0),(14,'project_file_added','project',0,1,'','','project_members',14,0),(15,'project_file_deleted','project',0,1,'','','project_members',15,0),(16,'project_file_commented','project',0,1,'','','project_members',16,0),(17,'project_comment_added','project',0,1,'','','project_members',17,0),(18,'project_comment_replied','project',0,1,'','','project_members,comment_creator',18,0),(19,'project_customer_feedback_added','project',0,1,'','','project_members',19,0),(20,'project_customer_feedback_replied','project',0,1,'','','project_members,comment_creator',20,0),(21,'client_signup','client',0,0,'','','',21,0),(22,'invoice_online_payment_received','invoice',0,0,'','','',22,0),(23,'leave_application_submitted','leave',0,0,'','','',23,0),(24,'leave_approved','leave',0,1,'','','leave_applicant',24,0),(25,'leave_assigned','leave',0,1,'','','leave_applicant',25,0),(26,'leave_rejected','leave',0,1,'','','leave_applicant',26,0),(27,'leave_canceled','leave',0,0,'','','',27,0),(28,'ticket_created','ticket',0,1,'','6,7,5,11,12,1','client_all_contacts',28,0),(29,'ticket_commented','ticket',0,1,'','','client_primary_contact,ticket_creator',29,0),(30,'ticket_closed','ticket',0,1,'','','client_primary_contact,ticket_creator',30,0),(31,'ticket_reopened','ticket',0,1,'','','client_primary_contact,ticket_creator',31,0),(32,'estimate_request_received','estimate',0,0,'','','',32,0),(33,'estimate_sent','estimate',0,0,'','','',33,0),(34,'estimate_accepted','estimate',0,0,'','','',34,0),(35,'estimate_rejected','estimate',0,0,'','','',35,0),(36,'new_message_sent','message',0,0,'','','',36,0),(37,'message_reply_sent','message',0,0,'','','',37,0),(38,'invoice_payment_confirmation','invoice',0,0,'','','',22,0),(39,'new_event_added_in_calendar','event',0,0,'','','',39,0),(40,'recurring_invoice_created_vai_cron_job','invoice',0,0,'','','',22,0),(41,'new_announcement_created','announcement',1,1,'','','recipient',41,0),(42,'invoice_due_reminder_before_due_date','invoice',0,0,'','','',22,0),(43,'invoice_overdue_reminder','invoice',0,0,'','','',22,0),(44,'recurring_invoice_creation_reminder','invoice',0,0,'','','',22,0),(45,'project_completed','project',0,0,'','','',2,0),(46,'lead_created','lead',0,0,'','','',21,0),(47,'client_created_from_lead','lead',0,0,'','','',21,0),(48,'project_task_deadline_pre_reminder','project',0,1,'','','task_assignee',20,0),(49,'project_task_reminder_on_the_day_of_deadline','project',0,1,'','','task_assignee',20,0),(50,'project_task_deadline_overdue_reminder','project',0,1,'','','task_assignee',20,0),(51,'recurring_task_created_via_cron_job','project',0,1,'','','project_members,task_assignee',20,0),(52,'calendar_event_modified','event',0,0,'','','',39,0);

--
-- Table structure for table `Edama_businessesnotifications`
--

CREATE TABLE `Edama_businessesnotifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `notify_to` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `read_by` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `event` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `project_comment_id` int(11) NOT NULL,
  `ticket_id` int(11) NOT NULL,
  `ticket_comment_id` int(11) NOT NULL,
  `project_file_id` int(11) NOT NULL,
  `leave_id` int(11) NOT NULL,
  `post_id` int(11) NOT NULL,
  `to_user_id` int(11) NOT NULL,
  `activity_log_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `lead_id` int(11) NOT NULL,
  `invoice_payment_id` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `estimate_request_id` int(11) NOT NULL,
  `actual_message_id` int(11) NOT NULL,
  `parent_message_id` int(11) NOT NULL,
  `event_id` int(11) NOT NULL,
  `announcement_id` int(11) NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesnotifications`
--


--
-- Table structure for table `Edama_businessespayment_methods`
--

CREATE TABLE `Edama_businessespayment_methods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'custom',
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `online_payable` tinyint(1) NOT NULL DEFAULT '0',
  `available_on_invoice` tinyint(1) NOT NULL DEFAULT '0',
  `minimum_payment_amount` double NOT NULL DEFAULT '0',
  `settings` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespayment_methods`
--

INSERT INTO `Edama_businessespayment_methods` VALUES (1,'Cash','custom','',0,0,0,'a:0:{}',0),(4,'Bank transfer / Card','custom','',0,0,0,'a:0:{}',0),(5,'Cheque','custom','',0,0,0,'a:0:{}',0);

--
-- Table structure for table `Edama_businessespaypal_ipn`
--

CREATE TABLE `Edama_businessespaypal_ipn` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transaction_id` tinytext COLLATE utf8_unicode_ci,
  `ipn_hash` longtext COLLATE utf8_unicode_ci NOT NULL,
  `ipn_data` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespaypal_ipn`
--


--
-- Table structure for table `Edama_businessespayroll`
--

CREATE TABLE `Edama_businessespayroll` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `month` date NOT NULL,
  `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` int(11) NOT NULL DEFAULT '0',
  `payment_item_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespayroll`
--


--
-- Table structure for table `Edama_businessespayroll_detail`
--

CREATE TABLE `Edama_businessespayroll_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `salary` float(8,3) NOT NULL,
  `manual_deduction` float(8,3) NOT NULL,
  `manual_deduction_reason` text COLLATE utf8_unicode_ci,
  `manual_bounce` float(8,3) NOT NULL,
  `manual_bonus_reason` text COLLATE utf8_unicode_ci,
  `advance` float(10,3) NOT NULL,
  `loan` float(10,3) NOT NULL,
  `pasi_company` double DEFAULT '0',
  `pasi_employee` double DEFAULT '0',
  `job_s_company` double DEFAULT '0',
  `job_s_employee` double DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespayroll_detail`
--


--
-- Table structure for table `Edama_businessesposts`
--

CREATE TABLE `Edama_businessesposts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `post_id` int(11) NOT NULL,
  `share_with` text COLLATE utf8_unicode_ci,
  `files` longtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesposts`
--


--
-- Table structure for table `Edama_businessesproforma_invoice_items`
--

CREATE TABLE `Edama_businessesproforma_invoice_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `cost` double NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `invoice_id` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `old_id` int(11) DEFAULT '0',
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproforma_invoice_items`
--


--
-- Table structure for table `Edama_businessesproforma_invoice_payments`
--

CREATE TABLE `Edama_businessesproforma_invoice_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `invoice_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved','bounce','deposited','refunded','cancelled','delayed','on_hold') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` tinytext COLLATE utf8_unicode_ci,
  `account_transaction_id` int(11) NOT NULL DEFAULT '0',
  `advance_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `files` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `bank` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproforma_invoice_payments`
--


--
-- Table structure for table `Edama_businessesproforma_invoices`
--

CREATE TABLE `Edama_businessesproforma_invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `quotation_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `bill_date` date NOT NULL,
  `due_date` date NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `labels` text COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','not_paid','cancelled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `delivery_status` enum('delivered','not_delivered') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_delivered',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `recurring` tinyint(4) NOT NULL DEFAULT '0',
  `recurring_invoice_id` int(11) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `next_recurring_date` date DEFAULT NULL,
  `no_of_cycles_completed` int(11) NOT NULL DEFAULT '0',
  `due_reminder_date` date DEFAULT NULL,
  `recurring_reminder_date` date DEFAULT NULL,
  `discount_amount` double NOT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci NOT NULL,
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_by` int(11) NOT NULL,
  `owner` int(11) NOT NULL,
  `revised` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `old_project` int(11) DEFAULT '0',
  `old_invoice_no` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `old_quotation_id` int(11) DEFAULT '0',
  `department` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproforma_invoices`
--


--
-- Table structure for table `Edama_businessesproject_comments`
--

CREATE TABLE `Edama_businessesproject_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `comment_id` int(11) NOT NULL DEFAULT '0',
  `task_id` int(11) NOT NULL DEFAULT '0',
  `file_id` int(11) NOT NULL DEFAULT '0',
  `customer_feedback_id` int(11) NOT NULL DEFAULT '0',
  `files` longtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproject_comments`
--


--
-- Table structure for table `Edama_businessesproject_files`
--

CREATE TABLE `Edama_businessesproject_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_name` text COLLATE utf8_unicode_ci NOT NULL,
  `file_id` text COLLATE utf8_unicode_ci,
  `service_type` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `file_size` double NOT NULL,
  `created_at` datetime NOT NULL,
  `project_id` int(11) NOT NULL,
  `uploaded_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproject_files`
--


--
-- Table structure for table `Edama_businessesproject_members`
--

CREATE TABLE `Edama_businessesproject_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `is_leader` tinyint(1) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproject_members`
--


--
-- Table structure for table `Edama_businessesproject_settings`
--

CREATE TABLE `Edama_businessesproject_settings` (
  `project_id` int(11) NOT NULL,
  `setting_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `setting_value` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  UNIQUE KEY `unique_index` (`project_id`,`setting_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproject_settings`
--


--
-- Table structure for table `Edama_businessesproject_time`
--

CREATE TABLE `Edama_businessesproject_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime DEFAULT NULL,
  `status` enum('open','logged','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'logged',
  `note` text COLLATE utf8_unicode_ci,
  `task_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesproject_time`
--


--
-- Table structure for table `Edama_businessesprojects`
--

CREATE TABLE `Edama_businessesprojects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `start_date` date DEFAULT NULL,
  `deadline` date DEFAULT NULL,
  `client_id` int(11) NOT NULL,
  `created_date` date DEFAULT NULL,
  `created_by` int(11) NOT NULL DEFAULT '0',
  `status` enum('open','completed','hold','canceled','pending','') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending',
  `labels` text COLLATE utf8_unicode_ci,
  `price` double NOT NULL DEFAULT '0',
  `starred_by` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `geo_location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesprojects`
--


--
-- Table structure for table `Edama_businessespurchase_order_items`
--

CREATE TABLE `Edama_businessespurchase_order_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `purchase_order_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespurchase_order_items`
--


--
-- Table structure for table `Edama_businessespurchase_order_payments`
--

CREATE TABLE `Edama_businessespurchase_order_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `files` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `purchase_order_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `prepayment_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `bank` int(11) NOT NULL DEFAULT '0',
  `treasury` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespurchase_order_payments`
--


--
-- Table structure for table `Edama_businessespurchase_orders`
--

CREATE TABLE `Edama_businessespurchase_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) NOT NULL,
  `purchase_order_date` date NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `status` enum('draft','not_paid') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespurchase_orders`
--


--
-- Table structure for table `Edama_businessespurchase_return_items`
--

CREATE TABLE `Edama_businessespurchase_return_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL,
  `po_item_id` int(11) NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `purchase_return_id` int(11) NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespurchase_return_items`
--


--
-- Table structure for table `Edama_businessespurchase_returns`
--

CREATE TABLE `Edama_businessespurchase_returns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(11) NOT NULL,
  `shipment_id` int(11) DEFAULT NULL,
  `supplier_id` int(11) NOT NULL DEFAULT '0',
  `payment_method_id` int(11) DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `date` date NOT NULL,
  `status` enum('draft','approved') COLLATE utf8_unicode_ci DEFAULT 'draft',
  `note` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessespurchase_returns`
--


--
-- Table structure for table `Edama_businessesroles`
--

CREATE TABLE `Edama_businessesroles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `permissions` mediumtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesroles`
--

INSERT INTO `Edama_businessesroles` VALUES (1,'test BOM',NULL,0);

--
-- Table structure for table `Edama_businessessalary_advance`
--

CREATE TABLE `Edama_businessessalary_advance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `amount` float NOT NULL DEFAULT '0',
  `date` date DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessalary_advance`
--


--
-- Table structure for table `Edama_businessessale_return_items`
--

CREATE TABLE `Edama_businessessale_return_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sale_return_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `invoice_item_id` int(11) NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `sort` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessale_return_items`
--


--
-- Table structure for table `Edama_businessessale_returns`
--

CREATE TABLE `Edama_businessessale_returns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `payment_method_id` int(11) DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `date` date NOT NULL,
  `status` enum('draft','approved') COLLATE utf8_unicode_ci DEFAULT 'draft',
  `note` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessale_returns`
--


--
-- Table structure for table `Edama_businessessaleorder_status`
--

CREATE TABLE `Edama_businessessaleorder_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `key_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessaleorder_status`
--

INSERT INTO `Edama_businessessaleorder_status` VALUES (1,'Pending','pending','#F9A52D',0,0),(2,'Ready','ready','#1672B9',1,0),(3,'In Progress','in_progress','#00B393',2,0),(4,'Finished','finished','#aab7b7',3,0);

--
-- Table structure for table `Edama_businessessales_items`
--

CREATE TABLE `Edama_businessessales_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `sale_account_id` int(11) NOT NULL,
  `sale_cost_account_id` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Edama_businessessales_items`
--

INSERT INTO `Edama_businessessales_items` VALUES (1,'Default Sales',70,62,0);

--
-- Table structure for table `Edama_businessessettings`
--

CREATE TABLE `Edama_businessessettings` (
  `setting_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `setting_value` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'app',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  UNIQUE KEY `setting_name` (`setting_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessettings`
--

INSERT INTO `Edama_businessessettings` VALUES ('accepted_file_formats','jpg,jpeg,doc,pdf,csv,pptx,xlsx,docx,png,rar','app',0),('allow_partial_invoice_payment_from_clients','','app',0),('allowed_ip_addresses','','app',0),('app_title','Teamway','app',0),('attendance_password','94269935','app',0),('banks_accounts_parent','25','app',0),('cash_on_hand_accounts_parent','24','app',0),('client_can_add_project_files','1','app',0),('client_can_comment_on_files','1','app',0),('client_can_comment_on_tasks','1','app',0),('client_can_create_projects','1','app',0),('client_can_create_tasks','1','app',0),('client_can_edit_tasks','1','app',0),('client_can_view_activity','1','app',0),('client_can_view_gantt','1','app',0),('client_can_view_milestones','1','app',0),('client_can_view_overview','1','app',0),('client_can_view_project_files','1','app',0),('client_can_view_tasks','1','app',0),('client_default_dashboard','','app',0),('client_message_own_contacts','1','app',0),('client_message_users','5','app',0),('clients_accounts_parent','19','app',0),('clients_parent','','app',0),('company_address','','app',0),('company_email','info@teamway','app',0),('company_name','Teamway','app',0),('company_phone','','app',0),('company_vat_number','','app',0),('company_website','teamway.om','app',0),('cost_of_goods_sold','62','app',0),('currency_position','right','app',0),('currency_symbol',' /OMR','app',0),('date_format','d-m-Y','app',0),('decimal_separator','.','app',0),('default_bank','61','app',0),('default_cash_on_hand','12','app',0),('default_currency','OMR','app',0),('default_due_date_after_billing_date','30','app',0),('default_git','75','app',0),('default_inventory','18','app',0),('default_sales','70','app',0),('disable_client_login','1','app',0),('disable_client_signup','1','app',0),('discount','60','app',0),('email_protocol','','app',0),('email_sent_from_address','info@teamway.om','app',0),('email_sent_from_name','Teamway','app',0),('email_smtp_host','','app',0),('email_smtp_pass','','app',0),('email_smtp_port','','app',0),('email_smtp_security_type','none','app',0),('email_smtp_user','','app',0),('enable_attendance','','app',0),('enable_email_piping','','app',0),('enable_google_calendar_api','','app',0),('enable_push_notification','','app',0),('enable_rich_text_editor','0','app',0),('estimate_color','#054d7f ','app',0),('estimate_logo','','app',0),('expenses_accounts_parent','56','app',0),('financial_year_end','2022-01-01','app',0),('first_day_of_week','0','app',0),('hidden_client_menus','','app',0),('imap_email','info@teamway.om','app',0),('imap_host','','app',0),('imap_password','00000','app',0),('imap_port','','app',0),('imap_ssl_enabled','1','app',0),('initial_number_of_the_estimate','1','app',0),('initial_number_of_the_invoice','8991','app',0),('invoice_color','#054d7f ','app',0),('invoice_footer','<p><br></p>','app',0),('invoice_prefix','AMI/','app',0),('item_purchase_code','53434654','app',0),('language','english','app',0),('leave_salary_expenses','4','app',0),('module_announcement','1','app',0),('module_attendance','','app',0),('module_chat','1','app',0),('module_estimate','1','app',0),('module_estimate_request','','app',0),('module_event','1','app',0),('module_expense','1','app',0),('module_help','','app',0),('module_invoice','1','app',0),('module_knowledge_base','1','app',0),('module_lead','1','app',0),('module_leave','1','app',0),('module_message','1','app',0),('module_note','1','app',0),('module_project_timesheet','','app',0),('module_ticket','','app',0),('module_timeline','1','app',0),('module_todo','1','app',0),('no_of_decimals','2','app',0),('payable_cheques','43','app',0),('payable_EOS_benefits','15','app',0),('payable_job_security','9','app',0),('payable_leave_salaries','15','app',0),('payable_PASI','53','app',0),('payable_salaries','46','app',0),('petty_cash_parent','16','app',0),('project_reference_in_tickets','1','app',0),('pusher_app_id','929038','app',0),('pusher_cluster','eu','app',0),('pusher_key','2cbc86a72bfa9a85b0e5','app',0),('pusher_secret','53077cbb420c5e79c8f6','app',0),('receivable_cheques','21','app',0),('rows_per_page','100','app',0),('salary_advances','66','app',0),('salary_expenses','65','app',0),('scrollbar','native','app',0),('send_bcc_to','info@teamway.om','app',0),('send_estimate_bcc_to','info@teamway.om','app',0),('show_background_image_in_signin_page','yes','app',0),('show_logo_in_signin_page','yes','app',0),('show_recent_ticket_comments_at_the_top','1','app',0),('suppliers_accounts_parent','37','app',0),('ticket_prefix','','app',0),('time_format','24_hours','app',0),('timezone','Asia/Muscat','app',0),('treasury_accounts_parent','12','app',0),('user_1_allowed_distance','100000','user',0),('user_1_dashboard','','user',0),('user_1_disable_push_notification','0','user',0),('user_1_hidden_topbar_menus','','user',0),('user_1_location','23.620058326708097,58.24233084570313','user',0),('user_1_notification_sound_volume','4','user',0),('user_1_personal_language','english','user',0),('user_10_dashboard','','user',0),('user_10_personal_language','english','user',0),('user_11_dashboard','','user',0),('user_2_dashboard','','user',0),('user_21_dashboard','','user',0),('user_21_personal_language','english','user',0),('user_23_dashboard','','user',0),('user_24_dashboard','','user',0),('user_24_personal_language','arabic','user',0),('user_25_dashboard','','user',0),('user_25_personal_language','english','user',0),('user_3_dashboard','','user',0),('user_39_dashboard','','user',0),('user_39_personal_language','english','user',0),('user_4_dashboard','','user',0),('user_43_dashboard','','user',0),('user_44_dashboard','','user',0),('user_45_dashboard','','user',0),('user_46_dashboard','','user',0),('user_47_dashboard','','user',0),('user_48_dashboard','','user',0),('user_48_personal_language','english','user',0),('user_49_dashboard','','user',0),('user_5_allowed_distance','100000000','user',0),('user_5_dashboard','6','user',0),('user_5_disable_push_notification','1','user',0),('user_5_hidden_topbar_menus','','user',0),('user_5_location','23.673522614041882,57.680654820312505','user',0),('user_5_notification_sound_volume','7','user',0),('user_5_personal_language','english','user',0),('user_53_dashboard','','user',0),('user_54_dashboard','','user',0),('user_54_personal_language','english','user',0),('user_58_dashboard','','user',0),('user_6_dashboard','','user',0),('user_6_personal_language','english','user',0),('user_64_dashboard','','user',0),('user_65_dashboard','','user',0),('user_66_dashboard','','user',0),('user_69_dashboard','','user',0),('user_70_dashboard','','user',0),('user_72_dashboard','','user',0),('VAT_expense','21','app',0),('VAT_in','35','app',0),('VAT_out','27','app',0),('weekend','5,6','app',0);

--
-- Table structure for table `Edama_businessesshipment_items`
--

CREATE TABLE `Edama_businessesshipment_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL,
  `po_item_id` int(11) NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `shipment_id` int(11) NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesshipment_items`
--


--
-- Table structure for table `Edama_businessesshipments`
--

CREATE TABLE `Edama_businessesshipments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(11) NOT NULL,
  `supplier_id` int(11) NOT NULL DEFAULT '0',
  `date` date NOT NULL,
  `invoice_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `invoice_date` date DEFAULT NULL,
  `delivery_note_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `delivery_note_date` date DEFAULT NULL,
  `status` enum('draft','approved') COLLATE utf8_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesshipments`
--


--
-- Table structure for table `Edama_businessessocial_links`
--

CREATE TABLE `Edama_businessessocial_links` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `facebook` text COLLATE utf8_unicode_ci,
  `twitter` text COLLATE utf8_unicode_ci,
  `linkedin` text COLLATE utf8_unicode_ci,
  `googleplus` text COLLATE utf8_unicode_ci,
  `digg` text COLLATE utf8_unicode_ci,
  `youtube` text COLLATE utf8_unicode_ci,
  `pinterest` text COLLATE utf8_unicode_ci,
  `instagram` text COLLATE utf8_unicode_ci,
  `github` text COLLATE utf8_unicode_ci,
  `tumblr` text COLLATE utf8_unicode_ci,
  `vine` text COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessocial_links`
--


--
-- Table structure for table `Edama_businessesstock_adjustments`
--

CREATE TABLE `Edama_businessesstock_adjustments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesstock_adjustments`
--

INSERT INTO `Edama_businessesstock_adjustments` VALUES (1,11,200,'',0),(2,10,100,'',0),(3,13,10,'',0),(4,12,10,'',0),(5,15,1,'',0),(6,16,20,'',0),(7,18,200,'',0),(8,17,10,'',0),(9,19,500,'',0),(10,20,1000,'',0),(11,24,1,'',0),(12,25,20,'',0),(13,27,20,'',0),(14,26,1,'',0),(15,30,5,'',0),(16,31,100,'',0),(17,35,10,'',0),(18,36,30,'',0),(19,39,100,'',0),(20,42,40,'',0),(21,44,40,'',0),(22,46,100,'',0),(23,49,100,'',0),(24,48,100,'',0);

--
-- Table structure for table `Edama_businessessuppliers`
--

CREATE TABLE `Edama_businessessuppliers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `contact_name` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_date` date DEFAULT NULL,
  `website` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alternative_phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `currency_symbol` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `currency` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `vat_number` text COLLATE utf8_unicode_ci,
  `note` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `advance_account_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessessuppliers`
--


--
-- Table structure for table `Edama_businessestask_status`
--

CREATE TABLE `Edama_businessestask_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `key_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessestask_status`
--

INSERT INTO `Edama_businessestask_status` VALUES (1,'To Do','to_do','#F9A52D',0,0),(2,'In progress','in_progress','#1672B9',1,0),(3,'Done','done','#00B393',2,0),(4,'holding','','#aab7b7',3,0);

--
-- Table structure for table `Edama_businessestasks`
--

CREATE TABLE `Edama_businessestasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `milestone_id` int(11) NOT NULL DEFAULT '0',
  `assigned_to` int(11) NOT NULL,
  `deadline` date DEFAULT NULL,
  `labels` text COLLATE utf8_unicode_ci,
  `points` tinyint(4) NOT NULL DEFAULT '1',
  `status` enum('to_do','in_progress','done') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'to_do',
  `status_id` int(11) NOT NULL,
  `start_date` date DEFAULT NULL,
  `collaborators` text COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `recurring` tinyint(1) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `recurring_task_id` int(11) NOT NULL DEFAULT '0',
  `no_of_cycles_completed` int(11) NOT NULL DEFAULT '0',
  `created_date` date NOT NULL,
  `next_recurring_date` date DEFAULT NULL,
  `reminder_date` date NOT NULL,
  `ticket_id` int(11) NOT NULL,
  `deleted` tinyint(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessestasks`
--


--
-- Table structure for table `Edama_businessestaxes`
--

CREATE TABLE `Edama_businessestaxes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` tinytext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `percentage` double NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Edama_businessestaxes`
--

INSERT INTO `Edama_businessestaxes` VALUES (1,'VAT (5%)',5,0),(2,'SPD- vat (3%)',3,1),(3,'SPD-Vat ( Nill) new agreement (0%)',0,1);

--
-- Table structure for table `Edama_businessesteam`
--

CREATE TABLE `Edama_businessesteam` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `members` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesteam`
--


--
-- Table structure for table `Edama_businessesteam_member_job_info`
--

CREATE TABLE `Edama_businessesteam_member_job_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `date_of_hire` date DEFAULT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  `salary` double NOT NULL DEFAULT '0',
  `salary_term` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `working_hours` int(11) DEFAULT NULL,
  `yearly_leaves` int(11) DEFAULT NULL,
  `housing` float DEFAULT '0',
  `transportation` float DEFAULT '0',
  `telephone` float DEFAULT '0',
  `utility` float DEFAULT '0',
  `national` tinyint(4) DEFAULT '0',
  `pasi` tinyint(4) DEFAULT '1',
  `bank_title` text COLLATE utf8_unicode_ci,
  `account_title` text COLLATE utf8_unicode_ci,
  `account_no` text COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesteam_member_job_info`
--


--
-- Table structure for table `Edama_businessesticket_comments`
--

CREATE TABLE `Edama_businessesticket_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `ticket_id` int(11) NOT NULL,
  `files` longtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesticket_comments`
--


--
-- Table structure for table `Edama_businessesticket_types`
--

CREATE TABLE `Edama_businessesticket_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesticket_types`
--

INSERT INTO `Edama_businessesticket_types` VALUES (1,'General Support',0),(2,'One way',0),(3,'Two way',0);

--
-- Table structure for table `Edama_businessestickets`
--

CREATE TABLE `Edama_businessestickets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `ticket_type_id` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `status` enum('new','client_replied','open','closed') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'new',
  `last_activity_at` datetime DEFAULT NULL,
  `assigned_to` int(11) NOT NULL DEFAULT '0',
  `creator_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `creator_email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `labels` text COLLATE utf8_unicode_ci,
  `task_id` int(11) NOT NULL,
  `closed_at` datetime NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessestickets`
--


--
-- Table structure for table `Edama_businessesto_do`
--

CREATE TABLE `Edama_businessesto_do` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `labels` text COLLATE utf8_unicode_ci,
  `status` enum('to_do','done') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'to_do',
  `start_date` date DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesto_do`
--


--
-- Table structure for table `Edama_businessestransactions`
--

CREATE TABLE `Edama_businessestransactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `type` text NOT NULL,
  `is_manual` tinyint(1) NOT NULL DEFAULT '0',
  `reference` text,
  `bank_cash` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Edama_businessestransactions`
--


--
-- Table structure for table `Edama_businessesusers`
--

CREATE TABLE `Edama_businessesusers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nationality` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `first_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `last_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `superior_id` int(11) DEFAULT '-1',
  `user_type` enum('staff','client','lead') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'client',
  `is_admin` tinyint(1) NOT NULL DEFAULT '0',
  `role_id` int(11) NOT NULL DEFAULT '0',
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `image` text COLLATE utf8_unicode_ci,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `message_checked_at` datetime DEFAULT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `notification_checked_at` datetime DEFAULT NULL,
  `is_primary_contact` tinyint(1) NOT NULL DEFAULT '0',
  `job_title` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Untitled',
  `disable_login` tinyint(1) NOT NULL DEFAULT '0',
  `note` mediumtext COLLATE utf8_unicode_ci,
  `address` text COLLATE utf8_unicode_ci,
  `alternative_address` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alternative_phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `ssn` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `gender` enum('male','female') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'male',
  `sticky_note` mediumtext COLLATE utf8_unicode_ci,
  `external_links` mediumtext COLLATE utf8_unicode_ci,
  `skype` text COLLATE utf8_unicode_ci,
  `enable_web_notification` tinyint(1) NOT NULL DEFAULT '1',
  `enable_email_notification` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `last_online` datetime DEFAULT NULL,
  `pt_account_id` int(11) NOT NULL DEFAULT '0',
  `sal_account_id` int(11) NOT NULL DEFAULT '0',
  `imb_account_id` int(11) NOT NULL DEFAULT '0',
  `resident_card_no` text COLLATE utf8_unicode_ci,
  `resident_card_expiry` date DEFAULT NULL,
  `passport_no` text COLLATE utf8_unicode_ci,
  `passport_expiry` date DEFAULT NULL,
  `requested_account_removal` tinyint(1) DEFAULT '0',
  `payroll` tinyint(1) DEFAULT '1',
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_type` (`user_type`),
  KEY `email` (`email`),
  KEY `client_id` (`client_id`),
  KEY `deleted` (`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Edama_businessesusers`
--

INSERT INTO `Edama_businessesusers` VALUES (2,'0','Admin','Admin',-1,'staff',1,0,'office@edama-group.com','e10adc3949ba59abbe56e057f20f883e',NULL,'active',NULL,0,NULL,0,'Untitled',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'male',NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,NULL,NULL,NULL,NULL,0,1,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factoryaccounts`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryaccounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `acc_name` varchar(255) NOT NULL,
  `acc_code` varchar(255) DEFAULT NULL,
  `acc_parent` int(11) NOT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT '0',
  `is_inactive` int(11) NOT NULL DEFAULT '0',
  `acc_description` text,
  `module_id` int(11) DEFAULT '0',
  `module` enum('suppliers','team_members','clients','expenses','assets') DEFAULT NULL,
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryaccounts`
--

INSERT INTO `Fajr_Mineral_Water_Factoryaccounts` VALUES (1,'Assets','1',0,1,0,NULL,0,NULL,0),(2,'Non-Current Assets','1-1',1,0,0,NULL,0,NULL,0),(3,'Office Devices, Furniture and Fixtures','1-1-1',2,0,0,NULL,0,NULL,0),(4,'Office Devices, Furniture and Fixtures','1-1-1-1',3,0,0,NULL,0,NULL,0),(5,'Machinery, Tools & Equipments','1-1-2',2,0,0,NULL,0,NULL,0),(6,'Machinery, Tools & Equipments','1-1-2-1',5,0,0,NULL,0,NULL,0),(7,'Motor Vehicles','1-1-3',2,0,0,NULL,0,NULL,0),(8,'Motor Vehicles','1-1-3-1',7,0,0,NULL,0,NULL,0),(9,'Long Term Investments ','1-1-4',2,0,0,NULL,0,NULL,0),(10,'Long Term Investments ','1-1-4-1',9,0,0,NULL,0,NULL,0),(11,'Intangible Assets','1-1-5',2,0,0,NULL,0,NULL,0),(12,'Intangible Assets','1-1-5-1',11,0,0,NULL,0,NULL,0),(13,'Current Assets','1-2',1,0,0,NULL,0,NULL,0),(14,'Employees Payments','1-2-1',13,0,0,NULL,0,NULL,0),(15,'Employees loans','1-2-1-1',14,0,0,NULL,0,NULL,0),(16,'Employees petty cash','1-2-1-2',14,0,0,NULL,0,NULL,0),(17,'Inventories','1-2-2',13,0,0,NULL,0,NULL,0),(18,'Default Inventory','1-2-2-1',17,0,0,NULL,0,NULL,0),(19,'Account Receivable - Customers','1-2-3',13,0,0,NULL,0,NULL,0),(20,'Account Receivable - Cheques On Hand','1-2-4',13,0,0,NULL,0,NULL,0),(21,'PDC Receivable','1-2-4-1',20,0,0,NULL,0,NULL,0),(22,'RD Receivable Cheques','1-2-4-2',20,0,0,NULL,0,NULL,0),(23,'Legal Cheques','1-2-4-3',20,0,0,NULL,0,NULL,0),(24,'Cash-On-Hand(Safes)','1-2-5',13,0,0,NULL,0,NULL,0),(25,'Bank Accounts','1-2-6',13,0,0,NULL,0,NULL,0),(26,'Deferred Taxes','1-2-7',13,0,0,NULL,0,NULL,0),(27,'VAT-In','1-2-7-1',26,0,0,NULL,0,NULL,0),(28,'Liabilities','2',0,1,0,NULL,0,NULL,0),(29,'Non-Current Liability','2-1',28,0,0,NULL,0,NULL,0),(30,'Mortgage Loan Payable','2-1-1',29,0,0,NULL,0,NULL,0),(31,'Mortgage Loan Payable','2-1-1-1',30,0,0,NULL,0,NULL,0),(32,'Othor -Longe term - Liabilities','2-1-2',29,0,0,NULL,0,NULL,0),(33,'Othor -Longe term - Liabilities','2-1-2-1',32,0,0,NULL,0,NULL,0),(34,'Deferred Taxes','2-1-3',29,0,0,NULL,0,NULL,0),(35,'VAT-Out','2-1-3-1',34,0,0,NULL,0,NULL,0),(36,'Current Liability','2-2',28,0,0,NULL,0,NULL,0),(37,'Account Payables - Suppliers','2-2-1',36,0,0,NULL,0,NULL,0),(38,'Accumulated Depreciation ','2-2-2',36,0,0,NULL,0,NULL,0),(39,'Accumulated Depreciation ','2-2-2-1',38,0,0,NULL,0,NULL,0),(40,'Service Providers','2-2-3',36,0,0,NULL,0,NULL,0),(41,'Default Service Provider','2-2-3-1',40,0,0,NULL,0,NULL,0),(42,'Account Payable - Cheques','2-2-4',36,0,0,NULL,0,NULL,0),(43,'PDC Payables','2-2-4-1',42,0,0,NULL,0,NULL,0),(44,'RD Payables Cheques','2-2-4-2',43,0,0,NULL,0,NULL,0),(45,'Employees Payments','2-2-5',36,0,0,NULL,0,NULL,0),(46,'Payable Salaries','2-2-5-1',45,0,0,NULL,0,NULL,0),(47,'Equity','3',0,1,0,NULL,0,NULL,0),(48,'Owners Equity','3-1',47,0,0,NULL,0,NULL,0),(49,'SHARE HOLDERS A/C','3-1-1',48,0,0,NULL,0,NULL,0),(50,'SHARE HOLDERS A/C','3-1-1-1',49,0,0,NULL,0,NULL,0),(51,'OWNER CURRENT A/C','3-1-2',48,0,0,NULL,0,NULL,0),(52,'OWNER CURRENT A/C','3-1-2-1',51,0,0,NULL,0,NULL,0),(53,'PROFIT & LOSS A/C','3-1-3',48,0,0,NULL,0,NULL,0),(54,'Retained Profit & Loss','3-1-3-1',53,0,0,NULL,0,NULL,0),(55,'Current Profit & Loss','3-1-3-2',53,0,0,NULL,0,NULL,0),(56,'Expenses','4',0,1,0,NULL,0,NULL,0),(57,'Direct Expenses','4-1',56,0,0,NULL,0,NULL,0),(58,'Sales Returns And Allowances','4-1-1',57,0,0,NULL,0,NULL,0),(59,'Sales Returns','4-1-1-1',58,0,0,NULL,0,NULL,0),(60,'Sales Discount','4-1-1-2',58,0,0,NULL,0,NULL,0),(61,'Cost of Revenue','4-1-2',57,0,0,NULL,0,NULL,0),(62,'Default Cost Of Good Sold','4-1-2-1',61,0,0,NULL,0,NULL,0),(63,'Indirect Expenses','4-2',56,0,0,NULL,0,NULL,0),(64,'Employees & Benefits Expenses','4-2-1',63,0,0,NULL,0,NULL,0),(65,'Salaries','4-2-1-1',64,0,0,NULL,0,NULL,0),(66,'Advance Salaries','4-2-1-2',64,0,0,NULL,0,NULL,0),(67,'Income','5',0,1,0,NULL,0,NULL,0),(68,'Direct Income','5-1',67,0,0,NULL,0,NULL,0),(69,'Sales Revenue','5-1-1',68,0,0,NULL,0,NULL,0),(70,'Default Sales','5-1-1-1',69,0,0,NULL,0,NULL,0),(71,'Indirect Income','5-2',67,0,0,NULL,0,NULL,0),(72,'Other Revenue','5-2-1',71,0,0,NULL,0,NULL,0),(73,'Other Revenue','5-2-1-1',72,0,0,NULL,0,NULL,0),(74,'GIT','1-2-8',13,0,0,NULL,0,NULL,0),(75,'Default Git','1-2-8-1',74,0,0,NULL,0,NULL,0),(76,'Client 1','1-2-3-1',19,0,0,NULL,0,NULL,0),(77,'Test Bank','1-2-6-1',25,0,0,'Test Bank',NULL,NULL,0),(78,'TetraObject','2-2-1-1',37,0,0,NULL,0,NULL,0),(79,'Intelligent Projects','1-2-3-2',19,0,0,NULL,0,NULL,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factoryactivity_logs`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryactivity_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `action` enum('created','updated','deleted') COLLATE utf8_unicode_ci NOT NULL,
  `log_type` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `log_type_title` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `log_type_id` int(11) NOT NULL DEFAULT '0',
  `changes` mediumtext COLLATE utf8_unicode_ci,
  `log_for` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `log_for_id` int(11) NOT NULL DEFAULT '0',
  `log_for2` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `log_for_id2` int(11) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryactivity_logs`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryannouncements`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryannouncements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `created_by` int(11) NOT NULL,
  `share_with` mediumtext COLLATE utf8_unicode_ci,
  `created_at` datetime NOT NULL,
  `files` text COLLATE utf8_unicode_ci NOT NULL,
  `read_by` mediumtext COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryannouncements`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryattendance`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryattendance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `status` enum('incomplete','pending','approved','rejected','deleted') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'incomplete',
  `user_id` int(11) NOT NULL,
  `in_time` datetime NOT NULL,
  `out_time` datetime DEFAULT NULL,
  `checked_by` int(11) DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `checked_at` datetime DEFAULT NULL,
  `reject_reason` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `checked_by` (`checked_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryattendance`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorybudgeting`
--

CREATE TABLE `Fajr_Mineral_Water_Factorybudgeting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) DEFAULT NULL,
  `estimate_request_id` int(11) NOT NULL DEFAULT '0',
  `estimate_date` date NOT NULL,
  `valid_until` date DEFAULT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','sent','accepted','declined','approved','request_approval') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci DEFAULT NULL,
  `discount_amount` double DEFAULT NULL,
  `profit` double DEFAULT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci DEFAULT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorybudgeting`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorybudgeting_forms`
--

CREATE TABLE `Fajr_Mineral_Water_Factorybudgeting_forms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `public` tinyint(1) NOT NULL DEFAULT '0',
  `enable_attachment` tinyint(4) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorybudgeting_forms`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorybudgeting_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorybudgeting_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `estimate_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `quotation_uom` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `quotation_quantity` double DEFAULT NULL,
  `item_price` double DEFAULT NULL,
  `quotation_selling_rate` double DEFAULT NULL,
  `quotation_total` double DEFAULT NULL,
  `cost_uom` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cost_quantity` double DEFAULT NULL,
  `cost_rate` double DEFAULT NULL,
  `cost_total` double DEFAULT NULL,
  `material_cost` double DEFAULT NULL,
  `labour_cost` double DEFAULT NULL,
  `machinery` double DEFAULT NULL,
  `others` double DEFAULT NULL,
  `profit` double DEFAULT NULL,
  `total` double DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorybudgeting_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorybudgeting_requests`
--

CREATE TABLE `Fajr_Mineral_Water_Factorybudgeting_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `estimate_form_id` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `client_id` int(11) NOT NULL,
  `lead_id` int(11) NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `status` enum('new','processing','hold','canceled','estimated') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'new',
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorybudgeting_requests`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorychecklist_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorychecklist_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `is_checked` int(11) NOT NULL DEFAULT '0',
  `task_id` int(11) NOT NULL DEFAULT '0',
  `sort` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorychecklist_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryci_sessions`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryci_sessions` (
  `id` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `ip_address` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `timestamp` int(10) unsigned NOT NULL DEFAULT '0',
  `data` blob NOT NULL,
  KEY `ci_sessions_timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryci_sessions`
--

INSERT INTO `Fajr_Mineral_Water_Factoryci_sessions` VALUES ('95a73a927137e60cc74d987fa1bab870e7e705bc','161.8.109.180',1727338614,_binary '__ci_last_regenerate|i:1727338432;user_id|s:1:\"2\";');

--
-- Table structure for table `Fajr_Mineral_Water_Factoryclient_groups`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryclient_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryclient_groups`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryclients`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryclients` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_date` date NOT NULL,
  `website` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `currency_symbol` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `starred_by` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `group_ids` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `is_lead` tinyint(1) NOT NULL DEFAULT '0',
  `lead_status_id` int(11) NOT NULL,
  `owner_id` int(11) NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `lead_source_id` int(11) NOT NULL,
  `last_lead_status` text COLLATE utf8_unicode_ci NOT NULL,
  `client_migration_date` date NOT NULL,
  `vat_number` text COLLATE utf8_unicode_ci,
  `currency` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
  `disable_online_payment` tinyint(1) NOT NULL DEFAULT '0',
  `geo_location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `advance_account_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryclients`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorycontacts`
--

CREATE TABLE `Fajr_Mineral_Water_Factorycontacts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `alternative_phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `job_title` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `created_date` date NOT NULL,
  `created_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorycontacts`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorycustom_field_values`
--

CREATE TABLE `Fajr_Mineral_Water_Factorycustom_field_values` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `related_to_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `related_to_id` int(11) NOT NULL,
  `custom_field_id` int(11) NOT NULL,
  `value` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorycustom_field_values`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorycustom_fields`
--

CREATE TABLE `Fajr_Mineral_Water_Factorycustom_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `placeholder` text COLLATE utf8_unicode_ci NOT NULL,
  `example_variable_name` text COLLATE utf8_unicode_ci,
  `options` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `field_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `related_to` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `required` tinyint(1) NOT NULL DEFAULT '0',
  `show_in_table` tinyint(1) NOT NULL DEFAULT '0',
  `show_in_invoice` tinyint(1) NOT NULL DEFAULT '0',
  `show_in_estimate` tinyint(1) NOT NULL DEFAULT '0',
  `visible_to_admins_only` tinyint(1) NOT NULL DEFAULT '0',
  `hide_from_clients` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorycustom_fields`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorycustom_widgets`
--

CREATE TABLE `Fajr_Mineral_Water_Factorycustom_widgets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci,
  `content` text COLLATE utf8_unicode_ci,
  `show_title` tinyint(1) NOT NULL DEFAULT '0',
  `show_border` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorycustom_widgets`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorydashboards`
--

CREATE TABLE `Fajr_Mineral_Water_Factorydashboards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci,
  `data` text COLLATE utf8_unicode_ci,
  `color` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorydashboards`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorydelivery_note_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorydelivery_note_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) DEFAULT '0',
  `invoice_item_id` int(11) DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `delivery_note_id` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorydelivery_note_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorydelivery_notes`
--

CREATE TABLE `Fajr_Mineral_Water_Factorydelivery_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `project_id` int(11) NOT NULL DEFAULT '0',
  `delivery_note_date` date NOT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `status` enum('draft','approved','request_approval') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorydelivery_notes`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorydepartments`
--

CREATE TABLE `Fajr_Mineral_Water_Factorydepartments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorydepartments`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryemail_templates`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryemail_templates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `template_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `email_subject` text COLLATE utf8_unicode_ci NOT NULL,
  `default_message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `custom_message` mediumtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryemail_templates`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryenteries`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryenteries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `trans_id` int(11) NOT NULL,
  `account` int(11) NOT NULL,
  `type` enum('dr','cr') NOT NULL,
  `amount` double NOT NULL,
  `narration` text NOT NULL,
  `branch_id` int(11) DEFAULT '0',
  `concerned_person` int(11) DEFAULT '0',
  `unit` text,
  `reference` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=179 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryenteries`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryestimate_forms`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryestimate_forms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `public` tinyint(1) NOT NULL DEFAULT '0',
  `enable_attachment` tinyint(4) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryestimate_forms`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryestimate_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryestimate_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryestimate_items`
--

INSERT INTO `Fajr_Mineral_Water_Factoryestimate_items` VALUES (1,2,'Product 2','asdasd',10,'pc',150,1500,2,1,0,0),(2,3,'product 3','',20,'pc',75,1500,2,1,0,0),(3,3,'product 3','',10,'pc',75,750,3,1,0,0),(4,3,'product 3','',20,'pc',75,1500,4,1,0,0),(5,2,'Product 2','asdasd',10,'pc',150,1500,4,0,0,0),(6,2,'Product 2','asdasd',20,'pc',150,3000,5,1,0,0),(7,3,'product 3','',20,'pc',75,1500,5,1,0,0),(8,3,'product 3','',10,'pc',75,750,6,1,0,0),(9,3,'product 3','',10,'pc',75,750,7,1,0,0),(10,3,'product 3','',2,'pc',75,150,8,0,0,0),(11,3,'product 3','',5,'pc',75,375,8,0,0,0),(12,2,'Product 2','asdasd',2,'pc',150,300,9,1,0,0),(13,3,'product 3','asdasd',5,'pc',150,750,9,0,0,0),(14,2,'Product 2','asdasd',3,'pc',150,450,10,1,0,0),(15,3,'product 3','',4,'pc',75,300,10,0,0,0),(16,2,'Product 2','asdasd',10,'pc',150,1500,11,0,0,0),(17,3,'product 3','',6,'pc',75,450,11,0,0,0),(18,2,'Product 2','asdasd',10,'pc',150,1500,12,0,0,0),(19,3,'product 3','',6,'pc',75,450,12,0,0,0),(20,1,'Product 1cdsfds','Product 1',1,'pc',250,250,13,0,0,0),(21,4,'product not raw','desc',6,'kg',11,66,13,0,0,0),(22,5,'product raw','desc',1,'meter ',120,120,13,0,0,0),(23,4,'product not raw','desc',45645,'pc',75,3423375,13,1,0,0),(24,7,'paper cup 1','',210,'pack',250,52500,14,0,0,0),(25,4,'product not raw','asdasd',999,'pc',150,149850,15,0,0,0),(26,14,'P33','dfsf',2,'PC',15,30,16,0,0,0),(27,8,'Test SALEABLE item','Test',10,'PC',20,200,17,0,0,0),(28,20,'Test P11222','',10,'pc',50,500,18,0,0,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factoryestimate_requests`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryestimate_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `estimate_form_id` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `client_id` int(11) NOT NULL,
  `lead_id` int(11) NOT NULL,
  `assigned_to` int(11) NOT NULL,
  `status` enum('new','processing','hold','canceled','estimated') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'new',
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryestimate_requests`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryestimates`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryestimates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `estimate_request_id` int(11) NOT NULL DEFAULT '0',
  `estimate_date` date NOT NULL,
  `valid_until` date NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','sent','accepted','declined','approved','request_approval') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci NOT NULL,
  `discount_amount` double NOT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryestimates`
--

INSERT INTO `Fajr_Mineral_Water_Factoryestimates` VALUES (1,1,0,'2022-12-22','2022-12-24','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(2,2,0,'2022-12-27','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(3,2,0,'2022-12-28','2022-12-31','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(4,2,0,'2022-12-27','2022-12-31','',NULL,'approved',0,0,'before_tax',0,'percentage',0,0),(5,2,0,'2022-12-27','2022-12-28','',NULL,'approved',0,0,'before_tax',0,'percentage',0,0),(6,2,0,'2022-12-27','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(7,2,0,'2023-01-04','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(8,2,0,'2022-12-29','2022-12-29','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(9,2,0,'2022-12-28','2022-12-28','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(10,2,0,'2023-01-03','2023-01-10','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(11,1,0,'2023-01-03','2023-01-19','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(12,2,0,'2023-01-11','2023-01-27','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(13,1,0,'2023-01-04','2023-01-11','jgghj',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(14,2,0,'2023-01-04','2023-01-11','',NULL,'draft',0,0,'before_tax',0,'percentage',0,0),(15,1,0,'2023-01-04','2023-01-05','kkkk',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(16,1,0,'2023-01-20','2023-01-19','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(17,2,0,'2023-01-20','2023-01-21','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0),(18,2,0,'2023-01-19','2023-01-20','',NULL,'accepted',0,0,'before_tax',0,'percentage',0,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factoryevents`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryevents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `location` mediumtext COLLATE utf8_unicode_ci,
  `files` mediumtext COLLATE utf8_unicode_ci,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci NOT NULL,
  `share_with` mediumtext COLLATE utf8_unicode_ci,
  `editable_google_event` tinyint(1) NOT NULL DEFAULT '0',
  `google_event_id` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  `color` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `recurring` int(1) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `last_start_date` date DEFAULT NULL,
  `recurring_dates` longtext COLLATE utf8_unicode_ci NOT NULL,
  `confirmed_by` text COLLATE utf8_unicode_ci NOT NULL,
  `rejected_by` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryevents`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryexpense_categories`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryexpense_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_parent` int(11) NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryexpense_categories`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryexpense_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryexpense_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `parent` int(11) NOT NULL,
  `account_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryexpense_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryexpenses`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryexpenses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `expense_date` date NOT NULL,
  `category_id` int(11) NOT NULL,
  `item_id` int(11) DEFAULT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `amount` double NOT NULL,
  `payment_mode` enum('bank','cash_on_hand','cheque','reimbursement','pt_cash') COLLATE utf8_unicode_ci NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` int(11) DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `invoice_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `status` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `transaction_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `bank` int(11) NOT NULL DEFAULT '0',
  `treasury` int(11) NOT NULL DEFAULT '0',
  `pt_cash` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryexpenses`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryexpires`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryexpires` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item` text COLLATE utf8_unicode_ci,
  `type` text COLLATE utf8_unicode_ci,
  `department_id` int(11) DEFAULT NULL,
  `expiry` date DEFAULT NULL,
  `recurring_charges` int(11) DEFAULT NULL,
  `responsible_id` int(11) DEFAULT NULL,
  `client_id` int(11) DEFAULT NULL,
  `status` enum('alert','ignore') COLLATE utf8_unicode_ci NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryexpires`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorygeneral_files`
--

CREATE TABLE `Fajr_Mineral_Water_Factorygeneral_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_name` text COLLATE utf8_unicode_ci NOT NULL,
  `file_id` text COLLATE utf8_unicode_ci,
  `service_type` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `file_size` double NOT NULL,
  `created_at` datetime NOT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `eroom_id` int(11) NOT NULL DEFAULT '0',
  `uploaded_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorygeneral_files`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryhelp_articles`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryhelp_articles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `category_id` int(11) NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `files` text COLLATE utf8_unicode_ci NOT NULL,
  `total_views` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryhelp_articles`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryhelp_categories`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryhelp_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `type` enum('help','knowledge_base') COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryhelp_categories`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryinternal_transactions`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryinternal_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `from_employee` int(11) NOT NULL,
  `to_employee` int(11) NOT NULL,
  `amount` float(10,3) NOT NULL,
  `note` text COLLATE utf8_bin NOT NULL,
  `status` enum('draft','approved') COLLATE utf8_bin NOT NULL DEFAULT 'draft',
  `transaction_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `bank` int(11) NOT NULL DEFAULT '0',
  `treasury` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryinternal_transactions`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryinvoice_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryinvoice_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `cost` double DEFAULT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `invoice_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryinvoice_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryinvoice_payments`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryinvoice_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `files` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `invoice_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` tinytext COLLATE utf8_unicode_ci,
  `account_transaction_id` int(11) NOT NULL DEFAULT '0',
  `advance_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `bank` int(11) DEFAULT '0',
  `treasury` int(11) DEFAULT '0',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryinvoice_payments`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryinvoices`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryinvoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `bill_date` date NOT NULL,
  `due_date` date NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `files` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `labels` text COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','not_paid','cancelled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `delivery_status` enum('delivered','not_delivered') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_delivered',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `confirm_status` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_confirmed',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `recurring` tinyint(4) NOT NULL DEFAULT '0',
  `recurring_invoice_id` int(11) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `next_recurring_date` date DEFAULT NULL,
  `no_of_cycles_completed` int(11) NOT NULL DEFAULT '0',
  `due_reminder_date` date DEFAULT NULL,
  `recurring_reminder_date` date DEFAULT NULL,
  `discount_amount` double NOT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci NOT NULL,
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci NOT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `sale_item` int(11) NOT NULL DEFAULT '0',
  `sale_account_id` int(11) NOT NULL DEFAULT '0',
  `sale_cost_account_id` int(11) NOT NULL DEFAULT '0',
  `sale_status` enum('Pending','Ready','In Progress','Finished') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Pending',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryinvoices`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryitem_categories`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryitem_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryitem_categories`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryitem_uom`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryitem_uom` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryitem_uom`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryitems`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryitems` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cost` double NOT NULL,
  `rate` double NOT NULL,
  `category_id` int(11) NOT NULL,
  `item_type` enum('product','service') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'product',
  `raw_material` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryitems`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryitems_levels`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryitems_levels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryitems_levels`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryjob_orders`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryjob_orders` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `invoice_item_id` int(8) NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  `quantity` int(8) NOT NULL,
  `scheduled_start_date` date DEFAULT NULL,
  `expected_duration` int(8) DEFAULT NULL,
  `actual_duration` date DEFAULT NULL,
  `worksheet` text,
  `priority` enum('1','2','3','4','5') DEFAULT NULL,
  `stages` text,
  `current_stage` varchar(50) DEFAULT NULL,
  `operation_cost` int(8) DEFAULT NULL,
  `total_cost` int(8) DEFAULT NULL,
  `team_member` int(8) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_by` int(8) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryjob_orders`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryjoborder_status`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryjoborder_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `key_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryjoborder_status`
--

INSERT INTO `Fajr_Mineral_Water_Factoryjoborder_status` VALUES (1,'In Progress','in_progress','#F9A52D',0,0),(2,'Waiting For A Step','stepa','#1672B9',1,0),(3,'Ready','ready','#00B393',2,0),(4,'Finished','finished','#aab7b7',3,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factorylead_source`
--

CREATE TABLE `Fajr_Mineral_Water_Factorylead_source` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorylead_source`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorylead_status`
--

CREATE TABLE `Fajr_Mineral_Water_Factorylead_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorylead_status`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryleads`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryleads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `first_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `last_name` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `address` text COLLATE utf8_unicode_ci,
  `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_date` date NOT NULL,
  `website` text COLLATE utf8_unicode_ci,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryleads`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryleave_applications`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryleave_applications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `leave_type_id` int(11) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `total_hours` decimal(7,2) NOT NULL,
  `total_days` decimal(5,2) NOT NULL,
  `applicant_id` int(11) NOT NULL,
  `reason` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected','canceled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `checked_at` datetime DEFAULT NULL,
  `checked_by` int(11) NOT NULL DEFAULT '0',
  `paid_unpaid` tinyint(1) DEFAULT '1',
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `leave_type_id` (`leave_type_id`),
  KEY `user_id` (`applicant_id`),
  KEY `checked_by` (`checked_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryleave_applications`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryleave_types`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryleave_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `color` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `max_allowed` int(11) DEFAULT '1',
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryleave_types`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryloans`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryloans` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `amount` double DEFAULT NULL,
  `date` date DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryloans`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorymaterial_request`
--

CREATE TABLE `Fajr_Mineral_Water_Factorymaterial_request` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) DEFAULT '0',
  `material_request_date` date NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `status` enum('draft','not_paid') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorymaterial_request`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorymaterial_request_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorymaterial_request_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double DEFAULT NULL,
  `total` double DEFAULT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `material_request_id` int(11) DEFAULT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorymaterial_request_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorymaterial_request_payments`
--

CREATE TABLE `Fajr_Mineral_Water_Factorymaterial_request_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `material_request_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `prepayment_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorymaterial_request_payments`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorymaterials_bill`
--

CREATE TABLE `Fajr_Mineral_Water_Factorymaterials_bill` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `item_id` int(8) NOT NULL,
  `quantity` int(8) NOT NULL,
  `cost` int(8) NOT NULL,
  `current_stock` float DEFAULT NULL,
  `job_id` int(8) NOT NULL,
  `is_used` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorymaterials_bill`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorymessages`
--

CREATE TABLE `Fajr_Mineral_Water_Factorymessages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Untitled',
  `message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `from_user_id` int(11) NOT NULL,
  `to_user_id` int(11) NOT NULL,
  `status` enum('unread','read') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unread',
  `message_id` int(11) NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `files` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted_by_users` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `message_from` (`from_user_id`),
  KEY `message_to` (`to_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorymessages`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorymilestones`
--

CREATE TABLE `Fajr_Mineral_Water_Factorymilestones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL,
  `due_date` date NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorymilestones`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorynationality`
--

CREATE TABLE `Fajr_Mineral_Water_Factorynationality` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorynationality`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorynotes`
--

CREATE TABLE `Fajr_Mineral_Water_Factorynotes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci,
  `files` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `is_public` tinyint(1) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorynotes`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorynotification_settings`
--

CREATE TABLE `Fajr_Mineral_Water_Factorynotification_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `event` varchar(250) NOT NULL,
  `category` varchar(50) NOT NULL,
  `enable_email` int(1) NOT NULL DEFAULT '0',
  `enable_web` int(1) NOT NULL DEFAULT '0',
  `notify_to_team` text NOT NULL,
  `notify_to_team_members` text NOT NULL,
  `notify_to_terms` text NOT NULL,
  `sort` int(11) NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `event` (`event`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorynotification_settings`
--

INSERT INTO `Fajr_Mineral_Water_Factorynotification_settings` VALUES (1,'project_created','project',0,1,'1','5','client_primary_contact,client_all_contacts',1,0),(2,'project_deleted','project',0,1,'1','5','project_members,client_primary_contact,client_all_contacts',2,0),(3,'project_task_created','project',0,1,'','5','project_members,task_assignee',3,0),(4,'project_task_updated','project',0,1,'','','task_assignee',4,0),(5,'project_task_assigned','project',0,1,'','','task_assignee',5,0),(7,'project_task_started','project',0,1,'','5','project_members,client_primary_contact,client_all_contacts',7,0),(8,'project_task_finished','project',0,0,'','','',8,0),(9,'project_task_reopened','project',0,0,'','','',9,0),(10,'project_task_deleted','project',0,1,'','','task_assignee',10,0),(11,'project_task_commented','project',0,1,'','','task_assignee',11,0),(12,'project_member_added','project',0,1,'','','project_members',12,0),(13,'project_member_deleted','project',0,1,'','','project_members',13,0),(14,'project_file_added','project',0,1,'','','project_members',14,0),(15,'project_file_deleted','project',0,1,'','','project_members',15,0),(16,'project_file_commented','project',0,1,'','','project_members',16,0),(17,'project_comment_added','project',0,1,'','','project_members',17,0),(18,'project_comment_replied','project',0,1,'','','project_members,comment_creator',18,0),(19,'project_customer_feedback_added','project',0,1,'','','project_members',19,0),(20,'project_customer_feedback_replied','project',0,1,'','','project_members,comment_creator',20,0),(21,'client_signup','client',0,0,'','','',21,0),(22,'invoice_online_payment_received','invoice',0,0,'','','',22,0),(23,'leave_application_submitted','leave',0,0,'','','',23,0),(24,'leave_approved','leave',0,1,'','','leave_applicant',24,0),(25,'leave_assigned','leave',0,1,'','','leave_applicant',25,0),(26,'leave_rejected','leave',0,1,'','','leave_applicant',26,0),(27,'leave_canceled','leave',0,0,'','','',27,0),(28,'ticket_created','ticket',0,1,'','6,7,5,11,12,1','client_all_contacts',28,0),(29,'ticket_commented','ticket',0,1,'','','client_primary_contact,ticket_creator',29,0),(30,'ticket_closed','ticket',0,1,'','','client_primary_contact,ticket_creator',30,0),(31,'ticket_reopened','ticket',0,1,'','','client_primary_contact,ticket_creator',31,0),(32,'estimate_request_received','estimate',0,0,'','','',32,0),(33,'estimate_sent','estimate',0,0,'','','',33,0),(34,'estimate_accepted','estimate',0,0,'','','',34,0),(35,'estimate_rejected','estimate',0,0,'','','',35,0),(36,'new_message_sent','message',0,0,'','','',36,0),(37,'message_reply_sent','message',0,0,'','','',37,0),(38,'invoice_payment_confirmation','invoice',0,0,'','','',22,0),(39,'new_event_added_in_calendar','event',0,0,'','','',39,0),(40,'recurring_invoice_created_vai_cron_job','invoice',0,0,'','','',22,0),(41,'new_announcement_created','announcement',1,1,'','','recipient',41,0),(42,'invoice_due_reminder_before_due_date','invoice',0,0,'','','',22,0),(43,'invoice_overdue_reminder','invoice',0,0,'','','',22,0),(44,'recurring_invoice_creation_reminder','invoice',0,0,'','','',22,0),(45,'project_completed','project',0,0,'','','',2,0),(46,'lead_created','lead',0,0,'','','',21,0),(47,'client_created_from_lead','lead',0,0,'','','',21,0),(48,'project_task_deadline_pre_reminder','project',0,1,'','','task_assignee',20,0),(49,'project_task_reminder_on_the_day_of_deadline','project',0,1,'','','task_assignee',20,0),(50,'project_task_deadline_overdue_reminder','project',0,1,'','','task_assignee',20,0),(51,'recurring_task_created_via_cron_job','project',0,1,'','','project_members,task_assignee',20,0),(52,'calendar_event_modified','event',0,0,'','','',39,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factorynotifications`
--

CREATE TABLE `Fajr_Mineral_Water_Factorynotifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `notify_to` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `read_by` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `event` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `project_comment_id` int(11) NOT NULL,
  `ticket_id` int(11) NOT NULL,
  `ticket_comment_id` int(11) NOT NULL,
  `project_file_id` int(11) NOT NULL,
  `leave_id` int(11) NOT NULL,
  `post_id` int(11) NOT NULL,
  `to_user_id` int(11) NOT NULL,
  `activity_log_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `lead_id` int(11) NOT NULL,
  `invoice_payment_id` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `estimate_request_id` int(11) NOT NULL,
  `actual_message_id` int(11) NOT NULL,
  `parent_message_id` int(11) NOT NULL,
  `event_id` int(11) NOT NULL,
  `announcement_id` int(11) NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorynotifications`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypayment_methods`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypayment_methods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'custom',
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `online_payable` tinyint(1) NOT NULL DEFAULT '0',
  `available_on_invoice` tinyint(1) NOT NULL DEFAULT '0',
  `minimum_payment_amount` double NOT NULL DEFAULT '0',
  `settings` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypayment_methods`
--

INSERT INTO `Fajr_Mineral_Water_Factorypayment_methods` VALUES (1,'Cash','custom','',0,0,0,'a:0:{}',0),(4,'Bank transfer / Card','custom','',0,0,0,'a:0:{}',0),(5,'Cheque','custom','',0,0,0,'a:0:{}',0);

--
-- Table structure for table `Fajr_Mineral_Water_Factorypaypal_ipn`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypaypal_ipn` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transaction_id` tinytext COLLATE utf8_unicode_ci,
  `ipn_hash` longtext COLLATE utf8_unicode_ci NOT NULL,
  `ipn_data` longtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypaypal_ipn`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypayroll`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypayroll` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `month` date NOT NULL,
  `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` int(11) NOT NULL DEFAULT '0',
  `payment_item_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypayroll`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypayroll_detail`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypayroll_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `salary` float(8,3) NOT NULL,
  `manual_deduction` float(8,3) NOT NULL,
  `manual_deduction_reason` text COLLATE utf8_unicode_ci,
  `manual_bounce` float(8,3) NOT NULL,
  `manual_bonus_reason` text COLLATE utf8_unicode_ci,
  `advance` float(10,3) NOT NULL,
  `loan` float(10,3) NOT NULL,
  `pasi_company` double DEFAULT '0',
  `pasi_employee` double DEFAULT '0',
  `job_s_company` double DEFAULT '0',
  `job_s_employee` double DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypayroll_detail`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryposts`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryposts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `post_id` int(11) NOT NULL,
  `share_with` text COLLATE utf8_unicode_ci,
  `files` longtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryposts`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproforma_invoice_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproforma_invoice_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `cost` double NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `invoice_id` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `old_id` int(11) DEFAULT '0',
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproforma_invoice_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproforma_invoice_payments`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproforma_invoice_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `invoice_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved','bounce','deposited','refunded','cancelled','delayed','on_hold') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` tinytext COLLATE utf8_unicode_ci,
  `account_transaction_id` int(11) NOT NULL DEFAULT '0',
  `advance_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `created_at` datetime DEFAULT NULL,
  `files` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `bank` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproforma_invoice_payments`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproforma_invoices`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproforma_invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `quotation_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `bill_date` date NOT NULL,
  `due_date` date NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `labels` text COLLATE utf8_unicode_ci,
  `last_email_sent_date` date DEFAULT NULL,
  `status` enum('draft','not_paid','cancelled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `delivery_status` enum('delivered','not_delivered') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_delivered',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `tax_id` int(11) NOT NULL DEFAULT '0',
  `tax_id2` int(11) NOT NULL DEFAULT '0',
  `recurring` tinyint(4) NOT NULL DEFAULT '0',
  `recurring_invoice_id` int(11) NOT NULL DEFAULT '0',
  `repeat_every` int(11) NOT NULL DEFAULT '0',
  `repeat_type` enum('days','weeks','months','years') COLLATE utf8_unicode_ci DEFAULT NULL,
  `no_of_cycles` int(11) NOT NULL DEFAULT '0',
  `next_recurring_date` date DEFAULT NULL,
  `no_of_cycles_completed` int(11) NOT NULL DEFAULT '0',
  `due_reminder_date` date DEFAULT NULL,
  `recurring_reminder_date` date DEFAULT NULL,
  `discount_amount` double NOT NULL,
  `discount_amount_type` enum('percentage','fixed_amount') COLLATE utf8_unicode_ci NOT NULL,
  `discount_type` enum('before_tax','after_tax') COLLATE utf8_unicode_ci DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `cancelled_by` int(11) NOT NULL,
  `owner` int(11) NOT NULL,
  `revised` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `old_project` int(11) DEFAULT '0',
  `old_invoice_no` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `old_quotation_id` int(11) DEFAULT '0',
  `department` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproforma_invoices`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproject_comments`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproject_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `comment_id` int(11) NOT NULL DEFAULT '0',
  `task_id` int(11) NOT NULL DEFAULT '0',
  `file_id` int(11) NOT NULL DEFAULT '0',
  `customer_feedback_id` int(11) NOT NULL DEFAULT '0',
  `files` longtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproject_comments`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproject_files`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproject_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_name` text COLLATE utf8_unicode_ci NOT NULL,
  `file_id` text COLLATE utf8_unicode_ci,
  `service_type` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `file_size` double NOT NULL,
  `created_at` datetime NOT NULL,
  `project_id` int(11) NOT NULL,
  `uploaded_by` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproject_files`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproject_members`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproject_members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `is_leader` tinyint(1) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproject_members`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproject_settings`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproject_settings` (
  `project_id` int(11) NOT NULL,
  `setting_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `setting_value` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  UNIQUE KEY `unique_index` (`project_id`,`setting_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproject_settings`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryproject_time`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryproject_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime DEFAULT NULL,
  `status` enum('open','logged','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'logged',
  `note` text COLLATE utf8_unicode_ci,
  `task_id` int(11) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryproject_time`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryprojects`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryprojects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` mediumtext COLLATE utf8_unicode_ci,
  `start_date` date DEFAULT NULL,
  `deadline` date DEFAULT NULL,
  `client_id` int(11) NOT NULL,
  `created_date` date DEFAULT NULL,
  `created_by` int(11) NOT NULL DEFAULT '0',
  `status` enum('open','completed','hold','canceled','pending','') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'pending',
  `labels` text COLLATE utf8_unicode_ci,
  `price` double NOT NULL DEFAULT '0',
  `starred_by` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `estimate_id` int(11) NOT NULL,
  `geo_location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryprojects`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypurchase_order_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypurchase_order_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT '0',
  `title` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `quantity` double NOT NULL,
  `unit_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `rate` double NOT NULL,
  `total` double NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  `purchase_order_id` int(11) NOT NULL,
  `tax_id` int(11) DEFAULT '0',
  `tax_id2` int(11) DEFAULT '0',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypurchase_order_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypurchase_order_payments`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypurchase_order_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `files` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `amount` double NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method_id` int(11) NOT NULL,
  `cheque_due_date` date DEFAULT NULL,
  `cheque_description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_account` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_number` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  `cheque_transaction_id` int(11) NOT NULL DEFAULT '0',
  `note` text COLLATE utf8_unicode_ci,
  `purchase_order_id` int(11) NOT NULL,
  `status` enum('draft','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `prepayment_transaction_id` int(11) NOT NULL DEFAULT '0',
  `created_by` int(11) DEFAULT '1',
  `bank` int(11) NOT NULL DEFAULT '0',
  `treasury` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypurchase_order_payments`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypurchase_orders`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypurchase_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) NOT NULL,
  `purchase_order_date` date NOT NULL,
  `project_id` int(11) NOT NULL DEFAULT '0',
  `labels` text COLLATE utf8_unicode_ci NOT NULL,
  `note` mediumtext COLLATE utf8_unicode_ci,
  `status` enum('draft','not_paid') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
  `approval_status` enum('not_approved','request_approval','approved') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'not_approved',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypurchase_orders`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypurchase_return_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypurchase_return_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL,
  `po_item_id` int(11) NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `purchase_return_id` int(11) NOT NULL,
  `sort` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypurchase_return_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorypurchase_returns`
--

CREATE TABLE `Fajr_Mineral_Water_Factorypurchase_returns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(11) NOT NULL,
  `shipment_id` int(11) DEFAULT NULL,
  `supplier_id` int(11) NOT NULL DEFAULT '0',
  `payment_method_id` int(11) DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `date` date NOT NULL,
  `status` enum('draft','approved') COLLATE utf8_unicode_ci DEFAULT 'draft',
  `note` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorypurchase_returns`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factoryroles`
--

CREATE TABLE `Fajr_Mineral_Water_Factoryroles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `permissions` mediumtext COLLATE utf8_unicode_ci,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factoryroles`
--

INSERT INTO `Fajr_Mineral_Water_Factoryroles` VALUES (1,'test BOM',NULL,0);

--
-- Table structure for table `Fajr_Mineral_Water_Factorysalary_advance`
--

CREATE TABLE `Fajr_Mineral_Water_Factorysalary_advance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `amount` float NOT NULL DEFAULT '0',
  `date` date DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorysalary_advance`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorysale_return_items`
--

CREATE TABLE `Fajr_Mineral_Water_Factorysale_return_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sale_return_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `invoice_item_id` int(11) NOT NULL,
  `quantity` double NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `sort` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `Fajr_Mineral_Water_Factorysale_return_items`
--


--
-- Table structure for table `Fajr_Mineral_Water_Factorysale_returns`
--

CREATE TABLE `Fajr_Mineral_Water_Factorysale_returns` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL DEFAULT '0',
  `payment_method_id` int(11) DEFAULT '0',
  `transaction_id` int(11) DEFAULT '0',
  `date` date NOT NULL,
  `status` enum('draft','approved') COLLATE utf8_unicode_ci DEFAULT 'draft',
  `note` text COLLATE utf8_unicode_ci,
  `deleted` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
