--
-- Host: 127.0.0.1    Database: misksoft_user_dd5bf4a5-e014-41d1-8415-5df5b39b8527_db
-- ------------------------------------------------------


--
-- Table structure for table `account_banks`
--

CREATE TABLE `account_banks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bank_id` bigint unsigned NOT NULL,
  `underCollectionCheck_id` bigint unsigned NOT NULL,
  `postPaidCheck_id` bigint unsigned NOT NULL,
  `owner_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `account_banks_bank_id_foreign` (`bank_id`),
  KEY `account_banks_undercollectioncheck_id_foreign` (`underCollectionCheck_id`),
  KEY `account_banks_postpaidcheck_id_foreign` (`postPaidCheck_id`),
  CONSTRAINT `account_banks_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `account_banks_postpaidcheck_id_foreign` FOREIGN KEY (`postPaidCheck_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `account_banks_undercollectioncheck_id_foreign` FOREIGN KEY (`underCollectionCheck_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_banks`
--


--
-- Table structure for table `account_branch`
--

CREATE TABLE `account_branch` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `account_branch_code_id_foreign` (`code_id`),
  KEY `account_branch_branch_id_foreign` (`branch_id`),
  KEY `account_branch_account_id_foreign` (`account_id`),
  CONSTRAINT `account_branch_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `account_branch_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `account_branch_code_id_foreign` FOREIGN KEY (`code_id`) REFERENCES `branch_connection_codes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_branch`
--

INSERT INTO `account_branch` VALUES (1,1,1,98),(2,2,1,103),(3,3,1,120),(4,4,1,123),(5,5,1,100),(6,6,1,105),(7,7,1,135);

--
-- Table structure for table `account_category`
--

CREATE TABLE `account_category` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `category_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `code_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `account_category_category_id_foreign` (`category_id`),
  KEY `account_category_branch_id_foreign` (`branch_id`),
  KEY `account_category_code_id_foreign` (`code_id`),
  KEY `account_category_account_id_foreign` (`account_id`),
  CONSTRAINT `account_category_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `account_category_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `account_category_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
  CONSTRAINT `account_category_code_id_foreign` FOREIGN KEY (`code_id`) REFERENCES `category_connection_codes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_category`
--


--
-- Table structure for table `account_statement_items`
--

CREATE TABLE `account_statement_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `action_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subaction_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `receivable_account_id` bigint unsigned DEFAULT NULL,
  `resource_id` bigint NOT NULL,
  `parent_resource_id` bigint DEFAULT NULL,
  `resource_title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `date` date NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `account_statement_items_cost_center_id_foreign` (`cost_center_id`),
  KEY `account_statement_items_account_id_index` (`account_id`),
  KEY `account_statement_items_receivable_account_id_index` (`receivable_account_id`),
  CONSTRAINT `account_statement_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `account_statement_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `account_statement_items_receivable_account_id_foreign` FOREIGN KEY (`receivable_account_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_statement_items`
--


--
-- Table structure for table `accounts`
--

CREATE TABLE `accounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  `account_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_leaf` tinyint(1) NOT NULL DEFAULT '0',
  `sterile` tinyint(1) NOT NULL DEFAULT '0',
  `level` int NOT NULL DEFAULT '1',
  `initial_balance` double NOT NULL DEFAULT '0',
  `debit_balance` double(13,3) NOT NULL DEFAULT '0.000',
  `credit_balance` double(13,3) NOT NULL DEFAULT '0.000',
  `is_income_account` tinyint(1) NOT NULL DEFAULT '0',
  `is_budget_account` tinyint(1) NOT NULL DEFAULT '0',
  `removable` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `accounts_parent_id_foreign` (`parent_id`),
  KEY `accounts_account_type_foreign` (`account_type`),
  CONSTRAINT `accounts_account_type_foreign` FOREIGN KEY (`account_type`) REFERENCES `accounts_types` (`key`),
  CONSTRAINT `accounts_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=146 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounts`
--

INSERT INTO `accounts` VALUES (1,'01','الموجودات',NULL,'assets',0,0,1,0,0.000,0.000,0,1,0),(2,'0101','الموجودات المتداولة',1,'commonAssets',0,0,2,0,0.000,0.000,0,1,0),(3,'010101','النقدية والبنوك',2,NULL,0,0,3,0,0.000,0.000,0,1,0),(4,'01010101','الصناديق النقدية',3,'boxes',0,0,4,0,0.000,0.000,0,1,0),(5,'0101010101','الصندوق الرئيسي',4,NULL,1,0,5,0,0.000,0.000,0,1,0),(6,'01010102','البنوك',3,'banks',0,0,4,0,0.000,0.000,0,1,0),(7,'0101010201','البنك 1',6,NULL,1,0,5,0,0.000,0.000,0,1,0),(8,'01010103','صناديق الشيكات',3,'checks_boxes',0,0,4,0,0.000,0.000,0,1,0),(9,'0101010301','صندوق الشيكات',8,NULL,1,0,5,0,0.000,0.000,0,1,0),(10,'01010104','محافظ الكترونية',3,'ewallets',0,0,4,0,0.000,0.000,0,1,0),(11,'0101010401','محفظة زين كاش',10,NULL,1,0,5,0,0.000,0.000,0,1,0),(12,'010102','الذمم المدينة',2,'receivableDebtor',0,0,3,0,0.000,0.000,0,1,0),(13,'01010201','ذمم الموظفين',12,NULL,0,0,4,0,0.000,0.000,0,1,0),(14,'0101020101','ذمم الموظفين',13,NULL,1,0,5,0,0.000,0.000,0,1,0),(15,'01010202','الذمم المدينة التجارية',12,NULL,0,0,4,0,0.000,0.000,0,1,0),(16,'0101020201','ذمم العملاء',15,'clientsReceivables',1,0,5,0,0.000,0.000,0,1,0),(17,'01010203','ذمم مدينة أخرى',12,NULL,0,0,4,0,0.000,0.000,0,1,0),(18,'0101020301','ذمم مدينة أخرى',17,NULL,1,0,5,0,0.000,0.000,0,1,0),(19,'01010204','ذمم المستأجرين',12,'tenantsReceivables',1,1,4,0,0.000,0.000,0,1,0),(20,'010103','شيكات برسم التحصيل',2,NULL,0,0,3,0,0.000,0.000,0,1,0),(21,'01010301','شيكات برسم التحصيل',20,'underCollectionChecks',0,0,4,0,0.000,0.000,0,1,0),(22,'0101030101','شيكات برسم التحصيل البنك 1',21,NULL,1,0,5,0,0.000,0.000,0,1,0),(23,'01010302','شيكات معادة تحصيل',20,NULL,0,0,4,0,0.000,0.000,0,1,0),(24,'0101030201','شيكات معادة تحصيل البنك 1',23,NULL,1,0,5,0,0.000,0.000,0,1,0),(25,'010104','أرصدة مدينة أخرى',2,NULL,0,0,3,0,0.000,0.000,0,1,0),(26,'01010401','أمانات مدينة',25,NULL,0,0,4,0,0.000,0.000,0,1,0),(27,'0101040101','أمانات ضريبة الدخل',26,NULL,1,0,5,0,0.000,0.000,0,1,0),(28,'01010402','مصاريف مدفوعة مقدّماً',25,NULL,0,0,4,0,0.000,0.000,0,1,0),(29,'0101040201','مصاريف مدفوعة مقدّماً',28,NULL,1,0,5,0,0.000,0.000,0,1,0),(30,'01010403','تأمينات مستردة',25,NULL,0,0,4,0,0.000,0.000,0,1,0),(31,'0101040301','تأمين الكهرباء',30,NULL,1,0,5,0,0.000,0.000,0,1,0),(32,'010105','البضاعة',2,'inventory',0,0,3,0,0.000,0.000,0,1,0),(33,'01010501','بضاعة أول المدّة',32,'beginningInventory',1,1,4,0,0.000,0.000,0,1,0),(34,'0102','الموجودات غير المتداولة',1,'staticAssets',0,0,2,0,0.000,0.000,0,1,0),(35,'010201','الموجودات غير المتداولة',34,NULL,0,0,3,0,0.000,0.000,0,1,0),(36,'01020101','الأجهزة الكهربائية',35,NULL,0,0,4,0,0.000,0.000,0,1,0),(37,'0102010101','المكيف',36,NULL,1,0,5,0,0.000,0.000,0,1,0),(38,'01020102','أجهزة الكمبيوتر',35,NULL,0,0,4,0,0.000,0.000,0,1,0),(39,'0102010201','جهاز كمبيوتر',38,NULL,1,0,5,0,0.000,0.000,0,1,0),(40,'01020103','المباني',35,NULL,0,0,4,0,0.000,0.000,0,1,0),(41,'0102010301','مبنى الإدارة',40,NULL,1,0,5,0,0.000,0.000,0,1,0),(42,'01020104','الالات والمعدات',35,NULL,0,0,4,0,0.000,0.000,0,1,0),(43,'0102010401','ماكينة التصنيع',42,NULL,1,0,5,0,0.000,0.000,0,1,0),(44,'010202','مجمع استهلاك الموجودات',34,NULL,0,0,3,0,0.000,0.000,0,1,0),(45,'01020201','مجمع استهلاك الأجهزة الكهربائية',44,NULL,0,0,4,0,0.000,0.000,0,1,0),(46,'0102020101','مجمع استهلاك المكيف',45,NULL,1,0,5,0,0.000,0.000,0,1,0),(47,'01020202','مجمع استهلاك أجهزة الكمبيوتر',44,NULL,0,0,4,0,0.000,0.000,0,1,0),(48,'0102020201','مجمع استهلاك جهاز كمبيوتر',47,NULL,1,0,5,0,0.000,0.000,0,1,0),(49,'01020203','مجمع استهلاك المباني',44,NULL,0,0,4,0,0.000,0.000,0,1,0),(50,'0102020301','مجمع استهلاك مبنى الادارة',49,NULL,1,0,5,0,0.000,0.000,0,1,0),(51,'01020204','مجمع استهلاك الالات والمعدات',44,NULL,0,0,4,0,0.000,0.000,0,1,0),(52,'0102020401','مجمع استهلاك ماكينة التصنيع',51,NULL,1,0,5,0,0.000,0.000,0,1,0),(53,'02','المطلوبات',NULL,'liabilities',0,0,1,0,0.000,0.000,0,1,0),(54,'0201','المطلوبات المتداولة',53,'reciprocalLiabilities',0,0,2,0,0.000,0.000,0,1,0),(55,'020101','الذمم الدائنة',54,'receivableCreditor',0,0,3,0,0.000,0.000,0,1,0),(56,'02010101','ذمم دائنة موردون',55,NULL,0,0,4,0,0.000,0.000,0,1,0),(57,'0201010101','ذمم الموردين',56,NULL,1,0,5,0,0.000,0.000,0,1,0),(58,'02010102','ذمم دائنة أخرى',55,NULL,0,0,4,0,0.000,0.000,0,1,0),(59,'0201010201','ذمم دائنة أخرى',58,NULL,1,0,5,0,0.000,0.000,0,1,0),(60,'020102','البنوك الدائنة والقروض',54,NULL,0,0,3,0,0.000,0.000,0,1,0),(61,'02010201','قروض قصيرة الأجل',60,NULL,0,0,4,0,0.000,0.000,0,1,0),(62,'0201020101','قرض البنك 1',61,NULL,1,0,5,0,0.000,0.000,0,1,0),(63,'02010202','البنوك جاري مدين',60,NULL,0,0,4,0,0.000,0.000,0,1,0),(64,'0201020201','جاري مدين البنك 1',63,NULL,1,0,5,0,0.000,0.000,0,1,0),(65,'020103','شيكات آجلة الدفع',54,NULL,0,0,3,0,0.000,0.000,0,1,0),(66,'02010301','شيكات آجلة الدفع',65,'postpaidChecks',0,0,4,0,0.000,0.000,0,1,0),(67,'0201030101','شيكات آجلة الدفع البنك 1',66,NULL,1,0,5,0,0.000,0.000,0,1,0),(68,'02010302','شيكات معادة آجلة الدفع',65,NULL,0,0,4,0,0.000,0.000,0,1,0),(69,'0201030201','شيكات معادة آجلة الدفع البنك 1',68,NULL,1,0,5,0,0.000,0.000,0,1,0),(70,'020104','ارصدة دائنة أخرى',54,NULL,0,0,3,0,0.000,0.000,0,1,0),(71,'02010401','أمانات ضريبة المبيعات',70,'salesTaxDeposits',0,0,4,0,0.000,0.000,0,1,0),(72,'0201040101','أمانات ضريبة المبيعات',71,NULL,1,0,5,0,0.000,0.000,0,1,0),(73,'02010402','مصاريف مستحقة الدفع',70,NULL,0,0,4,0,0.000,0.000,0,1,0),(74,'0201040201','مصاريف مستحقة الدفع',73,NULL,1,0,5,0,0.000,0.000,0,1,0),(75,'02010403','إيرادات مقبوضة مقدّماً',70,'unearned_revenues',0,0,4,0,0.000,0.000,0,1,0),(76,'0201040301','إيرادات مقبوضة مقدّماً',75,NULL,1,0,5,0,0.000,0.000,0,1,0),(77,'0202','المطلوبات غير المتداولة',53,NULL,0,0,2,0,0.000,0.000,0,1,0),(78,'020201','قروض طويلة الأجل',77,NULL,0,0,3,0,0.000,0.000,0,1,0),(79,'02020101','قرض البنوك',78,NULL,0,0,4,0,0.000,0.000,0,1,0),(80,'0202010101','قرض تمويل مشتريات 1',79,NULL,1,0,5,0,0.000,0.000,0,1,0),(81,'03','رأس المال وحقوق الملكية',NULL,NULL,0,0,1,0,0.000,0.000,0,1,0),(82,'0301','رأس المال',81,'capital',0,0,2,0,0.000,0.000,0,1,0),(83,'030101','رأس المال',82,NULL,0,0,3,0,0.000,0.000,0,1,0),(84,'03010101','رأس مال الشركاء',83,'PartnersRights',0,0,4,0,0.000,0.000,0,1,0),(85,'0301010101','رأس مال الشريك 1',84,NULL,1,0,5,0,0.000,0.000,0,1,0),(86,'0302','الأرباح والخسائر المدورة',81,'profitAndLossCalculate',0,0,2,0,0.000,0.000,0,1,0),(87,'030201','الأرباح والخسائر المدورة',86,NULL,0,0,3,0,0.000,0.000,0,1,0),(88,'03020101','الأرباح والخسائر المدورة',87,NULL,0,0,4,0,0.000,0.000,0,1,0),(89,'0302010101','الأرباح والخسائر المدورة',88,NULL,1,0,5,0,0.000,0.000,0,1,0),(90,'0303','الاحتياطات',81,NULL,0,0,2,0,0.000,0.000,0,1,0),(91,'030301','الاحتياطات',90,NULL,0,0,3,0,0.000,0.000,0,1,0),(92,'03030101','الاحتياطات',91,NULL,0,0,4,0,0.000,0.000,0,1,0),(93,'0303010101','الاحتياطي الاجباري',92,NULL,1,0,5,0,0.000,0.000,0,1,0),(94,'04','المبيعات والإيرادات',NULL,'salesList',0,0,1,0,0.000,0.000,1,0,0),(95,'0401','صافي المبيعات',94,'netSales',0,0,2,0,0.000,0.000,1,0,0),(96,'040101','المبيعات',95,'sales',0,0,3,0,0.000,0.000,1,0,0),(97,'04010101','المبيعات',96,'finalSales',0,0,4,0,0.000,0.000,1,0,0),(98,'0401010101','المبيعات',97,NULL,1,0,5,0,0.000,0.000,1,0,0),(99,'04010102','مبيعات نقاط البيع',96,'finalPosSales',0,0,4,0,0.000,0.000,1,0,0),(100,'0401010201','مبيعات نقاط البيع',99,NULL,1,0,5,0,0.000,0.000,1,0,0),(101,'040102','مردودات المبيعات',95,'returnedSales',0,0,3,0,0.000,0.000,1,0,0),(102,'04010201','مردودات المبيعات',101,'finalReturnedSales',0,0,4,0,0.000,0.000,1,0,0),(103,'0401020101','مردودات المبيعات',102,NULL,1,0,5,0,0.000,0.000,1,0,0),(104,'04010202','مردودات نقاط البيع',101,'finalPosReturnedSales',0,0,4,0,0.000,0.000,1,0,0),(105,'0401020201','مردودات نقاط البيع',104,NULL,1,0,5,0,0.000,0.000,1,0,0),(106,'040103','خصم ممنوح',95,NULL,0,0,3,0,0.000,0.000,1,0,0),(107,'04010301','خصم ممنوح',106,NULL,0,0,4,0,0.000,0.000,1,0,0),(108,'0401030101','خصم ممنوح',107,NULL,1,0,5,0,0.000,0.000,1,0,0),(109,'0402','الإيرادات',94,'revenuesList',0,0,2,0,0.000,0.000,1,0,0),(110,'040201','الإيرادات',109,NULL,0,0,3,0,0.000,0.000,1,0,0),(111,'04020101','الإيرادات',110,'revenues',0,0,4,0,0.000,0.000,1,0,0),(112,'0402010101','إيرادات الإيجارات',111,'rental_revenues',1,0,5,0,0.000,0.000,1,0,0),(113,'0402010102','إيرادات الخدمات',111,'services_revenues',1,0,5,0,0.000,0.000,1,0,1),(114,'0402010103','خصم الإيجارات',111,'rental_discount',1,0,5,0,0.000,0.000,1,0,1),(115,'0402010104','مردودات الخدمات',111,'returned_services',1,0,5,0,0.000,0.000,1,0,1),(116,'05','المشتريات',NULL,'purchasesList',0,0,1,0,0.000,0.000,1,0,0),(117,'0501','صافي المشتريات',116,'netPurchases',0,0,2,0,0.000,0.000,1,0,0),(118,'050101','المشتريات',117,'purchases',0,0,3,0,0.000,0.000,1,0,0),(119,'05010101','المشتريات',118,'finalPurchases',0,0,4,0,0.000,0.000,1,0,0),(120,'0501010101','المشتريات',119,NULL,1,0,5,0,0.000,0.000,1,0,0),(121,'050102','مردودات المشتريات',117,'returnedPurchases',0,0,3,0,0.000,0.000,1,0,0),(122,'05010201','مردودات المشتريات',121,'finalReturnedPurchases',0,0,4,0,0.000,0.000,1,0,0),(123,'0501020101','مردودات المشتريات',122,NULL,1,0,5,0,0.000,0.000,1,0,0),(124,'050103','خصم مسموح به',117,NULL,0,0,3,0,0.000,0.000,1,0,0),(125,'05010301','خصم مسموح به',124,NULL,0,0,4,0,0.000,0.000,1,0,0),(126,'0501030101','خصم مكتسب',125,'discountEarned',1,0,5,0,0.000,0.000,1,0,0),(127,'06','المصاريف',NULL,'outlays',0,0,1,0,0.000,0.000,1,0,0),(128,'0601','المصاريف الإدارية العمومية',127,NULL,0,0,2,0,0.000,0.000,1,0,0),(129,'060101','المصاريف الإدارية العمومية',128,NULL,0,0,3,0,0.000,0.000,1,0,0),(130,'06010101','المصاريف الإدارية العمومية',129,NULL,0,0,4,0,0.000,0.000,1,0,0),(131,'0601010101','مصروف الرواتب والأجور',130,NULL,1,0,5,0,0.000,0.000,1,0,0),(132,'0601010102','مصروف الضمان الاجتماعي',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(133,'0601010103','مصروف الإيجار',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(134,'0601010104','مصروف الكهرباء',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(135,'0601010105','مصروف الإستهلاك',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(136,'0601010106','مصروف المياه',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(137,'0601010107','مصروف الانترنت',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(138,'0601010108','مصروف العمولات والفوائد البنكية',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(139,'0601010109','مصروف الهاتف',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(140,'0601010110','مصروف الضيافة',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(141,'0601010111','مصروف النظافة',130,NULL,1,0,5,0,0.000,0.000,1,0,1),(142,'0602','مصاريف التسويق',127,NULL,0,0,2,0,0.000,0.000,1,0,0),(143,'060201','مصاريف التسويق',142,NULL,0,0,3,0,0.000,0.000,1,0,0),(144,'06020101','مصاريف التسويق',143,NULL,0,0,4,0,0.000,0.000,1,0,0),(145,'0602010101','مصروف التسويق',144,NULL,1,0,5,0,0.000,0.000,1,0,0);

--
-- Table structure for table `actions_log`
--

CREATE TABLE `actions_log` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned NOT NULL,
  `module_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `section_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `function_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resource_id` bigint DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `actions_log_employee_id_foreign` (`employee_id`),
  CONSTRAINT `actions_log_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `actions_log`
--

INSERT INTO `actions_log` VALUES (1,1,'warehouses','categories','add',1,NULL,'2025-11-04 02:06:29','2025-11-04 02:06:29'),(2,1,'warehouses','branches','add',1,NULL,'2025-11-04 02:09:16','2025-11-04 02:09:16'),(3,1,'warehouses','items','add',1,NULL,'2025-11-04 02:13:05','2025-11-04 02:13:05'),(4,1,'posSettings','users','add',1,NULL,'2025-11-04 02:16:34','2025-11-04 02:16:34');

--
-- Table structure for table `aggregation_invoice_items`
--

CREATE TABLE `aggregation_invoice_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `aggregation_invoice_id` bigint unsigned NOT NULL,
  `type` enum('sales','returned') COLLATE utf8mb4_unicode_ci NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` decimal(10,3) NOT NULL,
  `price` decimal(10,3) NOT NULL,
  `discount` decimal(10,3) NOT NULL DEFAULT '0.000',
  `tax_ratio` decimal(10,3) DEFAULT NULL,
  `total` decimal(10,3) NOT NULL,
  `remaining_quantity` decimal(10,3) NOT NULL,
  `source_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `aggregation_invoice_items_aggregation_invoice_id_foreign` (`aggregation_invoice_id`),
  KEY `aggregation_invoice_items_barcode_id_foreign` (`barcode_id`),
  KEY `aggregation_invoice_items_source_type_source_id_index` (`source_type`,`source_id`),
  CONSTRAINT `aggregation_invoice_items_aggregation_invoice_id_foreign` FOREIGN KEY (`aggregation_invoice_id`) REFERENCES `aggregation_invoices` (`id`),
  CONSTRAINT `aggregation_invoice_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `aggregation_invoice_items`
--


--
-- Table structure for table `aggregation_invoice_sales`
--

CREATE TABLE `aggregation_invoice_sales` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `aggregation_invoice_id` bigint unsigned NOT NULL,
  `sales_invoice_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `agg_sales_unique` (`aggregation_invoice_id`,`sales_invoice_id`),
  KEY `agg_sales_by_sale_idx` (`sales_invoice_id`),
  CONSTRAINT `aggregation_invoice_sales_aggregation_invoice_id_foreign` FOREIGN KEY (`aggregation_invoice_id`) REFERENCES `aggregation_invoices` (`id`),
  CONSTRAINT `aggregation_invoice_sales_sales_invoice_id_foreign` FOREIGN KEY (`sales_invoice_id`) REFERENCES `pos_sales_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `aggregation_invoice_sales`
--


--
-- Table structure for table `aggregation_invoices`
--

CREATE TABLE `aggregation_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `box_day_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `price` decimal(10,3) NOT NULL,
  `quantity` decimal(10,3) NOT NULL,
  `discount` decimal(10,3) NOT NULL,
  `tax_amount` decimal(10,3) NOT NULL,
  `total` decimal(10,3) NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `fotara_saved_at` timestamp NULL DEFAULT NULL,
  `related_invoices` json NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `aggregation_invoices_box_day_id_foreign` (`box_day_id`),
  KEY `aggregation_invoices_branch_id_foreign` (`branch_id`),
  CONSTRAINT `aggregation_invoices_box_day_id_foreign` FOREIGN KEY (`box_day_id`) REFERENCES `box_days` (`id`),
  CONSTRAINT `aggregation_invoices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `aggregation_invoices`
--


--
-- Table structure for table `automated_entries`
--

CREATE TABLE `automated_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `amount` double(13,3) NOT NULL,
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `automated_entries_year_id_foreign` (`year_id`),
  KEY `automated_entries_period_id_foreign` (`period_id`),
  CONSTRAINT `automated_entries_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `automated_entries_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `automated_entries`
--


--
-- Table structure for table `automated_entry_items`
--

CREATE TABLE `automated_entry_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `automated_entry_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `receivable_id` bigint unsigned DEFAULT NULL,
  `debit` double DEFAULT NULL,
  `credit` double DEFAULT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `automated_entry_items_automated_entry_id_foreign` (`automated_entry_id`),
  KEY `automated_entry_items_account_id_foreign` (`account_id`),
  KEY `automated_entry_items_receivable_id_foreign` (`receivable_id`),
  KEY `automated_entry_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `automated_entry_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `automated_entry_items_automated_entry_id_foreign` FOREIGN KEY (`automated_entry_id`) REFERENCES `automated_entries` (`id`),
  CONSTRAINT `automated_entry_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `automated_entry_items_receivable_id_foreign` FOREIGN KEY (`receivable_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `automated_entry_items`
--


--
-- Table structure for table `barcode_branch`
--

CREATE TABLE `barcode_branch` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `cost` double NOT NULL DEFAULT '0',
  `available_quantity` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `barcode_branch_branch_id_foreign` (`branch_id`),
  KEY `barcode_branch_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `barcode_branch_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `barcode_branch_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcode_branch`
--


--
-- Table structure for table `barcode_branch_locations`
--

CREATE TABLE `barcode_branch_locations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `barcode_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `hall` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `line` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shelf` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `barcode_branch_locations_barcode_id_foreign` (`barcode_id`),
  KEY `barcode_branch_locations_branch_id_foreign` (`branch_id`),
  CONSTRAINT `barcode_branch_locations_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `barcode_branch_locations_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcode_branch_locations`
--

INSERT INTO `barcode_branch_locations` VALUES (1,1,1,NULL,NULL,NULL);

--
-- Table structure for table `barcode_branch_prices`
--

CREATE TABLE `barcode_branch_prices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `barcode_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `price_type_id` bigint unsigned NOT NULL,
  `price` double DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `barcode_branch_prices_barcode_id_foreign` (`barcode_id`),
  KEY `barcode_branch_prices_branch_id_foreign` (`branch_id`),
  KEY `barcode_branch_prices_price_type_id_foreign` (`price_type_id`),
  CONSTRAINT `barcode_branch_prices_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `barcode_branch_prices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `barcode_branch_prices_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `barcode_price_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcode_branch_prices`
--

INSERT INTO `barcode_branch_prices` VALUES (1,1,1,2,1,0);

--
-- Table structure for table `barcode_menu`
--

CREATE TABLE `barcode_menu` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `menu_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `barcode_menu_menu_id_foreign` (`menu_id`),
  KEY `barcode_menu_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `barcode_menu_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `barcode_menu_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcode_menu`
--


--
-- Table structure for table `barcode_price_types`
--

CREATE TABLE `barcode_price_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcode_price_types`
--

INSERT INTO `barcode_price_types` VALUES (1,'جُملة',0),(2,'مفرّق',1);

--
-- Table structure for table `barcode_section`
--

CREATE TABLE `barcode_section` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `barcode_id` bigint unsigned NOT NULL,
  `section_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `barcode_section_barcode_id_foreign` (`barcode_id`),
  KEY `barcode_section_section_id_foreign` (`section_id`),
  CONSTRAINT `barcode_section_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `barcode_section_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `pos_sections` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcode_section`
--


--
-- Table structure for table `barcodes`
--

CREATE TABLE `barcodes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `item_id` bigint unsigned NOT NULL,
  `ar_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `en_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_id` bigint unsigned NOT NULL,
  `max_quantity` double DEFAULT NULL,
  `min_quantity` double DEFAULT NULL,
  `width` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `size` double DEFAULT NULL,
  `is_pos` tinyint(1) NOT NULL DEFAULT '0',
  `is_under_discount` tinyint(1) NOT NULL DEFAULT '0',
  `purchasable` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `barcodes_number_unique` (`number`),
  KEY `barcodes_item_id_foreign` (`item_id`),
  KEY `barcodes_unit_id_foreign` (`unit_id`),
  CONSTRAINT `barcodes_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `barcodes_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcodes`
--

INSERT INTO `barcodes` VALUES (1,1,'مادة تجريبية','Test Item','00215328169',NULL,1,NULL,NULL,NULL,NULL,NULL,0,0,1,'2025-11-04 02:13:05','2025-11-04 02:13:05');

--
-- Table structure for table `bond_attachments`
--

CREATE TABLE `bond_attachments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bond_id` int NOT NULL,
  `file` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bond_attachments`
--


--
-- Table structure for table `booths`
--

CREATE TABLE `booths` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `floor_id` bigint unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'movable/immutable/temporal',
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `area` double(10,3) NOT NULL,
  `price` double(10,3) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `is_rented` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `booths_floor_id_foreign` (`floor_id`),
  CONSTRAINT `booths_floor_id_foreign` FOREIGN KEY (`floor_id`) REFERENCES `floors` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `booths`
--


--
-- Table structure for table `box_day_entry_items`
--

CREATE TABLE `box_day_entry_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `box_day_id` bigint unsigned NOT NULL,
  `class` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Account' COMMENT 'Account/ReceivableAccount',
  `account_id` bigint NOT NULL,
  `amount` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `box_day_entry_items_box_day_id_foreign` (`box_day_id`),
  CONSTRAINT `box_day_entry_items_box_day_id_foreign` FOREIGN KEY (`box_day_id`) REFERENCES `box_days` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `box_day_entry_items`
--


--
-- Table structure for table `box_days`
--

CREATE TABLE `box_days` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `day_date` date NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `sales_total` double DEFAULT NULL,
  `returned_sales_total` double DEFAULT NULL,
  `is_closed` tinyint(1) NOT NULL DEFAULT '0',
  `closed_at` datetime DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `started_fotara_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `box_days_branch_id_foreign` (`branch_id`),
  CONSTRAINT `box_days_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `box_days`
--


--
-- Table structure for table `boxes`
--

CREATE TABLE `boxes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `box_day_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `cash_device_id` bigint unsigned NOT NULL,
  `custody_value` double(13,4) NOT NULL DEFAULT '0.0000',
  `date` date NOT NULL,
  `sales_total` double(13,4) NOT NULL DEFAULT '0.0000',
  `returned_sales_total` double(13,4) NOT NULL DEFAULT '0.0000',
  `is_closed` tinyint(1) NOT NULL DEFAULT '0',
  `closed_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `boxes_box_day_id_foreign` (`box_day_id`),
  KEY `boxes_branch_id_foreign` (`branch_id`),
  KEY `boxes_user_id_foreign` (`user_id`),
  KEY `boxes_cash_device_id_foreign` (`cash_device_id`),
  CONSTRAINT `boxes_box_day_id_foreign` FOREIGN KEY (`box_day_id`) REFERENCES `box_days` (`id`),
  CONSTRAINT `boxes_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `boxes_cash_device_id_foreign` FOREIGN KEY (`cash_device_id`) REFERENCES `cash_devices` (`id`),
  CONSTRAINT `boxes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `pos_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `boxes`
--


--
-- Table structure for table `branch_connection_codes`
--

CREATE TABLE `branch_connection_codes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branch_connection_codes`
--

INSERT INTO `branch_connection_codes` VALUES (1,'finalSales','المبيعات'),(2,'finalReturnedSales','مردود المبيعات'),(3,'finalPurchases','المشتريات'),(4,'finalReturnedPurchases','مردود المشتريات'),(5,'finalPosSales','مبيعات نقاط البيع'),(6,'finalPosReturnedSales','مردودات نقاط البيع'),(7,'outlays','سحوبات نقاط البيع');

--
-- Table structure for table `branch_item`
--

CREATE TABLE `branch_item` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint unsigned NOT NULL,
  `item_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `branch_item_branch_id_foreign` (`branch_id`),
  KEY `branch_item_item_id_foreign` (`item_id`),
  CONSTRAINT `branch_item_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `branch_item_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branch_item`
--

INSERT INTO `branch_item` VALUES (1,1,1);

--
-- Table structure for table `branch_menu`
--

CREATE TABLE `branch_menu` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint unsigned NOT NULL,
  `menu_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `branch_menu_branch_id_foreign` (`branch_id`),
  KEY `branch_menu_menu_id_foreign` (`menu_id`),
  CONSTRAINT `branch_menu_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `branch_menu_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branch_menu`
--


--
-- Table structure for table `branch_tax`
--

CREATE TABLE `branch_tax` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint unsigned NOT NULL,
  `tax_id` bigint unsigned NOT NULL,
  `purchases_account_id` bigint unsigned NOT NULL,
  `returned_purchases_account_id` bigint unsigned NOT NULL,
  `sales_account_id` bigint unsigned NOT NULL,
  `returned_sales_account_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `branch_tax_branch_id_foreign` (`branch_id`),
  KEY `branch_tax_tax_id_foreign` (`tax_id`),
  KEY `branch_tax_purchases_account_id_foreign` (`purchases_account_id`),
  KEY `branch_tax_returned_purchases_account_id_foreign` (`returned_purchases_account_id`),
  KEY `branch_tax_sales_account_id_foreign` (`sales_account_id`),
  KEY `branch_tax_returned_sales_account_id_foreign` (`returned_sales_account_id`),
  CONSTRAINT `branch_tax_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `branch_tax_purchases_account_id_foreign` FOREIGN KEY (`purchases_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `branch_tax_returned_purchases_account_id_foreign` FOREIGN KEY (`returned_purchases_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `branch_tax_returned_sales_account_id_foreign` FOREIGN KEY (`returned_sales_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `branch_tax_sales_account_id_foreign` FOREIGN KEY (`sales_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `branch_tax_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branch_tax`
--

INSERT INTO `branch_tax` VALUES (1,1,1,72,72,72,72),(2,1,2,72,72,72,72),(3,1,3,72,72,72,72),(4,1,4,72,72,72,72),(5,1,5,72,72,72,72),(6,1,6,72,72,72,72);

--
-- Table structure for table `branch_types`
--

CREATE TABLE `branch_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branch_types`
--


--
-- Table structure for table `branches`
--

CREATE TABLE `branches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `copy_prices_from_branch_id` bigint unsigned DEFAULT NULL,
  `responsible_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type_id` bigint unsigned DEFAULT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fax` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `maximum_purchase_monthly` double DEFAULT NULL,
  `purchases_under_tax` tinyint(1) NOT NULL DEFAULT '0',
  `sales_under_tax` tinyint(1) NOT NULL DEFAULT '0',
  `sales_tax_id` bigint unsigned DEFAULT NULL,
  `is_temp` tinyint(1) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branches_name_unique` (`name`),
  KEY `branches_type_id_foreign` (`type_id`),
  KEY `branches_cost_center_id_foreign` (`cost_center_id`),
  KEY `branches_sales_tax_id_foreign` (`sales_tax_id`),
  CONSTRAINT `branches_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `branches_sales_tax_id_foreign` FOREIGN KEY (`sales_tax_id`) REFERENCES `taxes` (`id`),
  CONSTRAINT `branches_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `branch_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branches`
--

INSERT INTO `branches` VALUES (1,'المستودع الرئيسي',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,1,NULL,0,1,1,'2025-11-04 02:09:16','2025-11-04 02:09:16');

--
-- Table structure for table `building_types`
--

CREATE TABLE `building_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `building_types`
--

INSERT INTO `building_types` VALUES (1,'شقق سكنية'),(2,'مجمع تجاري'),(3,'كومباوند فلل'),(4,'شقق فنادق');

--
-- Table structure for table `buildings`
--

CREATE TABLE `buildings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `building_type_id` bigint unsigned DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `area` double(10,3) NOT NULL,
  `shops_area` double(10,3) NOT NULL,
  `booths_area` double(10,3) NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `earth_place` text COLLATE utf8mb4_unicode_ci,
  `attachments` text COLLATE utf8mb4_unicode_ci,
  `starting_work_permit_date` date DEFAULT NULL,
  `expire_work_permit_date` date DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `buildings_building_type_id_foreign` (`building_type_id`),
  CONSTRAINT `buildings_building_type_id_foreign` FOREIGN KEY (`building_type_id`) REFERENCES `building_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `buildings`
--


--
-- Table structure for table `cart_items`
--

CREATE TABLE `cart_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `representative_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `price` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cart_items_representative_id_foreign` (`representative_id`),
  KEY `cart_items_barcode_id_foreign` (`barcode_id`),
  KEY `cart_items_branch_id_foreign` (`branch_id`),
  CONSTRAINT `cart_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `cart_items_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `cart_items_representative_id_foreign` FOREIGN KEY (`representative_id`) REFERENCES `representatives` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cart_items`
--


--
-- Table structure for table `cash_devices`
--

CREATE TABLE `cash_devices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ar_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `en_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_id` bigint unsigned DEFAULT NULL,
  `custody_on_boxes` double(13,4) NOT NULL DEFAULT '0.0000',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `mac_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `printers` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `drawer_device` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cash_devices_branch_id_foreign` (`branch_id`),
  CONSTRAINT `cash_devices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cash_devices`
--

INSERT INTO `cash_devices` VALUES (1,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(2,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(3,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(4,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(5,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(6,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(7,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(8,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(9,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10'),(10,NULL,NULL,NULL,0.0000,1,NULL,NULL,NULL,'2025-11-04 02:03:10','2025-11-04 02:03:10');

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

CREATE TABLE `categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  `dedicated_space` double DEFAULT NULL,
  `level` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `categories_parent_id_foreign` (`parent_id`),
  CONSTRAINT `categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `categories` VALUES (1,'100','Test',NULL,1000,1);

--
-- Table structure for table `category_connection_codes`
--

CREATE TABLE `category_connection_codes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `category_connection_codes`
--

INSERT INTO `category_connection_codes` VALUES (1,'finalSales','finalSales','المبيعات'),(2,'finalReturnedSales','finalReturnedSales','مردود المبيعات'),(3,'finalPurchases','finalPurchases','المشتريات'),(4,'finalReturnedPurchases','finalReturnedPurchases','مردود المشتريات'),(5,'inventory','inventory','البضاعة'),(6,'inventoryCost','inventory','كلفة البضاغة'),(7,'warehousesExchange','','صرف مستودعي');

--
-- Table structure for table `chart_widget_group_items`
--

CREATE TABLE `chart_widget_group_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `chart_widget_group_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `chart_widget_group_items_chart_widget_group_id_foreign` (`chart_widget_group_id`),
  KEY `chart_widget_group_items_account_id_foreign` (`account_id`),
  CONSTRAINT `chart_widget_group_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `chart_widget_group_items_chart_widget_group_id_foreign` FOREIGN KEY (`chart_widget_group_id`) REFERENCES `chart_widget_groups` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `chart_widget_group_items`
--


--
-- Table structure for table `chart_widget_groups`
--

CREATE TABLE `chart_widget_groups` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `chart_widget_id` bigint unsigned NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `chart_widget_groups_chart_widget_id_foreign` (`chart_widget_id`),
  CONSTRAINT `chart_widget_groups_chart_widget_id_foreign` FOREIGN KEY (`chart_widget_id`) REFERENCES `chart_widgets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `chart_widget_groups`
--


--
-- Table structure for table `chart_widgets`
--

CREATE TABLE `chart_widgets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `width` double NOT NULL DEFAULT '100',
  `is_visible` tinyint(1) NOT NULL DEFAULT '1',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `order` int NOT NULL DEFAULT '1',
  `chart_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `data_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'accounts,rentals',
  `chart_shape` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'line' COMMENT 'line,bar,doughnut,table',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `chart_widgets`
--

INSERT INTO `chart_widgets` VALUES (1,'الإيراد حسب الطابق',50,1,1,1,'revenue_based_on_floors','rentals','bar',NULL,NULL),(2,'المساحات حسب الطابق',50,1,1,2,'areas_based_on_floors','rentals','table',NULL,NULL),(3,'المساحات حسب مساحة المحل',50,1,1,3,'areas_based_on_shops_area','rentals','table',NULL,NULL),(4,'الإيراد حسب المساحة',50,1,1,4,'revenue_based_on_shops_areas','rentals','bar',NULL,NULL);

--
-- Table structure for table `code_functions`
--

CREATE TABLE `code_functions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `section_id` bigint unsigned NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `code_functions_section_id_foreign` (`section_id`),
  CONSTRAINT `code_functions_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `code_sections` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=433 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `code_functions`
--

INSERT INTO `code_functions` VALUES (1,'مشاهدة',1,'show'),(2,'إضافة',1,'add'),(3,'تعديل',1,'edit'),(4,'حذف',1,'delete'),(5,'مشاهدة',2,'show'),(6,'تهيئة الأرصدة الافتتاحية',2,'initialize'),(7,'إضافة',3,'add'),(8,'تعديل',3,'edit'),(9,'حذف',3,'delete'),(10,'تدقيق',4,'audit'),(11,'الغاء التدقيق',4,'unaudit'),(12,'ترحيل',4,'post'),(13,'الغاء الترحيل',4,'unpost'),(14,'مشاهدة',5,'show'),(15,'إضافة',5,'add'),(16,'تعديل',5,'edit'),(17,'حذف',5,'delete'),(18,'ترحيل',5,'post'),(19,'نسخ',5,'clone'),(20,'الغاء ترحيل',5,'unpost'),(21,'تدقيق',5,'audit'),(22,'الغاء تدقيق',5,'unaudit'),(23,'مشاهدة',6,'show'),(24,'إضافة',6,'add'),(25,'تعديل',6,'edit'),(26,'حذف',6,'delete'),(27,'ترحيل',6,'post'),(28,'الغاء ترحيل',6,'unpost'),(29,'تدقيق',6,'audit'),(30,'الغاء تدقيق',6,'unaudit'),(31,'مشاهدة',7,'show'),(32,'إضافة',7,'add'),(33,'تعديل',7,'edit'),(34,'حذف',7,'delete'),(35,'ترحيل',7,'post'),(36,'الغاء ترحيل',7,'unpost'),(37,'تدقيق',7,'audit'),(38,'الغاء تدقيق',7,'unaudit'),(39,'مشاهدة',8,'show'),(40,'إضافة',8,'add'),(41,'تعديل',8,'edit'),(42,'حذف',8,'delete'),(43,'ترحيل',8,'post'),(44,'الغاء ترحيل',8,'unpost'),(45,'تدقيق',8,'audit'),(46,'الغاء تدقيق',8,'unaudit'),(47,'مشاهدة',9,'show'),(48,'إضافة',9,'add'),(49,'تعديل',9,'edit'),(50,'حذف',9,'delete'),(51,'ترحيل',9,'post'),(52,'الغاء الترحيل',9,'unpost'),(53,'تدقيق',9,'audit'),(54,'الغاء تدقيق',9,'unaudit'),(55,'مشاهدة',10,'show'),(56,'إضافة',10,'add'),(57,'تعديل',10,'edit'),(58,'حذف',10,'delete'),(59,'ترحيل',10,'post'),(60,'الغاء ترحيل',10,'unpost'),(61,'تدقيق',10,'audit'),(62,'الغاء تدقيق',10,'unaudit'),(63,'مشاهدة',11,'show'),(64,'إضافة',11,'add'),(65,'تعديل',11,'edit'),(66,'حذف',11,'delete'),(67,'ترحيل',11,'post'),(68,'الغاء ترحيل',11,'unpost'),(69,'تدقيق',11,'audit'),(70,'الغاء تدقيق',11,'unaudit'),(71,'مشاهدة',12,'show'),(72,'ترحيل/إيداع',13,'post'),(73,'الغاء ترحيل',13,'unpost'),(74,'تغيير/تأجيل',13,'change'),(75,'إرجاع/الغاء',13,'return'),(76,'تحويل/تجيير',13,'convert'),(77,'الغاء تحويل/تجيير',13,'unconvert'),(78,'ترحيل/إيداع',14,'post'),(79,'الغاء ترحيل',14,'unpost'),(80,'تغيير/تأجيل',14,'change'),(81,'إرجاع/الغاء',14,'return'),(82,'مشاهدة',15,'show'),(83,'إضافة',15,'add'),(84,'تعديل',15,'edit'),(85,'قائمة الدخل',16,'incomeList'),(86,'أرصدة الحسابات الشهرية',16,'monthlyAccountBalance'),(87,'تحليل المصاريف',16,'outlaysAnalysis'),(88,'أرصدة الحسابات الإجمالية',16,'totalAccountBalance'),(89,'ميزان المراجعة',16,'trialBalance'),(90,'كشف مراكز الكلف',16,'costCentersStatement'),(91,'كشف مراكز الكلف التفصيلي',16,'detailedCostCenterStatement'),(92,'مشاهدة',17,'show'),(93,'إضافة',17,'add'),(94,'تعديل',17,'edit'),(95,'حذف',17,'delete'),(96,'مشاهدة',18,'show'),(97,'إضافة',18,'add'),(98,'تعديل',18,'edit'),(99,'حذف',18,'delete'),(100,'كشف الذمم التفصيلي',19,'detailedStatement'),(101,'كشف أعمار الذمم',19,'receivableAccountAging'),(102,'إضافة',20,'add'),(103,'تعديل',20,'edit'),(104,'حذف',20,'delete'),(105,'إضافة',21,'add'),(106,'تعديل',21,'edit'),(107,'حذف',21,'delete'),(108,'إضافة',22,'add'),(109,'تعديل',22,'edit'),(110,'حذف',22,'delete'),(111,'مشاهدة الحركات للمادة',22,'barcodeOverview'),(112,'إضافة',23,'add'),(113,'تعديل',23,'edit'),(114,'حذف',23,'delete'),(115,'ترحيل',23,'post'),(116,'الغاء ترحيل',23,'unpost'),(117,'إضافة',24,'add'),(118,'تعديل',24,'edit'),(119,'حذف',24,'delete'),(120,'ترحيل',24,'post'),(121,'الغاء ترحيل',24,'unpost'),(122,'إضافة',25,'add'),(123,'تعديل',25,'edit'),(124,'حذف',25,'delete'),(125,'ترحيل',25,'post'),(126,'الغاء ترحيل',25,'unpost'),(127,'إظهار الكلفة',25,'showCost'),(128,'إظهار سعر البيع',25,'showSalesPrice'),(129,'إضافة',26,'add'),(130,'تعديل',26,'edit'),(131,'حذف',26,'delete'),(132,'ترحيل',26,'post'),(133,'تدقيق/تنفيذ',26,'audit'),(134,'إضافة',27,'add'),(135,'تعديل',27,'edit'),(136,'حذف',27,'delete'),(137,'ترحيل',27,'post'),(138,'إضافة',28,'add'),(139,'تعديل',28,'edit'),(140,'حذف',28,'delete'),(141,'تلبية',28,'meet'),(142,'ترحيل',28,'post'),(143,'إضافة',29,'add'),(144,'تعديل',29,'edit'),(145,'حذف',29,'delete'),(146,'ترحيل',29,'post'),(147,'فك الترحيل',29,'unpost'),(148,'إضافة',30,'add'),(149,'تعديل',30,'edit'),(150,'حذف',30,'delete'),(151,'ترحيل',30,'post'),(152,'الغاء الترحيل',30,'unpost'),(153,'إضافة',31,'add'),(154,'تعديل',31,'edit'),(155,'نسخ',31,'copy'),(156,'حذف',31,'delete'),(157,'تغير الحالة',31,'changeStatus'),(158,'إظهار سعر البيع',31,'showSalesPrice'),(159,'إظهار نسبة الربح',31,'showProfitRatio'),(160,'تعديل طريقة دفع النقدي',31,'editCashPaymentWay'),(161,'تعديل اسم العميل ',31,'editClientName'),(162,'إضافة',32,'add'),(163,'تعديل',32,'edit'),(164,'حذف',32,'delete'),(165,'تلبية',32,'meet'),(166,'ترحيل',32,'post'),(167,'تعديل اسم العميل ',32,'editClientName'),(168,'إضافة',33,'add'),(169,'تعديل',33,'edit'),(170,'مشاهدة',33,'show'),(171,'حذف',33,'delete'),(172,'ترحيل',33,'post'),(173,'الغاء الترحيل',33,'unpost'),(174,'تدقيق الفاتورة',33,'audit'),(175,'الغاء تدقيق الفاتورة',33,'unaudit'),(176,'ترحيل فاتورة غير مدققة',33,'postUnauditInvoice'),(177,'ادخال تاريخ في المستقبل',33,'allowFutureDate'),(178,'تعديل الفرع',33,'changeBranch'),(179,'بيع بسعر أقل من الكلفة',33,'saleByLowerPriceOfCost'),(180,'إظهار نسبة الربح',33,'showProfitRatio'),(181,'إظهار الكلفة',33,'showCost'),(182,'إظهار البونص',33,'showBonus'),(183,'إظهار الكلفة الأصلية - السعر القائم',33,'showOriginalPrice'),(184,'إظهار سعر البيع',33,'showSalesPrice'),(185,'تعديل السعر',33,'editPrice'),(186,'تعديل البونص',33,'editBonus'),(187,'تعديل نوع العميل',33,'editClientType'),(188,'تعديل العميل',33,'editClient'),(189,'تعديل طريقة دفع النقدي',33,'editCashPaymentWay'),(190,'إضافة مرفقات',33,'addAttachments'),(191,'عرض المرفقات',33,'showAttachments'),(192,'حذف المرفقات',33,'deleteAttachments'),(193,'تعديل اسم العميل ',33,'editClientName'),(194,'إضافة',34,'add'),(195,'تعديل',34,'edit'),(196,'حذف',34,'delete'),(197,'ترحيل',34,'post'),(198,'الغاء الترحيل',34,'unpost'),(199,'إضافة',37,'add'),(200,'تعديل',37,'edit'),(201,'حذف',37,'delete'),(202,'ترحيل',37,'post'),(203,'الغاء ترحيل',37,'unpost'),(204,'إضافة',38,'add'),(205,'تعديل',38,'edit'),(206,'حذف',38,'delete'),(207,'ترحيل',38,'post'),(208,'الغاء ترحيل',38,'unpost'),(209,'إضافة',39,'add'),(210,'تعديل',39,'edit'),(211,'حذف',39,'delete'),(212,'ترحيل',39,'post'),(213,'الغاء ترحيل',39,'unpost'),(214,'جرد المستودعات',40,'warehouseStocktaking'),(215,'المبيعات والأرباح',40,'salesAndProfit'),(216,'ضريبة المبيعات',40,'salesTax'),(217,'ضريبة المشتريات',40,'purchasesTax'),(218,'كشف تسوية البضاعة',40,'goodsSettlementStatement'),(219,'تفاصيل المواد',40,'detailedItems'),(220,'تقرير المبيعات بالسالب',40,'minusSales'),(221,'تقرير  فواتير المبيعات',40,'generalSalesInvoices'),(222,'تقرير فواتير المشتريات',40,'generalPurchaseInvoices'),(223,'مشاهدة',41,'show'),(224,'إضافة',41,'add'),(225,'تعديل',41,'edit'),(226,'حذف',41,'delete'),(227,'مشاهدة',42,'show'),(228,'إضافة',42,'add'),(229,'تعديل',42,'edit'),(230,'حذف',42,'delete'),(231,'مشاهدة',43,'show'),(232,'إضافة',43,'add'),(233,'تعديل',43,'edit'),(234,'حذف',43,'delete'),(235,'دمج',43,'merge'),(236,'مشاهدة',44,'show'),(237,'إضافة',44,'add'),(238,'تعديل',44,'edit'),(239,'حذف',44,'delete'),(240,'مشاهدة',45,'show'),(241,'إضافة',45,'add'),(242,'تعديل',45,'edit'),(243,'حذف/إهمال',45,'delete'),(244,'استعادة من المهمل',45,'restore'),(245,'فسخ',45,'terminate'),(246,'دمج',45,'merge'),(247,'تجديد',45,'renew'),(248,'ترحيل',45,'post'),(249,'مشاهدة',46,'show'),(250,'تصدير الفواتير',46,'export'),(251,'الغاء التصدير',46,'cancelExport'),(252,'التوزيع الشهري',46,'monthlyDistribute'),(253,'مشاهدة',47,'show'),(254,'تغيير الحالة',47,'changeStatus'),(255,'مشاهدة',48,'show'),(256,'مشاهدة',49,'show'),(257,'إضافة',49,'add'),(258,'تعديل',49,'edit'),(259,'حذف',49,'delete'),(260,'مشاهدة',50,'show'),(261,'إضافة',50,'add'),(262,'تعديل',50,'edit'),(263,'حذف',50,'delete'),(264,'ترحيل',50,'post'),(265,'الغاء ترحيل',50,'unpost'),(266,'مشاهدة',51,'show'),(267,'إضافة',51,'add'),(268,'تعديل',51,'edit'),(269,'حذف',51,'delete'),(270,'ترحيل',51,'post'),(271,'الغاء ترحيل',51,'unpost'),(272,'مشاهدة',52,'show'),(273,'إضافة',52,'add'),(274,'تعديل',52,'edit'),(275,'حذف',52,'delete'),(276,'ترحيل',52,'post'),(277,'الغاء ترحيل',52,'unpost'),(278,'الإيرادات الشهرية',53,'monthlyRevenues'),(279,'إضافة',54,'add'),(280,'تعديل',54,'edit'),(281,'حذف',54,'delete'),(282,'إضافة',55,'add'),(283,'تعديل',55,'edit'),(284,'حذف',55,'delete'),(285,'إضافة',56,'add'),(286,'تعديل',56,'edit'),(287,'حذف',56,'delete'),(288,'إضافة',57,'add'),(289,'تعديل',57,'edit'),(290,'حذف',57,'delete'),(291,'إضافة',58,'add'),(292,'تعديل',58,'edit'),(293,'حذف',58,'delete'),(294,'إضافة',59,'add'),(295,'تعديل',59,'edit'),(296,'حذف',59,'delete'),(297,'إضافة',60,'add'),(298,'تعديل',60,'edit'),(299,'حذف',60,'delete'),(300,'إضافة',61,'add'),(301,'تعديل',61,'edit'),(302,'حذف',61,'delete'),(303,'مشاهدة',62,'show'),(304,'إضافة',62,'add'),(305,'تعديل',62,'edit'),(306,'حذف',62,'delete'),(307,'ربط الطابعة',62,'connectPrinter'),(308,'مشاهدة',63,'show'),(309,'مشاهدة الحركات',63,'showDetails'),(310,'ترحيل إلى فوترة',63,'postToFotara'),(311,'إغلاق',63,'close'),(312,'ترحيل',63,'post'),(313,'مشاهدة',64,'show'),(314,'المواد المحذوفة',65,'deletedItems'),(315,'مبيعات الصناديق',65,'boxesSales'),(316,'مبيعات الصناديق',65,'detailedBoxes'),(317,'تعديل',66,'edit'),(318,'إضافة فواتير المبيعات',69,'addSalesInvoices'),(319,'تعديل فواتير المبيعات',69,'editSalesInvoices'),(320,'ترحيل فواتر المبيعات',69,'postSalesInvoices'),(321,'إضافة طلبات المبيعات',69,'addSalesOrders'),(322,'تعديل طلبات المبيعات',69,'editSalesOrders'),(323,'تحويل طلبات المبيعات',69,'convertSalesOrders'),(324,'إضافة عروض الاسعار',69,'addSalesOffers'),(325,'تعديل عروض الاسعار',69,'editSalesOffers'),(326,'تحويل عروض الاسعار',69,'convertSalesOffers'),(327,'إضافة سندات القبض',70,'addReceiptEntry'),(328,'تعديل سندات القبض',70,'editReceiptEntry'),(329,'ترحيل سندات القبض ',70,'postReceiptEntry'),(330,'إضافة',71,'add'),(331,'تعديل',71,'edit'),(332,'حذف',71,'delete'),(333,'ترحيل',71,'post'),(334,'الغاء ترحيل',71,'unpost'),(335,'مشاهدة الاحصائيات الإجمالية',72,'showTotalsCharts'),(336,'مشاهدة الشاشة',73,'show'),(337,'التعديل',73,'edit'),(338,'مشاهدة الشاشة',74,'show'),(339,'التعديل',74,'edit'),(340,'إنشاء السنوات المالية',75,'create'),(341,'فتح السنة المالية',75,'openYear'),(342,'اغلاق السنة المالية',75,'closeYear'),(343,'اغلاق الاشهر المالية',75,'closeMonth'),(344,'تعيين السنة الفعّالة',75,'activateYear'),(345,'مشاهدة الشاشة',76,'show'),(346,'إضافة',76,'add'),(347,'التعديل',76,'edit'),(348,'حذف',76,'delete'),(349,'تغيير الحالة',76,'changeStatus'),(350,'مشاهدة المستخدمين',77,'show'),(351,'تغعيل الحسابات',77,'activate'),(352,'إنشاء مستخدم جديد',77,'add'),(353,'تعديل البيانات العامة',77,'editInfo'),(354,'تعديل الصلاحيات',77,'editPermissions'),(355,'حذف',77,'delete'),(356,'مشاهدة السجل',78,'show'),(357,'مشاهدة الشاشة',79,'show'),(358,'التعديل',79,'edit'),(359,'إضافة',79,'add'),(360,'حذف',79,'delete'),(361,'مشاهدة الشاشة',80,'show'),(362,'امكانية الربط',80,'connect'),(363,'مشاهدة الشاشة',81,'show'),(364,'التعديل',81,'edit'),(365,'مشاهدة الشاشة',82,'show'),(366,'التعديل',82,'edit'),(367,'مشاهدة الشاشة',83,'show'),(368,'التعديل',83,'edit'),(369,'انشاء ضريبة',84,'add'),(370,'انشاء ضريبة',84,'edit'),(371,'تفعيل/الغاء تفعيل',84,'activate'),(372,'فك ترحيل سند القيد',85,'unpostEntry'),(373,'فك ترحيل سند القبض',85,'unpostReceipt'),(374,'فك ترحيل سند الصرف',85,'unpostExchange'),(375,'فك ترحيل فاتورة بيع خدمات',85,'unpostServiceInvoice'),(376,'فك ترحيل سند مردود خدمات',85,'unpostReturnedServiceBond'),(377,'فك ترحيل سند إشعار مدين',85,'unpostDebitNote'),(378,'فك ترحيل سند إشعار دائن',85,'unpostCreditNote'),(379,'السقف اليومي لتصدير الشيكات',85,'exchangeChecksDailyCeiling'),(380,'توقيع سند القيد',86,'entry'),(381,'توقيع سند الصرف',86,'exchange'),(382,'توقيع سند القبض',86,'receipt'),(383,'توقيع فاتورة بيع الخدمات',86,'serviceInvoice'),(384,'توقيع سند مردود خدمات',86,'returnedServiceInvoice'),(385,'توقيع إشعار المدين',86,'debitNote'),(386,'توقيع إشعار الدائن',86,'creditNote'),(387,'إمكانية تصدير الفواتير',87,'enableExport'),(388,'إمكانية التوزيع الشهري للفواتير',87,'enableDistribute'),(389,'إضافة',88,'add'),(390,'تعديل',88,'edit'),(391,'حذف',88,'delete'),(392,'إضافة',89,'add'),(393,'تعديل',89,'edit'),(394,'حذف',89,'delete'),(395,'إضافة',90,'add'),(396,'تعديل',90,'edit'),(397,'حذف',90,'delete'),(398,'إضافة',91,'add'),(399,'تعديل',91,'edit'),(400,'حذف',91,'delete'),(401,'إضافة',92,'add'),(402,'تعديل',92,'edit'),(403,'حذف',92,'delete'),(404,'إضافة',93,'add'),(405,'تعديل',93,'edit'),(406,'حذف',93,'delete'),(407,'تفعيل مرحلة التنفيذ',94,'enableAuditingPhase'),(408,'ترحيل مصاريف التصنيع',94,'postExpensesToAccounting'),(409,'إضافة',95,'add'),(410,'تعديل',95,'edit'),(411,'حذف',95,'delete'),(412,'إضافة',96,'add'),(413,'تعديل',96,'edit'),(414,'حذف',96,'delete'),(415,'إضافة',97,'add'),(416,'تعديل',97,'edit'),(417,'حذف',97,'delete'),(418,'مشاهدة',98,'show'),(419,'إضافة',98,'add'),(420,'تعديل',98,'editInfo'),(421,'تفعيل/الغاء التفعيل',98,'activate'),(422,'مشاهدة',99,'show'),(423,'حفظ',99,'save'),(424,'مشاهدة',100,'show'),(425,'حفظ',100,'save'),(426,'مشاهدة',101,'show'),(427,'حفظ',101,'save'),(428,'مشاهدة',102,'show'),(429,'حفظ',102,'save'),(430,'مشاهدة',103,'show'),(431,'إضافة',103,'add'),(432,'تعديل',103,'editInfo');

--
-- Table structure for table `code_modules`
--

CREATE TABLE `code_modules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `code_modules`
--

INSERT INTO `code_modules` VALUES (1,'المحاسبة','accounting',1),(2,'الذمم','receivable',1),(3,'المستودعات','warehouses',1),(4,'العقار/الإيجارات','rentals',1),(5,'نقاط البيع - POS','pos',1),(6,'المندوبين','representatives',1),(7,'إعدادات عامة','generalSettings',1),(8,'إعدادات المحاسبة','accountingSettings',1),(9,'إعدادات الإيجارات','rentalsSettings',1),(10,'إعدادات المستودعات','warehousesSettings',1),(11,'إعدادات نقط البيع','posSettings',1),(12,'إعدادات المندوبين','representativesSettings',1);

--
-- Table structure for table `code_sections`
--

CREATE TABLE `code_sections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module_id` bigint unsigned NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `code_sections_module_id_foreign` (`module_id`),
  CONSTRAINT `code_sections_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `code_modules` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `code_sections`
--

INSERT INTO `code_sections` VALUES (1,'شجرة الحسابات',1,'accountsTree',1),(2,'الأرصدة الافتتاحية',1,'initialBalances',1),(3,'شجرة مراكز الكلفة',1,'costCenterTree',1),(4,'تدقيق المستندات',1,'bondsAuditing',1),(5,'سند القيد',1,'entries',1),(6,'سند القبض',1,'receipts',1),(7,'سند الصرف',1,'exchanges',1),(8,'فاتورة بيع الخدمات',1,'servicesInvoices',1),(9,'مردودات الخدمات',1,'returnedServicesBonds',1),(10,'إشعار مدين',1,'debitNotes',1),(11,'إشعار دائن',1,'creditNotes',1),(12,'القيود الآلية',1,'automatedEntries',1),(13,'حافظة الشيكات القبض',1,'receiptChecksKeeper',1),(14,'حافظة الشيكات الصرف',1,'exchangeChecksKeeper',1),(15,'الشيكات',1,'checks',1),(16,'تقارير',1,'reports',1),(17,'أنوع الذمم',2,'receivableTypes',1),(18,'الذمم',2,'receivableAccounts',1),(19,'تقارير',2,'reports',1),(20,'الفروع',3,'branches',1),(21,'العائلات',3,'categories',1),(22,'المواد',3,'items',1),(23,'سند الادخال',3,'entryBonds',1),(24,'سند الإخراج',3,'outBonds',1),(25,'سند التحويل',3,'convertBonds',1),(26,'سند التصنيع',3,'manufacturingBonds',1),(27,'أمر الشراء',3,'purchaseCommands',1),(28,'طلب الشراء',3,'purchaseOrders',1),(29,'فاتورة الشراء',3,'purchaseInvoices',1),(30,'مردودات المشتريات',3,'returnedPurchaseBonds',1),(31,'عرض سعر',3,'salesPriceOffers',1),(32,'طلب مبيعات',3,'salesOrders',1),(33,'فاتورة مبيعات',3,'salesInvoices',1),(34,'مردودات مبيعات',3,'returnedSalesBonds',1),(35,'طلب الإنتاج',3,'productionRequest',1),(36,'أمر الإنتاج',3,'productionCommand',1),(37,'سند الجرد',3,'stocktakingBonds',1),(38,'سند زيادة الكلفه',3,'costIncreaseBonds',1),(39,'سند تخفيض الكلفه',3,'costDecreaseBonds',1),(40,'تقارير',3,'reports',1),(41,'المباني',4,'buildings',1),(42,'الطوابق',4,'floors',1),(43,'المحلات',4,'shops',1),(44,'البوثات',4,'booths',1),(45,'العقود',4,'contracts',1),(46,'فواتير العقود',4,'contractInvoices',1),(47,'حركات المستأجرين',4,'tenantsActions',1),(48,'طلبات التأجير',4,'rentalRequests',1),(49,'فعاليات المستأجرين',4,'tenantsEvents',1),(50,'سند القبض',4,'receipts',1),(51,'إشعار مدين',4,'debitNotes',1),(52,'إشعار دائن',4,'creditNotes',1),(53,'تقارير',4,'reports',1),(54,'الفروع',5,'branches',1),(55,'العائلات',5,'categories',1),(56,'القوائم',5,'menus',1),(57,'المواد',5,'items',1),(58,'فاتورة مبيعات',5,'salesInvoices',1),(59,'مردودات مبيعات',5,'returnedSalesBonds',1),(60,'تبديل عناصر المبيعات',5,'exchangeBonds',1),(61,'العروض',5,'offers',1),(62,'الأقسام',5,'sections',1),(63,'مبيعات الأيام',5,'daysSales',1),(64,'فواتير الأيام',5,'posInvoices',1),(65,'تقارير',5,'reports',1),(66,'الصناديق',5,'cashDevices',1),(67,'توصيل الطلبيات',6,'ordersDelivery',1),(68,'كاش فان',6,'cashVan',1),(69,'مندوب مبيعات',6,'salesMan',1),(70,'التحصيل',6,'collector',1),(71,'الشحنات',6,'shipmentBonds',1),(72,'الشاشة الرئيسية',7,'homePage',1),(73,'تعريف الشركة',7,'companyDefinition',1),(74,'إعدادات عامة',7,'general',1),(75,'السنوات المالية',7,'fiscalYears',1),(76,'طرق تسديد الذمم',7,'receivablePaymentMethods',1),(77,'المستخدمين',7,'employees',1),(78,'سجل حركات المستخدمين',7,'employeesActionsLog',1),(79,'تصنيفات الذمم',7,'receivableCategory',1),(80,'ربط الحسابات البنكية',8,'bankAccountsConnecting',1),(81,'الحسابات الافتراضية',8,'defaultAccounts',1),(82,'مراكز الكلفة',8,'costCenters',1),(83,'المحافظ الإلكترونية',8,'ewalletAccounts',1),(84,'اعداد الضريبة',8,'taxes',1),(85,'السندات',8,'bonds',1),(86,'التواقيع',8,'signatures',1),(87,'عقود الإيجارات',9,'rentalContracts',1),(88,'تصنيفات عقود الإيجارات',9,'rentalContractCategories',1),(89,'قوالب الردود',9,'responseTemplates',1),(90,'تعريف الوحدات',10,'warehousesUnits',1),(91,'تعريف أحجام المواد',10,'warehousesItemSizes',1),(92,'أنواع سندات الإدخال',10,'warehousesEntryBondTypes',1),(93,'أنواع سندات الإخراج',10,'warehousesOutBondTypes',1),(94,'سندات التصنيع',10,'warehousesManufacturingBonds',1),(95,'أنواع الأسعار',10,'barcodePriceTypes',1),(96,'شروط الدفع',10,'paymentTerms',1),(97,'شروط الشحن والتسليم',10,'deliveryTerms',1),(98,'حسابات المستخدمين',11,'users',1),(99,'إعدادات عامة',11,'generalSettings',1),(100,'إعدادات المبيعات',11,'salesSettings',1),(101,'إعدادات الصناديق',11,'boxesSettings',1),(102,'إعدادات الميزان',11,'scaleSettings',1),(103,'تعريف السيارات',12,'deliveryCars',1);

--
-- Table structure for table `contract_categories`
--

CREATE TABLE `contract_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  `level` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `contract_categories_parent_id_foreign` (`parent_id`),
  CONSTRAINT `contract_categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `contract_categories` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contract_categories`
--


--
-- Table structure for table `convert_bond_items`
--

CREATE TABLE `convert_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `cost` double NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `convert_bond_items_bond_id_foreign` (`bond_id`),
  KEY `convert_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `convert_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `convert_bond_items_bond_id_foreign` FOREIGN KEY (`bond_id`) REFERENCES `convert_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `convert_bond_items`
--


--
-- Table structure for table `convert_bonds`
--

CREATE TABLE `convert_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `from_temp_branch` tinyint(1) NOT NULL DEFAULT '0',
  `to_temp_branch` tinyint(1) NOT NULL DEFAULT '0',
  `from_branch_id` bigint unsigned NOT NULL,
  `to_branch_id` bigint unsigned NOT NULL,
  `type_id` bigint unsigned NOT NULL,
  `differences_from_date` date DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `finished_temp_tour` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `convert_bonds_employee_id_foreign` (`employee_id`),
  KEY `convert_bonds_from_branch_id_foreign` (`from_branch_id`),
  KEY `convert_bonds_to_branch_id_foreign` (`to_branch_id`),
  KEY `convert_bonds_type_id_foreign` (`type_id`),
  CONSTRAINT `convert_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `convert_bonds_from_branch_id_foreign` FOREIGN KEY (`from_branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `convert_bonds_to_branch_id_foreign` FOREIGN KEY (`to_branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `convert_bonds_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `convert_bond_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `convert_bonds`
--


--
-- Table structure for table `converted_checks`
--

CREATE TABLE `converted_checks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receipt_check_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `credit_account_id` bigint unsigned NOT NULL,
  `receivable_account_id` bigint unsigned NOT NULL,
  `amount` double(13,3) NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `converted_checks_receipt_check_id_foreign` (`receipt_check_id`),
  KEY `converted_checks_credit_account_id_foreign` (`credit_account_id`),
  KEY `converted_checks_receivable_account_id_foreign` (`receivable_account_id`),
  CONSTRAINT `converted_checks_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `converted_checks_receipt_check_id_foreign` FOREIGN KEY (`receipt_check_id`) REFERENCES `receipt_checks` (`id`),
  CONSTRAINT `converted_checks_receivable_account_id_foreign` FOREIGN KEY (`receivable_account_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `converted_checks`
--


--
-- Table structure for table `cost_centers`
--

CREATE TABLE `cost_centers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` bigint unsigned DEFAULT NULL,
  `ar_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `en_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` int NOT NULL DEFAULT '1',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `cost_centers_parent_id_foreign` (`parent_id`),
  CONSTRAINT `cost_centers_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `cost_centers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_centers`
--


--
-- Table structure for table `cost_decrease_bond_items`
--

CREATE TABLE `cost_decrease_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cost_decrease_bond_id` bigint unsigned NOT NULL,
  `purchase_item_id` int unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `remaining_quantity` double NOT NULL,
  `cost` double NOT NULL,
  `new_cost` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cost_decrease_bond_items_cost_decrease_bond_id_foreign` (`cost_decrease_bond_id`),
  KEY `cost_decrease_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `cost_decrease_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `cost_decrease_bond_items_cost_decrease_bond_id_foreign` FOREIGN KEY (`cost_decrease_bond_id`) REFERENCES `cost_decrease_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_decrease_bond_items`
--


--
-- Table structure for table `cost_decrease_bonds`
--

CREATE TABLE `cost_decrease_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `purchase_invoice_id` bigint unsigned NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` timestamp NULL DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cost_decrease_bonds_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  CONSTRAINT `cost_decrease_bonds_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_decrease_bonds`
--


--
-- Table structure for table `cost_increase_bond_items`
--

CREATE TABLE `cost_increase_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cost_increase_bond_id` bigint unsigned NOT NULL,
  `purchase_item_id` int unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `remaining_quantity` double NOT NULL,
  `cost` double NOT NULL,
  `new_cost` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `cost_increase_bond_items_cost_increase_bond_id_foreign` (`cost_increase_bond_id`),
  KEY `cost_increase_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `cost_increase_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `cost_increase_bond_items_cost_increase_bond_id_foreign` FOREIGN KEY (`cost_increase_bond_id`) REFERENCES `cost_increase_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_increase_bond_items`
--


--
-- Table structure for table `cost_increase_bonds`
--

CREATE TABLE `cost_increase_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `purchase_invoice_id` bigint unsigned NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` timestamp NULL DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cost_increase_bonds_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  CONSTRAINT `cost_increase_bonds_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cost_increase_bonds`
--


--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ar_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `en_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `currency_symbol` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `countries`
--

INSERT INTO `countries` VALUES (1,'الأردن','Jordan',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(2,'السعودية','Saudi ِArabia',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(3,'الولايات المتحدة','United States',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(4,'سوريا','Syria',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(5,'العراق','Iraq',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(6,'مصر','Egypt',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(7,'كوريا','Korea',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08'),(8,'كوريا','Korea',NULL,'2025-11-04 02:03:08','2025-11-04 02:03:08');

--
-- Table structure for table `credit_note_items`
--

CREATE TABLE `credit_note_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `note_id` bigint unsigned NOT NULL,
  `debit_account_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `credit_note_items_note_id_foreign` (`note_id`),
  KEY `credit_note_items_debit_account_id_foreign` (`debit_account_id`),
  KEY `credit_note_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `credit_note_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `credit_note_items_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `credit_note_items_note_id_foreign` FOREIGN KEY (`note_id`) REFERENCES `credit_notes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `credit_note_items`
--


--
-- Table structure for table `credit_notes`
--

CREATE TABLE `credit_notes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `credit_receivable_id` bigint unsigned DEFAULT NULL,
  `credit_account_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `post_status` smallint NOT NULL DEFAULT '0',
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `credit_notes_year_id_foreign` (`year_id`),
  KEY `credit_notes_period_id_foreign` (`period_id`),
  KEY `credit_notes_employee_id_foreign` (`employee_id`),
  KEY `credit_notes_credit_receivable_id_foreign` (`credit_receivable_id`),
  KEY `credit_notes_credit_account_id_foreign` (`credit_account_id`),
  CONSTRAINT `credit_notes_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `credit_notes_credit_receivable_id_foreign` FOREIGN KEY (`credit_receivable_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `credit_notes_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `credit_notes_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `credit_notes_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `credit_notes`
--


--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `symbol` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ar_symbol` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `flag` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `exchange_price` double(10,5) NOT NULL DEFAULT '1.00000',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `currencies`
--

INSERT INTO `currencies` VALUES (1,'الدينار الاردني','JOD','د.أ',NULL,1.00000),(2,'ريال سعودي','SAR','ر.س',NULL,0.18933),(3,'الدولار الامريكي','USD','$',NULL,0.71000),(4,'الليرة السورية','SYP','ل.س',NULL,0.00006),(5,'الدينار العراقي','IQD','د.ع',NULL,0.00054),(6,'الجنيه مصري','EGP','ج.م',NULL,0.01492),(7,'وون كوري','KRW','وون',NULL,0.00049);

--
-- Table structure for table `debit_note_items`
--

CREATE TABLE `debit_note_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `note_id` bigint unsigned NOT NULL,
  `credit_account_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `debit_note_items_note_id_foreign` (`note_id`),
  KEY `debit_note_items_credit_account_id_foreign` (`credit_account_id`),
  KEY `debit_note_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `debit_note_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `debit_note_items_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `debit_note_items_note_id_foreign` FOREIGN KEY (`note_id`) REFERENCES `debit_notes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `debit_note_items`
--


--
-- Table structure for table `debit_notes`
--

CREATE TABLE `debit_notes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `debit_receivable_id` bigint unsigned DEFAULT NULL,
  `debit_account_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `post_status` smallint NOT NULL DEFAULT '0',
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `debit_notes_year_id_foreign` (`year_id`),
  KEY `debit_notes_period_id_foreign` (`period_id`),
  KEY `debit_notes_employee_id_foreign` (`employee_id`),
  KEY `debit_notes_debit_receivable_id_foreign` (`debit_receivable_id`),
  KEY `debit_notes_debit_account_id_foreign` (`debit_account_id`),
  CONSTRAINT `debit_notes_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `debit_notes_debit_receivable_id_foreign` FOREIGN KEY (`debit_receivable_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `debit_notes_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `debit_notes_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `debit_notes_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `debit_notes`
--


--
-- Table structure for table `deleted_item_log_actions`
--

CREATE TABLE `deleted_item_log_actions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cashier_id` bigint unsigned NOT NULL,
  `supervisor_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `deleted_item_log_actions_cashier_id_foreign` (`cashier_id`),
  KEY `deleted_item_log_actions_supervisor_id_foreign` (`supervisor_id`),
  KEY `deleted_item_log_actions_branch_id_foreign` (`branch_id`),
  CONSTRAINT `deleted_item_log_actions_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `deleted_item_log_actions_cashier_id_foreign` FOREIGN KEY (`cashier_id`) REFERENCES `pos_users` (`id`),
  CONSTRAINT `deleted_item_log_actions_supervisor_id_foreign` FOREIGN KEY (`supervisor_id`) REFERENCES `pos_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `deleted_item_log_actions`
--


--
-- Table structure for table `delivery_cars`
--

CREATE TABLE `delivery_cars` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `delivery_cars`
--


--
-- Table structure for table `delivery_terms`
--

CREATE TABLE `delivery_terms` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `delivery_terms`
--


--
-- Table structure for table `draft_purchase_order_meets`
--

CREATE TABLE `draft_purchase_order_meets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint unsigned NOT NULL,
  `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `draft_purchase_order_meets_purchase_order_id_foreign` (`purchase_order_id`),
  CONSTRAINT `draft_purchase_order_meets_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `draft_purchase_order_meets`
--


--
-- Table structure for table `draft_sales_order_meets`
--

CREATE TABLE `draft_sales_order_meets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_order_id` bigint unsigned NOT NULL,
  `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `draft_sales_order_meets_sales_order_id_foreign` (`sales_order_id`),
  CONSTRAINT `draft_sales_order_meets_sales_order_id_foreign` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `draft_sales_order_meets`
--


--
-- Table structure for table `drivers`
--

CREATE TABLE `drivers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `drivers`
--


--
-- Table structure for table `entries`
--

CREATE TABLE `entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `amount` double(13,3) NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `entries_year_id_foreign` (`year_id`),
  KEY `entries_period_id_foreign` (`period_id`),
  KEY `entries_employee_id_foreign` (`employee_id`),
  CONSTRAINT `entries_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `entries_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `entries_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entries`
--


--
-- Table structure for table `entry_batch_out_bond_item`
--

CREATE TABLE `entry_batch_out_bond_item` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `out_bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `out_bond_id` bigint unsigned NOT NULL,
  `out_bond_item_id` bigint unsigned NOT NULL,
  `entry_batch_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `cost` double NOT NULL,
  `sales_price` double DEFAULT NULL,
  `created_at` timestamp NOT NULL,
  PRIMARY KEY (`id`),
  KEY `entry_batch_out_bond_item_entry_batch_id_foreign` (`entry_batch_id`),
  CONSTRAINT `entry_batch_out_bond_item_entry_batch_id_foreign` FOREIGN KEY (`entry_batch_id`) REFERENCES `entry_batches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entry_batch_out_bond_item`
--


--
-- Table structure for table `entry_batches`
--

CREATE TABLE `entry_batches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `entry_bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entry_bond_id` bigint unsigned NOT NULL,
  `entry_bond_item_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `remaining_quantity` double NOT NULL,
  `cost` double NOT NULL,
  `expire_date` date DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `entry_batches_barcode_id_foreign` (`barcode_id`),
  KEY `entry_batches_branch_id_foreign` (`branch_id`),
  CONSTRAINT `entry_batches_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `entry_batches_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entry_batches`
--


--
-- Table structure for table `entry_bond_items`
--

CREATE TABLE `entry_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,3) NOT NULL DEFAULT '1.000',
  `cost` double(14,9) NOT NULL,
  `expire_date` date DEFAULT NULL,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `print_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `entry_bond_items_bond_id_foreign` (`bond_id`),
  KEY `entry_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `entry_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `entry_bond_items_bond_id_foreign` FOREIGN KEY (`bond_id`) REFERENCES `entry_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entry_bond_items`
--


--
-- Table structure for table `entry_bonds`
--

CREATE TABLE `entry_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `type_id` bigint unsigned NOT NULL,
  `recipient_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total` double(10,3) NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `entry_bonds_branch_id_foreign` (`branch_id`),
  KEY `entry_bonds_client_id_foreign` (`client_id`),
  KEY `entry_bonds_employee_id_foreign` (`employee_id`),
  KEY `entry_bonds_type_id_foreign` (`type_id`),
  CONSTRAINT `entry_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `entry_bonds_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `entry_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `entry_bonds_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `entry_bond_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entry_bonds`
--


--
-- Table structure for table `entry_employee_notices`
--

CREATE TABLE `entry_employee_notices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `employee_id` bigint unsigned NOT NULL,
  `resource_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resource_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `entry_employee_notices_employee_id_foreign` (`employee_id`),
  CONSTRAINT `entry_employee_notices_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entry_employee_notices`
--


--
-- Table structure for table `entry_items`
--

CREATE TABLE `entry_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `entry_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `receivable_id` bigint unsigned DEFAULT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `debit` double DEFAULT NULL,
  `credit` double DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `entry_items_entry_id_foreign` (`entry_id`),
  KEY `entry_items_account_id_foreign` (`account_id`),
  KEY `entry_items_receivable_id_foreign` (`receivable_id`),
  KEY `entry_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `entry_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `entry_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `entry_items_entry_id_foreign` FOREIGN KEY (`entry_id`) REFERENCES `entries` (`id`),
  CONSTRAINT `entry_items_receivable_id_foreign` FOREIGN KEY (`receivable_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entry_items`
--


--
-- Table structure for table `ewallet_accounts`
--

CREATE TABLE `ewallet_accounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `account_id` bigint unsigned NOT NULL,
  `owner_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ewallet_accounts_account_id_foreign` (`account_id`),
  CONSTRAINT `ewallet_accounts_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ewallet_accounts`
--


--
-- Table structure for table `exchange_bond_items`
--

CREATE TABLE `exchange_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `exchange_bond_id` bigint unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'new, returned',
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL DEFAULT '1',
  `price` double(10,3) DEFAULT NULL,
  `total` decimal(10,3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exchange_bond_items_exchange_bond_id_foreign` (`exchange_bond_id`),
  KEY `exchange_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `exchange_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `exchange_bond_items_exchange_bond_id_foreign` FOREIGN KEY (`exchange_bond_id`) REFERENCES `exchange_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_bond_items`
--


--
-- Table structure for table `exchange_bonds`
--

CREATE TABLE `exchange_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `box_id` bigint unsigned NOT NULL,
  `is_fully_costed` tinyint(1) NOT NULL DEFAULT '0',
  `amount` decimal(15,3) NOT NULL DEFAULT '0.000',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exchange_bonds_user_id_foreign` (`user_id`),
  KEY `exchange_bonds_branch_id_foreign` (`branch_id`),
  KEY `exchange_bonds_box_id_foreign` (`box_id`),
  CONSTRAINT `exchange_bonds_box_id_foreign` FOREIGN KEY (`box_id`) REFERENCES `boxes` (`id`),
  CONSTRAINT `exchange_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `exchange_bonds_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `pos_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_bonds`
--


--
-- Table structure for table `exchange_check_operations`
--

CREATE TABLE `exchange_check_operations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `check_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `credit_type` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `credit_account_id` bigint unsigned NOT NULL,
  `debit_type` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `debit_account_id` bigint unsigned NOT NULL,
  `posted_file` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exchange_check_operations_check_id_foreign` (`check_id`),
  CONSTRAINT `exchange_check_operations_check_id_foreign` FOREIGN KEY (`check_id`) REFERENCES `exchange_checks` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_check_operations`
--


--
-- Table structure for table `exchange_checks`
--

CREATE TABLE `exchange_checks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `exchange_id` bigint unsigned NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `beneficiary_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(13,3) NOT NULL,
  `date` date NOT NULL,
  `switched_check_id` bigint unsigned DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'in_postPaid/ posted/ returned',
  PRIMARY KEY (`id`),
  KEY `exchange_checks_exchange_id_foreign` (`exchange_id`),
  KEY `exchange_checks_switched_check_id_foreign` (`switched_check_id`),
  CONSTRAINT `exchange_checks_exchange_id_foreign` FOREIGN KEY (`exchange_id`) REFERENCES `exchange_entries` (`id`),
  CONSTRAINT `exchange_checks_switched_check_id_foreign` FOREIGN KEY (`switched_check_id`) REFERENCES `exchange_checks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_checks`
--


--
-- Table structure for table `exchange_entries`
--

CREATE TABLE `exchange_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_way` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'cash or check or transfer',
  `credit_account_id` bigint unsigned NOT NULL,
  `amount` double(13,3) NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exchange_entries_year_id_foreign` (`year_id`),
  KEY `exchange_entries_period_id_foreign` (`period_id`),
  KEY `exchange_entries_employee_id_foreign` (`employee_id`),
  KEY `exchange_entries_credit_account_id_foreign` (`credit_account_id`),
  CONSTRAINT `exchange_entries_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `exchange_entries_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `exchange_entries_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `exchange_entries_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_entries`
--


--
-- Table structure for table `exchange_entry_items`
--

CREATE TABLE `exchange_entry_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `exchange_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `receivable_id` bigint unsigned DEFAULT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exchange_entry_items_exchange_id_foreign` (`exchange_id`),
  KEY `exchange_entry_items_account_id_foreign` (`account_id`),
  KEY `exchange_entry_items_receivable_id_foreign` (`receivable_id`),
  KEY `exchange_entry_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `exchange_entry_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `exchange_entry_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `exchange_entry_items_exchange_id_foreign` FOREIGN KEY (`exchange_id`) REFERENCES `exchange_entries` (`id`),
  CONSTRAINT `exchange_entry_items_receivable_id_foreign` FOREIGN KEY (`receivable_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_entry_items`
--


--
-- Table structure for table `exchange_ewallet_items`
--

CREATE TABLE `exchange_ewallet_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `exchange_id` bigint unsigned NOT NULL,
  `from_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(10,2) NOT NULL,
  `date` date NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `exchange_ewallet_items_exchange_id_foreign` (`exchange_id`),
  CONSTRAINT `exchange_ewallet_items_exchange_id_foreign` FOREIGN KEY (`exchange_id`) REFERENCES `exchange_entries` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_ewallet_items`
--


--
-- Table structure for table `exchange_transfers`
--

CREATE TABLE `exchange_transfers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `exchange_id` bigint unsigned NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(13,3) NOT NULL,
  `date` date NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `exchange_transfers_exchange_id_foreign` (`exchange_id`),
  CONSTRAINT `exchange_transfers_exchange_id_foreign` FOREIGN KEY (`exchange_id`) REFERENCES `exchange_entries` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `exchange_transfers`
--


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

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `fiscal_periods`
--

CREATE TABLE `fiscal_periods` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `month` int NOT NULL,
  `is_open` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `fiscal_periods_year_id_foreign` (`year_id`),
  CONSTRAINT `fiscal_periods_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `fiscal_periods`
--


--
-- Table structure for table `fiscal_years`
--

CREATE TABLE `fiscal_years` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `from` date NOT NULL,
  `to` date NOT NULL,
  `is_open` tinyint(1) NOT NULL DEFAULT '1',
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `fiscal_years`
--


--
-- Table structure for table `floors`
--

CREATE TABLE `floors` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `building_id` bigint unsigned NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `area` double(10,3) NOT NULL,
  `shops_area` double(10,3) NOT NULL,
  `booths_area` double(10,3) NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `floors_building_id_foreign` (`building_id`),
  CONSTRAINT `floors_building_id_foreign` FOREIGN KEY (`building_id`) REFERENCES `buildings` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `floors`
--


--
-- Table structure for table `general_banks`
--

CREATE TABLE `general_banks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `general_banks`
--

INSERT INTO `general_banks` VALUES (1,'البنك العربي',1),(2,'بنك الأردن',1),(3,'البنك التجاري الأردني',1),(4,'البنك الأهلي الأردني',1),(5,'بنك الاستثمار العربي الأردني',1),(6,'بنك القاهرة عمان',1),(7,'البنك الأردني الكويتي',1),(8,'بنك الإسكان للتجارة والتمويل',1),(9,'بنك الاتحاد',1),(10,'البنك الاستثماري',1);

--
-- Table structure for table `general_item_classifications`
--

CREATE TABLE `general_item_classifications` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `general_item_classifications_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `general_item_classifications`
--


--
-- Table structure for table `invoice_receipt_payments`
--

CREATE TABLE `invoice_receipt_payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receipt_id` bigint unsigned NOT NULL,
  `invoice_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'services_invoice / rental_contract_invoice / sales_invoice',
  `services_invoice_id` bigint unsigned DEFAULT NULL,
  `rental_invoice_id` bigint unsigned DEFAULT NULL,
  `sales_invoice_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `invoice_receipt_payments_receipt_id_foreign` (`receipt_id`),
  KEY `invoice_receipt_payments_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `invoice_receipt_payments_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `invoice_receipt_payments_receipt_id_foreign` FOREIGN KEY (`receipt_id`) REFERENCES `receipt_entries` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `invoice_receipt_payments`
--


--
-- Table structure for table `item_dynamic_input_values`
--

CREATE TABLE `item_dynamic_input_values` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `item_id` bigint unsigned NOT NULL,
  `dynamic_input_id` bigint unsigned NOT NULL,
  `value` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `item_dynamic_input_values_item_id_foreign` (`item_id`),
  KEY `item_dynamic_input_values_dynamic_input_id_foreign` (`dynamic_input_id`),
  CONSTRAINT `item_dynamic_input_values_dynamic_input_id_foreign` FOREIGN KEY (`dynamic_input_id`) REFERENCES `item_dynamic_inputs` (`id`),
  CONSTRAINT `item_dynamic_input_values_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `item_dynamic_input_values`
--


--
-- Table structure for table `item_dynamic_inputs`
--

CREATE TABLE `item_dynamic_inputs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_required` tinyint(1) NOT NULL DEFAULT '0',
  `options` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `item_dynamic_inputs`
--


--
-- Table structure for table `item_manufacturing_recipes`
--

CREATE TABLE `item_manufacturing_recipes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `item_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `item_manufacturing_recipes_item_id_foreign` (`item_id`),
  CONSTRAINT `item_manufacturing_recipes_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `item_manufacturing_recipes`
--


--
-- Table structure for table `item_size_types`
--

CREATE TABLE `item_size_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `item_size_types`
--

INSERT INTO `item_size_types` VALUES (1,'مل'),(2,'لتر');

--
-- Table structure for table `items`
--

CREATE TABLE `items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `number` bigint NOT NULL,
  `full_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ar_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `en_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category_id` bigint unsigned NOT NULL,
  `general_classification_id` bigint unsigned DEFAULT NULL,
  `primary_supplier_id` bigint unsigned DEFAULT NULL,
  `secondary_supplier_id` bigint unsigned DEFAULT NULL,
  `country_id` bigint unsigned DEFAULT NULL,
  `under_tax` tinyint(1) NOT NULL DEFAULT '0',
  `tax_id` bigint unsigned DEFAULT NULL,
  `has_expire_date` tinyint(1) NOT NULL DEFAULT '0',
  `decimal_quantity` tinyint(1) NOT NULL DEFAULT '0',
  `size_type_id` bigint unsigned DEFAULT NULL,
  `size` double DEFAULT NULL,
  `barcode_price_types` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '[]',
  `has_serial_number` tinyint(1) NOT NULL DEFAULT '0',
  `manufacturable_item` tinyint(1) NOT NULL DEFAULT '0',
  `purchases_discount_ratio` double DEFAULT NULL,
  `purchase_orders` tinyint(1) NOT NULL DEFAULT '1',
  `editable_price` tinyint(1) NOT NULL DEFAULT '0',
  `auto_generate_barcodes_numbers` tinyint(1) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `items_full_number_unique` (`full_number`),
  KEY `items_category_id_foreign` (`category_id`),
  KEY `items_general_classification_id_foreign` (`general_classification_id`),
  KEY `items_primary_supplier_id_foreign` (`primary_supplier_id`),
  KEY `items_secondary_supplier_id_foreign` (`secondary_supplier_id`),
  KEY `items_country_id_foreign` (`country_id`),
  KEY `items_tax_id_foreign` (`tax_id`),
  KEY `items_size_type_id_foreign` (`size_type_id`),
  CONSTRAINT `items_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
  CONSTRAINT `items_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
  CONSTRAINT `items_general_classification_id_foreign` FOREIGN KEY (`general_classification_id`) REFERENCES `general_item_classifications` (`id`),
  CONSTRAINT `items_primary_supplier_id_foreign` FOREIGN KEY (`primary_supplier_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `items_secondary_supplier_id_foreign` FOREIGN KEY (`secondary_supplier_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `items_size_type_id_foreign` FOREIGN KEY (`size_type_id`) REFERENCES `item_size_types` (`id`),
  CONSTRAINT `items_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `items`
--

INSERT INTO `items` VALUES (1,1,'1','مادة تجريبية','Test Item',NULL,1,NULL,NULL,NULL,NULL,1,6,0,0,NULL,NULL,'[\"2\"]',0,0,NULL,1,0,0,1,'2025-11-04 02:13:05','2025-11-04 02:13:05');

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `jobs`
--


--
-- Table structure for table `manufacturing_bond_items`
--

CREATE TABLE `manufacturing_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `manufacturing_bond_id` bigint unsigned NOT NULL,
  `from_branch_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `unit_cost` double NOT NULL COMMENT 'cost for one thing',
  `notes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacturing_bond_items_manufacturing_bond_id_foreign` (`manufacturing_bond_id`),
  KEY `manufacturing_bond_items_from_branch_id_foreign` (`from_branch_id`),
  KEY `manufacturing_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `manufacturing_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `manufacturing_bond_items_from_branch_id_foreign` FOREIGN KEY (`from_branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `manufacturing_bond_items_manufacturing_bond_id_foreign` FOREIGN KEY (`manufacturing_bond_id`) REFERENCES `manufacturing_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `manufacturing_bond_items`
--


--
-- Table structure for table `manufacturing_bond_out_sourced_employee`
--

CREATE TABLE `manufacturing_bond_out_sourced_employee` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `hours_count` int NOT NULL DEFAULT '1',
  `hour_cost` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacturing_bond_out_sourced_employee_bond_id_foreign` (`bond_id`),
  KEY `manufacturing_bond_out_sourced_employee_employee_id_foreign` (`employee_id`),
  CONSTRAINT `manufacturing_bond_out_sourced_employee_bond_id_foreign` FOREIGN KEY (`bond_id`) REFERENCES `manufacturing_bonds` (`id`),
  CONSTRAINT `manufacturing_bond_out_sourced_employee_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `out_sourced_employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `manufacturing_bond_out_sourced_employee`
--


--
-- Table structure for table `manufacturing_bonds`
--

CREATE TABLE `manufacturing_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `batch_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL COMMENT 'manufacturing start date',
  `end_date` date NOT NULL COMMENT 'manufacturing end date',
  `client_id` bigint unsigned DEFAULT NULL,
  `client_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `manufactured_barcode_id` bigint unsigned NOT NULL COMMENT 'called as item',
  `barcode_recipe_id` bigint unsigned NOT NULL,
  `from_branch_id` bigint unsigned NOT NULL,
  `to_branch_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `unit_cost` double NOT NULL COMMENT 'cost for one thing',
  `manufacturing_expenses_ratio` double DEFAULT NULL,
  `other_expenses` double DEFAULT NULL,
  `out_sourced_employees_expenses` double DEFAULT NULL,
  `expenses_credit_account_id` bigint unsigned DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `cost_after_audit` double DEFAULT NULL,
  `quantity_after_audit` double DEFAULT NULL COMMENT 'cost for one thing',
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacturing_bonds_employee_id_foreign` (`employee_id`),
  KEY `manufacturing_bonds_client_id_foreign` (`client_id`),
  KEY `manufacturing_bonds_manufactured_barcode_id_foreign` (`manufactured_barcode_id`),
  KEY `manufacturing_bonds_barcode_recipe_id_foreign` (`barcode_recipe_id`),
  KEY `manufacturing_bonds_from_branch_id_foreign` (`from_branch_id`),
  KEY `manufacturing_bonds_to_branch_id_foreign` (`to_branch_id`),
  KEY `manufacturing_bonds_expenses_credit_account_id_foreign` (`expenses_credit_account_id`),
  CONSTRAINT `manufacturing_bonds_barcode_recipe_id_foreign` FOREIGN KEY (`barcode_recipe_id`) REFERENCES `item_manufacturing_recipes` (`id`),
  CONSTRAINT `manufacturing_bonds_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `manufacturing_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `manufacturing_bonds_expenses_credit_account_id_foreign` FOREIGN KEY (`expenses_credit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `manufacturing_bonds_from_branch_id_foreign` FOREIGN KEY (`from_branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `manufacturing_bonds_manufactured_barcode_id_foreign` FOREIGN KEY (`manufactured_barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `manufacturing_bonds_to_branch_id_foreign` FOREIGN KEY (`to_branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `manufacturing_bonds`
--


--
-- Table structure for table `manufacturing_recipe_ingredients`
--

CREATE TABLE `manufacturing_recipe_ingredients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `recipe_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `manufacturing_recipe_ingredients_recipe_id_foreign` (`recipe_id`),
  KEY `manufacturing_recipe_ingredients_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `manufacturing_recipe_ingredients_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `manufacturing_recipe_ingredients_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `item_manufacturing_recipes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `manufacturing_recipe_ingredients`
--


--
-- Table structure for table `menus`
--

CREATE TABLE `menus` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` bigint unsigned DEFAULT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` int NOT NULL DEFAULT '1',
  `image` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `menus_parent_id_foreign` (`parent_id`),
  CONSTRAINT `menus_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `menus` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `menus`
--


--
-- Table structure for table `merged_contracts`
--

CREATE TABLE `merged_contracts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contract_id` bigint unsigned NOT NULL,
  `merged_contract_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `merged_contracts_contract_id_foreign` (`contract_id`),
  KEY `merged_contracts_merged_contract_id_foreign` (`merged_contract_id`),
  CONSTRAINT `merged_contracts_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `rental_contracts` (`id`),
  CONSTRAINT `merged_contracts_merged_contract_id_foreign` FOREIGN KEY (`merged_contract_id`) REFERENCES `rental_contracts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `merged_contracts`
--


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

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=198 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` VALUES (1,'2019_08_19_000000_create_failed_jobs_table',1),(2,'2021_12_06_122709_create_password_resets_table',1),(3,'2021_12_06_122710_create_cache_table',1),(4,'2021_12_06_122720_create_permission_tables',1),(5,'2021_12_06_134444_create_sessions_table',1),(6,'2021_12_06_135903_create_employees_table',1),(7,'2021_12_14_112245_create_settings_table',1),(8,'2021_12_14_130038_create_code_modules_table',1),(9,'2021_12_14_130040_create_code_sections_table',1),(10,'2021_12_14_130053_create_code_functions_table',1),(11,'2021_12_15_074025_create_active_users',1),(12,'2021_12_20_092334_create_jobs_table',1),(13,'2021_12_22_111212_create_account_types_table',1),(14,'2021_12_22_115457_create_accounts_table',1),(15,'2021_12_26_065020_create_fiscal_years_table',1),(16,'2021_12_26_065344_create_fiscal_periods_table',1),(17,'2021_12_26_141920_create_countries_table',1),(18,'2021_12_26_141921_create_currencies_table',1),(19,'2021_12_26_141942_create_cost_centers_table',1),(20,'2021_12_26_141943_create_receivable_categories_table',1),(21,'2021_12_26_141944_create_receivable_types_table',1),(22,'2021_12_26_141945_create_receivable_payment_methods_table',1),(23,'2021_12_26_141946_create_receivable_accounts_table',1),(24,'2021_12_26_141947_create_entries_table',1),(25,'2021_12_30_090157_create_entry_items_table',1),(26,'2022_01_03_081523_create_taxes_table',1),(27,'2022_01_03_094943_create_service_invoices_table',1),(28,'2022_01_03_095048_create_service_invoice_items_table',1),(29,'2022_01_06_122635_create_receipt_entries_table',1),(30,'2022_01_06_122743_create_invoice_receipt_payments_table',1),(31,'2022_01_06_122810_create_receipt_checks_table',1),(32,'2022_01_06_122831_create_receipt_bank_transfers_table',1),(33,'2022_01_16_144024_create_exchange_entries_table',1),(34,'2022_01_16_144323_create_exchange_entry_items_table',1),(35,'2022_01_16_144734_create_exchange_checks_table',1),(36,'2022_01_16_144745_create_exchange_transfers_table',1),(37,'2022_01_25_121949_create_general_banks_table',1),(38,'2022_01_26_072801_create_action_logs_table',1),(39,'2022_01_31_090358_create_converted_checks_table',1),(40,'2022_02_03_090823_create_account_banks_table',1),(41,'2022_03_16_082226_create_representatives_table',1),(42,'2022_03_17_084357_create_receipt_check_operations_table',1),(43,'2022_03_20_061729_create_exchange_check_operations_table',1),(44,'2022_03_27_061308_create_debit_notes_table',1),(45,'2022_03_27_062115_create_debit_note_items_table',1),(46,'2022_03_27_114253_create_credit_notes_table',1),(47,'2022_03_27_115437_create_credit_note_items_table',1),(48,'2022_04_07_072630_create_year_account_balances_table',1),(49,'2022_04_07_072631_create_year_receivable_account_balances_table',1),(50,'2022_04_14_070724_create_account_statement_items_table',1),(51,'2022_04_20_122948_create_entry_employee_notices_table',1),(52,'2022_04_24_072018_create_building_types',1),(53,'2022_04_24_072019_create_buildings_table',1),(54,'2022_04_25_083002_create_floors_table',1),(55,'2022_04_26_104459_create_shops_table',1),(56,'2022_04_26_104947_create_shop_merges_table',1),(57,'2022_04_26_104948_create_booths_table',1),(58,'2022_04_28_090445_create_contract_categories_table',1),(59,'2022_04_28_090446_create_rental_contracts_table',1),(60,'2022_04_28_103813_create_rental_contract_invoices_table',1),(61,'2022_05_25_130437_create_signatures_table',1),(62,'2022_06_02_130041_create_updated_shops_table',1),(63,'2022_06_20_121120_create_bond_attachments_table',1),(64,'2022_07_03_084831_create_merged_contracts_table',1),(65,'2022_08_07_071914_create_branch_types_table',1),(66,'2022_08_07_071915_create_branches_table',1),(67,'2022_08_07_074806_create_delivery_terms_table',1),(68,'2022_08_07_074807_create_payment_terms_table',1),(69,'2022_08_07_074808_create_categories_table',1),(70,'2022_08_07_130519_create_general_item_classifications_table',1),(71,'2022_08_07_130520_create_item_size_types_table',1),(72,'2022_08_07_130521_create_items_table',1),(73,'2022_08_08_070637_create_units_table',1),(74,'2022_08_08_070638_create_barcodes_table',1),(75,'2022_08_09_125356_create_category_connection_codes_table',1),(76,'2022_08_09_125414_create_account_category_table',1),(77,'2022_08_10_075041_create_branch_connection_codes_table',1),(78,'2022_08_10_075150_create_account_branch_table',1),(79,'2022_08_10_083139_create_branch_tax_table',1),(80,'2022_09_21_084011_create_receipt_ewallet_items_table',1),(81,'2022_09_21_105828_create_ewallet_accounts_table',1),(82,'2022_10_02_075733_create_yearly_contract_amounts_table',1),(83,'2022_10_09_095332_create_exchange_ewallet_items_table',1),(84,'2022_12_22_123807_barcode_price_types_table',1),(85,'2022_12_26_072021_create_barcode_branch_prices_table',1),(86,'2022_12_26_095905_create_item_manufacturing_recipes_table',1),(87,'2022_12_26_100053_create_manufacturing_recipe_ingredients_table',1),(88,'2022_12_28_122454_create_manufacturing_bonds_table',1),(89,'2022_12_28_124519_create_manufacturing_bond_items_table',1),(90,'2022_12_28_130024_create_out_sourced_employee_types_table',1),(91,'2022_12_28_130025_create_out_sourced_employees_table',1),(92,'2022_12_28_130534_create_manufacturing_bond_out_sourced_employee_table',1),(93,'2022_12_29_062109_create_barcode_branch_table',1),(94,'2022_12_29_134753_create_entry_bond_types_table',1),(95,'2022_12_29_134754_create_entry_bonds_table',1),(96,'2022_12_29_135436_create_entry_bond_items_table',1),(97,'2022_12_29_180550_create_out_bond_types_table',1),(98,'2022_12_29_180551_create_out_bonds_table',1),(99,'2022_12_29_181213_create_out_bond_items_table',1),(100,'2022_12_29_185724_create_entry_batches_table',1),(101,'2023_01_02_073557_create_entry_batch_out_bond_item_table',1),(102,'2023_01_03_074720_create_convert_bond_types_table',1),(103,'2023_01_03_074721_create_convert_bonds_table',1),(104,'2023_01_03_075122_create_convert_bond_items_table',1),(105,'2023_01_25_071553_create_chart_widgets_table',1),(106,'2023_01_25_072846_create_chart_widget_groups_table',1),(107,'2023_01_25_072847_create_chart_widget_group_items_table',1),(108,'2023_02_09_094822_create_rental_requests_table',1),(109,'2023_02_12_071425_create_rental_events_table',1),(110,'2023_02_12_123845_create_rental_tenant_actions_table',1),(111,'2023_02_21_122646_add_new_column_to_rental_contracts_table',1),(112,'2023_04_26_103752_create_purchase_commands_table',1),(113,'2023_04_26_103753_create_purchase_command_barcodes_table',1),(114,'2023_04_26_103832_create_purchase_orders_table',1),(115,'2023_04_27_123222_create_purchase_order_barcodes_table',1),(116,'2023_05_04_113222_create_purchase_invoices_table',1),(117,'2023_05_04_113234_create_purchase_invoice_barcodes_table',1),(118,'2023_05_04_113906_create_draft_purchase_order_meets_table',1),(119,'2023_05_08_090608_create_standard_purchase_invoice_expenses_table',1),(120,'2023_05_08_122020_create_purchase_invoice_expenses_table',1),(121,'2023_05_09_074843_create_returned_purchase_bond_types_table',1),(122,'2023_05_09_074844_create_returned_purchase_bonds_table',1),(123,'2023_05_10_065842_create_returned_purchase_bond_items_table',1),(124,'2023_05_11_084549_create_receivable_account_branches_table',1),(125,'2023_05_11_085000_create_drivers_table',1),(126,'2023_05_11_085001_create_sellers_table',1),(127,'2023_05_11_085004_create_sales_price_offers_table',1),(128,'2023_05_11_085005_create_sales_price_offer_items_table',1),(129,'2023_05_11_085008_create_sales_orders_table',1),(130,'2023_05_11_085009_create_sales_order_items_table',1),(131,'2023_05_11_085011_create_sales_invoices_table',1),(132,'2023_05_11_085854_create_sales_invoice_items_table',1),(133,'2023_05_11_131555_create_standard_sales_invoice_expenses_table',1),(134,'2023_05_14_063526_create_sales_invoice_expenses_table',1),(135,'2023_05_17_055140_create_returned_sales_bonds_table',1),(136,'2023_05_17_055201_create_returned_sales_bond_items_table',1),(137,'2023_06_11_123310_create_response_templates_table',1),(138,'2023_06_15_070021_create_stocktaking_bonds_table',1),(139,'2023_06_18_095837_create_stocktaking_bond_items_table',1),(140,'2023_07_12_131512_create_warehouses_signatures_table',1),(141,'2023_08_27_132410_create_rental_contract_initial_balances_table',1),(142,'2023_09_04_081832_create_automated_entries_table',1),(143,'2023_09_04_081909_create_automated_entry_items_table',1),(144,'2023_09_12_085333_create_sales_order_expenses_table',1),(145,'2023_09_14_072436_create_draft_sales_order_meets_table',1),(146,'2023_09_28_094337_create_pos_desktop_functions_table',1),(147,'2022_09_28_094340_create_pos_users_table',1),(148,'2023_09_28_094342_create_cash_devices_table',1),(149,'2023_09_28_094344_create_box_days_table',1),(150,'2023_09_28_094347_create_boxes_table',1),(151,'2023_09_28_094348_create_menus_table',1),(152,'2023_09_28_094350_create_box_day_entry_items_table',1),(153,'2023_09_28_105131_create_pos_sales_invoices_table',1),(154,'2023_09_28_105146_create_pos_sales_invoice_items_table',1),(155,'2023_09_28_105235_create_pos_returned_sales_bonds_table',1),(156,'2023_09_28_105240_create_pos_returned_sales_bond_items_table',1),(157,'2023_10_03_064511_create_barcode_menu_table',1),(158,'2023_10_08_101346_create_branch_item_table',1),(159,'2023_10_12_055857_create_pos_sales_invoice_payments_table',1),(160,'2023_10_16_082216_create_receivable_payment_method_accounts_table',1),(161,'2023_10_26_114142_create_pos_sections_table',1),(162,'2023_10_29_130308_create_exchange_bonds_table',1),(163,'2023_10_29_130314_create_exchange_bond_items_table',1),(164,'2023_10_31_103514_create_barcode_section_table',1),(165,'2023_11_01_130426_create_branch_menu_table',1),(166,'2023_11_07_105524_create_notifications_table',1),(167,'2023_11_09_065153_create_minus_entry_batches_table',1),(168,'2023_11_09_065153_create_minus_out_batches_table',1),(169,'2023_11_16_123158_create_pos_offers_table',1),(170,'2023_11_16_124007_create_pos_offer_items_table',1),(171,'2023_11_16_124909_create_pos_offer_barcodes_table',1),(172,'2023_11_27_103029_create_withdrawal_bonds_table',1),(173,'2023_12_05_084626_create_purchase_invoice_entries_table',1),(174,'2024_02_05_062129_create_item_dynamic_inputs_table',1),(175,'2024_02_06_114204_create_item_dynamic_input_values_table',1),(176,'2024_02_18_110654_create_print_bond_templates_table',1),(177,'2024_03_10_100057_create_deleted_item_log_actions_table',1),(178,'2024_04_16_100724_create_representatives_branches_table',1),(179,'2024_04_16_101036_create_representatives_receivables_table',1),(180,'2024_04_17_160705_create_representatives_mobile_sections_table',1),(181,'2024_04_17_160728_create_representatives_mobile_functions_table',1),(182,'2024_04_23_105903_create_cart_items_table',1),(183,'2024_05_05_103551_create_barcode_branch_locations_table',1),(184,'2024_06_09_201000_create_delivery_cars_table',1),(185,'2024_06_10_202057_create_shipment_bonds_table',1),(186,'2024_06_10_203402_create_shipment_bond_items_table',1),(187,'2024_11_20_165621_create_cost_increase_bonds_table',1),(188,'2024_11_21_102121_create_cost_increase_bonds_item_table',1),(189,'2024_11_25_112228_create_cost_decrease_bonds_table',1),(190,'2024_12_17_154700_create_cost_decrease_bond_items_table',1),(191,'2025_05_30_220315_create_returned_service_bonds_table',1),(192,'2025_05_31_220440_create_returned_service_bonds_items_table',1),(193,'2025_07_05_091505_create_aggregation_invoices_table',1),(194,'2025_07_05_091900_create_aggregation_invoice_items_table',1),(195,'2025_08_17_094659_create_returned_aggregations',1),(196,'2025_08_17_094744_create_returned_aggregation_items',1),(197,'2025_08_18_120848_create_aggregation_invoice_sales',1);

--
-- Table structure for table `minus_entry_batches`
--

CREATE TABLE `minus_entry_batches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `entry_bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entry_bond_id` bigint unsigned NOT NULL,
  `entry_bond_item_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `created_at` timestamp NOT NULL,
  PRIMARY KEY (`id`),
  KEY `minus_entry_batches_barcode_id_foreign` (`barcode_id`),
  KEY `minus_entry_batches_branch_id_foreign` (`branch_id`),
  CONSTRAINT `minus_entry_batches_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `minus_entry_batches_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `minus_entry_batches`
--


--
-- Table structure for table `minus_out_batches`
--

CREATE TABLE `minus_out_batches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `out_bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `out_bond_id` bigint unsigned NOT NULL,
  `out_bond_item_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `sales_price` double DEFAULT NULL,
  `created_at` timestamp NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `minus_out_batches`
--


--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_permissions`
--

INSERT INTO `model_has_permissions` VALUES (1,'App\\Models\\Employee',1),(2,'App\\Models\\Employee',1),(3,'App\\Models\\Employee',1),(4,'App\\Models\\Employee',1),(5,'App\\Models\\Employee',1),(6,'App\\Models\\Employee',1),(7,'App\\Models\\Employee',1),(8,'App\\Models\\Employee',1),(9,'App\\Models\\Employee',1),(10,'App\\Models\\Employee',1),(11,'App\\Models\\Employee',1),(12,'App\\Models\\Employee',1),(13,'App\\Models\\Employee',1),(14,'App\\Models\\Employee',1),(15,'App\\Models\\Employee',1),(16,'App\\Models\\Employee',1),(17,'App\\Models\\Employee',1),(18,'App\\Models\\Employee',1),(19,'App\\Models\\Employee',1),(20,'App\\Models\\Employee',1),(21,'App\\Models\\Employee',1),(22,'App\\Models\\Employee',1),(23,'App\\Models\\Employee',1),(24,'App\\Models\\Employee',1),(25,'App\\Models\\Employee',1),(26,'App\\Models\\Employee',1),(27,'App\\Models\\Employee',1),(28,'App\\Models\\Employee',1),(29,'App\\Models\\Employee',1),(30,'App\\Models\\Employee',1),(31,'App\\Models\\Employee',1),(32,'App\\Models\\Employee',1),(33,'App\\Models\\Employee',1),(34,'App\\Models\\Employee',1),(35,'App\\Models\\Employee',1),(36,'App\\Models\\Employee',1),(37,'App\\Models\\Employee',1),(38,'App\\Models\\Employee',1),(39,'App\\Models\\Employee',1),(40,'App\\Models\\Employee',1),(41,'App\\Models\\Employee',1),(42,'App\\Models\\Employee',1),(43,'App\\Models\\Employee',1),(44,'App\\Models\\Employee',1),(45,'App\\Models\\Employee',1),(46,'App\\Models\\Employee',1),(47,'App\\Models\\Employee',1),(48,'App\\Models\\Employee',1),(49,'App\\Models\\Employee',1),(50,'App\\Models\\Employee',1),(51,'App\\Models\\Employee',1),(52,'App\\Models\\Employee',1),(53,'App\\Models\\Employee',1),(54,'App\\Models\\Employee',1),(55,'App\\Models\\Employee',1),(56,'App\\Models\\Employee',1),(57,'App\\Models\\Employee',1),(58,'App\\Models\\Employee',1),(59,'App\\Models\\Employee',1),(60,'App\\Models\\Employee',1),(61,'App\\Models\\Employee',1),(62,'App\\Models\\Employee',1),(63,'App\\Models\\Employee',1),(64,'App\\Models\\Employee',1),(65,'App\\Models\\Employee',1),(66,'App\\Models\\Employee',1),(67,'App\\Models\\Employee',1),(68,'App\\Models\\Employee',1),(69,'App\\Models\\Employee',1),(70,'App\\Models\\Employee',1),(71,'App\\Models\\Employee',1),(72,'App\\Models\\Employee',1),(73,'App\\Models\\Employee',1),(74,'App\\Models\\Employee',1),(75,'App\\Models\\Employee',1),(76,'App\\Models\\Employee',1),(77,'App\\Models\\Employee',1),(78,'App\\Models\\Employee',1),(79,'App\\Models\\Employee',1),(80,'App\\Models\\Employee',1),(81,'App\\Models\\Employee',1),(82,'App\\Models\\Employee',1),(83,'App\\Models\\Employee',1),(84,'App\\Models\\Employee',1),(85,'App\\Models\\Employee',1),(86,'App\\Models\\Employee',1),(87,'App\\Models\\Employee',1),(88,'App\\Models\\Employee',1),(89,'App\\Models\\Employee',1),(90,'App\\Models\\Employee',1),(91,'App\\Models\\Employee',1),(92,'App\\Models\\Employee',1),(93,'App\\Models\\Employee',1),(94,'App\\Models\\Employee',1),(95,'App\\Models\\Employee',1),(96,'App\\Models\\Employee',1),(97,'App\\Models\\Employee',1),(98,'App\\Models\\Employee',1),(99,'App\\Models\\Employee',1),(100,'App\\Models\\Employee',1),(101,'App\\Models\\Employee',1),(102,'App\\Models\\Employee',1),(103,'App\\Models\\Employee',1),(104,'App\\Models\\Employee',1),(105,'App\\Models\\Employee',1),(106,'App\\Models\\Employee',1),(107,'App\\Models\\Employee',1),(108,'App\\Models\\Employee',1),(109,'App\\Models\\Employee',1),(110,'App\\Models\\Employee',1),(111,'App\\Models\\Employee',1),(112,'App\\Models\\Employee',1),(113,'App\\Models\\Employee',1),(114,'App\\Models\\Employee',1),(115,'App\\Models\\Employee',1),(116,'App\\Models\\Employee',1),(117,'App\\Models\\Employee',1),(118,'App\\Models\\Employee',1),(119,'App\\Models\\Employee',1),(120,'App\\Models\\Employee',1),(121,'App\\Models\\Employee',1),(122,'App\\Models\\Employee',1),(123,'App\\Models\\Employee',1),(124,'App\\Models\\Employee',1),(125,'App\\Models\\Employee',1),(126,'App\\Models\\Employee',1),(127,'App\\Models\\Employee',1),(128,'App\\Models\\Employee',1),(129,'App\\Models\\Employee',1),(130,'App\\Models\\Employee',1),(131,'App\\Models\\Employee',1),(132,'App\\Models\\Employee',1),(133,'App\\Models\\Employee',1),(134,'App\\Models\\Employee',1),(135,'App\\Models\\Employee',1),(136,'App\\Models\\Employee',1),(137,'App\\Models\\Employee',1),(138,'App\\Models\\Employee',1),(139,'App\\Models\\Employee',1),(140,'App\\Models\\Employee',1),(141,'App\\Models\\Employee',1),(142,'App\\Models\\Employee',1),(143,'App\\Models\\Employee',1),(144,'App\\Models\\Employee',1),(145,'App\\Models\\Employee',1),(146,'App\\Models\\Employee',1),(147,'App\\Models\\Employee',1),(148,'App\\Models\\Employee',1),(149,'App\\Models\\Employee',1),(150,'App\\Models\\Employee',1),(151,'App\\Models\\Employee',1),(152,'App\\Models\\Employee',1),(153,'App\\Models\\Employee',1),(154,'App\\Models\\Employee',1),(155,'App\\Models\\Employee',1),(156,'App\\Models\\Employee',1),(157,'App\\Models\\Employee',1),(158,'App\\Models\\Employee',1),(159,'App\\Models\\Employee',1),(160,'App\\Models\\Employee',1),(161,'App\\Models\\Employee',1),(162,'App\\Models\\Employee',1),(163,'App\\Models\\Employee',1),(164,'App\\Models\\Employee',1),(165,'App\\Models\\Employee',1),(166,'App\\Models\\Employee',1),(167,'App\\Models\\Employee',1),(168,'App\\Models\\Employee',1),(169,'App\\Models\\Employee',1),(170,'App\\Models\\Employee',1),(171,'App\\Models\\Employee',1),(172,'App\\Models\\Employee',1),(173,'App\\Models\\Employee',1),(174,'App\\Models\\Employee',1),(175,'App\\Models\\Employee',1),(176,'App\\Models\\Employee',1),(177,'App\\Models\\Employee',1),(178,'App\\Models\\Employee',1),(179,'App\\Models\\Employee',1),(180,'App\\Models\\Employee',1),(181,'App\\Models\\Employee',1),(182,'App\\Models\\Employee',1),(183,'App\\Models\\Employee',1),(184,'App\\Models\\Employee',1),(185,'App\\Models\\Employee',1),(186,'App\\Models\\Employee',1),(187,'App\\Models\\Employee',1),(188,'App\\Models\\Employee',1),(189,'App\\Models\\Employee',1),(190,'App\\Models\\Employee',1),(191,'App\\Models\\Employee',1),(192,'App\\Models\\Employee',1),(193,'App\\Models\\Employee',1),(194,'App\\Models\\Employee',1),(195,'App\\Models\\Employee',1),(196,'App\\Models\\Employee',1),(197,'App\\Models\\Employee',1),(198,'App\\Models\\Employee',1),(199,'App\\Models\\Employee',1),(200,'App\\Models\\Employee',1),(201,'App\\Models\\Employee',1),(202,'App\\Models\\Employee',1),(203,'App\\Models\\Employee',1),(204,'App\\Models\\Employee',1),(205,'App\\Models\\Employee',1),(206,'App\\Models\\Employee',1),(207,'App\\Models\\Employee',1),(208,'App\\Models\\Employee',1),(209,'App\\Models\\Employee',1),(210,'App\\Models\\Employee',1),(211,'App\\Models\\Employee',1),(212,'App\\Models\\Employee',1),(213,'App\\Models\\Employee',1),(214,'App\\Models\\Employee',1),(215,'App\\Models\\Employee',1),(216,'App\\Models\\Employee',1),(217,'App\\Models\\Employee',1),(218,'App\\Models\\Employee',1),(219,'App\\Models\\Employee',1),(220,'App\\Models\\Employee',1),(221,'App\\Models\\Employee',1),(222,'App\\Models\\Employee',1),(223,'App\\Models\\Employee',1),(224,'App\\Models\\Employee',1),(225,'App\\Models\\Employee',1),(226,'App\\Models\\Employee',1),(227,'App\\Models\\Employee',1),(228,'App\\Models\\Employee',1),(229,'App\\Models\\Employee',1),(230,'App\\Models\\Employee',1),(231,'App\\Models\\Employee',1),(232,'App\\Models\\Employee',1),(233,'App\\Models\\Employee',1),(234,'App\\Models\\Employee',1),(235,'App\\Models\\Employee',1),(236,'App\\Models\\Employee',1),(237,'App\\Models\\Employee',1),(238,'App\\Models\\Employee',1),(239,'App\\Models\\Employee',1),(240,'App\\Models\\Employee',1),(241,'App\\Models\\Employee',1),(242,'App\\Models\\Employee',1),(243,'App\\Models\\Employee',1),(244,'App\\Models\\Employee',1),(245,'App\\Models\\Employee',1),(246,'App\\Models\\Employee',1),(247,'App\\Models\\Employee',1),(248,'App\\Models\\Employee',1),(249,'App\\Models\\Employee',1),(250,'App\\Models\\Employee',1),(251,'App\\Models\\Employee',1),(252,'App\\Models\\Employee',1),(253,'App\\Models\\Employee',1),(254,'App\\Models\\Employee',1),(255,'App\\Models\\Employee',1),(256,'App\\Models\\Employee',1),(257,'App\\Models\\Employee',1),(258,'App\\Models\\Employee',1),(259,'App\\Models\\Employee',1),(260,'App\\Models\\Employee',1),(261,'App\\Models\\Employee',1),(262,'App\\Models\\Employee',1),(263,'App\\Models\\Employee',1),(264,'App\\Models\\Employee',1),(265,'App\\Models\\Employee',1),(266,'App\\Models\\Employee',1),(267,'App\\Models\\Employee',1),(268,'App\\Models\\Employee',1),(269,'App\\Models\\Employee',1),(270,'App\\Models\\Employee',1),(271,'App\\Models\\Employee',1),(272,'App\\Models\\Employee',1),(273,'App\\Models\\Employee',1),(274,'App\\Models\\Employee',1),(275,'App\\Models\\Employee',1),(276,'App\\Models\\Employee',1),(277,'App\\Models\\Employee',1),(278,'App\\Models\\Employee',1),(279,'App\\Models\\Employee',1),(280,'App\\Models\\Employee',1),(281,'App\\Models\\Employee',1),(282,'App\\Models\\Employee',1),(283,'App\\Models\\Employee',1),(284,'App\\Models\\Employee',1),(285,'App\\Models\\Employee',1),(286,'App\\Models\\Employee',1),(287,'App\\Models\\Employee',1),(288,'App\\Models\\Employee',1),(289,'App\\Models\\Employee',1),(290,'App\\Models\\Employee',1),(291,'App\\Models\\Employee',1),(292,'App\\Models\\Employee',1),(293,'App\\Models\\Employee',1),(294,'App\\Models\\Employee',1),(295,'App\\Models\\Employee',1),(296,'App\\Models\\Employee',1),(297,'App\\Models\\Employee',1),(298,'App\\Models\\Employee',1),(299,'App\\Models\\Employee',1),(300,'App\\Models\\Employee',1),(301,'App\\Models\\Employee',1),(302,'App\\Models\\Employee',1),(303,'App\\Models\\Employee',1),(304,'App\\Models\\Employee',1),(305,'App\\Models\\Employee',1),(306,'App\\Models\\Employee',1),(307,'App\\Models\\Employee',1),(308,'App\\Models\\Employee',1),(309,'App\\Models\\Employee',1),(310,'App\\Models\\Employee',1),(311,'App\\Models\\Employee',1),(312,'App\\Models\\Employee',1),(313,'App\\Models\\Employee',1),(314,'App\\Models\\Employee',1),(315,'App\\Models\\Employee',1),(316,'App\\Models\\Employee',1),(317,'App\\Models\\Employee',1),(318,'App\\Models\\Employee',1),(319,'App\\Models\\Employee',1),(320,'App\\Models\\Employee',1),(321,'App\\Models\\Employee',1),(322,'App\\Models\\Employee',1),(323,'App\\Models\\Employee',1),(324,'App\\Models\\Employee',1),(325,'App\\Models\\Employee',1),(326,'App\\Models\\Employee',1),(327,'App\\Models\\Employee',1),(328,'App\\Models\\Employee',1),(329,'App\\Models\\Employee',1),(330,'App\\Models\\Employee',1),(331,'App\\Models\\Employee',1),(332,'App\\Models\\Employee',1),(333,'App\\Models\\Employee',1),(334,'App\\Models\\Employee',1),(335,'App\\Models\\Employee',1),(336,'App\\Models\\Employee',1),(337,'App\\Models\\Employee',1),(338,'App\\Models\\Employee',1),(339,'App\\Models\\Employee',1),(340,'App\\Models\\Employee',1),(341,'App\\Models\\Employee',1),(342,'App\\Models\\Employee',1),(343,'App\\Models\\Employee',1),(344,'App\\Models\\Employee',1),(345,'App\\Models\\Employee',1),(346,'App\\Models\\Employee',1),(347,'App\\Models\\Employee',1),(348,'App\\Models\\Employee',1),(349,'App\\Models\\Employee',1),(350,'App\\Models\\Employee',1),(351,'App\\Models\\Employee',1),(352,'App\\Models\\Employee',1),(353,'App\\Models\\Employee',1),(354,'App\\Models\\Employee',1),(355,'App\\Models\\Employee',1),(356,'App\\Models\\Employee',1),(357,'App\\Models\\Employee',1),(358,'App\\Models\\Employee',1),(359,'App\\Models\\Employee',1),(360,'App\\Models\\Employee',1),(361,'App\\Models\\Employee',1),(362,'App\\Models\\Employee',1),(363,'App\\Models\\Employee',1),(364,'App\\Models\\Employee',1),(365,'App\\Models\\Employee',1),(366,'App\\Models\\Employee',1),(367,'App\\Models\\Employee',1),(368,'App\\Models\\Employee',1),(369,'App\\Models\\Employee',1),(370,'App\\Models\\Employee',1),(371,'App\\Models\\Employee',1),(372,'App\\Models\\Employee',1),(373,'App\\Models\\Employee',1),(374,'App\\Models\\Employee',1),(375,'App\\Models\\Employee',1),(376,'App\\Models\\Employee',1),(377,'App\\Models\\Employee',1),(378,'App\\Models\\Employee',1),(379,'App\\Models\\Employee',1),(380,'App\\Models\\Employee',1),(381,'App\\Models\\Employee',1),(382,'App\\Models\\Employee',1),(383,'App\\Models\\Employee',1),(384,'App\\Models\\Employee',1),(385,'App\\Models\\Employee',1),(386,'App\\Models\\Employee',1),(387,'App\\Models\\Employee',1),(388,'App\\Models\\Employee',1),(389,'App\\Models\\Employee',1),(390,'App\\Models\\Employee',1),(391,'App\\Models\\Employee',1),(392,'App\\Models\\Employee',1),(393,'App\\Models\\Employee',1),(394,'App\\Models\\Employee',1),(395,'App\\Models\\Employee',1),(396,'App\\Models\\Employee',1),(397,'App\\Models\\Employee',1),(398,'App\\Models\\Employee',1),(399,'App\\Models\\Employee',1),(400,'App\\Models\\Employee',1),(401,'App\\Models\\Employee',1),(402,'App\\Models\\Employee',1),(403,'App\\Models\\Employee',1),(404,'App\\Models\\Employee',1),(405,'App\\Models\\Employee',1),(406,'App\\Models\\Employee',1),(407,'App\\Models\\Employee',1),(408,'App\\Models\\Employee',1),(409,'App\\Models\\Employee',1),(410,'App\\Models\\Employee',1),(411,'App\\Models\\Employee',1),(412,'App\\Models\\Employee',1),(413,'App\\Models\\Employee',1),(414,'App\\Models\\Employee',1),(415,'App\\Models\\Employee',1),(416,'App\\Models\\Employee',1),(417,'App\\Models\\Employee',1),(418,'App\\Models\\Employee',1),(419,'App\\Models\\Employee',1),(420,'App\\Models\\Employee',1),(421,'App\\Models\\Employee',1),(422,'App\\Models\\Employee',1),(423,'App\\Models\\Employee',1),(424,'App\\Models\\Employee',1),(425,'App\\Models\\Employee',1),(426,'App\\Models\\Employee',1),(427,'App\\Models\\Employee',1),(428,'App\\Models\\Employee',1),(429,'App\\Models\\Employee',1),(430,'App\\Models\\Employee',1),(431,'App\\Models\\Employee',1),(432,'App\\Models\\Employee',1),(433,'App\\Models\\Employee',1),(434,'App\\Models\\Employee',1),(435,'App\\Models\\Employee',1),(436,'App\\Models\\Employee',1),(437,'App\\Models\\Employee',1),(438,'App\\Models\\Employee',1),(439,'App\\Models\\Employee',1),(440,'App\\Models\\Employee',1),(441,'App\\Models\\Employee',1),(442,'App\\Models\\Employee',1),(443,'App\\Models\\Employee',1),(444,'App\\Models\\Employee',1),(445,'App\\Models\\Employee',1),(446,'App\\Models\\Employee',1),(447,'App\\Models\\Employee',1),(448,'App\\Models\\Employee',1),(449,'App\\Models\\Employee',1),(450,'App\\Models\\Employee',1),(451,'App\\Models\\Employee',1),(452,'App\\Models\\Employee',1),(453,'App\\Models\\Employee',1),(454,'App\\Models\\Employee',1),(455,'App\\Models\\Employee',1),(456,'App\\Models\\Employee',1),(457,'App\\Models\\Employee',1),(458,'App\\Models\\Employee',1),(459,'App\\Models\\Employee',1),(460,'App\\Models\\Employee',1),(461,'App\\Models\\Employee',1),(462,'App\\Models\\Employee',1),(463,'App\\Models\\Employee',1),(464,'App\\Models\\Employee',1),(465,'App\\Models\\Employee',1),(466,'App\\Models\\Employee',1),(467,'App\\Models\\Employee',1),(468,'App\\Models\\Employee',1),(469,'App\\Models\\Employee',1),(470,'App\\Models\\Employee',1),(471,'App\\Models\\Employee',1),(472,'App\\Models\\Employee',1),(473,'App\\Models\\Employee',1),(474,'App\\Models\\Employee',1),(475,'App\\Models\\Employee',1),(476,'App\\Models\\Employee',1),(477,'App\\Models\\Employee',1),(478,'App\\Models\\Employee',1),(479,'App\\Models\\Employee',1),(480,'App\\Models\\Employee',1),(481,'App\\Models\\Employee',1),(482,'App\\Models\\Employee',1),(483,'App\\Models\\Employee',1),(484,'App\\Models\\Employee',1),(485,'App\\Models\\Employee',1),(486,'App\\Models\\Employee',1),(487,'App\\Models\\Employee',1),(488,'App\\Models\\Employee',1),(489,'App\\Models\\Employee',1),(490,'App\\Models\\Employee',1),(491,'App\\Models\\Employee',1),(492,'App\\Models\\Employee',1),(493,'App\\Models\\Employee',1),(494,'App\\Models\\Employee',1),(495,'App\\Models\\Employee',1),(496,'App\\Models\\Employee',1),(497,'App\\Models\\Employee',1),(498,'App\\Models\\Employee',1),(499,'App\\Models\\Employee',1),(500,'App\\Models\\Employee',1),(501,'App\\Models\\Employee',1),(502,'App\\Models\\Employee',1),(503,'App\\Models\\Employee',1),(504,'App\\Models\\Employee',1),(505,'App\\Models\\Employee',1),(506,'App\\Models\\Employee',1),(507,'App\\Models\\Employee',1),(508,'App\\Models\\Employee',1),(509,'App\\Models\\Employee',1),(510,'App\\Models\\Employee',1),(511,'App\\Models\\Employee',1),(512,'App\\Models\\Employee',1),(513,'App\\Models\\Employee',1),(514,'App\\Models\\Employee',1),(515,'App\\Models\\Employee',1),(516,'App\\Models\\Employee',1),(517,'App\\Models\\Employee',1),(518,'App\\Models\\Employee',1),(519,'App\\Models\\Employee',1),(520,'App\\Models\\Employee',1),(521,'App\\Models\\Employee',1),(522,'App\\Models\\Employee',1),(523,'App\\Models\\Employee',1),(524,'App\\Models\\Employee',1),(525,'App\\Models\\Employee',1),(526,'App\\Models\\Employee',1),(527,'App\\Models\\Employee',1),(528,'App\\Models\\Employee',1),(529,'App\\Models\\Employee',1),(530,'App\\Models\\Employee',1),(531,'App\\Models\\Employee',1),(532,'App\\Models\\Employee',1),(533,'App\\Models\\Employee',1),(534,'App\\Models\\Employee',1),(535,'App\\Models\\Employee',1),(536,'App\\Models\\Employee',1),(537,'App\\Models\\Employee',1),(538,'App\\Models\\Employee',1),(539,'App\\Models\\Employee',1),(540,'App\\Models\\Employee',1),(541,'App\\Models\\Employee',1),(542,'App\\Models\\Employee',1),(543,'App\\Models\\Employee',1),(544,'App\\Models\\Employee',1),(545,'App\\Models\\Employee',1),(546,'App\\Models\\Employee',1),(547,'App\\Models\\Employee',1),(583,'App\\Models\\Employee',1),(584,'App\\Models\\Employee',1),(564,'App\\Models\\Pos\\PosUser',1),(565,'App\\Models\\Pos\\PosUser',1),(566,'App\\Models\\Pos\\PosUser',1),(567,'App\\Models\\Pos\\PosUser',1),(568,'App\\Models\\Pos\\PosUser',1),(569,'App\\Models\\Pos\\PosUser',1),(570,'App\\Models\\Pos\\PosUser',1),(571,'App\\Models\\Pos\\PosUser',1),(572,'App\\Models\\Pos\\PosUser',1),(573,'App\\Models\\Pos\\PosUser',1),(574,'App\\Models\\Pos\\PosUser',1),(575,'App\\Models\\Pos\\PosUser',1),(576,'App\\Models\\Pos\\PosUser',1),(577,'App\\Models\\Pos\\PosUser',1),(578,'App\\Models\\Pos\\PosUser',1),(579,'App\\Models\\Pos\\PosUser',1),(580,'App\\Models\\Pos\\PosUser',1),(581,'App\\Models\\Pos\\PosUser',1),(582,'App\\Models\\Pos\\PosUser',1),(585,'App\\Models\\Pos\\PosUser',1);

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint unsigned NOT NULL,
  `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--


--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notifiable_id` bigint unsigned NOT NULL,
  `data` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notifications`
--


--
-- Table structure for table `out_bond_items`
--

CREATE TABLE `out_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL DEFAULT '1',
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `selected_batches_ids` json DEFAULT NULL,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `print_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `out_bond_items_bond_id_foreign` (`bond_id`),
  KEY `out_bond_items_barcode_id_foreign` (`barcode_id`),
  KEY `out_bond_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `out_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `out_bond_items_bond_id_foreign` FOREIGN KEY (`bond_id`) REFERENCES `out_bonds` (`id`),
  CONSTRAINT `out_bond_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `out_bond_items`
--


--
-- Table structure for table `out_bonds`
--

CREATE TABLE `out_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `type_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `is_fully_costed` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `out_bonds_employee_id_foreign` (`employee_id`),
  KEY `out_bonds_type_id_foreign` (`type_id`),
  KEY `out_bonds_branch_id_foreign` (`branch_id`),
  KEY `out_bonds_client_id_foreign` (`client_id`),
  CONSTRAINT `out_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `out_bonds_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `out_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `out_bonds_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `out_bond_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `out_bonds`
--


--
-- Table structure for table `out_sourced_employee_types`
--

CREATE TABLE `out_sourced_employee_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `out_sourced_employee_types`
--


--
-- Table structure for table `out_sourced_employees`
--

CREATE TABLE `out_sourced_employees` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type_id` bigint unsigned NOT NULL,
  `hour_cost` double NOT NULL,
  `active_status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `out_sourced_employees_type_id_foreign` (`type_id`),
  CONSTRAINT `out_sourced_employees_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `out_sourced_employee_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `out_sourced_employees`
--


--
-- Table structure for table `payment_terms`
--

CREATE TABLE `payment_terms` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_terms`
--


--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=586 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'accounting','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(2,'accounting-accountsTree','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(3,'accounting-accountsTree-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(4,'accounting-accountsTree-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(5,'accounting-accountsTree-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(6,'accounting-accountsTree-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(7,'accounting-initialBalances','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(8,'accounting-initialBalances-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(9,'accounting-initialBalances-initialize','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(10,'accounting-costCenterTree','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(11,'accounting-costCenterTree-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(12,'accounting-costCenterTree-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(13,'accounting-costCenterTree-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(14,'accounting-bondsAuditing','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(15,'accounting-bondsAuditing-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(16,'accounting-bondsAuditing-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(17,'accounting-bondsAuditing-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(18,'accounting-bondsAuditing-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(19,'accounting-entries','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(20,'accounting-entries-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(21,'accounting-entries-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(22,'accounting-entries-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(23,'accounting-entries-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(24,'accounting-entries-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(25,'accounting-entries-clone','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(26,'accounting-entries-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(27,'accounting-entries-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(28,'accounting-entries-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(29,'accounting-receipts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(30,'accounting-receipts-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(31,'accounting-receipts-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(32,'accounting-receipts-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(33,'accounting-receipts-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(34,'accounting-receipts-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(35,'accounting-receipts-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(36,'accounting-receipts-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(37,'accounting-receipts-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(38,'accounting-exchanges','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(39,'accounting-exchanges-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(40,'accounting-exchanges-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(41,'accounting-exchanges-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(42,'accounting-exchanges-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(43,'accounting-exchanges-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(44,'accounting-exchanges-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(45,'accounting-exchanges-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(46,'accounting-exchanges-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(47,'accounting-servicesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(48,'accounting-servicesInvoices-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(49,'accounting-servicesInvoices-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(50,'accounting-servicesInvoices-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(51,'accounting-servicesInvoices-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(52,'accounting-servicesInvoices-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(53,'accounting-servicesInvoices-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(54,'accounting-servicesInvoices-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(55,'accounting-servicesInvoices-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(56,'accounting-returnedServicesBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(57,'accounting-returnedServicesBonds-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(58,'accounting-returnedServicesBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(59,'accounting-returnedServicesBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(60,'accounting-returnedServicesBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(61,'accounting-returnedServicesBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(62,'accounting-returnedServicesBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(63,'accounting-returnedServicesBonds-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(64,'accounting-returnedServicesBonds-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(65,'accounting-debitNotes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(66,'accounting-debitNotes-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(67,'accounting-debitNotes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(68,'accounting-debitNotes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(69,'accounting-debitNotes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(70,'accounting-debitNotes-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(71,'accounting-debitNotes-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(72,'accounting-debitNotes-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(73,'accounting-debitNotes-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(74,'accounting-creditNotes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(75,'accounting-creditNotes-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(76,'accounting-creditNotes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(77,'accounting-creditNotes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(78,'accounting-creditNotes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(79,'accounting-creditNotes-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(80,'accounting-creditNotes-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(81,'accounting-creditNotes-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(82,'accounting-creditNotes-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(83,'accounting-automatedEntries','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(84,'accounting-automatedEntries-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(85,'accounting-receiptChecksKeeper','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(86,'accounting-receiptChecksKeeper-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(87,'accounting-receiptChecksKeeper-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(88,'accounting-receiptChecksKeeper-change','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(89,'accounting-receiptChecksKeeper-return','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(90,'accounting-receiptChecksKeeper-convert','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(91,'accounting-receiptChecksKeeper-unconvert','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(92,'accounting-exchangeChecksKeeper','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(93,'accounting-exchangeChecksKeeper-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(94,'accounting-exchangeChecksKeeper-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(95,'accounting-exchangeChecksKeeper-change','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(96,'accounting-exchangeChecksKeeper-return','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(97,'accounting-checks','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(98,'accounting-checks-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(99,'accounting-checks-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(100,'accounting-checks-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(101,'accounting-reports','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(102,'accounting-reports-incomeList','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(103,'accounting-reports-monthlyAccountBalance','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(104,'accounting-reports-outlaysAnalysis','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(105,'accounting-reports-totalAccountBalance','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(106,'accounting-reports-trialBalance','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(107,'accounting-reports-costCentersStatement','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(108,'accounting-reports-detailedCostCenterStatement','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(109,'receivable','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(110,'receivable-receivableTypes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(111,'receivable-receivableTypes-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(112,'receivable-receivableTypes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(113,'receivable-receivableTypes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(114,'receivable-receivableTypes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(115,'receivable-receivableAccounts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(116,'receivable-receivableAccounts-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(117,'receivable-receivableAccounts-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(118,'receivable-receivableAccounts-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(119,'receivable-receivableAccounts-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(120,'receivable-reports','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(121,'receivable-reports-detailedStatement','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(122,'receivable-reports-receivableAccountAging','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(123,'warehouses','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(124,'warehouses-branches','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(125,'warehouses-branches-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(126,'warehouses-branches-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(127,'warehouses-branches-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(128,'warehouses-categories','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(129,'warehouses-categories-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(130,'warehouses-categories-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(131,'warehouses-categories-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(132,'warehouses-items','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(133,'warehouses-items-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(134,'warehouses-items-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(135,'warehouses-items-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(136,'warehouses-items-barcodeOverview','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(137,'warehouses-entryBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(138,'warehouses-entryBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(139,'warehouses-entryBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(140,'warehouses-entryBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(141,'warehouses-entryBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(142,'warehouses-entryBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(143,'warehouses-outBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(144,'warehouses-outBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(145,'warehouses-outBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(146,'warehouses-outBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(147,'warehouses-outBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(148,'warehouses-outBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(149,'warehouses-convertBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(150,'warehouses-convertBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(151,'warehouses-convertBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(152,'warehouses-convertBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(153,'warehouses-convertBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(154,'warehouses-convertBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(155,'warehouses-convertBonds-showCost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(156,'warehouses-convertBonds-showSalesPrice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(157,'warehouses-manufacturingBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(158,'warehouses-manufacturingBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(159,'warehouses-manufacturingBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(160,'warehouses-manufacturingBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(161,'warehouses-manufacturingBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(162,'warehouses-manufacturingBonds-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(163,'warehouses-purchaseCommands','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(164,'warehouses-purchaseCommands-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(165,'warehouses-purchaseCommands-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(166,'warehouses-purchaseCommands-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(167,'warehouses-purchaseCommands-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(168,'warehouses-purchaseOrders','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(169,'warehouses-purchaseOrders-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(170,'warehouses-purchaseOrders-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(171,'warehouses-purchaseOrders-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(172,'warehouses-purchaseOrders-meet','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(173,'warehouses-purchaseOrders-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(174,'warehouses-purchaseInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(175,'warehouses-purchaseInvoices-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(176,'warehouses-purchaseInvoices-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(177,'warehouses-purchaseInvoices-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(178,'warehouses-purchaseInvoices-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(179,'warehouses-purchaseInvoices-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(180,'warehouses-returnedPurchaseBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(181,'warehouses-returnedPurchaseBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(182,'warehouses-returnedPurchaseBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(183,'warehouses-returnedPurchaseBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(184,'warehouses-returnedPurchaseBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(185,'warehouses-returnedPurchaseBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(186,'warehouses-salesPriceOffers','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(187,'warehouses-salesPriceOffers-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(188,'warehouses-salesPriceOffers-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(189,'warehouses-salesPriceOffers-copy','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(190,'warehouses-salesPriceOffers-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(191,'warehouses-salesPriceOffers-changeStatus','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(192,'warehouses-salesPriceOffers-showSalesPrice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(193,'warehouses-salesPriceOffers-showProfitRatio','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(194,'warehouses-salesPriceOffers-editCashPaymentWay','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(195,'warehouses-salesPriceOffers-editClientName','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(196,'warehouses-salesOrders','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(197,'warehouses-salesOrders-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(198,'warehouses-salesOrders-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(199,'warehouses-salesOrders-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(200,'warehouses-salesOrders-meet','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(201,'warehouses-salesOrders-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(202,'warehouses-salesOrders-editClientName','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(203,'warehouses-salesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(204,'warehouses-salesInvoices-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(205,'warehouses-salesInvoices-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(206,'warehouses-salesInvoices-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(207,'warehouses-salesInvoices-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(208,'warehouses-salesInvoices-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(209,'warehouses-salesInvoices-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(210,'warehouses-salesInvoices-audit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(211,'warehouses-salesInvoices-unaudit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(212,'warehouses-salesInvoices-postUnauditInvoice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(213,'warehouses-salesInvoices-allowFutureDate','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(214,'warehouses-salesInvoices-changeBranch','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(215,'warehouses-salesInvoices-saleByLowerPriceOfCost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(216,'warehouses-salesInvoices-showProfitRatio','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(217,'warehouses-salesInvoices-showCost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(218,'warehouses-salesInvoices-showBonus','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(219,'warehouses-salesInvoices-showOriginalPrice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(220,'warehouses-salesInvoices-showSalesPrice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(221,'warehouses-salesInvoices-editPrice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(222,'warehouses-salesInvoices-editBonus','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(223,'warehouses-salesInvoices-editClientType','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(224,'warehouses-salesInvoices-editClient','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(225,'warehouses-salesInvoices-editCashPaymentWay','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(226,'warehouses-salesInvoices-addAttachments','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(227,'warehouses-salesInvoices-showAttachments','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(228,'warehouses-salesInvoices-deleteAttachments','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(229,'warehouses-salesInvoices-editClientName','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(230,'warehouses-returnedSalesBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(231,'warehouses-returnedSalesBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(232,'warehouses-returnedSalesBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(233,'warehouses-returnedSalesBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(234,'warehouses-returnedSalesBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(235,'warehouses-returnedSalesBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(236,'warehouses-productionRequest','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(237,'warehouses-productionCommand','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(238,'warehouses-stocktakingBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(239,'warehouses-stocktakingBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(240,'warehouses-stocktakingBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(241,'warehouses-stocktakingBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(242,'warehouses-stocktakingBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(243,'warehouses-stocktakingBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(244,'warehouses-costIncreaseBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(245,'warehouses-costIncreaseBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(246,'warehouses-costIncreaseBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(247,'warehouses-costIncreaseBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(248,'warehouses-costIncreaseBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(249,'warehouses-costIncreaseBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(250,'warehouses-costDecreaseBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(251,'warehouses-costDecreaseBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(252,'warehouses-costDecreaseBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(253,'warehouses-costDecreaseBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(254,'warehouses-costDecreaseBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(255,'warehouses-costDecreaseBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(256,'warehouses-reports','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(257,'warehouses-reports-warehouseStocktaking','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(258,'warehouses-reports-salesAndProfit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(259,'warehouses-reports-salesTax','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(260,'warehouses-reports-purchasesTax','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(261,'warehouses-reports-goodsSettlementStatement','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(262,'warehouses-reports-detailedItems','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(263,'warehouses-reports-minusSales','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(264,'warehouses-reports-generalSalesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(265,'warehouses-reports-generalPurchaseInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(266,'rentals','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(267,'rentals-buildings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(268,'rentals-buildings-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(269,'rentals-buildings-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(270,'rentals-buildings-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(271,'rentals-buildings-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(272,'rentals-floors','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(273,'rentals-floors-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(274,'rentals-floors-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(275,'rentals-floors-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(276,'rentals-floors-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(277,'rentals-shops','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(278,'rentals-shops-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(279,'rentals-shops-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(280,'rentals-shops-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(281,'rentals-shops-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(282,'rentals-shops-merge','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(283,'rentals-booths','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(284,'rentals-booths-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(285,'rentals-booths-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(286,'rentals-booths-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(287,'rentals-booths-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(288,'rentals-contracts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(289,'rentals-contracts-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(290,'rentals-contracts-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(291,'rentals-contracts-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(292,'rentals-contracts-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(293,'rentals-contracts-restore','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(294,'rentals-contracts-terminate','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(295,'rentals-contracts-merge','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(296,'rentals-contracts-renew','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(297,'rentals-contracts-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(298,'rentals-contractInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(299,'rentals-contractInvoices-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(300,'rentals-contractInvoices-export','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(301,'rentals-contractInvoices-cancelExport','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(302,'rentals-contractInvoices-monthlyDistribute','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(303,'rentals-tenantsActions','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(304,'rentals-tenantsActions-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(305,'rentals-tenantsActions-changeStatus','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(306,'rentals-rentalRequests','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(307,'rentals-rentalRequests-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(308,'rentals-tenantsEvents','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(309,'rentals-tenantsEvents-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(310,'rentals-tenantsEvents-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(311,'rentals-tenantsEvents-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(312,'rentals-tenantsEvents-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(313,'rentals-receipts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(314,'rentals-receipts-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(315,'rentals-receipts-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(316,'rentals-receipts-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(317,'rentals-receipts-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(318,'rentals-receipts-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(319,'rentals-receipts-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(320,'rentals-debitNotes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(321,'rentals-debitNotes-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(322,'rentals-debitNotes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(323,'rentals-debitNotes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(324,'rentals-debitNotes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(325,'rentals-debitNotes-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(326,'rentals-debitNotes-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(327,'rentals-creditNotes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(328,'rentals-creditNotes-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(329,'rentals-creditNotes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(330,'rentals-creditNotes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(331,'rentals-creditNotes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(332,'rentals-creditNotes-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(333,'rentals-creditNotes-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(334,'rentals-reports','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(335,'rentals-reports-monthlyRevenues','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(336,'pos','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(337,'pos-branches','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(338,'pos-branches-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(339,'pos-branches-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(340,'pos-branches-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(341,'pos-categories','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(342,'pos-categories-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(343,'pos-categories-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(344,'pos-categories-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(345,'pos-menus','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(346,'pos-menus-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(347,'pos-menus-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(348,'pos-menus-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(349,'pos-items','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(350,'pos-items-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(351,'pos-items-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(352,'pos-items-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(353,'pos-salesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(354,'pos-salesInvoices-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(355,'pos-salesInvoices-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(356,'pos-salesInvoices-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(357,'pos-returnedSalesBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(358,'pos-returnedSalesBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(359,'pos-returnedSalesBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(360,'pos-returnedSalesBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(361,'pos-exchangeBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(362,'pos-exchangeBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(363,'pos-exchangeBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(364,'pos-exchangeBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(365,'pos-offers','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(366,'pos-offers-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(367,'pos-offers-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(368,'pos-offers-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(369,'pos-sections','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(370,'pos-sections-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(371,'pos-sections-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(372,'pos-sections-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(373,'pos-sections-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(374,'pos-sections-connectPrinter','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(375,'pos-daysSales','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(376,'pos-daysSales-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(377,'pos-daysSales-showDetails','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(378,'pos-daysSales-postToFotara','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(379,'pos-daysSales-close','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(380,'pos-daysSales-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(381,'pos-posInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(382,'pos-posInvoices-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(383,'pos-reports','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(384,'pos-reports-deletedItems','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(385,'pos-reports-boxesSales','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(386,'pos-reports-detailedBoxes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(387,'pos-cashDevices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(388,'pos-cashDevices-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(389,'representatives','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(390,'representatives-ordersDelivery','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(391,'representatives-cashVan','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(392,'representatives-salesMan','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(393,'representatives-salesMan-addSalesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(394,'representatives-salesMan-editSalesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(395,'representatives-salesMan-postSalesInvoices','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(396,'representatives-salesMan-addSalesOrders','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(397,'representatives-salesMan-editSalesOrders','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(398,'representatives-salesMan-convertSalesOrders','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(399,'representatives-salesMan-addSalesOffers','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(400,'representatives-salesMan-editSalesOffers','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(401,'representatives-salesMan-convertSalesOffers','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(402,'representatives-collector','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(403,'representatives-collector-addReceiptEntry','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(404,'representatives-collector-editReceiptEntry','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(405,'representatives-collector-postReceiptEntry','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(406,'representatives-shipmentBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(407,'representatives-shipmentBonds-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(408,'representatives-shipmentBonds-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(409,'representatives-shipmentBonds-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(410,'representatives-shipmentBonds-post','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(411,'representatives-shipmentBonds-unpost','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(412,'generalSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(413,'generalSettings-homePage','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(414,'generalSettings-homePage-showTotalsCharts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(415,'generalSettings-companyDefinition','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(416,'generalSettings-companyDefinition-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(417,'generalSettings-companyDefinition-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(418,'generalSettings-general','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(419,'generalSettings-general-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(420,'generalSettings-general-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(421,'generalSettings-fiscalYears','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(422,'generalSettings-fiscalYears-create','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(423,'generalSettings-fiscalYears-openYear','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(424,'generalSettings-fiscalYears-closeYear','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(425,'generalSettings-fiscalYears-closeMonth','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(426,'generalSettings-fiscalYears-activateYear','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(427,'generalSettings-receivablePaymentMethods','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(428,'generalSettings-receivablePaymentMethods-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(429,'generalSettings-receivablePaymentMethods-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(430,'generalSettings-receivablePaymentMethods-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(431,'generalSettings-receivablePaymentMethods-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(432,'generalSettings-receivablePaymentMethods-changeStatus','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(433,'generalSettings-employees','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(434,'generalSettings-employees-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(435,'generalSettings-employees-activate','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(436,'generalSettings-employees-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(437,'generalSettings-employees-editInfo','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(438,'generalSettings-employees-editPermissions','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(439,'generalSettings-employees-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(440,'generalSettings-employeesActionsLog','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(441,'generalSettings-employeesActionsLog-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(442,'generalSettings-receivableCategory','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(443,'generalSettings-receivableCategory-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(444,'generalSettings-receivableCategory-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(445,'generalSettings-receivableCategory-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(446,'generalSettings-receivableCategory-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(447,'accountingSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(448,'accountingSettings-bankAccountsConnecting','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(449,'accountingSettings-bankAccountsConnecting-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(450,'accountingSettings-bankAccountsConnecting-connect','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(451,'accountingSettings-defaultAccounts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(452,'accountingSettings-defaultAccounts-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(453,'accountingSettings-defaultAccounts-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(454,'accountingSettings-costCenters','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(455,'accountingSettings-costCenters-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(456,'accountingSettings-costCenters-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(457,'accountingSettings-ewalletAccounts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(458,'accountingSettings-ewalletAccounts-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(459,'accountingSettings-ewalletAccounts-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(460,'accountingSettings-taxes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(461,'accountingSettings-taxes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(462,'accountingSettings-taxes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(463,'accountingSettings-taxes-activate','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(464,'accountingSettings-bonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(465,'accountingSettings-bonds-unpostEntry','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(466,'accountingSettings-bonds-unpostReceipt','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(467,'accountingSettings-bonds-unpostExchange','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(468,'accountingSettings-bonds-unpostServiceInvoice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(469,'accountingSettings-bonds-unpostReturnedServiceBond','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(470,'accountingSettings-bonds-unpostDebitNote','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(471,'accountingSettings-bonds-unpostCreditNote','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(472,'accountingSettings-bonds-exchangeChecksDailyCeiling','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(473,'accountingSettings-signatures','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(474,'accountingSettings-signatures-entry','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(475,'accountingSettings-signatures-exchange','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(476,'accountingSettings-signatures-receipt','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(477,'accountingSettings-signatures-serviceInvoice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(478,'accountingSettings-signatures-returnedServiceInvoice','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(479,'accountingSettings-signatures-debitNote','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(480,'accountingSettings-signatures-creditNote','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(481,'rentalsSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(482,'rentalsSettings-rentalContracts','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(483,'rentalsSettings-rentalContracts-enableExport','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(484,'rentalsSettings-rentalContracts-enableDistribute','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(485,'rentalsSettings-rentalContractCategories','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(486,'rentalsSettings-rentalContractCategories-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(487,'rentalsSettings-rentalContractCategories-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(488,'rentalsSettings-rentalContractCategories-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(489,'rentalsSettings-responseTemplates','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(490,'rentalsSettings-responseTemplates-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(491,'rentalsSettings-responseTemplates-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(492,'rentalsSettings-responseTemplates-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(493,'warehousesSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(494,'warehousesSettings-warehousesUnits','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(495,'warehousesSettings-warehousesUnits-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(496,'warehousesSettings-warehousesUnits-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(497,'warehousesSettings-warehousesUnits-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(498,'warehousesSettings-warehousesItemSizes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(499,'warehousesSettings-warehousesItemSizes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(500,'warehousesSettings-warehousesItemSizes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(501,'warehousesSettings-warehousesItemSizes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(502,'warehousesSettings-warehousesEntryBondTypes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(503,'warehousesSettings-warehousesEntryBondTypes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(504,'warehousesSettings-warehousesEntryBondTypes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(505,'warehousesSettings-warehousesEntryBondTypes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(506,'warehousesSettings-warehousesOutBondTypes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(507,'warehousesSettings-warehousesOutBondTypes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(508,'warehousesSettings-warehousesOutBondTypes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(509,'warehousesSettings-warehousesOutBondTypes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(510,'warehousesSettings-warehousesManufacturingBonds','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(511,'warehousesSettings-warehousesManufacturingBonds-enableAuditingPhase','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(512,'warehousesSettings-warehousesManufacturingBonds-postExpensesToAccounting','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(513,'warehousesSettings-barcodePriceTypes','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(514,'warehousesSettings-barcodePriceTypes-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(515,'warehousesSettings-barcodePriceTypes-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(516,'warehousesSettings-barcodePriceTypes-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(517,'warehousesSettings-paymentTerms','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(518,'warehousesSettings-paymentTerms-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(519,'warehousesSettings-paymentTerms-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(520,'warehousesSettings-paymentTerms-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(521,'warehousesSettings-deliveryTerms','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(522,'warehousesSettings-deliveryTerms-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(523,'warehousesSettings-deliveryTerms-edit','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(524,'warehousesSettings-deliveryTerms-delete','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(525,'posSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(526,'posSettings-users','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(527,'posSettings-users-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(528,'posSettings-users-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(529,'posSettings-users-editInfo','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(530,'posSettings-users-activate','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(531,'posSettings-generalSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(532,'posSettings-generalSettings-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(533,'posSettings-generalSettings-save','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(534,'posSettings-salesSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(535,'posSettings-salesSettings-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(536,'posSettings-salesSettings-save','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(537,'posSettings-boxesSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(538,'posSettings-boxesSettings-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(539,'posSettings-boxesSettings-save','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(540,'posSettings-scaleSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(541,'posSettings-scaleSettings-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(542,'posSettings-scaleSettings-save','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(543,'representativesSettings','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(544,'representativesSettings-deliveryCars','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(545,'representativesSettings-deliveryCars-show','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(546,'representativesSettings-deliveryCars-add','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(547,'representativesSettings-deliveryCars-editInfo','web','2025-11-04 02:03:08','2025-11-04 02:03:08'),(548,'representativesApp-ordersDelivery','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(549,'representativesApp-cashVan','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(550,'representativesApp-salesMan','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(551,'representativesApp-salesMan-addSalesInvoices','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(552,'representativesApp-salesMan-editSalesInvoices','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(553,'representativesApp-salesMan-postSalesInvoices','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(554,'representativesApp-salesMan-addSalesOrders','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(555,'representativesApp-salesMan-editSalesOrders','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(556,'representativesApp-salesMan-convertSalesOrders','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(557,'representativesApp-salesMan-addSalesOffers','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(558,'representativesApp-salesMan-editSalesOffers','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(559,'representativesApp-salesMan-convertSalesOffers','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(560,'representativesApp-collector','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(561,'representativesApp-collector-addReceiptEntry','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(562,'representativesApp-collector-editReceiptEntry','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(563,'representativesApp-collector-postReceiptEntry','representative','2025-11-04 02:03:08','2025-11-04 02:03:08'),(564,'pos-desktopApp-itemSearch','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(565,'pos-desktopApp-checkItemPrice','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(566,'pos-desktopApp-closeSlip','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(567,'pos-desktopApp-printSlip','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(568,'pos-desktopApp-slipItemDiscount','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(569,'pos-desktopApp-slipDiscount','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(570,'pos-desktopApp-makeInvoiceWithoutTax','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(571,'pos-desktopApp-changePaymentMethods','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(572,'pos-desktopApp-exchange','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(573,'pos-desktopApp-deleteInvoiceItem','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(574,'pos-desktopApp-deleteAllInvoiceItems','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(575,'pos-desktopApp-writeNotes','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(576,'pos-desktopApp-quickReturn','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(577,'pos-desktopApp-returnFromInvoice','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(578,'pos-desktopApp-closeCash','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(579,'pos-desktopApp-printCash','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(580,'pos-desktopApp-printerSettings','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(581,'pos-desktopApp-refresh','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(582,'pos-desktopApp-logout','pos-desktop','2025-11-04 02:03:08','2025-11-04 02:03:08'),(583,'category-1','web','2025-11-04 02:06:28','2025-11-04 02:06:28'),(584,'branch-1','web','2025-11-04 02:09:16','2025-11-04 02:09:16'),(585,'branch-1','pos-desktop','2025-11-04 02:09:16','2025-11-04 02:09:16');

--
-- Table structure for table `pos_desktop_functions`
--

CREATE TABLE `pos_desktop_functions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_desktop_functions`
--

INSERT INTO `pos_desktop_functions` VALUES (1,'البحث عن مادة','itemSearch'),(2,'التحقق من سعر المواد','checkItemPrice'),(3,'إضافة فاتورة','closeSlip'),(4,'طباعة الفاتورة','printSlip'),(5,'خصم على مادة بالفاتورة','slipItemDiscount'),(6,'خصم على الفاتورة','slipDiscount'),(7,'إزالة الضريبة من الفاتورة','makeInvoiceWithoutTax'),(8,'تغيير طرق الدفع بالفاتورة','changePaymentMethods'),(9,'تبديل المواد','exchange'),(10,'حذف مادة بالفاتورة','deleteInvoiceItem'),(11,'حذف كل مواد الفاتورة','deleteAllInvoiceItems'),(12,'كتابة ملاحظات','writeNotes'),(13,'عمل إرجاع سريع','quickReturn'),(14,'عمل إرجاع من فاتورة','returnFromInvoice'),(15,'إغلاق الصندوق','closeCash'),(16,'طباعة الصندوق','printCash'),(17,'التعديل على إعدادات الطباعة','printerSettings'),(18,'تحديث البيانات','refresh'),(19,'تسجيل الخروج','logout');

--
-- Table structure for table `pos_offer_barcodes`
--

CREATE TABLE `pos_offer_barcodes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `offer_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  `price_type_id` bigint unsigned NOT NULL,
  `discount_price` double DEFAULT NULL,
  `discount_ratio` double DEFAULT NULL,
  `when_quantity` double DEFAULT NULL,
  `free_quantity` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_offer_barcodes_offer_id_foreign` (`offer_id`),
  CONSTRAINT `pos_offer_barcodes_offer_id_foreign` FOREIGN KEY (`offer_id`) REFERENCES `pos_offers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_offer_barcodes`
--


--
-- Table structure for table `pos_offer_items`
--

CREATE TABLE `pos_offer_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `offer_id` bigint unsigned NOT NULL,
  `resource_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'category' COMMENT 'category/barcode/country/supplier',
  `resource_id` bigint unsigned NOT NULL,
  `discount_price` double DEFAULT NULL,
  `discount_ratio` double DEFAULT NULL,
  `when_quantity` double DEFAULT NULL,
  `free_quantity` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_offer_items_offer_id_foreign` (`offer_id`),
  CONSTRAINT `pos_offer_items_offer_id_foreign` FOREIGN KEY (`offer_id`) REFERENCES `pos_offers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_offer_items`
--


--
-- Table structure for table `pos_offers`
--

CREATE TABLE `pos_offers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general' COMMENT 'general/private',
  `clients_ids` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branches_ids` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price_types_ids` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date DEFAULT NULL,
  `from_time` time DEFAULT NULL,
  `to_time` time DEFAULT NULL,
  `is_forever` tinyint(1) NOT NULL DEFAULT '0',
  `filter_by` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'category' COMMENT 'category/barcode/supplier/country',
  `filtered_resources_ids` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `show_sub_categories` tinyint(1) NOT NULL DEFAULT '0',
  `offer_way` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'price' COMMENT 'price/ratio/quantity',
  `apply_way_on_all` tinyint(1) NOT NULL DEFAULT '1',
  `discount_price` double DEFAULT NULL,
  `discount_ratio` double DEFAULT NULL,
  `when_quantity` double DEFAULT NULL,
  `free_quantity` double DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_offers`
--


--
-- Table structure for table `pos_returned_bond_payments`
--

CREATE TABLE `pos_returned_bond_payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `returned_sales_bond_id` bigint unsigned NOT NULL,
  `payment_method_id` bigint unsigned NOT NULL,
  `amount` double(10,5) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_returned_bond_payments_returned_sales_bond_id_foreign` (`returned_sales_bond_id`),
  KEY `pos_returned_bond_payments_payment_method_id_foreign` (`payment_method_id`),
  CONSTRAINT `pos_returned_bond_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `receivable_payment_methods` (`id`),
  CONSTRAINT `pos_returned_bond_payments_returned_sales_bond_id_foreign` FOREIGN KEY (`returned_sales_bond_id`) REFERENCES `pos_returned_sales_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_returned_bond_payments`
--


--
-- Table structure for table `pos_returned_sales_bond_items`
--

CREATE TABLE `pos_returned_sales_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `pos_returned_bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL DEFAULT '1',
  `price` double NOT NULL,
  `tax_ratio` double DEFAULT NULL,
  `total_discount_amount` double NOT NULL DEFAULT '0',
  `total` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `pos_returned_sales_bond_items_pos_returned_bond_id_foreign` (`pos_returned_bond_id`),
  KEY `pos_returned_sales_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `pos_returned_sales_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `pos_returned_sales_bond_items_pos_returned_bond_id_foreign` FOREIGN KEY (`pos_returned_bond_id`) REFERENCES `pos_returned_sales_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_returned_sales_bond_items`
--


--
-- Table structure for table `pos_returned_sales_bonds`
--

CREATE TABLE `pos_returned_sales_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `box_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'exchange, from_invoice',
  `pos_sales_invoice_id` bigint unsigned NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `fotara_saved_at` datetime DEFAULT NULL,
  `is_fully_costed` tinyint(1) NOT NULL DEFAULT '0',
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_returned_sales_bonds_user_id_foreign` (`user_id`),
  KEY `pos_returned_sales_bonds_branch_id_foreign` (`branch_id`),
  KEY `pos_returned_sales_bonds_box_id_foreign` (`box_id`),
  KEY `pos_returned_sales_bonds_client_id_foreign` (`client_id`),
  KEY `pos_returned_sales_bonds_pos_sales_invoice_id_foreign` (`pos_sales_invoice_id`),
  CONSTRAINT `pos_returned_sales_bonds_box_id_foreign` FOREIGN KEY (`box_id`) REFERENCES `boxes` (`id`),
  CONSTRAINT `pos_returned_sales_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `pos_returned_sales_bonds_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `pos_returned_sales_bonds_pos_sales_invoice_id_foreign` FOREIGN KEY (`pos_sales_invoice_id`) REFERENCES `pos_sales_invoices` (`id`),
  CONSTRAINT `pos_returned_sales_bonds_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `pos_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_returned_sales_bonds`
--


--
-- Table structure for table `pos_sales_invoice_items`
--

CREATE TABLE `pos_sales_invoice_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `pos_sales_invoice_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(9,3) NOT NULL,
  `remaining_quantity` double(9,3) NOT NULL,
  `price` double NOT NULL,
  `tax_ratio` double(10,3) DEFAULT NULL,
  `total_discount_amount` double(10,3) DEFAULT NULL,
  `free_quantity` double(10,3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_sales_invoice_items_pos_sales_invoice_id_foreign` (`pos_sales_invoice_id`),
  KEY `pos_sales_invoice_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `pos_sales_invoice_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `pos_sales_invoice_items_pos_sales_invoice_id_foreign` FOREIGN KEY (`pos_sales_invoice_id`) REFERENCES `pos_sales_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_sales_invoice_items`
--


--
-- Table structure for table `pos_sales_invoice_payments`
--

CREATE TABLE `pos_sales_invoice_payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_invoice_id` bigint unsigned NOT NULL,
  `payment_method_id` bigint unsigned NOT NULL,
  `amount` double NOT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_sales_invoice_payments_sales_invoice_id_foreign` (`sales_invoice_id`),
  KEY `pos_sales_invoice_payments_payment_method_id_foreign` (`payment_method_id`),
  CONSTRAINT `pos_sales_invoice_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `receivable_payment_methods` (`id`),
  CONSTRAINT `pos_sales_invoice_payments_sales_invoice_id_foreign` FOREIGN KEY (`sales_invoice_id`) REFERENCES `pos_sales_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_sales_invoice_payments`
--


--
-- Table structure for table `pos_sales_invoices`
--

CREATE TABLE `pos_sales_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `order_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1',
  `user_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `box_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  `amount` double NOT NULL,
  `with_tax` tinyint(1) NOT NULL DEFAULT '1',
  `tax_amount` double DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci,
  `is_take_away` tinyint(1) NOT NULL DEFAULT '0',
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `fotara_saved_at` datetime DEFAULT NULL,
  `is_fully_costed` tinyint(1) NOT NULL DEFAULT '0',
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_sales_invoices_user_id_foreign` (`user_id`),
  KEY `pos_sales_invoices_branch_id_foreign` (`branch_id`),
  KEY `pos_sales_invoices_box_id_foreign` (`box_id`),
  KEY `pos_sales_invoices_client_id_foreign` (`client_id`),
  CONSTRAINT `pos_sales_invoices_box_id_foreign` FOREIGN KEY (`box_id`) REFERENCES `boxes` (`id`),
  CONSTRAINT `pos_sales_invoices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `pos_sales_invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `pos_sales_invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `pos_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_sales_invoices`
--


--
-- Table structure for table `pos_sections`
--

CREATE TABLE `pos_sections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `printer` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pos_sections_branch_id_foreign` (`branch_id`),
  CONSTRAINT `pos_sections_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_sections`
--


--
-- Table structure for table `print_bond_templates`
--

CREATE TABLE `print_bond_templates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `print_bond_templates`
--

INSERT INTO `print_bond_templates` VALUES (1,'salesOffer','Sales Offers Simple Template 1','show'),(2,'salesOffer','Sales Offers Advanced Template 2','show-2'),(3,'salesOrder','Sales Orders Simple Template 1','show'),(4,'salesOrder','Sales Orders Advanced Template 2','show-2'),(5,'salesInvoice','Sales Invoices Simple Template 1','show'),(6,'salesInvoice','Sales Invoices Advanced Template 2','show-2'),(7,'salesInvoice','Sales Invoices Advanced Template 3','show-3'),(8,'returnedSalesBond','Returned Sales Bonds Simple Template 1','show'),(9,'returnedSalesBond','Returned Sales Bonds Advanced Template 2','show-2');

--
-- Table structure for table `purchase_command_barcodes`
--

CREATE TABLE `purchase_command_barcodes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_command_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,2) NOT NULL DEFAULT '1.00',
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_command_barcodes_purchase_command_id_foreign` (`purchase_command_id`),
  KEY `purchase_command_barcodes_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `purchase_command_barcodes_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `purchase_command_barcodes_purchase_command_id_foreign` FOREIGN KEY (`purchase_command_id`) REFERENCES `purchase_commands` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_command_barcodes`
--


--
-- Table structure for table `purchase_commands`
--

CREATE TABLE `purchase_commands` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft' COMMENT 'draft/ unmet/ partially-satiated/ full-satiated',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_commands_employee_id_foreign` (`employee_id`),
  KEY `purchase_commands_branch_id_foreign` (`branch_id`),
  CONSTRAINT `purchase_commands_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `purchase_commands_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_commands`
--


--
-- Table structure for table `purchase_invoice_barcodes`
--

CREATE TABLE `purchase_invoice_barcodes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_invoice_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `cost` double(14,9) NOT NULL,
  `foreign_cost` double(14,9) DEFAULT NULL,
  `tax_ratio` double(10,3) DEFAULT NULL,
  `bonus` double(10,2) DEFAULT NULL,
  `discount_amount` double(14,9) DEFAULT NULL,
  `extra_discount_amount` double(14,9) DEFAULT NULL,
  `expenses_amount` double(10,2) DEFAULT NULL,
  `expire_date` date DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `print_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_invoice_barcodes_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  KEY `purchase_invoice_barcodes_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `purchase_invoice_barcodes_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `purchase_invoice_barcodes_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoice_barcodes`
--


--
-- Table structure for table `purchase_invoice_entries`
--

CREATE TABLE `purchase_invoice_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_invoice_id` bigint unsigned NOT NULL,
  `credit_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'account' COMMENT 'account/receivable',
  `credit_account_id` bigint unsigned NOT NULL,
  `debit_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'account' COMMENT 'account/receivable',
  `debit_account_id` bigint unsigned NOT NULL,
  `amount` double NOT NULL,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_invoice_entries_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  CONSTRAINT `purchase_invoice_entries_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoice_entries`
--


--
-- Table structure for table `purchase_invoice_expenses`
--

CREATE TABLE `purchase_invoice_expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_invoice_id` bigint unsigned NOT NULL,
  `expenses_id` bigint unsigned NOT NULL,
  `amount` double(10,2) NOT NULL,
  `credit_account_id` bigint unsigned DEFAULT NULL,
  `credit_receivable_account_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_invoice_expenses_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  KEY `purchase_invoice_expenses_expenses_id_foreign` (`expenses_id`),
  CONSTRAINT `purchase_invoice_expenses_expenses_id_foreign` FOREIGN KEY (`expenses_id`) REFERENCES `standard_purchase_invoice_expenses` (`id`),
  CONSTRAINT `purchase_invoice_expenses_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoice_expenses`
--


--
-- Table structure for table `purchase_invoices`
--

CREATE TABLE `purchase_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint unsigned DEFAULT NULL,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `supplier_id` bigint unsigned NOT NULL,
  `selected_payment_method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'internal / external',
  `supplier_invoice_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supplier_invoice_date` date DEFAULT NULL,
  `expected_delivery_date` date DEFAULT NULL,
  `show_just_supplier_items` tinyint(1) NOT NULL DEFAULT '1',
  `expenses_distribution_way` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'equally' COMMENT 'equally / manually',
  `recipient_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deposit_number` int DEFAULT NULL,
  `extra_discount_amount` double(10,3) DEFAULT NULL,
  `total_before_taxes` double(10,3) DEFAULT NULL,
  `taxes_sum` double(10,2) DEFAULT NULL,
  `total_after_taxes` double(10,3) DEFAULT NULL,
  `currency_id` bigint unsigned NOT NULL,
  `exchange_price` double(10,5) DEFAULT NULL,
  `is_under_tax` tinyint(1) NOT NULL DEFAULT '0',
  `notice` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_invoices_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_invoices_employee_id_foreign` (`employee_id`),
  KEY `purchase_invoices_branch_id_foreign` (`branch_id`),
  KEY `purchase_invoices_cost_center_id_foreign` (`cost_center_id`),
  KEY `purchase_invoices_supplier_id_foreign` (`supplier_id`),
  KEY `purchase_invoices_currency_id_foreign` (`currency_id`),
  CONSTRAINT `purchase_invoices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `purchase_invoices_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `purchase_invoices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  CONSTRAINT `purchase_invoices_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `purchase_invoices_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `purchase_invoices_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoices`
--


--
-- Table structure for table `purchase_order_barcodes`
--

CREATE TABLE `purchase_order_barcodes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,2) NOT NULL,
  `delivered_quantity` double(10,2) NOT NULL DEFAULT '0.00',
  `cost` double(10,2) NOT NULL,
  `discount_amount` double(10,2) DEFAULT NULL,
  `bonus` double(10,2) DEFAULT NULL,
  `delivered_bonus` double(10,2) NOT NULL DEFAULT '0.00',
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_barcodes_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_order_barcodes_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `purchase_order_barcodes_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `purchase_order_barcodes_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_order_barcodes`
--


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

CREATE TABLE `purchase_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_command_id` bigint unsigned DEFAULT NULL,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expected_delivery_date` date DEFAULT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `supplier_id` bigint unsigned NOT NULL,
  `delivery_term_id` bigint unsigned DEFAULT NULL,
  `payment_term_id` bigint unsigned DEFAULT NULL,
  `currency_id` bigint unsigned DEFAULT NULL,
  `exchange_price` double(10,2) DEFAULT NULL,
  `just_show_supplier_items` tinyint(1) NOT NULL DEFAULT '0',
  `tax_id` bigint unsigned DEFAULT NULL,
  `extra_discount_amount` double(10,2) DEFAULT NULL,
  `total_before_taxes` double(10,2) DEFAULT NULL,
  `taxes_sum` double(10,2) DEFAULT NULL,
  `total_after_taxes` double(10,2) DEFAULT NULL,
  `order_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `printing_count` int NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft' COMMENT 'draft/ unmet/ partially-satiated/ full-satiated',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_orders_purchase_command_id_foreign` (`purchase_command_id`),
  KEY `purchase_orders_employee_id_foreign` (`employee_id`),
  KEY `purchase_orders_branch_id_foreign` (`branch_id`),
  KEY `purchase_orders_supplier_id_foreign` (`supplier_id`),
  KEY `purchase_orders_delivery_term_id_foreign` (`delivery_term_id`),
  KEY `purchase_orders_payment_term_id_foreign` (`payment_term_id`),
  KEY `purchase_orders_currency_id_foreign` (`currency_id`),
  KEY `purchase_orders_tax_id_foreign` (`tax_id`),
  CONSTRAINT `purchase_orders_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `purchase_orders_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  CONSTRAINT `purchase_orders_delivery_term_id_foreign` FOREIGN KEY (`delivery_term_id`) REFERENCES `delivery_terms` (`id`),
  CONSTRAINT `purchase_orders_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `purchase_orders_payment_term_id_foreign` FOREIGN KEY (`payment_term_id`) REFERENCES `payment_terms` (`id`),
  CONSTRAINT `purchase_orders_purchase_command_id_foreign` FOREIGN KEY (`purchase_command_id`) REFERENCES `purchase_commands` (`id`),
  CONSTRAINT `purchase_orders_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `purchase_orders_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_orders`
--


--
-- Table structure for table `receipt_bank_transfers`
--

CREATE TABLE `receipt_bank_transfers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receipt_id` bigint unsigned NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(13,3) NOT NULL,
  `date` date NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `receipt_bank_transfers_receipt_id_foreign` (`receipt_id`),
  CONSTRAINT `receipt_bank_transfers_receipt_id_foreign` FOREIGN KEY (`receipt_id`) REFERENCES `receipt_entries` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_bank_transfers`
--


--
-- Table structure for table `receipt_check_operations`
--

CREATE TABLE `receipt_check_operations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `check_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `credit_type` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `credit_account_id` bigint unsigned NOT NULL,
  `debit_type` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `debit_account_id` bigint unsigned NOT NULL,
  `posted_file` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receipt_check_operations_check_id_foreign` (`check_id`),
  CONSTRAINT `receipt_check_operations_check_id_foreign` FOREIGN KEY (`check_id`) REFERENCES `receipt_checks` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_check_operations`
--


--
-- Table structure for table `receipt_checks`
--

CREATE TABLE `receipt_checks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receipt_id` bigint unsigned NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'bank name',
  `amount` double(13,3) NOT NULL,
  `date` date NOT NULL,
  `drawer_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `switched_check_id` bigint unsigned DEFAULT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'in_box/ in_collection/ posted/ returned/ converted',
  PRIMARY KEY (`id`),
  KEY `receipt_checks_receipt_id_foreign` (`receipt_id`),
  KEY `receipt_checks_switched_check_id_foreign` (`switched_check_id`),
  CONSTRAINT `receipt_checks_receipt_id_foreign` FOREIGN KEY (`receipt_id`) REFERENCES `receipt_entries` (`id`),
  CONSTRAINT `receipt_checks_switched_check_id_foreign` FOREIGN KEY (`switched_check_id`) REFERENCES `receipt_checks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_checks`
--


--
-- Table structure for table `receipt_entries`
--

CREATE TABLE `receipt_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_way` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'cash,check,transfer,ewallet,other',
  `credit_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'account / receivable',
  `debit_account_id` bigint unsigned DEFAULT NULL,
  `credit_account_id` bigint unsigned DEFAULT NULL,
  `credit_receivable_id` bigint unsigned DEFAULT NULL,
  `checks_post_way` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'by checks-box or checks-collector',
  `direct_post_to_bank` tinyint(1) NOT NULL DEFAULT '0',
  `customer_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  `automated_notice` text COLLATE utf8mb4_unicode_ci,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receipt_entries_year_id_foreign` (`year_id`),
  KEY `receipt_entries_period_id_foreign` (`period_id`),
  KEY `receipt_entries_employee_id_foreign` (`employee_id`),
  KEY `receipt_entries_debit_account_id_foreign` (`debit_account_id`),
  KEY `receipt_entries_credit_account_id_foreign` (`credit_account_id`),
  KEY `receipt_entries_credit_receivable_id_foreign` (`credit_receivable_id`),
  CONSTRAINT `receipt_entries_credit_account_id_foreign` FOREIGN KEY (`credit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `receipt_entries_credit_receivable_id_foreign` FOREIGN KEY (`credit_receivable_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `receipt_entries_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `receipt_entries_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `receipt_entries_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `receipt_entries_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_entries`
--


--
-- Table structure for table `receipt_ewallet_items`
--

CREATE TABLE `receipt_ewallet_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receipt_id` bigint unsigned NOT NULL,
  `from_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(10,2) NOT NULL,
  `date` date NOT NULL,
  `notice` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `receipt_ewallet_items_receipt_id_foreign` (`receipt_id`),
  CONSTRAINT `receipt_ewallet_items_receipt_id_foreign` FOREIGN KEY (`receipt_id`) REFERENCES `receipt_entries` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_ewallet_items`
--


--
-- Table structure for table `receivable_account_branches`
--

CREATE TABLE `receivable_account_branches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receivable_account_id` bigint unsigned NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `receivable_account_branches_receivable_account_id_foreign` (`receivable_account_id`),
  CONSTRAINT `receivable_account_branches_receivable_account_id_foreign` FOREIGN KEY (`receivable_account_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receivable_account_branches`
--


--
-- Table structure for table `receivable_categories`
--

CREATE TABLE `receivable_categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ar_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  `level` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `receivable_categories_parent_id_foreign` (`parent_id`),
  CONSTRAINT `receivable_categories_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `receivable_categories` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receivable_categories`
--


--
-- Table structure for table `receivable_payment_method_accounts`
--

CREATE TABLE `receivable_payment_method_accounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `payment_method_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `commission_account_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receivable_payment_method_accounts_payment_method_id_foreign` (`payment_method_id`),
  KEY `receivable_payment_method_accounts_branch_id_foreign` (`branch_id`),
  KEY `receivable_payment_method_accounts_account_id_foreign` (`account_id`),
  KEY `receivable_payment_method_accounts_commission_account_id_foreign` (`commission_account_id`),
  CONSTRAINT `receivable_payment_method_accounts_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `receivable_payment_method_accounts_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `receivable_payment_method_accounts_commission_account_id_foreign` FOREIGN KEY (`commission_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `receivable_payment_method_accounts_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `receivable_payment_methods` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receivable_payment_method_accounts`
--


--
-- Table structure for table `receivable_payment_methods`
--

CREATE TABLE `receivable_payment_methods` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `logo` text COLLATE utf8mb4_unicode_ci,
  `way_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'receivable' COMMENT 'receivable/cash/cards',
  `days_count` int DEFAULT NULL,
  `commission_ratio` double(10,2) DEFAULT NULL,
  `show_in_pos` tinyint(1) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receivable_payment_methods`
--

INSERT INTO `receivable_payment_methods` VALUES (1,'نقدي',NULL,'cash',NULL,NULL,0,1),(2,'10 يوم',NULL,'receivable',10,NULL,0,1),(3,'20 يوم',NULL,'receivable',20,NULL,0,1),(4,'30 يوم',NULL,'receivable',30,NULL,0,1),(5,'45 يوم',NULL,'receivable',45,NULL,0,1),(6,'90 يوم',NULL,'receivable',90,NULL,0,1);

--
-- Table structure for table `rental_contract_initial_balances`
--

CREATE TABLE `rental_contract_initial_balances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contract_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `tenant_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  `amount` double NOT NULL DEFAULT '0',
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_contract_initial_balances_contract_id_foreign` (`contract_id`),
  KEY `rental_contract_initial_balances_tenant_id_foreign` (`tenant_id`),
  KEY `rental_contract_initial_balances_account_id_foreign` (`account_id`),
  CONSTRAINT `rental_contract_initial_balances_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `rental_contract_initial_balances_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `rental_contracts` (`id`),
  CONSTRAINT `rental_contract_initial_balances_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_contract_initial_balances`
--


--
-- Table structure for table `rental_contract_invoices`
--

CREATE TABLE `rental_contract_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contract_id` bigint unsigned NOT NULL,
  `tenant_id` bigint unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal' COMMENT 'normal,services,knowledges_tax',
  `id_by_type` bigint NOT NULL,
  `amount` double(13,3) NOT NULL,
  `accrued_amount` double(13,3) NOT NULL,
  `accrued_date_starting` date NOT NULL,
  `accrued_date_ending` date NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `fully_distributed` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_contract_invoices_contract_id_foreign` (`contract_id`),
  KEY `rental_contract_invoices_tenant_id_foreign` (`tenant_id`),
  KEY `rental_contract_invoices_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `rental_contract_invoices_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `rental_contracts` (`id`),
  CONSTRAINT `rental_contract_invoices_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `rental_contract_invoices_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_contract_invoices`
--


--
-- Table structure for table `rental_contracts`
--

CREATE TABLE `rental_contracts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint unsigned NOT NULL,
  `shop_id` bigint unsigned DEFAULT NULL,
  `booth_id` bigint unsigned DEFAULT NULL,
  `rented_place_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'shop/booth',
  `period_starting` date NOT NULL,
  `period_ending` date NOT NULL,
  `creating_invoices_from_date` date NOT NULL,
  `amount` double(13,3) NOT NULL,
  `initial_balance_on_receivable` double(9,3) DEFAULT NULL,
  `term_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'long_term / short_term',
  `payment_frequency` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'amount calc yearly, monthly, daily',
  `knowledge_tax` double(13,3) DEFAULT NULL,
  `services_amount` double(13,3) DEFAULT NULL,
  `services_payment_way` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'yearly, monthly, quarter, daily, oneTime',
  `logo_path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_way` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'yearly, monthly, quarter, daily, oneTime',
  `years_amounts_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'static' COMMENT 'static',
  `years_increment_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'from-first-year,from-previous-year',
  `category_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `brand_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `signaturey_of_contract` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tenant_address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `work_nature` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `automatic_export_invoices` tinyint(1) NOT NULL DEFAULT '0',
  `monthly_distribute_invoices` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft' COMMENT 'draft/active/unactive/trashed/terminated',
  `posted_at` datetime DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_contracts_tenant_id_foreign` (`tenant_id`),
  KEY `rental_contracts_shop_id_foreign` (`shop_id`),
  KEY `rental_contracts_booth_id_foreign` (`booth_id`),
  KEY `rental_contracts_category_id_foreign` (`category_id`),
  KEY `rental_contracts_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `rental_contracts_booth_id_foreign` FOREIGN KEY (`booth_id`) REFERENCES `booths` (`id`),
  CONSTRAINT `rental_contracts_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `contract_categories` (`id`),
  CONSTRAINT `rental_contracts_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `rental_contracts_shop_id_foreign` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`),
  CONSTRAINT `rental_contracts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_contracts`
--


--
-- Table structure for table `rental_events`
--

CREATE TABLE `rental_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `from_date` datetime NOT NULL,
  `to_date` datetime NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `building_id` bigint unsigned NOT NULL,
  `floor_id` bigint unsigned NOT NULL,
  `shop_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_events_building_id_foreign` (`building_id`),
  KEY `rental_events_floor_id_foreign` (`floor_id`),
  KEY `rental_events_shop_id_foreign` (`shop_id`),
  CONSTRAINT `rental_events_building_id_foreign` FOREIGN KEY (`building_id`) REFERENCES `buildings` (`id`),
  CONSTRAINT `rental_events_floor_id_foreign` FOREIGN KEY (`floor_id`) REFERENCES `floors` (`id`),
  CONSTRAINT `rental_events_shop_id_foreign` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_events`
--


--
-- Table structure for table `rental_requests`
--

CREATE TABLE `rental_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `en_company_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fax_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trade_mark` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_shopping_centers` text COLLATE utf8mb4_unicode_ci,
  `company_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general_partnership',
  `capital_investment` double(10,2) DEFAULT NULL,
  `years_in_business` int DEFAULT NULL,
  `stores_in_business_count` int DEFAULT NULL,
  `employees_count` int DEFAULT NULL,
  `required_area` double(10,2) NOT NULL,
  `business_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `other_business_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `business_description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `accepted_credit_cards` text COLLATE utf8mb4_unicode_ci,
  `business_reference` text COLLATE utf8mb4_unicode_ci,
  `bank_reference` text COLLATE utf8mb4_unicode_ci,
  `applicant_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_requests`
--


--
-- Table structure for table `rental_tenant_actions`
--

CREATE TABLE `rental_tenant_actions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `receivable_account_id` bigint unsigned NOT NULL,
  `action_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_tenant_action_files` text COLLATE utf8mb4_unicode_ci,
  `from_date` datetime NOT NULL,
  `to_date` datetime NOT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending' COMMENT 'pending,accepted,cancelled',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_tenant_actions_receivable_account_id_foreign` (`receivable_account_id`),
  CONSTRAINT `rental_tenant_actions_receivable_account_id_foreign` FOREIGN KEY (`receivable_account_id`) REFERENCES `receivable_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_tenant_actions`
--


--
-- Table structure for table `representatives_branches`
--

CREATE TABLE `representatives_branches` (
  `representative_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`representative_id`,`branch_id`),
  KEY `representatives_branches_branch_id_foreign` (`branch_id`),
  CONSTRAINT `representatives_branches_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `representatives_branches_representative_id_foreign` FOREIGN KEY (`representative_id`) REFERENCES `representatives` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representatives_branches`
--


--
-- Table structure for table `representatives_mobile_functions`
--

CREATE TABLE `representatives_mobile_functions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `section_id` bigint unsigned NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `representatives_mobile_functions_section_id_foreign` (`section_id`),
  CONSTRAINT `representatives_mobile_functions_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `representatives_mobile_sections` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representatives_mobile_functions`
--

INSERT INTO `representatives_mobile_functions` VALUES (1,'إضافة فواتير المبيعات',3,'addSalesInvoices'),(2,'تعديل فواتير المبيعات',3,'editSalesInvoices'),(3,'ترحيل فواتر المبيعات',3,'postSalesInvoices'),(4,'إضافة طلبات المبيعات',3,'addSalesOrders'),(5,'تعديل طلبات المبيعات',3,'editSalesOrders'),(6,'تحويل طلبات المبيعات',3,'convertSalesOrders'),(7,'إضافة عروض الاسعار',3,'addSalesOffers'),(8,'تعديل عروض الاسعار',3,'editSalesOffers'),(9,'تحويل عروض الاسعار',3,'convertSalesOffers'),(10,'إضافة سندات القبض',4,'addReceiptEntry'),(11,'تعديل سندات القبض',4,'editReceiptEntry'),(12,'ترحيل سندات القبض ',4,'postReceiptEntry');

--
-- Table structure for table `representatives_mobile_sections`
--

CREATE TABLE `representatives_mobile_sections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representatives_mobile_sections`
--

INSERT INTO `representatives_mobile_sections` VALUES (1,'توصيل الطلبيات','ordersDelivery'),(2,'كاش فان','cashVan'),(3,'مندوب مبيعات','salesMan'),(4,'التحصيل','collector');

--
-- Table structure for table `representatives_receivables`
--

CREATE TABLE `representatives_receivables` (
  `representative_id` bigint unsigned NOT NULL,
  `receivable_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`representative_id`,`receivable_id`),
  KEY `representatives_receivables_receivable_id_foreign` (`receivable_id`),
  CONSTRAINT `representatives_receivables_receivable_id_foreign` FOREIGN KEY (`receivable_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `representatives_receivables_representative_id_foreign` FOREIGN KEY (`representative_id`) REFERENCES `representatives` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representatives_receivables`
--


--
-- Table structure for table `response_templates`
--

CREATE TABLE `response_templates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `description` text COLLATE utf8mb4_unicode_ci,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `response_templates`
--


--
-- Table structure for table `returned_aggregation_items`
--

CREATE TABLE `returned_aggregation_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `returned_aggregation_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` decimal(10,3) NOT NULL,
  `price` decimal(10,3) NOT NULL,
  `discount` decimal(10,3) NOT NULL DEFAULT '0.000',
  `tax_ratio` decimal(10,3) DEFAULT NULL,
  `total` decimal(10,3) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_aggregation_items_returned_aggregation_id_foreign` (`returned_aggregation_id`),
  KEY `returned_aggregation_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `returned_aggregation_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `returned_aggregation_items_returned_aggregation_id_foreign` FOREIGN KEY (`returned_aggregation_id`) REFERENCES `returned_aggregations` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_aggregation_items`
--


--
-- Table structure for table `returned_aggregations`
--

CREATE TABLE `returned_aggregations` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `box_day_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `aggregation_invoice_id` bigint unsigned NOT NULL,
  `source_return_bond_id` bigint unsigned NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` timestamp NULL DEFAULT NULL,
  `price` decimal(10,3) NOT NULL DEFAULT '0.000',
  `quantity` decimal(10,3) NOT NULL DEFAULT '0.000',
  `discount` decimal(10,3) NOT NULL DEFAULT '0.000',
  `tax_amount` decimal(10,3) NOT NULL DEFAULT '0.000',
  `total` decimal(10,3) NOT NULL DEFAULT '0.000',
  `fotara_saved_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_aggregations_box_day_id_foreign` (`box_day_id`),
  KEY `returned_aggregations_branch_id_foreign` (`branch_id`),
  KEY `returned_aggregations_aggregation_invoice_id_foreign` (`aggregation_invoice_id`),
  KEY `returned_aggregations_source_return_bond_id_foreign` (`source_return_bond_id`),
  CONSTRAINT `returned_aggregations_aggregation_invoice_id_foreign` FOREIGN KEY (`aggregation_invoice_id`) REFERENCES `aggregation_invoices` (`id`),
  CONSTRAINT `returned_aggregations_box_day_id_foreign` FOREIGN KEY (`box_day_id`) REFERENCES `box_days` (`id`),
  CONSTRAINT `returned_aggregations_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `returned_aggregations_source_return_bond_id_foreign` FOREIGN KEY (`source_return_bond_id`) REFERENCES `pos_returned_sales_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_aggregations`
--


--
-- Table structure for table `returned_purchase_bond_items`
--

CREATE TABLE `returned_purchase_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `returned_purchase_bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,3) NOT NULL,
  `cost` double(10,3) NOT NULL,
  `foreign_cost` double(10,3) DEFAULT NULL,
  `purchase_invoice_id` bigint unsigned DEFAULT NULL,
  `tax_ratio` double(10,3) DEFAULT NULL,
  `tax_amount` decimal(10,2) DEFAULT NULL,
  `total_cost_after_tax` decimal(10,3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_purchase_bond_items_returned_purchase_bond_id_foreign` (`returned_purchase_bond_id`),
  KEY `returned_purchase_bond_items_barcode_id_foreign` (`barcode_id`),
  KEY `returned_purchase_bond_items_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  CONSTRAINT `returned_purchase_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `returned_purchase_bond_items_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`),
  CONSTRAINT `returned_purchase_bond_items_returned_purchase_bond_id_foreign` FOREIGN KEY (`returned_purchase_bond_id`) REFERENCES `returned_purchase_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_purchase_bond_items`
--


--
-- Table structure for table `returned_purchase_bond_types`
--

CREATE TABLE `returned_purchase_bond_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_deletable` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_purchase_bond_types`
--

INSERT INTO `returned_purchase_bond_types` VALUES (1,'مردود مشتريات',0);

--
-- Table structure for table `returned_purchase_bonds`
--

CREATE TABLE `returned_purchase_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `selected_invoices_ids` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_id` bigint unsigned NOT NULL,
  `type_id` bigint unsigned NOT NULL,
  `exchange_price` double(10,3) DEFAULT NULL,
  `payment_way` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'receivable / cash',
  `just_show_supplier_items` tinyint(1) NOT NULL DEFAULT '0',
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_purchase_bonds_employee_id_foreign` (`employee_id`),
  KEY `returned_purchase_bonds_supplier_id_foreign` (`supplier_id`),
  KEY `returned_purchase_bonds_branch_id_foreign` (`branch_id`),
  KEY `returned_purchase_bonds_cost_center_id_foreign` (`cost_center_id`),
  KEY `returned_purchase_bonds_currency_id_foreign` (`currency_id`),
  KEY `returned_purchase_bonds_type_id_foreign` (`type_id`),
  CONSTRAINT `returned_purchase_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `returned_purchase_bonds_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `returned_purchase_bonds_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  CONSTRAINT `returned_purchase_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `returned_purchase_bonds_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `returned_purchase_bonds_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `returned_purchase_bond_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_purchase_bonds`
--


--
-- Table structure for table `returned_sales_bond_items`
--

CREATE TABLE `returned_sales_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `returned_sales_bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double NOT NULL,
  `tax_ratio` double DEFAULT NULL,
  `sales_invoice_id` bigint unsigned NOT NULL,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,3) DEFAULT NULL,
  `total_price` decimal(10,3) DEFAULT NULL,
  `total_price_after_tax` decimal(10,3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_sales_bond_items_returned_sales_bond_id_foreign` (`returned_sales_bond_id`),
  KEY `returned_sales_bond_items_barcode_id_foreign` (`barcode_id`),
  KEY `returned_sales_bond_items_sales_invoice_id_foreign` (`sales_invoice_id`),
  CONSTRAINT `returned_sales_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `returned_sales_bond_items_returned_sales_bond_id_foreign` FOREIGN KEY (`returned_sales_bond_id`) REFERENCES `returned_sales_bonds` (`id`),
  CONSTRAINT `returned_sales_bond_items_sales_invoice_id_foreign` FOREIGN KEY (`sales_invoice_id`) REFERENCES `sales_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_sales_bond_items`
--


--
-- Table structure for table `returned_sales_bonds`
--

CREATE TABLE `returned_sales_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash' COMMENT 'cash / receivable',
  `client_id` bigint unsigned DEFAULT NULL,
  `client_name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `selected_invoices_ids` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_branch_id` bigint unsigned DEFAULT NULL,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `fotara_saved_at` datetime DEFAULT NULL,
  `is_fully_costed` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_sales_bonds_employee_id_foreign` (`employee_id`),
  KEY `returned_sales_bonds_client_id_foreign` (`client_id`),
  KEY `returned_sales_bonds_branch_id_foreign` (`branch_id`),
  KEY `returned_sales_bonds_cost_center_id_foreign` (`cost_center_id`),
  KEY `returned_sales_bonds_client_branch_id_foreign` (`client_branch_id`),
  CONSTRAINT `returned_sales_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `returned_sales_bonds_client_branch_id_foreign` FOREIGN KEY (`client_branch_id`) REFERENCES `receivable_account_branches` (`id`),
  CONSTRAINT `returned_sales_bonds_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `returned_sales_bonds_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `returned_sales_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_sales_bonds`
--


--
-- Table structure for table `returned_service_bond_items`
--

CREATE TABLE `returned_service_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `returned_service_bond_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `tax_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `tax_amount` double(13,3) DEFAULT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_service_bond_items_returned_service_bond_id_foreign` (`returned_service_bond_id`),
  KEY `returned_service_bond_items_account_id_foreign` (`account_id`),
  KEY `returned_service_bond_items_tax_id_foreign` (`tax_id`),
  KEY `returned_service_bond_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `returned_service_bond_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `returned_service_bond_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `returned_service_bond_items_returned_service_bond_id_foreign` FOREIGN KEY (`returned_service_bond_id`) REFERENCES `returned_service_bonds` (`id`),
  CONSTRAINT `returned_service_bond_items_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_service_bond_items`
--


--
-- Table structure for table `returned_service_bonds`
--

CREATE TABLE `returned_service_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `selected_invoices_ids` bigint unsigned NOT NULL,
  `post_status` smallint NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `fotara_saved_at` datetime DEFAULT NULL,
  `debit_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'cash or receivable',
  `receivable_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'name of customer (cash/receivable)',
  `debit_account_id` bigint unsigned DEFAULT NULL COMMENT 'when type is cash',
  `debit_receivable_id` bigint unsigned DEFAULT NULL COMMENT 'when type is receivable',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `returned_service_bonds_year_id_foreign` (`year_id`),
  KEY `returned_service_bonds_period_id_foreign` (`period_id`),
  KEY `returned_service_bonds_employee_id_foreign` (`employee_id`),
  KEY `returned_service_bonds_selected_invoices_ids_foreign` (`selected_invoices_ids`),
  KEY `returned_service_bonds_debit_account_id_foreign` (`debit_account_id`),
  KEY `returned_service_bonds_debit_receivable_id_foreign` (`debit_receivable_id`),
  CONSTRAINT `returned_service_bonds_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `returned_service_bonds_debit_receivable_id_foreign` FOREIGN KEY (`debit_receivable_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `returned_service_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `returned_service_bonds_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `returned_service_bonds_selected_invoices_ids_foreign` FOREIGN KEY (`selected_invoices_ids`) REFERENCES `service_invoices` (`id`),
  CONSTRAINT `returned_service_bonds_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `returned_service_bonds`
--


--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `role_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--


--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(125) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--


--
-- Table structure for table `sales_invoice_expenses`
--

CREATE TABLE `sales_invoice_expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_invoice_id` bigint unsigned NOT NULL,
  `expenses_id` bigint unsigned NOT NULL,
  `amount` double(10,2) NOT NULL,
  `credit_account_id` bigint unsigned DEFAULT NULL,
  `credit_receivable_account_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_invoice_expenses_sales_invoice_id_foreign` (`sales_invoice_id`),
  KEY `sales_invoice_expenses_expenses_id_foreign` (`expenses_id`),
  CONSTRAINT `sales_invoice_expenses_expenses_id_foreign` FOREIGN KEY (`expenses_id`) REFERENCES `standard_sales_invoice_expenses` (`id`),
  CONSTRAINT `sales_invoice_expenses_sales_invoice_id_foreign` FOREIGN KEY (`sales_invoice_id`) REFERENCES `sales_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_invoice_expenses`
--


--
-- Table structure for table `sales_invoice_items`
--

CREATE TABLE `sales_invoice_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_invoice_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,3) NOT NULL,
  `price` double(15,9) NOT NULL,
  `foreign_price` double(13,9) DEFAULT NULL,
  `tax_ratio` double(10,3) DEFAULT NULL,
  `discount_amount` double(10,5) DEFAULT NULL,
  `extra_discount_amount` double(10,5) DEFAULT NULL,
  `bonus` double(10,2) DEFAULT NULL,
  `expire_date` date DEFAULT NULL,
  `serial_items` text COLLATE utf8mb4_unicode_ci,
  `notice` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `print_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_invoice_items_sales_invoice_id_foreign` (`sales_invoice_id`),
  KEY `sales_invoice_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `sales_invoice_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `sales_invoice_items_sales_invoice_id_foreign` FOREIGN KEY (`sales_invoice_id`) REFERENCES `sales_invoices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_invoice_items`
--


--
-- Table structure for table `sales_invoices`
--

CREATE TABLE `sales_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_price_offer_id` bigint unsigned DEFAULT NULL,
  `sales_order_id` bigint unsigned DEFAULT NULL,
  `entry_bond_id` bigint unsigned DEFAULT NULL,
  `out_bond_id` bigint unsigned DEFAULT NULL,
  `date` date NOT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `representative_id` bigint unsigned DEFAULT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash' COMMENT 'cash/receivable',
  `client_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  `price_type_id` bigint unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'internal' COMMENT 'internal / external',
  `client_name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivered_date` date DEFAULT NULL,
  `accured_date` date DEFAULT NULL,
  `payment_method_id` bigint unsigned DEFAULT NULL,
  `driver_id` bigint unsigned DEFAULT NULL,
  `seller_id` bigint unsigned DEFAULT NULL,
  `client_branch_id` bigint unsigned DEFAULT NULL,
  `extra_discount_amount` double(10,3) DEFAULT NULL,
  `client_discount_ratio` double DEFAULT NULL,
  `currency_id` bigint unsigned NOT NULL,
  `exchange_price` double(10,5) DEFAULT NULL,
  `selected_payment_way` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `fotara_saved_at` datetime DEFAULT NULL,
  `total_before_taxes` double(10,3) NOT NULL,
  `accrued_amount` double(10,3) NOT NULL,
  `original_price` tinyint(1) NOT NULL DEFAULT '0',
  `without_out_quantities` tinyint(1) NOT NULL DEFAULT '0',
  `builder_model` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `builder_model_id` bigint DEFAULT NULL,
  `is_under_tax` tinyint(1) NOT NULL DEFAULT '0',
  `without_tax` tinyint(1) NOT NULL DEFAULT '0',
  `taxes_sum` double NOT NULL DEFAULT '0',
  `is_fully_costed` tinyint(1) NOT NULL DEFAULT '0',
  `delivered_status` tinyint(1) NOT NULL DEFAULT '0',
  `notice` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_invoices_sales_price_offer_id_foreign` (`sales_price_offer_id`),
  KEY `sales_invoices_sales_order_id_foreign` (`sales_order_id`),
  KEY `sales_invoices_entry_bond_id_foreign` (`entry_bond_id`),
  KEY `sales_invoices_out_bond_id_foreign` (`out_bond_id`),
  KEY `sales_invoices_employee_id_foreign` (`employee_id`),
  KEY `sales_invoices_representative_id_foreign` (`representative_id`),
  KEY `sales_invoices_client_id_foreign` (`client_id`),
  KEY `sales_invoices_branch_id_foreign` (`branch_id`),
  KEY `sales_invoices_cost_center_id_foreign` (`cost_center_id`),
  KEY `sales_invoices_price_type_id_foreign` (`price_type_id`),
  KEY `sales_invoices_driver_id_foreign` (`driver_id`),
  KEY `sales_invoices_seller_id_foreign` (`seller_id`),
  KEY `sales_invoices_client_branch_id_foreign` (`client_branch_id`),
  KEY `sales_invoices_currency_id_foreign` (`currency_id`),
  CONSTRAINT `sales_invoices_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `sales_invoices_client_branch_id_foreign` FOREIGN KEY (`client_branch_id`) REFERENCES `receivable_account_branches` (`id`),
  CONSTRAINT `sales_invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `sales_invoices_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `sales_invoices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  CONSTRAINT `sales_invoices_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`),
  CONSTRAINT `sales_invoices_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `sales_invoices_entry_bond_id_foreign` FOREIGN KEY (`entry_bond_id`) REFERENCES `entry_bonds` (`id`),
  CONSTRAINT `sales_invoices_out_bond_id_foreign` FOREIGN KEY (`out_bond_id`) REFERENCES `out_bonds` (`id`),
  CONSTRAINT `sales_invoices_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `barcode_price_types` (`id`),
  CONSTRAINT `sales_invoices_representative_id_foreign` FOREIGN KEY (`representative_id`) REFERENCES `representatives` (`id`),
  CONSTRAINT `sales_invoices_sales_order_id_foreign` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_orders` (`id`),
  CONSTRAINT `sales_invoices_sales_price_offer_id_foreign` FOREIGN KEY (`sales_price_offer_id`) REFERENCES `sales_price_offers` (`id`),
  CONSTRAINT `sales_invoices_seller_id_foreign` FOREIGN KEY (`seller_id`) REFERENCES `sellers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_invoices`
--


--
-- Table structure for table `sales_order_expenses`
--

CREATE TABLE `sales_order_expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_order_id` bigint unsigned NOT NULL,
  `expenses_id` bigint unsigned NOT NULL,
  `amount` double(10,2) NOT NULL,
  `credit_account_id` bigint unsigned DEFAULT NULL,
  `credit_receivable_account_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_order_expenses_sales_order_id_foreign` (`sales_order_id`),
  KEY `sales_order_expenses_expenses_id_foreign` (`expenses_id`),
  CONSTRAINT `sales_order_expenses_expenses_id_foreign` FOREIGN KEY (`expenses_id`) REFERENCES `standard_sales_invoice_expenses` (`id`),
  CONSTRAINT `sales_order_expenses_sales_order_id_foreign` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_order_expenses`
--


--
-- Table structure for table `sales_order_items`
--

CREATE TABLE `sales_order_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_order_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,3) NOT NULL,
  `delivered_quantity` double(10,2) NOT NULL DEFAULT '0.00' COMMENT 'quantity Received from client',
  `delivered_bonus` double(10,2) NOT NULL DEFAULT '0.00' COMMENT 'bonus Received from client',
  `price` double(13,9) NOT NULL,
  `foreign_price` double(13,9) DEFAULT NULL,
  `discount_amount` double(10,2) DEFAULT NULL,
  `extra_discount_amount` double(10,2) DEFAULT NULL,
  `bonus` double(10,2) DEFAULT NULL,
  `expire_date` date DEFAULT NULL,
  `serial_items` text COLLATE utf8mb4_unicode_ci,
  `notice` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_order_items_sales_order_id_foreign` (`sales_order_id`),
  KEY `sales_order_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `sales_order_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `sales_order_items_sales_order_id_foreign` FOREIGN KEY (`sales_order_id`) REFERENCES `sales_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_order_items`
--


--
-- Table structure for table `sales_orders`
--

CREATE TABLE `sales_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sales_price_offer_id` bigint unsigned DEFAULT NULL,
  `client_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash' COMMENT 'cash/receivable',
  `client_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `price_type_id` bigint unsigned NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'internal' COMMENT 'internal / external',
  `client_name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivered_date` date DEFAULT NULL,
  `accured_date` date DEFAULT NULL,
  `payment_method_id` bigint unsigned DEFAULT NULL,
  `driver_id` bigint unsigned DEFAULT NULL,
  `seller_id` bigint unsigned DEFAULT NULL,
  `client_branch_id` bigint unsigned DEFAULT NULL,
  `extra_discount_amount` double(10,2) DEFAULT NULL,
  `client_discount_ratio` double DEFAULT NULL,
  `currency_id` bigint unsigned NOT NULL,
  `exchange_price` double(10,5) DEFAULT NULL,
  `amount` double(10,3) NOT NULL,
  `accrued_amount` double(10,3) NOT NULL,
  `notice` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft' COMMENT 'draft/ unmet/ partially-satiated/ full-satiated',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_orders_employee_id_foreign` (`employee_id`),
  KEY `sales_orders_sales_price_offer_id_foreign` (`sales_price_offer_id`),
  KEY `sales_orders_client_id_foreign` (`client_id`),
  KEY `sales_orders_branch_id_foreign` (`branch_id`),
  KEY `sales_orders_price_type_id_foreign` (`price_type_id`),
  KEY `sales_orders_driver_id_foreign` (`driver_id`),
  KEY `sales_orders_seller_id_foreign` (`seller_id`),
  KEY `sales_orders_client_branch_id_foreign` (`client_branch_id`),
  KEY `sales_orders_currency_id_foreign` (`currency_id`),
  CONSTRAINT `sales_orders_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `sales_orders_client_branch_id_foreign` FOREIGN KEY (`client_branch_id`) REFERENCES `receivable_account_branches` (`id`),
  CONSTRAINT `sales_orders_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `sales_orders_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  CONSTRAINT `sales_orders_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`),
  CONSTRAINT `sales_orders_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `sales_orders_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `barcode_price_types` (`id`),
  CONSTRAINT `sales_orders_sales_price_offer_id_foreign` FOREIGN KEY (`sales_price_offer_id`) REFERENCES `sales_price_offers` (`id`),
  CONSTRAINT `sales_orders_seller_id_foreign` FOREIGN KEY (`seller_id`) REFERENCES `sellers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_orders`
--


--
-- Table structure for table `sales_price_offer_items`
--

CREATE TABLE `sales_price_offer_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sales_price_offer_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `quantity` double(10,3) NOT NULL,
  `price` double(13,9) NOT NULL,
  `discount_amount` double(10,3) DEFAULT NULL,
  `extra_discount_amount` double(10,2) DEFAULT NULL,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_price_offer_items_sales_price_offer_id_foreign` (`sales_price_offer_id`),
  KEY `sales_price_offer_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `sales_price_offer_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `sales_price_offer_items_sales_price_offer_id_foreign` FOREIGN KEY (`sales_price_offer_id`) REFERENCES `sales_price_offers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_price_offer_items`
--


--
-- Table structure for table `sales_price_offers`
--

CREATE TABLE `sales_price_offers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `representative_id` bigint unsigned DEFAULT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash' COMMENT 'cash/receivable',
  `client_id` bigint unsigned DEFAULT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `price_type_id` bigint unsigned NOT NULL,
  `client_name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_method_id` bigint unsigned DEFAULT NULL,
  `selected_payment_way` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` double(10,2) NOT NULL,
  `extra_discount_amount` double(10,3) DEFAULT NULL,
  `client_discount_ratio` double DEFAULT NULL,
  `status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft' COMMENT 'draft/active',
  `notice` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_price_offers_employee_id_foreign` (`employee_id`),
  KEY `sales_price_offers_representative_id_foreign` (`representative_id`),
  KEY `sales_price_offers_client_id_foreign` (`client_id`),
  KEY `sales_price_offers_branch_id_foreign` (`branch_id`),
  KEY `sales_price_offers_price_type_id_foreign` (`price_type_id`),
  CONSTRAINT `sales_price_offers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `sales_price_offers_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `sales_price_offers_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `sales_price_offers_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `barcode_price_types` (`id`),
  CONSTRAINT `sales_price_offers_representative_id_foreign` FOREIGN KEY (`representative_id`) REFERENCES `representatives` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_price_offers`
--


--
-- Table structure for table `sellers`
--

CREATE TABLE `sellers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sellers`
--


--
-- Table structure for table `service_invoice_items`
--

CREATE TABLE `service_invoice_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `service_invoice_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `tax_id` bigint unsigned DEFAULT NULL,
  `amount` double(13,3) NOT NULL,
  `tax_amount` double(13,3) DEFAULT NULL,
  `cost_center_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `service_invoice_items_service_invoice_id_foreign` (`service_invoice_id`),
  KEY `service_invoice_items_account_id_foreign` (`account_id`),
  KEY `service_invoice_items_tax_id_foreign` (`tax_id`),
  KEY `service_invoice_items_cost_center_id_foreign` (`cost_center_id`),
  CONSTRAINT `service_invoice_items_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `service_invoice_items_cost_center_id_foreign` FOREIGN KEY (`cost_center_id`) REFERENCES `cost_centers` (`id`),
  CONSTRAINT `service_invoice_items_service_invoice_id_foreign` FOREIGN KEY (`service_invoice_id`) REFERENCES `service_invoices` (`id`),
  CONSTRAINT `service_invoice_items_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `taxes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `service_invoice_items`
--


--
-- Table structure for table `service_invoices`
--

CREATE TABLE `service_invoices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `period_id` bigint unsigned NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(13,3) DEFAULT NULL,
  `accrued_amount` double(13,3) DEFAULT NULL,
  `post_status` smallint NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `fotara_saved_at` datetime DEFAULT NULL,
  `audit_status` tinyint(1) NOT NULL DEFAULT '0',
  `debit_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'cash or receivable',
  `receivable_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'name of customer (cash/receivable)',
  `debit_account_id` bigint unsigned DEFAULT NULL COMMENT 'when type is cash',
  `debit_receivable_id` bigint unsigned DEFAULT NULL COMMENT 'when type is receivable',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `service_invoices_year_id_foreign` (`year_id`),
  KEY `service_invoices_period_id_foreign` (`period_id`),
  KEY `service_invoices_employee_id_foreign` (`employee_id`),
  KEY `service_invoices_debit_account_id_foreign` (`debit_account_id`),
  KEY `service_invoices_debit_receivable_id_foreign` (`debit_receivable_id`),
  CONSTRAINT `service_invoices_debit_account_id_foreign` FOREIGN KEY (`debit_account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `service_invoices_debit_receivable_id_foreign` FOREIGN KEY (`debit_receivable_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `service_invoices_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `service_invoices_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `fiscal_periods` (`id`),
  CONSTRAINT `service_invoices_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `service_invoices`
--


--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--


--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `settings_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES (1,'sub_users_count','5'),(2,'buildings_count','10'),(3,'floors_count_to_each_building','10'),(4,'warehouses_count','10'),(5,'company_info','{\"name\":\"pos-test\",\"en_name\":\"pos-test\",\"phone\":\"0777777777\",\"fax\":\"\",\"email\":\"info@miskgrouptech.com\",\"website\":\"\",\"address\":{\"governorate\":\"\",\"neighborhood\":\"\",\"street\":\"\"},\"owner\":\"pos-test\",\"register_date\":\"\",\"under_tax\":\"\",\"tax_number\":\"\",\"id_number\":\"\"}'),(6,'fotara_config','{\"is_enabled\":false,\"company_name\":\"\",\"income_seq_number\":\"\",\"client_id\":\"\",\"secret_key\":\"\"}'),(7,'fotara_posting_type','per_day'),(8,'fotara_lock_at',NULL),(9,'logo',NULL),(10,'auditing_step','1'),(11,'checks_box_step','1'),(12,'bonds_unpost','{\"entries\":true,\"receipts\":true,\"exchanges\":true,\"serviceInvoices\":true,\"returnedServiceBonds\":true,\"debitNotes\":true,\"creditNotes\":true}'),(13,'bonds_autopost','{\"entries\":false,\"receipts\":false,\"exchanges\":false,\"serviceInvoices\":false,\"returnedServiceBonds\":false,\"debitNotes\":false,\"creditNotes\":false}'),(14,'accounting_bonds_printing_after_save','{\"entries\":true,\"receipts\":true,\"exchanges\":true,\"serviceInvoices\":true,\"returnedServiceBonds\":true,\"debitNotes\":true,\"creditNotes\":true}'),(15,'warehouses_bonds_printing_after_save','{\"entryBonds\":true,\"outBonds\":true,\"convertBonds\":true,\"manufacturingBonds\":true,\"purchasesOrders\":true,\"purchasesCommands\":true,\"purchasesInvoices\":true,\"returnedPurchasesBonds\":true,\"salesInvoices\":true,\"salesOrders\":true,\"returnedSalesBonds\":true,\"stocktakingBonds\":true,\"salesPriceOffers\":true,\"costIncreaseBonds\":true,\"costDecreaseBonds\":true}'),(16,'daily_ceiling_for_exchange_checks','0'),(17,'automatic_export_rental_contract_invoices','1'),(18,'monthly_distribute_rental_contract_invoices','0'),(19,'start_date','2025-01-01'),(20,'end_date','2027-12-30'),(21,'default_currency','1'),(22,'decimal_places','3'),(23,'active_accounts_for_cost_centers','[]'),(24,'active_modules_for_cost_centers','[]'),(25,'normal_rental_invoices_posting_account','76'),(26,'services_rental_invoices_posting_account','76'),(27,'knowledge_rental_invoices_posting_account','76'),(28,'normal_rental_invoices_monthly_distribution_account','112'),(29,'services_rental_invoices_monthly_distribution_account','113'),(30,'knowledge_rental_invoices_monthly_distribution_account','112'),(31,'enable_manual_auditing_for_manufacturing','1'),(32,'enable_post_manufacturing_expenses_to_accounting','1'),(33,'debit_account_for_manufacturing_expenses_posting','5'),(34,'ar_purchase_order_conditions','[]'),(35,'en_purchase_order_conditions','[]'),(36,'allowed_purchase_invoice_date_before_days_count','20'),(37,'warehouses_bonds_autopost','{\"entryBonds\":false,\"outBonds\":false,\"convertBonds\":false,\"manufacturingBonds\":false,\"stocktakingBonds\":false,\"purchasesInvoices\":false,\"returnedPurchasesBonds\":false,\"salesInvoices\":false,\"returnedSalesBonds\":false}'),(38,'deletable_accounting_bonds','{\"entries\":false,\"receipts\":false,\"exchanges\":false,\"serviceInvoices\":false,\"returnedServiceBonds\":false,\"debitNotes\":false,\"creditNotes\":false}'),(39,'deletable_warehouses_bonds','{\"entryBonds\":false,\"outBonds\":false,\"convertBonds\":false,\"manufacturingBonds\":false,\"purchasesOrders\":false,\"purchasesCommands\":false,\"purchasesInvoices\":false,\"returnedPurchasesBonds\":false,\"salesInvoices\":false,\"salesOrders\":false,\"returnedSalesBonds\":false,\"stocktakingBonds\":false,\"salesPriceOffers\":false,\"costIncreaseBonds\":false,\"costDecreaseBonds\":false}'),(40,'print_options','{\"show_header\":true,\"show_footer\":true}'),(41,'initial_balances_account_in_rental_contracts','89'),(42,'finished_tour','0'),(43,'show_barcode_image_on_pos_scan','1'),(44,'allowing_sale_not_exist_items','0'),(45,'allowing_sale_not_exist_items_on_pos','0'),(46,'pos_taking_out_items_quantity_option','direct'),(47,'allowing_edit_price_for_editable_price_items','0'),(48,'allowing_show_available_quantity_for_barcodes','0'),(49,'allowing_show_cost_in_find_item','0'),(50,'track_items_expire_date_on_pos','0'),(51,'items_prices_with_tax_in_pos','[]'),(52,'scale_barcode_type','weight'),(53,'scale_first_digits','21'),(54,'pos_order_number_start','1'),(55,'pos_returend_period','0'),(56,'pos_order_number_end','100'),(57,'enable_auto_close_for_pos_days','0'),(58,'hours_count_to_wait_for_auto_close_pos_days',NULL),(59,'enable_to_close_pos_day_when_prev_day_is_not_closed','0'),(60,'enable_auto_close_cash_for_boxes','0'),(61,'hour_to_auto_close_cash_for_boxes','00:00'),(62,'pos_printers_settings','{\"logo_content\":null,\"lang\":\"ar\",\"header_1\":null,\"header_2\":null,\"footer_1\":null}'),(63,'pos_allowing_edit_quantity_for_items','1'),(64,'auto_generated_barcode_number_length','5'),(65,'is_item_price_required','0'),(66,'item_number_way','normal_sequence'),(67,'item_number_multi_parts','{\"country\":false,\"supplier\":false,\"category\":false,\"general_classification\":false}'),(68,'item_number_single_part',NULL),(69,'selected_print_templates','{\"salesOffer\":1,\"salesOrder\":3,\"salesInvoice\":5,\"returnedSalesBond\":8}'),(70,'warehouses_bonds_number_way','{\"EntryBond\":\"forever_sequence\",\"OutBond\":\"forever_sequence\",\"ConvertBond\":\"forever_sequence\",\"ManufacturingBond\":\"forever_sequence\",\"StocktakingBond\":\"forever_sequence\",\"PurchaseOrder\":\"forever_sequence\",\"PurchaseCommand\":\"forever_sequence\",\"PurchaseInvoice\":\"forever_sequence\",\"ReturnedPurchaseBond\":\"forever_sequence\",\"SalesOrder\":\"forever_sequence\",\"SalesInvoice\":\"forever_sequence\",\"ReturnedSalesBond\":\"forever_sequence\",\"SalesPriceOffer\":\"forever_sequence\"}'),(71,'accounting_bonds_number_way','{\"ReceiptEntry\":\"forever_sequence\",\"ExchangeEntry\":\"forever_sequence\",\"ServiceInvoice\":\"forever_sequence\",\"ReturnedServiceBond\":\"forever_sequence\",\"DebitNote\":\"forever_sequence\",\"CreditNote\":\"forever_sequence\"}'),(72,'ar_sales_order_conditions','[]'),(73,'en_sales_order_conditions','[]'),(74,'ar_sales_price_offers_conditions','[]'),(75,'en_sales_price_offers_conditions','[]'),(76,'pos_content_lang','english'),(77,'sales_show_entry_bond','0'),(78,'sales_show_out_bond','0'),(79,'sales_show_original_price','0'),(80,'allow_slip_discount_on_undiscountable_items','0'),(81,'allow_direct_costing_for_minus_batches','1'),(82,'allow_auto_manufacturing','0'),(83,'allow_duplicated_items_in_bonds','{\"entryBonds\":false,\"outBonds\":false,\"purchasesInvoices\":false,\"salesInvoices\":false}'),(84,'default-receipt.cash-account','5'),(85,'default-receipt.check.checksBox-account','9'),(86,'default-receipt.check.underCollection-account','22'),(87,'default-receipt.check.bank-account','7'),(88,'default-receipt.transfer-account','7'),(89,'default-receipt.ewallet-account','11'),(90,'default-exchange.cash-account','5'),(91,'default-exchange.check-account','67'),(92,'default-exchange.transfer-account','7'),(93,'default-exchange.ewallet-account','11'),(94,'default-serviceInvoice-account','112'),(95,'default-returnedServiceBond-account','112'),(96,'enable_automatic_manufacturing_pos','0');

--
-- Table structure for table `shipment_bond_items`
--

CREATE TABLE `shipment_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `shipment_bond_id` bigint unsigned NOT NULL,
  `sales_invoice_id` bigint unsigned NOT NULL,
  `delivered_status` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `shipment_bond_items_shipment_bond_id_foreign` (`shipment_bond_id`),
  KEY `shipment_bond_items_sales_invoice_id_foreign` (`sales_invoice_id`),
  CONSTRAINT `shipment_bond_items_sales_invoice_id_foreign` FOREIGN KEY (`sales_invoice_id`) REFERENCES `sales_invoices` (`id`),
  CONSTRAINT `shipment_bond_items_shipment_bond_id_foreign` FOREIGN KEY (`shipment_bond_id`) REFERENCES `shipment_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shipment_bond_items`
--


--
-- Table structure for table `shipment_bonds`
--

CREATE TABLE `shipment_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` bigint unsigned DEFAULT NULL,
  `from_date` datetime NOT NULL,
  `to_date` datetime NOT NULL,
  `driver_id` bigint unsigned NOT NULL,
  `delivery_car_id` bigint unsigned NOT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `delivery_status` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shipment_bonds_employee_id_foreign` (`employee_id`),
  KEY `shipment_bonds_driver_id_foreign` (`driver_id`),
  KEY `shipment_bonds_delivery_car_id_foreign` (`delivery_car_id`),
  CONSTRAINT `shipment_bonds_delivery_car_id_foreign` FOREIGN KEY (`delivery_car_id`) REFERENCES `delivery_cars` (`id`),
  CONSTRAINT `shipment_bonds_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`),
  CONSTRAINT `shipment_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shipment_bonds`
--


--
-- Table structure for table `shop_merges`
--

CREATE TABLE `shop_merges` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `shop_id` bigint unsigned NOT NULL,
  `merged_shop_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shop_merges_shop_id_foreign` (`shop_id`),
  KEY `shop_merges_merged_shop_id_foreign` (`merged_shop_id`),
  CONSTRAINT `shop_merges_merged_shop_id_foreign` FOREIGN KEY (`merged_shop_id`) REFERENCES `shops` (`id`),
  CONSTRAINT `shop_merges_shop_id_foreign` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shop_merges`
--


--
-- Table structure for table `shops`
--

CREATE TABLE `shops` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `floor_id` bigint unsigned NOT NULL,
  `number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `area` double(10,3) NOT NULL,
  `price` double(10,3) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `is_rented` tinyint(1) NOT NULL DEFAULT '0',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shops_floor_id_foreign` (`floor_id`),
  CONSTRAINT `shops_floor_id_foreign` FOREIGN KEY (`floor_id`) REFERENCES `floors` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shops`
--


--
-- Table structure for table `signatures`
--

CREATE TABLE `signatures` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `signatures`
--


--
-- Table structure for table `standard_purchase_invoice_expenses`
--

CREATE TABLE `standard_purchase_invoice_expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `standard_purchase_invoice_expenses_account_id_foreign` (`account_id`),
  CONSTRAINT `standard_purchase_invoice_expenses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `standard_purchase_invoice_expenses`
--


--
-- Table structure for table `standard_sales_invoice_expenses`
--

CREATE TABLE `standard_sales_invoice_expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `standard_sales_invoice_expenses_account_id_foreign` (`account_id`),
  CONSTRAINT `standard_sales_invoice_expenses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `standard_sales_invoice_expenses`
--


--
-- Table structure for table `stocktaking_bond_items`
--

CREATE TABLE `stocktaking_bond_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `stocktaking_bond_id` bigint unsigned NOT NULL,
  `barcode_id` bigint unsigned NOT NULL,
  `expected_available_quantity` double NOT NULL DEFAULT '1',
  `real_available_quantity` double NOT NULL DEFAULT '1',
  `avg_cost` double DEFAULT NULL,
  `expire_date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stocktaking_bond_items_stocktaking_bond_id_foreign` (`stocktaking_bond_id`),
  KEY `stocktaking_bond_items_barcode_id_foreign` (`barcode_id`),
  CONSTRAINT `stocktaking_bond_items_barcode_id_foreign` FOREIGN KEY (`barcode_id`) REFERENCES `barcodes` (`id`),
  CONSTRAINT `stocktaking_bond_items_stocktaking_bond_id_foreign` FOREIGN KEY (`stocktaking_bond_id`) REFERENCES `stocktaking_bonds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `stocktaking_bond_items`
--


--
-- Table structure for table `stocktaking_bonds`
--

CREATE TABLE `stocktaking_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` bigint unsigned NOT NULL,
  `bond_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` bigint unsigned NOT NULL,
  `filter_by` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `selected_categories_ids` text COLLATE utf8mb4_unicode_ci,
  `selected_suppliers_ids` text COLLATE utf8mb4_unicode_ci,
  `selected_items_ids` text COLLATE utf8mb4_unicode_ci,
  `selected_barcodes_ids` text COLLATE utf8mb4_unicode_ci,
  `notice` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `post_status` tinyint(1) NOT NULL DEFAULT '0',
  `posted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stocktaking_bonds_employee_id_foreign` (`employee_id`),
  KEY `stocktaking_bonds_branch_id_foreign` (`branch_id`),
  CONSTRAINT `stocktaking_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `stocktaking_bonds_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `stocktaking_bonds`
--


--
-- Table structure for table `taxes`
--

CREATE TABLE `taxes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `value` int NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `taxes_account_id_foreign` (`account_id`),
  CONSTRAINT `taxes_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `taxes`
--

INSERT INTO `taxes` VALUES (1,0,72,1,0),(2,2,72,1,0),(3,4,72,1,0),(4,5,72,1,0),(5,10,72,1,0),(6,16,72,1,0);

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_decimal` tinyint(1) NOT NULL DEFAULT '0',
  `unit_id` bigint unsigned DEFAULT NULL,
  `unit_count` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `units_unit_id_foreign` (`unit_id`),
  CONSTRAINT `units_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `units`
--

INSERT INTO `units` VALUES (1,'PC',0,NULL,NULL),(2,'KG',1,NULL,NULL),(3,'Liter',1,NULL,NULL),(4,'Meter',1,NULL,NULL),(5,'CM',1,NULL,NULL);

--
-- Table structure for table `updated_shops`
--

CREATE TABLE `updated_shops` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `shop_id` bigint unsigned NOT NULL,
  `number` int NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `area` double(10,3) NOT NULL,
  `price` double(10,3) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `notice` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `updated_shops_shop_id_foreign` (`shop_id`),
  CONSTRAINT `updated_shops_shop_id_foreign` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `updated_shops`
--


--
-- Table structure for table `warehouses_signatures`
--

CREATE TABLE `warehouses_signatures` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bond_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouses_signatures`
--


--
-- Table structure for table `withdrawal_bonds`
--

CREATE TABLE `withdrawal_bonds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `branch_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `date` date NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash' COMMENT 'cash/debit',
  `amount` double NOT NULL,
  `box_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned DEFAULT NULL,
  `note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `withdrawal_bonds_branch_id_foreign` (`branch_id`),
  KEY `withdrawal_bonds_user_id_foreign` (`user_id`),
  KEY `withdrawal_bonds_box_id_foreign` (`box_id`),
  KEY `withdrawal_bonds_client_id_foreign` (`client_id`),
  CONSTRAINT `withdrawal_bonds_box_id_foreign` FOREIGN KEY (`box_id`) REFERENCES `boxes` (`id`),
  CONSTRAINT `withdrawal_bonds_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`),
  CONSTRAINT `withdrawal_bonds_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `withdrawal_bonds_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `pos_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `withdrawal_bonds`
--


--
-- Table structure for table `year_account_balances`
--

CREATE TABLE `year_account_balances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  `initial_balance` double(13,3) NOT NULL DEFAULT '0.000',
  `debit_balance` double(13,3) NOT NULL DEFAULT '0.000',
  `credit_balance` double(13,3) NOT NULL DEFAULT '0.000',
  PRIMARY KEY (`id`),
  KEY `year_account_balances_year_id_foreign` (`year_id`),
  KEY `year_account_balances_account_id_foreign` (`account_id`),
  CONSTRAINT `year_account_balances_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`),
  CONSTRAINT `year_account_balances_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `year_account_balances`
--


--
-- Table structure for table `year_receivable_account_balances`
--

CREATE TABLE `year_receivable_account_balances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `year_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  `initial_balance` double(13,3) NOT NULL DEFAULT '0.000',
  `debit_balance` double(13,3) NOT NULL DEFAULT '0.000',
  `credit_balance` double(13,3) NOT NULL DEFAULT '0.000',
  PRIMARY KEY (`id`),
  KEY `year_receivable_account_balances_year_id_foreign` (`year_id`),
  KEY `year_receivable_account_balances_account_id_foreign` (`account_id`),
  CONSTRAINT `year_receivable_account_balances_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `receivable_accounts` (`id`),
  CONSTRAINT `year_receivable_account_balances_year_id_foreign` FOREIGN KEY (`year_id`) REFERENCES `fiscal_years` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `year_receivable_account_balances`
--


--
-- Table structure for table `yearly_contract_amounts`
--

CREATE TABLE `yearly_contract_amounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contract_id` bigint unsigned NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  `amount` double(13,3) NOT NULL,
  `has_knowledge_tax` tinyint(1) NOT NULL DEFAULT '0',
  `knowledge_tax_ratio` double DEFAULT NULL,
  `has_services_amount` tinyint(1) NOT NULL DEFAULT '0',
  `services_ratio` double DEFAULT NULL,
  `services_payment_way` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'yearly, monthly, quarter, daily, oneTime',
  `increment_ratio` double DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yearly_contract_amounts_contract_id_foreign` (`contract_id`),
  CONSTRAINT `yearly_contract_amounts_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `rental_contracts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `yearly_contract_amounts`
--



