-- http://www.phpmyadmin.net
--




--
-- Database: `erp2016_fatma`
--

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

--
-- Table structure for table `accountmovement`
--

CREATE TABLE IF NOT EXISTS `accountmovement` (
  `accountmovementid` int(11) NOT NULL AUTO_INCREMENT,
  `accountmovementbefore` decimal(10,2) NOT NULL,
  `accountmovementamount` decimal(10,2) NOT NULL,
  `accountmovementafter` decimal(10,2) NOT NULL,
  `accountmovementtype` int(11) NOT NULL COMMENT '0 => deposit- 1 => withdrawal',
  `processname` varchar(256) DEFAULT NULL,
  `accountmovementmodelid` int(11) NOT NULL,
  `accountmovementdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `accountid` int(11) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  `bankid` int(11) NOT NULL,
  `accountmovementcomment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `accountmovementkindid` int(11) NOT NULL,
  PRIMARY KEY (`accountmovementid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `accountmovementkind`
--

CREATE TABLE IF NOT EXISTS `accountmovementkind` (
  `accountmovementkindid` int(11) NOT NULL AUTO_INCREMENT,
  `accountmovementkindname` varchar(256) DEFAULT NULL,
  `accountmovementkinddate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  `conditions` int(1) NOT NULL,
  `accountmovementkindcomment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`accountmovementkindid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

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

--
-- Table structure for table `accountstree`
--

CREATE TABLE IF NOT EXISTS `accountstree` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `customName` varchar(255) NOT NULL,
  `parent` int(11) NOT NULL,
  `itemtype` int(11) NOT NULL COMMENT '0 masrofat-1khsoom-2eradat-3osool',
  `itemfrom` int(11) NOT NULL COMMENT '0 from program - 1 from tree only',
  `notes` text NOT NULL,
  `del` int(11) NOT NULL COMMENT '0not del - 1 deleted',
  `userid` int(11) NOT NULL,
  `mydate` date NOT NULL,
  `itemtype2` int(11) NOT NULL COMMENT '0 "parent" is a node haschilden - 1 "end element" has no childern only 1 is used in daily entry',
  `theValue` decimal(10,2) NOT NULL,
  `theOrder` int(11) NOT NULL COMMENT 'like 123',
  `layingOrder` varchar(255) NOT NULL COMMENT 'like 1.2.1',
  `reportid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `accountstreefromprog`
--

CREATE TABLE IF NOT EXISTS `accountstreefromprog` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `displayName` varchar(255) NOT NULL,
  `fptype` int(11) NOT NULL COMMENT '0 masrofat-1khsoom-2eradat-3osool',
  `showit` int(11) NOT NULL COMMENT '0show-1hide',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `accountstreesetting`
--

CREATE TABLE IF NOT EXISTS `accountstreesetting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `levelno` int(11) NOT NULL,
  `nooffields` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `assets`
--

CREATE TABLE IF NOT EXISTS `assets` (
  `assetId` int(11) NOT NULL AUTO_INCREMENT,
  `assetsName` varchar(265) NOT NULL DEFAULT '',
  `assetsDescription` text,
  `assetsValue` decimal(10,2) NOT NULL,
  `assetsDate` datetime NOT NULL,
  `depreciation` decimal(10,2) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `userid` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '0' COMMENT '0 --->old and 1 -->new',
  `assetsDepreciation` decimal(10,2) NOT NULL COMMENT 'for rate',
  `assetscatid` int(11) NOT NULL,
  `manufacture` int(11) NOT NULL DEFAULT '0' COMMENT '1 for ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€Â',
  `Hourlyrate` decimal(10,2) NOT NULL DEFAULT '10',
  `dailyentryid` varchar(11) NOT NULL,
  `saveid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`assetId`),
  KEY `assetscatid` (`assetscatid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------
--
-- Table structure for table `assetssale`
--

CREATE TABLE IF NOT EXISTS `assetssale` (
  `assetssaleid` int(11) NOT NULL AUTO_INCREMENT,
  `assetssaleclient` int(11) NOT NULL,
  `assetssalesave` int(11) NOT NULL,
  `assetssaleval` varchar(191) NOT NULL,
  `assetssalecomment` text CHARACTER SET utf8 NOT NULL,
  `assetssaledateadd` varchar(191) NOT NULL,
  `assetssaledate` varchar(191) NOT NULL,
  `assetsid` int(11) NOT NULL,
  PRIMARY KEY (`assetssaleid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------
--
-- Table structure for table `assetscat`
--

CREATE TABLE IF NOT EXISTS `assetscat` (
  `assetscatid` int(11) NOT NULL AUTO_INCREMENT,
  `cattitel` varchar(255) NOT NULL,
  `descripe` text NOT NULL,
  `userid` int(11) NOT NULL,
  `assetscatdate` date NOT NULL,
  `del` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`assetscatid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `availableparcode`
--

CREATE TABLE IF NOT EXISTS `availableparcode` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `value` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `bank`
--

CREATE TABLE IF NOT EXISTS `bank` (
  `bankid` int(11) NOT NULL AUTO_INCREMENT,
  `bankname` varchar(256) NOT NULL,
  `bankdetails` text,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `bankdate` date NOT NULL,
  PRIMARY KEY (`bankid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `bankaccount`
--

CREATE TABLE IF NOT EXISTS `bankaccount` (
  `accountid` int(11) NOT NULL AUTO_INCREMENT,
  `accountname` varchar(256) NOT NULL,
  `comment` text,
  `accountnumber` varchar(256) NOT NULL,
  `accountbeginingbalance` decimal(10,2) NOT NULL,
  `accountdate` datetime NOT NULL,
  `accountcurrencytype` varchar(10) DEFAULT NULL,
  `bankid` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `visa` tinyint(4) NOT NULL DEFAULT '0',
  `visaDisPer` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`accountid`),
  KEY `bankid` (`bankid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billname`
--

CREATE TABLE IF NOT EXISTS `billname` (
  `billnameid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL,
  `billnamedate` date NOT NULL,
  `billtype` int(11) NOT NULL DEFAULT '0' COMMENT '0 => sellbill- 1 => buybill',
  `billtype2` int(11) NOT NULL DEFAULT '0' COMMENT '0=>normal bill-1=>optics bill',
  `ordertype` int(11) NOT NULL DEFAULT '0' COMMENT ' 1 ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã',
  `saveeffect` int(11) NOT NULL DEFAULT '0' COMMENT '1 ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ãâ',
  `productAndQuantityOnly` int(11) NOT NULL DEFAULT '0',
  `posFlag` int(11) NOT NULL COMMENT 'parcode scale',
  `posCode` int(11) NOT NULL COMMENT 'parcode scale',
  `posType` tinyint(4) NOT NULL COMMENT 'parcode scale',
  `posWeightPrice` int(11) NOT NULL COMMENT 'parcode scale',
  `checkDigit` int(11) NOT NULL COMMENT 'parcode scale',
  `goodsReceiptApproval` text NOT NULL,
  `parcodeType` tinyint(4) NOT NULL DEFAULT '0',
  `defVisaAccount` int(11) NOT NULL DEFAULT '0',
  `defVisaAccountSelect` tinyint(4) NOT NULL DEFAULT '0',
  `isBankAccountTransfer` tinyint(4) NOT NULL DEFAULT '0',
  `taxOfDiscountVal` float NOT NULL DEFAULT '0',
  `taxOfDiscountPrint` tinyint(4) NOT NULL DEFAULT '0',
  `extraDiscountPlace` tinyint(4) NOT NULL DEFAULT '0',
  `extraDiscountFixed` tinyint(4) NOT NULL DEFAULT '0',
  `extraDiscountPer` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`billnameid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billproperty`
--

CREATE TABLE IF NOT EXISTS `billproperty` (
  `billpropertyid` int(11) NOT NULL AUTO_INCREMENT,
  `billpropertyname` varchar(256) NOT NULL,
  `description` text NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`billpropertyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `bills`
--

CREATE TABLE IF NOT EXISTS `bills` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `branchid` int(11) DEFAULT '0',
  `clientid` int(11) DEFAULT NULL,
  `receivedate` datetime DEFAULT NULL,
  `billno` varchar(255) DEFAULT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `billdate` datetime DEFAULT NULL,
  `serverdate` datetime DEFAULT NULL COMMENT 'date when bill added',
  `kashfid` int(11) DEFAULT NULL,
  `cash` int(11) DEFAULT '0',
  `cashvalue` decimal(10,2) DEFAULT '0',
  `waitvalue` decimal(10,2) DEFAULT '0',
  `insurance` int(11) DEFAULT '0',
  `insurancecompanyid` int(11) DEFAULT NULL,
  `customerpercent` decimal(10,2) DEFAULT '0',
  `customermax` decimal(10,2) DEFAULT '0',
  `customercarry` decimal(10,2) DEFAULT '0',
  `companyaccept` decimal(10,2) DEFAULT '0',
  `companycarry` decimal(10,2) DEFAULT '0',
  `card` int(11) DEFAULT '0',
  `cardvalue` decimal(10,2) DEFAULT '0',
  `paymentnetworkid` int(11) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  `kashftype` int(11) NOT NULL DEFAULT '0' COMMENT '1 external - 0 internal ',
  `alloweddays` int(11) DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `productstotalprice` decimal(10,2) DEFAULT NULL COMMENT ' ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ãâ€',
  `kashfvalue` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `kashfdiscount` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `netbillvalue` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `discounttype` int(11) DEFAULT NULL COMMENT ' 1 direct   - 2 percent',
  `discountvalue` decimal(10,2) DEFAULT NULL COMMENT 'discValue',
  `finalnetbillvalue` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `offline` int(11) DEFAULT '0' COMMENT '0 online - 1 offline',
  `uploaddate` datetime DEFAULT NULL,
  `pricetype` int(11) DEFAULT NULL,
  `billstatus` int(11) DEFAULT NULL,
  `approvalno` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deliverytime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kashfplace` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kashfdate` date DEFAULT NULL,
  `dailyentryid` int(11) DEFAULT NULL,
  `insdiscountpercent` decimal(10,2) DEFAULT '0' COMMENT 'insurance company discount percent',
  `clientPayReceiptVal` decimal(10,2) DEFAULT '0',
  `netdiscountpercent` decimal(10,2) DEFAULT '0' COMMENT 'network discount percent',
  `rondomtxt` varchar(255) DEFAULT NULL,
  `attatch` varchar(255) NOT NULL COMMENT 'for insurance only it is file in the bill by fatma',
  `approved` int(11) NOT NULL COMMENT '1accepted-2rejected this is for insurance only  by fatma',
  `saveid` int(11) NOT NULL COMMENT ' by fatma',
  `approveNo` varchar(255) NOT NULL COMMENT 'for insurance bills approve by fatma',
  `approveFile` varchar(255) NOT NULL COMMENT 'for insurance bills approve  by fatma',
  `notifSeen` int(11) NOT NULL COMMENT '0 not seen - 1 seen in notification',
  `payType` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billsbuy`
--

CREATE TABLE IF NOT EXISTS `billsbuy` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `branchid` int(11) DEFAULT '0',
  `clientid` int(11) DEFAULT NULL COMMENT 'which is supplierid',
  `receivedate` date DEFAULT NULL,
  `billno` varchar(255) DEFAULT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `billdate` datetime DEFAULT NULL,
  `serverdate` datetime DEFAULT NULL COMMENT 'date when bill added',
  `kashfid` int(11) DEFAULT NULL,
  `cash` int(11) DEFAULT '0',
  `cashvalue` decimal(10,2) DEFAULT '0',
  `waitvalue` decimal(10,2) DEFAULT '0',
  `insurance` int(11) DEFAULT '0',
  `insurancecompanyid` int(11) DEFAULT NULL,
  `customerpercent` decimal(10,2) DEFAULT '0',
  `customermax` decimal(10,2) DEFAULT '0',
  `customercarry` decimal(10,2) DEFAULT '0',
  `companyaccept` decimal(10,2) DEFAULT '0',
  `companycarry` decimal(10,2) DEFAULT '0',
  `card` int(11) DEFAULT '0',
  `cardvalue` decimal(10,2) DEFAULT '0',
  `paymentnetworkid` int(11) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  `kashftype` int(11) NOT NULL DEFAULT '0' COMMENT '1 external - 0 internal ',
  `alloweddays` int(11) DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `productstotalprice` decimal(10,2) DEFAULT NULL COMMENT ' ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ãâ€',
  `kashfvalue` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `kashfdiscount` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `netbillvalue` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `discounttype` int(11) DEFAULT NULL COMMENT ' 1 direct   - 2 percent',
  `discountvalue` decimal(10,2) DEFAULT NULL COMMENT 'discValue',
  `finalnetbillvalue` decimal(10,2) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `offline` int(11) DEFAULT '0' COMMENT '0 online - 1 offline',
  `uploaddate` datetime DEFAULT NULL,
  `pricetype` int(11) DEFAULT NULL,
  `billstatus` int(11) DEFAULT NULL,
  `approvalno` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deliverytime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kashfplace` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kashfdate` date DEFAULT NULL,
  `dailyentryid` int(11) DEFAULT NULL,
  `insdiscountpercent` decimal(10,2) DEFAULT '0' COMMENT 'insurance company discount percent',
  `clientPayReceiptVal` decimal(10,2) DEFAULT '0',
  `netdiscountpercent` decimal(10,2) DEFAULT '0' COMMENT 'network discount percent',
  `rondomtxt` varchar(255) DEFAULT NULL,
  `attatch` varchar(255) NOT NULL COMMENT 'for insurance only it is file in the bill by fatma',
  `approved` int(11) NOT NULL COMMENT '1accepted-2rejected this is for insurance only  by fatma',
  `saveid` int(11) NOT NULL COMMENT ' by fatma',
  `approveNo` varchar(255) NOT NULL COMMENT 'for insurance bills approve by fatma',
  `approveFile` varchar(255) NOT NULL COMMENT 'for insurance bills approve  by fatma',
  `notifSeen` int(11) NOT NULL COMMENT '0 not seen - 1 seen in notification',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billsettings`
--

CREATE TABLE IF NOT EXISTS `billsettings` (
  `billsettingsid` int(11) NOT NULL AUTO_INCREMENT,
  `billnameid` int(11) NOT NULL,
  `billpropertyid` int(11) NOT NULL,
  `billsettingsvalue` int(11) NOT NULL DEFAULT '0' COMMENT '0 => yes- 1 => no',
  PRIMARY KEY (`billsettingsid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billsproducts`
--

CREATE TABLE IF NOT EXISTS `billsproducts` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `billid` int(11) unsigned DEFAULT NULL,
  `productid` int(11) unsigned DEFAULT NULL,
  `note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `productno` int(10) unsigned DEFAULT NULL,
  `productprice` decimal(10,2) unsigned DEFAULT NULL,
  `producttotalprice` decimal(10,2) DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  `service` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `retproductno` int(11) DEFAULT '0' COMMENT 'no of returned product',
  `rondomtxt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `storeid` int(11) NOT NULL,
  `productcode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billsproductsbuy`
--

CREATE TABLE IF NOT EXISTS `billsproductsbuy` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `billid` int(11) unsigned DEFAULT NULL,
  `productid` int(11) unsigned DEFAULT NULL,
  `note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `productno` int(10) unsigned DEFAULT NULL,
  `productprice` decimal(10,2) unsigned DEFAULT NULL,
  `producttotalprice` decimal(10,2) DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  `service` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `retproductno` int(11) DEFAULT '0' COMMENT 'no of returned product',
  `rondomtxt` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `storeid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billsreturn`
--

CREATE TABLE IF NOT EXISTS `billsreturn` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `billid` int(11) DEFAULT NULL,
  `returnedprice` decimal(10,2) DEFAULT '0',
  `clientreceivevalue` decimal(10,2) DEFAULT '0',
  `date` date DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  `dailyentryid` int(11) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `branchid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `billsreturnproducts`
--

CREATE TABLE IF NOT EXISTS `billsreturnproducts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) DEFAULT NULL,
  `returnbillid` int(11) DEFAULT NULL,
  `productno` int(11) DEFAULT '0',
  `productprice` decimal(10,2) DEFAULT NULL,
  `producttotalprice` decimal(10,2) DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  `billproductid` int(11) DEFAULT NULL,
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `bind`
--

CREATE TABLE IF NOT EXISTS `bind` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employeeid` int(11) DEFAULT NULL,
  `bindtype` int(11) DEFAULT NULL COMMENT '1 : save - 0 : bank',
  `saveid` int(11) DEFAULT NULL,
  `savevalue` decimal(10,2) DEFAULT NULL,
  `bankid` int(11) DEFAULT NULL,
  `bankaccount` int(11) DEFAULT NULL,
  `ckekno` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `benefitname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ckekvalue` decimal(10,2) DEFAULT NULL,
  `dailyentryid` int(11) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL,
  `binddate` date DEFAULT NULL,
  `deleted` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `bindsettlement`
--

CREATE TABLE IF NOT EXISTS `bindsettlement` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` int(11) DEFAULT NULL,
  `employeeid` int(11) DEFAULT NULL,
  `settlementway` int(11) DEFAULT NULL COMMENT '1 : masroufat - 2 saves',
  `settlementwayid` int(11) DEFAULT NULL,
  `projectid` int(11) DEFAULT NULL,
  `value` decimal(10,2) DEFAULT NULL,
  `comment` text COLLATE utf8mb4_unicode_ci,
  `deleted` int(11) DEFAULT '0',
  `dailyentryid` int(11) DEFAULT NULL,
  `groupno` int(11) DEFAULT '0',
  `group` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='تسوية عهده ' AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `branch`
--

CREATE TABLE IF NOT EXISTS `branch` (
  `branchId` int(11) NOT NULL AUTO_INCREMENT,
  `branchName` varchar(255) NOT NULL,
  `branchDate` date NOT NULL,
  `phone` varchar(255) NOT NULL,
  `mobile` varchar(255) NOT NULL,
  `branchNo` int(11) DEFAULT NULL,
  `branchAddress` varchar(255) DEFAULT NULL,
  `message` text NOT NULL,
  `logo` varchar(255) NOT NULL,
  PRIMARY KEY (`branchId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `buyandruternbill`
--

CREATE TABLE IF NOT EXISTS `buyandruternbill` (
  `buybillid` int(11) NOT NULL AUTO_INCREMENT,
  `buybillSerial` varchar(255) DEFAULT NULL,
  `buybilldate` datetime DEFAULT NULL,
  `buybillsupplierid` int(11) NOT NULL,
  `buybilltotaldeptbefor` decimal(10,2) NOT NULL,
  `buybilltotaldeptafter` decimal(10,2) NOT NULL,
  `buybilldiscount` varchar(255) NOT NULL DEFAULT '',
  `buybilldiscountrype` int(11) NOT NULL DEFAULT '0',
  `buybilltotalbill` decimal(10,2) NOT NULL,
  `buybillaftertotalbill` decimal(10,2) NOT NULL,
  `buybilltotalpayed` decimal(10,2) NOT NULL,
  `buybillfinalbill` decimal(10,2) NOT NULL,
  `buybillstoreid` int(11) NOT NULL,
  `buybillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `buybillclientname` varchar(255) NOT NULL DEFAULT '',
  `buybillsaveid` int(11) NOT NULL,
  `buybilldirectpayment` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `deletedbuyid` int(11) DEFAULT NULL,
  `controlname` varchar(255) NOT NULL,
  `payedtax` decimal(10,2) NOT NULL DEFAULT '0',
  `costcenterid` int(11) DEFAULT '0',
  `dailyentryid` int(11) DEFAULT NULL,
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`buybillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `buyandruternbilldetail`
--

CREATE TABLE IF NOT EXISTS `buyandruternbilldetail` (
  `Parcode` varchar(255) NOT NULL DEFAULT '',
  `buybilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `buybillid` int(11) NOT NULL,
  `buybilldetailcatid` int(11) NOT NULL,
  `buybilldetailproductid` int(11) NOT NULL,
  `buybilldetailquantity` decimal(10,2) NOT NULL,
  `buybilldetailprice` decimal(10,2) NOT NULL,
  `buybilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `buybilldetaildate` date NOT NULL,
  `billtype` int(11) NOT NULL COMMENT '0 for buy 1 for return',
  `productunitid` int(11) NOT NULL,
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `quantitybefore` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`buybilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `buybill`
--

CREATE TABLE IF NOT EXISTS `buybill` (
  `buybillid` int(11) NOT NULL AUTO_INCREMENT,
  `buybillSerial` varchar(255) DEFAULT NULL,
  `buybilldate` datetime DEFAULT NULL,
  `buybillsupplierid` int(11) NOT NULL,
  `buybilltotaldeptbefor` decimal(10,2) NOT NULL,
  `buybilltotaldeptafter` decimal(10,2) NOT NULL,
  `buybilldiscount` varchar(255) NOT NULL DEFAULT '',
  `buybilldiscountrype` int(11) NOT NULL DEFAULT '0',
  `buybilltotalbill` decimal(10,2) NOT NULL,
  `buybillaftertotalbill` decimal(10,2) NOT NULL,
  `buybilltotalpayed` decimal(10,2) NOT NULL,
  `buybillfinalbill` decimal(10,2) NOT NULL,
  `buybillstoreid` int(11) NOT NULL,
  `buybillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `buybillclientname` varchar(255) NOT NULL DEFAULT '',
  `buybillsaveid` int(11) NOT NULL,
  `buybilldirectpayment` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `deletedbuyid` int(11) DEFAULT NULL,
  `controlname` varchar(255) NOT NULL,
  `payedtax` decimal(10,2) NOT NULL DEFAULT '0',
  `costcenterid` int(11) DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`buybillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `buybilldetail`
--

CREATE TABLE IF NOT EXISTS `buybilldetail` (
  `Parcode` varchar(255) NOT NULL DEFAULT '',
  `buybilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `buybillid` int(11) NOT NULL,
  `buybilldetailcatid` int(11) NOT NULL,
  `buybilldetailproductid` int(11) NOT NULL,
  `buybilldetailquantity` decimal(10,2) NOT NULL,
  `buybilldetailprice` decimal(10,2) NOT NULL,
  `buybilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `buybilldetaildate` date NOT NULL,
  `productunitid` int(11) NOT NULL,
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `quantitybefore` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`buybilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `buypriceshistorybook`
--

CREATE TABLE IF NOT EXISTS `buypriceshistorybook` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `theDate` date NOT NULL,
  `storeId` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `sizeid` int(11) NOT NULL,
  `colorid` int(11) NOT NULL,
  `buyprice` decimal(10,2) NOT NULL,
  `buyQuantity` decimal(10,2) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL,
  `del` tinyint(4) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `theDate` (`theDate`,`storeId`,`productid`,`sizeid`,`colorid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `capital`
--

CREATE TABLE IF NOT EXISTS `capital` (
  `capitalid` int(11) NOT NULL AUTO_INCREMENT,
  `capitalamount` double NOT NULL,
  PRIMARY KEY (`capitalid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `cashtransfer`
--

CREATE TABLE IF NOT EXISTS `cashtransfer` (
  `cashtransferid` int(11) NOT NULL AUTO_INCREMENT,
  `bankaccountid` int(11) NOT NULL,
  `saveid` int(11) NOT NULL,
  `accountbeforevalue` decimal(10,2) NOT NULL,
  `cashtransferuser` varchar(256) DEFAULT NULL,
  `cashtransferamount` decimal(10,2) NOT NULL,
  `cashtransferdate` date NOT NULL,
  `cashtransfernote` varchar(600) DEFAULT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `cashtransfernumber` decimal(55,2) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`cashtransferid`),
  KEY `bankaccountid` (`bankaccountid`,`saveid`),
  KEY `saveid` (`saveid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `checkcontroller`
--

CREATE TABLE IF NOT EXISTS `checkcontroller` (
  `checkControllerid` int(11) NOT NULL AUTO_INCREMENT,
  `checkid` int(11) NOT NULL,
  `controllerid` int(11) NOT NULL,
  `type` varchar(255) NOT NULL,
  PRIMARY KEY (`checkControllerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `checkdeposit`
--

CREATE TABLE IF NOT EXISTS `checkdeposit` (
  `checkdepositid` int(11) NOT NULL AUTO_INCREMENT,
  `bankaccountid` int(11) NOT NULL,
  `clientid` int(11) NOT NULL,
  `checkdepositnumber` int(11) NOT NULL,
  `checkdeposituser` varchar(256) DEFAULT NULL,
  `checkdepositamount` decimal(10,2) NOT NULL,
  `checkdepositdate` date NOT NULL,
  `checkdepositnote` varchar(600) DEFAULT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `accountbeforevalue` decimal(10,2) NOT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `checkdate` date DEFAULT NULL,
  PRIMARY KEY (`checkdepositid`),
  KEY `bankaccountid` (`bankaccountid`,`clientid`),
  KEY `clientid` (`clientid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `checkwithdrawal`
--

CREATE TABLE IF NOT EXISTS `checkwithdrawal` (
  `checkwithdrawalid` int(11) NOT NULL AUTO_INCREMENT,
  `bankaccountid` int(11) NOT NULL,
  `supplierid` int(11) NOT NULL,
  `accountbeforevalue` decimal(10,2) NOT NULL,
  `checkwithdrawaluser` varchar(256) DEFAULT NULL,
  `checkwithdrawalamount` decimal(10,2) NOT NULL,
  `checkwithdrawaldate` date NOT NULL,
  `checkwithdrawalnote` varchar(600) DEFAULT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `checkwithdrawalnumber` decimal(13,0) NOT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`checkwithdrawalid`),
  KEY `bankaccountid` (`bankaccountid`,`supplierid`),
  KEY `supplierid` (`supplierid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `clientarea`
--

CREATE TABLE IF NOT EXISTS `clientarea` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `comment` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `clientdebtchange`
--

CREATE TABLE IF NOT EXISTS `clientdebtchange` (
  `clientdebtchangeid` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `clientdebtchangebefore` decimal(10,2) NOT NULL,
  `clientdebtchangeamount` decimal(10,2) NOT NULL,
  `clientdebtchangetype` int(11) NOT NULL DEFAULT '0' COMMENT '0 => plus- 1 => minus',
  `processname` varchar(500) NOT NULL,
  `clientdebtchangemodelid` int(11) NOT NULL,
  `clientdebtchangeafter` decimal(10,2) NOT NULL,
  `clientdebtchangedate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  `comment` text,
  `totalOperationCost` decimal(10,2) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `discount` decimal(10,2) DEFAULT '0',
  `reciptid` int(11) DEFAULT '0',
  `del` int(11) NOT NULL DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `num` int(11) DEFAULT NULL,
  `billid` int(11) DEFAULT NULL,
  `paytype` varchar(255) DEFAULT NULL,
  `seller` int(11) NOT NULL DEFAULT '0',
  `discountearlyRepayment` decimal(10,2) DEFAULT NULL,
  `costcenterid` int(11) NOT NULL DEFAULT '0',
  `currencyId` int(11) NOT NULL,
  `conversionFactor` float NOT NULL,
  `payedInCurrency` decimal(10,2) NOT NULL,
  `saveConversionFactor` float NOT NULL,
  PRIMARY KEY (`clientdebtchangeid`),
  KEY `clientid` (`clientid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `clientpaymentreceiptt`
--

CREATE TABLE IF NOT EXISTS `clientpaymentreceiptt` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `billid` int(11) NOT NULL,
  `payedtype` int(11) NOT NULL COMMENT '0 --ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã',
  `paymethod` int(11) NOT NULL,
  `debtbefore` decimal(10,2) NOT NULL,
  `payed` decimal(10,2) NOT NULL,
  `debtafter` decimal(10,2) NOT NULL,
  `biltype` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` date NOT NULL,
  `del` int(11) NOT NULL,
  `dailyentryid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `clinic`
--

CREATE TABLE IF NOT EXISTS `clinic` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8 NOT NULL,
  `description` text CHARACTER SET utf8 NOT NULL,
  `tempdel` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `collectedparcodestemp`
--

CREATE TABLE IF NOT EXISTS `collectedparcodestemp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `parcodes` text NOT NULL,
  `sysdate` datetime NOT NULL,
  `conditions` tinyint(4) NOT NULL COMMENT '0 new,1 being done as sellbill , 2 completed',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `commentclient`
--

CREATE TABLE IF NOT EXISTS `commentclient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `comments` text NOT NULL,
  `commentdate` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `costcenter`
--

CREATE TABLE IF NOT EXISTS `costcenter` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `comment` text NOT NULL,
  `condation` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `costcenterdetail`
--

CREATE TABLE IF NOT EXISTS `costcenterdetail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `costcenterid` int(11) NOT NULL,
  `type` int(11) NOT NULL COMMENT '0 for sell 1 for return sell 2 for selland return 3 for buy 4 for return buy 5 for buyand return 6 for expeneses 7 for income 8 for salary 9 withdrow 10borrow 11 Advance payment directly-12 expenseexchange-13 bindsettlement',
  `processname` text NOT NULL,
  `modelid` int(11) NOT NULL,
  `tablename` varchar(255) NOT NULL,
  `costdate` date NOT NULL,
  `uesrid` int(11) NOT NULL,
  `del` int(11) NOT NULL,
  `costamount` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `country`
--

CREATE TABLE IF NOT EXISTS `country` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `nameen` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `currency`
--

CREATE TABLE IF NOT EXISTS `currency` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `symbol` varchar(100) NOT NULL,
  `conversionFactor` float NOT NULL,
  `conditions` tinyint(4) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `dailyentry`
--

CREATE TABLE IF NOT EXISTS `dailyentry` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `totalcreditor` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `totaldebtor` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `thedate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `condition` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 not del',
  `reverseofid` int(11) NOT NULL DEFAULT '0',
  `dDateTime` datetime NOT NULL,
  `entryComment` text,
  `fromFlag` int(11) NOT NULL COMMENT '0entry from daily entry controller-1 entry from program plugins-2 from plugins that use affectplugin()"like case 0" it makes daily entry and automatically affect plugins like ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ',
  `related` int(11) NOT NULL COMMENT 'rows has the same no are related "dailyentrymany one entry"',
  `branchid` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `dailyentrycreditor`
--

CREATE TABLE IF NOT EXISTS `dailyentrycreditor` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dailyentryid` int(11) NOT NULL,
  `accountstreeid` int(11) NOT NULL,
  `value` decimal(10,2) NOT NULL,
  `dComment` varchar(300) NOT NULL,
  `costcenterid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `dailyentrydebtor`
--

CREATE TABLE IF NOT EXISTS `dailyentrydebtor` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dailyentryid` int(11) NOT NULL,
  `accountstreeid` int(11) NOT NULL,
  `value` decimal(10,2) NOT NULL,
  `dComment` varchar(300) NOT NULL,
  `costcenterid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `damagedproduct`
--

CREATE TABLE IF NOT EXISTS `damagedproduct` (
  `damagedProductId` int(11) NOT NULL AUTO_INCREMENT,
  `productId` int(11) NOT NULL,
  `measurUnitId` int(11) NOT NULL,
  `productQuantity` int(11) NOT NULL,
  `cost` int(11) NOT NULL,
  `productionOrderId` int(11) NOT NULL,
  `operationDate` date NOT NULL,
  `userID` int(11) NOT NULL,
  `storeId` int(11) NOT NULL,
  PRIMARY KEY (`damagedProductId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `datedchecked`
--

CREATE TABLE IF NOT EXISTS `datedchecked` (
  `addType` int(11) NOT NULL COMMENT '0 for client 1 for supplier',
  `datedCheckedID` int(11) NOT NULL AUTO_INCREMENT,
  `bankName` varchar(255) NOT NULL,
  `accountNo` int(11) NOT NULL,
  `checkValue` int(11) NOT NULL,
  `checkNo` int(11) NOT NULL,
  `dueDate` date NOT NULL,
  `antherDetailes` varchar(255) NOT NULL,
  `done` int(11) NOT NULL COMMENT '0 for not done - 1 for done - 2 for cancaled - 3 for endoursed',
  `operationDate` date NOT NULL,
  `userID` int(11) NOT NULL,
  `clientNum` int(11) NOT NULL COMMENT 'clientNum = clientId',
  `resonForRefused` varchar(255) NOT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `checkdate` date DEFAULT NULL,
  `endorsePersonId` int(11) DEFAULT NULL COMMENT 'often id of supplier ',
  `endorseComment` text,
  `endorseDate` date DEFAULT NULL,
  PRIMARY KEY (`datedCheckedID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `discountcontrol`
--

CREATE TABLE IF NOT EXISTS `discountcontrol` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `totalFrom` float NOT NULL,
  `totalTo` float NOT NULL,
  `discount` float NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `conditions` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `doctorkashf`
--

CREATE TABLE IF NOT EXISTS `doctorkashf` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `rdsphere` text NOT NULL,
  `rnsphere` text NOT NULL,
  `rdcylinder` text NOT NULL,
  `rncylinder` text NOT NULL,
  `rdaxis` text NOT NULL,
  `rnaxis` text NOT NULL,
  `rdprism` text NOT NULL,
  `rnprism` text NOT NULL,
  `rdva` text NOT NULL,
  `rnva` text NOT NULL,
  `ldsphere` text NOT NULL,
  `lnsphere` text NOT NULL,
  `ldcylinder` text NOT NULL,
  `lncylinder` text NOT NULL,
  `ldaxis` text NOT NULL,
  `lnaxis` text NOT NULL,
  `ldprism` text NOT NULL,
  `lnprism` text NOT NULL,
  `ldva` text NOT NULL,
  `lnva` text NOT NULL,
  `customerid` int(6) NOT NULL,
  `kashfid` int(11) NOT NULL DEFAULT '0',
  `doctorid` int(11) NOT NULL,
  `date` date NOT NULL,
  `loguserid` int(11) NOT NULL DEFAULT '0',
  `branchid` int(11) NOT NULL DEFAULT '0',
  `rondomtxt` varchar(255) DEFAULT NULL,
  `uploaddate` datetime DEFAULT NULL,
  `offline` int(11) DEFAULT '0' COMMENT ' 1 offline - 0 online ',
  `radd` text,
  `rbiofocal` text,
  `ladd` text,
  `lbiofocal` text,
  `pd` text,
  `bvd` text,
  `notes` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employee`
--

CREATE TABLE IF NOT EXISTS `employee` (
  `employeeId` int(11) NOT NULL AUTO_INCREMENT,
  `employeeName` varchar(256) NOT NULL,
  `employeeBOD` date DEFAULT NULL,
  `employeeAddress` text,
  `employeePhone` varchar(256) DEFAULT NULL,
  `employeeSalary` decimal(10,2) NOT NULL DEFAULT '0',
  `employeeBouns` decimal(10,2) NOT NULL DEFAULT '0',
  `employeeDate` datetime NOT NULL,
  `conditions` int(1) NOT NULL DEFAULT '0',
  `userId` int(11) NOT NULL,
  `username` varchar(256) NOT NULL,
  `empdept` int(11) NOT NULL DEFAULT '0',
  `isworker` int(11) NOT NULL DEFAULT '0' COMMENT '0 for yes 1 for no',
  `Hourlyrate` decimal(10,2) NOT NULL DEFAULT '0',
  `houseAllowance` decimal(10,2) NOT NULL,
  `transportationAllowance` decimal(10,2) NOT NULL,
  `otherAllowance` decimal(10,2) NOT NULL,
  `nationality` varchar(256) NOT NULL,
  `religion` varchar(256) NOT NULL,
  `noOfWorkDaysPerMonth` int(11) NOT NULL,
  `noOfWorkHoursDaysPerDay` int(11) NOT NULL,
  `noOfDistountDaysWhenAbsences` int(11) NOT NULL,
  `contract` varchar(255) NOT NULL,
  `residence` varchar(255) NOT NULL,
  `personalPhoto` varchar(255) NOT NULL,
  `healthCard` varchar(255) NOT NULL,
  `visa` varchar(255) NOT NULL,
  `passport` varchar(255) NOT NULL,
  `minuteLateCost` decimal(10,2) NOT NULL,
  `dayAbsencesCost` decimal(10,2) NOT NULL,
  `graduate` varchar(255) NOT NULL,
  `expert1` varchar(255) NOT NULL,
  `expert2` varchar(255) NOT NULL,
  `expert3` varchar(255) NOT NULL,
  `employeegroupid` int(11) NOT NULL,
  `employeesubgroupid` int(11) NOT NULL,
  `halfHourLateWithPermissionDisount` float NOT NULL,
  `hourLateWithPermissionDisount` float NOT NULL,
  `hourAndHalfLateWithPermissionDisount` float NOT NULL,
  `twoHoursLateWithPermissionDisount` float NOT NULL,
  `halfHourLateWithoutPermissionDisount` float NOT NULL,
  `hourLateWithoutPermissionDisount` float NOT NULL,
  `hourAndHalfLateWithoutPermissionDisount` float NOT NULL,
  `twoHoursLateWithoutPermissionDisount` float NOT NULL,
  `halfHourPermissionDisount` float NOT NULL,
  `hourPermissionDisount` float NOT NULL,
  `hourAndHalfPermissionDisount` float NOT NULL,
  `twoHoursPermissionDisount` float NOT NULL,
  `dayAbsenceWithPermissionDisount` float NOT NULL,
  `dayAbsenceWithoutPermissionDisount` float NOT NULL,
  `moreThanTwoHoursLateWithPermissionDisount` float NOT NULL,
  `moreThanTwoHoursLateWithoutPermissionDisount` float NOT NULL,
  `empFingerId` varchar(18) NOT NULL DEFAULT '',
  `empRFID` varchar(18) NOT NULL DEFAULT '',
  `empFingerId2` varchar(18) NOT NULL DEFAULT '',
  `empFingerId3` varchar(18) NOT NULL DEFAULT '',
  `empFingerId4` varchar(18) NOT NULL DEFAULT '',
  `empFingerId5` varchar(18) NOT NULL DEFAULT '',
  PRIMARY KEY (`employeeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeeattendance`
--

CREATE TABLE IF NOT EXISTS `employeeattendance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `empid` int(11) NOT NULL,
  `theImage` varchar(255) NOT NULL,
  `sysdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `fingerid` varchar(18) NOT NULL,
  `rfid` varchar(18) NOT NULL,
  `accessType` tinyint(4) NOT NULL COMMENT 'finger access 0, rfid access 1',
  `syncToServer` tinyint(4) NOT NULL COMMENT '0 at accees  device , 1 handled at erp',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeeattendancesystem`
--

CREATE TABLE IF NOT EXISTS `employeeattendancesystem` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `attendanceTime` time NOT NULL,
  `departureTime` time NOT NULL,
  `halfHourLateWithPermissionDisount` float NOT NULL,
  `hourLateWithPermissionDisount` float NOT NULL,
  `hourAndHalfLateWithPermissionDisount` float NOT NULL,
  `twoHoursLateWithPermissionDisount` float NOT NULL,
  `halfHourLateWithoutPermissionDisount` float NOT NULL,
  `hourLateWithoutPermissionDisount` float NOT NULL,
  `hourAndHalfLateWithoutPermissionDisount` float NOT NULL,
  `twoHoursLateWithoutPermissionDisount` float NOT NULL,
  `halfHourPermissionDisount` float NOT NULL,
  `hourPermissionDisount` float NOT NULL,
  `hourAndHalfPermissionDisount` float NOT NULL,
  `twoHoursPermissionDisount` float NOT NULL,
  `dayAbsenceWithPermissionDisount` float NOT NULL,
  `dayAbsenceWithoutPermissionDisount` float NOT NULL,
  `userid` int(11) NOT NULL,
  `del` tinyint(4) NOT NULL,
  `sysdate` datetime NOT NULL,
  `moreThanTwoHoursLateWithPermissionDisount` float NOT NULL,
  `moreThanTwoHoursLateWithoutPermissionDisount` float NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeeclosedaygroupstatus`
--

CREATE TABLE IF NOT EXISTS `employeeclosedaygroupstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL,
  `employeegroupid` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `conditions` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `day` (`day`,`employeegroupid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeeclosedayhistory`
--

CREATE TABLE IF NOT EXISTS `employeeclosedayhistory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employeeid` int(11) NOT NULL,
  `day` date NOT NULL,
  `attendanceTime` time NOT NULL,
  `departureTime` time NOT NULL,
  `latePeriod` float NOT NULL,
  `lateHasPermission` tinyint(4) NOT NULL,
  `lateDiscount` float NOT NULL,
  `isAbsent` tinyint(4) NOT NULL,
  `absentHasPermission` tinyint(4) NOT NULL,
  `absentDiscount` float NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '-1 is just attenendace no affect with late or absent money, 1 hr close it and already affect done',
  PRIMARY KEY (`id`),
  UNIQUE KEY `employeeid` (`employeeid`,`day`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeeclosedaystatus`
--

CREATE TABLE IF NOT EXISTS `employeeclosedaystatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL,
  `status` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `conditions` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `day` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeeclosedaysubgroupstatus`
--

CREATE TABLE IF NOT EXISTS `employeeclosedaysubgroupstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL,
  `employeesubgroupid` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `conditions` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `day` (`day`,`employeesubgroupid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeegroup`
--

CREATE TABLE IF NOT EXISTS `employeegroup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `employeeattendancesystemid` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `del` tinyint(4) NOT NULL,
  `sysdate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeepersonnel`
--

CREATE TABLE IF NOT EXISTS `employeepersonnel` (
  `employeepersonnelid` int(11) NOT NULL AUTO_INCREMENT,
  `employeeid` int(11) NOT NULL,
  `employeepersonnelvalue` decimal(10,2) NOT NULL,
  `employeepersonnelnote` varchar(600) DEFAULT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `userid` int(11) NOT NULL,
  `employeepersonneldate` datetime NOT NULL,
  `employeepersonneltype` int(11) NOT NULL COMMENT '1 for Reward 2 for Discount  3 for  Withdrawal 4 for Borrow 5 for Absence 6 for  Repayment 7 Repayment from salary   ',
  `done` int(11) NOT NULL DEFAULT '0' COMMENT '1 for Catch 0 for notCatch',
  `empdeptbefor` int(11) NOT NULL DEFAULT '0',
  `empdeptafter` int(11) NOT NULL DEFAULT '0',
  `salarymonth` varchar(255) NOT NULL,
  `paymenttype` int(11) NOT NULL,
  `payid` int(11) NOT NULL,
  `payid2` int(11) NOT NULL,
  `checknum` varchar(255) NOT NULL,
  `isMandobReward` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`employeepersonnelid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `employeesubgroup`
--

CREATE TABLE IF NOT EXISTS `employeesubgroup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `employeegroupid` int(11) NOT NULL,
  `employeeattendancesystemid` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `del` tinyint(4) NOT NULL,
  `sysdate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `entryproductspurchased`
--

CREATE TABLE IF NOT EXISTS `entryproductspurchased` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `productquantity` decimal(10,2) NOT NULL,
  `soldquantity` decimal(10,2) NOT NULL,
  `tablename` varchar(255) NOT NULL,
  `modelid` int(11) NOT NULL,
  `expirationDate` date DEFAULT NULL,
  `priority` int(11) NOT NULL DEFAULT '0',
  `del` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `expenseexchange`
--

CREATE TABLE IF NOT EXISTS `expenseexchange` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serialno` varchar(255) NOT NULL,
  `projectid` int(11) NOT NULL,
  `expensefrom` int(11) NOT NULL COMMENT '0 from save-1from bank-2from ohda',
  `expenseid` int(11) NOT NULL,
  `expenseid2` int(11) NOT NULL,
  `thevalue` int(11) NOT NULL,
  `costcenterid` int(11) NOT NULL,
  `expensedate` date NOT NULL,
  `expensetype` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `del` int(11) NOT NULL,
  `sysdate` date NOT NULL,
  `entryid` int(11) NOT NULL,
  `expenseexcomment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `expenses`
--

CREATE TABLE IF NOT EXISTS `expenses` (
  `expensesid` int(11) NOT NULL AUTO_INCREMENT,
  `expensestypeid` int(11) NOT NULL,
  `expensesname` varchar(100) NOT NULL,
  `expensesdetails` text,
  `expensesValue` decimal(10,2) NOT NULL DEFAULT '0',
  `expensesdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for not deleted- 1 for deleted',
  `costcenterid` int(11) DEFAULT '0',
  `saveid` int(11) NOT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `bankid` int(11) NOT NULL,
  `bankaccountid` int(11) NOT NULL,
  `checknum` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `productid` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`expensesid`),
  KEY `idx_expenses` (`expensestypeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `expensestype`
--

CREATE TABLE IF NOT EXISTS `expensestype` (
  `expensestypeid` int(11) NOT NULL AUTO_INCREMENT,
  `expensestypename` varchar(256) NOT NULL,
  `expensestypedetails` text,
  `expensestypedate` date NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for not deleted- 1 for deleted',
  `userid` int(11) NOT NULL,
  `parent` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT '0' COMMENT '0 for ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€Â',
  `saveid` int(11) NOT NULL,
  `addOnlyGroupIds` varchar(255) NOT NULL,
  PRIMARY KEY (`expensestypeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `goverarea`
--

CREATE TABLE IF NOT EXISTS `goverarea` (
  `goverareaid` int(11) NOT NULL AUTO_INCREMENT,
  `governmentid` int(11) DEFAULT NULL,
  `clientareaid` int(11) DEFAULT NULL,
  PRIMARY KEY (`goverareaid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


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

--
-- Table structure for table `government`
--

CREATE TABLE IF NOT EXISTS `government` (
  `governmetid` int(11) NOT NULL AUTO_INCREMENT,
  `governmentname` text,
  PRIMARY KEY (`governmetid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


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

--
-- Table structure for table `impotencetreatmentsuppliersave`
--

CREATE TABLE IF NOT EXISTS `impotencetreatmentsuppliersave` (
  `impotencetreatmentsuppliersaveid` int(11) NOT NULL AUTO_INCREMENT,
  `typesimpotencetreatmentid` int(11) NOT NULL,
  `saveid` int(11) NOT NULL,
  `supplierid` int(11) NOT NULL,
  `impotencetreatmentsuppliersavetype` int(11) NOT NULL,
  `impotencetreatmentsuppliersavebefore` decimal(10,2) NOT NULL,
  `impotencetreatmentsuppliersavetamount` decimal(10,2) NOT NULL,
  `impotencetreatmentsuppliersaveafter` decimal(10,2) NOT NULL,
  `impotencetreatmentsuppliersavecomment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `conditions` int(11) NOT NULL COMMENT '0 for not deleted- 1 for deleted',
  `impotencetreatmentsuppliersavedate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  PRIMARY KEY (`impotencetreatmentsuppliersaveid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `income`
--

CREATE TABLE IF NOT EXISTS `income` (
  `incomeId` int(11) NOT NULL AUTO_INCREMENT,
  `incomeTypeId` int(11) NOT NULL,
  `incomeName` varchar(255) NOT NULL,
  `incomeDetails` text NOT NULL,
  `incomeValue` decimal(10,2) NOT NULL,
  `incomeDate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL COMMENT '0 for not deleted- 1 for deleted',
  `costcenterid` int(11) DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `saveid` int(11) DEFAULT '0',
  PRIMARY KEY (`incomeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `incometype`
--

CREATE TABLE IF NOT EXISTS `incometype` (
  `incomeTypeId` int(11) NOT NULL AUTO_INCREMENT,
  `incomeTypeName` varchar(255) NOT NULL,
  `defaultValue` decimal(10,2) NOT NULL,
  `incomeTypeDetails` text NOT NULL,
  `parent` int(11) NOT NULL,
  `incomeTypeDate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL COMMENT '0 for not deleted- 1 for deleted',
  PRIMARY KEY (`incomeTypeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `insurancecompanies`
--

CREATE TABLE IF NOT EXISTS `insurancecompanies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `discountpercent` decimal(10,2) DEFAULT '0',
  `contractstart` date DEFAULT NULL,
  `contractend` date DEFAULT NULL,
  `contractphoto` varchar(255) DEFAULT NULL,
  `instruction` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `deleted` int(11) NOT NULL DEFAULT '0',
  `userid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='أسماء شركات التأمين ' AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `kashf`
--

CREATE TABLE IF NOT EXISTS `kashf` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `kashfvalue` int(6) NOT NULL,
  `kashftype` varchar(50) CHARACTER SET utf8mb4 NOT NULL,
  `customerid` int(6) NOT NULL,
  `doctorid` int(6) NOT NULL,
  `kashfdate` date DEFAULT NULL,
  `entered` int(11) unsigned NOT NULL DEFAULT '0',
  `paystatus` int(11) NOT NULL DEFAULT '0' COMMENT '0 paid now - will be paid with bill - ## added to bill previous already ',
  `rondomtxt` varchar(255) DEFAULT NULL,
  `branchid` int(11) DEFAULT NULL,
  `offline` int(11) DEFAULT '0' COMMENT ' 1 offline - 0 online ',
  `uploaddate` datetime DEFAULT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `kasfhserial` int(11) NOT NULL,
  `discountkashf` int(11) DEFAULT NULL COMMENT '0 => no - 1 =>yes',
  `used` int(11) DEFAULT NULL COMMENT '0=> no - 1 => yes',
  `bill_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `kempiala`
--

CREATE TABLE IF NOT EXISTS `kempiala` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientID` int(11) NOT NULL,
  `recievingdate` date NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `value` decimal(10,2) NOT NULL,
  `clientcomment` text NOT NULL,
  `selling` int(11) NOT NULL DEFAULT '0' COMMENT '0 => not sold- 1 => sold',
  `expiredate` date NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `supplierID` int(11) DEFAULT NULL,
  `sellingdate` datetime DEFAULT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for not canceled- 1 for canceled',
  `suppliercomment` text,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `clientID` (`clientID`),
  KEY `supplierID` (`supplierID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `lastbillidspricesupdated`
--

CREATE TABLE IF NOT EXISTS `lastbillidspricesupdated` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `buybill` int(11) NOT NULL DEFAULT '0',
  `buyandret` int(11) NOT NULL DEFAULT '0',
  `retbuy` int(11) NOT NULL DEFAULT '0',
  `sell` int(11) NOT NULL DEFAULT '0',
  `sellandret` int(11) NOT NULL DEFAULT '0',
  `retsell` int(11) NOT NULL DEFAULT '0',
  `buyquantity` int(11) NOT NULL DEFAULT '0',
  `buyandretquantity` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `lastbillidsquickprofit`
--

CREATE TABLE IF NOT EXISTS `lastbillidsquickprofit` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sell` int(11) NOT NULL,
  `sellDetail` int(11) NOT NULL,
  `sellandret` int(11) NOT NULL,
  `sellandretDetail` int(11) NOT NULL,
  `retsell` int(11) NOT NULL,
  `retsellDetail` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `manufacuresetting`
--

CREATE TABLE IF NOT EXISTS `manufacuresetting` (
  `manufacuresettingid` int(11) NOT NULL AUTO_INCREMENT,
  `ordername` varchar(255) NOT NULL,
  `excahangeorder` int(11) NOT NULL DEFAULT '1' COMMENT '1->no-0->yes',
  PRIMARY KEY (`manufacuresettingid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `menuurl`
--

CREATE TABLE IF NOT EXISTS `menuurl` (
  `menuurlid` int(11) NOT NULL AUTO_INCREMENT,
  `orderno` int(11) DEFAULT '0',
  `urltitle` varchar(255) NOT NULL,
  `menuurl` varchar(255) NOT NULL,
  `urlimage` varchar(255) NOT NULL,
  `usergroupid` text NOT NULL,
  PRIMARY KEY (`menuurlid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `movementmanage`
--

CREATE TABLE IF NOT EXISTS `movementmanage` (
  `movementmanageid` int(11) NOT NULL AUTO_INCREMENT,
  `operationname` varchar(256) NOT NULL,
  `movementmanagedate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `currentDo` varchar(255) NOT NULL,
  `ip` varchar(35) NOT NULL,
  `mac` varchar(35) NOT NULL,
  `deviceType` varchar(10) NOT NULL,
  PRIMARY KEY (`movementmanageid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `movementmanagedeleted`
--

CREATE TABLE IF NOT EXISTS `movementmanagedeleted` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `operationname` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `movementmanagedate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `currentDo` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip` varchar(35) NOT NULL,
  `mac` varchar(35) NOT NULL,
  `deviceType` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_check`
--

CREATE TABLE IF NOT EXISTS `m_check` (
  `checkId` int(11) NOT NULL AUTO_INCREMENT,
  `ourSerial` varchar(255) NOT NULL,
  `userId` int(11) NOT NULL,
  `stageFrom` int(11) NOT NULL,
  `checkDate` date NOT NULL,
  `branchId` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`checkId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_comreceipt`
--

CREATE TABLE IF NOT EXISTS `m_comreceipt` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `receiptserial` varchar(255) NOT NULL,
  `receiptdat` date NOT NULL,
  `branchid` int(11) NOT NULL,
  `clientid` int(11) NOT NULL,
  `totalCost` decimal(10,2) DEFAULT '0' COMMENT 'for MaintennanceSettlement ',
  `Initialcost` decimal(10,2) NOT NULL,
  `shipcost` decimal(10,2) NOT NULL,
  `documentid` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `del` int(11) NOT NULL DEFAULT '0' COMMENT '0 not del 1 del',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '1 for done',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_comreceiptdetail`
--

CREATE TABLE IF NOT EXISTS `m_comreceiptdetail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `receiptid` int(11) NOT NULL,
  `productserial` varchar(255) NOT NULL,
  `productId` int(11) NOT NULL,
  `ourserial` varchar(255) NOT NULL,
  `granttype` int(11) NOT NULL COMMENT '0 for maintennance- 1  for client insurance -2 for copmany insurance',
  `sellbillid` int(11) NOT NULL,
  `sellbilldate` date NOT NULL,
  `buybillid` int(11) NOT NULL,
  `buybilldate` date NOT NULL,
  `insduration` int(11) NOT NULL,
  `insstatus` int(11) NOT NULL,
  `problem` text NOT NULL,
  `attach` text NOT NULL,
  `comment` text NOT NULL,
  `shipcost` decimal(10,2) NOT NULL,
  `initialcost` decimal(10,2) NOT NULL,
  `supplierid` int(11) NOT NULL,
  `currentstage` int(11) NOT NULL,
  `branchid` int(11) NOT NULL,
  `del` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_comreceiptimage`
--

CREATE TABLE IF NOT EXISTS `m_comreceiptimage` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `comreceiptid` int(11) NOT NULL,
  `receiptimage` varchar(255) NOT NULL,
  `imagedate` date NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_externalmaintenance`
--

CREATE TABLE IF NOT EXISTS `m_externalmaintenance` (
  `externalmaintenanceId` int(11) NOT NULL AUTO_INCREMENT,
  `ourSerial` varchar(255) NOT NULL,
  `supplierId` int(11) NOT NULL,
  `externalmaintenanceDate` date NOT NULL,
  `comment` text NOT NULL,
  `externalmaintenanceReturn` int(11) NOT NULL COMMENT '0 for nonReturn - 1 for Returned',
  `returnComment` text NOT NULL,
  `supplierCost` decimal(10,2) NOT NULL,
  `returnedDate` date NOT NULL,
  `branchId` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`externalmaintenanceId`),
  KEY `externalmaintenanceReturn` (`externalmaintenanceReturn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_finishingpayed`
--

CREATE TABLE IF NOT EXISTS `m_finishingpayed` (
  `finishingPayedId` int(11) NOT NULL AUTO_INCREMENT,
  `clientId` int(11) NOT NULL,
  `payed` decimal(10,2) NOT NULL,
  `clientDebtChangeId` int(11) NOT NULL,
  `finishingType` int(11) NOT NULL COMMENT '0 for not uesd "new"- 1 for finished - 2  for remain',
  `finishingPayedDate` date NOT NULL,
  `remain` decimal(10,2) NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del - 1 for del',
  PRIMARY KEY (`finishingPayedId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_handedreport`
--

CREATE TABLE IF NOT EXISTS `m_handedreport` (
  `handedReportId` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `stageId` int(11) NOT NULL,
  `ourSerial` varchar(255) NOT NULL,
  `actualCost` decimal(10,2) NOT NULL,
  `initiateCost` decimal(10,2) NOT NULL,
  `clientCost` decimal(10,2) NOT NULL,
  `comment` text NOT NULL,
  `userId` int(11) NOT NULL,
  `handedReportDate` date NOT NULL,
  `archive` int(11) NOT NULL COMMENT '0 for delivered-1not delevered',
  `branchId` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`handedReportId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_initialmaintenance`
--

CREATE TABLE IF NOT EXISTS `m_initialmaintenance` (
  `initialMaintenanceId` int(11) NOT NULL AUTO_INCREMENT,
  `ourSerial` varchar(255) NOT NULL,
  `initialMaintenanceDate` date NOT NULL,
  `comment` text NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `totalClientCost` decimal(10,2) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`initialMaintenanceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_initialmaintenancedetail`
--

CREATE TABLE IF NOT EXISTS `m_initialmaintenancedetail` (
  `initialMaintenanceDetailId` int(11) NOT NULL AUTO_INCREMENT,
  `initialMaintenanceId` int(11) NOT NULL,
  `propertyId` int(11) NOT NULL,
  `propertyValue` decimal(10,2) NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `initialMaintenanceDetailDate` date NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`initialMaintenanceDetailId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_insurance`
--

CREATE TABLE IF NOT EXISTS `m_insurance` (
  `insuranceId` int(11) NOT NULL AUTO_INCREMENT,
  `ourSerial` varchar(255) NOT NULL,
  `stageIdBefore` int(11) NOT NULL,
  `currentStage` int(11) NOT NULL,
  `shipNameGo` int(11) NOT NULL,
  `shipCompanyGo` int(11) NOT NULL,
  `shipPersonalGo` int(11) NOT NULL,
  `shipCostGo` decimal(10,2) NOT NULL,
  `shipNameReturned` int(11) NOT NULL,
  `shipCompanyReturned` int(11) NOT NULL,
  `shipPersonalReturned` int(11) NOT NULL,
  `shipCostReturned` decimal(10,2) NOT NULL,
  `type` int(11) NOT NULL COMMENT '0 for replace - 1 for discount - 2 for  maintenance-3 for reject- 4 in preparing Stage "Donnot have type yet"',
  `oldSN` varchar(255) NOT NULL,
  `newSN` varchar(255) NOT NULL,
  `insuranceCost` decimal(10,2) NOT NULL,
  `kindOfInsurance` int(11) NOT NULL COMMENT '0 for new - 1 for continue',
  `insuranceDate` date NOT NULL,
  `insuranceDiscount` decimal(10,2) NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `comment` text NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del - 1 for del',
  `returned` int(11) NOT NULL COMMENT '0 fornot returned - 1 for returned',
  PRIMARY KEY (`insuranceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_maintenancereceipt`
--

CREATE TABLE IF NOT EXISTS `m_maintenancereceipt` (
  `maintenanceReceiptId` int(11) NOT NULL AUTO_INCREMENT,
  `receiptId` int(11) NOT NULL,
  `totalCost` decimal(10,2) NOT NULL,
  `type` int(11) NOT NULL COMMENT '0 for finished-1 for remain',
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `maintenanceReceiptDAte` date NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del - 1 for del',
  PRIMARY KEY (`maintenanceReceiptId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_maintenancereceiptfinish`
--

CREATE TABLE IF NOT EXISTS `m_maintenancereceiptfinish` (
  `maintenanceReceiptFinishId` int(11) NOT NULL AUTO_INCREMENT,
  `maintenanceReceiptId` int(11) NOT NULL,
  `finishingPayedId` int(11) NOT NULL,
  `payed` decimal(10,2) NOT NULL,
  `remain` decimal(10,2) NOT NULL,
  `maintenanceReceiptFinishDate` date NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del - 1 for del',
  PRIMARY KEY (`maintenanceReceiptFinishId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_producthistory`
--

CREATE TABLE IF NOT EXISTS `m_producthistory` (
  `productHistoryId` int(11) NOT NULL AUTO_INCREMENT,
  `ourSerial` varchar(255) NOT NULL,
  `stageFrom` int(11) NOT NULL,
  `stageTo` int(11) NOT NULL,
  `cost` decimal(10,2) NOT NULL,
  `comment` text NOT NULL,
  `status` int(11) NOT NULL COMMENT '0 for accepted- 1 for rejected',
  `userId` int(11) NOT NULL,
  `productHistoryDate` datetime NOT NULL,
  `branchId` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`productHistoryId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_stage`
--

CREATE TABLE IF NOT EXISTS `m_stage` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `descreption` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `m_stageproperity`
--

CREATE TABLE IF NOT EXISTS `m_stageproperity` (
  `stageProperityId` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `initialValue` decimal(10,2) NOT NULL,
  `stageId` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `stageProperityDate` date NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del -1 for del',
  PRIMARY KEY (`stageProperityId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `newdbbackup`
--

CREATE TABLE IF NOT EXISTS `newdbbackup` (
  `backupid` int(11) NOT NULL AUTO_INCREMENT,
  `backupname` varchar(255) NOT NULL,
  `backupdate` datetime NOT NULL,
  PRIMARY KEY (`backupid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `newdbname`
--

CREATE TABLE IF NOT EXISTS `newdbname` (
  `newdbnameid` int(11) NOT NULL AUTO_INCREMENT,
  `dbname` varchar(255) NOT NULL,
  PRIMARY KEY (`newdbnameid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `notics`
--

CREATE TABLE IF NOT EXISTS `notics` (
  `noticesid` int(11) NOT NULL AUTO_INCREMENT,
  `productno` int(11) NOT NULL DEFAULT '0',
  `productnotsellno` int(11) NOT NULL DEFAULT '0',
  `kempilano` int(11) NOT NULL DEFAULT '0',
  `clientcheckno` int(11) NOT NULL DEFAULT '0',
  `suppliercheckno` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`noticesid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `offerpricebill`
--

CREATE TABLE IF NOT EXISTS `offerpricebill` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `offerpricebillid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `productname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sellprice` decimal(10,2) NOT NULL,
  `prodescrption` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `pronumber` int(11) NOT NULL,
  `totalprice` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `offerpricebillprop`
--

CREATE TABLE IF NOT EXISTS `offerpricebillprop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `clientname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `totalprice` double NOT NULL,
  `realtotalprice` double NOT NULL,
  `sysdate` date NOT NULL,
  `serialno` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `offerpricecondition`
--

CREATE TABLE IF NOT EXISTS `offerpricecondition` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `introduction` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `onlinestoresetting`
--

CREATE TABLE IF NOT EXISTS `onlinestoresetting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `url` varchar(255) NOT NULL,
  `availableStores` varchar(255) NOT NULL,
  `onlinestoreid` int(11) NOT NULL DEFAULT '2',
  `onlineclientareaid` int(11) NOT NULL DEFAULT '0',
  `updatetype` tinyint(4) NOT NULL DEFAULT '0',
  `catprohour` decimal(10,2) NOT NULL DEFAULT '0',
  `catprominute` decimal(10,2) NOT NULL DEFAULT '0',
  `proquantityhour` decimal(10,2) NOT NULL DEFAULT '0',
  `proquantityminute` decimal(10,2) NOT NULL DEFAULT '0',
  `clientshour` decimal(10,2) NOT NULL DEFAULT '0',
  `clientsminute` decimal(10,2) NOT NULL DEFAULT '0',
  `ordershour` decimal(10,2) NOT NULL,
  `ordersminute` decimal(10,2) NOT NULL,
  `clientdebtchangeStartId` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `onlinetempcategory`
--

CREATE TABLE IF NOT EXISTS `onlinetempcategory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `catid` int(11) NOT NULL,
  `edited` tinyint(4) NOT NULL COMMENT '0 not edited "this value is therre online", 1 edited , 2 del',
  `sysdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `catid` (`catid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `onlinetemporder`
--

CREATE TABLE IF NOT EXISTS `onlinetemporder` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `onlineorderid` int(11) NOT NULL,
  `customerid` int(11) NOT NULL,
  `ordertotal` double NOT NULL,
  `shippingcost` varchar(191) NOT NULL,
  `fulltotal` varchar(191) NOT NULL,
  `paytype` varchar(191) NOT NULL,
  `createdatetime` datetime NOT NULL,
  `orderstatus` tinyint(4) NOT NULL,
  `tax_value` varchar(191) NOT NULL,
  `userid` int(11) NOT NULL COMMENT 'userid online',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `onlinetemporderclient`
--

CREATE TABLE IF NOT EXISTS `onlinetemporderclient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `erpid` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `orderid` int(11) NOT NULL,
  `clientname` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `clientcode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `clientmobile` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `clientdebt` decimal(10,2) NOT NULL,
  `clientaddress` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `clientareaid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `onlinetemporderproduct`
--

CREATE TABLE IF NOT EXISTS `onlinetemporderproduct` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orderid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `sizeid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` double NOT NULL,
  `quantity` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shippingcost` double NOT NULL,
  `total` double NOT NULL,
  `orderstatus` int(11) NOT NULL,
  `shippingtype` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `discountprice` double NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `onlinetempproduct`
--

CREATE TABLE IF NOT EXISTS `onlinetempproduct` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `edited` tinyint(4) NOT NULL COMMENT '0 not edited "this value is therre online", 1 edited , 2 del',
  `sysdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `productid` (`productid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `onlinetempstoredetail`
--

CREATE TABLE IF NOT EXISTS `onlinetempstoredetail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `storeid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `sizeid` int(11) NOT NULL,
  `colorid` int(11) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `edited` tinyint(4) NOT NULL COMMENT '0 not edited "this value is therre online", 1 edited , 2 del',
  `sysdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniquecombination` (`storeid`,`productid`,`sizeid`,`colorid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `onlinetempstorereport`
--

CREATE TABLE IF NOT EXISTS `onlinetempstorereport` (
  `storereportid` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  `productquantity` decimal(10,2) NOT NULL,
  `storereporttype` int(11) NOT NULL COMMENT '0 => plus- 1 => minus',
  `storereportmodelid` int(11) NOT NULL,
  `processname` varchar(256) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  `productbefore` decimal(10,2) NOT NULL,
  `productafter` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `storereportdate` date NOT NULL,
  PRIMARY KEY (`storereportid`),
  KEY `productid` (`productid`,`storeid`),
  KEY `storeid` (`storeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `otherrequest`
--

CREATE TABLE IF NOT EXISTS `otherrequest` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `requestTo` int(11) NOT NULL COMMENT '0 branch - 1 user group - 2 user',
  `requestToId` int(11) NOT NULL,
  `requestTitle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `requestDate` date NOT NULL,
  `userId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL COMMENT 'branch who made the request',
  `seen` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `otherstoremovement`
--

CREATE TABLE IF NOT EXISTS `otherstoremovement` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `oprationnumber` varchar(255) NOT NULL,
  `deloperation` int(11) NOT NULL,
  `del` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `comment` text NOT NULL,
  `oprationdata` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `partner`
--

CREATE TABLE IF NOT EXISTS `partner` (
  `partnerid` int(11) NOT NULL AUTO_INCREMENT,
  `partnername` varchar(256) NOT NULL,
  `partnerdate` date NOT NULL,
  `partnerpercentage` decimal(10,2) NOT NULL,
  `partnermoney` decimal(10,2) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `dailyentryid` int(11) NOT NULL,
  PRIMARY KEY (`partnerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `partnertransferbetween`
--

CREATE TABLE IF NOT EXISTS `partnertransferbetween` (
  `partnertransferbetweenid` int(11) NOT NULL AUTO_INCREMENT,
  `partneridfrom` int(11) NOT NULL,
  `partneridto` int(11) NOT NULL,
  `partnervalue` decimal(10,2) NOT NULL,
  `comment` text NOT NULL,
  `partnerdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `partnerfrombefore` decimal(10,2) NOT NULL DEFAULT '0',
  `partnerfromafter` decimal(10,2) NOT NULL DEFAULT '0',
  `partnertobefore` decimal(10,2) NOT NULL DEFAULT '0',
  `partnertoafter` decimal(10,2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`partnertransferbetweenid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ;

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

--
-- Table structure for table `partnerwithdrawal`
--

CREATE TABLE IF NOT EXISTS `partnerwithdrawal` (
  `partnerwithdrawalid` int(11) NOT NULL AUTO_INCREMENT,
  `partnerid` int(11) NOT NULL,
  `partnerwithdrawalvalue` decimal(10,2) NOT NULL,
  `comment` text NOT NULL,
  `partnerwithdrawaldate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `saveid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `partenrwithdrawaltype` int(11) NOT NULL COMMENT '0  ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã',
  `dailyentryid` int(11) NOT NULL,
  `bankid` int(11) NOT NULL,
  `bankaccountid` int(11) NOT NULL,
  `checknum` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `partnerbefore` decimal(10,2) NOT NULL DEFAULT '0',
  `partnerafter` decimal(10,2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`partnerwithdrawalid`),
  KEY `partnerid` (`partnerid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `paymentnetworks`
--

CREATE TABLE IF NOT EXISTS `paymentnetworks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `discountpercent` decimal(10,2) DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  `nameen` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='أسماء شبكات  الدفع  ' AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `playstationcard`
--

CREATE TABLE IF NOT EXISTS `playstationcard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `packageVal` float NOT NULL,
  `packagePrice` float NOT NULL,
  `packageDays` int(11) NOT NULL,
  `file` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `del` tinyint(4) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `playstationclientcard`
--

CREATE TABLE IF NOT EXISTS `playstationclientcard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cardid` int(11) NOT NULL,
  `clientid` int(11) NOT NULL,
  `buyDate` datetime NOT NULL,
  `packVal` float NOT NULL,
  `packPrice` float NOT NULL,
  `packDays` int(11) NOT NULL,
  `packValConsumed` float NOT NULL,
  `cardEndDate` datetime NOT NULL,
  `cardStatus` tinyint(4) NOT NULL COMMENT '0 active,1 totaly consumed , 2 expired',
  `userid` int(11) NOT NULL,
  `del` tinyint(4) NOT NULL,
  `sysDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `playstationclientcardpayhistory`
--

CREATE TABLE IF NOT EXISTS `playstationclientcardpayhistory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `cardid` int(11) NOT NULL,
  `cardValBefore` float NOT NULL,
  `payAmount` float NOT NULL,
  `changeType` tinyint(4) NOT NULL COMMENT '0 increase , 1decrease',
  `cardValAfter` float NOT NULL,
  `processname` varchar(255) CHARACTER SET latin1 NOT NULL,
  `modelid` int(11) NOT NULL,
  `tablename` varchar(255) CHARACTER SET latin1 NOT NULL,
  `comment` text CHARACTER SET latin1 NOT NULL,
  `conditions` tinyint(4) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `policy`
--

CREATE TABLE IF NOT EXISTS `policy` (
  `policyId` int(11) NOT NULL AUTO_INCREMENT,
  `policyName` varchar(255) NOT NULL,
  `policyDate` date NOT NULL,
  `policyNum` int(11) NOT NULL,
  `policyCost` decimal(10,2) NOT NULL,
  `policyType` int(11) NOT NULL COMMENT '1 => go- 2 =>return',
  `companyId` int(11) NOT NULL,
  `invoicenumber` varchar(255) NOT NULL,
  `tempdele` int(11) NOT NULL,
  `saveId` int(11) NOT NULL,
  `senderType` int(11) NOT NULL COMMENT '1 => client- 2 =>supplier',
  PRIMARY KEY (`policyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `product`
--

CREATE TABLE IF NOT EXISTS `product` (
  `productId` int(11) NOT NULL AUTO_INCREMENT,
  `inMenu` tinyint(4) DEFAULT '0' COMMENT '0 show in resturant menu-1 hide it',
  `productName` varchar(256) NOT NULL DEFAULT '',
  `productDescription` text,
  `productCatId` int(11) NOT NULL,
  `productBuyPrice` decimal(10,2) NOT NULL,
  `productSellAllPrice` decimal(10,2) NOT NULL,
  `productSellUnitPrice` decimal(10,2) NOT NULL,
  `productSellHalfPrice` decimal(10,2) NOT NULL,
  `productDate` date NOT NULL,
  `conditions` int(1) NOT NULL DEFAULT '0',
  `userId` int(11) NOT NULL,
  `limitamount` int(11) NOT NULL DEFAULT '0',
  `parcode` varchar(256) DEFAULT NULL,
  `type` int(11) NOT NULL DEFAULT '0' COMMENT '1 for Manufacturing - 0 for not Manufacturing',
  `sellingtype` int(11) DEFAULT '0' COMMENT '1 for FCFO  2 for  LCFO  3 for expirdata ',
  `expireDate` int(11) DEFAULT NULL,
  `dailyentryId` int(11) NOT NULL,
  `isService` int(11) NOT NULL DEFAULT '0' COMMENT '0 no - 1 yes',
  `isOptic` int(11) NOT NULL DEFAULT '0' COMMENT '0 not optic -1 without size and color-2 with size and color',
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `productbuypricereal` decimal(10,2) DEFAULT '0',
  `buypricereal_precentage` decimal(10,2) DEFAULT '0',
  `buytotal_precentage` decimal(10,2) DEFAULT '0',
  `buyhalf_precentage` decimal(10,2) DEFAULT '0',
  `buypart_precentage` decimal(10,2) DEFAULT '0',
  `logo` varchar(255) DEFAULT NULL,
  `obygyDetectionId` int(11) DEFAULT NULL,
  `hasSizeAndColor` tinyint(4) NOT NULL DEFAULT '0',
  `logo1` varchar(255) DEFAULT NULL,
  `logo2` varchar(255) DEFAULT NULL,
  `logo3` varchar(255) DEFAULT NULL,
  `logo4` varchar(255) DEFAULT NULL,
  `logo5` varchar(255) DEFAULT NULL,
  `logo6` varchar(255) DEFAULT NULL,
  `logo7` varchar(255) DEFAULT NULL,
  `overAllAveragePrice` decimal(10,2) NOT NULL DEFAULT '0',
  `online` text,
  `reviewType` int(11) NOT NULL DEFAULT '0',
  `updatebyuser` int(11) NOT NULL DEFAULT '0',
  `proExcelid` int(11) NOT NULL DEFAULT '0' COMMENT 'used to link products to products from another erp like siam see in buybill',
  `proExcelParcode` varchar(12) NOT NULL COMMENT 'used to link products to products from another erp like siam see in buybill',
  `webApiId` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`productId`),
  KEY `productCatId` (`productCatId`),
  KEY `userId` (`userId`),
  KEY `productId` (`productId`),
  KEY `productCatId_2` (`productCatId`),
  KEY `userId_2` (`userId`),
  KEY `parcode` (`parcode`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productcat`
--

CREATE TABLE IF NOT EXISTS `productcat` (
  `productCatId` int(11) NOT NULL AUTO_INCREMENT,
  `productCatName` varchar(256) NOT NULL,
  `productCatDate` date NOT NULL,
  `productCatDescription` text,
  `productCatParent` int(11) NOT NULL DEFAULT '0',
  `userId` int(11) NOT NULL,
  `conditions` int(1) NOT NULL DEFAULT '0',
  `selldiscount` decimal(10,2) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `buydiscount` decimal(10,2) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `discounttype` int(11) NOT NULL DEFAULT '0' COMMENT '0 =>direct- 1=>percent',
  `isOptic` int(11) NOT NULL DEFAULT '0' COMMENT '0 not optic -1 without size and color-2 with size and color',
  `buytotal` int(11) DEFAULT '0',
  `buyhalf` int(11) DEFAULT '0',
  `buypart` int(11) DEFAULT '0',
  `buypricereal` int(11) DEFAULT '0',
  `opticServices` varchar(200) NOT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `inMenu` tinyint(4) DEFAULT '0' COMMENT '0 show in resturant menu-1 hide it',
  `stopNegativeSale` tinyint(4) NOT NULL DEFAULT '0',
  `catExcelid` int(11) NOT NULL COMMENT 'used to link products to products from another erp like siam see in buybill',
  `webApiId` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`productCatId`),
  KEY `productCatParent` (`productCatParent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productcatunit`
--

CREATE TABLE IF NOT EXISTS `productcatunit` (
  `productcatunitid` int(11) NOT NULL AUTO_INCREMENT,
  `unitid` int(11) NOT NULL,
  `productcatid` int(11) NOT NULL,
  `productnumber` decimal(10,2) NOT NULL,
  `productcatunitdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`productcatunitid`),
  KEY `productcatid` (`productcatid`),
  KEY `unitid` (`unitid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productingredients`
--

CREATE TABLE IF NOT EXISTS `productingredients` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productId` int(11) NOT NULL COMMENT 'from product tabe it is the product that has ingredients',
  `ingridientId` int(11) NOT NULL COMMENT 'from product table it is the ingridient',
  `unitId` int(11) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `userId` int(11) NOT NULL,
  `thedate` date NOT NULL,
  `conditions` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionexecution`
--

CREATE TABLE IF NOT EXISTS `productionexecution` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orderId` int(11) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL,
  `orderdate` date NOT NULL,
  `taskid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `num` int(11) NOT NULL,
  `outstoreid` int(11) NOT NULL,
  `wastestoreid` int(11) NOT NULL,
  `rentcost` double NOT NULL,
  `othercost` double NOT NULL,
  `executioncost` double NOT NULL,
  `sysdate` datetime NOT NULL,
  `executed` int(11) NOT NULL DEFAULT '0' COMMENT '0: not execued -- 1:executed',
  `comment` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `orderId` (`orderId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionexecutionoutput`
--

CREATE TABLE IF NOT EXISTS `productionexecutionoutput` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exeutionid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `allprice` double NOT NULL,
  `halfprice` double NOT NULL,
  `unitprice` double NOT NULL,
  `num` int(11) NOT NULL,
  `cost` double NOT NULL,
  `storeid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionexecutionproduct`
--

CREATE TABLE IF NOT EXISTS `productionexecutionproduct` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `executionid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `unitid` int(11) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `actualquantity` decimal(10,2) NOT NULL,
  `cost` double NOT NULL,
  `actualcost` double NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionexecutionwaste`
--

CREATE TABLE IF NOT EXISTS `productionexecutionwaste` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `executionid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `allprice` double NOT NULL,
  `halfprice` double NOT NULL,
  `unitprice` double NOT NULL,
  `num` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionorder`
--

CREATE TABLE IF NOT EXISTS `productionorder` (
  `productionOrderid` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `orderDate` date NOT NULL,
  `branchId` int(11) DEFAULT NULL,
  `startDate` date NOT NULL,
  `endDate` date NOT NULL,
  `productId` int(11) NOT NULL,
  `stageId` int(11) NOT NULL,
  `storeId` int(11) NOT NULL,
  `outQuantity` int(11) NOT NULL,
  `measureUnitId` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for notdel -1 for del',
  `userId` int(11) NOT NULL,
  `orderStatus` int(11) NOT NULL DEFAULT '0' COMMENT '0 for Under implementation - 1 for finished',
  PRIMARY KEY (`productionOrderid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionrate`
--

CREATE TABLE IF NOT EXISTS `productionrate` (
  `productionRateId` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT 'equation name',
  `finalName` varchar(255) NOT NULL COMMENT 'equation final product name',
  `userId` int(11) NOT NULL,
  `thedate` date NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for notdel- 1for del',
  PRIMARY KEY (`productionRateId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productionrateproduct`
--

CREATE TABLE IF NOT EXISTS `productionrateproduct` (
  `productionRateProductId` int(11) NOT NULL AUTO_INCREMENT,
  `productionRateId` int(11) NOT NULL,
  `productId` int(11) NOT NULL,
  `unitId` int(11) NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `userId` int(11) NOT NULL,
  `thedate` date NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for notdel- 1for del',
  PRIMARY KEY (`productionRateProductId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productrecieve`
--

CREATE TABLE IF NOT EXISTS `productrecieve` (
  `productrecieveid` int(11) NOT NULL AUTO_INCREMENT,
  `sparepartid` int(11) NOT NULL,
  `productrecievedate` date NOT NULL,
  `recieptnum` varchar(255) NOT NULL,
  `clientname` varchar(255) NOT NULL,
  `type` int(11) NOT NULL COMMENT '1=>ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã',
  `cost` decimal(10,2) NOT NULL,
  `partsnumber` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`productrecieveid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productrequests`
--

CREATE TABLE IF NOT EXISTS `productrequests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  `requeststoreid` int(11) NOT NULL COMMENT 'id of store that made the request',
  `productnoreq` int(11) NOT NULL COMMENT 'no of requested pieces',
  `productnoaccept` int(11) NOT NULL COMMENT 'no of accepted pieces',
  `useridadd` int(11) NOT NULL COMMENT 'user who add the request',
  `useridresponse` int(11) NOT NULL COMMENT 'user who respond to the request',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '0 new - 1 refuse - 2 accept - 3 accept and added to bill',
  `seen` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0' COMMENT '1 deleted - 0 not deleted ',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productserial`
--

CREATE TABLE IF NOT EXISTS `productserial` (
  `productserailid` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `serialnumber` varchar(256) NOT NULL,
  `comment` text NOT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `billid` int(11) NOT NULL,
  `type` int(11) NOT NULL COMMENT '0 for Buy 1 for returnBuyBill',
  `buybilldetailid` int(11) NOT NULL,
  `don` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillid` int(11) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del 1 for del',
  `storeid` int(11) NOT NULL COMMENT 'store of buy bill where serial exists',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `chassisNo` varchar(25) NOT NULL DEFAULT '',
  `motorNo` varchar(25) NOT NULL DEFAULT '',
  `theColor` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`productserailid`),
  KEY `productid` (`productid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productsetting`
--

CREATE TABLE IF NOT EXISTS `productsetting` (
  `productsettingid` int(11) NOT NULL AUTO_INCREMENT,
  `leastValueAtStore` decimal(10,2) NOT NULL,
  `storeid` int(11) NOT NULL,
  PRIMARY KEY (`productsettingid`),
  KEY `storeid` (`storeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `producttemp`
--

CREATE TABLE IF NOT EXISTS `producttemp` (
  `producttempid` int(11) NOT NULL AUTO_INCREMENT,
  `productName` varchar(256) NOT NULL DEFAULT '',
  `productCatId` int(11) NOT NULL,
  `productBuyPrice` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `productSellAllPrice` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `productSellUnitPrice` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `productSellHalfPrice` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `productDate` date NOT NULL,
  `conditions` int(1) NOT NULL DEFAULT '0',
  `userId` int(11) NOT NULL,
  `parcode` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`producttempid`),
  KEY `productCatId` (`productCatId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `producttempunit`
--

CREATE TABLE IF NOT EXISTS `producttempunit` (
  `producttempunitid` int(11) NOT NULL AUTO_INCREMENT,
  `unitid` int(11) NOT NULL,
  `producttempid` int(11) NOT NULL,
  `productnumber` int(11) NOT NULL,
  `producttempunitdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`producttempunitid`),
  KEY `producttempid` (`producttempid`),
  KEY `unitid` (`unitid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `productunit`
--

CREATE TABLE IF NOT EXISTS `productunit` (
  `productunitid` int(11) NOT NULL AUTO_INCREMENT,
  `unitid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `productnumber` decimal(10,2) NOT NULL,
  `productunitdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `proUnitParcode` varchar(30) NOT NULL,
  `proUnitSellAllPrice` float NOT NULL,
  `proUnitSellHalfPrice` float NOT NULL,
  `proUnitSellUnitPrice` float NOT NULL,
  `proUnitBuyPrice` float NOT NULL,
  PRIMARY KEY (`productunitid`),
  KEY `productid` (`productid`),
  KEY `unitid` (`unitid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `project`
--

CREATE TABLE IF NOT EXISTS `project` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `totalcontract` decimal(10,2) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `detail` text NOT NULL,
  `clientid` int(11) NOT NULL,
  `costcenterid` int(11) NOT NULL,
  `treeid` int(11) NOT NULL,
  `treeproid` int(11) NOT NULL,
  `entryid` int(11) NOT NULL,
  `sysdate` date NOT NULL,
  `del` int(11) NOT NULL DEFAULT '0',
  `finish` int(11) DEFAULT '0' COMMENT '0: not finish 1: finish',
  `projectkindid` int(11) NOT NULL DEFAULT '0',
  `bannerdesigned` int(11) NOT NULL DEFAULT '0',
  `projectsuit` int(11) NOT NULL DEFAULT '0',
  `addeddate` date NOT NULL,
  `expirydate` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `projectexchmaterial`
--

CREATE TABLE IF NOT EXISTS `projectexchmaterial` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serilno` varchar(255) NOT NULL,
  `projectid` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  `projdate` date NOT NULL,
  `sysdate` date NOT NULL,
  `totalnum` varchar(255) NOT NULL,
  `totalbuyprice` varchar(255) NOT NULL,
  `entryid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `projectexchmaterialdetail`
--

CREATE TABLE IF NOT EXISTS `projectexchmaterialdetail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `projectexchid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `pronumber` int(11) NOT NULL,
  `probuyprice` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `projectexchmaterialdetailreturn`
--

CREATE TABLE IF NOT EXISTS `projectexchmaterialdetailreturn` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `projectexchid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `pronumber` int(11) NOT NULL,
  `probuyprice` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `projectexchmaterialreturn`
--

CREATE TABLE IF NOT EXISTS `projectexchmaterialreturn` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `serilno` varchar(255) NOT NULL,
  `projectid` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  `projdate` date NOT NULL,
  `sysdate` date NOT NULL,
  `totalnum` varchar(255) NOT NULL,
  `totalbuyprice` varchar(255) NOT NULL,
  `entryid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `projectkind`
--

CREATE TABLE IF NOT EXISTS `projectkind` (
  `projectkindid` int(11) NOT NULL AUTO_INCREMENT,
  `projectkindname` varchar(256) DEFAULT NULL,
  `projectkinddate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(1) NOT NULL,
  `projectkindcomment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`projectkindid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;


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

--
-- Table structure for table `properties`
--

CREATE TABLE IF NOT EXISTS `properties` (
  `propertyid` int(11) NOT NULL AUTO_INCREMENT,
  `propertyname` varchar(255) NOT NULL,
  `propertyparent` int(11) NOT NULL,
  `propertydefault` int(11) NOT NULL DEFAULT '0',
  `propertyurl` varchar(255) NOT NULL,
  PRIMARY KEY (`propertyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `quickprofitclient`
--

CREATE TABLE IF NOT EXISTS `quickprofitclient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientId` int(11) NOT NULL,
  `theDate` date NOT NULL,
  `sellVal` decimal(15,2) NOT NULL,
  `sellCostBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  `returnSellVal` decimal(15,2) NOT NULL,
  `returnSellCostBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  `debtLimit` decimal(10,2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_quickprofitclient` (`clientId`,`theDate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `quickprofitday`
--

CREATE TABLE IF NOT EXISTS `quickprofitday` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `theDate` date NOT NULL,
  `sellVal` decimal(15,2) NOT NULL,
  `sellCostBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  `returnSellVal` decimal(15,2) NOT NULL,
  `returnSellCostBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `theDate` (`theDate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `quickprofitgeneral`
--

CREATE TABLE IF NOT EXISTS `quickprofitgeneral` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `netSellVal` decimal(15,2) NOT NULL,
  `netSellCostBuyPrice` decimal(15,2) NOT NULL,
  `netSellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `netSellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `netSellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `netSellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `netSellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `quickprofitproduct`
--

CREATE TABLE IF NOT EXISTS `quickprofitproduct` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `productId` int(11) NOT NULL,
  `theDate` date NOT NULL,
  `sellVal` decimal(15,2) NOT NULL,
  `sellCostBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  `returnSellVal` decimal(15,2) NOT NULL,
  `returnSellCostBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  `netQuantity` decimal(10,2) NOT NULL,
  `netQuantityRet` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_quickprofitproduct` (`productId`,`theDate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `quickprofitstore`
--

CREATE TABLE IF NOT EXISTS `quickprofitstore` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `storeId` int(11) NOT NULL,
  `theDate` date NOT NULL,
  `sellVal` decimal(15,2) NOT NULL,
  `sellCostBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `sellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `sellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  `returnSellVal` decimal(15,2) NOT NULL,
  `returnSellCostBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPrice` decimal(15,2) NOT NULL,
  `returnSellCostLastBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostMeanBuyPricewithDiscount` decimal(15,2) NOT NULL,
  `returnSellCostOverAllAveragePrice` decimal(15,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_quickprofitstore` (`storeId`,`theDate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `religions`
--

CREATE TABLE IF NOT EXISTS `religions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `relusergroupproperties`
--

CREATE TABLE IF NOT EXISTS `relusergroupproperties` (
  `relusergrouppropertiesid` int(11) NOT NULL AUTO_INCREMENT,
  `usergroupid` int(11) NOT NULL,
  `propertyid` int(11) NOT NULL,
  `propertyvalue` int(11) NOT NULL DEFAULT '0',
  `theorder` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`relusergrouppropertiesid`),
  UNIQUE KEY `usergroupid_2` (`usergroupid`,`propertyid`),
  KEY `usergroupid` (`usergroupid`,`propertyid`),
  KEY `propertyid` (`propertyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `rentbill`
--

CREATE TABLE IF NOT EXISTS `rentbill` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) DEFAULT NULL,
  `createdatetime` date DEFAULT NULL,
  `billtotal` decimal(10,2) DEFAULT NULL,
  `firmbilltotal` decimal(10,2) DEFAULT NULL,
  `billpayed` decimal(10,2) DEFAULT NULL,
  `billreset` decimal(10,2) DEFAULT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `payistype` char(1) NOT NULL DEFAULT '0',
  `bankid` int(11) DEFAULT NULL,
  `accountid` int(11) DEFAULT NULL,
  `paperno` int(11) DEFAULT NULL,
  `paperval` decimal(10,2) DEFAULT NULL,
  `paperdate` date DEFAULT NULL,
  `discount` decimal(10,2) DEFAULT NULL,
  `distotal` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `rentbillprop`
--

CREATE TABLE IF NOT EXISTS `rentbillprop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `billid` int(11) DEFAULT NULL,
  `productid` int(11) DEFAULT NULL,
  `type` char(1) DEFAULT NULL,
  `supplierid` int(11) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `rentprice` decimal(10,2) DEFAULT NULL,
  `supplierprice` decimal(10,2) DEFAULT NULL,
  `totalprice` decimal(10,2) DEFAULT NULL,
  `suppliertotalpice` decimal(10,2) DEFAULT NULL,
  `startdate` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  `rentdays` int(11) DEFAULT NULL,
  `status` char(1) DEFAULT NULL,
  `delayvalue` decimal(10,2) DEFAULT NULL,
  `delaytype` char(1) DEFAULT NULL,
  `delypay` decimal(10,2) DEFAULT NULL,
  `delayreset` decimal(10,2) DEFAULT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `diffdate` varchar(2000) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `rentproduct`
--

CREATE TABLE IF NOT EXISTS `rentproduct` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(2000) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `buyprice` decimal(10,2) DEFAULT NULL,
  `totalprice` decimal(10,2) DEFAULT NULL,
  `rentprice` decimal(10,2) DEFAULT NULL,
  `paytype` char(1) DEFAULT NULL,
  `supplierid` int(11) DEFAULT '0',
  `createdate` date DEFAULT NULL,
  `info` text,
  `isdel` char(1) DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `rentstore`
--

CREATE TABLE IF NOT EXISTS `rentstore` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rentproductid` int(11) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `rented` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `representativecompany`
--

CREATE TABLE IF NOT EXISTS `representativecompany` (
  `representativecompanyId` int(11) NOT NULL AUTO_INCREMENT,
  `representativeName` varchar(255) NOT NULL,
  `representativePhone` varchar(255) NOT NULL,
  `companyId` int(11) NOT NULL,
  `otherInfo` longtext NOT NULL,
  PRIMARY KEY (`representativecompanyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restauranthall`
--

CREATE TABLE IF NOT EXISTS `restauranthall` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `hallPrice` tinyint(4) NOT NULL,
  `hallUsers` varchar(300) NOT NULL,
  `userId` int(11) NOT NULL,
  `sysdate` date NOT NULL,
  `del` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantkitchenprint`
--

CREATE TABLE IF NOT EXISTS `restaurantkitchenprint` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orderId` int(11) NOT NULL,
  `productId` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `notesPrinted` text NOT NULL,
  `togetherNo` int(11) NOT NULL,
  `isPrinted` tinyint(4) NOT NULL COMMENT '0 not printed - 1 printed',
  `sysDateTime` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantorder`
--

CREATE TABLE IF NOT EXISTS `restaurantorder` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `hallUserId` int(11) NOT NULL,
  `tableId` int(11) NOT NULL,
  `totalBill` decimal(10,2) NOT NULL,
  `discount` decimal(10,2) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  `netBill` decimal(10,2) NOT NULL,
  `finished` tinyint(4) NOT NULL COMMENT '0 not finished - 1 finished',
  `sellBillId` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL,
  `daySreial` int(11) NOT NULL,
  `billComment` text CHARACTER SET utf8 NOT NULL,
  `payed` decimal(10,2) NOT NULL DEFAULT '0',
  `restaurantplaystationplayid` int(11) NOT NULL DEFAULT '0',
  `rest` float(8,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantorderdeliverydetails`
--

CREATE TABLE IF NOT EXISTS `restaurantorderdeliverydetails` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orderId` int(11) NOT NULL,
  `clientId` int(11) NOT NULL,
  `clientmobile` tinyint(4) NOT NULL COMMENT '0 hide- 1 show',
  `clientphone` tinyint(4) NOT NULL COMMENT '0 hide- 1 show',
  `clientaddress` tinyint(4) NOT NULL COMMENT '0 hide- 1 show',
  `clientdetails` tinyint(4) NOT NULL COMMENT '0 hide- 1 show',
  `driverId` int(11) NOT NULL,
  `driverReciveDate` datetime NOT NULL,
  `deliveryStatus` tinyint(4) NOT NULL COMMENT '0 new -1 assigned to driver - 2 finish',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantorderdetails`
--

CREATE TABLE IF NOT EXISTS `restaurantorderdetails` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orderId` int(11) NOT NULL,
  `productId` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `notes` text NOT NULL,
  `notesPrinted` text NOT NULL,
  `isPrinted` tinyint(4) NOT NULL,
  `printedQuantity` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantplaystation`
--

CREATE TABLE IF NOT EXISTS `restaurantplaystation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hourPrice` float NOT NULL,
  `beingUsed` tinyint(4) NOT NULL COMMENT '0 empty-1 is used now',
  `tableId` int(11) NOT NULL,
  `serviceId` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL,
  `theType` tinyint(4) NOT NULL COMMENT 'it is to be deleted below it doesnot exist',
  `deviceIdentification` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subDeviceIdentification` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `useSubIdentification` tinyint(4) NOT NULL,
  `hourPriceMulti` float NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantplaystationplay`
--

CREATE TABLE IF NOT EXISTS `restaurantplaystationplay` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `playstationid` int(11) NOT NULL,
  `hourPrice` float NOT NULL,
  `startsysDate` datetime NOT NULL,
  `endsysDate` datetime NOT NULL,
  `duration` time NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `totalPrice` float NOT NULL,
  `discount` float NOT NULL,
  `tax` float NOT NULL,
  `netPrice` float NOT NULL,
  `payed` float NOT NULL,
  `finished` tinyint(4) NOT NULL,
  `sellBillId` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL,
  `reservationType` tinyint(4) NOT NULL COMMENT '0 open - 1 with timer',
  `reservationHours` int(11) NOT NULL,
  `reservationMinutes` int(11) NOT NULL,
  `reservationEndDateTime` datetime NOT NULL,
  `moveStartSysDate` datetime NOT NULL COMMENT 'used in move psplay',
  `moveDuration` time NOT NULL COMMENT 'used in move psplay',
  `oldPsPlayid` INT NOT NULL DEFAULT '0' COMMENT 'used in move psplay',
  `startPrice` FLOAT NOT NULL DEFAULT '0' COMMENT 'used in move psplay  it is sum of price of all previous plastation play',
  `cardPayed` float NOT NULL,
  `cashPayed` float NOT NULL,
  `psClientCardId` int(11) NOT NULL,
  `priceIs` tinyint(4) NOT NULL COMMENT '0 hourPrice - 1 hourPriceMulti',
  `hourPriceMulti` float NOT NULL,
  `allMovesUnitedSellBillId` INT NOT NULL DEFAULT '0' COMMENT 'it is sellbill id made to all movenent from playstation to another and from single to multi as we need it to identify them and use it in print',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantprinter`
--

CREATE TABLE IF NOT EXISTS `restaurantprinter` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `cats` varchar(400) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` date NOT NULL,
  `del` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restaurantrawdestruction`
--

CREATE TABLE IF NOT EXISTS `restaurantrawdestruction` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `storeid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `productBuyPrice` decimal(10,2) NOT NULL,
  `lastbuyprice` decimal(10,2) NOT NULL,
  `meanbuyprice` decimal(10,2) NOT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `conditions` tinyint(4) NOT NULL,
  `sysdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `restauranttable`
--

CREATE TABLE IF NOT EXISTS `restauranttable` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `hallid` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `beingUsed` tinyint(4) NOT NULL COMMENT '0 empty-1 is used now',
  `userId` int(11) NOT NULL,
  `sysdate` date NOT NULL,
  `del` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `returnbuybill`
--

CREATE TABLE IF NOT EXISTS `returnbuybill` (
  `returnbuybillid` int(11) NOT NULL AUTO_INCREMENT,
  `returnbuybillSerial` varchar(255) DEFAULT NULL,
  `returnbuybilldate` datetime DEFAULT NULL,
  `returnbuybillsupplierid` int(11) NOT NULL,
  `returnbuybilltotaldeptbefor` decimal(10,2) NOT NULL,
  `returnbuybilltotaldeptafter` decimal(10,2) NOT NULL,
  `returnbuybilldiscount` varchar(255) NOT NULL DEFAULT '',
  `returnbuybilldiscountrype` int(11) NOT NULL DEFAULT '0',
  `returnbuybilltotalbill` decimal(10,2) NOT NULL,
  `returnbuybillaftertotalbill` decimal(10,2) NOT NULL,
  `returnbuybilltotalpayed` decimal(10,2) NOT NULL,
  `returnbuybillfinalbill` decimal(10,2) NOT NULL,
  `returnbuybillstoreid` int(11) NOT NULL,
  `returnbuybillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `returnbuybillclientname` varchar(255) NOT NULL DEFAULT '',
  `returnbuybillsaveid` int(11) NOT NULL,
  `billnameid` int(11) NOT NULL,
  `returnbuybilldirectpayment` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedbuyid` int(11) DEFAULT NULL,
  `controlname` varchar(255) NOT NULL,
  `payedtax` decimal(10,2) NOT NULL DEFAULT '0',
  `costcenterid` int(11) DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`returnbuybillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `returnbuybilldetail`
--

CREATE TABLE IF NOT EXISTS `returnbuybilldetail` (
  `returnbuybilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `Parcode` varchar(255) NOT NULL DEFAULT '',
  `returnbuybillid` int(11) NOT NULL,
  `returnbuybilldetailcatid` int(11) NOT NULL,
  `returnbuybilldetailproductid` int(11) NOT NULL,
  `returnbuybilldetailquantity` decimal(10,2) NOT NULL,
  `returnbuybilldetailprice` decimal(10,2) NOT NULL,
  `returnbuybilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `productunitid` int(11) NOT NULL,
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`returnbuybilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `returnsellbill`
--

CREATE TABLE IF NOT EXISTS `returnsellbill` (
  `returnsellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `returnsellbilldate` datetime DEFAULT NULL,
  `returnsellbillserial` varchar(5000) DEFAULT NULL,
  `returnsellbillclientid` int(11) NOT NULL,
  `returnsellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `returnsellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `returnsellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `returnsellbilldiscounttype` int(11) NOT NULL DEFAULT '1' COMMENT '1 for direct- 2 for percent',
  `returnsellbilltotalbill` decimal(10,2) NOT NULL,
  `returnsellbillaftertotalbill` decimal(10,2) NOT NULL,
  `returnsellbilltotalpayed` decimal(10,2) NOT NULL,
  `returnsellbillfinalbill` decimal(10,2) NOT NULL,
  `returnsellbillstoreid` int(11) NOT NULL,
  `returnsellbillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `returnsellbillclientname` text NOT NULL,
  `returnsellbillsaveid` int(11) NOT NULL,
  `returnsellbildirectpayment` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `returnsellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL DEFAULT '0',
  `controlname` varchar(255) NOT NULL DEFAULT '0',
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  `carnumber` varchar(255) NOT NULL,
  `cartype` varchar(255) NOT NULL,
  `carchase` varchar(255) NOT NULL,
  `carmotor` varchar(255) NOT NULL,
  `costcenterid` int(11) DEFAULT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  `lastReviewType` tinyint(4) NOT NULL DEFAULT '0',
  `lastReviewUser` int(11) DEFAULT NULL,
  `lastReviewDateTime` datetime DEFAULT NULL,
  `billReservation` tinyint(4) NOT NULL DEFAULT '0',
  `billReservationDate` date NOT NULL,
  `visaAccountId` int(11) NOT NULL DEFAULT '0',
  `cashPayed` decimal(10,2) NOT NULL,
  `visaPayed` decimal(10,2) NOT NULL,
  `isBankAccountTransfer` tinyint(4) NOT NULL DEFAULT '0',
  `extraDiscountPer` float NOT NULL DEFAULT '0',
  `extraDiscountVal` float NOT NULL DEFAULT '0',
  `taxOfDiscountPer` float NOT NULL DEFAULT '0',
  `taxOfDiscountVal` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`returnsellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `returnsellbilldetail`
--

CREATE TABLE IF NOT EXISTS `returnsellbilldetail` (
  `returnsellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `returnsellbillid` int(11) NOT NULL,
  `returnsellbilldetailcatid` int(11) NOT NULL,
  `returnsellbilldetailproductid` int(11) NOT NULL,
  `returnsellbilldetailquantity` decimal(10,2) NOT NULL,
  `returnsellbilldetailprice` decimal(10,2) NOT NULL,
  `returnsellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `conditions` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `discountvalue` decimal(10,2) NOT NULL,
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `discounttype` decimal(10,2) NOT NULL DEFAULT '0',
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `scunitqty` int(11) NOT NULL DEFAULT '0',
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `pricetypepro` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`returnsellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `returnsellbillreview`
--

CREATE TABLE IF NOT EXISTS `returnsellbillreview` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `billid` int(11) NOT NULL,
  `reviewType` tinyint(4) NOT NULL COMMENT '0 cancel review , 1 reviewed',
  `reviewComment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewuserid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL COMMENT '0 not del , 1 del',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Stand-in structure for view `returnsellbillview`
--
CREATE TABLE IF NOT EXISTS `returnsellbillview` (
`returnsellbillid` int(11)
,`returnsellbillserial` varchar(5000)
,`returnsellbillaftertotalbill` decimal(10,2)
,`returnsellbilldate` datetime
,`returnsellbilltotalpayed` decimal(10,2)
,`returnsellbillfinalbill` decimal(10,2)
,`conditions` int(11)
,`returnsellbillclientid` int(11)
,`sellerid` int(11)
,`userid` int(11)
,`returnsellbillstoreid` int(11)
,`returnsellbillsaveid` int(11)
,`clientname` varchar(256)
,`newSellbillidAfterEdit` int(11)
,`dailyentryid` int(11)
);
-- --------------------------------------------------------

--
-- Table structure for table `richproperity`
--

CREATE TABLE IF NOT EXISTS `richproperity` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `parentid` int(11) NOT NULL,
  `url` varchar(255) NOT NULL,
  `defaultval` int(11) NOT NULL,
  `showit` int(11) NOT NULL,
  `displayorder` int(11) NOT NULL,
  `groupid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `salaryreport`
--

CREATE TABLE IF NOT EXISTS `salaryreport` (
  `salaryreportid` int(11) NOT NULL AUTO_INCREMENT,
  `employeeid` int(11) NOT NULL,
  `salaryreportdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `salaryreportsalary` decimal(10,2) NOT NULL,
  `salaryreportdiscount` decimal(10,2) DEFAULT NULL,
  `salaryreportbouns` decimal(10,2) DEFAULT NULL,
  `salaryreportwithdrawal` decimal(10,2) DEFAULT NULL,
  `salaryreportnet` decimal(10,2) NOT NULL,
  `salarymonthdate` varchar(255) NOT NULL,
  `salarymonth` varchar(255) NOT NULL,
  `Repayment` decimal(10,2) NOT NULL,
  `Absence` decimal(10,2) NOT NULL,
  `Reward` decimal(10,2) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '1 for del 0 for notdel',
  `costcenterid` int(11) DEFAULT '0',
  PRIMARY KEY (`salaryreportid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `save`
--

CREATE TABLE IF NOT EXISTS `save` (
  `saveid` int(11) NOT NULL AUTO_INCREMENT,
  `savename` varchar(256) NOT NULL,
  `savecurrentvalue` decimal(15,2) NOT NULL DEFAULT '0.00',
  `savedetails` text,
  `savedate` datetime NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for not deleted- 1 for deleted',
  `userid` int(11) NOT NULL,
  `currencyId` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`saveid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `savedaily`
--

CREATE TABLE IF NOT EXISTS `savedaily` (
  `savedailyid` int(11) NOT NULL AUTO_INCREMENT,
  `savedailysavebefore` decimal(15,2) NOT NULL,
  `savedailychangeamount` decimal(10,2) NOT NULL,
  `savedailychangetype` int(11) DEFAULT NULL COMMENT '0 for plus- 1 for minus',
  `saveid` int(11) NOT NULL,
  `processname` varchar(256) NOT NULL COMMENT 'name of the process',
  `savedailymodelid` int(11) NOT NULL COMMENT '0 => ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦',
  `savedailysaveafter` decimal(15,2) NOT NULL,
  `savedailydate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `tablename` varchar(256) NOT NULL COMMENT 'table of this process',
  `clientid` int(11) DEFAULT '0',
  `note` TEXT NOT NULL DEFAULT '',
  PRIMARY KEY (`savedailyid`),
  KEY `saveid` (`saveid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellandruternbilldetail`
--

CREATE TABLE IF NOT EXISTS `sellandruternbilldetail` (
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `sellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbillid` int(11) NOT NULL,
  `sellbilldetailcatid` int(11) NOT NULL,
  `sellbilldetailproductid` int(11) NOT NULL,
  `sellbilldetailquantity` decimal(10,2) NOT NULL,
  `sellbilldetailprice` decimal(10,2) NOT NULL,
  `sellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilldetaildate` date NOT NULL,
  `selltype` int(11) NOT NULL COMMENT '0 for sell 1 for return',
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `discounttype` decimal(10,2) NOT NULL DEFAULT '0',
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `scunitqty` int(11) NOT NULL DEFAULT '0',
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `pricetypepro` tinyint(4) NOT NULL DEFAULT '0',
  `buyPricesHistoryBookIdQuantity`  TEXT NOT NULL DEFAULT '',
  PRIMARY KEY (`sellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbill`
--

CREATE TABLE IF NOT EXISTS `sellbill` (
  `sellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbilldate` datetime DEFAULT NULL,
  `sellbillserial` varchar(255) DEFAULT NULL,
  `sellbillclientid` int(11) NOT NULL DEFAULT '0',
  `sellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `sellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `sellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `sellbilldiscounttype` int(11) NOT NULL DEFAULT '0',
  `sellbilltotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillaftertotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilltotalpayed` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillfinalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillstoreid` int(11) NOT NULL,
  `sellbillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `sellbillclientname` text NOT NULL,
  `sellbillsaveid` int(11) NOT NULL,
  `sellbildirectpayment` int(11) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL,
  `controlname` varchar(255) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  `carnumber` varchar(255) NOT NULL,
  `cartype` varchar(255) NOT NULL,
  `carchase` varchar(255) NOT NULL,
  `carmotor` varchar(255) NOT NULL,
  `costcenterid` int(11) DEFAULT NULL,
  `localdonw` int(11) DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `obygyVisitId` int(11) DEFAULT '0',
  `onlineOrderId` int(11) DEFAULT '0',
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  `lastReviewType` tinyint(4) NOT NULL DEFAULT '0',
  `lastReviewUser` int(11) DEFAULT NULL,
  `lastReviewDateTime` datetime DEFAULT NULL,
  `delivery` decimal(10,2) NOT NULL DEFAULT '0',
  `totalafterdelivery` decimal(10,2) NOT NULL DEFAULT '0',
  `billReservation` tinyint(4) NOT NULL DEFAULT '0',
  `billReservationDate` date NOT NULL,
  `webApiId` int(11) NOT NULL DEFAULT '0',
  `visaAccountId` int(11) NOT NULL DEFAULT '0',
  `cashPayed` decimal(10,2) NOT NULL,
  `visaPayed` decimal(10,2) NOT NULL,
  `isBankAccountTransfer` tinyint(4) NOT NULL DEFAULT '0',
  `extraDiscountPer` float NOT NULL DEFAULT '0',
  `extraDiscountVal` float NOT NULL DEFAULT '0',
  `taxOfDiscountPer` float NOT NULL DEFAULT '0',
  `taxOfDiscountVal` float NOT NULL DEFAULT '0',
  `shippingDate` date NOT NULL,
  `taxBillNumber` int(11) NOT NULL DEFAULT '0',
  `collectionType` tinyint(4) NOT NULL DEFAULT '0',
  `collectionDate` date NOT NULL,
  PRIMARY KEY (`sellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbillandreturnreview`
--

CREATE TABLE IF NOT EXISTS `sellbillandreturnreview` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `billid` int(11) NOT NULL,
  `reviewType` tinyint(4) NOT NULL COMMENT '0 cancel review , 1 reviewed',
  `reviewuserid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL COMMENT '0 not del , 1 del',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbillandrutern`
--

CREATE TABLE IF NOT EXISTS `sellbillandrutern` (
  `sellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbilldate` datetime DEFAULT NULL,
  `sellbillserial` varchar(255) DEFAULT NULL,
  `sellbillclientid` int(11) NOT NULL DEFAULT '0',
  `sellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `sellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `sellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `sellbilldiscounttype` int(11) NOT NULL DEFAULT '0',
  `sellbilltotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillaftertotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilltotalpayed` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillfinalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillstoreid` int(11) NOT NULL,
  `sellbillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `sellbillclientname` text NOT NULL,
  `sellbillsaveid` int(11) NOT NULL,
  `sellbildirectpayment` int(11) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `sellbillprice` decimal(10,2) NOT NULL,
  `returnsellbillprice` decimal(10,2) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `returnsellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL,
  `controlname` varchar(255) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  `carnumber` varchar(255) NOT NULL,
  `cartype` varchar(255) NOT NULL,
  `carchase` varchar(255) NOT NULL,
  `carmotor` varchar(255) NOT NULL,
  `costcenterid` int(11) DEFAULT NULL,
  `dailyentryid` int(11) DEFAULT NULL,
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  `billReservation` tinyint(4) NOT NULL DEFAULT '0',
  `billReservationDate` date NOT NULL,
  `visaAccountId` int(11) NOT NULL DEFAULT '0',
  `cashPayed` decimal(10,2) NOT NULL,
  `visaPayed` decimal(10,2) NOT NULL,
  `isBankAccountTransfer` tinyint(4) NOT NULL DEFAULT '0',
  `extraDiscountPer` float NOT NULL DEFAULT '0',
  `extraDiscountVal` float NOT NULL DEFAULT '0',
  `taxOfDiscountPer` float NOT NULL DEFAULT '0',
  `taxOfDiscountVal` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`sellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Stand-in structure for view `sellbillandruternview`
--
CREATE TABLE IF NOT EXISTS `sellbillandruternview` (
`sellbillid` int(11)
,`sellbillaftertotalbill` decimal(10,2)
,`sellbilldate` datetime
,`sellbilltotalpayed` decimal(10,2)
,`sellbillfinalbill` decimal(10,2)
,`conditions` int(11)
,`sellbillclientid` int(11)
,`sellerid` int(11)
,`userid` int(11)
,`sellbillstoreid` int(11)
,`sellbillsaveid` int(11)
,`clientname` varchar(256)
,`newSellbillidAfterEdit` int(11)
,`dailyentryid` int(11)
);
-- --------------------------------------------------------

--
-- Table structure for table `sellbilldetail`
--

CREATE TABLE IF NOT EXISTS `sellbilldetail` (
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `sellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbillid` int(11) NOT NULL,
  `sellbilldetailcatid` int(11) NOT NULL,
  `sellbilldetailproductid` int(11) NOT NULL,
  `sellbilldetailquantity` decimal(10,2) NOT NULL,
  `sellbilldetailprice` decimal(10,2) NOT NULL,
  `sellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilldetaildate` date NOT NULL,
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `discounttype` decimal(10,2) NOT NULL DEFAULT '0',
  `localdonw` int(11) DEFAULT '0',
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `scunitqty` int(11) NOT NULL DEFAULT '0',
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `onlineOrderId` int(11) NOT NULL DEFAULT '0',
  `pricetypepro` tinyint(4) NOT NULL DEFAULT '0',
  `playstationPlayId` int(11) NOT NULL DEFAULT '0' COMMENT 'it is restaurantplaystationplay id',
  `soldSerialsInDetails`  TEXT NOT NULL DEFAULT '',
  `buyPricesHistoryBookIdQuantity`  TEXT NOT NULL DEFAULT '',
  PRIMARY KEY (`sellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbilldetailoffer`
--

CREATE TABLE IF NOT EXISTS `sellbilldetailoffer` (
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `sellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbillid` int(11) NOT NULL,
  `sellbilldetailcatid` int(11) NOT NULL,
  `sellbilldetailproductid` int(11) NOT NULL,
  `sellbilldetailquantity` decimal(10,2) NOT NULL,
  `sellbilldetailprice` decimal(10,2) NOT NULL,
  `sellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilldetaildate` date NOT NULL,
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `discounttype` decimal(10,2) NOT NULL DEFAULT '0.00',
  `localdonw` int(11) DEFAULT '0',
  `lastbuyprice` decimal(10,2) DEFAULT NULL,
  `meanbuyprice` decimal(10,2) DEFAULT NULL,
  `lastbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `meanbuyprice_withDiscount` decimal(10,2) DEFAULT NULL,
  `scunitqty` int(11) NOT NULL DEFAULT '0',
  `otherdetailquantity` int(11) NOT NULL DEFAULT '0',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `onlineOrderId` int(11) NOT NULL DEFAULT '0',
  `pricetypepro` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sellbilldetailid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbilldetailorder`
--

CREATE TABLE IF NOT EXISTS `sellbilldetailorder` (
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `sellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbillid` int(11) NOT NULL,
  `sellbilldetailcatid` int(11) NOT NULL,
  `sellbilldetailproductid` int(11) NOT NULL,
  `sellbilldetailquantity` decimal(10,2) NOT NULL,
  `sellbilldetailprice` decimal(10,2) NOT NULL,
  `sellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilldetaildate` date NOT NULL,
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbilloffer`
--

CREATE TABLE IF NOT EXISTS `sellbilloffer` (
  `sellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbilldate` datetime DEFAULT NULL,
  `sellbillserial` varchar(255) DEFAULT NULL,
  `sellbillclientid` int(11) NOT NULL DEFAULT '0',
  `sellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `sellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `sellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `sellbilldiscounttype` int(11) NOT NULL DEFAULT '0',
  `sellbilltotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillaftertotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilltotalpayed` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillfinalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillstoreid` int(11) NOT NULL,
  `sellbillsysdate` datetime NOT NULL,
  `comment` text NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `sellbillclientname` text NOT NULL,
  `sellbillsaveid` int(11) NOT NULL,
  `sellbildirectpayment` int(11) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL,
  `controlname` varchar(255) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0.00',
  `carnumber` varchar(255) NOT NULL,
  `cartype` varchar(255) NOT NULL,
  `carchase` varchar(255) NOT NULL,
  `carmotor` varchar(255) NOT NULL,
  `costcenterid` int(11) DEFAULT NULL,
  `localdonw` int(11) DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `obygyVisitId` int(11) DEFAULT '0',
  `onlineOrderId` int(11) DEFAULT '0',
  `delbyuserid` int(11) NOT NULL DEFAULT '0',
  `lastReviewType` tinyint(4) NOT NULL DEFAULT '0',
  `lastReviewUser` int(11) DEFAULT NULL,
  `lastReviewDateTime` datetime DEFAULT NULL,
  `delivery` decimal(10,2) NOT NULL DEFAULT '0.00',
  `totalafterdelivery` decimal(10,2) NOT NULL DEFAULT '0.00',
  `orderSavedBillId` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sellbillid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `sellbillorder`
--

CREATE TABLE IF NOT EXISTS `sellbillorder` (
  `sellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbilldate` date DEFAULT NULL,
  `sellbillserial` varchar(255) DEFAULT NULL,
  `sellbillclientid` int(11) NOT NULL DEFAULT '0',
  `sellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `sellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `sellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `sellbilldiscounttype` int(11) NOT NULL DEFAULT '0',
  `sellbilltotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillaftertotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilltotalpayed` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillfinalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillstoreid` int(11) NOT NULL,
  `sellbillsysdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `sellbillclientname` text NOT NULL,
  `sellbillsaveid` int(11) NOT NULL,
  `sellbildirectpayment` int(11) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `actualsellbill` int(11) NOT NULL DEFAULT '0' COMMENT 'the actual sell bill id   0 not don yet ',
  `saveAffect` int(11) NOT NULL DEFAULT '0' COMMENT ' 0 for Affect in save  1 not affect',
  PRIMARY KEY (`sellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sellbillreview`
--

CREATE TABLE IF NOT EXISTS `sellbillreview` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `billid` int(11) NOT NULL,
  `reviewType` tinyint(4) NOT NULL COMMENT '0 cancel review , 1 reviewed',
  `reviewComment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `reviewuserid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL COMMENT '0 not del , 1 del',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Stand-in structure for view `sellbillview`
--
CREATE TABLE IF NOT EXISTS `sellbillview` (
`sellbillid` int(11)
,`sellbillserial` varchar(255)
,`sellbillaftertotalbill` decimal(10,2)
,`sellbilldate` datetime
,`sellbilltotalpayed` decimal(10,2)
,`sellbillfinalbill` decimal(10,2)
,`conditions` int(11)
,`sellbillclientid` int(11)
,`sellerid` int(11)
,`userid` int(11)
,`sellbillstoreid` int(11)
,`sellbillsaveid` int(11)
,`clientname` varchar(256)
,`newSellbillidAfterEdit` int(11)
,`dailyentryid` int(11)
);
-- --------------------------------------------------------

--
-- Table structure for table `settingoperation`
--

CREATE TABLE IF NOT EXISTS `settingoperation` (
  `settingOperationID` int(11) NOT NULL AUTO_INCREMENT,
  `settingOperationName` varchar(100) NOT NULL,
  `workStationID` int(11) NOT NULL,
  `realTime` int(11) NOT NULL,
  `assetesID` int(11) NOT NULL,
  `workersNo` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for del - 1 for not del',
  `userID` int(11) NOT NULL,
  `operationDate` date NOT NULL,
  `operationType` varchar(255) NOT NULL DEFAULT '0',
  PRIMARY KEY (`settingOperationID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `shippercompanies`
--

CREATE TABLE IF NOT EXISTS `shippercompanies` (
  `companyId` int(11) NOT NULL AUTO_INCREMENT,
  `companyName` varchar(255) NOT NULL,
  `otherInfo` longtext NOT NULL,
  `tempdele` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`companyId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `simplemanufacturesetting`
--

CREATE TABLE IF NOT EXISTS `simplemanufacturesetting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `storeid` tinyint(4) NOT NULL,
  `reducestoreamount` tinyint(4) NOT NULL COMMENT '1: yes --- 0: no',
  `productsproductionequation` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: Manufacturing products -- 1:all products',
  `orderclient` tinyint(4) NOT NULL DEFAULT '0',
  `taskOrderName` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `sizecolor`
--

CREATE TABLE IF NOT EXISTS `sizecolor` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 NOT NULL,
  `type` tinyint(4) NOT NULL COMMENT '0 size , 1 color',
  `userid` int(11) NOT NULL,
  `conditions` tinyint(4) NOT NULL,
  `sysdate` date NOT NULL,
  `scExcelid` int(11) NOT NULL COMMENT 'used to link products to products from another erp like siam see in buybill',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sizecolorstoredetail`
--

CREATE TABLE IF NOT EXISTS `sizecolorstoredetail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `storeid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `sizeid` int(11) NOT NULL,
  `colorid` int(11) NOT NULL,
  `parcode` varchar(300) NOT NULL,
  `buyprice` decimal(10,2) NOT NULL,
  `sellunitprice` decimal(10,2) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `scdExcelParcode` varchar(12) NOT NULL COMMENT 'used to link products to products from another erp like siam see in buybill',
  PRIMARY KEY (`id`),
  UNIQUE KEY `prosizecolor_unique` (`storeid`, `productid`,`sizeid`,`colorid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `soldserialproduct`
--

CREATE TABLE IF NOT EXISTS `soldserialproduct` (
  `soldserialproductid` int(11) NOT NULL AUTO_INCREMENT,
  `productserailid` int(11) NOT NULL,
  `sellbillid` int(11) NOT NULL,
  `sellbilltype` int(11) NOT NULL COMMENT '0 for sellbill 1 for sell and return sellpart 3 returnsellbill 4 for sell and return returnpart',
  `quantity` decimal(10,2) NOT NULL,
  `del` int(11) NOT NULL COMMENT '0 for not del 1 for del',
  `clientid` int(11) NOT NULL,
  PRIMARY KEY (`soldserialproductid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sparepart`
--

CREATE TABLE IF NOT EXISTS `sparepart` (
  `sparepartid` int(11) NOT NULL AUTO_INCREMENT,
  `sparepartname` varchar(255) NOT NULL,
  `sparepartprice` decimal(10,2) NOT NULL,
  `sparepartnotes` text NOT NULL,
  `userid` int(11) NOT NULL,
  `sparepartdate` date NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sparepartid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sparepartstore`
--

CREATE TABLE IF NOT EXISTS `sparepartstore` (
  `sparepartstoreId` int(11) NOT NULL AUTO_INCREMENT,
  `storeName` varchar(255) NOT NULL,
  `storeDate` date NOT NULL,
  `storeDescription` text NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `userId` int(11) NOT NULL,
  PRIMARY KEY (`sparepartstoreId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sparepartstoredetails`
--

CREATE TABLE IF NOT EXISTS `sparepartstoredetails` (
  `sparepartstoredetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sparepartid` int(11) NOT NULL,
  `sparepartstoreId` int(11) NOT NULL,
  `partquantity` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `sparepartstoredetaildate` date NOT NULL,
  PRIMARY KEY (`sparepartstoredetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `sparepartstorereport`
--

CREATE TABLE IF NOT EXISTS `sparepartstorereport` (
  `sparepartstorereportid` int(11) NOT NULL AUTO_INCREMENT,
  `sparepartid` int(11) NOT NULL,
  `sparepartstoreId` int(11) NOT NULL,
  `partquantity` decimal(10,2) NOT NULL,
  `storereporttype` int(11) NOT NULL COMMENT '0 => plus- 1 => minus',
  `storereportmodelid` int(11) NOT NULL,
  `processname` varchar(256) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  `partbefore` decimal(10,2) NOT NULL,
  `partafter` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `storereportdate` date NOT NULL,
  PRIMARY KEY (`sparepartstorereportid`),
  KEY `sparepartid` (`sparepartid`,`sparepartstoreId`),
  KEY `sparepartstoreId` (`sparepartstoreId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `stage`
--

CREATE TABLE IF NOT EXISTS `stage` (
  `stageId` int(11) NOT NULL AUTO_INCREMENT,
  `stagename` varchar(255) NOT NULL,
  `productId` int(11) NOT NULL,
  `totalhour` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `date` varchar(255) NOT NULL,
  PRIMARY KEY (`stageId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `stagestep`
--

CREATE TABLE IF NOT EXISTS `stagestep` (
  `stagestepId` int(11) NOT NULL AUTO_INCREMENT,
  `stageId` int(11) NOT NULL,
  `stepno` int(11) NOT NULL,
  `operationId` int(11) NOT NULL,
  PRIMARY KEY (`stagestepId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `store`
--

CREATE TABLE IF NOT EXISTS `store` (
  `storeId` int(11) NOT NULL AUTO_INCREMENT,
  `storeName` varchar(256) NOT NULL,
  `storeDate` date NOT NULL,
  `storeDescription` text,
  `conditions` int(1) NOT NULL,
  `userId` int(11) NOT NULL,
  PRIMARY KEY (`storeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `storedetail`
--

CREATE TABLE IF NOT EXISTS `storedetail` (
  `storedetailid` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  `productquantity` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `storedetaildate` date NOT NULL,
  `unittype` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`storedetailid`),
  KEY `productid` (`productid`,`storeid`),
  KEY `storeid` (`storeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `storemovement`
--

CREATE TABLE IF NOT EXISTS `storemovement` (
  `transferproductid` int(11) NOT NULL AUTO_INCREMENT,
  `storeidfrom` int(11) NOT NULL,
  `storeidto` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `transferproductamount` decimal(10,2) NOT NULL,
  `transferproductdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `comment` text NOT NULL,
  `operationnum` int(11) NOT NULL DEFAULT '0',
  `deloperationnum` int(11) NOT NULL DEFAULT '-1',
  `driverid` int(11) DEFAULT NULL,
  `drivertimeout` int(11) DEFAULT NULL,
  `driverdate` datetime DEFAULT NULL,
  `delivererid` int(11) DEFAULT NULL,
  `deliverdate` datetime DEFAULT NULL,
  `storetype` int(11) DEFAULT '0' COMMENT '0=>ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã',
  `priceType` varchar(191) NOT NULL DEFAULT '',
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',`price` decimal(10,2) NOT NULL DEFAULT '0',
  `buyPricesHistoryBookData` text NOT NULL,
  PRIMARY KEY (`transferproductid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `storereport`
--

CREATE TABLE IF NOT EXISTS `storereport` (
  `storereportid` int(11) NOT NULL AUTO_INCREMENT,
  `productid` int(11) NOT NULL,
  `storeid` int(11) NOT NULL,
  `productquantity` decimal(10,2) NOT NULL,
  `storereporttype` int(11) NOT NULL COMMENT '0 => plus- 1 => minus',
  `storereportmodelid` int(11) NOT NULL,
  `processname` varchar(256) NOT NULL,
  `tablename` varchar(256) NOT NULL,
  `productbefore` decimal(10,2) NOT NULL,
  `productafter` decimal(10,2) NOT NULL,
  `userid` int(11) NOT NULL,
  `storereportdate` date NOT NULL,
  `sizeid` int(11) NOT NULL DEFAULT '0',
  `colorid` int(11) NOT NULL DEFAULT '0',
  `unittype` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`storereportid`),
  KEY `productid` (`productid`,`storeid`),
  KEY `storeid` (`storeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `suppay`
--

CREATE TABLE IF NOT EXISTS `suppay` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idsupdeptchange` int(11) NOT NULL,
  `paytype` int(11) NOT NULL DEFAULT '0',
  `accountid` int(11) DEFAULT NULL,
  `del` int(11) NOT NULL DEFAULT '0',
  `bankid` int(11) DEFAULT NULL,
  `checkno` int(11) DEFAULT NULL,
  `beneficiaryname` varchar(255) DEFAULT NULL,
  `chckdate` date DEFAULT NULL,
  `chckimage` varchar(255) DEFAULT NULL,
  `senderbank` varchar(50) DEFAULT NULL,
  `details` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `supplier`
--

CREATE TABLE IF NOT EXISTS `supplier` (
  `supplierid` int(11) NOT NULL AUTO_INCREMENT,
  `suppliername` varchar(256) NOT NULL,
  `supplieraddress` varchar(256) DEFAULT NULL,
  `supplierphone` varchar(20) DEFAULT NULL,
  `suppliercurrentDebt` decimal(10,2) DEFAULT '0',
  `supplierdetails` text,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `userid` int(11) NOT NULL,
  `supplierdate` date NOT NULL,
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `category_id` varchar(200) DEFAULT NULL,
  `typesupplier_id` varchar(200) DEFAULT NULL,
  `linkedClientId` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`supplierid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `supplierdebtchange`
--

CREATE TABLE IF NOT EXISTS `supplierdebtchange` (
  `supplierdebtchangeid` int(11) NOT NULL AUTO_INCREMENT,
  `supplierid` int(11) NOT NULL,
  `supplierdebtchangebefore` decimal(10,2) NOT NULL,
  `supplierdebtchangeamount` decimal(10,2) NOT NULL,
  `supplierdebtchangetype` int(11) NOT NULL COMMENT '0 => plus- 1 => minus',
  `processname` varchar(256) NOT NULL,
  `supplierdebtchangemodelid` int(11) NOT NULL,
  `supplierdebtchangeafter` decimal(10,2) NOT NULL,
  `supplierdebtchangedate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `tablename` varchar(500) NOT NULL,
  `comment` text,
  `del` int(11) NOT NULL DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `saveid` int(11) DEFAULT NULL,
  `costcenterid` int(11) DEFAULT NULL,
  `currencyId` int(11) NOT NULL,
  `conversionFactor` float NOT NULL,
  `payedInCurrency` decimal(10,2) NOT NULL,
  `saveConversionFactor` float NOT NULL,
  PRIMARY KEY (`supplierdebtchangeid`),
  KEY `idx_supplierdebtchange` (`tablename`(255)),
  KEY `supplierid` (`supplierid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `tamweenbill`
--

CREATE TABLE IF NOT EXISTS `tamweenbill` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `billdate` datetime NOT NULL,
  `billMonthDays` int(11) NOT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `tamweenda3mstatus`
--

CREATE TABLE IF NOT EXISTS `tamweenda3mstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `month` date NOT NULL,
  `tamweenStatus` tinyint(4) NOT NULL COMMENT '0 client didnot take it,1 client take it',
  `da3mStatus` tinyint(4) NOT NULL COMMENT '0 client didnot take it,1 client take it,   bread is in da3m',
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL,
  `useridTamween` int(11) NOT NULL,
  `sysdateTamween` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `tamweenremainstatus`
--

CREATE TABLE IF NOT EXISTS `tamweenremainstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clientid` int(11) NOT NULL,
  `month` date NOT NULL,
  `remainstatus` tinyint(4) NOT NULL COMMENT '0 didnot take it, 1 take it',
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `del` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `taskorder`
--

CREATE TABLE IF NOT EXISTS `taskorder` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `productId` int(11) NOT NULL,
  `num` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `thedate` date NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0 for notdel- 1for del',
  `clientid` int(11) NOT NULL,
  `file` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `taskorderproducts`
--

CREATE TABLE IF NOT EXISTS `taskorderproducts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `taskorderid` int(11) NOT NULL,
  `productid` int(11) NOT NULL,
  `unitid` int(11) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `temreturnsellbill`
--

CREATE TABLE IF NOT EXISTS `temreturnsellbill` (
  `returnsellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `returnsellbilldate` date DEFAULT NULL,
  `returnsellbillserial` varchar(255) DEFAULT NULL,
  `returnsellbillclientid` int(11) NOT NULL,
  `returnsellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `returnsellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `returnsellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `returnsellbilldiscounttype` int(11) NOT NULL DEFAULT '1' COMMENT '1 for direct- 2 for percent',
  `returnsellbilltotalbill` decimal(10,2) NOT NULL,
  `returnsellbillaftertotalbill` decimal(10,2) NOT NULL,
  `returnsellbilltotalpayed` decimal(10,2) NOT NULL,
  `returnsellbillfinalbill` decimal(10,2) NOT NULL,
  `returnsellbillstoreid` int(11) NOT NULL,
  `returnsellbillsysdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `returnsellbillclientname` text NOT NULL,
  `returnsellbillsaveid` int(11) NOT NULL,
  `returnsellbildirectpayment` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `returnsellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL DEFAULT '0',
  `controlname` varchar(255) NOT NULL DEFAULT '0',
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`returnsellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `temreturnsellbilldetail`
--

CREATE TABLE IF NOT EXISTS `temreturnsellbilldetail` (
  `returnsellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `returnsellbillid` int(11) NOT NULL,
  `returnsellbilldetailcatid` int(11) NOT NULL,
  `returnsellbilldetailproductid` int(11) NOT NULL,
  `returnsellbilldetailquantity` decimal(10,2) NOT NULL,
  `returnsellbilldetailprice` decimal(10,2) NOT NULL,
  `returnsellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `conditions` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `discountvalue` decimal(10,2) NOT NULL,
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `actualqty` int(11) NOT NULL,
  PRIMARY KEY (`returnsellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `temsellandruternbilldetail`
--

CREATE TABLE IF NOT EXISTS `temsellandruternbilldetail` (
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `sellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbillid` int(11) NOT NULL,
  `sellbilldetailcatid` int(11) NOT NULL,
  `sellbilldetailproductid` int(11) NOT NULL,
  `sellbilldetailquantity` decimal(10,2) NOT NULL,
  `sellbilldetailprice` decimal(10,2) NOT NULL,
  `sellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilldetaildate` date NOT NULL,
  `selltype` int(11) NOT NULL COMMENT '0 for sell 1 for return',
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `actualqty` int(11) NOT NULL,
  PRIMARY KEY (`sellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `temsellbill`
--

CREATE TABLE IF NOT EXISTS `temsellbill` (
  `sellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbilldate` date DEFAULT NULL,
  `sellbillserial` varchar(255) DEFAULT NULL,
  `sellbillclientid` int(11) NOT NULL DEFAULT '0',
  `sellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `sellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `sellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `sellbilldiscounttype` int(11) NOT NULL DEFAULT '0',
  `sellbilltotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillaftertotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilltotalpayed` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillfinalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillstoreid` int(11) NOT NULL,
  `sellbillsysdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `sellbillclientname` text NOT NULL,
  `sellbillsaveid` int(11) NOT NULL,
  `sellbildirectpayment` int(11) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL,
  `controlname` varchar(255) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `temsellbillandrutern`
--

CREATE TABLE IF NOT EXISTS `temsellbillandrutern` (
  `sellbillid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbilldate` date DEFAULT NULL,
  `sellbillserial` varchar(255) DEFAULT NULL,
  `sellbillclientid` int(11) NOT NULL DEFAULT '0',
  `sellbilltotaldeptbefor` decimal(10,2) NOT NULL,
  `sellbilltotaldeptafter` decimal(10,2) NOT NULL,
  `sellbilldiscount` varchar(255) NOT NULL DEFAULT '',
  `sellbilldiscounttype` int(11) NOT NULL DEFAULT '0',
  `sellbilltotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillaftertotalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilltotalpayed` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillfinalbill` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbillstoreid` int(11) NOT NULL,
  `sellbillsysdate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `sellbillclientname` text NOT NULL,
  `sellbillsaveid` int(11) NOT NULL,
  `sellbildirectpayment` int(11) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `billnameid` int(11) NOT NULL,
  `sellerid` int(11) NOT NULL,
  `sellbillprice` decimal(10,2) NOT NULL,
  `returnsellbillprice` decimal(10,2) NOT NULL,
  `tempclientName` varchar(255) NOT NULL,
  `sellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `returnsellQuantity` decimal(10,2) NOT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `deletedsellid` int(11) NOT NULL,
  `controlname` varchar(255) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sellbillid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `temsellbilldetail`
--

CREATE TABLE IF NOT EXISTS `temsellbilldetail` (
  `buyprice` decimal(10,2) NOT NULL,
  `parcode` varchar(256) NOT NULL DEFAULT '',
  `sellbilldetailid` int(11) NOT NULL AUTO_INCREMENT,
  `sellbillid` int(11) NOT NULL,
  `sellbilldetailcatid` int(11) NOT NULL,
  `sellbilldetailproductid` int(11) NOT NULL,
  `sellbilldetailquantity` decimal(10,2) NOT NULL,
  `sellbilldetailprice` decimal(10,2) NOT NULL,
  `sellbilldetailtotalprice` decimal(10,2) NOT NULL,
  `discountvalue` decimal(10,2) NOT NULL,
  `note` varchar(256) DEFAULT NULL,
  `pricetype` int(11) NOT NULL DEFAULT '0' COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `sellbilldetaildate` date NOT NULL,
  `productunitid` int(11) NOT NULL,
  `buydiscount` decimal(10,2) NOT NULL,
  `buydiscounttype` int(11) NOT NULL,
  `storeid` int(11) NOT NULL DEFAULT '0',
  `actualqty` int(11) NOT NULL,
  PRIMARY KEY (`sellbilldetailid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `toworkshoporder`
--

CREATE TABLE IF NOT EXISTS `toworkshoporder` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `driverIdBack` int(11) NOT NULL,
  `deliverIdBack` int(11) NOT NULL,
  `orderNo` varchar(100) NOT NULL,
  `driverId` int(11) NOT NULL,
  `workshopId` int(11) NOT NULL,
  `productNo` int(11) NOT NULL,
  `deliverWorkshopDate` datetime NOT NULL,
  `deliverId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `orderStatus` int(11) NOT NULL,
  `sysDate` datetime NOT NULL,
  `del` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `recieveWorkshopDate` datetime NOT NULL,
  `deliverBranchDate` datetime NOT NULL,
  `recieveBranchDate` datetime NOT NULL,
  `drivertimeout` int(11) NOT NULL DEFAULT '0',
  `driverdelay` int(11) NOT NULL DEFAULT '0',
  `workshoptimeout` int(11) NOT NULL DEFAULT '0',
  `workshopdelay` int(11) NOT NULL DEFAULT '0',
  `drivertimeoutback` int(11) NOT NULL DEFAULT '0',
  `driverdelayback` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `toworkshoporderbill`
--

CREATE TABLE IF NOT EXISTS `toworkshoporderbill` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `toworkshoporderid` int(11) NOT NULL,
  `billid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `transferbtweenbankaccount`
--

CREATE TABLE IF NOT EXISTS `transferbtweenbankaccount` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bankidfrom` int(11) NOT NULL,
  `accountidfrom` int(11) NOT NULL,
  `bankidto` int(11) NOT NULL,
  `accountidto` int(11) NOT NULL,
  `transfervalue` decimal(10,2) NOT NULL,
  `transferdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` tinyint(4) NOT NULL,
  `dailyentryid` int(11) NOT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `transfermoney`
--

CREATE TABLE IF NOT EXISTS `transfermoney` (
  `transfermoneyid` int(11) NOT NULL AUTO_INCREMENT,
  `saveidfrom` int(11) NOT NULL,
  `saveidto` int(11) NOT NULL,
  `transfermoneyvalue` decimal(10,2) NOT NULL,
  `transfermoneydate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `dailyentryid` int(11) NOT NULL DEFAULT '0',
  `comment` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`transfermoneyid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `unit`
--

CREATE TABLE IF NOT EXISTS `unit` (
  `unitId` int(11) NOT NULL AUTO_INCREMENT,
  `unitName` varchar(256) NOT NULL,
  `unitSymbol` varchar(256) DEFAULT NULL COMMENT 'ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€¦Ã‚',
  `unitDescription` text,
  `unitDate` date NOT NULL,
  `conditions` int(1) NOT NULL DEFAULT '0',
  `userId` int(11) NOT NULL,
  PRIMARY KEY (`unitId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `usergroupadmin`
--

CREATE TABLE IF NOT EXISTS `usergroupadmin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `propertyid` int(11) NOT NULL,
  `isallowed` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 allowed,1not allowed',
  PRIMARY KEY (`id`),
  UNIQUE KEY `propertyid` (`propertyid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `vatpayment`
--

CREATE TABLE IF NOT EXISTS `vatpayment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `amount` decimal(10,2) NOT NULL,
  `saveid` int(11) NOT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `userid` int(11) NOT NULL,
  `sysdate` datetime NOT NULL,
  `conditions` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `workshop`
--

CREATE TABLE IF NOT EXISTS `workshop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `thedate` date NOT NULL,
  `userid` int(11) NOT NULL,
  `del` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `workstation`
--

CREATE TABLE IF NOT EXISTS `workstation` (
  `workstationid` int(11) NOT NULL AUTO_INCREMENT,
  `workname` varchar(255) NOT NULL,
  `workerhours` decimal(10,2) NOT NULL,
  `assetshours` decimal(10,2) NOT NULL,
  `date` varchar(255) NOT NULL COMMENT '0->delÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™ÃƒÂ¢Ã¢â€šÂ¬Ã‚Â ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÂ¢Ã¢â‚¬Å¾Ã‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¾Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡Ãƒâ€šÃ‚Â¬ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â ÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Å¡Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã†â€™Ãƒâ€šÃ‚Â¢ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬Ãƒâ€Â',
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '0del-1-notdel',
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`workstationid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `workstationassets`
--

CREATE TABLE IF NOT EXISTS `workstationassets` (
  `workstationassetsId` int(11) NOT NULL AUTO_INCREMENT,
  `workstationid` int(11) NOT NULL,
  `assetsId` varchar(255) NOT NULL,
  `workhours` decimal(10,2) NOT NULL,
  `efficiency` decimal(10,2) NOT NULL,
  PRIMARY KEY (`workstationassetsId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `workstationworker`
--

CREATE TABLE IF NOT EXISTS `workstationworker` (
  `workstationworkerId` int(11) NOT NULL AUTO_INCREMENT,
  `workstationid` int(11) NOT NULL,
  `employeeId` varchar(255) NOT NULL,
  `workhours` decimal(10,2) NOT NULL,
  `efficiency` decimal(10,2) NOT NULL,
  PRIMARY KEY (`workstationworkerId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `typeclient`
--

CREATE TABLE IF NOT EXISTS `typeclient` (
  `typeId` int(11) NOT NULL AUTO_INCREMENT,
  `typeName` varchar(255) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `comments` text NOT NULL,
  `typeDate` date NOT NULL,
  PRIMARY KEY (`typeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------

--
-- Table structure for table `typesimpotencetreatment`
--

CREATE TABLE IF NOT EXISTS `typesimpotencetreatment` (
  `typesimpotencetreatmentid` int(11) NOT NULL AUTO_INCREMENT,
  `typesimpotencetreatmentname` varchar(256) DEFAULT NULL,
  `typesimpotencetreatmentdate` datetime NOT NULL,
  `userid` int(11) NOT NULL,
  `conditions` int(1) NOT NULL,
  `typesimpotencetreatmentcomment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`typesimpotencetreatmentid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

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

--
-- Table structure for table `typesupplier`
--

CREATE TABLE IF NOT EXISTS `typesupplier` (
  `typeId` int(11) NOT NULL AUTO_INCREMENT,
  `typeName` varchar(100) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `comments` text NOT NULL,
  `typeDate` date NOT NULL,
  `category_id` varchar(50) DEFAULT NULL,
    PRIMARY KEY (`typeId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `premium`
--

CREATE TABLE IF NOT EXISTS `premium` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `value` int(11) NOT NULL,
  `premiumclient_id` int(11) NOT NULL,
  `payed` int(11) NOT NULL DEFAULT '0',
  `conditions` int(11) NOT NULL DEFAULT '0',
  `rest` int(11) NOT NULL DEFAULT '0',
  `payment_date` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `premiumclient`
--

CREATE TABLE IF NOT EXISTS `premiumclient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `premiumautomatic`
--

CREATE TABLE IF NOT EXISTS `premiumautomatic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `Totalinstallment` decimal(10,2) NOT NULL,
  `presenter_dir` decimal(10,2) NOT NULL,
  `presenter_per` decimal(10,2) NOT NULL,
  `date` date NOT NULL,
  `remain_amount` decimal(10,2) NOT NULL,
  `installment_nos` int(11) NOT NULL,
  `installment_months` int(11) NOT NULL,
  `installment_days` int(11) NOT NULL,
  `premiumclient_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


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

--
-- Table structure for table `premiuminstallments`
--

CREATE TABLE IF NOT EXISTS `premiuminstallments` (
  `id_installment` int(11) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `value` int(11) NOT NULL,
  `premiumauo_id` int(11) NOT NULL,
  `payed` int(11) NOT NULL DEFAULT '0',
  `conditions` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_installment`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;

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

--
-- Table structure for table `faida`
--

CREATE TABLE IF NOT EXISTS `faida` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `premmium` varchar(100) NOT NULL,
  `comment` text NOT NULL,
  `user_id` int(11) NOT NULL,
  `store_id` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0' COMMENT '(0=all) (1=approval)(2=refusal)',
  `installment_duration` int(11) NOT NULL,
  `total_amount` int(11) NOT NULL,
  `presenter` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;


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


--
-- Table structure for table `faidaproduct`
--

CREATE TABLE IF NOT EXISTS `faidaproduct` (
  `faida_prod_id` int(11) NOT NULL AUTO_INCREMENT,
  `parcode` int(11) DEFAULT NULL,
  `comment` text,
  `productunit` float DEFAULT NULL,
  `pronum` float DEFAULT NULL,
  `scunitname` int(11) DEFAULT NULL,
  `bouns` float DEFAULT NULL,
  `pricetypepro` int(11) DEFAULT NULL,
  `proprice` int(11) DEFAULT NULL,
  `discounttype` float DEFAULT NULL,
  `Faida_id` int(11) DEFAULT NULL,
  `product_id` int(11) NOT NULL,
  `conditions` int(11) NOT NULL DEFAULT '0',
  `faidaproducttotalprice` decimal(10,2) NOT NULL,
  PRIMARY KEY (`faida_prod_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

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


--
-- Table structure for table `faidadirector`
--

CREATE TABLE IF NOT EXISTS `faidadirector` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
  `faida_id` int(11) NOT NULL,
  `conditions` int(11) DEFAULT '0' COMMENT '(0=>Approval)(1=>Refusal)',
  `comment` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


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


--
-- Table structure for table `resturantcategory`
--

CREATE TABLE IF NOT EXISTS `resturantcategory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_id` varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `product_id` int(11) DEFAULT NULL,
  `date` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `resturantcategory`
--


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

--
-- Structure for view `returnsellbillview`
--

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

--
-- Structure for view `sellbillandruternview`
--

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

--
-- Structure for view `sellbillview`
--



-- sql needed
ALTER TABLE `relusergroupproperties` DROP INDEX `usergroupid`, ADD UNIQUE `usergroupid` ( `usergroupid`, `propertyid`);
ALTER TABLE `sizecolorstoredetail` DROP INDEX `prosizecolor_unique`, ADD UNIQUE `prosizecolor_unique` (`storeid`, `productid`,`sizeid`,`colorid`);
ALTER TABLE storereport MODIFY `productbefore` decimal(10,2) AFTER `tablename`;
ALTER TABLE `restaurantplaystation` DROP `theType`;
UPDATE productunit join product on product.productId = productunit.productid SET proUnitParcode = CONCAT(LPAD(product.productId,5,0) , LPAD(productunit.unitid,2,0)) ,proUnitSellAllPrice = (product.productSellAllPrice*productunit.productnumber),proUnitSellHalfPrice = (product.productSellHalfPrice*productunit.productnumber),proUnitSellUnitPrice = (product.productSellUnitPrice*productunit.productnumber),proUnitBuyPrice = (product.productBuyPrice*productunit.productnumber) where productunit.proUnitParcode = '';
ALTER TABLE `buypriceshistorybook` ADD CONSTRAINT `theDate` UNIQUE( `theDate`, `storeId`, `productid`, `sizeid`, `colorid`);
-- ALTER TABLE `restaurantplaystationplay` DROP `psCard`;
