From cf833c479fab0033d7eeffa0458eb533f2f6147c Mon Sep 17 00:00:00 2001 From: "HOME\\leonm" Date: Sun, 16 May 2021 19:16:10 +0300 Subject: [PATCH] v5.1.0 --- db/db.sql | 2734 +++++++++-------- db/temp.sql | 25 +- db/update500to510.sql | 24 - www/app/api/customers.php | 1 + www/app/api/docs.php | 2 + www/app/api/items.php | 27 +- www/app/entity/doc/document.php | 8 +- www/app/pages/main.php | 4 +- www/app/pages/reference/itemlist.php | 22 +- www/app/pages/userlogin.php | 2 +- www/composer.json | 2 +- www/composer.lock | 24 +- www/templates/pages/reference/itemlist.html | 9 +- www/templates/pages/userlogin.html | 3 +- .../pages/reference/itemlist.html | 7 +- www/templates_ua/pages/userlogin.html | 3 +- 16 files changed, 1477 insertions(+), 1420 deletions(-) diff --git a/db/db.sql b/db/db.sql index 9e277b6f6..05dd35941 100644 --- a/db/db.sql +++ b/db/db.sql @@ -1,1342 +1,1392 @@ - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES cp1251 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `branches`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `branches` ( - `branch_id` int(11) NOT NULL AUTO_INCREMENT, - `branch_name` varchar(255) NOT NULL, - `details` longtext NOT NULL, - `disabled` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`branch_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `contracts`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `contracts` ( - `contract_id` int(11) NOT NULL AUTO_INCREMENT, - `customer_id` int(11) DEFAULT '0', - `firm_id` int(11) DEFAULT '0', - `createdon` date NOT NULL, - `contract_number` varchar(64) NOT NULL, - `disabled` tinyint(1) DEFAULT '0', - `details` longtext NOT NULL, - PRIMARY KEY (`contract_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `contracts_view`; -/*!50001 DROP VIEW IF EXISTS `contracts_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `contracts_view` AS SELECT - 1 AS `contract_id`, - 1 AS `customer_id`, - 1 AS `firm_id`, - 1 AS `createdon`, - 1 AS `contract_number`, - 1 AS `disabled`, - 1 AS `details`, - 1 AS `customer_name`, - 1 AS `firm_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `customers`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `customers` ( - `customer_id` int(11) NOT NULL AUTO_INCREMENT, - `customer_name` varchar(255) DEFAULT NULL, - `detail` mediumtext NOT NULL, - `email` varchar(64) DEFAULT NULL, - `phone` varchar(64) DEFAULT NULL, - `status` smallint(4) NOT NULL DEFAULT '0', - `city` varchar(255) DEFAULT NULL, - `leadstatus` varchar(255) DEFAULT NULL, - `leadsource` varchar(255) DEFAULT NULL, - `createdon` date DEFAULT NULL, - PRIMARY KEY (`customer_id`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `customers_view`; -/*!50001 DROP VIEW IF EXISTS `customers_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `customers_view` AS SELECT - 1 AS `customer_id`, - 1 AS `customer_name`, - 1 AS `detail`, - 1 AS `email`, - 1 AS `phone`, - 1 AS `status`, - 1 AS `city`, - 1 AS `leadsource`, - 1 AS `leadstatus`, - 1 AS `mcnt`, - 1 AS `fcnt`, - 1 AS `ecnt`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `docstatelog`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `docstatelog` ( - `log_id` bigint(20) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `document_id` int(11) NOT NULL, - `docstate` smallint(6) NOT NULL, - `createdon` datetime NOT NULL, - `hostname` varchar(64) NOT NULL, - PRIMARY KEY (`log_id`), - KEY `document_id` (`document_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1687 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `docstatelog_view`; -/*!50001 DROP VIEW IF EXISTS `docstatelog_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `docstatelog_view` AS SELECT - 1 AS `log_id`, - 1 AS `user_id`, - 1 AS `document_id`, - 1 AS `docstate`, - 1 AS `createdon`, - 1 AS `hostname`, - 1 AS `username`, - 1 AS `document_number`, - 1 AS `meta_desc`, - 1 AS `meta_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `documents`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `documents` ( - `document_id` int(11) NOT NULL AUTO_INCREMENT, - `document_number` varchar(45) NOT NULL, - `document_date` date NOT NULL, - `user_id` int(11) NOT NULL, - `content` longtext, - `amount` decimal(11,2) DEFAULT NULL, - `meta_id` int(11) NOT NULL, - `state` tinyint(4) NOT NULL, - `notes` varchar(255) NOT NULL, - `customer_id` int(11) DEFAULT '0', - `payamount` decimal(11,2) DEFAULT '0.00', - `payed` decimal(11,2) DEFAULT '0.00', - `branch_id` int(11) DEFAULT '0', - `parent_id` bigint(20) DEFAULT '0', - `firm_id` int(11) DEFAULT NULL, - PRIMARY KEY (`document_id`), - UNIQUE KEY `unuqnumber` (`meta_id`,`document_number`,`branch_id`), - KEY `document_date` (`document_date`), - KEY `customer_id` (`customer_id`), - KEY `user_id` (`user_id`), - KEY `branch_id` (`branch_id`), - CONSTRAINT `documents_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=463 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `documents_view`; -/*!50001 DROP VIEW IF EXISTS `documents_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `documents_view` AS SELECT - 1 AS `document_id`, - 1 AS `document_number`, - 1 AS `document_date`, - 1 AS `user_id`, - 1 AS `content`, - 1 AS `amount`, - 1 AS `meta_id`, - 1 AS `username`, - 1 AS `customer_id`, - 1 AS `customer_name`, - 1 AS `state`, - 1 AS `notes`, - 1 AS `payamount`, - 1 AS `payed`, - 1 AS `parent_id`, - 1 AS `branch_id`, - 1 AS `branch_name`, - 1 AS `firm_id`, - 1 AS `firm_name`, - 1 AS `meta_name`, - 1 AS `meta_desc`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `employees`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `employees` ( - `employee_id` int(11) NOT NULL AUTO_INCREMENT, - `login` varchar(64) DEFAULT NULL, - `detail` mediumtext, - `disabled` tinyint(1) DEFAULT '0', - `emp_name` varchar(64) NOT NULL, - `branch_id` int(11) DEFAULT '0', - PRIMARY KEY (`employee_id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `entrylist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `entrylist` ( - `entry_id` bigint(20) NOT NULL AUTO_INCREMENT, - `document_id` int(11) NOT NULL, - `amount` decimal(11,2) NOT NULL DEFAULT '0.00', - `quantity` decimal(11,3) DEFAULT '0.000', - `extcode` int(11) DEFAULT NULL, - `stock_id` int(11) DEFAULT NULL, - `service_id` int(11) DEFAULT NULL, - `outprice` decimal(10,2) DEFAULT NULL, - PRIMARY KEY (`entry_id`), - KEY `document_id` (`document_id`), - KEY `stock_id` (`stock_id`), - CONSTRAINT `entrylist_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`), - CONSTRAINT `entrylist_ibfk_2` FOREIGN KEY (`stock_id`) REFERENCES `store_stock` (`stock_id`) -) ENGINE=InnoDB AUTO_INCREMENT=961 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - -/*!50003 SET @saved_cs_client = @@character_set_client */ ; -/*!50003 SET @saved_cs_results = @@character_set_results */ ; -/*!50003 SET @saved_col_connection = @@collation_connection */ ; -/*!50003 SET character_set_client = latin1 */ ; -/*!50003 SET character_set_results = latin1 */ ; -/*!50003 SET collation_connection = latin1_swedish_ci */ ; -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; -DELIMITER ;; -/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `entrylist_after_ins_tr` AFTER INSERT ON `entrylist` - FOR EACH ROW -BEGIN - - - - IF new.stock_id >0 then - - update store_stock set qty=(select coalesce(sum(quantity),0) from entrylist where stock_id=new.stock_id) where store_stock.stock_id = new.stock_id; - END IF; -END */;; -DELIMITER ; -/*!50003 SET sql_mode = @saved_sql_mode */ ; -/*!50003 SET character_set_client = @saved_cs_client */ ; -/*!50003 SET character_set_results = @saved_cs_results */ ; -/*!50003 SET collation_connection = @saved_col_connection */ ; - - -/*!50003 SET @saved_cs_client = @@character_set_client */ ; -/*!50003 SET @saved_cs_results = @@character_set_results */ ; -/*!50003 SET @saved_col_connection = @@collation_connection */ ; -/*!50003 SET character_set_client = latin1 */ ; -/*!50003 SET character_set_results = latin1 */ ; -/*!50003 SET collation_connection = latin1_swedish_ci */ ; -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; -DELIMITER ;; -/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `entrylist_after_del_tr` AFTER DELETE ON `entrylist` - FOR EACH ROW -BEGIN - - - IF old.stock_id >0 then - - update store_stock set qty=(select coalesce(sum(quantity),0) from entrylist where stock_id=old.stock_id) where store_stock.stock_id = old.stock_id; - END IF; -END */;; -DELIMITER ; -/*!50003 SET sql_mode = @saved_sql_mode */ ; -/*!50003 SET character_set_client = @saved_cs_client */ ; -/*!50003 SET character_set_results = @saved_cs_results */ ; -/*!50003 SET collation_connection = @saved_col_connection */ ; - -DROP TABLE IF EXISTS `entrylist_view`; -/*!50001 DROP VIEW IF EXISTS `entrylist_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `entrylist_view` AS SELECT - 1 AS `entry_id`, - 1 AS `document_id`, - 1 AS `amount`, - 1 AS `quantity`, - 1 AS `customer_id`, - 1 AS `extcode`, - 1 AS `stock_id`, - 1 AS `service_id`, - 1 AS `item_id`, - 1 AS `partion`, - 1 AS `document_date`, - 1 AS `outprice`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `equipments`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `equipments` ( - `eq_id` int(11) NOT NULL AUTO_INCREMENT, - `eq_name` varchar(255) DEFAULT NULL, - `detail` mediumtext, - `disabled` tinyint(1) DEFAULT '0', - `description` text, - PRIMARY KEY (`eq_id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `eventlist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `eventlist` ( - `user_id` int(11) NOT NULL, - `eventdate` datetime NOT NULL, - `title` varchar(255) NOT NULL, - `description` text NOT NULL, - `isdone` TINYINT(1) NOT NULL DEFAULT 0 , - `event_id` int(11) NOT NULL AUTO_INCREMENT, - `customer_id` int(11) NOT NULL, - PRIMARY KEY (`event_id`), - KEY `user_id` (`user_id`), - KEY `customer_id` (`customer_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `eventlist_view`; -/*!50001 DROP VIEW IF EXISTS `eventlist_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `eventlist_view` AS SELECT - 1 AS `user_id`, - 1 AS `eventdate`, - 1 AS `title`, - 1 AS `description`, - 1 AS `isdone`, - 1 AS `event_id`, - 1 AS `customer_id`, - 1 AS `customer_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `files`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `files` ( - `file_id` int(11) NOT NULL AUTO_INCREMENT, - `item_id` int(11) DEFAULT NULL, - `filename` varchar(255) DEFAULT NULL, - `description` varchar(255) DEFAULT NULL, - `item_type` int(11) NOT NULL, - `mime` varchar(16) DEFAULT NULL, - PRIMARY KEY (`file_id`), - KEY `item_id` (`item_id`) -) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `filesdata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `filesdata` ( - `file_id` int(11) DEFAULT NULL, - `filedata` longblob, - UNIQUE KEY `file_id` (`file_id`) -) ENGINE=MYISAM DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `firms`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `firms` ( - `firm_id` int(11) NOT NULL AUTO_INCREMENT, - `firm_name` varchar(255) NOT NULL, - `details` longtext NOT NULL, - `disabled` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`firm_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `images`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `images` ( - `image_id` int(11) NOT NULL AUTO_INCREMENT, - `content` longblob NOT NULL, - `mime` varchar(16) DEFAULT NULL, - `thumb` longblob, - PRIMARY KEY (`image_id`) -) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `issue_history`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `issue_history` ( - `hist_id` bigint(20) NOT NULL AUTO_INCREMENT, - `issue_id` int(11) NOT NULL, - `createdon` date NOT NULL, - `user_id` int(11) NOT NULL, - `description` varchar(255) NOT NULL, - PRIMARY KEY (`hist_id`), - KEY `issue_id` (`issue_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `issue_issuelist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `issue_issuelist` ( - `issue_id` int(11) NOT NULL AUTO_INCREMENT, - `issue_name` varchar(255) NOT NULL, - `details` longtext NOT NULL, - `status` smallint(6) NOT NULL, - `priority` tinyint(4) NOT NULL, - `user_id` int(11) NOT NULL, - `lastupdate` datetime DEFAULT NULL, - `project_id` int(11) NOT NULL, - PRIMARY KEY (`issue_id`), - KEY `project_id` (`project_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `issue_issuelist_view`; -/*!50001 DROP VIEW IF EXISTS `issue_issuelist_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `issue_issuelist_view` AS SELECT - 1 AS `issue_id`, - 1 AS `issue_name`, - 1 AS `details`, - 1 AS `status`, - 1 AS `priority`, - 1 AS `user_id`, - 1 AS `lastupdate`, - 1 AS `project_id`, - 1 AS `username`, - 1 AS `project_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `issue_projectacc`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `issue_projectacc` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `project_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `issue_projectlist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `issue_projectlist` ( - `project_id` int(11) NOT NULL AUTO_INCREMENT, - `project_name` varchar(255) NOT NULL, - `details` longtext NOT NULL, - `customer_id` int(11) DEFAULT NULL, - `status` smallint(6) DEFAULT NULL, - PRIMARY KEY (`project_id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `issue_projectlist_view`; -/*!50001 DROP VIEW IF EXISTS `issue_projectlist_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `issue_projectlist_view` AS SELECT - 1 AS `project_id`, - 1 AS `project_name`, - 1 AS `details`, - 1 AS `customer_id`, - 1 AS `status`, - 1 AS `customer_name`, - 1 AS `inew`, - 1 AS `iproc`, - 1 AS `iclose`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `issue_time`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `issue_time` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `issue_id` int(11) NOT NULL, - `createdon` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `duration` decimal(10,2) DEFAULT NULL, - `notes` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `issue_id` (`issue_id`) -) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `issue_time_view`; -/*!50001 DROP VIEW IF EXISTS `issue_time_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `issue_time_view` AS SELECT - 1 AS `id`, - 1 AS `issue_id`, - 1 AS `createdon`, - 1 AS `user_id`, - 1 AS `duration`, - 1 AS `notes`, - 1 AS `username`, - 1 AS `issue_name`, - 1 AS `project_id`, - 1 AS `project_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `item_cat`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `item_cat` ( - `cat_id` int(11) NOT NULL AUTO_INCREMENT, - `cat_name` varchar(255) NOT NULL, - `detail` longtext, - `parent_id` int(11) DEFAULT '0', - PRIMARY KEY (`cat_id`) -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `item_set`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `item_set` ( - `set_id` int(11) NOT NULL AUTO_INCREMENT, - `item_id` int(11) DEFAULT '0', - `pitem_id` int(11) DEFAULT '0', - `qty` decimal(11,3) DEFAULT '0.000', - PRIMARY KEY (`set_id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `item_set_view`; -/*!50001 DROP VIEW IF EXISTS `item_set_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `item_set_view` AS SELECT - 1 AS `set_id`, - 1 AS `item_id`, - 1 AS `pitem_id`, - 1 AS `qty`, - 1 AS `itemname`, - 1 AS `item_code`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `items`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `items` ( - `item_id` int(11) NOT NULL AUTO_INCREMENT, - `itemname` varchar(255) DEFAULT NULL, - `description` longtext, - `detail` longtext NOT NULL, - `item_code` varchar(64) DEFAULT NULL, - `bar_code` varchar(64) DEFAULT NULL, - `cat_id` int(11) NOT NULL, - `msr` varchar(64) DEFAULT NULL, - `disabled` tinyint(1) DEFAULT '0', - `minqty` decimal(11,3) DEFAULT '0.000', - `manufacturer` varchar(355) DEFAULT NULL, - `item_type` int(11) DEFAULT NULL, - PRIMARY KEY (`item_id`), - KEY `item_code` (`item_code`), - KEY `itemname` (`itemname`), - KEY `cat_id` (`cat_id`) -) ENGINE=InnoDB AUTO_INCREMENT=593 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `items_view`; -/*!50001 DROP VIEW IF EXISTS `items_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `items_view` AS SELECT - 1 AS `item_id`, - 1 AS `itemname`, - 1 AS `description`, - 1 AS `detail`, - 1 AS `item_code`, - 1 AS `bar_code`, - 1 AS `cat_id`, - 1 AS `msr`, - 1 AS `disabled`, - 1 AS `minqty`, - 1 AS `item_type`, - 1 AS `manufacturer`, - 1 AS `cat_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `messages`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `messages` ( - `message_id` bigint(20) NOT NULL AUTO_INCREMENT, - `user_id` int(11) DEFAULT NULL, - `created` datetime DEFAULT NULL, - `message` text, - `item_id` int(11) NOT NULL, - `item_type` int(11) DEFAULT NULL, - PRIMARY KEY (`message_id`), - KEY `item_id` (`item_id`) -) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `messages_view`; -/*!50001 DROP VIEW IF EXISTS `messages_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `messages_view` AS SELECT - 1 AS `message_id`, - 1 AS `user_id`, - 1 AS `created`, - 1 AS `message`, - 1 AS `item_id`, - 1 AS `item_type`, - 1 AS `username`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `metadata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `metadata` ( - `meta_id` int(11) NOT NULL AUTO_INCREMENT, - `meta_type` tinyint(11) NOT NULL, - `description` varchar(255) DEFAULT NULL, - `meta_name` varchar(255) NOT NULL, - `menugroup` varchar(255) DEFAULT NULL, - `disabled` tinyint(4) NOT NULL, - PRIMARY KEY (`meta_id`) -) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `mfund`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `mfund` ( - `mf_id` int(11) NOT NULL AUTO_INCREMENT, - `mf_name` varchar(255) NOT NULL, - `description` varchar(255) DEFAULT NULL, - `branch_id` int(11) DEFAULT '0', - `detail` longtext, - PRIMARY KEY (`mf_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `note_fav`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `note_fav` ( - `fav_id` int(11) NOT NULL AUTO_INCREMENT, - `topic_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`fav_id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `note_nodes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `note_nodes` ( - `node_id` int(11) NOT NULL AUTO_INCREMENT, - `pid` int(11) NOT NULL, - `title` varchar(50) NOT NULL, - `mpath` varchar(255) CHARACTER SET latin1 NOT NULL, - `user_id` int(11) DEFAULT NULL, - `ispublic` tinyint(1) DEFAULT '0', - PRIMARY KEY (`node_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `note_nodesview`; -/*!50001 DROP VIEW IF EXISTS `note_nodesview`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `note_nodesview` AS SELECT - 1 AS `node_id`, - 1 AS `pid`, - 1 AS `title`, - 1 AS `mpath`, - 1 AS `user_id`, - 1 AS `ispublic`, - 1 AS `tcnt`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `note_tags`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `note_tags` ( - `tag_id` int(11) NOT NULL AUTO_INCREMENT, - `topic_id` int(11) NOT NULL, - `tagvalue` varchar(255) NOT NULL, - PRIMARY KEY (`tag_id`), - KEY `topic_id` (`topic_id`) -) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `note_topicnode`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `note_topicnode` ( - `topic_id` int(11) NOT NULL, - `node_id` int(11) NOT NULL, - `tn_id` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`tn_id`), - KEY `topic_id` (`topic_id`), - KEY `node_id` (`node_id`) -) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `note_topicnodeview`; -/*!50001 DROP VIEW IF EXISTS `note_topicnodeview`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `note_topicnodeview` AS SELECT - 1 AS `topic_id`, - 1 AS `node_id`, - 1 AS `tn_id`, - 1 AS `title`, - 1 AS `user_id`, - 1 AS `content`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `note_topics`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `note_topics` ( - `topic_id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL, - `content` longtext NOT NULL, - `acctype` smallint(4) DEFAULT '0', - `user_id` int(11) NOT NULL, - PRIMARY KEY (`topic_id`) -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `note_topicsview`; -/*!50001 DROP VIEW IF EXISTS `note_topicsview`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `note_topicsview` AS SELECT - 1 AS `topic_id`, - 1 AS `title`, - 1 AS `content`, - 1 AS `acctype`, - 1 AS `user_id`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `notifies`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `notifies` ( - `notify_id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `dateshow` datetime NOT NULL, - `checked` tinyint(1) NOT NULL DEFAULT '0', - `message` text NOT NULL, - `sender_name` varchar(255) DEFAULT NULL, - PRIMARY KEY (`notify_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `options`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `options` ( - `optname` varchar(64) NOT NULL, - `optvalue` longtext NOT NULL, - UNIQUE KEY `optname` (`optname`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `parealist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `parealist` ( - `pa_id` int(11) NOT NULL AUTO_INCREMENT, - `pa_name` varchar(255) NOT NULL, - PRIMARY KEY (`pa_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `paylist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `paylist` ( - `pl_id` bigint(20) NOT NULL AUTO_INCREMENT, - `document_id` int(11) NOT NULL, - `amount` decimal(11,2) NOT NULL, - `mf_id` int(11) NOT NULL, - `notes` varchar(255) DEFAULT NULL, - `paydate` datetime DEFAULT NULL, - `user_id` int(11) NOT NULL, - `paytype` smallint(6) NOT NULL, - `detail` longtext, - PRIMARY KEY (`pl_id`), - KEY `document_id` (`document_id`), - CONSTRAINT `paylist_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) -) ENGINE=InnoDB AUTO_INCREMENT=419 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `paylist_view`; -/*!50001 DROP VIEW IF EXISTS `paylist_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `paylist_view` AS SELECT - 1 AS `pl_id`, - 1 AS `document_id`, - 1 AS `amount`, - 1 AS `mf_id`, - 1 AS `notes`, - 1 AS `user_id`, - 1 AS `paydate`, - 1 AS `paytype`, - 1 AS `detail`, - 1 AS `document_number`, - 1 AS `username`, - 1 AS `mf_name`, - 1 AS `customer_id`, - 1 AS `customer_name`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `poslist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `poslist` ( - `pos_id` int(11) NOT NULL AUTO_INCREMENT, - `pos_name` varchar(255) NOT NULL, - `details` longtext NOT NULL, - `branch_id` int(11) DEFAULT '0', - PRIMARY KEY (`pos_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `ppo_zformstat`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `ppo_zformstat` ( - `zf_id` int(11) NOT NULL AUTO_INCREMENT, - `pos_id` int(11) NOT NULL, - `checktype` int(11) NOT NULL, - `createdon` datetime NOT NULL, - `document_number` varchar(255) NOT NULL, - `amount0` decimal(10,2) NOT NULL, - `amount1` decimal(10,2) NOT NULL, - `amount2` decimal(10,2) NOT NULL, - `amount3` decimal(10,2) NOT NULL, - PRIMARY KEY (`zf_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `roles`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `roles` ( - `role_id` int(11) NOT NULL AUTO_INCREMENT, - `rolename` varchar(255) DEFAULT NULL, - `acl` mediumtext, - PRIMARY KEY (`role_id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `roles_view`; -/*!50001 DROP VIEW IF EXISTS `roles_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `roles_view` AS SELECT - 1 AS `role_id`, - 1 AS `rolename`, - 1 AS `acl`, - 1 AS `cnt`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `services`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `services` ( - `service_id` int(11) NOT NULL AUTO_INCREMENT, - `service_name` varchar(255) NOT NULL, - `detail` text, - `disabled` tinyint(1) DEFAULT '0', - PRIMARY KEY (`service_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shop_attributes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shop_attributes` ( - `attribute_id` int(11) NOT NULL AUTO_INCREMENT, - `attributename` varchar(64) NOT NULL, - `cat_id` int(11) NOT NULL, - `attributetype` tinyint(4) NOT NULL, - `valueslist` text, - PRIMARY KEY (`attribute_id`) -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shop_attributes_order`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shop_attributes_order` ( - `order_id` int(11) NOT NULL AUTO_INCREMENT, - `attr_id` int(11) NOT NULL, - `pg_id` int(11) NOT NULL, - `ordern` int(11) NOT NULL, - PRIMARY KEY (`order_id`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shop_attributes_view`; -/*!50001 DROP VIEW IF EXISTS `shop_attributes_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `shop_attributes_view` AS SELECT - 1 AS `attribute_id`, - 1 AS `attributename`, - 1 AS `cat_id`, - 1 AS `attributetype`, - 1 AS `valueslist`, - 1 AS `ordern`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `shop_attributevalues`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shop_attributevalues` ( - `attributevalue_id` int(11) NOT NULL AUTO_INCREMENT, - `attribute_id` int(11) NOT NULL, - `item_id` int(11) NOT NULL, - `attributevalue` varchar(255) NOT NULL, - PRIMARY KEY (`attributevalue_id`), - KEY `attribute_id` (`attribute_id`) -) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shop_prod_comments`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `shop_prod_comments` ( - `comment_id` int(11) NOT NULL AUTO_INCREMENT, - `item_id` int(11) NOT NULL, - `author` varchar(64) NOT NULL, - `comment` text NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `rating` tinyint(4) NOT NULL DEFAULT '0', - `moderated` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`comment_id`), - KEY `product_id` (`item_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `shop_products_view`; -/*!50001 DROP VIEW IF EXISTS `shop_products_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `shop_products_view` AS SELECT - 1 AS `item_id`, - 1 AS `itemname`, - 1 AS `description`, - 1 AS `detail`, - 1 AS `item_code`, - 1 AS `bar_code`, - 1 AS `cat_id`, - 1 AS `msr`, - 1 AS `disabled`, - 1 AS `minqty`, - 1 AS `item_type`, - 1 AS `manufacturer`, - 1 AS `cat_name`, - 1 AS `qty`, - 1 AS `comments`, - 1 AS `ratings`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `store_stock`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `store_stock` ( - `stock_id` int(11) NOT NULL AUTO_INCREMENT, - `item_id` int(11) NOT NULL, - `partion` decimal(11,2) DEFAULT NULL, - `store_id` int(11) NOT NULL, - `qty` decimal(11,3) DEFAULT '0.000', - `snumber` varchar(64) DEFAULT NULL, - `sdate` date DEFAULT NULL, - PRIMARY KEY (`stock_id`), - KEY `item_id` (`item_id`), - KEY `store_id` (`store_id`), - CONSTRAINT `store_stock_fk` FOREIGN KEY (`store_id`) REFERENCES `stores` (`store_id`), - CONSTRAINT `store_stock_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`item_id`) -) ENGINE=InnoDB AUTO_INCREMENT=603 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `store_stock_view`; -/*!50001 DROP VIEW IF EXISTS `store_stock_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `store_stock_view` AS SELECT - 1 AS `stock_id`, - 1 AS `item_id`, - 1 AS `partion`, - 1 AS `store_id`, - 1 AS `itemname`, - 1 AS `item_code`, - 1 AS `cat_id`, - 1 AS `msr`, - 1 AS `item_type`, - 1 AS `bar_code`, - 1 AS `cat_name`, - 1 AS `itemdisabled`, - 1 AS `storename`, - 1 AS `qty`, - 1 AS `snumber`, - 1 AS `sdate`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `stores`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `stores` ( - `store_id` int(11) NOT NULL AUTO_INCREMENT, - `storename` varchar(64) DEFAULT NULL, - `description` varchar(255) DEFAULT NULL, - `branch_id` int(11) DEFAULT '0', - PRIMARY KEY (`store_id`) -) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `subscribes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `subscribes` ( - `sub_id` int(11) NOT NULL AUTO_INCREMENT, - `sub_type` int(11) DEFAULT NULL, - `reciever_type` int(11) DEFAULT NULL, - `msg_type` int(11) DEFAULT NULL, - `msgtext` text, - `detail` longtext, - `disabled` int(1) DEFAULT '0', - PRIMARY KEY (`sub_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `timesheet`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `timesheet` ( - `time_id` int(11) NOT NULL AUTO_INCREMENT, - `emp_id` int(11) NOT NULL, - `description` varchar(255) DEFAULT NULL, - `t_start` datetime DEFAULT NULL, - `t_end` datetime DEFAULT NULL, - `t_type` int(11) DEFAULT '0', - `t_break` smallint(6) DEFAULT '0', - PRIMARY KEY (`time_id`), - KEY `emp_id` (`emp_id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `timesheet_view`; -/*!50001 DROP VIEW IF EXISTS `timesheet_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `timesheet_view` AS SELECT - 1 AS `time_id`, - 1 AS `emp_id`, - 1 AS `description`, - 1 AS `t_start`, - 1 AS `t_end`, - 1 AS `t_type`, - 1 AS `t_break`, - 1 AS `emp_name`, - 1 AS `disabled`, - 1 AS `branch_id`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users` ( - `user_id` int(11) NOT NULL AUTO_INCREMENT, - `userlogin` varchar(32) NOT NULL, - `userpass` varchar(255) NOT NULL, - `createdon` date NOT NULL, - `email` varchar(255) DEFAULT NULL, - `acl` mediumtext NOT NULL, - `disabled` int(1) NOT NULL DEFAULT '0', - `options` longtext, - `role_id` int(11) DEFAULT NULL, - PRIMARY KEY (`user_id`), - UNIQUE KEY `userlogin` (`userlogin`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `users_view`; -/*!50001 DROP VIEW IF EXISTS `users_view`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `users_view` AS SELECT - 1 AS `user_id`, - 1 AS `userlogin`, - 1 AS `userpass`, - 1 AS `createdon`, - 1 AS `email`, - 1 AS `acl`, - 1 AS `options`, - 1 AS `disabled`, - 1 AS `rolename`, - 1 AS `role_id`, - 1 AS `roleacl`, - 1 AS `employee_id`, - 1 AS `username`*/; -SET character_set_client = @saved_cs_client; -DROP TABLE IF EXISTS `zformstat`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `zformstat` ( - `zf_id` int(11) NOT NULL AUTO_INCREMENT, - `pos_id` int(11) NOT NULL, - `checktype` int(11) NOT NULL, - `amount0` decimal(10,2) NOT NULL, - `createdon` datetime NOT NULL, - `amount1` decimal(10,2) NOT NULL, - `amount2` decimal(10,2) NOT NULL, - `document_number` varchar(255) NOT NULL, - `amount3` decimal(10,2) NOT NULL, - PRIMARY KEY (`zf_id`) -) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -/*!50001 DROP VIEW IF EXISTS `contracts_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `contracts_view` AS select `co`.`contract_id` AS `contract_id`,`co`.`customer_id` AS `customer_id`,`co`.`firm_id` AS `firm_id`,`co`.`createdon` AS `createdon`,`co`.`contract_number` AS `contract_number`,`co`.`disabled` AS `disabled`,`co`.`details` AS `details`,`cu`.`customer_name` AS `customer_name`,`f`.`firm_name` AS `firm_name` from ((`contracts` `co` join `customers` `cu` on((`co`.`customer_id` = `cu`.`customer_id`))) left join `firms` `f` on((`co`.`firm_id` = `f`.`firm_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `customers_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `customers_view` AS select `customers`.`customer_id` AS `customer_id`,`customers`.`customer_name` AS `customer_name`,`customers`.`detail` AS `detail`,`customers`.`email` AS `email`,`customers`.`phone` AS `phone`,`customers`.`status` AS `status`,`customers`.`city` AS `city`,`customers`.`leadsource` AS `leadsource`,`customers`.`leadstatus` AS `leadstatus`,(select count(0) from `messages` `m` where ((`m`.`item_id` = `customers`.`customer_id`) and (`m`.`item_type` = 2))) AS `mcnt`,(select count(0) from `files` `f` where ((`f`.`item_id` = `customers`.`customer_id`) and (`f`.`item_type` = 2))) AS `fcnt`,(select count(0) from `eventlist` `e` where ((`e`.`customer_id` = `customers`.`customer_id`) and (`e`.`eventdate` >= now()))) AS `ecnt` from `customers` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `docstatelog_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `docstatelog_view` AS select `dl`.`log_id` AS `log_id`,`dl`.`user_id` AS `user_id`,`dl`.`document_id` AS `document_id`,`dl`.`docstate` AS `docstate`,`dl`.`createdon` AS `createdon`,`dl`.`hostname` AS `hostname`,`u`.`username` AS `username`,`d`.`document_number` AS `document_number`,`d`.`meta_desc` AS `meta_desc`,`d`.`meta_name` AS `meta_name` from ((`docstatelog` `dl` join `users_view` `u` on((`dl`.`user_id` = `u`.`user_id`))) join `documents_view` `d` on((`d`.`document_id` = `dl`.`document_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `documents_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `documents_view` AS select `d`.`document_id` AS `document_id`,`d`.`document_number` AS `document_number`,`d`.`document_date` AS `document_date`,`d`.`user_id` AS `user_id`,`d`.`content` AS `content`,`d`.`amount` AS `amount`,`d`.`meta_id` AS `meta_id`,`u`.`username` AS `username`,`c`.`customer_id` AS `customer_id`,`c`.`customer_name` AS `customer_name`,`d`.`state` AS `state`,`d`.`notes` AS `notes`,`d`.`payamount` AS `payamount`,`d`.`payed` AS `payed`,`d`.`parent_id` AS `parent_id`,`d`.`branch_id` AS `branch_id`,`b`.`branch_name` AS `branch_name`,`d`.`firm_id` AS `firm_id`,`f`.`firm_name` AS `firm_name`,`metadata`.`meta_name` AS `meta_name`,`metadata`.`description` AS `meta_desc` from (((((`documents` `d` left join `users_view` `u` on((`d`.`user_id` = `u`.`user_id`))) left join `customers` `c` on((`d`.`customer_id` = `c`.`customer_id`))) join `metadata` on((`metadata`.`meta_id` = `d`.`meta_id`))) left join `branches` `b` on((`d`.`branch_id` = `b`.`branch_id`))) left join `firms` `f` on((`d`.`firm_id` = `f`.`firm_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `entrylist_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `entrylist_view` AS select `entrylist`.`entry_id` AS `entry_id`,`entrylist`.`document_id` AS `document_id`,`entrylist`.`amount` AS `amount`,`entrylist`.`quantity` AS `quantity`,`documents`.`customer_id` AS `customer_id`,`entrylist`.`extcode` AS `extcode`,`entrylist`.`stock_id` AS `stock_id`,`entrylist`.`service_id` AS `service_id`,`store_stock`.`item_id` AS `item_id`,`store_stock`.`partion` AS `partion`,`documents`.`document_date` AS `document_date`,`entrylist`.`outprice` AS `outprice` from ((`entrylist` left join `store_stock` on((`entrylist`.`stock_id` = `store_stock`.`stock_id`))) join `documents` on((`entrylist`.`document_id` = `documents`.`document_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `eventlist_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `eventlist_view` AS select `e`.`user_id` AS `user_id`,`e`.`eventdate` AS `eventdate`,`e`.`title` AS `title`,`e`.`description` AS `description`,`e`.`isdone` AS `isdone`,`e`.`event_id` AS `event_id`,`e`.`customer_id` AS `customer_id`,`c`.`customer_name` AS `customer_name` from (`eventlist` `e` left join `customers` `c` on((`e`.`customer_id` = `c`.`customer_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `issue_issuelist_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `issue_issuelist_view` AS select `i`.`issue_id` AS `issue_id`,`i`.`issue_name` AS `issue_name`,`i`.`details` AS `details`,`i`.`status` AS `status`,`i`.`priority` AS `priority`,`i`.`user_id` AS `user_id`,`i`.`lastupdate` AS `lastupdate`,`i`.`project_id` AS `project_id`,`u`.`username` AS `username`,`p`.`project_name` AS `project_name` from ((`issue_issuelist` `i` left join `users_view` `u` on((`i`.`user_id` = `u`.`user_id`))) join `issue_projectlist` `p` on((`i`.`project_id` = `p`.`project_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `issue_projectlist_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `issue_projectlist_view` AS select `p`.`project_id` AS `project_id`,`p`.`project_name` AS `project_name`,`p`.`details` AS `details`,`p`.`customer_id` AS `customer_id`,`p`.`status` AS `status`,`c`.`customer_name` AS `customer_name`,(select coalesce(sum((case when (`i`.`status` = 0) then 1 else 0 end)),0) from `issue_issuelist` `i` where (`i`.`project_id` = `p`.`project_id`)) AS `inew`,(select coalesce(sum((case when (`i`.`status` > 1) then 1 else 0 end)),0) from `issue_issuelist` `i` where (`i`.`project_id` = `p`.`project_id`)) AS `iproc`,(select coalesce(sum((case when (`i`.`status` = 1) then 1 else 0 end)),0) from `issue_issuelist` `i` where (`i`.`project_id` = `p`.`project_id`)) AS `iclose` from (`issue_projectlist` `p` left join `customers` `c` on((`p`.`customer_id` = `c`.`customer_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `issue_time_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `issue_time_view` AS select `t`.`id` AS `id`,`t`.`issue_id` AS `issue_id`,`t`.`createdon` AS `createdon`,`t`.`user_id` AS `user_id`,`t`.`duration` AS `duration`,`t`.`notes` AS `notes`,`u`.`username` AS `username`,`i`.`issue_name` AS `issue_name`,`i`.`project_id` AS `project_id`,`i`.`project_name` AS `project_name` from ((`issue_time` `t` join `users_view` `u` on((`t`.`user_id` = `u`.`user_id`))) join `issue_issuelist_view` `i` on((`t`.`issue_id` = `i`.`issue_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `item_set_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; - - -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `item_set_view` AS select `item_set`.`set_id` AS `set_id`,`item_set`.`item_id` AS `item_id`,`item_set`.`pitem_id` AS `pitem_id`,`item_set`.`qty` AS `qty`,`items`.`itemname` AS `itemname`,`items`.`item_code` AS `item_code` from (`item_set` join `items` on((`item_set`.`item_id` = `items`.`item_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `items_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `items_view` AS select `items`.`item_id` AS `item_id`,`items`.`itemname` AS `itemname`,`items`.`description` AS `description`,`items`.`detail` AS `detail`,`items`.`item_code` AS `item_code`,`items`.`bar_code` AS `bar_code`,`items`.`cat_id` AS `cat_id`,`items`.`msr` AS `msr`,`items`.`disabled` AS `disabled`,`items`.`minqty` AS `minqty`,`items`.`item_type` AS `item_type`,`items`.`manufacturer` AS `manufacturer`,`item_cat`.`cat_name` AS `cat_name` from (`items` left join `item_cat` on((`items`.`cat_id` = `item_cat`.`cat_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `messages_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `messages_view` AS select `messages`.`message_id` AS `message_id`,`messages`.`user_id` AS `user_id`,`messages`.`created` AS `created`,`messages`.`message` AS `message`,`messages`.`item_id` AS `item_id`,`messages`.`item_type` AS `item_type`,`users_view`.`username` AS `username` from (`messages` join `users_view` on((`messages`.`user_id` = `users_view`.`user_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `note_nodesview`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `note_nodesview` AS select `note_nodes`.`node_id` AS `node_id`,`note_nodes`.`pid` AS `pid`,`note_nodes`.`title` AS `title`,`note_nodes`.`mpath` AS `mpath`,`note_nodes`.`user_id` AS `user_id`,`note_nodes`.`ispublic` AS `ispublic`,(select count(`note_topicnode`.`topic_id`) AS `Count(topic_id)` from `note_topicnode` where (`note_topicnode`.`node_id` = `note_nodes`.`node_id`)) AS `tcnt` from `note_nodes` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `note_topicnodeview`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `note_topicnodeview` AS select `note_topicnode`.`topic_id` AS `topic_id`,`note_topicnode`.`node_id` AS `node_id`,`note_topicnode`.`tn_id` AS `tn_id`,`note_topics`.`title` AS `title`,`note_nodes`.`user_id` AS `user_id`,`note_topics`.`content` AS `content` from ((`note_topics` join `note_topicnode` on((`note_topics`.`topic_id` = `note_topicnode`.`topic_id`))) join `note_nodes` on((`note_nodes`.`node_id` = `note_topicnode`.`node_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `note_topicsview`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `note_topicsview` AS select `t`.`topic_id` AS `topic_id`,`t`.`title` AS `title`,`t`.`content` AS `content`,`t`.`acctype` AS `acctype`,`t`.`user_id` AS `user_id` from `note_topics` `t` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `paylist_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `paylist_view` AS select `pl`.`pl_id` AS `pl_id`,`pl`.`document_id` AS `document_id`,`pl`.`amount` AS `amount`,`pl`.`mf_id` AS `mf_id`,`pl`.`notes` AS `notes`,`pl`.`user_id` AS `user_id`,`pl`.`paydate` AS `paydate`,`pl`.`paytype` AS `paytype`,`pl`.`detail` AS `detail`,`d`.`document_number` AS `document_number`,`u`.`username` AS `username`,`m`.`mf_name` AS `mf_name`,`d`.`customer_id` AS `customer_id`,`d`.`customer_name` AS `customer_name` from (((`paylist` `pl` join `documents_view` `d` on((`pl`.`document_id` = `d`.`document_id`))) join `users_view` `u` on((`pl`.`user_id` = `u`.`user_id`))) join `mfund` `m` on((`pl`.`mf_id` = `m`.`mf_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `roles_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; - - - -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `roles_view` AS select `roles`.`role_id` AS `role_id`,`roles`.`rolename` AS `rolename`,`roles`.`acl` AS `acl`,(select coalesce(count(0),0) from `users` where (`users`.`role_id` = `roles`.`role_id`)) AS `cnt` from `roles` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `shop_attributes_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `shop_attributes_view` AS select `shop_attributes`.`attribute_id` AS `attribute_id`,`shop_attributes`.`attributename` AS `attributename`,`shop_attributes`.`cat_id` AS `cat_id`,`shop_attributes`.`attributetype` AS `attributetype`,`shop_attributes`.`valueslist` AS `valueslist`,`shop_attributes_order`.`ordern` AS `ordern` from (`shop_attributes` join `shop_attributes_order` on(((`shop_attributes`.`attribute_id` = `shop_attributes_order`.`attr_id`) and (`shop_attributes`.`cat_id` = `shop_attributes_order`.`pg_id`)))) order by `shop_attributes_order`.`ordern` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `shop_products_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `shop_products_view` AS select `i`.`item_id` AS `item_id`,`i`.`itemname` AS `itemname`,`i`.`description` AS `description`,`i`.`detail` AS `detail`,`i`.`item_code` AS `item_code`,`i`.`bar_code` AS `bar_code`,`i`.`cat_id` AS `cat_id`,`i`.`msr` AS `msr`,`i`.`disabled` AS `disabled`,`i`.`minqty` AS `minqty`,`i`.`item_type` AS `item_type`,`i`.`manufacturer` AS `manufacturer`,`i`.`cat_name` AS `cat_name`,coalesce((select sum(`store_stock`.`qty`) from `store_stock` where (`store_stock`.`item_id` = `i`.`item_id`)),0) AS `qty`,coalesce((select count(0) from `shop_prod_comments` `c` where (`c`.`item_id` = `i`.`item_id`)),0) AS `comments`,coalesce((select sum(`c`.`rating`) from `shop_prod_comments` `c` where (`c`.`item_id` = `i`.`item_id`)),0) AS `ratings` from `items_view` `i` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `store_stock_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `store_stock_view` AS select `st`.`stock_id` AS `stock_id`,`st`.`item_id` AS `item_id`,`st`.`partion` AS `partion`,`st`.`store_id` AS `store_id`,`i`.`itemname` AS `itemname`,`i`.`item_code` AS `item_code`,`i`.`cat_id` AS `cat_id`,`i`.`msr` AS `msr`,`i`.`item_type` AS `item_type`,`i`.`bar_code` AS `bar_code`,`i`.`cat_name` AS `cat_name`,`i`.`disabled` AS `itemdisabled`,`stores`.`storename` AS `storename`,`st`.`qty` AS `qty`,`st`.`snumber` AS `snumber`,`st`.`sdate` AS `sdate` from ((`store_stock` `st` join `items_view` `i` on(((`i`.`item_id` = `st`.`item_id`) and (`i`.`disabled` <> 1)))) join `stores` on((`stores`.`store_id` = `st`.`store_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `timesheet_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = latin1 */; -/*!50001 SET character_set_results = latin1 */; -/*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `timesheet_view` AS select `t`.`time_id` AS `time_id`,`t`.`emp_id` AS `emp_id`,`t`.`description` AS `description`,`t`.`t_start` AS `t_start`,`t`.`t_end` AS `t_end`,`t`.`t_type` AS `t_type`,`t`.`t_break` AS `t_break`,`e`.`emp_name` AS `emp_name`,`e`.`disabled` AS `disabled`,`e`.`branch_id` AS `branch_id` from (`timesheet` `t` join `employees` `e` on((`t`.`emp_id` = `e`.`employee_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP VIEW IF EXISTS `users_view`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 CREATE */ -/*!50013 SQL SECURITY DEFINER */ -/*!50001 VIEW `users_view` AS select `users`.`user_id` AS `user_id`,`users`.`userlogin` AS `userlogin`,`users`.`userpass` AS `userpass`,`users`.`createdon` AS `createdon`,`users`.`email` AS `email`,`users`.`acl` AS `acl`,`users`.`options` AS `options`,`users`.`disabled` AS `disabled`,`roles`.`rolename` AS `rolename`,`users`.`role_id` AS `role_id`,`roles`.`acl` AS `roleacl`,coalesce(`employees`.`employee_id`,0) AS `employee_id`,(case when isnull(`employees`.`emp_name`) then `users`.`userlogin` else `employees`.`emp_name` end) AS `username` from ((`users` left join `employees` on(((`users`.`userlogin` = `employees`.`login`) and (`employees`.`disabled` <> 1)))) left join `roles` on((`users`.`role_id` = `roles`.`role_id`))) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES cp1251 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `branches`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `branches` ( + `branch_id` int(11) NOT NULL AUTO_INCREMENT, + `branch_name` varchar(255) NOT NULL, + `details` longtext NOT NULL, + `disabled` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`branch_id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `contracts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contracts` ( + `contract_id` int(11) NOT NULL AUTO_INCREMENT, + `customer_id` int(11) DEFAULT '0', + `firm_id` int(11) DEFAULT '0', + `createdon` date NOT NULL, + `contract_number` varchar(64) NOT NULL, + `disabled` tinyint(1) DEFAULT '0', + `details` longtext NOT NULL, + PRIMARY KEY (`contract_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `contracts_view`; +/*!50001 DROP VIEW IF EXISTS `contracts_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `contracts_view` AS SELECT + 1 AS `contract_id`, + 1 AS `customer_id`, + 1 AS `firm_id`, + 1 AS `createdon`, + 1 AS `contract_number`, + 1 AS `disabled`, + 1 AS `details`, + 1 AS `customer_name`, + 1 AS `firm_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `custacc`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `custacc` ( + `ca_id` int(11) NOT NULL AUTO_INCREMENT, + `customer_id` int(11) NOT NULL, + `document_id` int(11) DEFAULT NULL, + `optype` int(11) DEFAULT '0', + `amount` decimal(10,2) NOT NULL, + `createdon` date NOT NULL, + PRIMARY KEY (`ca_id`), + KEY `customer_id` (`customer_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `custacc_view`; +/*!50001 DROP VIEW IF EXISTS `custacc_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `custacc_view` AS SELECT + 1 AS `ca_id`, + 1 AS `customer_id`, + 1 AS `document_id`, + 1 AS `optype`, + 1 AS `amount`, + 1 AS `document_number`, + 1 AS `createdon`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `customers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `customers` ( + `customer_id` int(11) NOT NULL AUTO_INCREMENT, + `customer_name` varchar(255) DEFAULT NULL, + `detail` mediumtext NOT NULL, + `email` varchar(64) DEFAULT NULL, + `phone` varchar(64) DEFAULT NULL, + `status` smallint(4) NOT NULL DEFAULT '0', + `city` varchar(255) DEFAULT NULL, + `leadstatus` varchar(255) DEFAULT NULL, + `leadsource` varchar(255) DEFAULT NULL, + `createdon` date DEFAULT NULL, + `country` varchar(255) DEFAULT NULL, + PRIMARY KEY (`customer_id`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `customers_view`; +/*!50001 DROP VIEW IF EXISTS `customers_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `customers_view` AS SELECT + 1 AS `customer_id`, + 1 AS `customer_name`, + 1 AS `detail`, + 1 AS `email`, + 1 AS `phone`, + 1 AS `status`, + 1 AS `city`, + 1 AS `leadsource`, + 1 AS `leadstatus`, + 1 AS `country`, + 1 AS `mcnt`, + 1 AS `fcnt`, + 1 AS `ecnt`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `docstatelog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `docstatelog` ( + `log_id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `document_id` int(11) NOT NULL, + `docstate` smallint(6) NOT NULL, + `createdon` datetime NOT NULL, + `hostname` varchar(64) NOT NULL, + PRIMARY KEY (`log_id`), + KEY `document_id` (`document_id`) +) ENGINE=InnoDB AUTO_INCREMENT=1769 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `docstatelog_view`; +/*!50001 DROP VIEW IF EXISTS `docstatelog_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `docstatelog_view` AS SELECT + 1 AS `log_id`, + 1 AS `user_id`, + 1 AS `document_id`, + 1 AS `docstate`, + 1 AS `createdon`, + 1 AS `hostname`, + 1 AS `username`, + 1 AS `document_number`, + 1 AS `meta_desc`, + 1 AS `meta_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `documents`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `documents` ( + `document_id` int(11) NOT NULL AUTO_INCREMENT, + `document_number` varchar(45) NOT NULL, + `document_date` date NOT NULL, + `user_id` int(11) NOT NULL, + `content` longtext, + `amount` decimal(11,2) DEFAULT NULL, + `meta_id` int(11) NOT NULL, + `state` tinyint(4) NOT NULL, + `notes` varchar(255) NOT NULL, + `customer_id` int(11) DEFAULT '0', + `payamount` decimal(11,2) DEFAULT '0.00', + `payed` decimal(11,2) DEFAULT '0.00', + `branch_id` int(11) DEFAULT '0', + `parent_id` bigint(20) DEFAULT '0', + `firm_id` int(11) DEFAULT NULL, + PRIMARY KEY (`document_id`), + UNIQUE KEY `unuqnumber` (`meta_id`,`document_number`,`branch_id`), + KEY `document_date` (`document_date`), + KEY `customer_id` (`customer_id`), + KEY `user_id` (`user_id`), + KEY `branch_id` (`branch_id`), + CONSTRAINT `documents_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=488 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `documents_view`; +/*!50001 DROP VIEW IF EXISTS `documents_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `documents_view` AS SELECT + 1 AS `document_id`, + 1 AS `document_number`, + 1 AS `document_date`, + 1 AS `user_id`, + 1 AS `content`, + 1 AS `amount`, + 1 AS `meta_id`, + 1 AS `username`, + 1 AS `customer_id`, + 1 AS `customer_name`, + 1 AS `state`, + 1 AS `notes`, + 1 AS `payamount`, + 1 AS `payed`, + 1 AS `parent_id`, + 1 AS `branch_id`, + 1 AS `branch_name`, + 1 AS `firm_id`, + 1 AS `firm_name`, + 1 AS `meta_name`, + 1 AS `meta_desc`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `employees`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `employees` ( + `employee_id` int(11) NOT NULL AUTO_INCREMENT, + `login` varchar(64) DEFAULT NULL, + `detail` mediumtext, + `disabled` tinyint(1) DEFAULT '0', + `emp_name` varchar(64) NOT NULL, + `branch_id` int(11) DEFAULT '0', + PRIMARY KEY (`employee_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `entrylist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `entrylist` ( + `entry_id` bigint(20) NOT NULL AUTO_INCREMENT, + `document_id` int(11) NOT NULL, + `quantity` decimal(11,3) DEFAULT '0.000', + `stock_id` int(11) DEFAULT NULL, + `service_id` int(11) DEFAULT NULL, + `outprice` decimal(10,2) DEFAULT NULL, + PRIMARY KEY (`entry_id`), + KEY `document_id` (`document_id`), + KEY `stock_id` (`stock_id`), + CONSTRAINT `entrylist_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`), + CONSTRAINT `entrylist_ibfk_2` FOREIGN KEY (`stock_id`) REFERENCES `store_stock` (`stock_id`) +) ENGINE=InnoDB AUTO_INCREMENT=986 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +ALTER DATABASE `zstore` CHARACTER SET utf8 COLLATE utf8_general_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `entrylist_after_ins_tr` AFTER INSERT ON `entrylist` + FOR EACH ROW +BEGIN + + + + IF new.stock_id >0 then + + update store_stock set qty=(select coalesce(sum(quantity),0) from entrylist where stock_id=new.stock_id) where store_stock.stock_id = new.stock_id; + END IF; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE `zstore` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ; +ALTER DATABASE `zstore` CHARACTER SET utf8 COLLATE utf8_general_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = latin1 */ ; +/*!50003 SET character_set_results = latin1 */ ; +/*!50003 SET collation_connection = latin1_swedish_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `entrylist_after_del_tr` AFTER DELETE ON `entrylist` + FOR EACH ROW +BEGIN + + + IF old.stock_id >0 then + + update store_stock set qty=(select coalesce(sum(quantity),0) from entrylist where stock_id=old.stock_id) where store_stock.stock_id = old.stock_id; + END IF; +END */;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE `zstore` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ; +DROP TABLE IF EXISTS `entrylist_view`; +/*!50001 DROP VIEW IF EXISTS `entrylist_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `entrylist_view` AS SELECT + 1 AS `entry_id`, + 1 AS `document_id`, + 1 AS `quantity`, + 1 AS `customer_id`, + 1 AS `stock_id`, + 1 AS `service_id`, + 1 AS `item_id`, + 1 AS `partion`, + 1 AS `document_date`, + 1 AS `outprice`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `equipments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `equipments` ( + `eq_id` int(11) NOT NULL AUTO_INCREMENT, + `eq_name` varchar(255) DEFAULT NULL, + `detail` mediumtext, + `disabled` tinyint(1) DEFAULT '0', + `description` text, + PRIMARY KEY (`eq_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `eventlist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `eventlist` ( + `user_id` int(11) NOT NULL, + `eventdate` datetime NOT NULL, + `title` varchar(255) NOT NULL, + `description` text NOT NULL, + `event_id` int(11) NOT NULL AUTO_INCREMENT, + `customer_id` int(11) NOT NULL, + `isdone` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`event_id`), + KEY `user_id` (`user_id`), + KEY `customer_id` (`customer_id`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `eventlist_view`; +/*!50001 DROP VIEW IF EXISTS `eventlist_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `eventlist_view` AS SELECT + 1 AS `user_id`, + 1 AS `eventdate`, + 1 AS `title`, + 1 AS `description`, + 1 AS `event_id`, + 1 AS `customer_id`, + 1 AS `isdone`, + 1 AS `customer_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `files`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `files` ( + `file_id` int(11) NOT NULL AUTO_INCREMENT, + `item_id` int(11) DEFAULT NULL, + `filename` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `item_type` int(11) NOT NULL, + `mime` varchar(16) DEFAULT NULL, + PRIMARY KEY (`file_id`), + KEY `item_id` (`item_id`) +) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `filesdata`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `filesdata` ( + `file_id` int(11) DEFAULT NULL, + `filedata` longblob, + UNIQUE KEY `file_id` (`file_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `firms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `firms` ( + `firm_id` int(11) NOT NULL AUTO_INCREMENT, + `firm_name` varchar(255) NOT NULL, + `details` longtext NOT NULL, + `disabled` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`firm_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `images`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `images` ( + `image_id` int(11) NOT NULL AUTO_INCREMENT, + `content` longblob NOT NULL, + `mime` varchar(16) DEFAULT NULL, + `thumb` longblob, + PRIMARY KEY (`image_id`) +) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `issue_history`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `issue_history` ( + `hist_id` bigint(20) NOT NULL AUTO_INCREMENT, + `issue_id` int(11) NOT NULL, + `createdon` date NOT NULL, + `user_id` int(11) NOT NULL, + `description` varchar(255) NOT NULL, + PRIMARY KEY (`hist_id`), + KEY `issue_id` (`issue_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `issue_issuelist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `issue_issuelist` ( + `issue_id` int(11) NOT NULL AUTO_INCREMENT, + `issue_name` varchar(255) NOT NULL, + `details` longtext NOT NULL, + `status` smallint(6) NOT NULL, + `priority` tinyint(4) NOT NULL, + `user_id` int(11) NOT NULL, + `lastupdate` datetime DEFAULT NULL, + `project_id` int(11) NOT NULL, + PRIMARY KEY (`issue_id`), + KEY `project_id` (`project_id`), + KEY `user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `issue_issuelist_view`; +/*!50001 DROP VIEW IF EXISTS `issue_issuelist_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `issue_issuelist_view` AS SELECT + 1 AS `issue_id`, + 1 AS `issue_name`, + 1 AS `details`, + 1 AS `status`, + 1 AS `priority`, + 1 AS `user_id`, + 1 AS `lastupdate`, + 1 AS `project_id`, + 1 AS `username`, + 1 AS `project_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `issue_projectacc`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `issue_projectacc` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `project_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `issue_projectlist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `issue_projectlist` ( + `project_id` int(11) NOT NULL AUTO_INCREMENT, + `project_name` varchar(255) NOT NULL, + `details` longtext NOT NULL, + `customer_id` int(11) DEFAULT NULL, + `status` smallint(6) DEFAULT NULL, + PRIMARY KEY (`project_id`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `issue_projectlist_view`; +/*!50001 DROP VIEW IF EXISTS `issue_projectlist_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `issue_projectlist_view` AS SELECT + 1 AS `project_id`, + 1 AS `project_name`, + 1 AS `details`, + 1 AS `customer_id`, + 1 AS `status`, + 1 AS `customer_name`, + 1 AS `inew`, + 1 AS `iproc`, + 1 AS `iclose`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `issue_time`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `issue_time` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `issue_id` int(11) NOT NULL, + `createdon` datetime NOT NULL, + `user_id` int(11) NOT NULL, + `duration` decimal(10,2) DEFAULT NULL, + `notes` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `issue_id` (`issue_id`) +) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `issue_time_view`; +/*!50001 DROP VIEW IF EXISTS `issue_time_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `issue_time_view` AS SELECT + 1 AS `id`, + 1 AS `issue_id`, + 1 AS `createdon`, + 1 AS `user_id`, + 1 AS `duration`, + 1 AS `notes`, + 1 AS `username`, + 1 AS `issue_name`, + 1 AS `project_id`, + 1 AS `project_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `item_cat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_cat` ( + `cat_id` int(11) NOT NULL AUTO_INCREMENT, + `cat_name` varchar(255) NOT NULL, + `detail` longtext, + `parent_id` int(11) DEFAULT '0', + PRIMARY KEY (`cat_id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `item_set`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `item_set` ( + `set_id` int(11) NOT NULL AUTO_INCREMENT, + `item_id` int(11) DEFAULT '0', + `pitem_id` int(11) DEFAULT '0', + `qty` decimal(11,3) DEFAULT '0.000', + PRIMARY KEY (`set_id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `item_set_view`; +/*!50001 DROP VIEW IF EXISTS `item_set_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `item_set_view` AS SELECT + 1 AS `set_id`, + 1 AS `item_id`, + 1 AS `pitem_id`, + 1 AS `qty`, + 1 AS `itemname`, + 1 AS `item_code`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `items`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `items` ( + `item_id` int(11) NOT NULL AUTO_INCREMENT, + `itemname` varchar(255) DEFAULT NULL, + `description` longtext, + `detail` longtext NOT NULL, + `item_code` varchar(64) DEFAULT NULL, + `bar_code` varchar(64) DEFAULT NULL, + `cat_id` int(11) NOT NULL, + `msr` varchar(64) DEFAULT NULL, + `disabled` tinyint(1) DEFAULT '0', + `minqty` decimal(11,3) DEFAULT '0.000', + `manufacturer` varchar(355) DEFAULT NULL, + `item_type` int(11) DEFAULT NULL, + PRIMARY KEY (`item_id`), + KEY `item_code` (`item_code`), + KEY `itemname` (`itemname`), + KEY `cat_id` (`cat_id`) +) ENGINE=InnoDB AUTO_INCREMENT=598 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `items_view`; +/*!50001 DROP VIEW IF EXISTS `items_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `items_view` AS SELECT + 1 AS `item_id`, + 1 AS `itemname`, + 1 AS `description`, + 1 AS `detail`, + 1 AS `item_code`, + 1 AS `bar_code`, + 1 AS `cat_id`, + 1 AS `msr`, + 1 AS `disabled`, + 1 AS `minqty`, + 1 AS `item_type`, + 1 AS `manufacturer`, + 1 AS `cat_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `messages`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `messages` ( + `message_id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` int(11) DEFAULT NULL, + `created` datetime DEFAULT NULL, + `message` text, + `item_id` int(11) NOT NULL, + `item_type` int(11) DEFAULT NULL, + PRIMARY KEY (`message_id`), + KEY `item_id` (`item_id`) +) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `messages_view`; +/*!50001 DROP VIEW IF EXISTS `messages_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `messages_view` AS SELECT + 1 AS `message_id`, + 1 AS `user_id`, + 1 AS `created`, + 1 AS `message`, + 1 AS `item_id`, + 1 AS `item_type`, + 1 AS `username`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `metadata`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `metadata` ( + `meta_id` int(11) NOT NULL AUTO_INCREMENT, + `meta_type` tinyint(11) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `meta_name` varchar(255) NOT NULL, + `menugroup` varchar(255) DEFAULT NULL, + `disabled` tinyint(4) NOT NULL, + PRIMARY KEY (`meta_id`) +) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `mfund`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mfund` ( + `mf_id` int(11) NOT NULL AUTO_INCREMENT, + `mf_name` varchar(255) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `branch_id` int(11) DEFAULT '0', + `detail` longtext, + PRIMARY KEY (`mf_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `note_fav`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `note_fav` ( + `fav_id` int(11) NOT NULL AUTO_INCREMENT, + `topic_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + PRIMARY KEY (`fav_id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `note_nodes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `note_nodes` ( + `node_id` int(11) NOT NULL AUTO_INCREMENT, + `pid` int(11) NOT NULL, + `title` varchar(50) NOT NULL, + `mpath` varchar(255) CHARACTER SET latin1 NOT NULL, + `user_id` int(11) DEFAULT NULL, + `ispublic` tinyint(1) DEFAULT '0', + PRIMARY KEY (`node_id`), + KEY `user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `note_nodesview`; +/*!50001 DROP VIEW IF EXISTS `note_nodesview`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `note_nodesview` AS SELECT + 1 AS `node_id`, + 1 AS `pid`, + 1 AS `title`, + 1 AS `mpath`, + 1 AS `user_id`, + 1 AS `ispublic`, + 1 AS `tcnt`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `note_tags`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `note_tags` ( + `tag_id` int(11) NOT NULL AUTO_INCREMENT, + `topic_id` int(11) NOT NULL, + `tagvalue` varchar(255) NOT NULL, + PRIMARY KEY (`tag_id`), + KEY `topic_id` (`topic_id`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `note_topicnode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `note_topicnode` ( + `topic_id` int(11) NOT NULL, + `node_id` int(11) NOT NULL, + `tn_id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`tn_id`), + KEY `topic_id` (`topic_id`), + KEY `node_id` (`node_id`) +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `note_topicnodeview`; +/*!50001 DROP VIEW IF EXISTS `note_topicnodeview`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `note_topicnodeview` AS SELECT + 1 AS `topic_id`, + 1 AS `node_id`, + 1 AS `tn_id`, + 1 AS `title`, + 1 AS `user_id`, + 1 AS `content`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `note_topics`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `note_topics` ( + `topic_id` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `content` longtext NOT NULL, + `acctype` smallint(4) DEFAULT '0', + `user_id` int(11) NOT NULL, + PRIMARY KEY (`topic_id`) +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `note_topicsview`; +/*!50001 DROP VIEW IF EXISTS `note_topicsview`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `note_topicsview` AS SELECT + 1 AS `topic_id`, + 1 AS `title`, + 1 AS `content`, + 1 AS `acctype`, + 1 AS `user_id`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `notifies`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `notifies` ( + `notify_id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `dateshow` datetime NOT NULL, + `checked` tinyint(1) NOT NULL DEFAULT '0', + `message` text NOT NULL, + `sender_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`notify_id`), + KEY `user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=143 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `options`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `options` ( + `optname` varchar(64) NOT NULL, + `optvalue` longtext NOT NULL, + UNIQUE KEY `optname` (`optname`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `parealist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `parealist` ( + `pa_id` int(11) NOT NULL AUTO_INCREMENT, + `pa_name` varchar(255) NOT NULL, + PRIMARY KEY (`pa_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `paylist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `paylist` ( + `pl_id` bigint(20) NOT NULL AUTO_INCREMENT, + `document_id` int(11) NOT NULL, + `amount` decimal(11,2) NOT NULL, + `mf_id` int(11) NOT NULL, + `notes` varchar(255) DEFAULT NULL, + `paydate` datetime DEFAULT NULL, + `user_id` int(11) NOT NULL, + `paytype` smallint(6) NOT NULL, + `detail` longtext, + PRIMARY KEY (`pl_id`), + KEY `document_id` (`document_id`), + CONSTRAINT `paylist_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) +) ENGINE=InnoDB AUTO_INCREMENT=437 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `paylist_view`; +/*!50001 DROP VIEW IF EXISTS `paylist_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `paylist_view` AS SELECT + 1 AS `pl_id`, + 1 AS `document_id`, + 1 AS `amount`, + 1 AS `mf_id`, + 1 AS `notes`, + 1 AS `user_id`, + 1 AS `paydate`, + 1 AS `paytype`, + 1 AS `detail`, + 1 AS `document_number`, + 1 AS `username`, + 1 AS `mf_name`, + 1 AS `customer_id`, + 1 AS `customer_name`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `poslist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `poslist` ( + `pos_id` int(11) NOT NULL AUTO_INCREMENT, + `pos_name` varchar(255) NOT NULL, + `details` longtext NOT NULL, + `branch_id` int(11) DEFAULT '0', + PRIMARY KEY (`pos_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `ppo_zformstat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ppo_zformstat` ( + `zf_id` int(11) NOT NULL AUTO_INCREMENT, + `pos_id` int(11) NOT NULL, + `checktype` int(11) NOT NULL, + `createdon` datetime NOT NULL, + `document_number` varchar(255) NOT NULL, + `amount0` decimal(10,2) NOT NULL, + `amount1` decimal(10,2) NOT NULL, + `amount2` decimal(10,2) NOT NULL, + `amount3` decimal(10,2) NOT NULL, + PRIMARY KEY (`zf_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `roles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `roles` ( + `role_id` int(11) NOT NULL AUTO_INCREMENT, + `rolename` varchar(255) DEFAULT NULL, + `acl` mediumtext, + PRIMARY KEY (`role_id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `roles_view`; +/*!50001 DROP VIEW IF EXISTS `roles_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `roles_view` AS SELECT + 1 AS `role_id`, + 1 AS `rolename`, + 1 AS `acl`, + 1 AS `cnt`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `services`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `services` ( + `service_id` int(11) NOT NULL AUTO_INCREMENT, + `service_name` varchar(255) NOT NULL, + `detail` text, + `disabled` tinyint(1) DEFAULT '0', + PRIMARY KEY (`service_id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `shop_attributes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `shop_attributes` ( + `attribute_id` int(11) NOT NULL AUTO_INCREMENT, + `attributename` varchar(64) NOT NULL, + `cat_id` int(11) NOT NULL, + `attributetype` tinyint(4) NOT NULL, + `valueslist` text, + PRIMARY KEY (`attribute_id`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `shop_attributes_order`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `shop_attributes_order` ( + `order_id` int(11) NOT NULL AUTO_INCREMENT, + `attr_id` int(11) NOT NULL, + `pg_id` int(11) NOT NULL, + `ordern` int(11) NOT NULL, + PRIMARY KEY (`order_id`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `shop_attributes_view`; +/*!50001 DROP VIEW IF EXISTS `shop_attributes_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `shop_attributes_view` AS SELECT + 1 AS `attribute_id`, + 1 AS `attributename`, + 1 AS `cat_id`, + 1 AS `attributetype`, + 1 AS `valueslist`, + 1 AS `ordern`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `shop_attributevalues`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `shop_attributevalues` ( + `attributevalue_id` int(11) NOT NULL AUTO_INCREMENT, + `attribute_id` int(11) NOT NULL, + `item_id` int(11) NOT NULL, + `attributevalue` varchar(255) NOT NULL, + PRIMARY KEY (`attributevalue_id`), + KEY `attribute_id` (`attribute_id`) +) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `shop_prod_comments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `shop_prod_comments` ( + `comment_id` int(11) NOT NULL AUTO_INCREMENT, + `item_id` int(11) NOT NULL, + `author` varchar(64) NOT NULL, + `comment` text NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `rating` tinyint(4) NOT NULL DEFAULT '0', + `moderated` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`comment_id`), + KEY `product_id` (`item_id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `shop_products_view`; +/*!50001 DROP VIEW IF EXISTS `shop_products_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `shop_products_view` AS SELECT + 1 AS `item_id`, + 1 AS `itemname`, + 1 AS `description`, + 1 AS `detail`, + 1 AS `item_code`, + 1 AS `bar_code`, + 1 AS `cat_id`, + 1 AS `msr`, + 1 AS `disabled`, + 1 AS `minqty`, + 1 AS `item_type`, + 1 AS `manufacturer`, + 1 AS `cat_name`, + 1 AS `qty`, + 1 AS `comments`, + 1 AS `ratings`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `store_stock`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `store_stock` ( + `stock_id` int(11) NOT NULL AUTO_INCREMENT, + `item_id` int(11) NOT NULL, + `partion` decimal(11,2) DEFAULT NULL, + `store_id` int(11) NOT NULL, + `qty` decimal(11,3) DEFAULT '0.000', + `snumber` varchar(64) DEFAULT NULL, + `sdate` date DEFAULT NULL, + PRIMARY KEY (`stock_id`), + KEY `item_id` (`item_id`), + KEY `store_id` (`store_id`), + CONSTRAINT `store_stock_fk` FOREIGN KEY (`store_id`) REFERENCES `stores` (`store_id`), + CONSTRAINT `store_stock_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`item_id`) +) ENGINE=InnoDB AUTO_INCREMENT=605 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `store_stock_view`; +/*!50001 DROP VIEW IF EXISTS `store_stock_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `store_stock_view` AS SELECT + 1 AS `stock_id`, + 1 AS `item_id`, + 1 AS `partion`, + 1 AS `store_id`, + 1 AS `itemname`, + 1 AS `item_code`, + 1 AS `cat_id`, + 1 AS `msr`, + 1 AS `item_type`, + 1 AS `bar_code`, + 1 AS `cat_name`, + 1 AS `itemdisabled`, + 1 AS `storename`, + 1 AS `qty`, + 1 AS `snumber`, + 1 AS `sdate`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `stores`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stores` ( + `store_id` int(11) NOT NULL AUTO_INCREMENT, + `storename` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `branch_id` int(11) DEFAULT '0', + PRIMARY KEY (`store_id`) +) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `subscribes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `subscribes` ( + `sub_id` int(11) NOT NULL AUTO_INCREMENT, + `sub_type` int(11) DEFAULT NULL, + `reciever_type` int(11) DEFAULT NULL, + `msg_type` int(11) DEFAULT NULL, + `msgtext` text, + `detail` longtext, + `disabled` int(1) DEFAULT '0', + PRIMARY KEY (`sub_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `timesheet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `timesheet` ( + `time_id` int(11) NOT NULL AUTO_INCREMENT, + `emp_id` int(11) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `t_start` datetime DEFAULT NULL, + `t_end` datetime DEFAULT NULL, + `t_type` int(11) DEFAULT '0', + `t_break` smallint(6) DEFAULT '0', + `branch_id` int(11) DEFAULT NULL, + PRIMARY KEY (`time_id`), + KEY `emp_id` (`emp_id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `timesheet_view`; +/*!50001 DROP VIEW IF EXISTS `timesheet_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `timesheet_view` AS SELECT + 1 AS `time_id`, + 1 AS `emp_id`, + 1 AS `description`, + 1 AS `t_start`, + 1 AS `t_end`, + 1 AS `t_type`, + 1 AS `t_break`, + 1 AS `emp_name`, + 1 AS `branch_name`, + 1 AS `disabled`, + 1 AS `branch_id`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `user_id` int(11) NOT NULL AUTO_INCREMENT, + `userlogin` varchar(32) NOT NULL, + `userpass` varchar(255) NOT NULL, + `createdon` date NOT NULL, + `email` varchar(255) DEFAULT NULL, + `acl` mediumtext NOT NULL, + `disabled` int(1) NOT NULL DEFAULT '0', + `options` longtext, + `role_id` int(11) DEFAULT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `userlogin` (`userlogin`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `users_view`; +/*!50001 DROP VIEW IF EXISTS `users_view`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `users_view` AS SELECT + 1 AS `user_id`, + 1 AS `userlogin`, + 1 AS `userpass`, + 1 AS `createdon`, + 1 AS `email`, + 1 AS `acl`, + 1 AS `options`, + 1 AS `disabled`, + 1 AS `rolename`, + 1 AS `role_id`, + 1 AS `roleacl`, + 1 AS `employee_id`, + 1 AS `username`*/; +SET character_set_client = @saved_cs_client; +DROP TABLE IF EXISTS `zformstat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `zformstat` ( + `zf_id` int(11) NOT NULL AUTO_INCREMENT, + `pos_id` int(11) NOT NULL, + `checktype` int(11) NOT NULL, + `amount0` decimal(10,2) NOT NULL, + `createdon` datetime NOT NULL, + `amount1` decimal(10,2) NOT NULL, + `amount2` decimal(10,2) NOT NULL, + `document_number` varchar(255) NOT NULL, + `amount3` decimal(10,2) NOT NULL, + PRIMARY KEY (`zf_id`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!50001 DROP VIEW IF EXISTS `contracts_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `contracts_view` AS select `co`.`contract_id` AS `contract_id`,`co`.`customer_id` AS `customer_id`,`co`.`firm_id` AS `firm_id`,`co`.`createdon` AS `createdon`,`co`.`contract_number` AS `contract_number`,`co`.`disabled` AS `disabled`,`co`.`details` AS `details`,`cu`.`customer_name` AS `customer_name`,`f`.`firm_name` AS `firm_name` from ((`contracts` `co` join `customers` `cu` on((`co`.`customer_id` = `cu`.`customer_id`))) left join `firms` `f` on((`co`.`firm_id` = `f`.`firm_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `custacc_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `custacc_view` AS select `c`.`ca_id` AS `ca_id`,`c`.`customer_id` AS `customer_id`,`c`.`document_id` AS `document_id`,`c`.`optype` AS `optype`,`c`.`amount` AS `amount`,`d`.`document_number` AS `document_number`,`c`.`createdon` AS `createdon` from (`custacc` `c` join `documents` `d` on((`d`.`document_id` = `c`.`document_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `customers_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `customers_view` AS select `customers`.`customer_id` AS `customer_id`,`customers`.`customer_name` AS `customer_name`,`customers`.`detail` AS `detail`,`customers`.`email` AS `email`,`customers`.`phone` AS `phone`,`customers`.`status` AS `status`,`customers`.`city` AS `city`,`customers`.`leadsource` AS `leadsource`,`customers`.`leadstatus` AS `leadstatus`,`customers`.`country` AS `country`,(select count(0) from `messages` `m` where ((`m`.`item_id` = `customers`.`customer_id`) and (`m`.`item_type` = 2))) AS `mcnt`,(select count(0) from `files` `f` where ((`f`.`item_id` = `customers`.`customer_id`) and (`f`.`item_type` = 2))) AS `fcnt`,(select count(0) from `eventlist` `e` where ((`e`.`customer_id` = `customers`.`customer_id`) and (`e`.`eventdate` >= now()))) AS `ecnt` from `customers` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `docstatelog_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `docstatelog_view` AS select `dl`.`log_id` AS `log_id`,`dl`.`user_id` AS `user_id`,`dl`.`document_id` AS `document_id`,`dl`.`docstate` AS `docstate`,`dl`.`createdon` AS `createdon`,`dl`.`hostname` AS `hostname`,`u`.`username` AS `username`,`d`.`document_number` AS `document_number`,`d`.`meta_desc` AS `meta_desc`,`d`.`meta_name` AS `meta_name` from ((`docstatelog` `dl` join `users_view` `u` on((`dl`.`user_id` = `u`.`user_id`))) join `documents_view` `d` on((`d`.`document_id` = `dl`.`document_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `documents_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `documents_view` AS select `d`.`document_id` AS `document_id`,`d`.`document_number` AS `document_number`,`d`.`document_date` AS `document_date`,`d`.`user_id` AS `user_id`,`d`.`content` AS `content`,`d`.`amount` AS `amount`,`d`.`meta_id` AS `meta_id`,`u`.`username` AS `username`,`c`.`customer_id` AS `customer_id`,`c`.`customer_name` AS `customer_name`,`d`.`state` AS `state`,`d`.`notes` AS `notes`,`d`.`payamount` AS `payamount`,`d`.`payed` AS `payed`,`d`.`parent_id` AS `parent_id`,`d`.`branch_id` AS `branch_id`,`b`.`branch_name` AS `branch_name`,`d`.`firm_id` AS `firm_id`,`f`.`firm_name` AS `firm_name`,`metadata`.`meta_name` AS `meta_name`,`metadata`.`description` AS `meta_desc` from (((((`documents` `d` left join `users_view` `u` on((`d`.`user_id` = `u`.`user_id`))) left join `customers` `c` on((`d`.`customer_id` = `c`.`customer_id`))) join `metadata` on((`metadata`.`meta_id` = `d`.`meta_id`))) left join `branches` `b` on((`d`.`branch_id` = `b`.`branch_id`))) left join `firms` `f` on((`d`.`firm_id` = `f`.`firm_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `entrylist_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `entrylist_view` AS select `entrylist`.`entry_id` AS `entry_id`,`entrylist`.`document_id` AS `document_id`,`entrylist`.`quantity` AS `quantity`,`documents`.`customer_id` AS `customer_id`,`entrylist`.`stock_id` AS `stock_id`,`entrylist`.`service_id` AS `service_id`,`store_stock`.`item_id` AS `item_id`,`store_stock`.`partion` AS `partion`,`documents`.`document_date` AS `document_date`,`entrylist`.`outprice` AS `outprice` from ((`entrylist` left join `store_stock` on((`entrylist`.`stock_id` = `store_stock`.`stock_id`))) join `documents` on((`entrylist`.`document_id` = `documents`.`document_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `eventlist_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `eventlist_view` AS select `e`.`user_id` AS `user_id`,`e`.`eventdate` AS `eventdate`,`e`.`title` AS `title`,`e`.`description` AS `description`,`e`.`event_id` AS `event_id`,`e`.`customer_id` AS `customer_id`,`e`.`isdone` AS `isdone`,`c`.`customer_name` AS `customer_name` from (`eventlist` `e` left join `customers` `c` on((`e`.`customer_id` = `c`.`customer_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `issue_issuelist_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `issue_issuelist_view` AS select `i`.`issue_id` AS `issue_id`,`i`.`issue_name` AS `issue_name`,`i`.`details` AS `details`,`i`.`status` AS `status`,`i`.`priority` AS `priority`,`i`.`user_id` AS `user_id`,`i`.`lastupdate` AS `lastupdate`,`i`.`project_id` AS `project_id`,`u`.`username` AS `username`,`p`.`project_name` AS `project_name` from ((`issue_issuelist` `i` left join `users_view` `u` on((`i`.`user_id` = `u`.`user_id`))) join `issue_projectlist` `p` on((`i`.`project_id` = `p`.`project_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `issue_projectlist_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `issue_projectlist_view` AS select `p`.`project_id` AS `project_id`,`p`.`project_name` AS `project_name`,`p`.`details` AS `details`,`p`.`customer_id` AS `customer_id`,`p`.`status` AS `status`,`c`.`customer_name` AS `customer_name`,(select coalesce(sum((case when (`i`.`status` = 0) then 1 else 0 end)),0) from `issue_issuelist` `i` where (`i`.`project_id` = `p`.`project_id`)) AS `inew`,(select coalesce(sum((case when (`i`.`status` > 1) then 1 else 0 end)),0) from `issue_issuelist` `i` where (`i`.`project_id` = `p`.`project_id`)) AS `iproc`,(select coalesce(sum((case when (`i`.`status` = 1) then 1 else 0 end)),0) from `issue_issuelist` `i` where (`i`.`project_id` = `p`.`project_id`)) AS `iclose` from (`issue_projectlist` `p` left join `customers` `c` on((`p`.`customer_id` = `c`.`customer_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `issue_time_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `issue_time_view` AS select `t`.`id` AS `id`,`t`.`issue_id` AS `issue_id`,`t`.`createdon` AS `createdon`,`t`.`user_id` AS `user_id`,`t`.`duration` AS `duration`,`t`.`notes` AS `notes`,`u`.`username` AS `username`,`i`.`issue_name` AS `issue_name`,`i`.`project_id` AS `project_id`,`i`.`project_name` AS `project_name` from ((`issue_time` `t` join `users_view` `u` on((`t`.`user_id` = `u`.`user_id`))) join `issue_issuelist_view` `i` on((`t`.`issue_id` = `i`.`issue_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `item_set_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `item_set_view` AS select `item_set`.`set_id` AS `set_id`,`item_set`.`item_id` AS `item_id`,`item_set`.`pitem_id` AS `pitem_id`,`item_set`.`qty` AS `qty`,`items`.`itemname` AS `itemname`,`items`.`item_code` AS `item_code` from (`item_set` join `items` on((`item_set`.`item_id` = `items`.`item_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `items_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `items_view` AS select `items`.`item_id` AS `item_id`,`items`.`itemname` AS `itemname`,`items`.`description` AS `description`,`items`.`detail` AS `detail`,`items`.`item_code` AS `item_code`,`items`.`bar_code` AS `bar_code`,`items`.`cat_id` AS `cat_id`,`items`.`msr` AS `msr`,`items`.`disabled` AS `disabled`,`items`.`minqty` AS `minqty`,`items`.`item_type` AS `item_type`,`items`.`manufacturer` AS `manufacturer`,`item_cat`.`cat_name` AS `cat_name` from (`items` left join `item_cat` on((`items`.`cat_id` = `item_cat`.`cat_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `messages_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `messages_view` AS select `messages`.`message_id` AS `message_id`,`messages`.`user_id` AS `user_id`,`messages`.`created` AS `created`,`messages`.`message` AS `message`,`messages`.`item_id` AS `item_id`,`messages`.`item_type` AS `item_type`,`users_view`.`username` AS `username` from (`messages` join `users_view` on((`messages`.`user_id` = `users_view`.`user_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `note_nodesview`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `note_nodesview` AS select `note_nodes`.`node_id` AS `node_id`,`note_nodes`.`pid` AS `pid`,`note_nodes`.`title` AS `title`,`note_nodes`.`mpath` AS `mpath`,`note_nodes`.`user_id` AS `user_id`,`note_nodes`.`ispublic` AS `ispublic`,(select count(`note_topicnode`.`topic_id`) AS `Count(topic_id)` from `note_topicnode` where (`note_topicnode`.`node_id` = `note_nodes`.`node_id`)) AS `tcnt` from `note_nodes` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `note_topicnodeview`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `note_topicnodeview` AS select `note_topicnode`.`topic_id` AS `topic_id`,`note_topicnode`.`node_id` AS `node_id`,`note_topicnode`.`tn_id` AS `tn_id`,`note_topics`.`title` AS `title`,`note_nodes`.`user_id` AS `user_id`,`note_topics`.`content` AS `content` from ((`note_topics` join `note_topicnode` on((`note_topics`.`topic_id` = `note_topicnode`.`topic_id`))) join `note_nodes` on((`note_nodes`.`node_id` = `note_topicnode`.`node_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `note_topicsview`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `note_topicsview` AS select `t`.`topic_id` AS `topic_id`,`t`.`title` AS `title`,`t`.`content` AS `content`,`t`.`acctype` AS `acctype`,`t`.`user_id` AS `user_id` from `note_topics` `t` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `paylist_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `paylist_view` AS select `pl`.`pl_id` AS `pl_id`,`pl`.`document_id` AS `document_id`,`pl`.`amount` AS `amount`,`pl`.`mf_id` AS `mf_id`,`pl`.`notes` AS `notes`,`pl`.`user_id` AS `user_id`,`pl`.`paydate` AS `paydate`,`pl`.`paytype` AS `paytype`,`pl`.`detail` AS `detail`,`d`.`document_number` AS `document_number`,`u`.`username` AS `username`,`m`.`mf_name` AS `mf_name`,`d`.`customer_id` AS `customer_id`,`d`.`customer_name` AS `customer_name` from (((`paylist` `pl` join `documents_view` `d` on((`pl`.`document_id` = `d`.`document_id`))) join `users_view` `u` on((`pl`.`user_id` = `u`.`user_id`))) join `mfund` `m` on((`pl`.`mf_id` = `m`.`mf_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `roles_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `roles_view` AS select `roles`.`role_id` AS `role_id`,`roles`.`rolename` AS `rolename`,`roles`.`acl` AS `acl`,(select coalesce(count(0),0) from `users` where (`users`.`role_id` = `roles`.`role_id`)) AS `cnt` from `roles` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `shop_attributes_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `shop_attributes_view` AS select `shop_attributes`.`attribute_id` AS `attribute_id`,`shop_attributes`.`attributename` AS `attributename`,`shop_attributes`.`cat_id` AS `cat_id`,`shop_attributes`.`attributetype` AS `attributetype`,`shop_attributes`.`valueslist` AS `valueslist`,`shop_attributes_order`.`ordern` AS `ordern` from (`shop_attributes` join `shop_attributes_order` on(((`shop_attributes`.`attribute_id` = `shop_attributes_order`.`attr_id`) and (`shop_attributes`.`cat_id` = `shop_attributes_order`.`pg_id`)))) order by `shop_attributes_order`.`ordern` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `shop_products_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = latin1 */; +/*!50001 SET character_set_results = latin1 */; +/*!50001 SET collation_connection = latin1_swedish_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `shop_products_view` AS select `i`.`item_id` AS `item_id`,`i`.`itemname` AS `itemname`,`i`.`description` AS `description`,`i`.`detail` AS `detail`,`i`.`item_code` AS `item_code`,`i`.`bar_code` AS `bar_code`,`i`.`cat_id` AS `cat_id`,`i`.`msr` AS `msr`,`i`.`disabled` AS `disabled`,`i`.`minqty` AS `minqty`,`i`.`item_type` AS `item_type`,`i`.`manufacturer` AS `manufacturer`,`i`.`cat_name` AS `cat_name`,coalesce((select sum(`store_stock`.`qty`) from `store_stock` where (`store_stock`.`item_id` = `i`.`item_id`)),0) AS `qty`,coalesce((select count(0) from `shop_prod_comments` `c` where (`c`.`item_id` = `i`.`item_id`)),0) AS `comments`,coalesce((select sum(`c`.`rating`) from `shop_prod_comments` `c` where (`c`.`item_id` = `i`.`item_id`)),0) AS `ratings` from `items_view` `i` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `store_stock_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `store_stock_view` AS select `st`.`stock_id` AS `stock_id`,`st`.`item_id` AS `item_id`,`st`.`partion` AS `partion`,`st`.`store_id` AS `store_id`,`i`.`itemname` AS `itemname`,`i`.`item_code` AS `item_code`,`i`.`cat_id` AS `cat_id`,`i`.`msr` AS `msr`,`i`.`item_type` AS `item_type`,`i`.`bar_code` AS `bar_code`,`i`.`cat_name` AS `cat_name`,`i`.`disabled` AS `itemdisabled`,`stores`.`storename` AS `storename`,`st`.`qty` AS `qty`,`st`.`snumber` AS `snumber`,`st`.`sdate` AS `sdate` from ((`store_stock` `st` join `items_view` `i` on(((`i`.`item_id` = `st`.`item_id`) and (`i`.`disabled` <> 1)))) join `stores` on((`stores`.`store_id` = `st`.`store_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `timesheet_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `timesheet_view` AS select `t`.`time_id` AS `time_id`,`t`.`emp_id` AS `emp_id`,`t`.`description` AS `description`,`t`.`t_start` AS `t_start`,`t`.`t_end` AS `t_end`,`t`.`t_type` AS `t_type`,`t`.`t_break` AS `t_break`,`e`.`emp_name` AS `emp_name`,`b`.`branch_name` AS `branch_name`,`e`.`disabled` AS `disabled`,`t`.`branch_id` AS `branch_id` from ((`timesheet` `t` join `employees` `e` on((`t`.`emp_id` = `e`.`employee_id`))) left join `branches` `b` on((`t`.`branch_id` = `b`.`branch_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `users_view`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_unicode_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `users_view` AS select `users`.`user_id` AS `user_id`,`users`.`userlogin` AS `userlogin`,`users`.`userpass` AS `userpass`,`users`.`createdon` AS `createdon`,`users`.`email` AS `email`,`users`.`acl` AS `acl`,`users`.`options` AS `options`,`users`.`disabled` AS `disabled`,`roles`.`rolename` AS `rolename`,`users`.`role_id` AS `role_id`,`roles`.`acl` AS `roleacl`,coalesce(`employees`.`employee_id`,0) AS `employee_id`,(case when isnull(`employees`.`emp_name`) then `users`.`userlogin` else `employees`.`emp_name` end) AS `username` from ((`users` left join `employees` on(((`users`.`userlogin` = `employees`.`login`) and (`employees`.`disabled` <> 1)))) left join `roles` on((`users`.`role_id` = `roles`.`role_id`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + diff --git a/db/temp.sql b/db/temp.sql index 9071976b3..4d069a255 100644 --- a/db/temp.sql +++ b/db/temp.sql @@ -1,5 +1,28 @@ - + CREATE TABLE `custacc` ( + `ca_id` int(11) NOT NULL AUTO_INCREMENT, + `customer_id` int(11) NOT NULL, + `document_id` int(11) DEFAULT NULL, + `optype` int(11) DEFAULT '0', + + `amount` decimal(10,2) NOT NULL, + `createdon` date NOT NULL, + PRIMARY KEY (`ca_id`), + KEY `customer_id` (`customer_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE VIEW `custacc_view` AS + select + `c`.`ca_id` AS `ca_id`, + `c`.`customer_id` AS `customer_id`, + `c`.`document_id` AS `document_id`, + `c`.`optype` AS `optype`, + + `c`.`amount` AS `amount`, + `d`.`document_number` AS `document_number`, + `c`.`createdon` AS `createdon` + from + (`custacc` `c` join `documents` `d` on((`d`.`document_id` = `c`.`document_id`))); /* diff --git a/db/update500to510.sql b/db/update500to510.sql index 8b105393e..5442d16b7 100644 --- a/db/update500to510.sql +++ b/db/update500to510.sql @@ -57,27 +57,3 @@ ALTER VIEW `customers_view` AS `customers`; -CREATE TABLE `custacc` ( - `ca_id` int(11) NOT NULL AUTO_INCREMENT, - `customer_id` int(11) NOT NULL, - `document_id` int(11) DEFAULT NULL, - `optype` int(11) DEFAULT '0', - - `amount` decimal(10,2) NOT NULL, - `createdon` date NOT NULL, - PRIMARY KEY (`ca_id`), - KEY `customer_id` (`customer_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE VIEW `custacc_view` AS - select - `c`.`ca_id` AS `ca_id`, - `c`.`customer_id` AS `customer_id`, - `c`.`document_id` AS `document_id`, - `c`.`optype` AS `optype`, - - `c`.`amount` AS `amount`, - `d`.`document_number` AS `document_number`, - `c`.`createdon` AS `createdon` - from - (`custacc` `c` join `documents` `d` on((`d`.`document_id` = `c`.`document_id`))); \ No newline at end of file diff --git a/www/app/api/customers.php b/www/app/api/customers.php index b299c4bdb..4d9e59a18 100644 --- a/www/app/api/customers.php +++ b/www/app/api/customers.php @@ -20,6 +20,7 @@ public function list() { 'phone' => $cust->phone, 'email' => $cust->email, 'city' => $cust->city, + 'country' => $cust->country, 'address' => $cust->address, 'description' => base64_encode($cust->comment) ); diff --git a/www/app/api/docs.php b/www/app/api/docs.php index 803ec71e4..5bdf38419 100644 --- a/www/app/api/docs.php +++ b/www/app/api/docs.php @@ -292,4 +292,6 @@ public function createprodissue($args) { return $doc->document_number; } + + } diff --git a/www/app/api/items.php b/www/app/api/items.php index 9449c15b0..00af1d720 100644 --- a/www/app/api/items.php +++ b/www/app/api/items.php @@ -29,6 +29,10 @@ public function storelist() { } return $list; } + //список типов ТМЦ + public function typelist() { + return Item::getTypes(); + } // список артикулов public function articlelist() { @@ -56,21 +60,37 @@ public function itemlist() { if ($args['cat'] > 0) { $w .= " and cat_id=" . $args['cat']; } + if ($args['item_type'] > 0) { + $w .= " and item_type=" . $args['item_type']; + } + if (strlen($args['item_code']) > 0) { + $w .= " and item_code=" . Item::qstr($args['item_code']); + } + if (strlen($args['bar_code']) > 0) { + $w .= " and bar_code=" . Item::qstr($args['bar_code']); + } foreach (Item::find($w, 'itemname') as $item) { $plist = array(); - $it = $it = array( + $it = array( 'item_code' => $item->item_code, 'bar_code' => $item->bar_code, 'itemname' => $item->itemname, 'description' => base64_encode($item->description), 'measure' => $item->msr, + 'item_type' => $item->item_type, 'manufacturer' => $item->manufacturer, 'cat_name' => $item->cat_name, 'cat_id' => $item->cat_id ); - + + $it = array_merge($it,$item->getData()) ; + + unset($it['detail']); + unset($it['disabled']); + + if (strlen($item->price1) > 0) { $it['price1'] = $item->price1; } @@ -131,10 +151,11 @@ public function save($args) { $item->item_code = $args['item_code']; $item->bar_code = $args['bar_code']; $item->itemname = $args['itemname']; - $item->measure = $args['measure']; + $item->msr = $args['measure']; $item->manufacturer = $args['manufacturer']; $item->description = @base64_decode($args['description']); $item->cat_id = $args['cat_id']; + $item->item_type = $args['item_type']; if ($args['price1'] > 0) { $item->price1 = $args['price1']; diff --git a/www/app/entity/doc/document.php b/www/app/entity/doc/document.php index e1edaaab5..65a979191 100644 --- a/www/app/entity/doc/document.php +++ b/www/app/entity/doc/document.php @@ -167,7 +167,13 @@ private function unpackData() { return; } foreach ($xml->header->children() as $child) { - $this->headerdata[(string)$child->getName()] = (string)$child; + /* $ch = (string)$child; + if(is_numeric($ch)) { + if(ctype_digit($ch)) $ch = intval($ch); + else $ch = doubleval($ch) ; + } + */ + $this->headerdata[(string)$child->getName()] =$ch ; } $this->detaildata = array(); diff --git a/www/app/pages/main.php b/www/app/pages/main.php index 1ad01d7bb..9e9b975b4 100644 --- a/www/app/pages/main.php +++ b/www/app/pages/main.php @@ -206,7 +206,7 @@ public function __construct() { $mon[] = $m['name']; $sql = " - select coalesce(sum(0-e.`amount`)) as summa + select coalesce(sum(0-(e.outprice*e.quantity))) as summa from `entrylist_view` e join `items_view` i on e.`item_id` = i.`item_id` @@ -223,7 +223,7 @@ public function __construct() { $tstov[] = abs(round($conn->GetOne($sql))); $sql = " - select coalesce( sum(0-e.`amount`) ) as summa + select coalesce( sum(0-(e.outprice*e.quantity)) ) as summa from `entrylist_view` e join `services` s on e.`service_id` = s.`service_id` diff --git a/www/app/pages/reference/itemlist.php b/www/app/pages/reference/itemlist.php index 5577422b4..bad378cd5 100644 --- a/www/app/pages/reference/itemlist.php +++ b/www/app/pages/reference/itemlist.php @@ -182,7 +182,7 @@ public function itemlistOnRow(\Zippy\Html\DataList\DataRow $row) { $row->add(new Label('inseria'))->setVisible($item->useserial); $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); - $row->add(new ClickLink('delete'))->onClick($this, 'deleteOnClick'); + $row->add(new ClickLink('set'))->onClick($this, 'setOnClick'); $row->set->setVisible($item->item_type == Item::TYPE_PROD || $item->item_type == Item::TYPE_HALFPROD); @@ -200,25 +200,7 @@ public function itemlistOnRow(\Zippy\Html\DataList\DataRow $row) { } - public function deleteOnClick($sender) { - if (false == \App\ACL::checkDelRef('ItemList')) { - return; - } - - $item = $sender->owner->getDataItem(); - - if ($item->allowDelete()) { - Item::delete($item->item_id); - } else { - $this->setWarn("delitemwarn"); - $item->disabled = 1; - $item->save(); - } - - - $this->itemtable->listform->itemlist->Reload(false); - $this->resetURL(); - } + public function editOnClick($sender) { $item = $sender->owner->getDataItem(); diff --git a/www/app/pages/userlogin.php b/www/app/pages/userlogin.php index f6b12ac7d..b6cc6cfce 100644 --- a/www/app/pages/userlogin.php +++ b/www/app/pages/userlogin.php @@ -31,7 +31,7 @@ public function __construct() { $this->add($form); $this->setError(''); - $curver = 'v5.0.2'; + $curver = 'v5.1.0'; $this->_tvars['curversion'] = $curver; //проверка новой версии diff --git a/www/composer.json b/www/composer.json index 84007ba12..7cf6f0718 100644 --- a/www/composer.json +++ b/www/composer.json @@ -29,7 +29,7 @@ "symfony/polyfill-mbstring": "v1.22.0", "symfony/polyfill-uuid": "v1.22.0", - "leon-mbs/zippy": "2.2.9" + "leon-mbs/zippy": "2.2.10" } } diff --git a/www/composer.lock b/www/composer.lock index ec504eefa..01f4b2092 100644 --- a/www/composer.lock +++ b/www/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "674b8c588a4ad21a9ddb5d0932de5e91", + "content-hash": "a935492e8867814d9c68e861bef140cb", "packages": [ { "name": "adodb/adodb-php", @@ -868,16 +868,16 @@ }, { "name": "leon-mbs/zippy", - "version": "2.2.9", + "version": "2.2.10", "source": { "type": "git", "url": "https://github.com/leon-mbs/zippy.git", - "reference": "18e946ffd99ae0f5cacf055ce318168bca5586f4" + "reference": "c58d3548c96927788c9622c632112df09eefb456" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/leon-mbs/zippy/zipball/18e946ffd99ae0f5cacf055ce318168bca5586f4", - "reference": "18e946ffd99ae0f5cacf055ce318168bca5586f4", + "url": "https://api.github.com/repos/leon-mbs/zippy/zipball/c58d3548c96927788c9622c632112df09eefb456", + "reference": "c58d3548c96927788c9622c632112df09eefb456", "shasum": "" }, "require": { @@ -909,9 +909,9 @@ ], "support": { "issues": "https://github.com/leon-mbs/zippy/issues", - "source": "https://github.com/leon-mbs/zippy/tree/2.2.9" + "source": "https://github.com/leon-mbs/zippy/tree/2.2.10" }, - "time": "2021-05-07T06:54:38+00:00" + "time": "2021-05-11T18:37:08+00:00" }, { "name": "lis-dev/nova-poshta-api-2", @@ -2203,12 +2203,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "630d41ce85b7af3598a7d2c07952739da298ecc6" + "reference": "5ffdb87f627ff16cc392e30515a1fe069cddc3e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/630d41ce85b7af3598a7d2c07952739da298ecc6", - "reference": "630d41ce85b7af3598a7d2c07952739da298ecc6", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5ffdb87f627ff16cc392e30515a1fe069cddc3e2", + "reference": "5ffdb87f627ff16cc392e30515a1fe069cddc3e2", "shasum": "" }, "conflict": { @@ -2449,7 +2449,7 @@ "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/serializer": ">=2,<2.0.11", "symfony/symfony": ">=2,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/translation": ">=2,<2.0.17", @@ -2551,7 +2551,7 @@ "type": "tidelift" } ], - "time": "2021-05-12T16:13:16+00:00" + "time": "2021-05-13T21:03:10+00:00" }, { "name": "sabberworm/php-css-parser", diff --git a/www/templates/pages/reference/itemlist.html b/www/templates/pages/reference/itemlist.html index e21aa10ef..08b2a7d6d 100644 --- a/www/templates/pages/reference/itemlist.html +++ b/www/templates/pages/reference/itemlist.html @@ -68,7 +68,7 @@

Справочник номенклатуры - + @@ -111,13 +111,12 @@

Справочник номенклатуры   - - + -    -    +       +       в категорию diff --git a/www/templates/pages/userlogin.html b/www/templates/pages/userlogin.html index 6e9ea215c..a7c5c6d90 100644 --- a/www/templates/pages/userlogin.html +++ b/www/templates/pages/userlogin.html @@ -57,8 +57,7 @@

{{appname}}

- +
diff --git a/www/templates_ua/pages/reference/itemlist.html b/www/templates_ua/pages/reference/itemlist.html index fc0441097..6f36a4df3 100644 --- a/www/templates_ua/pages/reference/itemlist.html +++ b/www/templates_ua/pages/reference/itemlist.html @@ -70,7 +70,7 @@

Довідник номенклатури - + @@ -112,13 +112,12 @@

Довідник номенклатури   - - +    -    +       в категорiю diff --git a/www/templates_ua/pages/userlogin.html b/www/templates_ua/pages/userlogin.html index befa50806..8cdc43704 100644 --- a/www/templates_ua/pages/userlogin.html +++ b/www/templates_ua/pages/userlogin.html @@ -57,8 +57,7 @@

{{appname}}

- +