-- Table structure for table `ug_video`
--

CREATE TABLE `ug_video` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ugID` int(11) NOT NULL,
  `title` varchar(64) NOT NULL,
  `videoLink` varchar(128) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ug_video`
--

INSERT INTO `ug_video` VALUES (58,304,'How to make a video intro','/ug_video/How_to_make_a_Video_Intro_online_Intro_Maker_IntroMaker.mp4'),(59,304,'hello world','/ug_video/How_to_make_a_Video_Intro_online_Intro_Maker_IntroMaker.mp4'),(60,306,'How To Start','/ug_video/how to start.avi'),(62,1,'welcome','/ug_video/video-sps.mp4'),(63,1,'Are you ready?','/ug_video/Final-Mia-video.mp4');

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(32) NOT NULL,
  `password` varchar(64) NOT NULL,
  `fullName` varchar(64) NOT NULL,
  `telephoneNo` varchar(16) NOT NULL,
  `emailAddress` varchar(16) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `user`
--


--
-- Table structure for table `user_module_access`
--

CREATE TABLE `user_module_access` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) DEFAULT NULL,
  `userID` int(11) NOT NULL,
  `moduleID` int(11) NOT NULL,
  `transaction` smallint(2) NOT NULL DEFAULT '0',
  `reports` smallint(2) NOT NULL DEFAULT '0',
  `setup` smallint(2) NOT NULL DEFAULT '0',
  `accessRight` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `user_module_access`
--

INSERT INTO `user_module_access` VALUES (1,1,1,1,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(2,1,1,2,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(3,1,1,3,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(4,1,1,4,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(5,1,1,5,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(6,1,1,6,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(7,1,1,7,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(8,1,1,8,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(9,1,1,9,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(10,1,1,10,1,1,1,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(11,1,1,0,0,0,0,0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(100,3,75,1,1,1,1,0,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(101,3,75,2,1,1,1,0,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(102,3,75,3,1,1,1,0,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(103,3,75,4,1,1,1,0,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(104,3,75,5,1,1,1,0,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(105,3,75,6,1,1,1,0,1,'2015-04-20 03:47:38',1,'2015-07-06 04:57:13'),(106,3,75,7,1,1,1,0,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(107,3,75,8,1,1,1,0,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(108,3,75,9,1,1,1,0,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(109,3,75,10,1,1,1,0,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(110,3,76,1,1,1,1,0,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(111,3,76,2,1,1,1,0,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(112,3,76,3,1,1,1,0,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(113,3,76,4,1,1,1,0,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(114,3,76,5,1,1,1,0,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(115,3,76,6,1,1,1,0,75,'2015-04-20 04:05:20',76,'2015-12-23 08:37:25'),(116,3,76,7,1,1,1,0,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(117,3,76,8,1,1,1,0,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(118,3,76,9,1,1,1,0,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(119,3,76,10,1,1,1,0,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(120,3,77,1,1,1,1,0,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(121,3,77,2,1,1,1,0,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(122,3,77,3,1,1,1,0,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(123,3,77,4,1,1,1,0,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(124,3,77,5,1,1,1,0,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(125,3,77,6,1,1,1,0,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:10'),(126,3,77,7,1,1,1,0,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(127,3,77,8,1,1,1,0,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(128,3,77,9,1,1,1,0,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(129,3,77,10,1,1,1,0,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(130,3,1,1,1,1,1,0,1,'2015-06-25 02:35:58',0,'2015-06-25 02:35:58'),(131,3,1,2,1,1,1,0,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(132,3,1,3,1,1,1,0,1,'2015-06-25 02:36:03',0,'2015-06-25 02:36:03'),(133,3,1,4,1,1,1,0,1,'2015-06-25 02:36:05',0,'2015-06-25 02:36:05'),(134,3,1,5,1,1,1,0,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(135,3,1,6,1,1,1,0,1,'2015-06-25 02:36:09',0,'2015-06-25 02:36:09'),(136,3,1,7,1,1,1,0,1,'2015-06-25 02:36:11',0,'2015-06-25 02:36:11'),(137,3,1,8,1,1,1,0,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(138,3,1,9,1,1,1,0,1,'2015-06-25 02:36:14',0,'2015-06-25 02:36:14'),(139,3,1,10,1,1,1,0,1,'2015-06-25 02:36:15',0,'2015-06-25 02:36:15');

--
-- Table structure for table `user_module_access_details`
--

CREATE TABLE `user_module_access_details` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) DEFAULT NULL,
  `userID` int(11) NOT NULL,
  `menuCode` varchar(8) NOT NULL,
  `accessRight` int(11) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3192 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `user_module_access_details`
--

INSERT INTO `user_module_access_details` VALUES (1,1,1,'ARINVLST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(2,1,1,'ARDBNLST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(3,1,1,'ARCDNLST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(4,1,1,'ARRCVPLS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(5,1,1,'ARCUSTST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(6,1,1,'APSUPPAY',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(7,1,1,'APPURDN',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(8,1,1,'APPURCN',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(9,1,1,'APPURDNC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(10,1,1,'APPURCNC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(11,1,1,'APOPWI',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(12,1,1,'APOPWIC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(13,1,1,'APOPWOI',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(14,1,1,'APPURINV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(15,1,1,'APDIRINV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(16,1,1,'APCPYPI',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(17,1,1,'APBANKRE',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(18,1,1,'APPAYCFM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(19,1,1,'APPAYICM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(20,1,1,'APDRNOTE',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(21,1,1,'GLTRJRNL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(22,1,1,'GLTRJlCY',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(23,1,1,'GLTRJlRV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(24,1,1,'GLTRPOST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(25,1,1,'GLRPBS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(26,1,1,'GLRPTB',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(27,1,1,'GLRPJLPS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(28,1,1,'GLRPJLUP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(29,1,1,'GLRPTBFC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(30,1,1,'GLRPABSM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(31,1,1,'GLRPPNLM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(32,1,1,'GLRPBGLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(33,1,1,'GLMCAL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(34,1,1,'GLMCALL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(35,1,1,'GLSTCOA',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(36,1,1,'GLSTBDGT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(37,1,1,'GLSTCURC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(38,1,1,'ARSALINV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(39,1,1,'ARSDBN',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(40,1,1,'ARDBNC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(41,1,1,'ARSCN',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(42,1,1,'ARSCNC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(43,1,1,'ARRCVP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(44,1,1,'ARRCVPC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(45,1,1,'ARDSLINV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(46,1,1,'ARDRSINV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(47,1,1,'ARCPYSI',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(48,1,1,'ARSETCUS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(49,1,1,'MSTRSUPP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(50,1,1,'APPURDNL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(51,1,1,'APPURCNL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(52,1,1,'APRPTOPW',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(53,1,1,'APRPTSTL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(54,1,1,'APTRETCR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(55,1,1,'APTRPYIE',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(56,1,1,'UM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(57,1,1,'UML',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(58,1,1,'MUL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(59,1,1,'LOGRPT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(60,1,1,'UMACCSS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(61,1,1,'MSCL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(62,1,1,'MSSL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(63,1,1,'MSTRCOMP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(64,1,1,'PROJECT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(65,1,1,'TERM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(66,1,1,'MSMTRCD',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(67,1,1,'EMP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(68,1,1,'AGENTSTP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(69,1,1,'BNKSETUP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(70,1,1,'ADMMENU',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(71,1,1,'APTRPYOE',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(72,1,1,'INVPLNRP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(73,1,1,'INVVALRP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(74,1,1,'INVSTORP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(75,1,1,'INVOUTRP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(76,1,1,'INVMOVRP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(77,1,1,'INVLSTRP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(78,1,1,'IVSTCKCS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(79,1,1,'LTL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(80,1,1,'ICAA',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(81,1,1,'MSLM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(82,1,1,'ITEMCAT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(83,1,1,'ITEMTYP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(84,1,1,'ITEMSET',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(85,1,1,'INVUM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(86,1,1,'INVUMCOV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(87,1,1,'INUMCVLS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(88,1,1,'ICSTIDTL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(89,1,1,'ARNWCUST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(90,1,1,'ARSHIP2L',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(91,1,1,'ARSHIP2N',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(92,1,1,'ADMBNKMS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(93,1,1,'ARTRINED',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(94,1,1,'AREDSLDR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(95,1,1,'AREDCR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(96,1,1,'ARPAYEDT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(97,1,1,'PURORDER',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(98,1,1,'PURRCV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(99,1,1,'PURORDCF',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(100,1,1,'PURRCVC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(101,1,1,'GSPRJNW',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(102,1,1,'ZKTSTGRP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(103,1,1,'ZKTSTNSB',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(104,1,1,'ZKTSTNSD',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(105,1,1,'ZKSTCNTR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(106,1,1,'WKSTMSTR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(107,1,1,'WCQCNTR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(108,1,1,'APNEWSUP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(109,1,1,'APNWSHP2',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(110,1,1,'GLTRYECL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(111,1,1,'INVLOCTR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(112,1,1,'INVSALEP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(113,1,1,'INVPURPR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(114,1,1,'INVITEMC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(115,1,1,'INVLOCTC',0,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(116,1,1,'INVITCC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(117,1,1,'INVSALC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(118,1,1,'INVPURCC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(119,1,1,'ItemDetR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(120,1,1,'INEDITEM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(121,1,1,'INNWITEM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(122,1,1,'PURSTSPL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(123,1,1,'PURSTUM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(124,1,1,'PURSTUMC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(125,1,1,'UMCONVNW',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(126,1,1,'SOSTSLPC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(127,1,1,'PURORLST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(128,1,1,'PURRCVLS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(129,1,1,'PUROUTGR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(130,1,1,'PUPRRPT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(131,1,1,'TERMNEW',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(132,1,1,'APDRINVC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(133,1,1,'SOQUOT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(134,1,1,'SOTRNWSO',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(135,1,1,'SOTRDO',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(136,1,1,'DELCNFRM',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(137,1,1,'ZKTTRCAL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(138,1,1,'WKFCAL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(139,1,1,'ZKTRGPLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(140,1,1,'ZKRPCTRL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(141,1,1,'ZKRPNBLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(142,1,1,'ZKRPSMLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(143,1,1,'WKFLST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(144,1,1,'WCQCTRNW',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(145,1,1,'TXTRPROC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(146,1,1,'GST03',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(147,1,1,'gstrpt',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(148,1,1,'null',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(149,1,1,'GSTMSTR',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(150,1,1,'GSTTYPE',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(151,1,1,'GSTGROUP',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(152,1,1,'SOTRQOLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(153,1,1,'SORPPCLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(154,1,1,'SOTRDOLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(155,1,1,'SOTRSOLT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(156,1,1,'SORPSOCU',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(157,1,1,'SORPYRSL',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(158,1,1,'SORPSLIT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(159,1,1,'SORPORCT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(160,1,1,'SORPSOIT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(161,1,1,'SORPOROT',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(162,1,1,'ARCUSTAG',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(163,1,1,'GSTCLASS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(164,1,1,'TAXMSNW',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(165,1,1,'SOSLSPRC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(166,1,1,'ARCASH',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(167,1,1,'ARCASHSC',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(168,1,1,'OTRPAY',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(169,1,1,'OTHRCV',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(170,1,1,'OTRCVCON',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(171,1,1,'ARCSHS',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(172,1,1,'OTRCVLST',1,1,'2015-04-20 03:30:13',1,'2015-04-20 03:30:13'),(2479,3,75,'GLTRJRNL',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2480,3,75,'GLTRJlCY',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2481,3,75,'GLTRJlRV',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2482,3,75,'GLTRPOST',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2483,3,75,'APOPWOI',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2484,3,75,'GLTRYECL',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2485,3,75,'OTRPAY',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2486,3,75,'OTHRCV',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2487,3,75,'OTRCVCON',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2488,3,75,'GLRPBS',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2489,3,75,'GLRPTB',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2490,3,75,'GLRPJLPS',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2491,3,75,'GLRPJLUP',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2492,3,75,'GLRPTBFC',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2493,3,75,'GLRPABSM',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2494,3,75,'GLRPPNLM',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2495,3,75,'APRPTOPW',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2496,3,75,'GLRPBGLT',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2497,3,75,'APBANKRE',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2498,3,75,'OTRCVLST',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2499,3,75,'GLBNKRCL',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2500,3,75,'TRSCSUMM',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2501,3,75,'GLMCAL',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2502,3,75,'GLMCALL',1,1,'2015-04-20 03:47:33',0,'2015-04-20 03:47:33'),(2503,3,75,'GLSTCOA',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2504,3,75,'GLSTBDGT',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2505,3,75,'GLSTCURC',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2506,3,75,'GLOPNBAL',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2507,3,75,'GLUNPRES',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2508,3,75,'ARSALINV',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2509,3,75,'ARSDBN',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2510,3,75,'ARDBNC',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2511,3,75,'ARSCN',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2512,3,75,'ARSCNC',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2513,3,75,'ARRCVP',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2514,3,75,'ARRCVPC',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2515,3,75,'ARDSLINV',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2516,3,75,'ARDRSINV',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2517,3,75,'ARCPYSI',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2518,3,75,'ARTRINED',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2519,3,75,'AREDSLDR',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2520,3,75,'AREDCR',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2521,3,75,'ARPAYEDT',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2522,3,75,'ARCASH',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2523,3,75,'ARCASHSC',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2524,3,75,'ARINVLST',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2525,3,75,'ARDBNLST',1,1,'2015-04-20 03:47:34',0,'2015-04-20 03:47:34'),(2526,3,75,'ARCDNLST',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2527,3,75,'ARRCVPLS',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2528,3,75,'ARCUSTST',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2529,3,75,'ARCUSTAG',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2530,3,75,'ARCSHS',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2531,3,75,'ARSETCUS',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2532,3,75,'ARNWCUST',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2533,3,75,'ARSHIP2L',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2534,3,75,'ARSHIP2N',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2535,3,75,'APSUPPAY',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2536,3,75,'APPURDN',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2537,3,75,'APPURCN',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2538,3,75,'APPURDNC',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2539,3,75,'APPURCNC',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2540,3,75,'APPAYCFM',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2541,3,75,'APOPWI',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2542,3,75,'APPAYICM',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2543,3,75,'APPURINV',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2544,3,75,'APDIRINV',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2545,3,75,'APDRINVC',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2546,3,75,'APCPYPI',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2547,3,75,'APDRNOTE',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2548,3,75,'APTRETCR',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2549,3,75,'APTRPYIE',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2550,3,75,'APTRPYOE',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2551,3,75,'APPURDNL',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2552,3,75,'APPURCNL',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2553,3,75,'APRPTSTL',1,1,'2015-04-20 03:47:35',0,'2015-04-20 03:47:35'),(2554,3,75,'MSTRSUPP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2555,3,75,'APNEWSUP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2556,3,75,'APNWSHP2',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2557,3,75,'INVLOCTR',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2558,3,75,'INVITEMC',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2559,3,75,'INVLOCTC',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2560,3,75,'INVITCC',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2561,3,75,'INVPLNRP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2562,3,75,'INVVALRP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2563,3,75,'INVSTORP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2564,3,75,'INVOUTRP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2565,3,75,'INVMOVRP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2566,3,75,'INVLSTRP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2567,3,75,'IVSTCKCS',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2568,3,75,'LTL',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2569,3,75,'ICAA',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2570,3,75,'ItemDetR',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2571,3,75,'MSLM',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2572,3,75,'ITEMCAT',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2573,3,75,'ITEMTYP',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2574,3,75,'ITEMSET',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2575,3,75,'INVUM',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2576,3,75,'INEDITEM',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2577,3,75,'INNWITEM',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2578,3,75,'IVUNTMSR',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2579,3,75,'OPNBALIN',1,1,'2015-04-20 03:47:36',0,'2015-04-20 03:47:36'),(2580,3,75,'SOQUOT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2581,3,75,'SOTRNWSO',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2582,3,75,'SOTRDO',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2583,3,75,'DELCNFRM',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2584,3,75,'SOTRQOLT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2585,3,75,'SORPPCLT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2586,3,75,'SOTRDOLT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2587,3,75,'SOTRSOLT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2588,3,75,'SORPSOCU',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2589,3,75,'SORPYRSL',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2590,3,75,'SORPSLIT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2591,3,75,'SORPORCT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2592,3,75,'SORPSOIT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2593,3,75,'SORPOROT',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2594,3,75,'SOSTSLPC',1,1,'2015-04-20 03:47:37',0,'2015-04-20 03:47:37'),(2595,3,75,'TXTRPROC',1,1,'2015-04-20 03:47:38',75,'2015-06-26 08:19:31'),(2596,3,75,'GSBADRLF',1,1,'2015-04-20 03:47:38',75,'2015-06-26 08:19:33'),(2597,3,75,'BADBTRLC',1,1,'2015-04-20 03:47:38',75,'2015-06-26 08:19:33'),(2598,3,75,'GSBADBTR',1,1,'2015-04-20 03:47:38',75,'2015-06-26 08:19:34'),(2599,3,75,'BDEBRCCO',1,1,'2015-04-20 03:47:38',75,'2015-06-26 08:19:34'),(2600,3,75,'GST03',1,1,'2015-04-20 03:47:38',1,'2015-07-06 04:57:13'),(2601,3,75,'GSTRPT01',1,1,'2015-04-20 03:47:38',1,'2015-07-06 04:57:16'),(2602,3,75,'BDRETRPT',1,1,'2015-04-20 03:47:38',1,'2015-07-06 04:57:16'),(2603,3,75,'BDRCVRPT',1,1,'2015-04-20 03:47:38',1,'2015-07-06 04:57:16'),(2604,3,75,'GSTMSTR',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2605,3,75,'GSTCLASS',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2606,3,75,'GSTGROUP',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2607,3,75,'GSTTYPE',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2608,3,75,'ZKTTRCAL',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2609,3,75,'WKFCAL',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2610,3,75,'ZKTRGPLT',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2611,3,75,'ZKRPCTRL',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2612,3,75,'ZKRPNBLT',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2613,3,75,'ZKRPSMLT',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2614,3,75,'WKFLST',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2615,3,75,'ZKTSTGRP',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2616,3,75,'ZKTSTNSB',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2617,3,75,'ZKTSTNSD',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2618,3,75,'ZKSTCNTR',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2619,3,75,'WKSTMSTR',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2620,3,75,'WCQCNTR',1,1,'2015-04-20 03:47:38',0,'2015-04-20 03:47:38'),(2621,3,75,'PURORDER',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2622,3,75,'PURRCV',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2623,3,75,'PURORDCF',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2624,3,75,'PURRCVC',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2625,3,75,'PURORLST',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2626,3,75,'PURRCVLS',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2627,3,75,'PUROUTGR',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2628,3,75,'PUPRRPT',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2629,3,75,'PURCNCL',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2630,3,75,'PURRCVCA',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2631,3,75,'PURSTSPL',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2632,3,75,'INVPURPR',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2633,3,75,'UMCONVNW',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2634,3,75,'PURUOMLS',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2635,3,75,'UM',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2636,3,75,'UML',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2637,3,75,'MUL',1,1,'2015-04-20 03:47:39',0,'2015-04-20 03:47:39'),(2638,3,75,'LOGRPT',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2639,3,75,'UMACCSS',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2640,3,75,'ADMMENU',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2641,3,75,'USRADD',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2642,3,75,'BACKUP',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2643,3,75,'updversi',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2644,3,75,'upgraden',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2645,3,75,'MSTRCOMP',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2646,3,75,'PROJECT',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2647,3,75,'TERM',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2648,3,75,'MSMTRCD',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2649,3,75,'EMP',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2650,3,75,'AGENTSTP',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2651,3,75,'BNKSETUP',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2652,3,75,'ShipToST',1,1,'2015-04-20 03:47:40',0,'2015-04-20 03:47:40'),(2653,3,76,'GLTRJRNL',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2654,3,76,'GLTRJlCY',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2655,3,76,'GLTRJlRV',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2656,3,76,'GLTRPOST',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2657,3,76,'APOPWOI',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2658,3,76,'GLTRYECL',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2659,3,76,'OTRPAY',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2660,3,76,'OTHRCV',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2661,3,76,'OTRCVCON',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2662,3,76,'GLRPBS',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2663,3,76,'GLRPTB',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2664,3,76,'GLRPJLPS',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2665,3,76,'GLRPJLUP',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2666,3,76,'GLRPTBFC',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2667,3,76,'GLRPABSM',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2668,3,76,'GLRPPNLM',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2669,3,76,'APRPTOPW',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2670,3,76,'GLRPBGLT',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2671,3,76,'APBANKRE',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2672,3,76,'OTRCVLST',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2673,3,76,'GLBNKRCL',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2674,3,76,'TRSCSUMM',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2675,3,76,'GLMCAL',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2676,3,76,'GLMCALL',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2677,3,76,'GLSTCOA',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2678,3,76,'GLSTBDGT',1,75,'2015-04-20 04:05:16',0,'2015-04-20 04:05:16'),(2679,3,76,'GLSTCURC',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2680,3,76,'GLOPNBAL',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2681,3,76,'GLUNPRES',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2682,3,76,'ARSALINV',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2683,3,76,'ARSDBN',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2684,3,76,'ARDBNC',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2685,3,76,'ARSCN',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2686,3,76,'ARSCNC',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2687,3,76,'ARRCVP',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2688,3,76,'ARRCVPC',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2689,3,76,'ARDSLINV',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2690,3,76,'ARDRSINV',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2691,3,76,'ARCPYSI',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2692,3,76,'ARTRINED',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2693,3,76,'AREDSLDR',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2694,3,76,'AREDCR',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2695,3,76,'ARPAYEDT',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2696,3,76,'ARCASH',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2697,3,76,'ARCASHSC',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2698,3,76,'ARINVLST',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2699,3,76,'ARDBNLST',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2700,3,76,'ARCDNLST',1,75,'2015-04-20 04:05:17',0,'2015-04-20 04:05:17'),(2701,3,76,'ARRCVPLS',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2702,3,76,'ARCUSTST',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2703,3,76,'ARCUSTAG',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2704,3,76,'ARCSHS',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2705,3,76,'ARSETCUS',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2706,3,76,'ARNWCUST',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2707,3,76,'ARSHIP2L',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2708,3,76,'ARSHIP2N',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2709,3,76,'APSUPPAY',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2710,3,76,'APPURDN',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2711,3,76,'APPURCN',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2712,3,76,'APPURDNC',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2713,3,76,'APPURCNC',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2714,3,76,'APPAYCFM',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2715,3,76,'APOPWI',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2716,3,76,'APPAYICM',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2717,3,76,'APPURINV',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2718,3,76,'APDIRINV',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2719,3,76,'APDRINVC',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2720,3,76,'APCPYPI',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2721,3,76,'APDRNOTE',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2722,3,76,'APTRETCR',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2723,3,76,'APTRPYIE',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2724,3,76,'APTRPYOE',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2725,3,76,'APPURDNL',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2726,3,76,'APPURCNL',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2727,3,76,'APRPTSTL',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2728,3,76,'MSTRSUPP',1,75,'2015-04-20 04:05:18',0,'2015-04-20 04:05:18'),(2729,3,76,'APNEWSUP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2730,3,76,'APNWSHP2',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2731,3,76,'INVLOCTR',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2732,3,76,'INVITEMC',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2733,3,76,'INVLOCTC',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2734,3,76,'INVITCC',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2735,3,76,'INVPLNRP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2736,3,76,'INVVALRP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2737,3,76,'INVSTORP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2738,3,76,'INVOUTRP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2739,3,76,'INVMOVRP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2740,3,76,'INVLSTRP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2741,3,76,'IVSTCKCS',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2742,3,76,'LTL',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2743,3,76,'ICAA',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2744,3,76,'ItemDetR',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2745,3,76,'MSLM',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2746,3,76,'ITEMCAT',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2747,3,76,'ITEMTYP',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2748,3,76,'ITEMSET',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2749,3,76,'INVUM',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2750,3,76,'INEDITEM',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2751,3,76,'INNWITEM',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2752,3,76,'IVUNTMSR',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2753,3,76,'OPNBALIN',1,75,'2015-04-20 04:05:19',0,'2015-04-20 04:05:19'),(2754,3,76,'SOQUOT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2755,3,76,'SOTRNWSO',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2756,3,76,'SOTRDO',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2757,3,76,'DELCNFRM',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2758,3,76,'SOTRQOLT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2759,3,76,'SORPPCLT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2760,3,76,'SOTRDOLT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2761,3,76,'SOTRSOLT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2762,3,76,'SORPSOCU',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2763,3,76,'SORPYRSL',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2764,3,76,'SORPSLIT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2765,3,76,'SORPORCT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2766,3,76,'SORPSOIT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2767,3,76,'SORPOROT',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2768,3,76,'SOSTSLPC',1,75,'2015-04-20 04:05:20',0,'2015-04-20 04:05:20'),(2769,3,76,'TXTRPROC',1,75,'2015-04-20 04:05:20',75,'2015-07-06 04:30:34'),(2770,3,76,'GSBADRLF',1,75,'2015-04-20 04:05:20',75,'2015-07-06 04:30:36'),(2771,3,76,'BADBTRLC',1,75,'2015-04-20 04:05:21',75,'2015-07-06 04:30:36'),(2772,3,76,'GSBADBTR',1,75,'2015-04-20 04:05:21',75,'2015-07-06 04:30:37'),(2773,3,76,'BDEBRCCO',1,75,'2015-04-20 04:05:21',75,'2015-07-06 04:30:37'),(2774,3,76,'GST03',1,75,'2015-04-20 04:05:21',76,'2015-12-23 08:37:25'),(2775,3,76,'GSTRPT01',1,75,'2015-04-20 04:05:21',76,'2015-12-23 08:37:26'),(2776,3,76,'BDRETRPT',1,75,'2015-04-20 04:05:21',76,'2015-12-23 08:37:26'),(2777,3,76,'BDRCVRPT',1,75,'2015-04-20 04:05:21',76,'2015-12-23 08:37:27'),(2778,3,76,'GSTMSTR',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2779,3,76,'GSTCLASS',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2780,3,76,'GSTGROUP',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2781,3,76,'GSTTYPE',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2782,3,76,'ZKTTRCAL',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2783,3,76,'WKFCAL',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2784,3,76,'ZKTRGPLT',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2785,3,76,'ZKRPCTRL',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2786,3,76,'ZKRPNBLT',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2787,3,76,'ZKRPSMLT',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2788,3,76,'WKFLST',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2789,3,76,'ZKTSTGRP',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2790,3,76,'ZKTSTNSB',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2791,3,76,'ZKTSTNSD',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2792,3,76,'ZKSTCNTR',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2793,3,76,'WKSTMSTR',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2794,3,76,'WCQCNTR',1,75,'2015-04-20 04:05:21',0,'2015-04-20 04:05:21'),(2795,3,76,'PURORDER',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2796,3,76,'PURRCV',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2797,3,76,'PURORDCF',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2798,3,76,'PURRCVC',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2799,3,76,'PURORLST',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2800,3,76,'PURRCVLS',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2801,3,76,'PUROUTGR',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2802,3,76,'PUPRRPT',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2803,3,76,'PURCNCL',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2804,3,76,'PURRCVCA',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2805,3,76,'PURSTSPL',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2806,3,76,'INVPURPR',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2807,3,76,'UMCONVNW',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2808,3,76,'PURUOMLS',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2809,3,76,'UM',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2810,3,76,'UML',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2811,3,76,'MUL',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2812,3,76,'LOGRPT',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2813,3,76,'UMACCSS',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2814,3,76,'ADMMENU',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2815,3,76,'USRADD',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2816,3,76,'BACKUP',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2817,3,76,'updversi',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2818,3,76,'upgraden',1,75,'2015-04-20 04:05:22',0,'2015-04-20 04:05:22'),(2819,3,76,'MSTRCOMP',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2820,3,76,'PROJECT',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2821,3,76,'TERM',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2822,3,76,'MSMTRCD',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2823,3,76,'EMP',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2824,3,76,'AGENTSTP',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2825,3,76,'BNKSETUP',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2826,3,76,'ShipToST',1,75,'2015-04-20 04:05:23',0,'2015-04-20 04:05:23'),(2827,3,77,'GLTRJRNL',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2828,3,77,'GLTRJlCY',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2829,3,77,'GLTRJlRV',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2830,3,77,'GLTRPOST',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2831,3,77,'APOPWOI',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2832,3,77,'GLTRYECL',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2833,3,77,'OTRPAY',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2834,3,77,'OTHRCV',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2835,3,77,'OTRCVCON',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2836,3,77,'GLRPBS',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2837,3,77,'GLRPTB',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2838,3,77,'GLRPJLPS',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2839,3,77,'GLRPJLUP',1,76,'2015-04-20 04:09:11',0,'2015-04-20 04:09:11'),(2840,3,77,'GLRPTBFC',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2841,3,77,'GLRPABSM',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2842,3,77,'GLRPPNLM',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2843,3,77,'APRPTOPW',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2844,3,77,'GLRPBGLT',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2845,3,77,'APBANKRE',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2846,3,77,'OTRCVLST',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2847,3,77,'GLBNKRCL',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2848,3,77,'TRSCSUMM',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2849,3,77,'GLMCAL',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2850,3,77,'GLMCALL',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2851,3,77,'GLSTCOA',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2852,3,77,'GLSTBDGT',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2853,3,77,'GLSTCURC',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2854,3,77,'GLOPNBAL',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2855,3,77,'GLUNPRES',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2856,3,77,'ARSALINV',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2857,3,77,'ARSDBN',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2858,3,77,'ARDBNC',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2859,3,77,'ARSCN',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2860,3,77,'ARSCNC',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2861,3,77,'ARRCVP',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2862,3,77,'ARRCVPC',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2863,3,77,'ARDSLINV',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2864,3,77,'ARDRSINV',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2865,3,77,'ARCPYSI',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2866,3,77,'ARTRINED',1,76,'2015-04-20 04:09:12',0,'2015-04-20 04:09:12'),(2867,3,77,'AREDSLDR',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2868,3,77,'AREDCR',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2869,3,77,'ARPAYEDT',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2870,3,77,'ARCASH',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2871,3,77,'ARCASHSC',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2872,3,77,'ARINVLST',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2873,3,77,'ARDBNLST',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2874,3,77,'ARCDNLST',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2875,3,77,'ARRCVPLS',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2876,3,77,'ARCUSTST',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2877,3,77,'ARCUSTAG',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2878,3,77,'ARCSHS',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2879,3,77,'ARSETCUS',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2880,3,77,'ARNWCUST',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2881,3,77,'ARSHIP2L',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2882,3,77,'ARSHIP2N',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2883,3,77,'APSUPPAY',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2884,3,77,'APPURDN',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2885,3,77,'APPURCN',1,76,'2015-04-20 04:09:13',0,'2015-04-20 04:09:13'),(2886,3,77,'APPURDNC',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2887,3,77,'APPURCNC',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2888,3,77,'APPAYCFM',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2889,3,77,'APOPWI',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2890,3,77,'APPAYICM',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2891,3,77,'APPURINV',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2892,3,77,'APDIRINV',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2893,3,77,'APDRINVC',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2894,3,77,'APCPYPI',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2895,3,77,'APDRNOTE',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2896,3,77,'APTRETCR',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2897,3,77,'APTRPYIE',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2898,3,77,'APTRPYOE',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2899,3,77,'APPURDNL',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2900,3,77,'APPURCNL',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2901,3,77,'APRPTSTL',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2902,3,77,'MSTRSUPP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2903,3,77,'APNEWSUP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2904,3,77,'APNWSHP2',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2905,3,77,'INVLOCTR',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2906,3,77,'INVITEMC',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2907,3,77,'INVLOCTC',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2908,3,77,'INVITCC',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2909,3,77,'INVPLNRP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2910,3,77,'INVVALRP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2911,3,77,'INVSTORP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2912,3,77,'INVOUTRP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2913,3,77,'INVMOVRP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2914,3,77,'INVLSTRP',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2915,3,77,'IVSTCKCS',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2916,3,77,'LTL',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2917,3,77,'ICAA',1,76,'2015-04-20 04:09:14',0,'2015-04-20 04:09:14'),(2918,3,77,'ItemDetR',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2919,3,77,'MSLM',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2920,3,77,'ITEMCAT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2921,3,77,'ITEMTYP',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2922,3,77,'ITEMSET',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2923,3,77,'INVUM',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2924,3,77,'INEDITEM',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2925,3,77,'INNWITEM',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2926,3,77,'IVUNTMSR',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2927,3,77,'OPNBALIN',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2928,3,77,'SOQUOT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2929,3,77,'SOTRNWSO',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2930,3,77,'SOTRDO',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2931,3,77,'DELCNFRM',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2932,3,77,'SOTRQOLT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2933,3,77,'SORPPCLT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2934,3,77,'SOTRDOLT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2935,3,77,'SOTRSOLT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2936,3,77,'SORPSOCU',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2937,3,77,'SORPYRSL',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2938,3,77,'SORPSLIT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2939,3,77,'SORPORCT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2940,3,77,'SORPSOIT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2941,3,77,'SORPOROT',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2942,3,77,'SOSTSLPC',1,76,'2015-04-20 04:09:15',0,'2015-04-20 04:09:15'),(2943,3,77,'TXTRPROC',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:10'),(2944,3,77,'GSBADRLF',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:12'),(2945,3,77,'BADBTRLC',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:13'),(2946,3,77,'GSBADBTR',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:13'),(2947,3,77,'BDEBRCCO',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:13'),(2948,3,77,'GST03',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:27'),(2949,3,77,'GSTRPT01',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:29'),(2950,3,77,'BDRETRPT',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:29'),(2951,3,77,'BDRCVRPT',1,76,'2015-04-20 04:09:16',75,'2015-07-06 04:32:29'),(2952,3,77,'GSTMSTR',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2953,3,77,'GSTCLASS',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2954,3,77,'GSTGROUP',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2955,3,77,'GSTTYPE',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2956,3,77,'ZKTTRCAL',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2957,3,77,'WKFCAL',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2958,3,77,'ZKTRGPLT',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2959,3,77,'ZKRPCTRL',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2960,3,77,'ZKRPNBLT',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2961,3,77,'ZKRPSMLT',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2962,3,77,'WKFLST',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2963,3,77,'ZKTSTGRP',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2964,3,77,'ZKTSTNSB',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2965,3,77,'ZKTSTNSD',1,76,'2015-04-20 04:09:16',0,'2015-04-20 04:09:16'),(2966,3,77,'ZKSTCNTR',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2967,3,77,'WKSTMSTR',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2968,3,77,'WCQCNTR',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2969,3,77,'PURORDER',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2970,3,77,'PURRCV',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2971,3,77,'PURORDCF',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2972,3,77,'PURRCVC',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2973,3,77,'PURORLST',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2974,3,77,'PURRCVLS',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2975,3,77,'PUROUTGR',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2976,3,77,'PUPRRPT',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2977,3,77,'PURCNCL',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2978,3,77,'PURRCVCA',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2979,3,77,'PURSTSPL',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2980,3,77,'INVPURPR',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2981,3,77,'UMCONVNW',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2982,3,77,'PURUOMLS',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2983,3,77,'UM',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2984,3,77,'UML',1,76,'2015-04-20 04:09:17',0,'2015-04-20 04:09:17'),(2985,3,77,'MUL',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2986,3,77,'LOGRPT',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2987,3,77,'UMACCSS',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2988,3,77,'ADMMENU',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2989,3,77,'USRADD',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2990,3,77,'BACKUP',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2991,3,77,'updversi',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2992,3,77,'upgraden',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2993,3,77,'MSTRCOMP',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2994,3,77,'PROJECT',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2995,3,77,'TERM',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2996,3,77,'MSMTRCD',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2997,3,77,'EMP',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2998,3,77,'AGENTSTP',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(2999,3,77,'BNKSETUP',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(3000,3,77,'ShipToST',1,76,'2015-04-20 04:09:18',0,'2015-04-20 04:09:18'),(3001,3,1,'GLTRJRNL',1,1,'2015-06-25 02:35:58',0,'2015-06-25 02:35:58'),(3002,3,1,'GLTRJlCY',1,1,'2015-06-25 02:35:58',0,'2015-06-25 02:35:58'),(3003,3,1,'GLTRJlRV',1,1,'2015-06-25 02:35:58',0,'2015-06-25 02:35:58'),(3004,3,1,'GLTRPOST',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3005,3,1,'APOPWOI',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3006,3,1,'GLTRYECL',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3007,3,1,'OTRPAY',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3008,3,1,'OTHRCV',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3009,3,1,'OTRCVCON',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3010,3,1,'GLRPBS',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3011,3,1,'GLRPTB',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3012,3,1,'GLRPJLPS',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3013,3,1,'GLRPJLUP',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3014,3,1,'GLRPTBFC',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3015,3,1,'GLRPABSM',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3016,3,1,'GLRPPNLM',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3017,3,1,'APRPTOPW',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3018,3,1,'GLRPBGLT',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3019,3,1,'APBANKRE',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3020,3,1,'OTRCVLST',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3021,3,1,'GLBNKRCL',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3022,3,1,'TRSCSUMM',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3023,3,1,'GLMCAL',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3024,3,1,'GLMCALL',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3025,3,1,'GLSTCOA',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3026,3,1,'GLSTBDGT',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3027,3,1,'GLSTCURC',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3028,3,1,'GLOPNBAL',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3029,3,1,'GLUNPRES',1,1,'2015-06-25 02:35:59',0,'2015-06-25 02:35:59'),(3030,3,1,'ARSALINV',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3031,3,1,'ARSDBN',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3032,3,1,'ARDBNC',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3033,3,1,'ARSCN',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3034,3,1,'ARSCNC',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3035,3,1,'ARRCVP',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3036,3,1,'ARRCVPC',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3037,3,1,'ARDSLINV',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3038,3,1,'ARDRSINV',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3039,3,1,'ARCPYSI',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3040,3,1,'ARTRINED',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3041,3,1,'AREDSLDR',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3042,3,1,'AREDCR',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3043,3,1,'ARPAYEDT',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3044,3,1,'ARCASH',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3045,3,1,'ARCASHSC',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3046,3,1,'ARINVLST',1,1,'2015-06-25 02:36:01',0,'2015-06-25 02:36:01'),(3047,3,1,'ARDBNLST',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3048,3,1,'ARCDNLST',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3049,3,1,'ARRCVPLS',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3050,3,1,'ARCUSTST',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3051,3,1,'ARCUSTAG',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3052,3,1,'ARCSHS',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3053,3,1,'ARSETCUS',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3054,3,1,'ARNWCUST',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3055,3,1,'ARSHIP2L',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3056,3,1,'ARSHIP2N',1,1,'2015-06-25 02:36:02',0,'2015-06-25 02:36:02'),(3057,3,1,'APSUPPAY',1,1,'2015-06-25 02:36:03',0,'2015-06-25 02:36:03'),(3058,3,1,'APPURDN',1,1,'2015-06-25 02:36:03',0,'2015-06-25 02:36:03'),(3059,3,1,'APPURCN',1,1,'2015-06-25 02:36:03',0,'2015-06-25 02:36:03'),(3060,3,1,'APPURDNC',1,1,'2015-06-25 02:36:03',0,'2015-06-25 02:36:03'),(3061,3,1,'APPURCNC',1,1,'2015-06-25 02:36:03',0,'2015-06-25 02:36:03'),(3062,3,1,'APPAYCFM',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3063,3,1,'APOPWI',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3064,3,1,'APPAYICM',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3065,3,1,'APPURINV',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3066,3,1,'APDIRINV',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3067,3,1,'APDRINVC',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3068,3,1,'APCPYPI',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3069,3,1,'APDRNOTE',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3070,3,1,'APTRETCR',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3071,3,1,'APTRPYIE',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3072,3,1,'APTRPYOE',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3073,3,1,'APPURDNL',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3074,3,1,'APPURCNL',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3075,3,1,'APRPTSTL',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3076,3,1,'MSTRSUPP',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3077,3,1,'APNEWSUP',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3078,3,1,'APNWSHP2',1,1,'2015-06-25 02:36:04',0,'2015-06-25 02:36:04'),(3079,3,1,'INVLOCTR',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3080,3,1,'INVITEMC',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3081,3,1,'INVLOCTC',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3082,3,1,'INVITCC',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3083,3,1,'INVPLNRP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3084,3,1,'INVVALRP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3085,3,1,'INVSTORP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3086,3,1,'INVOUTRP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3087,3,1,'INVMOVRP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3088,3,1,'INVLSTRP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3089,3,1,'IVSTCKCS',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3090,3,1,'LTL',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3091,3,1,'ICAA',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3092,3,1,'ItemDetR',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3093,3,1,'MSLM',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3094,3,1,'ITEMCAT',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3095,3,1,'ITEMTYP',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3096,3,1,'ITEMSET',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3097,3,1,'INVUM',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3098,3,1,'INEDITEM',1,1,'2015-06-25 02:36:06',0,'2015-06-25 02:36:06'),(3099,3,1,'INNWITEM',1,1,'2015-06-25 02:36:07',0,'2015-06-25 02:36:07'),(3100,3,1,'IVUNTMSR',1,1,'2015-06-25 02:36:07',0,'2015-06-25 02:36:07'),(3101,3,1,'OPNBALIN',1,1,'2015-06-25 02:36:07',0,'2015-06-25 02:36:07'),(3102,3,1,'SOQUOT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3103,3,1,'SOTRNWSO',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3104,3,1,'SOTRDO',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3105,3,1,'DELCNFRM',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3106,3,1,'SOTRQOLT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3107,3,1,'SORPPCLT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3108,3,1,'SOTRDOLT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3109,3,1,'SOTRSOLT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3110,3,1,'SORPSOCU',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3111,3,1,'SORPYRSL',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3112,3,1,'SORPSLIT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3113,3,1,'SORPORCT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3114,3,1,'SORPSOIT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3115,3,1,'SORPOROT',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3116,3,1,'SOSTSLPC',1,1,'2015-06-25 02:36:08',0,'2015-06-25 02:36:08'),(3117,3,1,'TXTRPROC',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3118,3,1,'GSBADRLF',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3119,3,1,'BADBTRLC',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3120,3,1,'GSBADBTR',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3121,3,1,'BDEBRCCO',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3122,3,1,'GTSJNL',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3123,3,1,'GSTJCNF',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3124,3,1,'GST03',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3125,3,1,'GSTRPT01',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3126,3,1,'BDRETRPT',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3127,3,1,'BDRCVRPT',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3128,3,1,'GSTRPTSU',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3129,3,1,'GST03SUM',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3130,3,1,'GSTMSTR',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3131,3,1,'GSTCLASS',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3132,3,1,'GSTGROUP',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3133,3,1,'GSTTYPE',1,1,'2015-06-25 02:36:10',0,'2015-06-25 02:36:10'),(3134,3,1,'ZKTTRCAL',1,1,'2015-06-25 02:36:11',0,'2015-06-25 02:36:11'),(3135,3,1,'WKFCAL',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3136,3,1,'ZKTRGPLT',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3137,3,1,'ZKRPCTRL',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3138,3,1,'ZKRPNBLT',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3139,3,1,'ZKRPSMLT',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3140,3,1,'WKFLST',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3141,3,1,'ZKTSTGRP',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3142,3,1,'ZKTSTNSB',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3143,3,1,'ZKTSTNSD',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3144,3,1,'ZKSTCNTR',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3145,3,1,'WKSTMSTR',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3146,3,1,'WCQCNTR',1,1,'2015-06-25 02:36:12',0,'2015-06-25 02:36:12'),(3147,3,1,'PURORDER',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3148,3,1,'PURRCV',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3149,3,1,'PURORDCF',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3150,3,1,'PURRCVC',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3151,3,1,'PURORLST',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3152,3,1,'PURRCVLS',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3153,3,1,'PUROUTGR',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3154,3,1,'PUPRRPT',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3155,3,1,'PURCNCL',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3156,3,1,'PURRCVCA',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3157,3,1,'PURSTSPL',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3158,3,1,'INVPURPR',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3159,3,1,'UMCONVNW',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3160,3,1,'PURUOMLS',1,1,'2015-06-25 02:36:13',0,'2015-06-25 02:36:13'),(3161,3,1,'UM',1,1,'2015-06-25 02:36:14',0,'2015-06-25 02:36:14'),(3162,3,1,'UML',1,1,'2015-06-25 02:36:14',0,'2015-06-25 02:36:14'),(3163,3,1,'MUL',1,1,'2015-06-25 02:36:14',0,'2015-06-25 02:36:14'),(3164,3,1,'LOGRPT',1,1,'2015-06-25 02:36:14',0,'2015-06-25 02:36:14'),(3165,3,1,'UMACCSS',1,1,'2015-06-25 02:36:14',0,'2015-06-25 02:36:14'),(3166,3,1,'ADMMENU',1,1,'2015-06-25 02:36:15',0,'2015-06-25 02:36:15'),(3167,3,1,'USRADD',1,1,'2015-06-25 02:36:15',0,'2015-06-25 02:36:15'),(3168,3,1,'BACKUP',1,1,'2015-06-25 02:36:15',0,'2015-06-25 02:36:15'),(3169,3,1,'updversi',1,1,'2015-06-25 02:36:15',0,'2015-06-25 02:36:15'),(3170,3,1,'upgraden',1,1,'2015-06-25 02:36:15',0,'2015-06-25 02:36:15'),(3171,3,1,'MSTRCOMP',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3172,3,1,'PROJECT',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3173,3,1,'TERM',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3174,3,1,'MSMTRCD',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3175,3,1,'EMP',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3176,3,1,'AGENTSTP',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3177,3,1,'BNKSETUP',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3178,3,1,'ShipToST',1,1,'2015-06-25 02:36:16',0,'2015-06-25 02:36:16'),(3179,3,75,'GTSJNL',1,75,'2015-06-26 08:19:34',0,'2015-06-26 08:19:34'),(3180,3,75,'GSTJCNF',1,75,'2015-06-26 08:19:34',0,'2015-06-26 08:19:34'),(3181,3,75,'GSTRPTSU',1,75,'2015-06-26 08:20:00',1,'2015-07-06 04:57:44'),(3182,3,75,'GST03SUM',1,75,'2015-06-26 08:20:00',1,'2015-07-06 04:57:16'),(3183,3,76,'GTSJNL',1,75,'2015-07-06 04:30:37',0,'2015-07-06 04:30:37'),(3184,3,76,'GSTJCNF',1,75,'2015-07-06 04:30:37',0,'2015-07-06 04:30:37'),(3185,3,76,'GSTRPTSU',1,75,'2015-07-06 04:30:54',0,'2015-07-06 04:30:54'),(3186,3,76,'GST03SUM',1,75,'2015-07-06 04:30:54',76,'2015-12-23 08:37:27'),(3187,3,77,'GTSJNL',1,75,'2015-07-06 04:32:13',0,'2015-07-06 04:32:13'),(3188,3,77,'GSTJCNF',1,75,'2015-07-06 04:32:13',0,'2015-07-06 04:32:13'),(3189,3,77,'GSTRPTSU',1,75,'2015-07-06 04:32:30',0,'2015-07-06 04:32:30'),(3190,3,77,'GST03SUM',1,75,'2015-07-06 04:32:30',0,'2015-07-06 04:32:30'),(3191,3,76,'GSTRTSUM',1,76,'2015-12-23 08:37:28',0,'2015-12-23 08:37:28');

--
-- Temporary view structure for view `view_account_balance`
--

/*!50001 DROP VIEW IF EXISTS `view_account_balance`*/;
/*!50001 CREATE VIEW `view_account_balance` AS SELECT 
 1 AS `companyID`,
 1 AS `acctID`,
 1 AS `acctName`,
 1 AS `year`,
 1 AS `period`,
 1 AS `closing`*/;

--
-- Temporary view structure for view `view_ar_inventory`
--

/*!50001 DROP VIEW IF EXISTS `view_ar_inventory`*/;
/*!50001 CREATE VIEW `view_ar_inventory` AS SELECT 
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `formNo`,
 1 AS `salesinvoiceDate`,
 1 AS `totalReceivable`*/;

--
-- Temporary view structure for view `view_ar_open_position`
--

/*!50001 DROP VIEW IF EXISTS `view_ar_open_position`*/;
/*!50001 CREATE VIEW `view_ar_open_position` AS SELECT 
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `customerName`,
 1 AS `phoneNumber1`,
 1 AS `email`,
 1 AS `due120`,
 1 AS `due90`,
 1 AS `due60`,
 1 AS `due30`,
 1 AS `due0`,
 1 AS `pastDue30`,
 1 AS `pastDue60`,
 1 AS `pastDue90`,
 1 AS `pastDue120`,
 1 AS `pastDue`*/;

--
-- Temporary view structure for view `view_balance_sheet`
--

/*!50001 DROP VIEW IF EXISTS `view_balance_sheet`*/;
/*!50001 CREATE VIEW `view_balance_sheet` AS SELECT 
 1 AS `acctCode`,
 1 AS `acctName`,
 1 AS `acctGroupID`,
 1 AS `currentyeardebit`,
 1 AS `currentyearcredit`,
 1 AS `lastyeardebit`,
 1 AS `lastyearcredit`*/;

--
-- Temporary view structure for view `view_bank_reconcile`
--

/*!50001 DROP VIEW IF EXISTS `view_bank_reconcile`*/;
/*!50001 CREATE VIEW `view_bank_reconcile` AS SELECT 
 1 AS `ID`,
 1 AS `companyid`,
 1 AS `tableName`,
 1 AS `bankid`,
 1 AS `referenceNo`,
 1 AS `transDate`,
 1 AS `formNo`,
 1 AS `description`,
 1 AS `debitAmount`,
 1 AS `creditAmount`*/;

--
-- Temporary view structure for view `view_bank_reconcile_reverse`
--

/*!50001 DROP VIEW IF EXISTS `view_bank_reconcile_reverse`*/;
/*!50001 CREATE VIEW `view_bank_reconcile_reverse` AS SELECT 
 1 AS `bankReconcileID`,
 1 AS `ID`,
 1 AS `companyID`,
 1 AS `tableName`,
 1 AS `bankID`,
 1 AS `referenceNo`,
 1 AS `transDate`,
 1 AS `formNo`,
 1 AS `description`,
 1 AS `debitAmount`,
 1 AS `creditAmount`*/;

--
-- Temporary view structure for view `view_chart_of_acct_updateable`
--

/*!50001 DROP VIEW IF EXISTS `view_chart_of_acct_updateable`*/;
/*!50001 CREATE VIEW `view_chart_of_acct_updateable` AS SELECT 
 1 AS `ID`,
 1 AS `companyID`,
 1 AS `acctGroupID`,
 1 AS `acctCode`,
 1 AS `acctName`,
 1 AS `acctDesc`,
 1 AS `updateable`*/;

--
-- Temporary view structure for view `view_comp_acc_det`
--

/*!50001 DROP VIEW IF EXISTS `view_comp_acc_det`*/;
/*!50001 CREATE VIEW `view_comp_acc_det` AS SELECT 
 1 AS `ID`,
 1 AS `companyID`,
 1 AS `acctGroupID`,
 1 AS `acctID`,
 1 AS `year`,
 1 AS `period`,
 1 AS `amountdr`,
 1 AS `amountcr`,
 1 AS `total`,
 1 AS `createdBy`,
 1 AS `createdTS`,
 1 AS `updatedBy`,
 1 AS `updatedTS`,
 1 AS `is_delete`*/;

--
-- Temporary view structure for view `view_customer_aging`
--

/*!50001 DROP VIEW IF EXISTS `view_customer_aging`*/;
/*!50001 CREATE VIEW `view_customer_aging` AS SELECT 
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `customerName`,
 1 AS `phoneNumber1`,
 1 AS `email`,
 1 AS `current`,
 1 AS `month1`,
 1 AS `month2`,
 1 AS `month3`,
 1 AS `month4`,
 1 AS `month5`,
 1 AS `month6`,
 1 AS `month7`,
 1 AS `month8`,
 1 AS `month9`,
 1 AS `month10`,
 1 AS `month11`*/;

--
-- Temporary view structure for view `view_customer_statement`
--

/*!50001 DROP VIEW IF EXISTS `view_customer_statement`*/;
/*!50001 CREATE VIEW `view_customer_statement` AS SELECT 
 1 AS `ID`,
 1 AS `parent`,
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `transType`,
 1 AS `transDate`,
 1 AS `refNo`,
 1 AS `formNo`,
 1 AS `dr`,
 1 AS `cr`,
 1 AS `seq`*/;

--
-- Temporary view structure for view `view_expence_and_income`
--

/*!50001 DROP VIEW IF EXISTS `view_expence_and_income`*/;
/*!50001 CREATE VIEW `view_expence_and_income` AS SELECT 
 1 AS `companyid`,
 1 AS `year`,
 1 AS `period`,
 1 AS `groupID`,
 1 AS `acctType`,
 1 AS `totalDr`,
 1 AS `totalCr`,
 1 AS `balance`*/;

--
-- Temporary view structure for view `view_gaf`
--

/*!50001 DROP VIEW IF EXISTS `view_gaf`*/;
/*!50001 CREATE VIEW `view_gaf` AS SELECT 
 1 AS `companyID`,
 1 AS `col1`,
 1 AS `col2`,
 1 AS `col3`,
 1 AS `col4`,
 1 AS `col5`,
 1 AS `col6`,
 1 AS `col7`,
 1 AS `col8`,
 1 AS `col9`,
 1 AS `col10`,
 1 AS `col11`,
 1 AS `col12`,
 1 AS `col13`,
 1 AS `col14`*/;

--
-- Temporary view structure for view `view_grn_report`
--

/*!50001 DROP VIEW IF EXISTS `view_grn_report`*/;
/*!50001 CREATE VIEW `view_grn_report` AS SELECT 
 1 AS `companyID`,
 1 AS `unitMesure`,
 1 AS `ID`,
 1 AS `itemCode`,
 1 AS `itemName`,
 1 AS `poNo`,
 1 AS `PoDate`,
 1 AS `unitPrice`,
 1 AS `quantityOrder`,
 1 AS `total`,
 1 AS `totalRcv`,
 1 AS `QtyLeft`,
 1 AS `itemID`*/;

--
-- Temporary view structure for view `view_gst_report`
--

/*!50001 DROP VIEW IF EXISTS `view_gst_report`*/;
/*!50001 CREATE VIEW `view_gst_report` AS SELECT 
 1 AS `companyid`,
 1 AS `gstRegisteredDate`,
 1 AS `taxablePeriod`,
 1 AS `financialYear`,
 1 AS `startDate`,
 1 AS `endDate`,
 1 AS `period`,
 1 AS `A1`,
 1 AS `A2`,
 1 AS `B5a`,
 1 AS `B5b`,
 1 AS `B6a`,
 1 AS `B6b`,
 1 AS `B7`,
 1 AS `B8`,
 1 AS `C10`,
 1 AS `C11`,
 1 AS `C12`,
 1 AS `C13`,
 1 AS `C14`,
 1 AS `C15`,
 1 AS `C16`,
 1 AS `C17`,
 1 AS `month6`,
 1 AS `C18`*/;

--
-- Temporary view structure for view `view_gst_tax`
--

/*!50001 DROP VIEW IF EXISTS `view_gst_tax`*/;
/*!50001 CREATE VIEW `view_gst_tax` AS SELECT 
 1 AS `lineNo`,
 1 AS `companyID`,
 1 AS `taxClass`,
 1 AS `taxClassName`,
 1 AS `taxGroup`,
 1 AS `taxGroupName`,
 1 AS `taxType`,
 1 AS `taxTypeName`,
 1 AS `transType`,
 1 AS `ref`,
 1 AS `transDate`,
 1 AS `customerID`,
 1 AS `customerName`,
 1 AS `itemName`,
 1 AS `amountExcludedTax`,
 1 AS `taxRate`,
 1 AS `taxAmount`,
 1 AS `amountIncludedTax`,
 1 AS `taxID`,
 1 AS `gst`,
 1 AS `journalID`,
 1 AS `formNo`*/;

--
-- Temporary view structure for view `view_inventory_statement`
--

/*!50001 DROP VIEW IF EXISTS `view_inventory_statement`*/;
/*!50001 CREATE VIEW `view_inventory_statement` AS SELECT 
 1 AS `companyID`,
 1 AS `transactionDate`,
 1 AS `itemID`,
 1 AS `name`,
 1 AS `supplierCustomer`,
 1 AS `transactionCode`,
 1 AS `transactionType`,
 1 AS `formNo`,
 1 AS `locationID`,
 1 AS `location`,
 1 AS `unitOfMeasure`,
 1 AS `quantityIn`,
 1 AS `quantityOut`,
 1 AS `updateable`*/;

--
-- Temporary view structure for view `view_inventory_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_inventory_transaction`*/;
/*!50001 CREATE VIEW `view_inventory_transaction` AS SELECT 
 1 AS `indexing`,
 1 AS `ID`,
 1 AS `companyID`,
 1 AS `itemID`,
 1 AS `locationID`,
 1 AS `createdTS`,
 1 AS `supplierName`,
 1 AS `formNo`,
 1 AS `transDate`,
 1 AS `um`,
 1 AS `transType`,
 1 AS `qtyIn`,
 1 AS `qtyOut`*/;

--
-- Temporary view structure for view `view_inventorylist_subtotal`
--

/*!50001 DROP VIEW IF EXISTS `view_inventorylist_subtotal`*/;
/*!50001 CREATE VIEW `view_inventorylist_subtotal` AS SELECT 
 1 AS `companyid`,
 1 AS `quantity`,
 1 AS `locationid`,
 1 AS `itemID`,
 1 AS `itemName`,
 1 AS `category`,
 1 AS `description`,
 1 AS `stockValue`*/;

--
-- Temporary view structure for view `view_item_details`
--

/*!50001 DROP VIEW IF EXISTS `view_item_details`*/;
/*!50001 CREATE VIEW `view_item_details` AS SELECT 
 1 AS `companyid`,
 1 AS `itemid`,
 1 AS `itemName`,
 1 AS `description`,
 1 AS `locationid`,
 1 AS `onHandQty`,
 1 AS `umID`,
 1 AS `acctID`,
 1 AS `location`,
 1 AS `unitOfMeasure`*/;

--
-- Temporary view structure for view `view_item_quantityonhand`
--

/*!50001 DROP VIEW IF EXISTS `view_item_quantityonhand`*/;
/*!50001 CREATE VIEW `view_item_quantityonhand` AS SELECT 
 1 AS `companyID`,
 1 AS `locationID`,
 1 AS `itemID`,
 1 AS `itemCode`,
 1 AS `itemName`,
 1 AS `umID`,
 1 AS `quantityOnHand`*/;

--
-- Temporary view structure for view `view_item_quantityonhand_confirm`
--

/*!50001 DROP VIEW IF EXISTS `view_item_quantityonhand_confirm`*/;
/*!50001 CREATE VIEW `view_item_quantityonhand_confirm` AS SELECT 
 1 AS `companyID`,
 1 AS `locationID`,
 1 AS `itemID`,
 1 AS `itemCode`,
 1 AS `itemName`,
 1 AS `umID`,
 1 AS `quantityOnHand`*/;

--
-- Temporary view structure for view `view_journal_table`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_table`*/;
/*!50001 CREATE VIEW `view_journal_table` AS SELECT 
 1 AS `ID`,
 1 AS `companyID`,
 1 AS `referenceNo`,
 1 AS `tableName`,
 1 AS `journalID`,
 1 AS `formNo`*/;

--
-- Temporary view structure for view `view_open_ar_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_open_ar_invoice`*/;
/*!50001 CREATE VIEW `view_open_ar_invoice` AS SELECT 
 1 AS `companyID`,
 1 AS `salesInvoiceDate`,
 1 AS `salesYear`,
 1 AS `salesMonth`,
 1 AS `slsMonth`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_salescreditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_salescreditnote`*/;
/*!50001 CREATE VIEW `view_salescreditnote` AS SELECT 
 1 AS `invoiceDetailID`,
 1 AS `unitOfMeasure`,
 1 AS `ID`,
 1 AS `invoiceID`,
 1 AS `doID`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `unitPrice`,
 1 AS `amountExcludedTax`,
 1 AS `taxID`,
 1 AS `taxRate`,
 1 AS `taxAmount`,
 1 AS `amountIncludedTax`,
 1 AS `accountID`,
 1 AS `createdBy`,
 1 AS `createdTS`,
 1 AS `updatedBy`,
 1 AS `updatedTS`,
 1 AS `code`,
 1 AS `itemCode`,
 1 AS `name`,
 1 AS `description`,
 1 AS `exactQty`*/;

--
-- Temporary view structure for view `view_salesdebitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_salesdebitnote`*/;
/*!50001 CREATE VIEW `view_salesdebitnote` AS SELECT 
 1 AS `invoiceDetailID`,
 1 AS `unitOfMeasure`,
 1 AS `ID`,
 1 AS `invoiceID`,
 1 AS `doID`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `unitPrice`,
 1 AS `amountExcludedTax`,
 1 AS `taxID`,
 1 AS `taxRate`,
 1 AS `taxAmount`,
 1 AS `amountIncludedTax`,
 1 AS `accountID`,
 1 AS `createdBy`,
 1 AS `createdTS`,
 1 AS `updatedBy`,
 1 AS `updatedTS`,
 1 AS `code`,
 1 AS `itemCode`,
 1 AS `name`,
 1 AS `description`,
 1 AS `exactQty`*/;

--
-- Temporary view structure for view `view_search`
--

/*!50001 DROP VIEW IF EXISTS `view_search`*/;
/*!50001 CREATE VIEW `view_search` AS SELECT 
 1 AS `ID`,
 1 AS `companyID`,
 1 AS `searchLink`,
 1 AS `searchKey`,
 1 AS `transDate`*/;

--
-- Temporary view structure for view `view_serial_comp_cash_sales`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_cash_sales`*/;
/*!50001 CREATE VIEW `view_serial_comp_cash_sales` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_delivery_order`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_delivery_order`*/;
/*!50001 CREATE VIEW `view_serial_comp_delivery_order` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_gst_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_gst_transaction`*/;
/*!50001 CREATE VIEW `view_serial_comp_gst_transaction` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_historical_customer_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_historical_customer_invoice`*/;
/*!50001 CREATE VIEW `view_serial_comp_historical_customer_invoice` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_historical_supplier_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_historical_supplier_invoice`*/;
/*!50001 CREATE VIEW `view_serial_comp_historical_supplier_invoice` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_location_transfer`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_location_transfer`*/;
/*!50001 CREATE VIEW `view_serial_comp_location_transfer` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_payment`*/;
/*!50001 CREATE VIEW `view_serial_comp_payment` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_payment_others`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_payment_others`*/;
/*!50001 CREATE VIEW `view_serial_comp_payment_others` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_purchase_order`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_purchase_order`*/;
/*!50001 CREATE VIEW `view_serial_comp_purchase_order` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_quotation`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_quotation`*/;
/*!50001 CREATE VIEW `view_serial_comp_quotation` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_receive_item`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_item`*/;
/*!50001 CREATE VIEW `view_serial_comp_receive_item` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_receive_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_payment`*/;
/*!50001 CREATE VIEW `view_serial_comp_receive_payment` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_receive_payment_others`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_payment_others`*/;
/*!50001 CREATE VIEW `view_serial_comp_receive_payment_others` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_sales_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_creditnote`*/;
/*!50001 CREATE VIEW `view_serial_comp_sales_creditnote` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_sales_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_debitnote`*/;
/*!50001 CREATE VIEW `view_serial_comp_sales_debitnote` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_sales_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_invoice`*/;
/*!50001 CREATE VIEW `view_serial_comp_sales_invoice` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_sales_order`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_order`*/;
/*!50001 CREATE VIEW `view_serial_comp_sales_order` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_supplier_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_creditnote`*/;
/*!50001 CREATE VIEW `view_serial_comp_supplier_creditnote` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_supplier_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_debitnote`*/;
/*!50001 CREATE VIEW `view_serial_comp_supplier_debitnote` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_serial_comp_supplier_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_invoice`*/;
/*!50001 CREATE VIEW `view_serial_comp_supplier_invoice` AS SELECT 
 1 AS `companyID`,
 1 AS `nextSerialNo`*/;

--
-- Temporary view structure for view `view_supplier_aging`
--

/*!50001 DROP VIEW IF EXISTS `view_supplier_aging`*/;
/*!50001 CREATE VIEW `view_supplier_aging` AS SELECT 
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `current`,
 1 AS `month1`,
 1 AS `month2`,
 1 AS `month3`,
 1 AS `month4`,
 1 AS `month5`,
 1 AS `month6`,
 1 AS `month7`,
 1 AS `month8`,
 1 AS `month9`,
 1 AS `month10`,
 1 AS `month11`*/;

--
-- Temporary view structure for view `view_supplier_statement`
--

/*!50001 DROP VIEW IF EXISTS `view_supplier_statement`*/;
/*!50001 CREATE VIEW `view_supplier_statement` AS SELECT 
 1 AS `ID`,
 1 AS `parent`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `transType`,
 1 AS `transDate`,
 1 AS `refNo`,
 1 AS `formNo`,
 1 AS `dr`,
 1 AS `cr`,
 1 AS `seq`*/;

--
-- Temporary view structure for view `view_suppliercreditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_suppliercreditnote`*/;
/*!50001 CREATE VIEW `view_suppliercreditnote` AS SELECT 
 1 AS `invoiceDetailID`,
 1 AS `invoiceUm`,
 1 AS `ID`,
 1 AS `invoiceID`,
 1 AS `receiveID`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `itemname`,
 1 AS `itemdescription`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `unitPrice`,
 1 AS `amountExcludedTax`,
 1 AS `taxID`,
 1 AS `taxRate`,
 1 AS `taxAmount`,
 1 AS `amountIncludedTax`,
 1 AS `accountID`,
 1 AS `createdBy`,
 1 AS `createdTS`,
 1 AS `updatedBy`,
 1 AS `updatedTS`,
 1 AS `exactQty`,
 1 AS `unitOfMeasure`,
 1 AS `receiveDetailID`,
 1 AS `code`,
 1 AS `itemCode`,
 1 AS `name`,
 1 AS `description`*/;

--
-- Temporary view structure for view `view_supplierdebitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_supplierdebitnote`*/;
/*!50001 CREATE VIEW `view_supplierdebitnote` AS SELECT 
 1 AS `invoiceDetailID`,
 1 AS `ID`,
 1 AS `invoiceID`,
 1 AS `receiveID`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `itemname`,
 1 AS `itemdescription`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `unitPrice`,
 1 AS `amountExcludedTax`,
 1 AS `taxID`,
 1 AS `taxRate`,
 1 AS `taxAmount`,
 1 AS `amountIncludedTax`,
 1 AS `accountID`,
 1 AS `createdBy`,
 1 AS `createdTS`,
 1 AS `updatedBy`,
 1 AS `updatedTS`,
 1 AS `unitOfMeasure`,
 1 AS `receiveDetailID`,
 1 AS `code`,
 1 AS `itemCode`,
 1 AS `name`,
 1 AS `description`,
 1 AS `exactQty`*/;

--
-- Temporary view structure for view `view_total_comp_sales_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_creditnote`*/;
/*!50001 CREATE VIEW `view_total_comp_sales_creditnote` AS SELECT 
 1 AS `ID`,
 1 AS `totalTaxAmount`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_total_comp_sales_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_debitnote`*/;
/*!50001 CREATE VIEW `view_total_comp_sales_debitnote` AS SELECT 
 1 AS `ID`,
 1 AS `totalTaxAmount`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_total_comp_sales_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_invoice`*/;
/*!50001 CREATE VIEW `view_total_comp_sales_invoice` AS SELECT 
 1 AS `ID`,
 1 AS `totalTaxAmount`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_total_comp_supplier_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_creditnote`*/;
/*!50001 CREATE VIEW `view_total_comp_supplier_creditnote` AS SELECT 
 1 AS `ID`,
 1 AS `totalTaxAmount`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_total_comp_supplier_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_debitnote`*/;
/*!50001 CREATE VIEW `view_total_comp_supplier_debitnote` AS SELECT 
 1 AS `ID`,
 1 AS `totalTaxAmount`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_total_comp_supplier_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_invoice`*/;
/*!50001 CREATE VIEW `view_total_comp_supplier_invoice` AS SELECT 
 1 AS `ID`,
 1 AS `totalTaxAmount`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_transaction_summary`
--

/*!50001 DROP VIEW IF EXISTS `view_transaction_summary`*/;
/*!50001 CREATE VIEW `view_transaction_summary` AS SELECT 
 1 AS `tableName`,
 1 AS `transID`,
 1 AS `companyid`,
 1 AS `year`,
 1 AS `Jan`,
 1 AS `Feb`,
 1 AS `Mar`,
 1 AS `Apr`,
 1 AS `may`,
 1 AS `Jun`,
 1 AS `Jul`,
 1 AS `Aug`,
 1 AS `Sept`,
 1 AS `Oct`,
 1 AS `Nov`,
 1 AS `Dec`*/;

--
-- Temporary view structure for view `view_unpost_ap_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_creditnote`*/;
/*!50001 CREATE VIEW `view_unpost_ap_creditnote` AS SELECT 
 1 AS `supplier`,
 1 AS `creditnoteID`,
 1 AS `lineNo`,
 1 AS `projectID`,
 1 AS `supplierInvoiceID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `supplierInvoiceNo`,
 1 AS `locationID`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `itemID`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`*/;

--
-- Temporary view structure for view `view_unpost_ap_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_debitnote`*/;
/*!50001 CREATE VIEW `view_unpost_ap_debitnote` AS SELECT 
 1 AS `supplier`,
 1 AS `debitnoteID`,
 1 AS `lineNo`,
 1 AS `projectID`,
 1 AS `typeID`,
 1 AS `typeDetailID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `supplierInvoiceNo`,
 1 AS `locationID`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `itemID`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`,
 1 AS `cogsAcctID`,
 1 AS `inventoriesAcctID`*/;

--
-- Temporary view structure for view `view_unpost_ap_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_invoice`*/;
/*!50001 CREATE VIEW `view_unpost_ap_invoice` AS SELECT 
 1 AS `supplier`,
 1 AS `invoiceID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`*/;

--
-- Temporary view structure for view `view_unpost_ar_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_creditnote`*/;
/*!50001 CREATE VIEW `view_unpost_ar_creditnote` AS SELECT 
 1 AS `customer`,
 1 AS `salesinvoiceID`,
 1 AS `creditnoteID`,
 1 AS `projectID`,
 1 AS `typeID`,
 1 AS `typeDetailID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `locationID`,
 1 AS `salesInvoiceNo`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`,
 1 AS `cogsAcctID`,
 1 AS `inventoriesAcctID`*/;

--
-- Temporary view structure for view `view_unpost_ar_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_debitnote`*/;
/*!50001 CREATE VIEW `view_unpost_ar_debitnote` AS SELECT 
 1 AS `customer`,
 1 AS `salesinvoiceID`,
 1 AS `debitnoteID`,
 1 AS `projectID`,
 1 AS `typeID`,
 1 AS `typeDetailID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `locationID`,
 1 AS `salesInvoiceNo`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `umID`,
 1 AS `quantity`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `currencyID`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`,
 1 AS `cogsAcctID`,
 1 AS `inventoriesAcctID`*/;

--
-- Temporary view structure for view `view_unpost_ar_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_invoice`*/;
/*!50001 CREATE VIEW `view_unpost_ar_invoice` AS SELECT 
 1 AS `projectID`,
 1 AS `customer`,
 1 AS `invoiceID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `itemID`,
 1 AS `lineNo`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`*/;

--
-- Temporary view structure for view `view_unpost_ar_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_payment`*/;
/*!50001 CREATE VIEW `view_unpost_ar_payment` AS SELECT 
 1 AS `paymentID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `customerID`,
 1 AS `purchaseInvoiceID`,
 1 AS `customerName`,
 1 AS `lineNo`,
 1 AS `paymentDetailID`,
 1 AS `item`,
 1 AS `amtPaid_amtAppl`,
 1 AS `discount_bankCharges`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drDiscountAccountID`,
 1 AS `crDiscountAccountID`*/;

--
-- Temporary view structure for view `view_unpost_cash_purchase`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_cash_purchase`*/;
/*!50001 CREATE VIEW `view_unpost_cash_purchase` AS SELECT 
 1 AS `lineNo`,
 1 AS `quantity`,
 1 AS `unitPrice`,
 1 AS `itemID`,
 1 AS `itemdescription`,
 1 AS `umID`,
 1 AS `locationID`,
 1 AS `othersPaymentID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `purchaseInvoiceID`,
 1 AS `paymentDetailID`,
 1 AS `supplierInvoiceNo`,
 1 AS `ID`,
 1 AS `itemName`,
 1 AS `amountExcludedTax`,
 1 AS `taxid`,
 1 AS `taxAmount`,
 1 AS `projectID`,
 1 AS `itemTypeID`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drDiscountAccountID`,
 1 AS `crDiscountAccountID`*/;

--
-- Temporary view structure for view `view_unpost_cash_sale`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_cash_sale`*/;
/*!50001 CREATE VIEW `view_unpost_cash_sale` AS SELECT 
 1 AS `projectID`,
 1 AS `customer`,
 1 AS `invoiceID`,
 1 AS `typeID`,
 1 AS `typeDetailID`,
 1 AS `locationID`,
 1 AS `quantity`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `itemID`,
 1 AS `umID`,
 1 AS `lineNo`,
 1 AS `currencyID`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`,
 1 AS `cogsAcctID`,
 1 AS `inventoriesAcctID`*/;

--
-- Temporary view structure for view `view_unpost_do`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_do`*/;
/*!50001 CREATE VIEW `view_unpost_do` AS SELECT 
 1 AS `deliveryOrderID`,
 1 AS `customerID`,
 1 AS `projectID`,
 1 AS `customer`,
 1 AS `invoiceID`,
 1 AS `typeID`,
 1 AS `typeDetailID`,
 1 AS `locationID`,
 1 AS `quantity`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `itemID`,
 1 AS `itemName`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`,
 1 AS `cogsAcctID`,
 1 AS `inventoriesAcctID`*/;

--
-- Temporary view structure for view `view_unpost_gst_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_gst_transaction`*/;
/*!50001 CREATE VIEW `view_unpost_gst_transaction` AS SELECT 
 1 AS `paymentID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `purchaseInvoiceID`,
 1 AS `supplierName`,
 1 AS `lineNo`,
 1 AS `paymentDetailID`,
 1 AS `supplierInvoiceNo`,
 1 AS `item`,
 1 AS `amtPaid_amtAppl`,
 1 AS `discount_bankCharges`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drDiscountAccountID`,
 1 AS `crDiscountAccountID`*/;

--
-- Temporary view structure for view `view_unpost_other_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_other_payment`*/;
/*!50001 CREATE VIEW `view_unpost_other_payment` AS SELECT 
 1 AS `othersPaymentID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `purchaseInvoiceID`,
 1 AS `paymentDetailID`,
 1 AS `supplierInvoiceNo`,
 1 AS `lineNo`,
 1 AS `itemdescription`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`*/;

--
-- Temporary view structure for view `view_unpost_other_receive`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_other_receive`*/;
/*!50001 CREATE VIEW `view_unpost_other_receive` AS SELECT 
 1 AS `projectID`,
 1 AS `receiveFrom`,
 1 AS `otherReceiveID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `NULL`,
 1 AS `itemdescription`,
 1 AS `amountExcludedtax`,
 1 AS `taxid`,
 1 AS `taxamount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drTaxAccountID`,
 1 AS `crTaxAccountID`*/;

--
-- Temporary view structure for view `view_unpost_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_payment`*/;
/*!50001 CREATE VIEW `view_unpost_payment` AS SELECT 
 1 AS `paymentID`,
 1 AS `formNo`,
 1 AS `companyID`,
 1 AS `supplierID`,
 1 AS `purchaseInvoiceID`,
 1 AS `supplierName`,
 1 AS `lineNo`,
 1 AS `paymentDetailID`,
 1 AS `supplierInvoiceNo`,
 1 AS `item`,
 1 AS `amtPaid_amtAppl`,
 1 AS `discount_bankCharges`,
 1 AS `drAccountID`,
 1 AS `crAccountID`,
 1 AS `drDiscountAccountID`,
 1 AS `crDiscountAccountID`*/;

--
-- Temporary view structure for view `view_unpost_receive_item`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_receive_item`*/;
/*!50001 CREATE VIEW `view_unpost_receive_item` AS SELECT 
 1 AS `receiveID`,
 1 AS `companyID`,
 1 AS `locationID`,
 1 AS `transactionDate`,
 1 AS `supplierID`,
 1 AS `formNo`,
 1 AS `lineNo`,
 1 AS `itemID`,
 1 AS `itemName`,
 1 AS `exchangeRate`,
 1 AS `unitPrice`,
 1 AS `quantityReceived`,
 1 AS `umID`,
 1 AS `amount`,
 1 AS `drAccountID`,
 1 AS `crAccountID`*/;

--
-- Temporary view structure for view `view_wakaf_accrual`
--

/*!50001 DROP VIEW IF EXISTS `view_wakaf_accrual`*/;
/*!50001 CREATE VIEW `view_wakaf_accrual` AS SELECT 
 1 AS `companyID`,
 1 AS `acctID`,
 1 AS `year`,
 1 AS `totalAmount`*/;

--
-- Temporary view structure for view `view_wakaf_from_profit`
--

/*!50001 DROP VIEW IF EXISTS `view_wakaf_from_profit`*/;
/*!50001 CREATE VIEW `view_wakaf_from_profit` AS SELECT 
 1 AS `companyid`,
 1 AS `year`,
 1 AS `acctType`,
 1 AS `totalDr`,
 1 AS `totalCr`*/;

--
-- Table structure for table `wakaf`
--

CREATE TABLE `wakaf` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `waqifID` int(11) NOT NULL COMMENT 'link to mastercode',
  `wakafCenterID` int(11) NOT NULL,
  `allocation` tinyint(4) NOT NULL COMMENT '0=lumpsum,1=percentage',
  `periodYear` smallint(6) NOT NULL,
  `periodFrom` tinyint(4) NOT NULL,
  `periodTo` tinyint(4) NOT NULL,
  `amountAllocated` double NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `is_delete` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `wakaf`
--


--
-- Table structure for table `wakaf_acrual`
--

CREATE TABLE `wakaf_acrual` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL,
  `salesAccountID` int(11) NOT NULL,
  `from` date NOT NULL,
  `to` date NOT NULL,
  `wakafPercent` decimal(10,0) NOT NULL,
  `createdBy` int(11) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `wakaf_acrual`
--


--
-- Table structure for table `wakaf_beneficiaries`
--

CREATE TABLE `wakaf_beneficiaries` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `shortName` varchar(12) NOT NULL DEFAULT '0',
  `name` varchar(128) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `wakaf_beneficiaries`
--


--
-- Table structure for table `wakaf_center`
--

CREATE TABLE `wakaf_center` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `shortName` varchar(12) NOT NULL DEFAULT '0',
  `name` varchar(128) NOT NULL,
  `line1` varchar(128) NOT NULL,
  `line2` varchar(128) NOT NULL,
  `line3` varchar(128) NOT NULL,
  `city` varchar(64) NOT NULL,
  `postCode` varchar(8) NOT NULL,
  `stateID` int(11) NOT NULL,
  `countryID` int(11) NOT NULL,
  `noTel` varchar(50) NOT NULL,
  `noFax` varchar(50) NOT NULL,
  `email` varchar(128) NOT NULL,
  `website` varchar(128) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  `is_delete` smallint(16) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `wakaf_center`
--

INSERT INTO `wakaf_center` VALUES (1,'MAIPS','Baitulmal Unit Wakaf, Majlis Agama Islam dan Adat Istiadat Melayu Perlis','A2,','Taman Pengkalan Asam,','Jalan Kangar- Alor Setar','Kangar','01000',1928,458,'','','','','2015-04-20 03:30:14',0,0,'0000-00-00 00:00:00',0),(2,'MAIKS','Bahagian Wakaf, Majlis Agama Islam Negeri Kedah','','Bangunan Wan Mat Saman','','Alor Setar','05000',1923,458,'','','','','2015-04-20 03:30:14',0,0,'0000-00-00 00:00:00',0),(3,'MAINPP','Bahagian Wakaf, Majlis Agama Islam Pulau Pinang','Tingkat 8 & 9','Menara UMNO,','128 Jalan Macalister','','10400',1929,458,'','','','','2015-04-20 03:30:14',0,0,'0000-00-00 00:00:00',0),(4,'MAIAMP','Majlis Agama Islam dan Adat Melayu Perak','Tingkat 1','Kompleks Islam Darul Ridzuan,','Jalan Panglima BUkit Gantang Wahab','Ipoh','30000',0,458,'034567894','','','','2015-04-20 03:30:14',0,1,'0000-00-00 00:00:00',0),(5,'MAIWP','Bahagian Baitulmal Majlis Agama Islam Wilayah Persekutuan ','Bangunan Daruzzakah Lorong Haji Hussein 2 ','','',' KUALA LUMPUR','50676',1933,458,'603-2617 5222','603-2617 5252','baitulmal@maiwp.gov.my','http://www.maiwp.gov.my/','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(6,'MAIS(PWS)','Perbadanan Wakaf Selangor Majlis Agama Islam Selangor','Tingkat 10 Menara Selatan,',' Bangunan Sultan Idris Shah','','Shah Alam',' 40000 ',1931,458,'603-5514 3758 / 3759','603-5514 3759','wakaf@wakafselangor.gov.my','www.wakafselangor.gov.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(7,'MAIM','Majlis Agama Islam Melaka','Pusat Islam Melaka ','Bukit Palah','','Melaka','75400 ',1924,458,'606-283 7416, 283 2077, 284 9809','606-282 6033','admin@maim.gov.my','www.maim.gov.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(8,'MAIJ','Pejabat Wakaf Majlis Agama Islam Negeri Johor','Jalan Abdul Rahman Andak','','','Johor Bahru','80100',1921,458,'607-2221655','607-2221677','wakaf@maij.gov.my','www.maij.gov.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(9,'MAIK','Majlis Agama Islam Dan Adat Istiadat Melayu Kelantan','Kompleks Balai Islam  Lundang','','','Kota Bharu','15200',1923,458,'609-7481512 ','609-7485512','maik@e-maik.my','www.e-maik.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(10,'MAIDAM','Majlis Agama Islam dan Adat Melayu Terengganu','Pusat Pentadbiran Islam Negeri','Kompleks Seri Iman','Jalan Sultan Mohamad','Kuala Terengganu','20676 ',1932,458,'609-6303030 / 6252525','609-6248134 / 6235185',' info@maidam.gov.my','www.maidam.gov.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(11,'MUIP','Majlis Ugama Islam Dan Adat Resam Melayu Pahang','Kompleks Islam Sultan Haji Ahmad Shah',' Jalan Istana Permai','',' Pekan','26600',1926,458,'609-4221311','609-4221885','info@muip.gov.my','www.muip.gov.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(12,'TBS','Tabung Baitulmal Majlis Islam Sarawak','Tabung Baitulmal Sarawak Bangunan Baitulmal',' Lot 71, Seksyen 8, KTLD',' Jalan Haji Muhamad Kassim','Kuching','93400 ',1930,458,' 6082-415563',' 6082-253786','','www.tbs.org.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(13,'MUIS','Pusat Zakat Sabah Majlis Ugama Islam Sabah','Tingkat 1, Blok A & B','Wisma MUIS','Peti Surat 11666','Kota Kibabalu','88818',1935,458,'6088-240 160','6088-260 246','','www.zakat@sabah.gov.my','2015-04-20 03:30:14',0,16,'0000-00-00 00:00:00',0),(14,'JWM','Yayasan Waqaf Malaysia','No. 13, Jalan Diplomatik 2/2','Presint Diplomatik Putrajaya','',' Putrajaya',' 62050',0,458,'603-8890 4071 / 72 / 73','603-8890 1010 / 2091',' info@ywm.gov.my','www.ywm.gov.my','2015-04-20 03:30:14',0,29,'0000-00-00 00:00:00',0);

--
-- Table structure for table `wakaf_details_allocation`
--

CREATE TABLE `wakaf_details_allocation` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `wakafID` varchar(64) NOT NULL DEFAULT '0',
  `accountID` int(11) NOT NULL,
  `saleAmount` double NOT NULL,
  `contributionPercentage` double NOT NULL,
  `amount` double NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `wakaf_details_allocation`
--


--
-- Table structure for table `wakaf_details_distribution`
--

CREATE TABLE `wakaf_details_distribution` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `wakafID` varchar(64) NOT NULL DEFAULT '0',
  `beneficiariesID` int(11) NOT NULL,
  `description` varchar(128) NOT NULL,
  `contributionPercentage` double NOT NULL,
  `amount` double NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `wakaf_details_distribution`
--


--
-- Table structure for table `wakaf_master`
--

CREATE TABLE `wakaf_master` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL DEFAULT '0',
  `waqif` varchar(64) NOT NULL DEFAULT '0',
  `category` varchar(24) NOT NULL,
  `allocationID` int(11) NOT NULL,
  `beneficiariesID` int(11) NOT NULL,
  `description` varchar(128) NOT NULL,
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `wakaf_master`
--


--
-- Table structure for table `zakat_center`
--

CREATE TABLE `zakat_center` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `shortName` varchar(12) NOT NULL DEFAULT '0',
  `name` varchar(128) NOT NULL,
  `line1` varchar(128) NOT NULL,
  `line2` varchar(128) NOT NULL,
  `line3` varchar(128) NOT NULL,
  `city` varchar(64) NOT NULL,
  `postCode` varchar(8) NOT NULL,
  `stateID` int(11) NOT NULL,
  `countryID` int(11) NOT NULL,
  `noTel` varchar(50) NOT NULL,
  `noFax` varchar(50) NOT NULL,
  `email` varchar(128) NOT NULL,
  `website` varchar(128) NOT NULL,
  `is_delete` tinyint(4) NOT NULL DEFAULT '0',
  `createdTS` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `updatedTS` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `zakat_center`
--

INSERT INTO `zakat_center` VALUES (1,'LZS','Lembaga Zakat Selangor','3-01-1, Presint ALAMi,','Pusat Perniagaan Worldwide 2, ','Persiaran Akuatik, Seksyen 13, ','Shah Alam','40100',1931,458,'03-5522 7700','03-5522 7722','','http://www.e-zakat.com.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(2,'PPZ','Pusat Pungutan Zakat, Majlis Agama Islam Wilayah Persekutuan','xx','','','Kuala Lumpur','12345678',1933,458,'+603.9289.5757','+603.9289.5758','info@zakat.com.my','http://www.zakat.com.my/',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(7,'MAIPS','Majlis Agama Islam & Adat Istiadat Melayu Perlis','A2, Taman Pengkalan Asam','Jalan Kangar- Alor Setar','','Kangar','01000',1928,458,'04-9794439','04-9782400','','www.maips.gov.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(8,'JZNK','Jabatan Zakat Negeri Kedah','Jabatan Zakat Negeri Kedah Darulaman Aras 3',' Menara Zakat','Jalan Teluk Wanjah','Alor Setar','05000',1922,458,'04-733 1740','','','',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(9,'MAIK','Majlis Agama Islam Dan Adat Istiadat Melayu Kelantan','Kompleks Balai Islam Lundang','','','Kota Bharu','15200',1923,458,'09 7481512','09 7485512','maik@e-maik.my','www.e-maik.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(10,'PZM','Pusat Zakat Melaka','No. 1 & 3,Jalan KPAA 1',' Kompleks Perniagaan Al-Azim ','','Bukit Baru','75150',1924,458,'1-300-88-0233','06-2818154','',' www.izakat.com',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(11,'MAINS','Pusat Zakat Negeri Sembilan','No. 25, Betaria Business Centre','Jalan Durian Emas 4','Off Jalan Dato\' Siamang Gagap','Seremban','70100 ',1925,458,'06-765 1402 ','06-765 1407','info@zakatns.com.my','www.zakatns.com.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(12,'MAIPk',' MAJLIS AGAMA ISLAM DAN ADAT MELAYU PERAK','Tingkat 1, Kompleks Islam Darul Ridzuan','Jalan Panglima BUkit Gantang Wahab','','Ipoh','30000',1927,458,'05-208 400',' 05-241 4257','korporat@maiamp.gov.my','www.maiamp.gov.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(13,'MUIP','Majlis Ugama Islam Dan Adat Resam Melayu Pahang','No.111A, Tingkat 1 ','Bangunan MUIP','Jalan Mahkota','Kuantan','25000 ',1926,458,'09-5131515',' 09-5152541','info@muip.gov.my','www.zakatpahang.my/v2',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(14,'ZPP','Zakat Pulau Pinang','No.4 Jalan Perda Selatan','Bandar Perda','','Bukit Mertajam','14000 ',1929,458,'04-549 8088','04 530 6466','admin@zakatpenang.com','www.zakatpenang.com',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(15,'MAIDAM','Majlis Agama Islam dan Adat Melayu Terengganu','Pusat Pentadbiran Islam Negeri','Kompleks Seri Iman',' Jalan Sultan Mohamad',' Kuala Terengganu','20676 ',1932,458,'09-6303030 / 09-6252525','09-6248134 / 09-6235185','info@maidam.gov.my','www.maidam.gov.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(16,'MUIS','Pusat Zakat Sabah','Tingkat 1, Blok A & B','Wisma MUIS','Peti Surat 11666','Kota Kinabalu','88818 ',1935,458,'088-240 160','088-260 246','www.zakat@sabah.gov.my','www.zakat.sabah.gov.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(17,'TBS','Tabung Baitulmal Sarawak','Bangunan Baitulmal','Lot 71, Seksyen 8, KTLD','Jalan Haji Muhamad Kassim','Kuching','93400 ',1930,458,'082-415563','082-253786','admin@tbs.org.my','www.tbs.org.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00'),(18,'MAIJ','Majlis Agama Islam Negeri Johor','Aras 5, Blok ÈÃ BÈÃÍ, Pusat Islam Iskandar Johor',' Jalan Masjid Abu Bakar','Karung Berkunci 725',' Johor Bahru','80990',1921,458,'07-2282929 / 07-2282937','07-2238752 / 07-2275173','zakat@maij.gov.my','www.maij.gov.my',0,'2015-04-20 03:30:14',1,0,'0000-00-00 00:00:00');

--
-- Table structure for table `zakat_details`
--

CREATE TABLE `zakat_details` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `zakatSummaryID` int(11) NOT NULL,
  `compAcctDetailID` int(11) NOT NULL,
  `acctGroup` varchar(64) DEFAULT NULL,
  `desc` varchar(64) DEFAULT NULL,
  `amount` double DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) DEFAULT NULL,
  `updatedTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `zakat_details`
--


--
-- Table structure for table `zakat_group`
--

CREATE TABLE `zakat_group` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL DEFAULT '1',
  `name` varchar(50) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `parentID` int(11) DEFAULT '0',
  `sequence` int(11) DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) DEFAULT NULL,
  `updatedTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `zakat_group`
--


--
-- Table structure for table `zakat_group_details`
--

CREATE TABLE `zakat_group_details` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL DEFAULT '1',
  `groupID` int(11) DEFAULT NULL,
  `acctID` int(11) DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) DEFAULT NULL,
  `updatedTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `zakat_group_details`
--


--
-- Table structure for table `zakat_nisab`
--

CREATE TABLE `zakat_nisab` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL DEFAULT '0',
  `centerID` int(11) DEFAULT NULL,
  `year` year(4) DEFAULT NULL,
  `nisab` double DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) DEFAULT NULL,
  `updatedTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `zakat_nisab`
--


--
-- Table structure for table `zakat_summary`
--

CREATE TABLE `zakat_summary` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `companyID` int(11) NOT NULL DEFAULT '1',
  `centerID` int(11) NOT NULL DEFAULT '1',
  `year` varchar(4) DEFAULT NULL,
  `calculationMethod` varchar(32) NOT NULL,
  `muslimOwnershipShare` double NOT NULL,
  `nisab` double NOT NULL,
  `netCurrentAsset` double NOT NULL,
  `totalDueForZakat` double NOT NULL,
  `zakatPayableForTheYear` double NOT NULL,
  `monthlyZakatPayable` double NOT NULL,
  `totalAmount` double DEFAULT NULL,
  `totalZakatPaid` double DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `createdTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedBy` int(11) DEFAULT NULL,
  `updatedTS` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_delete` int(11) NOT NULL DEFAULT '0',
  `updateAble` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `zakat_summary`
--


--
-- Final view structure for view `view_account_balance`
--

/*!50001 DROP VIEW IF EXISTS `view_account_balance`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_account_balance` AS select `a`.`companyID` AS `companyID`,`a`.`acctID` AS `acctID`,concat(left(`b`.`acctCode`,4),'-',substr(`b`.`acctCode`,4,3),'-',right(`b`.`acctCode`,2),' ',`b`.`acctName`) AS `acctName`,`a`.`year` AS `year`,`a`.`period` AS `period`,sum(`a`.`total`) AS `closing` from (`comp_acc_det` `a` join `comp_chart_of_acct` `b`) where (`b`.`ID` = `a`.`acctID`) group by `a`.`companyID`,`a`.`acctID`,`b`.`acctName`,`a`.`year`,`a`.`period` */;

--
-- Final view structure for view `view_ar_inventory`
--

/*!50001 DROP VIEW IF EXISTS `view_ar_inventory`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_ar_inventory` AS select `comp_sales_invoice`.`companyID` AS `companyID`,`comp_sales_invoice`.`customerID` AS `customerID`,concat(`comp_sales_invoice`.`formNo`,'[',convert(lpad(`comp_sales_invoice`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`comp_sales_invoice`.`salesInvoiceDate` AS `salesinvoiceDate`,`comp_sales_invoice`.`totalReceivable` AS `totalReceivable` from `comp_sales_invoice` where (`comp_sales_invoice`.`totalReceivable` > 0) */;

--
-- Final view structure for view `view_ar_open_position`
--

/*!50001 DROP VIEW IF EXISTS `view_ar_open_position`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_ar_open_position` AS select `a`.`companyID` AS `companyID`,`a`.`ID` AS `customerID`,`a`.`customerName` AS `customerName`,`a`.`phoneNumber1` AS `phoneNumber1`,`a`.`email` AS `email`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= -(90)))) AS `due120`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > -(90)) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= -(60)))) AS `due90`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > -(60)) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= -(30)))) AS `due60`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > -(30)) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= -(5)))) AS `due30`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > -(5)) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= 5))) AS `due0`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > 5) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= 30))) AS `pastDue30`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > 30) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= 60))) AS `pastDue60`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > 60) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= 90))) AS `pastDue90`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > 90) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) <= 120))) AS `pastDue120`,(select sum(`inv`.`totalReceivable`) from (`comp_sales_invoice` `inv` join `terms`) where ((`inv`.`termsID` = `terms`.`ID`) and (`inv`.`companyID` = `a`.`companyID`) and (`inv`.`customerID` = `a`.`ID`) and ((timestampdiff(DAY,`inv`.`salesInvoiceDate`,now()) - `terms`.`dueDays`) > 120))) AS `pastDue` from `customer` `a` */;

--
-- Final view structure for view `view_balance_sheet`
--

/*!50001 DROP VIEW IF EXISTS `view_balance_sheet`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_balance_sheet` AS select `a`.`acctCode` AS `acctCode`,`a`.`acctName` AS `acctName`,`a`.`acctGroupID` AS `acctGroupID`,sum(`b`.`amountdr`) AS `currentyeardebit`,sum(`b`.`amountcr`) AS `currentyearcredit`,sum(`c`.`amountdr`) AS `lastyeardebit`,sum(`c`.`amountcr`) AS `lastyearcredit` from ((`comp_chart_of_acct` `a` left join `comp_acc_det` `b` on(((`b`.`acctID` = `a`.`ID`) and (`b`.`year` = 2014) and (`b`.`period` <= 9)))) left join `comp_acc_det` `c` on(((`c`.`acctID` = `a`.`ID`) and (`c`.`year` < 2014)))) where (`a`.`companyID` = '110') group by `a`.`acctCode` */;

--
-- Final view structure for view `view_bank_reconcile`
--

/*!50001 DROP VIEW IF EXISTS `view_bank_reconcile`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_bank_reconcile` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyid`,'comp_journal_detail' AS `tableName`,`b`.`ID` AS `bankid`,(select max(`view_journal_table`.`referenceNo`) AS `referenceNo` from `view_journal_table` where ((`view_journal_table`.`journalID` = `a`.`journalID`) and (`view_journal_table`.`companyID` = `a`.`companyID`))) AS `referenceNo`,`c`.`effective_date` AS `transDate`,`a`.`journalID` AS `formNo`,`a`.`description` AS `description`,`a`.`amount_dr` AS `debitAmount`,`a`.`amount_cr` AS `creditAmount` from ((`comp_journal_detail` `a` left join `comp_bank` `b` on((`a`.`acctCode` = `b`.`linkAccountID`))) left join `comp_journal` `c` on(((`c`.`journalID` = `a`.`journalID`) and (`c`.`companyID` = `a`.`companyID`)))) where ((`a`.`bankReconcileID` = 0) and (`c`.`status` = 1)) */;

--
-- Final view structure for view `view_bank_reconcile_reverse`
--

/*!50001 DROP VIEW IF EXISTS `view_bank_reconcile_reverse`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_bank_reconcile_reverse` AS select `a`.`bankReconcileID` AS `bankReconcileID`,`a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,'comp_cash_sales' AS `tableName`,`a`.`bankID` AS `bankID`,`a`.`referenceNo` AS `referenceNo`,`a`.`salesInvoiceDate` AS `transDate`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`paymentFrom` AS `description`,`a`.`totalAmountIncludeTax` AS `debitAmount`,0 AS `creditAmount` from `comp_cash_sales` `a` where (`a`.`bankReconcileID` <> 0) union select `a`.`bankReconcileID` AS `bankReconcileID`,`a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,'comp_receive_payment' AS `tableName`,`a`.`bankID` AS `bankID`,`a`.`referenceNo` AS `referenceNo`,`a`.`receivePaymentDate` AS `transDate`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`b`.`customerName` AS `description`,`a`.`totalReceived` AS `debitAmount`,0 AS `creditAmount` from (`comp_receive_payment` `a` join `customer` `b`) where ((`a`.`bankReconcileID` <> 0) and (`a`.`customerID` = `b`.`ID`)) union select `a`.`bankReconcileID` AS `bankReconcileID`,`a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,'comp_receive_payment_others' AS `tableName`,`a`.`bankID` AS `bankID`,`a`.`referenceNo` AS `referenceNo`,`a`.`receivePaymentDate` AS `transDate`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`receiveFrom` AS `description`,`a`.`totalReceived` AS `debitAmount`,0 AS `creditAmount` from `comp_receive_payment_others` `a` where (`a`.`bankReconcileID` <> 0) union select `a`.`bankReconcileID` AS `bankReconcileID`,`a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,'comp_receive_payment_others' AS `tableName`,`a`.`bankID` AS `bankID`,`a`.`referenceNo` AS `referenceNo`,`a`.`receivePaymentDate` AS `transDate`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`receiveFrom` AS `description`,`a`.`totalReceived` AS `debitAmount`,0 AS `creditAmount` from `comp_receive_payment_others` `a` where (`a`.`bankReconcileID` <> 0) union select `a`.`bankReconcileID` AS `bankReconcileID`,`a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,'comp_payment' AS `tableName`,`a`.`bankID` AS `bankID`,`a`.`referenceNo` AS `referenceNo`,`a`.`paymentDate` AS `transDate`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`b`.`supplierName` AS `description`,0 AS `debitAmount`,`a`.`totalPaid` AS `creditAmount` from (`comp_payment` `a` join `supplier` `b`) where ((`a`.`bankReconcileID` <> 0) and (`a`.`supplierID` = `b`.`ID`)) union select `a`.`bankReconcileID` AS `bankReconcileID`,`a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,'comp_payment_others' AS `tableName`,`a`.`bankId` AS `bankID`,`a`.`referenceNo` AS `referenceNo`,`a`.`paymentDate` AS `transDate`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`payTo` AS `description`,0 AS `debitAmount`,`a`.`amountPaid` AS `creditAmount` from `comp_payment_others` `a` where (`a`.`bankReconcileID` <> 0) */;

--
-- Final view structure for view `view_chart_of_acct_updateable`
--

/*!50001 DROP VIEW IF EXISTS `view_chart_of_acct_updateable`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_chart_of_acct_updateable` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`acctGroupID` AS `acctGroupID`,`a`.`acctCode` AS `acctCode`,`a`.`acctName` AS `acctName`,`a`.`acctDesc` AS `acctDesc`,if((((select count(`comp_journal_detail`.`ID`) from `comp_journal_detail` where (`comp_journal_detail`.`acctCode` = `a`.`ID`)) + (select count(`comp_opening_balance`.`ID`) from `comp_opening_balance` where ((`comp_opening_balance`.`accountID` = `a`.`ID`) and ((`comp_opening_balance`.`debit` + `comp_opening_balance`.`credit`) > 0)))) > 0),10,1) AS `updateable` from `comp_chart_of_acct` `a` */;

--
-- Final view structure for view `view_comp_acc_det`
--

/*!50001 DROP VIEW IF EXISTS `view_comp_acc_det`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_comp_acc_det` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`acctGroupID` AS `acctGroupID`,`a`.`acctID` AS `acctID`,`a`.`year` AS `year`,`a`.`period` AS `period`,(select coalesce(sum(`comp_journal_detail`.`amount_dr`),0) from `comp_journal_detail` where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`acctCode` = `a`.`acctID`) and (`comp_journal_detail`.`period` = `a`.`period`) and (`comp_journal_detail`.`year` = `a`.`year`) and (`comp_journal_detail`.`status` = 1) and (`comp_journal_detail`.`is_delete` = 0))) AS `amountdr`,(select coalesce(sum(`comp_journal_detail`.`amount_cr`),0) from `comp_journal_detail` where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`acctCode` = `a`.`acctID`) and (`comp_journal_detail`.`period` = `a`.`period`) and (`comp_journal_detail`.`year` = `a`.`year`) and (`comp_journal_detail`.`status` = 1) and (`comp_journal_detail`.`is_delete` = 0))) AS `amountcr`,(select (coalesce(sum(`comp_journal_detail`.`amount_dr`),0) - coalesce(sum(`comp_journal_detail`.`amount_cr`),0)) from `comp_journal_detail` where ((`comp_journal_detail`.`companyID` = `a`.`companyID`) and (`comp_journal_detail`.`acctCode` = `a`.`acctID`) and (`comp_journal_detail`.`period` = `a`.`period`) and (`comp_journal_detail`.`year` = `a`.`year`) and (`comp_journal_detail`.`status` = 1) and (`comp_journal_detail`.`is_delete` = 0))) AS `total`,`a`.`createdBy` AS `createdBy`,`a`.`createdTS` AS `createdTS`,`a`.`updatedBy` AS `updatedBy`,`a`.`updatedTS` AS `updatedTS`,`a`.`is_delete` AS `is_delete` from `comp_acc_det` `a` where ((`a`.`companyID` > 0) and (`a`.`acctID` > 0) and (`a`.`year` > 0) and (`a`.`period` > 0)) */;

--
-- Final view structure for view `view_customer_aging`
--

/*!50001 DROP VIEW IF EXISTS `view_customer_aging`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_customer_aging` AS select `a`.`companyID` AS `companyID`,`a`.`ID` AS `customerID`,`a`.`customerName` AS `customerName`,`a`.`phoneNumber1` AS `phoneNumber1`,`a`.`email` AS `email`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 0) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 0) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 0) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `current`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 1) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 1) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 1) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month1`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 2) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 2) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 2) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month2`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 3) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 3) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 3) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month3`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 4) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 4) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 4) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month4`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 5) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 5) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 5) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month5`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 6) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 6) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 6) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month6`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 7) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 7) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 7) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month7`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 8) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 8) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 8) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month8`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 9) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 9) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 9) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month9`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) = 10) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) = 10) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) = 10) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month10`,((ifnull((select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) > 10) and (`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_sales_debitnote`.`total`) from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`companyID` = `a`.`companyID`) and (`comp_sales_debitnote`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_debitnote`.`debitNoteDate`,now()) > 10) and (`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_customer_invoice`.`totalReceivable`) from `comp_historical_customer_invoice` where ((`comp_historical_customer_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_customer_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_customer_invoice`.`salesInvoiceDate`,now()) > 10) and (`comp_historical_customer_invoice`.`updateAble` = 0) and (`comp_historical_customer_invoice`.`is_delete` = 0))),0)) AS `month11` from `customer` `a` */;

--
-- Final view structure for view `view_customer_statement`
--

/*!50001 DROP VIEW IF EXISTS `view_customer_statement`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_customer_statement` AS select `comp_sales_invoice`.`ID` AS `ID`,`comp_sales_invoice`.`ID` AS `parent`,`comp_sales_invoice`.`companyID` AS `companyID`,`comp_sales_invoice`.`customerID` AS `customerID`,'Invoice' AS `transType`,`comp_sales_invoice`.`salesInvoiceDate` AS `transDate`,`comp_sales_invoice`.`customerPoNo` AS `refNo`,concat(concat(concat(`comp_sales_invoice`.`formNo`,'['),convert(lpad(`comp_sales_invoice`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`comp_sales_invoice`.`totalamount` AS `dr`,NULL AS `cr`,1 AS `seq` from `comp_sales_invoice` where ((`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0)) union select `a`.`ID` AS `ID`,`a`.`salesInvoiceID` AS `parent`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,'DebitNote' AS `transType`,`a`.`debitNoteDate` AS `transDate`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `refno`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`totalAmount` AS `dr`,NULL AS `cr`,2 AS `seq` from (`comp_sales_debitnote` `a` join `comp_sales_invoice` `b`) where ((`a`.`updateAble` = 0) and (`a`.`is_delete` = 0) and (`b`.`ID` = `a`.`salesInvoiceID`)) union select `a`.`ID` AS `ID`,`a`.`salesInvoiceID` AS `parent`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,'CreditNote' AS `transType`,`a`.`creditNoteDate` AS `transDate`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `refno`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`a`.`totalAmount` AS `cr`,3 AS `seq` from (`comp_sales_creditnote` `a` join `comp_sales_invoice` `b`) where ((`a`.`updateAble` = 0) and (`a`.`is_delete` = 0) and (`b`.`ID` = `a`.`salesInvoiceID`)) union select `b`.`ID` AS `ID`,0 AS `parent`,`b`.`companyID` AS `companyID`,`b`.`customerID` AS `customerID`,if((`b`.`updateAble` = 0),'Payment','** Payment') AS `transType`,`b`.`receivePaymentDate` AS `transDate`,`b`.`referenceNo` AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`b`.`totalReceived` AS `cr`,4 AS `seq` from `comp_receive_payment` `b` where (`b`.`is_delete` = 0) union select `b`.`ID` AS `ID`,0 AS `parent`,`b`.`companyID` AS `companyID`,`b`.`customerID` AS `customerID`,'Discount' AS `transType`,`b`.`receivePaymentDate` AS `transDate`,NULL AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`b`.`totalDiscount` AS `cr`,4 AS `seq` from `comp_receive_payment` `b` where ((`b`.`totalDiscount` > 0) and (`b`.`updateAble` = 0) and (`b`.`is_delete` = 0)) union select `b`.`ID` AS `ID`,0 AS `parent`,`b`.`companyID` AS `companyID`,`b`.`customerID` AS `customerID`,'Historical Invoice' AS `transType`,`b`.`salesInvoiceDate` AS `transDate`,NULL AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`b`.`totalAmount` AS `dr`,NULL AS `cr`,1 AS `seq` from `comp_historical_customer_invoice` `b` where ((`b`.`updateAble` = 0) and (`b`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_expence_and_income`
--

/*!50001 DROP VIEW IF EXISTS `view_expence_and_income`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_expence_and_income` AS select `a`.`companyID` AS `companyid`,`a`.`year` AS `year`,`a`.`period` AS `period`,`c`.`ID` AS `groupID`,`c`.`acctTypeID` AS `acctType`,coalesce(sum(`a`.`amountdr`),0) AS `totalDr`,coalesce(sum(`a`.`amountcr`),0) AS `totalCr`,if((`c`.`acctTypeID` = 3),(coalesce(sum(`a`.`amountcr`),0) - coalesce(sum(`a`.`amountdr`),0)),(coalesce(sum(`a`.`amountdr`),0) - coalesce(sum(`a`.`amountcr`),0))) AS `balance` from ((`comp_acc_det` `a` join `comp_chart_of_acct` `b`) join `_ref_acct_group` `c`) where ((`b`.`ID` = `a`.`acctID`) and (`c`.`ID` = `b`.`acctGroupID`) and (`c`.`acctTypeID` in (3,4)) and (`c`.`title` = 1) and (`a`.`period` > 0) and (`b`.`companyID` > 0)) group by `a`.`companyID`,`a`.`year`,`a`.`period`,`acctType` */;

--
-- Final view structure for view `view_gaf`
--

/*!50001 DROP VIEW IF EXISTS `view_gaf`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_gaf` AS select `a`.`companyID` AS `companyID`,'P' AS `col1`,`a`.`supplierName` AS `col2`,`a`.`supplierCompanyNo` AS `col3`,`b`.`invoiceDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,'import declaration number' AS `col6`,`c`.`lineNo` AS `col7`,`c`.`itemdescription` AS `col8`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col9`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col10`,`e`.`code` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from ((((`supplier` `a` join `comp_supplier_invoice` `b`) join `comp_supplier_invoice_detail` `c`) join `_ref_currency` `d`) join `tax_master` `e`) where ((`a`.`ID` = `b`.`supplierID`) and (`b`.`ID` = `c`.`invoiceID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`)) union select `a`.`companyID` AS `companyID`,'P' AS `col1`,`a`.`supplierName` AS `col2`,`a`.`supplierCompanyNo` AS `col3`,`b`.`invoiceDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,'import declaration number' AS `col6`,`c`.`lineNo` AS `col7`,`c`.`itemdescription` AS `col8`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col9`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col10`,`e`.`code` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from ((((`supplier` `a` join `comp_supplier_invoice` `b`) join `comp_supplier_invoice_charges` `c`) join `_ref_currency` `d`) join `tax_master` `e`) where ((`a`.`ID` = `b`.`supplierID`) and (`b`.`ID` = `c`.`invoiceID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`)) union select `a`.`companyID` AS `companyID`,'P' AS `col1`,`a`.`supplierName` AS `col2`,`a`.`supplierCompanyNo` AS `col3`,`b`.`debitNoteDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,'import declaration number' AS `col6`,`c`.`lineNo` AS `col7`,`c`.`itemdescription` AS `col8`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col9`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col10`,`e`.`code` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from ((((`supplier` `a` join `comp_supplier_debitnote` `b`) join `comp_supplier_debitnote_detail` `c`) join `_ref_currency` `d`) join `tax_master` `e`) where ((`a`.`ID` = `b`.`supplierID`) and (`b`.`ID` = `c`.`debitnoteID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`)) union select `a`.`companyID` AS `companyID`,'P' AS `col1`,`a`.`supplierName` AS `col2`,`a`.`supplierCompanyNo` AS `col3`,`b`.`creditNoteDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,'import declaration number' AS `col6`,`c`.`lineNo` AS `col7`,`c`.`itemdescription` AS `col8`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col9`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col10`,`e`.`code` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from ((((`supplier` `a` join `comp_supplier_creditnote` `b`) join `comp_supplier_creditnote_detail` `c`) join `_ref_currency` `d`) join `tax_master` `e`) where ((`a`.`ID` = `b`.`supplierID`) and (`b`.`ID` = `c`.`creditnoteID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`)) union select `a`.`companyID` AS `companyID`,'S' AS `col1`,`a`.`customerName` AS `col2`,`a`.`customerCompanyNo` AS `col3`,`b`.`salesInvoiceDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,`c`.`lineNo` AS `col6`,`g`.`description` AS `col7`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col8`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col9`,`e`.`code` AS `col10`,`f`.`fldcountry` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from ((((((`customer` `a` join `comp_sales_invoice` `b`) join `comp_sales_invoice_detail` `c`) join `_ref_currency` `d`) join `tax_master` `e`) join `_ref_country` `f`) join `item` `g`) where ((`a`.`ID` = `b`.`customerID`) and (`b`.`ID` = `c`.`invoiceID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`) and (`f`.`fldid` = `a`.`customerCountryID`) and (`g`.`ID` = `c`.`itemID`)) union select `a`.`companyID` AS `companyID`,'S' AS `col1`,`a`.`customerName` AS `col2`,`a`.`customerCompanyNo` AS `col3`,`b`.`salesInvoiceDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,`c`.`lineNo` AS `col6`,`c`.`chargeDescription` AS `col7`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col8`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col9`,`e`.`code` AS `col10`,`f`.`fldcountry` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from (((((`customer` `a` join `comp_sales_invoice` `b`) join `comp_sales_invoice_charges` `c`) join `_ref_currency` `d`) join `tax_master` `e`) join `_ref_country` `f`) where ((`a`.`ID` = `b`.`customerID`) and (`b`.`ID` = `c`.`invoiceID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`) and (`f`.`fldid` = `a`.`customerCountryID`)) union select `a`.`companyID` AS `companyID`,'S' AS `col1`,`a`.`customerName` AS `col2`,`a`.`customerCompanyNo` AS `col3`,`b`.`debitNoteDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,`c`.`lineNo` AS `col6`,`c`.`itemdescription` AS `col7`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col8`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col9`,`e`.`code` AS `col10`,`f`.`fldcountry` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from (((((`customer` `a` join `comp_sales_debitnote` `b`) join `comp_sales_debitnote_detail` `c`) join `_ref_currency` `d`) join `tax_master` `e`) join `_ref_country` `f`) where ((`a`.`ID` = `b`.`customerID`) and (`b`.`ID` = `c`.`debitnoteID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`) and (`f`.`fldid` = `a`.`customerCountryID`)) union select `a`.`companyID` AS `companyID`,'S' AS `col1`,`a`.`customerName` AS `col2`,`a`.`customerCompanyNo` AS `col3`,`b`.`creditNoteDate` AS `col4`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `col5`,`c`.`lineNo` AS `col6`,`c`.`itemdescription` AS `col7`,(`c`.`amountExcludedTax` * `b`.`exchangeRate`) AS `col8`,(`c`.`taxAmount` * `b`.`exchangeRate`) AS `col9`,`e`.`code` AS `col10`,`f`.`fldcountry` AS `col11`,`d`.`fldcurr_code` AS `col12`,`c`.`amountExcludedTax` AS `col13`,`c`.`taxAmount` AS `col14` from (((((`customer` `a` join `comp_sales_creditnote` `b`) join `comp_sales_creditnote_detail` `c`) join `_ref_currency` `d`) join `tax_master` `e`) join `_ref_country` `f`) where ((`a`.`ID` = `b`.`customerID`) and (`b`.`ID` = `c`.`creditnoteID`) and (`d`.`fldid` = `a`.`currencyID`) and (`e`.`ID` = `c`.`taxID`) and (`f`.`fldid` = `a`.`customerCountryID`)) */;

--
-- Final view structure for view `view_grn_report`
--

/*!50001 DROP VIEW IF EXISTS `view_grn_report`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_grn_report` AS select `po`.`companyID` AS `companyID`,`um`.`code` AS `unitMesure`,`podet`.`ID` AS `ID`,`i`.`itemCode` AS `itemCode`,`i`.`name` AS `itemName`,concat(`po`.`formNo`,'[',convert(lpad(`po`.`serialNo`,8,0) using latin1),']') AS `poNo`,date_format(`po`.`poDate`,'%d-%m-%Y') AS `PoDate`,`podet`.`unitPrice` AS `unitPrice`,`podet`.`quantityOrder` AS `quantityOrder`,((`podet`.`quantityOrder` - `podet`.`quantityReceivedTotal`) * `podet`.`unitPrice`) AS `total`,sum(round((`ridet`.`quantityReceived` / ifnull(`umconv`.`factor`,1)),0)) AS `totalRcv`,(`podet`.`quantityOrder` - ifnull(sum(round((`ridet`.`quantityReceived` / ifnull(`umconv`.`factor`,1)),0)),0)) AS `QtyLeft`,`podet`.`itemID` AS `itemID` from ((((((`comp_purchase_order_detail` `podet` left join `comp_purchase_order` `po` on((`po`.`ID` = `podet`.`purchaseOrderID`))) left join `comp_receive_item_detail` `ridet` on((`ridet`.`poDetailID` = `podet`.`ID`))) left join `comp_receive_item` `ri` on((`ri`.`ID` = `ridet`.`receiveID`))) left join `item` `i` on((`i`.`ID` = `podet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `podet`.`umID`))) left join `_sys_um_conv` `umconv` on(((`umconv`.`itemID` = `podet`.`itemID`) and (`umconv`.`from_um` = `ridet`.`standUM`) and (`umconv`.`to_um` = `ridet`.`umID`) and (`umconv`.`companyID` = `po`.`companyID`)))) where ((`po`.`updateAble` = 0) and (`ri`.`updateAble` = 0)) group by `podet`.`ID` */;

--
-- Final view structure for view `view_gst_report`
--

/*!50001 DROP VIEW IF EXISTS `view_gst_report`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_gst_report` AS select `a`.`companyID` AS `companyid`,`b`.`gstRegisteredDate` AS `gstRegisteredDate`,`b`.`taxablePeriod` AS `taxablePeriod`,`a`.`financialYear` AS `financialYear`,`a`.`startDate` AS `startDate`,`a`.`endDate` AS `endDate`,`a`.`period` AS `period`,`b`.`gstRegisteredNo` AS `A1`,`b`.`companyName` AS `A2`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('SR','DS','IMS')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B5a`,(select sum(`view_gst_tax`.`taxAmount`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('SR','DS','AJS','IMS')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B5b`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('TX','TX-CG','IM','IMS','TX-E43','TX-RE')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B6a`,(select sum(`view_gst_tax`.`taxAmount`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('AJP','TX','TX-CG','IM','IMS','TX-E43','TX-RE')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `B6b`,if(((select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('SR','DS','AJS','IMS')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) > (select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('TX','TX-CG','IM','IMS','TX-E43','TX-RE')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`)))),((select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('SR','DS','AJS','IMS')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) - (select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('TX','TX-CG','IM','IMS','TX-E43','TX-RE')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`)))),0) AS `B7`,if(((select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('TX','TX-CG','IM','IMS','TX-E43','TX-RE')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) > (select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('SR','DS','AJS','IMS')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`)))),((select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('TX','TX-CG','IM','IMS','TX-E43','TX-RE')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) - (select coalesce(sum(`view_gst_tax`.`taxAmount`),0) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('SR','DS','AJS','IMS')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`)))),0) AS `B8`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` = 'ZRL') and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C10`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` = 'ZRE') and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C11`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` in ('ES','ES43')) and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C12`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` = 'RS') and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C13`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` = 'IS') and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C14`,(select sum((`view_gst_tax`.`amountExcludedTax` * 0.06)) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` = 'IS') and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C15`,(select sum(`view_gst_tax`.`amountExcludedTax`) from `view_gst_tax` where ((`view_gst_tax`.`companyID` = `a`.`companyID`) and (`view_gst_tax`.`gst` = 'TX-CG') and (`view_gst_tax`.`transDate` between `a`.`startDate` and `a`.`endDate`))) AS `C16`,(select sum(`comp_sales_bad_debt`.`valueBadDebt`) from `comp_sales_bad_debt` where ((`comp_sales_bad_debt`.`companyID` = `a`.`companyID`) and (`comp_sales_bad_debt`.`transDate` between `a`.`startDate` and `a`.`endDate`) and (`comp_sales_bad_debt`.`updateAble` = 0))) AS `C17`,(select sum(`comp_sales_invoice`.`totalReceivable`) from `comp_sales_invoice` where ((`comp_sales_invoice`.`companyID` = `a`.`companyID`) and (`comp_sales_invoice`.`customerID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_sales_invoice`.`salesInvoiceDate`,now()) >= 6))) AS `month6`,(select sum(`comp_sales_debt_recover`.`valueDebtRecover`) from `comp_sales_debt_recover` where ((`comp_sales_debt_recover`.`companyID` = `a`.`companyID`) and (`comp_sales_debt_recover`.`transDate` between `a`.`startDate` and `a`.`endDate`) and (`comp_sales_debt_recover`.`updateAble` = 0))) AS `C18` from (`comp_financial_year` `a` join `company` `b`) where ((`b`.`ID` = `a`.`companyID`) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_gst_tax`
--

/*!50001 DROP VIEW IF EXISTS `view_gst_tax`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_gst_tax` AS select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Sales Invoice' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`salesInvoiceDate` AS `transDate`,`a`.`customerID` AS `customerID`,`d`.`customerName` AS `customerName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_sales_invoice` `a` join `comp_sales_invoice_detail` `b`) join `customer` `d`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`customerID` = `d`.`ID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Sales Invoice' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`salesInvoiceDate` AS `transDate`,`a`.`customerID` AS `customerID`,`d`.`customerName` AS `customerName`,`b`.`chargeDescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_sales_invoice` `a` join `comp_sales_invoice_charges` `b`) join `customer` `d`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`customerID` = `d`.`ID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Sales Credit Note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`creditNoteDate` AS `transDate`,`a`.`customerID` AS `customerID`,`d`.`customerName` AS `customerName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,(`b`.`amountExcludedTax` * -(1)) AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,(`b`.`taxAmount` * -(1)) AS `taxAmount`,(`b`.`amountIncludedTax` * -(1)) AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_sales_creditnote` `a` join `comp_sales_creditnote_detail` `b`) join `customer` `d`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`creditnoteID`) and (`a`.`customerID` = `d`.`ID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Sales Credit Note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`creditNoteDate` AS `transDate`,`a`.`customerID` AS `customerID`,`d`.`customerName` AS `customerName`,`b`.`chargeDescription` AS `itemName`,(`b`.`amountExcludedTax` * -(1)) AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,(`b`.`taxAmount` * -(1)) AS `taxAmount`,(`b`.`amountIncludedTax` * -(1)) AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_sales_creditnote` `a` join `comp_sales_creditnote_charges` `b`) join `customer` `d`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`creditNoteID`) and (`a`.`customerID` = `d`.`ID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`d`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Sales Debit note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`debitNoteDate` AS `transDate`,`a`.`customerID` AS `customerID`,`d`.`customerName` AS `customerName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_sales_debitnote` `a` join `comp_sales_debitnote_detail` `b`) join `customer` `d`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`debitnoteID`) and (`a`.`customerID` = `d`.`ID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Sales Debit Note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`debitNoteDate` AS `transDate`,`a`.`customerID` AS `customerID`,`d`.`customerName` AS `customerName`,`b`.`chargeDescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_sales_debitnote` `a` join `comp_sales_debitnote_charges` `b`) join `customer` `d`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`debitNoteID`) and (`a`.`customerID` = `d`.`ID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`d`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Purchase Invoice' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`invoiceDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`d`.`supplierName` AS `supplierName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_supplier_invoice` `a` join `comp_supplier_invoice_detail` `b`) join `supplier` `d`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`supplierID` = `d`.`ID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Purchase Invoice' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`invoiceDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`d`.`supplierName` AS `supplierName`,`b`.`chargeDescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_supplier_invoice` `a` join `comp_supplier_invoice_charges` `b`) join `supplier` `d`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`supplierID` = `d`.`ID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`d`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Purchase Credit Note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`creditNoteDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`d`.`supplierName` AS `supplierName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_supplier_creditnote` `a` join `comp_supplier_creditnote_detail` `b`) join `supplier` `d`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`creditnoteID`) and (`a`.`supplierID` = `d`.`ID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Purchase Credit Note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`creditNoteDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`d`.`supplierName` AS `supplierName`,`b`.`itemdescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_supplier_creditnote` `a` join `comp_supplier_creditnote_charges` `b`) join `supplier` `d`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`creditNoteID`) and (`a`.`supplierID` = `d`.`ID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`d`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Purchase Debit note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`debitNoteDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`d`.`supplierName` AS `supplierName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,(`b`.`amountExcludedTax` * -(1)) AS `b.amountExcludedTax * -1`,`b`.`taxRate` AS `taxRate`,(`b`.`taxAmount` * -(1)) AS `b.taxAmount * -1`,(`b`.`amountIncludedTax` * -(1)) AS `b.amountIncludedTax * -1`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_supplier_debitnote` `a` join `comp_supplier_debitnote_detail` `b`) join `supplier` `d`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`debitnoteID`) and (`a`.`supplierID` = `d`.`ID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Purchase Debit Note' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`debitNoteDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`d`.`supplierName` AS `supplierName`,`b`.`itemdescription` AS `itemName`,(`b`.`amountExcludedTax` * -(1)) AS `b.amountExcludedTax * -1`,`b`.`taxRate` AS `taxRate`,(`b`.`taxAmount` * -(1)) AS `b.taxAmount * -1`,(`b`.`amountIncludedTax` * -(1)) AS `b.amountIncludedTax * -1`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_supplier_debitnote` `a` join `comp_supplier_debitnote_charges` `b`) join `supplier` `d`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`debitNoteID`) and (`a`.`supplierID` = `d`.`ID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`d`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Other Payment' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`paymentDate` AS `transDate`,NULL AS `NULL`,`a`.`payTo` AS `supplierName`,`b`.`itemdescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((`comp_payment_others` `a` join `comp_payment_others_without_item` `b`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`otherPaymentID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Cash Sales' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`salesInvoiceDate` AS `transDate`,NULL AS `customerID`,`a`.`paymentFrom` AS `customerName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_cash_sales` `a` join `comp_cash_sales_detail` `b`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`invoiceID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Other Receive' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`receivePaymentDate` AS `transDate`,NULL AS `customerID`,`a`.`receiveFrom` AS `customerName`,`b`.`description` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((`comp_receive_payment_others` `a` join `comp_receive_payment_others_detail` `b`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`receivePaymentOthersID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `b`.`ID` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,`a`.`type` AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`date` AS `transDate`,NULL AS `supplierID`,`a`.`vendor_cust_name` AS `supplierName`,`b`.`description` AS `itemName`,if((`a`.`reverse` > 0),(`a`.`based_amount` * -(1)),`a`.`based_amount`) AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,if((`a`.`reverse` > 0),(if((`b`.`taxAmountDr` > 0),`b`.`taxAmountDr`,`b`.`taxAmountCr`) * -(1)),if((`b`.`taxAmountDr` > 0),`b`.`taxAmountDr`,`b`.`taxAmountCr`)) AS `taxAmount`,if((`a`.`reverse` > 0),((if((`b`.`taxAmountDr` > 0),`b`.`taxAmountDr`,`b`.`taxAmountCr`) + `a`.`based_amount`) * -(1)),(if((`b`.`taxAmountDr` > 0),`b`.`taxAmountDr`,`b`.`taxAmountCr`) + `a`.`based_amount`)) AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((`comp_gst_transaction` `a` join `comp_gst_transaction_detail` `b`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`gstTransID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`a`.`isDelete` = 0)) union select `b`.`lineNo` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Cash Purchase' AS `transType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `ref`,`a`.`paymentDate` AS `transDate`,NULL AS `supplierID`,`a`.`payTo` AS `supplierName`,concat(`e`.`name`,' / ',`e`.`itemCode`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxRate` AS `taxRate`,`b`.`taxAmount` AS `taxAmount`,`b`.`amountIncludedTax` AS `amountIncludedTax`,`b`.`taxID` AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_payment_others` `a` join `comp_payment_others_with_item` `b`) join `item` `e`) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`a`.`ID` = `b`.`otherPaymentID`) and (`e`.`ID` = `b`.`itemID`) and (`f`.`ID` = `b`.`taxID`) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`f`.`taxClass` = 1) and (`b`.`taxID` > 0) and (`a`.`updateAble` = 0) and (`e`.`companyID` = `a`.`companyID`) and (`f`.`companyID` = `a`.`companyID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8)) and (`j`.`status` = 1) and (`a`.`is_delete` = 0)) union select `a`.`ID` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Bad debt relief' AS `transType`,`a`.`journalNo` AS `ref`,`a`.`transDate` AS `transDate`,NULL AS `supplierID`,`c`.`customerName` AS `supplierName`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `itemName`,round((((((round(`b`.`totalReceivable`,2) / round(`b`.`totalamount`,2)) * round(`b`.`totalTaxAmount`,2)) * 106) / 6) - ((round(`b`.`totalReceivable`,2) / round(`b`.`totalamount`,2)) * round(`b`.`totalTaxAmount`,2))),2) AS `amountExcludedTax`,`f`.`taxPercentage` AS `taxRate`,round(((`b`.`totalReceivable` / `b`.`totalamount`) * `b`.`totalTaxAmount`),2) AS `taxAmount`,round((round((((((`b`.`totalReceivable` / `b`.`totalamount`) * `b`.`totalTaxAmount`) * 106) / 6) - ((`b`.`totalReceivable` / `b`.`totalamount`) * `b`.`totalTaxAmount`)),2) + ((`b`.`totalReceivable` / `b`.`totalamount`) * `b`.`totalTaxAmount`)),2) AS `amountIncludedTax`,NULL AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((`comp_sales_bad_debt` `a` join `comp_sales_invoice` `b` on((`b`.`badDebtID` = `a`.`ID`))) join `customer` `c` on((`c`.`ID` = `a`.`custID`))) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`f`.`companyID` = `a`.`companyID`) and (`f`.`code` = 'AJP') and (`a`.`updateAble` = 0) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`a`.`updateAble` = 0) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8))) union select `a`.`ID` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Bad debt Recover' AS `transType`,`a`.`journalNo` AS `ref`,`a`.`transDate` AS `transDate`,NULL AS `supplierID`,`c`.`customerName` AS `supplierName`,concat(`y`.`formNo`,'[',convert(lpad(`y`.`serialNo`,8,'0') using latin1),']') AS `itemName`,round((((((round(`b`.`amountApplied`,2) / round(`y`.`totalamount`,2)) * round(`y`.`totalTaxAmount`,2)) * 106) / 6) - ((round(`b`.`amountApplied`,2) / round(`y`.`totalamount`,2)) * round(`y`.`totalTaxAmount`,2))),2) AS `amountExcludedTax`,`f`.`taxPercentage` AS `taxRate`,round(((`b`.`amountApplied` / `y`.`totalamount`) * `y`.`totalTaxAmount`),2) AS `taxAmount`,round((round((((((`b`.`amountApplied` / `y`.`totalamount`) * `y`.`totalTaxAmount`) * 106) / 6) - ((`b`.`amountApplied` / `y`.`totalamount`) * `y`.`totalTaxAmount`)),2) + ((`b`.`amountApplied` / `y`.`totalamount`) * `y`.`totalTaxAmount`)),2) AS `amountIncludedTax`,NULL AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_sales_debt_recover` `a` join `comp_receive_payment_detail` `b` on((`b`.`debtRecoverID` = `a`.`ID`))) left join `comp_sales_invoice` `y` on((`y`.`ID` = `b`.`invoiceID`))) join `customer` `c` on((`c`.`ID` = `a`.`custID`))) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`f`.`companyID` = `a`.`companyID`) and (`f`.`code` = 'AJS') and (`a`.`updateAble` = 0) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8))) union select `a`.`ID` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Supplier Bad debt relief' AS `transType`,`a`.`journalNo` AS `ref`,`a`.`transDate` AS `transDate`,`a`.`supplierID` AS `supplierID`,`c`.`supplierName` AS `supplierName`,concat(`b`.`formNo`,'[',convert(lpad(`b`.`serialNo`,8,'0') using latin1),']') AS `itemName`,round((((((round((`b`.`totalPayable` + ifnull(sum(`p`.`amountApplied`),0)),2) / round(`b`.`totalAmount`,2)) * round(`b`.`totalTaxAmount`,2)) * 106) / 6) - ((round((`b`.`totalPayable` + ifnull(sum(`p`.`amountApplied`),0)),2) / round(`b`.`totalAmount`,2)) * round(`b`.`totalTaxAmount`,2))),2) AS `amountExcludedTax`,`f`.`taxPercentage` AS `taxRate`,round((((`b`.`totalPayable` + ifnull(sum(`p`.`amountApplied`),0)) / `b`.`totalAmount`) * `b`.`totalTaxAmount`),2) AS `taxAmount`,(round((((((round((`b`.`totalPayable` + ifnull(sum(`p`.`amountApplied`),0)),2) / round(`b`.`totalAmount`,2)) * round(`b`.`totalTaxAmount`,2)) * 106) / 6) - ((round((`b`.`totalPayable` + ifnull(sum(`p`.`amountApplied`),0)),2) / round(`b`.`totalAmount`,2)) * round(`b`.`totalTaxAmount`,2))),2) + round((((`b`.`totalPayable` + ifnull(sum(`p`.`amountApplied`),0)) / `b`.`totalAmount`) * `b`.`totalTaxAmount`),2)) AS `amountIncludedTax`,NULL AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from (((((((((`comp_purchase_bad_debt` `a` join `comp_supplier_invoice` `b` on((`b`.`badDebtID` = `a`.`ID`))) join `comp_payment_detail` `p` on((`p`.`purchaseInvoiceID` = `b`.`ID`))) join `comp_payment` `pay` on(((`pay`.`ID` = `p`.`paymentID`) and (`pay`.`paymentDate` > `a`.`transDate`)))) join `supplier` `c` on((`c`.`ID` = `a`.`supplierID`))) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`f`.`companyID` = `a`.`companyID`) and (`f`.`code` = 'AJS') and (`a`.`updateAble` = 0) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8))) group by `p`.`purchaseInvoiceID` union select `a`.`ID` AS `lineNo`,`a`.`companyID` AS `companyID`,`f`.`taxClass` AS `taxClass`,`h`.`description` AS `taxClassName`,`f`.`taxGroup` AS `taxGroup`,`i`.`description` AS `taxGroupName`,`f`.`taxType` AS `taxType`,`g`.`description` AS `taxTypeName`,'Supplier Bad debt Recover' AS `transType`,`a`.`journalNo` AS `ref`,`a`.`transDate` AS `transDate`,`a`.`suppID` AS `supplierID`,`c`.`supplierName` AS `supplierName`,concat(`y`.`formNo`,'[',convert(lpad(`y`.`serialNo`,8,'0') using latin1),']') AS `itemName`,round((((((round(`b`.`amountApplied`,2) / round(`y`.`totalAmount`,2)) * round(`y`.`totalTaxAmount`,2)) * 106) / 6) - ((round(`b`.`amountApplied`,2) / round(`y`.`totalAmount`,2)) * round(`y`.`totalTaxAmount`,2))),2) AS `amountExcludedTax`,`f`.`taxPercentage` AS `taxRate`,round(((`b`.`amountApplied` / `y`.`totalAmount`) * `y`.`totalTaxAmount`),2) AS `taxAmount`,round((round((((((`b`.`amountApplied` / `y`.`totalAmount`) * `y`.`totalTaxAmount`) * 106) / 6) - ((`b`.`amountApplied` / `y`.`totalAmount`) * `y`.`totalTaxAmount`)),2) + ((`b`.`amountApplied` / `y`.`totalAmount`) * `y`.`totalTaxAmount`)),2) AS `amountIncludedTax`,NULL AS `taxID`,`f`.`code` AS `gst`,`j`.`journalID` AS `journalID`,`j`.`formNo` AS `formNo` from ((((((((`comp_purchase_debt_recover` `a` join `comp_payment_detail` `b` on((`b`.`debtRecoverID` = `a`.`ID`))) left join `comp_supplier_invoice` `y` on((`y`.`ID` = `b`.`purchaseInvoiceID`))) join `supplier` `c` on((`c`.`ID` = `a`.`suppID`))) join `tax_master` `f`) join `tax_type` `g`) join `tax_class` `h`) join `tax_group` `i`) join `comp_journal` `j`) where ((`f`.`companyID` = `a`.`companyID`) and (`f`.`code` = 'AJP') and (`a`.`updateAble` = 0) and (`f`.`taxType` = `g`.`ID`) and (`f`.`taxClass` = `h`.`ID`) and (`f`.`taxGroup` = `i`.`ID`) and (`j`.`companyID` = `a`.`companyID`) and (`j`.`journalID` = convert(`a`.`journalNo` using utf8))) */;

--
-- Final view structure for view `view_inventory_statement`
--

/*!50001 DROP VIEW IF EXISTS `view_inventory_statement`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_inventory_statement` AS select `a`.`companyID` AS `companyID`,`a`.`deliveryDate` AS `transactionDate`,`b`.`itemID` AS `itemID`,`c`.`name` AS `name`,`g`.`supplierName` AS `supplierCustomer`,1 AS `transactionCode`,'Purchase' AS `transactionType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`locationID` AS `locationID`,`d`.`desc` AS `location`,`e`.`desc` AS `unitOfMeasure`,`b`.`quantityReceived` AS `quantityIn`,NULL AS `quantityOut`,`a`.`updateAble` AS `updateable` from ((((((`comp_receive_item` `a` left join `comp_receive_item_detail` `b` on((`a`.`ID` = `b`.`receiveID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) left join `item_details` `f` on((`c`.`ID` = `f`.`itemID`))) join `tbl_location` `d`) join `_sys_um` `e`) join `supplier` `g`) where ((`f`.`locationID` = `d`.`fldid`) and (`e`.`fldid` = `c`.`unitOfMeasureID`) and (`a`.`supplierID` = `f`.`ID`)) union select `a`.`companyID` AS `companyID`,`a`.`adjustmentDate` AS `transactionDate`,`b`.`itemID` AS `itemID`,`c`.`name` AS `name`,`d`.`desc` AS `supplierCustomer`,2 AS `transactionCode`,'stockAdjustment' AS `transactionType`,`a`.`formNo` AS `formNo`,`a`.`locationID` AS `locationID`,`d`.`desc` AS `location`,`e`.`desc` AS `unitOfMeasure`,if(((`b`.`counted` - `b`.`qtyOnHand`) > 0),(`b`.`counted` - `b`.`qtyOnHand`),NULL) AS `quantityIn`,if(((`b`.`counted` - `b`.`qtyOnHand`) < 0),(`b`.`counted` - `b`.`qtyOnHand`),NULL) AS `quantityOut`,`a`.`updateAble` AS `updateable` from (((((`item_adjustment` `a` left join `item_adjustment_detail` `b` on((`a`.`ID` = `b`.`adjustmentID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) left join `item_details` `f` on((`c`.`ID` = `f`.`itemID`))) left join `tbl_location` `d` on((`d`.`fldid` = `a`.`locationID`))) left join `_sys_um` `e` on((`e`.`fldid` = `b`.`unitOfMeasureID`))) union select `a`.`companyID` AS `companyID`,`a`.`deliveryOrderDate` AS `transactionDate`,`b`.`itemID` AS `itemID`,`c`.`name` AS `name`,`g`.`customerName` AS `supplierCustomer`,3 AS `transactionCode`,'Sale' AS `transactionType`,`a`.`formNo` AS `formNo`,`a`.`locationID` AS `locationID`,`d`.`desc` AS `location`,`e`.`desc` AS `unitOfMeasure`,NULL AS `quantityIn`,(`b`.`quantitySent` * -(1)) AS `quantityOut`,`a`.`updateAble` AS `updateable` from ((((((`comp_delivery_order` `a` left join `comp_delivery_detail` `b` on((`a`.`ID` = `b`.`deliveryID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) left join `item_details` `f` on((`c`.`ID` = `f`.`itemID`))) join `tbl_location` `d`) join `_sys_um` `e`) join `customer` `g`) where ((`a`.`locationID` = `d`.`fldid`) and (`e`.`fldid` = `c`.`unitOfMeasureID`) and (`a`.`customerID` = `f`.`ID`)) union select `a`.`companyID` AS `companyID`,`a`.`dateTransfer` AS `transactionDate`,`b`.`itemID` AS `itemID`,`c`.`name` AS `name`,`d`.`desc` AS `supplierCustomer`,4 AS `transactionCode`,'TransferOut' AS `transactionType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`ID`,8,'0') using latin1),']') AS `formNo`,`a`.`fromLocationID` AS `locationID`,`d`.`desc` AS `location`,`e`.`desc` AS `unitOfMeasure`,NULL AS `quantityIn`,(`b`.`quantity` * -(1)) AS `quantityOut`,`a`.`updateable` AS `updateable` from ((((`comp_location_transfer` `a` left join `comp_location_transfer_detail` `b` on((`a`.`ID` = `b`.`locationTransferID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) join `tbl_location` `d`) join `_sys_um` `e`) where ((`a`.`fromLocationID` = `d`.`fldid`) and (`e`.`fldid` = `c`.`unitOfMeasureID`)) union select `a`.`companyID` AS `companyID`,`a`.`dateTransfer` AS `transactionDate`,`b`.`itemID` AS `itemID`,`c`.`name` AS `name`,`d`.`desc` AS `supplierCustomer`,5 AS `transactionCode`,'TransferIn' AS `transactionType`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`ID`,8,'0') using latin1),']') AS `formNo`,`a`.`toLocationID` AS `locationID`,`d`.`desc` AS `location`,`e`.`desc` AS `unitOfMeasure`,`b`.`quantity` AS `quantityIn`,NULL AS `quantityOut`,`a`.`updateable` AS `updateable` from ((((`comp_location_transfer` `a` left join `comp_location_transfer_detail` `b` on((`a`.`ID` = `b`.`locationTransferID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) join `tbl_location` `d`) join `_sys_um` `e`) where ((`a`.`fromLocationID` = `d`.`fldid`) and (`e`.`fldid` = `c`.`unitOfMeasureID`)) */;

--
-- Final view structure for view `view_inventory_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_inventory_transaction`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_inventory_transaction` AS select `ridet`.`ID` AS `indexing`,`ri`.`ID` AS `ID`,`ri`.`companyID` AS `companyID`,`ridet`.`itemID` AS `itemID`,`ri`.`locationID` AS `locationID`,`ridet`.`createdTS` AS `createdTS`,`s`.`supplierName` AS `supplierName`,if((`ri`.`purchaseOrderID` = '-1'),`ri`.`formNo`,concat(`ri`.`formNo`,'[',convert(lpad(`ri`.`serialNo`,8,'0') using latin1),']')) AS `formNo`,`ri`.`deliveryDate` AS `transDate`,`um`.`desc` AS `um`,'Transfer In' AS `transType`,`ridet`.`quantityReceived` AS `qtyIn`,'0' AS `qtyOut` from ((((`comp_receive_item_detail` `ridet` left join `comp_receive_item` `ri` on((`ri`.`ID` = `ridet`.`receiveID`))) left join `supplier` `s` on((`s`.`ID` = `ri`.`supplierID`))) left join `item` `i` on((`i`.`ID` = `ridet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `ridet`.`umID`))) where (`ri`.`updateAble` = 0) union select `outdet`.`ID` AS `indexing`,`do`.`ID` AS `ID`,`do`.`companyID` AS `companyID`,`dodet`.`itemID` AS `itemID`,`do`.`locationID` AS `locationID`,`outdet`.`createdTS` AS `createdTS`,`c`.`customerName` AS `supplierName`,concat(`do`.`formNo`,'[',convert(lpad(`do`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`do`.`deliveryOrderDate` AS `transDate`,`um`.`desc` AS `um`,'Transfer Out' AS `transType`,'0' AS `qtyIn`,`outdet`.`qty` AS `qtyOut` from (((((`comp_receive_delivery_conn` `outdet` left join `comp_delivery_detail` `dodet` on((`dodet`.`ID` = `outdet`.`deliveryDetailID`))) left join `comp_delivery_order` `do` on((`do`.`ID` = `dodet`.`deliveryID`))) left join `customer` `c` on((`c`.`ID` = `do`.`customerID`))) left join `item` `i` on((`i`.`ID` = `dodet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `i`.`unitOfMeasureID`))) where (`outdet`.`type` = 1) union select `outdet`.`ID` AS `indexing`,`loc`.`ID` AS `ID`,`loc`.`companyID` AS `companyID`,`locdet`.`itemID` AS `itemID`,`loc`.`fromLocationID` AS `locationID`,`outdet`.`createdTS` AS `createdTS`,`user`.`username` AS `supplierName`,concat(`loc`.`formNo`,'[',convert(lpad(`loc`.`ID`,8,'0') using latin1),']') AS `formNo`,`loc`.`dateTransfer` AS `transDate`,`um`.`desc` AS `um`,'Transfer Out' AS `transType`,'0' AS `qtyIn`,`outdet`.`qty` AS `qtyOut` from (((((`comp_receive_delivery_conn` `outdet` left join `comp_location_transfer_detail` `locdet` on((`locdet`.`ID` = `outdet`.`deliveryDetailID`))) left join `comp_location_transfer` `loc` on((`loc`.`ID` = `locdet`.`locationTransferID`))) left join `tbl_usermaster` `user` on((`user`.`fldid` = `loc`.`createdby`))) left join `item` `i` on((`i`.`ID` = `locdet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `i`.`unitOfMeasureID`))) where (`outdet`.`type` = 2) union select `outdet`.`ID` AS `indexing`,`loc`.`ID` AS `ID`,`loc`.`companyID` AS `companyID`,`locdet`.`itemID` AS `itemID`,`si`.`locationID` AS `locationID`,`outdet`.`createdTS` AS `createdTS`,`c`.`customerName` AS `supplierName`,concat(`loc`.`formNo`,'[',convert(lpad(`loc`.`ID`,8,'0') using latin1),']') AS `formNo`,`loc`.`debitNoteDate` AS `transDate`,`um`.`desc` AS `um`,'Transfer Out' AS `transType`,'0' AS `qtyIn`,`outdet`.`qty` AS `qtyOut` from (((((((`comp_receive_delivery_conn` `outdet` left join `comp_sales_debitnote_detail` `locdet` on((`locdet`.`ID` = `outdet`.`deliveryDetailID`))) left join `comp_sales_debitnote` `loc` on((`loc`.`ID` = `locdet`.`debitnoteID`))) left join `comp_sales_invoice_detail` `sidet` on((`sidet`.`ID` = `locdet`.`invoiceDetailID`))) left join `comp_sales_invoice` `si` on((`si`.`ID` = `sidet`.`invoiceID`))) left join `customer` `c` on((`c`.`ID` = `si`.`customerID`))) left join `item` `i` on((`i`.`ID` = `locdet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `i`.`unitOfMeasureID`))) where (`outdet`.`type` = 3) union select `outdet`.`ID` AS `indexing`,`loc`.`ID` AS `ID`,`loc`.`companyID` AS `companyID`,`locdet`.`itemID` AS `itemID`,if((`si`.`purchaseInvoiceCodeID` = '1'),`ri`.`locationID`,`si`.`locationID`) AS `locationID`,`outdet`.`createdTS` AS `createdTS`,`s`.`supplierName` AS `supplierName`,concat(`loc`.`formNo`,'[',convert(lpad(`loc`.`ID`,8,'0') using latin1),']') AS `formNo`,`loc`.`debitNoteDate` AS `transDate`,`um`.`desc` AS `um`,'Transfer Out' AS `transType`,'0' AS `qtyIn`,`outdet`.`qty` AS `qtyOut` from (((((((((`comp_receive_delivery_conn` `outdet` left join `comp_supplier_debitnote_detail` `locdet` on((`locdet`.`ID` = `outdet`.`deliveryDetailID`))) left join `comp_supplier_debitnote` `loc` on((`loc`.`ID` = `locdet`.`debitnoteID`))) left join `comp_supplier_invoice` `si` on((`si`.`ID` = `loc`.`supplierInvoiceID`))) left join `comp_supplier_invoice_detail` `sidet` on((`sidet`.`ID` = `locdet`.`invoiceDetailID`))) left join `comp_receive_item_detail` `ridet` on((`ridet`.`ID` = `sidet`.`receiveID`))) left join `comp_receive_item` `ri` on((`ri`.`ID` = `ridet`.`receiveID`))) left join `supplier` `s` on((`s`.`ID` = `si`.`supplierID`))) left join `item` `i` on((`i`.`ID` = `locdet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `i`.`unitOfMeasureID`))) where (`outdet`.`type` = 4) union select `outdet`.`ID` AS `indexing`,`loc`.`ID` AS `ID`,`loc`.`companyID` AS `companyID`,`locdet`.`itemID` AS `itemID`,`loc`.`locationID` AS `locationID`,`outdet`.`createdTS` AS `createdTS`,`loc`.`paymentFrom` AS `supplierName`,concat(`loc`.`formNo`,'[',convert(lpad(`loc`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`loc`.`salesInvoiceDate` AS `transDate`,`um`.`desc` AS `um`,'Transfer Out' AS `transType`,'0' AS `qtyIn`,`outdet`.`qty` AS `qtyOut` from ((((`comp_receive_delivery_conn` `outdet` left join `comp_cash_sales_detail` `locdet` on((`locdet`.`ID` = `outdet`.`deliveryDetailID`))) left join `comp_cash_sales` `loc` on((`loc`.`ID` = `locdet`.`invoiceID`))) left join `item` `i` on((`i`.`ID` = `locdet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `i`.`unitOfMeasureID`))) where (`outdet`.`type` = 5) union select `outdet`.`ID` AS `indexing`,`loc`.`ID` AS `ID`,`loc`.`companyID` AS `companyID`,`locdet`.`itemID` AS `itemID`,`loc`.`locationID` AS `locationID`,`outdet`.`createdTS` AS `createdTS`,`user`.`username` AS `supplierName`,concat(`loc`.`formNo`,'[',convert(lpad(`loc`.`ID`,8,'0') using latin1),']') AS `formNo`,`loc`.`adjustmentDate` AS `transDate`,`um`.`desc` AS `um`,'Transfer Out' AS `transType`,'0' AS `qtyIn`,`outdet`.`qty` AS `qtyOut` from (((((`comp_receive_delivery_conn` `outdet` left join `item_adjustment_detail` `locdet` on((`locdet`.`ID` = `outdet`.`deliveryDetailID`))) left join `item_adjustment` `loc` on((`loc`.`ID` = `locdet`.`adjustmentID`))) left join `tbl_usermaster` `user` on((`user`.`fldid` = `loc`.`createdBy`))) left join `item` `i` on((`i`.`ID` = `locdet`.`itemID`))) left join `_sys_um` `um` on((`um`.`fldid` = `i`.`unitOfMeasureID`))) where (`outdet`.`type` = 6) order by `formNo` */;

--
-- Final view structure for view `view_inventorylist_subtotal`
--

/*!50001 DROP VIEW IF EXISTS `view_inventorylist_subtotal`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_inventorylist_subtotal` AS select `a`.`companyID` AS `companyid`,sum(`b`.`balanceItem`) AS `quantity`,`a`.`locationID` AS `locationid`,`b`.`itemID` AS `itemID`,concat('[',`c`.`itemCode`,']',`c`.`name`) AS `itemName`,`d`.`name` AS `category`,`b`.`description` AS `description`,sum((`b`.`balanceItem` * `b`.`unitPrice`)) AS `stockValue` from (((`comp_receive_item` `a` join `comp_receive_item_detail` `b`) join `item` `c`) join `comp_item_category` `d`) where ((`a`.`ID` = `b`.`receiveID`) and (`b`.`balanceItem` > 0) and (`c`.`ID` = `b`.`itemID`) and (`c`.`itemCategoryID` = `d`.`ID`)) group by `a`.`companyID`,`a`.`locationID`,`b`.`itemID`,`b`.`itemName`,`category`,`b`.`description` */;

--
-- Final view structure for view `view_item_details`
--

/*!50001 DROP VIEW IF EXISTS `view_item_details`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_item_details` AS select `b`.`companyID` AS `companyid`,`a`.`itemID` AS `itemid`,concat('[',`c`.`itemCode`,']',`c`.`name`) AS `itemName`,`c`.`description` AS `description`,`b`.`locationID` AS `locationid`,sum(`a`.`balanceItem`) AS `onHandQty`,`a`.`umID` AS `umID`,`c`.`inventoriesID` AS `acctID`,`d`.`code` AS `location`,`e`.`code` AS `unitOfMeasure` from ((((`comp_receive_item_detail` `a` join `comp_receive_item` `b`) join `item` `c`) join `tbl_location` `d`) join `_sys_um` `e`) where ((`a`.`receiveID` = `b`.`ID`) and (`a`.`itemID` = `c`.`ID`) and (`d`.`fldid` = `b`.`locationID`) and (`e`.`fldid` = `a`.`umID`) and (`a`.`balanceItem` > 0)) group by `b`.`companyID`,`a`.`itemID`,`a`.`itemName`,`c`.`description`,`b`.`locationID`,`a`.`umID`,`acctID`,`location`,`unitOfMeasure` */;

--
-- Final view structure for view `view_item_quantityonhand`
--

/*!50001 DROP VIEW IF EXISTS `view_item_quantityonhand`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_item_quantityonhand` AS select `a`.`companyID` AS `companyID`,`a`.`locationID` AS `locationID`,`b`.`itemID` AS `itemID`,`b`.`itemCode` AS `itemCode`,`b`.`itemName` AS `itemName`,`b`.`umID` AS `umID`,sum(`b`.`balanceItem`) AS `quantityOnHand` from (`comp_receive_item` `a` left join `comp_receive_item_detail` `b` on(((`a`.`ID` = `b`.`receiveID`) and (`b`.`balanceItem` > 0)))) group by `a`.`companyID`,`a`.`locationID`,`b`.`itemID`,`b`.`itemCode`,`b`.`itemName`,`b`.`umID` */;

--
-- Final view structure for view `view_item_quantityonhand_confirm`
--

/*!50001 DROP VIEW IF EXISTS `view_item_quantityonhand_confirm`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_item_quantityonhand_confirm` AS select `a`.`companyID` AS `companyID`,`a`.`locationID` AS `locationID`,`b`.`itemID` AS `itemID`,`b`.`itemCode` AS `itemCode`,`b`.`itemName` AS `itemName`,`b`.`umID` AS `umID`,sum(`b`.`balanceItem`) AS `quantityOnHand` from (`comp_receive_item` `a` left join `comp_receive_item_detail` `b` on((`a`.`ID` = `b`.`receiveID`))) where ((`a`.`updateAble` = 0) and (`b`.`balanceItem` > 0)) group by `a`.`companyID`,`a`.`locationID`,`b`.`itemID`,`b`.`itemCode`,`b`.`itemName`,`b`.`umID` */;

--
-- Final view structure for view `view_journal_table`
--

/*!50001 DROP VIEW IF EXISTS `view_journal_table`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_journal_table` AS select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_cash_sales' AS `tableName`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_cash_sales` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_payment' AS `comp_payment`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_payment` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_payment_others' AS `comp_payment_others`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_payment_others` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`formNo` AS `referenceNo`,'comp_purchase_order' AS `comp_purchase_order`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_purchase_order` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_receive_payment' AS `comp_receive_payment`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_receive_payment` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`referenceNo` AS `referenceNo`,'comp_receive_payment_others' AS `comp_receive_payment_others`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_receive_payment_others` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_sales_creditnote' AS `comp_sales_creditnote`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_sales_creditnote` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_sales_debitnote' AS `comp_sales_debitnote`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_sales_debitnote` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`customerPoNo` AS `referenceNo`,'comp_sales_invoice' AS `comp_sales_invoice`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_sales_invoice` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_supplier_creditnote' AS `comp_supplier_creditnote`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_supplier_creditnote` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_supplier_debitnote' AS `comp_supplier_debitnote`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_supplier_debitnote` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`supplierInvoiceNo` AS `referenceNo`,'comp_supplier_invoice' AS `comp_supplier_invoice`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_supplier_invoice` `a` join `comp_journal` `b`) where ((convert(`a`.`journalNo` using utf8) = `b`.`journalID`) and (`a`.`is_delete` = 0)) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`b`.`formNo` AS `referenceNo`,'comp_delivery_order' AS `comp_delivery_order`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_delivery_order` `a` join `comp_journal` `b`) where (convert(`a`.`journalNo` using utf8) = `b`.`journalID`) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`reference` AS `referenceNo`,'comp_gst_transaction' AS `comp_gst_transaction`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_gst_transaction` `a` join `comp_journal` `b`) where (convert(`a`.`journalNo` using utf8) = `b`.`journalID`) union select distinct `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,`a`.`supplierDoNo` AS `referenceNo`,'comp_receive_item' AS `comp_receive_item`,`b`.`journalID` AS `journalID`,`b`.`formNo` AS `formNo` from (`comp_receive_item` `a` join `comp_journal` `b`) where (convert(`a`.`journalNo` using utf8) = `b`.`journalID`) */;

--
-- Final view structure for view `view_open_ar_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_open_ar_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_open_ar_invoice` AS select `comp_sales_invoice`.`companyID` AS `companyID`,`comp_sales_invoice`.`salesInvoiceDate` AS `salesInvoiceDate`,date_format(`comp_sales_invoice`.`salesInvoiceDate`,'%Y') AS `salesYear`,date_format(`comp_sales_invoice`.`salesInvoiceDate`,'%m') AS `salesMonth`,date_format(`comp_sales_invoice`.`salesInvoiceDate`,'%b') AS `slsMonth`,(`comp_sales_invoice`.`totalReceivable` * if((`comp_sales_invoice`.`exchangeRate` = 0),1,`comp_sales_invoice`.`exchangeRate`)) AS `totalAmount` from `comp_sales_invoice` where (`comp_sales_invoice`.`totalReceivable` <> 0) */;

--
-- Final view structure for view `view_salescreditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_salescreditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_salescreditnote` AS select `si`.`ID` AS `invoiceDetailID`,`_sys_um`.`code` AS `unitOfMeasure`,`si`.`ID` AS `ID`,`si`.`invoiceID` AS `invoiceID`,`si`.`doID` AS `doID`,`si`.`lineNo` AS `lineNo`,`si`.`itemID` AS `itemID`,`si`.`umID` AS `umID`,`si`.`quantity` AS `quantity`,`si`.`unitPrice` AS `unitPrice`,`si`.`amountExcludedTax` AS `amountExcludedTax`,`si`.`taxID` AS `taxID`,`si`.`taxRate` AS `taxRate`,`si`.`taxAmount` AS `taxAmount`,`si`.`amountIncludedTax` AS `amountIncludedTax`,`si`.`accountID` AS `accountID`,`si`.`createdBy` AS `createdBy`,`si`.`createdTS` AS `createdTS`,`si`.`updatedBy` AS `updatedBy`,`si`.`updatedTS` AS `updatedTS`,`tax_master`.`code` AS `code`,`item`.`itemCode` AS `itemCode`,`item`.`name` AS `name`,`si`.`itemdescription` AS `description`,((`si`.`quantity` + ifnull((select sum(`dnd`.`quantity`) from `comp_sales_debitnote_detail` `dnd` where (`si`.`ID` = `dnd`.`invoiceDetailID`)),0)) - ifnull((select sum(`scd`.`quantity`) from `comp_sales_creditnote_detail` `scd` where (`scd`.`invoiceDetailID` = `si`.`ID`)),0)) AS `exactQty` from (((`comp_sales_invoice_detail` `si` left join `tax_master` on((`tax_master`.`ID` = `si`.`taxID`))) left join `item` on((`si`.`itemID` = `item`.`ID`))) left join `_sys_um` on((`_sys_um`.`fldid` = `si`.`umID`))) */;

--
-- Final view structure for view `view_salesdebitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_salesdebitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_salesdebitnote` AS select `si`.`ID` AS `invoiceDetailID`,`_sys_um`.`code` AS `unitOfMeasure`,`si`.`ID` AS `ID`,`si`.`invoiceID` AS `invoiceID`,`si`.`doID` AS `doID`,`si`.`lineNo` AS `lineNo`,`si`.`itemID` AS `itemID`,`si`.`umID` AS `umID`,`si`.`quantity` AS `quantity`,`si`.`unitPrice` AS `unitPrice`,`si`.`amountExcludedTax` AS `amountExcludedTax`,`si`.`taxID` AS `taxID`,`si`.`taxRate` AS `taxRate`,`si`.`taxAmount` AS `taxAmount`,`si`.`amountIncludedTax` AS `amountIncludedTax`,`si`.`accountID` AS `accountID`,`si`.`createdBy` AS `createdBy`,`si`.`createdTS` AS `createdTS`,`si`.`updatedBy` AS `updatedBy`,`si`.`updatedTS` AS `updatedTS`,`tax_master`.`code` AS `code`,`item`.`itemCode` AS `itemCode`,`item`.`name` AS `name`,`si`.`itemdescription` AS `description`,((`si`.`quantity` + ifnull((select sum(`dnd`.`quantity`) from `comp_sales_debitnote_detail` `dnd` where (`si`.`ID` = `dnd`.`invoiceDetailID`)),0)) - ifnull((select sum(`scd`.`quantity`) from `comp_sales_creditnote_detail` `scd` where (`scd`.`invoiceDetailID` = `si`.`ID`)),0)) AS `exactQty` from (((`comp_sales_invoice_detail` `si` left join `tax_master` on((`tax_master`.`ID` = `si`.`taxID`))) left join `item` on((`si`.`itemID` = `item`.`ID`))) left join `_sys_um` on((`_sys_um`.`fldid` = `si`.`umID`))) */;

--
-- Final view structure for view `view_search`
--

/*!50001 DROP VIEW IF EXISTS `view_search`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_search` AS select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'arTransaction/editcashsale/','arReports/cashsalelistDetail/'),`a`.`ID`) AS `searchLink`,concat('Cash Sale&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`salesInvoiceDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`paymentFrom`) AS `searchKey`,`a`.`salesInvoiceDate` AS `transDate` from `comp_cash_sales` `a` union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'sotransaction/SalesDO/','soreport/DeliveryOrderDetail/'),`a`.`ID`) AS `searchLink`,concat('Delivery Order&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`deliveryOrderDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`deliveryOrderDate` AS `transDate` from (`comp_delivery_order` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateable` = 1),'locationtransfer/edit/','locationtransfer/reportdetail/'),`a`.`ID`) AS `searchLink`,concat('Inventory Transfer&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(`a`.`formNo` using utf8),'[',convert(lpad(`a`.`serialNo`,8,'0') using utf8),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`dateTransfer`,'%d/%m/%Y') using utf8),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`code`,'&nbsp',`b`.`desc`) AS `searchKey`,`a`.`dateTransfer` AS `transDate` from (`comp_location_transfer` `a` join `tbl_location` `b`) where (`a`.`fromLocationID` = `b`.`fldid`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'aptransaction/editPayment/','Apreports/supplierpaymentDetail/'),`a`.`ID`) AS `searchLink`,concat('Payment&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`paymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`paymentDate` AS `transDate` from (`comp_payment` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'othersPayment/editPayWithoutItem/','othersPayment/otherpaywithoutDetail/'),`a`.`ID`) AS `searchLink`,concat('Payment Others&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`paymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`payTo`) AS `searchKey`,`a`.`paymentDate` AS `transDate` from `comp_payment_others` `a` union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'PO_Transaction/edit/','purchaseReports/PODetails/'),`a`.`ID`) AS `searchLink`,concat('Purchase Order&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`poDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`poDate` AS `transDate` from (`comp_purchase_order` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('soreport/SalesQuotationDetail/',`a`.`ID`) AS `searchLink`,concat('Quotation&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`quotationDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`quotationDate` AS `transDate` from (`comp_quotation` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'receiveItems/editReceiveItem/','receiveItems/ReceiveItemDetails/'),`a`.`ID`) AS `searchLink`,concat('Receive Item&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`deliveryDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`deliveryDate` AS `transDate` from (`comp_receive_item` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'artransaction/editReceivePayment/','arReports/compRecPaymentDetail/'),`a`.`ID`) AS `searchLink`,concat('Receive Payment&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`receivePaymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`receivePaymentDate` AS `transDate` from (`comp_receive_payment` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'gltransaction/editotherreceive/','glreports/otherReceiveAdviceRpt/'),`a`.`ID`) AS `searchLink`,concat('Receive Payment Others&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`receivePaymentDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`receiveFrom`) AS `searchKey`,`a`.`receivePaymentDate` AS `transDate` from `comp_receive_payment_others` `a` union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'artransaction/editSaleCreditNote/','arreports/salescreditnoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Sales Credit Note&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`creditNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`creditNoteDate` AS `transDate` from (`comp_sales_creditnote` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'artransaction/editSaleDebitNote/','arreports/salesdebitnoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Sales Debit Note&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`debitNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`debitNoteDate` AS `transDate` from (`comp_sales_debitnote` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('arReports/salesInvoiceDetail/',`a`.`ID`) AS `searchLink`,concat('Sales Invoice&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`salesInvoiceDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`salesInvoiceDate` AS `transDate` from (`comp_sales_invoice` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('soreport/SalesOrderDetail/',`a`.`ID`) AS `searchLink`,concat('Sales Order&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`salesOrderDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`customerName`) AS `searchKey`,`a`.`salesOrderDate` AS `transDate` from (`comp_sales_order` `a` join `customer` `b`) where (`a`.`customerID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'aptransaction/editCreditNote/','Apreports/creditNoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Supplier Credit Note&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`creditNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`creditNoteDate` AS `transDate` from (`comp_supplier_creditnote` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat(if((`a`.`updateAble` = 1),'aptransaction/editDebitNote/','Apreports/debitNoteDetail/'),`a`.`ID`) AS `searchLink`,concat('Supplier Debit Note&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`debitNoteDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`debitNoteDate` AS `transDate` from (`comp_supplier_debitnote` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) union select `a`.`ID` AS `ID`,`a`.`companyID` AS `companyID`,concat('apreports/purchaseInvoiceDetail/',`a`.`ID`) AS `searchLink`,concat('Purchase Invoice&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',convert(date_format(`a`.`invoiceDate`,'%d/%m/%Y') using latin1),'&nbsp<i class="i-play" aria-hidden="true"></i>&nbsp',`b`.`supplierName`) AS `searchKey`,`a`.`invoiceDate` AS `transDate` from (`comp_supplier_invoice` `a` join `supplier` `b`) where (`a`.`supplierID` = `b`.`ID`) */;

--
-- Final view structure for view `view_serial_comp_cash_sales`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_cash_sales`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_cash_sales` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_cash_sales` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 121))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_delivery_order`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_delivery_order`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_delivery_order` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_delivery_order` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 49))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_gst_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_gst_transaction`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_gst_transaction` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_gst_transaction` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 118))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_historical_customer_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_historical_customer_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_historical_customer_invoice` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_historical_customer_invoice` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 41))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_historical_supplier_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_historical_supplier_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_historical_supplier_invoice` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_historical_supplier_invoice` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 41))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_location_transfer`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_location_transfer`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_location_transfer` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_location_transfer` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 46))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_payment`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_payment` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_payment` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 44))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_payment_others`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_payment_others`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_payment_others` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_payment_others` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 55))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_purchase_order`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_purchase_order`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_purchase_order` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`po`.`serialNo`) from `comp_purchase_order` `po` where (`c`.`ID` = `po`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 40))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_quotation`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_quotation`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_quotation` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_quotation` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 47))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_receive_item`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_item`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_receive_item` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_receive_item` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 54))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_receive_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_payment`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_receive_payment` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_receive_payment` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 53))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_receive_payment_others`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_receive_payment_others`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_receive_payment_others` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_receive_payment_others` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 56))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_sales_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_creditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_sales_creditnote` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_sales_creditnote` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 52))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_sales_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_debitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_sales_debitnote` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_sales_debitnote` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 51))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_sales_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_sales_invoice` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_sales_invoice` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 50))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_sales_order`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_sales_order`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_sales_order` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_sales_order` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 48))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_supplier_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_creditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_supplier_creditnote` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_supplier_creditnote` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 43))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_supplier_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_debitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_supplier_debitnote` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_supplier_debitnote` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 42))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_serial_comp_supplier_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_serial_comp_supplier_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_serial_comp_supplier_invoice` AS select `c`.`ID` AS `companyID`,ifnull(((select max(`t`.`serialNo`) from `comp_supplier_invoice` `t` where (`c`.`ID` = `t`.`companyID`)) + 1),ifnull((select `frm`.`formInitialNo` from `comp_form_control` `frm` where ((`frm`.`companyID` = `c`.`ID`) and (`frm`.`formID` = 41))),1)) AS `nextSerialNo` from `company` `c` */;

--
-- Final view structure for view `view_supplier_aging`
--

/*!50001 DROP VIEW IF EXISTS `view_supplier_aging`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_supplier_aging` AS select `a`.`companyID` AS `companyID`,`a`.`ID` AS `supplierID`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 0) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 0) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 0) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `current`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 1) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 1) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 1) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month1`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 2) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 2) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 2) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month2`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 3) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 3) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 3) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month3`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 4) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 4) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 4) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month4`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 5) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 5) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 5) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month5`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 6) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 6) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 6) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month6`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 7) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 7) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 7) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month7`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 8) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 8) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 8) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month8`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 9) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 9) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 9) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month9`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) = 10) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) = 10) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) = 10) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month10`,((ifnull((select sum(`comp_supplier_invoice`.`totalPayable`) from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_invoice`.`invoiceDate`,now()) > 10) and (`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0))),0) + ifnull((select sum(`comp_supplier_creditnote`.`total`) from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`companyID` = `a`.`companyID`) and (`comp_supplier_creditnote`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_supplier_creditnote`.`creditNoteDate`,now()) > 10) and (`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0))),0)) + ifnull((select sum(`comp_historical_supplier_invoice`.`totalPayable`) from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`companyID` = `a`.`companyID`) and (`comp_historical_supplier_invoice`.`supplierID` = `a`.`ID`) and (timestampdiff(MONTH,`comp_historical_supplier_invoice`.`invoiceDate`,now()) > 10) and (`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0))),0)) AS `month11` from `supplier` `a` */;

--
-- Final view structure for view `view_supplier_statement`
--

/*!50001 DROP VIEW IF EXISTS `view_supplier_statement`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_supplier_statement` AS select `comp_supplier_invoice`.`ID` AS `ID`,`comp_supplier_invoice`.`ID` AS `parent`,`comp_supplier_invoice`.`companyID` AS `companyID`,`comp_supplier_invoice`.`supplierID` AS `supplierID`,'Invoice' AS `transType`,`comp_supplier_invoice`.`invoiceDate` AS `transDate`,`comp_supplier_invoice`.`supplierInvoiceNo` AS `refNo`,concat(concat(concat(`comp_supplier_invoice`.`formNo`,'['),convert(lpad(`comp_supplier_invoice`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`comp_supplier_invoice`.`totalAmount` AS `cr`,1 AS `seq` from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0)) union select `a`.`ID` AS `ID`,`a`.`supplierInvoiceID` AS `parent`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,'DebitNote' AS `transType`,`a`.`debitNoteDate` AS `transDate`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `refno`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`totalAmount` AS `dr`,NULL AS `cr`,2 AS `seq` from (`comp_supplier_debitnote` `a` join `comp_supplier_invoice` `b`) where ((`a`.`updateAble` = 0) and (`a`.`is_delete` = 0) and (`a`.`supplierInvoiceID` = `b`.`ID`)) union select `a`.`ID` AS `ID`,`a`.`supplierInvoiceID` AS `parent`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,'CreditNote' AS `transType`,`a`.`creditNoteDate` AS `transDate`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `refno`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`a`.`totalAmount` AS `cr`,3 AS `seq` from (`comp_supplier_creditnote` `a` join `comp_supplier_invoice` `b`) where ((`a`.`updateAble` = 0) and (`a`.`is_delete` = 0) and (`a`.`supplierInvoiceID` = `b`.`ID`)) union select `b`.`ID` AS `ID`,NULL AS `parent`,`b`.`companyID` AS `companyID`,`b`.`supplierID` AS `supplierID`,if((`b`.`updateAble` = 0),'Payment','** Payment') AS `transType`,`b`.`paymentDate` AS `transDate`,`b`.`referenceNo` AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`b`.`amountPaid` AS `dr`,NULL AS `cr`,4 AS `seq` from `comp_payment` `b` where (`b`.`is_delete` = 0) union select `b`.`ID` AS `ID`,NULL AS `parent`,`b`.`companyID` AS `companyID`,`b`.`supplierID` AS `supplierID`,'Discount' AS `transType`,`b`.`paymentDate` AS `transDate`,`b`.`referenceNo` AS `refNo`,concat(concat(concat(`b`.`formNo`,'['),convert(lpad(`b`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`b`.`totalDiscount` AS `dr`,NULL AS `cr`,4 AS `seq` from `comp_payment` `b` where ((`b`.`updateAble` = 0) and (`b`.`is_delete` = 0)) union select `comp_historical_supplier_invoice`.`ID` AS `ID`,`comp_historical_supplier_invoice`.`ID` AS `parent`,`comp_historical_supplier_invoice`.`companyID` AS `companyID`,`comp_historical_supplier_invoice`.`supplierID` AS `supplierID`,'Historical Invoice' AS `transType`,`comp_historical_supplier_invoice`.`invoiceDate` AS `transDate`,`comp_historical_supplier_invoice`.`supplierInvoiceNo` AS `refNo`,concat(concat(concat(`comp_historical_supplier_invoice`.`formNo`,'['),convert(lpad(`comp_historical_supplier_invoice`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,NULL AS `dr`,`comp_historical_supplier_invoice`.`totalAmount` AS `cr`,1 AS `seq` from `comp_historical_supplier_invoice` where ((`comp_historical_supplier_invoice`.`updateAble` = 0) and (`comp_historical_supplier_invoice`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_suppliercreditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_suppliercreditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_suppliercreditnote` AS select `si`.`ID` AS `invoiceDetailID`,`si`.`umID` AS `invoiceUm`,`si`.`ID` AS `ID`,`si`.`invoiceID` AS `invoiceID`,`si`.`receiveID` AS `receiveID`,`si`.`lineNo` AS `lineNo`,`si`.`itemID` AS `itemID`,`si`.`itemname` AS `itemname`,`si`.`itemdescription` AS `itemdescription`,`si`.`umID` AS `umID`,`si`.`quantity` AS `quantity`,`si`.`unitPrice` AS `unitPrice`,`si`.`amountExcludedTax` AS `amountExcludedTax`,`si`.`taxID` AS `taxID`,`si`.`taxRate` AS `taxRate`,`si`.`taxAmount` AS `taxAmount`,`si`.`amountIncludedTax` AS `amountIncludedTax`,`si`.`accountID` AS `accountID`,`si`.`createdBy` AS `createdBy`,`si`.`createdTS` AS `createdTS`,`si`.`updatedBy` AS `updatedBy`,`si`.`updatedTS` AS `updatedTS`,((`si`.`quantity` - ifnull((select sum(`dnd`.`quantity`) from `comp_supplier_debitnote_detail` `dnd` where (`si`.`ID` = `dnd`.`invoiceDetailID`)),0)) + ifnull((select sum(`scd`.`quantity`) from `comp_supplier_creditnote_detail` `scd` where (`si`.`ID` = `scd`.`invoiceDetailID`)),0)) AS `exactQty`,`_sys_um`.`code` AS `unitOfMeasure`,`si`.`receiveID` AS `receiveDetailID`,`tax_master`.`code` AS `code`,`item`.`itemCode` AS `itemCode`,`item`.`name` AS `name`,`si`.`itemdescription` AS `description` from (((`comp_supplier_invoice_detail` `si` left join `tax_master` on((`tax_master`.`ID` = `si`.`taxID`))) left join `item` on((`si`.`itemID` = `item`.`ID`))) left join `_sys_um` on((`_sys_um`.`fldid` = `si`.`umID`))) */;

--
-- Final view structure for view `view_supplierdebitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_supplierdebitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_supplierdebitnote` AS select `si`.`ID` AS `invoiceDetailID`,`si`.`ID` AS `ID`,`si`.`invoiceID` AS `invoiceID`,`si`.`receiveID` AS `receiveID`,`si`.`lineNo` AS `lineNo`,`si`.`itemID` AS `itemID`,`si`.`itemname` AS `itemname`,`si`.`itemdescription` AS `itemdescription`,`si`.`umID` AS `umID`,`si`.`quantity` AS `quantity`,`si`.`unitPrice` AS `unitPrice`,`si`.`amountExcludedTax` AS `amountExcludedTax`,`si`.`taxID` AS `taxID`,`si`.`taxRate` AS `taxRate`,`si`.`taxAmount` AS `taxAmount`,`si`.`amountIncludedTax` AS `amountIncludedTax`,`si`.`accountID` AS `accountID`,`si`.`createdBy` AS `createdBy`,`si`.`createdTS` AS `createdTS`,`si`.`updatedBy` AS `updatedBy`,`si`.`updatedTS` AS `updatedTS`,`_sys_um`.`code` AS `unitOfMeasure`,`si`.`receiveID` AS `receiveDetailID`,`tax_master`.`code` AS `code`,`item`.`itemCode` AS `itemCode`,`item`.`name` AS `name`,`si`.`itemdescription` AS `description`,((`si`.`quantity` - ifnull((select sum(`dnd`.`quantity`) from `comp_supplier_debitnote_detail` `dnd` where (`si`.`ID` = `dnd`.`invoiceDetailID`)),0)) + ifnull((select sum(`scd`.`quantity`) from `comp_supplier_creditnote_detail` `scd` where (`si`.`ID` = `scd`.`invoiceDetailID`)),0)) AS `exactQty` from (((`comp_supplier_invoice_detail` `si` left join `tax_master` on((`tax_master`.`ID` = `si`.`taxID`))) left join `item` on((`si`.`itemID` = `item`.`ID`))) left join `_sys_um` on((`_sys_um`.`fldid` = `si`.`umID`))) */;

--
-- Final view structure for view `view_total_comp_sales_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_creditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_total_comp_sales_creditnote` AS select distinct `a`.`ID` AS `ID`,((select ifnull(sum(`comp_sales_creditnote_charges`.`taxAmount`),0) from `comp_sales_creditnote_charges` where (`comp_sales_creditnote_charges`.`creditNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_sales_creditnote_detail`.`taxAmount`),0) from `comp_sales_creditnote_detail` where (`comp_sales_creditnote_detail`.`creditnoteID` = `a`.`ID`))) AS `totalTaxAmount`,((select ifnull(sum(`comp_sales_creditnote_detail`.`amountIncludedTax`),0) from `comp_sales_creditnote_detail` where (`comp_sales_creditnote_detail`.`creditnoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_sales_creditnote_charges`.`amountIncludedTax`),0) from `comp_sales_creditnote_charges` where (`comp_sales_creditnote_charges`.`creditNoteID` = `a`.`ID`))) AS `totalAmount` from `comp_sales_creditnote` `a` group by `a`.`ID` */;

--
-- Final view structure for view `view_total_comp_sales_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_debitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_total_comp_sales_debitnote` AS select distinct `a`.`ID` AS `ID`,((select ifnull(sum(`comp_sales_debitnote_charges`.`taxAmount`),0) from `comp_sales_debitnote_charges` where (`comp_sales_debitnote_charges`.`debitNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_sales_debitnote_detail`.`taxAmount`),0) from `comp_sales_debitnote_detail` where (`comp_sales_debitnote_detail`.`debitnoteID` = `a`.`ID`))) AS `totalTaxAmount`,((select ifnull(sum(`comp_sales_debitnote_charges`.`amountIncludedTax`),0) from `comp_sales_debitnote_charges` where (`comp_sales_debitnote_charges`.`debitNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_sales_debitnote_detail`.`amountIncludedTax`),0) from `comp_sales_debitnote_detail` where (`comp_sales_debitnote_detail`.`debitnoteID` = `a`.`ID`))) AS `totalAmount` from `comp_sales_debitnote` `a` group by `a`.`ID` */;

--
-- Final view structure for view `view_total_comp_sales_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_sales_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_total_comp_sales_invoice` AS select distinct `a`.`ID` AS `ID`,((select ifnull(sum(`comp_sales_invoice_charges`.`taxAmount`),0) from `comp_sales_invoice_charges` where (`comp_sales_invoice_charges`.`invoiceID` = `a`.`ID`)) + (select ifnull(sum(`comp_sales_invoice_detail`.`taxAmount`),0) from `comp_sales_invoice_detail` where (`comp_sales_invoice_detail`.`invoiceID` = `a`.`ID`))) AS `totalTaxAmount`,((select ifnull(sum(`comp_sales_invoice_charges`.`amountIncludedTax`),0) from `comp_sales_invoice_charges` where (`comp_sales_invoice_charges`.`invoiceID` = `a`.`ID`)) + (select ifnull(sum(`comp_sales_invoice_detail`.`amountIncludedTax`),0) from `comp_sales_invoice_detail` where (`comp_sales_invoice_detail`.`invoiceID` = `a`.`ID`))) AS `totalAmount` from `comp_sales_invoice` `a` group by `a`.`ID` */;

--
-- Final view structure for view `view_total_comp_supplier_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_creditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_total_comp_supplier_creditnote` AS select distinct `a`.`ID` AS `ID`,((select ifnull(sum(`comp_supplier_creditnote_charges`.`taxAmount`),0) from `comp_supplier_creditnote_charges` where (`comp_supplier_creditnote_charges`.`creditNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_supplier_creditnote_detail`.`taxAmount`),0) from `comp_supplier_creditnote_detail` where (`comp_supplier_creditnote_detail`.`creditnoteID` = `a`.`ID`))) AS `totalTaxAmount`,((select ifnull(sum(`comp_supplier_creditnote_charges`.`amountIncludedTax`),0) from `comp_supplier_creditnote_charges` where (`comp_supplier_creditnote_charges`.`creditNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_supplier_creditnote_detail`.`amountIncludedTax`),0) from `comp_supplier_creditnote_detail` where (`comp_supplier_creditnote_detail`.`creditnoteID` = `a`.`ID`))) AS `totalAmount` from `comp_supplier_creditnote` `a` group by `a`.`ID` */;

--
-- Final view structure for view `view_total_comp_supplier_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_debitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_total_comp_supplier_debitnote` AS select distinct `a`.`ID` AS `ID`,((select ifnull(sum(`comp_supplier_debitnote_charges`.`taxAmount`),0) from `comp_supplier_debitnote_charges` where (`comp_supplier_debitnote_charges`.`debitNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_supplier_debitnote_detail`.`taxAmount`),0) from `comp_supplier_debitnote_detail` where (`comp_supplier_debitnote_detail`.`debitnoteID` = `a`.`ID`))) AS `totalTaxAmount`,((select ifnull(sum(`comp_supplier_debitnote_charges`.`amountIncludedTax`),0) from `comp_supplier_debitnote_charges` where (`comp_supplier_debitnote_charges`.`debitNoteID` = `a`.`ID`)) + (select ifnull(sum(`comp_supplier_debitnote_detail`.`amountIncludedTax`),0) from `comp_supplier_debitnote_detail` where (`comp_supplier_debitnote_detail`.`debitnoteID` = `a`.`ID`))) AS `totalAmount` from `comp_supplier_debitnote` `a` group by `a`.`ID` */;

--
-- Final view structure for view `view_total_comp_supplier_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_total_comp_supplier_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_total_comp_supplier_invoice` AS select distinct `a`.`ID` AS `ID`,((select ifnull(sum(`comp_supplier_invoice_charges`.`taxAmount`),0) from `comp_supplier_invoice_charges` where (`comp_supplier_invoice_charges`.`invoiceID` = `a`.`ID`)) + (select ifnull(sum(`comp_supplier_invoice_detail`.`taxAmount`),0) from `comp_supplier_invoice_detail` where (`comp_supplier_invoice_detail`.`invoiceID` = `a`.`ID`))) AS `totalTaxAmount`,((select ifnull(sum(`comp_supplier_invoice_charges`.`amountIncludedTax`),0) from `comp_supplier_invoice_charges` where (`comp_supplier_invoice_charges`.`invoiceID` = `a`.`ID`)) + (select ifnull(sum(`comp_supplier_invoice_detail`.`amountIncludedTax`),0) from `comp_supplier_invoice_detail` where (`comp_supplier_invoice_detail`.`invoiceID` = `a`.`ID`))) AS `totalAmount` from `comp_supplier_invoice` `a` group by `a`.`ID` */;

--
-- Final view structure for view `view_transaction_summary`
--

/*!50001 DROP VIEW IF EXISTS `view_transaction_summary`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_transaction_summary` AS select 'comp_purchase_order' AS `tableName`,100 AS `transID`,`comp_purchase_order`.`companyID` AS `companyid`,date_format(`comp_purchase_order`.`poDate`,'%Y') AS `year`,count(if((month(`comp_purchase_order`.`poDate`) = 1),1,NULL)) AS `Jan`,count(if((month(`comp_purchase_order`.`poDate`) = 2),1,NULL)) AS `Feb`,count(if((month(`comp_purchase_order`.`poDate`) = 3),1,NULL)) AS `Mar`,count(if((month(`comp_purchase_order`.`poDate`) = 4),1,NULL)) AS `Apr`,count(if((month(`comp_purchase_order`.`poDate`) = 5),1,NULL)) AS `may`,count(if((month(`comp_purchase_order`.`poDate`) = 6),1,NULL)) AS `Jun`,count(if((month(`comp_purchase_order`.`poDate`) = 7),1,NULL)) AS `Jul`,count(if((month(`comp_purchase_order`.`poDate`) = 8),1,NULL)) AS `Aug`,count(if((month(`comp_purchase_order`.`poDate`) = 9),1,NULL)) AS `Sept`,count(if((month(`comp_purchase_order`.`poDate`) = 10),1,NULL)) AS `Oct`,count(if((month(`comp_purchase_order`.`poDate`) = 11),1,NULL)) AS `Nov`,count(if((month(`comp_purchase_order`.`poDate`) = 12),1,NULL)) AS `Dec` from `comp_purchase_order` where ((`comp_purchase_order`.`updateAble` = 0) and (`comp_purchase_order`.`is_delete` = 0)) group by `comp_purchase_order`.`companyID`,`year` union select 'comp_receive_item' AS `comp_receive_item`,200 AS `200`,`comp_receive_item`.`companyID` AS `companyid`,date_format(`comp_receive_item`.`deliveryDate`,'%Y') AS `year`,count(if((month(`comp_receive_item`.`deliveryDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_receive_item`.`deliveryDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_receive_item`.`deliveryDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_receive_item`.`deliveryDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_receive_item`.`deliveryDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_receive_item`.`deliveryDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_receive_item`.`deliveryDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_receive_item`.`deliveryDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_receive_item`.`deliveryDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_receive_item`.`deliveryDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_receive_item`.`deliveryDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_receive_item`.`deliveryDate`) = 12),1,NULL)) AS `12` from `comp_receive_item` where ((`comp_receive_item`.`updateAble` = 0) and (`comp_receive_item`.`isDelete` = 0)) group by `comp_receive_item`.`companyID`,`year` union select 'comp_supplier_invoice' AS `comp_supplier_invoice`,300 AS `300`,`comp_supplier_invoice`.`companyID` AS `companyid`,date_format(`comp_supplier_invoice`.`invoiceDate`,'%Y') AS `year`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_supplier_invoice`.`invoiceDate`) = 12),1,NULL)) AS `12` from `comp_supplier_invoice` where ((`comp_supplier_invoice`.`updateAble` = 0) and (`comp_supplier_invoice`.`is_delete` = 0)) group by `comp_supplier_invoice`.`companyID`,`year` union select 'comp_supplier_debitNote' AS `comp_supplier_debitNote`,400 AS `400`,`comp_supplier_debitnote`.`companyID` AS `companyid`,date_format(`comp_supplier_debitnote`.`debitNoteDate`,'%Y') AS `year`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_supplier_debitnote`.`debitNoteDate`) = 12),1,NULL)) AS `12` from `comp_supplier_debitnote` where ((`comp_supplier_debitnote`.`updateAble` = 0) and (`comp_supplier_debitnote`.`is_delete` = 0)) group by `comp_supplier_debitnote`.`companyID`,`year` union select 'comp_supplier_creditNote' AS `comp_supplier_creditNote`,500 AS `500`,`comp_supplier_creditnote`.`companyID` AS `companyid`,date_format(`comp_supplier_creditnote`.`creditNoteDate`,'%Y') AS `year`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_supplier_creditnote`.`creditNoteDate`) = 12),1,NULL)) AS `12` from `comp_supplier_creditnote` where ((`comp_supplier_creditnote`.`updateAble` = 0) and (`comp_supplier_creditnote`.`is_delete` = 0)) group by `comp_supplier_creditnote`.`companyID`,`year` union select 'comp_payment' AS `comp_payment`,600 AS `600`,`comp_payment`.`companyID` AS `companyid`,date_format(`comp_payment`.`paymentDate`,'%Y') AS `year`,count(if((month(`comp_payment`.`paymentDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_payment`.`paymentDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_payment`.`paymentDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_payment`.`paymentDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_payment`.`paymentDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_payment`.`paymentDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_payment`.`paymentDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_payment`.`paymentDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_payment`.`paymentDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_payment`.`paymentDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_payment`.`paymentDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_payment`.`paymentDate`) = 12),1,NULL)) AS `12` from `comp_payment` where ((`comp_payment`.`updateAble` = 0) and (`comp_payment`.`is_delete` = 0)) group by `comp_payment`.`companyID`,`year` union select 'comp_payment_others' AS `comp_payment_others`,700 AS `700`,`comp_payment_others`.`companyID` AS `companyid`,date_format(`comp_payment_others`.`paymentDate`,'%Y') AS `year`,count(if((month(`comp_payment_others`.`paymentDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_payment_others`.`paymentDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_payment_others`.`paymentDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_payment_others`.`paymentDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_payment_others`.`paymentDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_payment_others`.`paymentDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_payment_others`.`paymentDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_payment_others`.`paymentDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_payment_others`.`paymentDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_payment_others`.`paymentDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_payment_others`.`paymentDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_payment_others`.`paymentDate`) = 12),1,NULL)) AS `12` from `comp_payment_others` where ((`comp_payment_others`.`updateAble` = 0) and (`comp_payment_others`.`is_delete` = 0) and (`comp_payment_others`.`otherPaymentType` = 1)) group by `comp_payment_others`.`companyID`,`year` union select 'comp_payment_others' AS `comp_payment_others`,750 AS `750`,`comp_payment_others`.`companyID` AS `companyid`,date_format(`comp_payment_others`.`paymentDate`,'%Y') AS `year`,count(if((month(`comp_payment_others`.`paymentDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_payment_others`.`paymentDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_payment_others`.`paymentDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_payment_others`.`paymentDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_payment_others`.`paymentDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_payment_others`.`paymentDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_payment_others`.`paymentDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_payment_others`.`paymentDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_payment_others`.`paymentDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_payment_others`.`paymentDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_payment_others`.`paymentDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_payment_others`.`paymentDate`) = 12),1,NULL)) AS `12` from `comp_payment_others` where ((`comp_payment_others`.`updateAble` = 0) and (`comp_payment_others`.`is_delete` = 0) and (`comp_payment_others`.`otherPaymentType` = 0)) group by `comp_payment_others`.`companyID`,`year` union select 'comp_sales_order' AS `comp_sales_order`,800 AS `800`,`comp_sales_order`.`companyID` AS `companyid`,date_format(`comp_sales_order`.`salesOrderDate`,'%Y') AS `year`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_sales_order`.`salesOrderDate`) = 12),1,NULL)) AS `12` from `comp_sales_order` where (`comp_sales_order`.`is_delete` = 0) group by `comp_sales_order`.`companyID`,`year` union select 'comp_delivery_order' AS `comp_delivery_order`,900 AS `900`,`comp_delivery_order`.`companyID` AS `companyid`,date_format(`comp_delivery_order`.`deliveryOrderDate`,'%Y') AS `year`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_delivery_order`.`deliveryOrderDate`) = 12),1,NULL)) AS `12` from `comp_delivery_order` where ((`comp_delivery_order`.`updateAble` = 0) and (`comp_delivery_order`.`isDelete` = 0)) group by `comp_delivery_order`.`companyID`,`year` union select 'comp_sales_invoice' AS `comp_sales_invoice`,1000 AS `1000`,`comp_sales_invoice`.`companyID` AS `companyid`,date_format(`comp_sales_invoice`.`salesInvoiceDate`,'%Y') AS `year`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_sales_invoice`.`salesInvoiceDate`) = 12),1,NULL)) AS `12` from `comp_sales_invoice` where ((`comp_sales_invoice`.`updateAble` = 0) and (`comp_sales_invoice`.`is_delete` = 0)) group by `comp_sales_invoice`.`companyID`,`year` union select 'comp_sales_debitNote' AS `comp_sales_debitNote`,1100 AS `1100`,`comp_sales_debitnote`.`companyID` AS `companyid`,date_format(`comp_sales_debitnote`.`debitNoteDate`,'%Y') AS `year`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_sales_debitnote`.`debitNoteDate`) = 12),1,NULL)) AS `12` from `comp_sales_debitnote` where ((`comp_sales_debitnote`.`updateAble` = 0) and (`comp_sales_debitnote`.`is_delete` = 0)) group by `comp_sales_debitnote`.`companyID`,`year` union select 'comp_sales_creditNote' AS `comp_sales_creditNote`,1200 AS `1200`,`comp_sales_creditnote`.`companyID` AS `companyid`,date_format(`comp_sales_creditnote`.`creditNoteDate`,'%Y') AS `year`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_sales_creditnote`.`creditNoteDate`) = 12),1,NULL)) AS `12` from `comp_sales_creditnote` where ((`comp_sales_creditnote`.`updateAble` = 0) and (`comp_sales_creditnote`.`is_delete` = 0)) group by `comp_sales_creditnote`.`companyID`,`year` union select 'comp_receive_payment' AS `comp_receive_payment`,1300 AS `1300`,`comp_receive_payment`.`companyID` AS `companyid`,date_format(`comp_receive_payment`.`receivePaymentDate`,'%Y') AS `year`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_receive_payment`.`receivePaymentDate`) = 12),1,NULL)) AS `12` from `comp_receive_payment` where ((`comp_receive_payment`.`updateAble` = 0) and (`comp_receive_payment`.`is_delete` = 0)) group by `comp_receive_payment`.`companyID`,`year` union select 'comp_receive_payment_others' AS `comp_receive_payment_others`,1400 AS `1400`,`comp_receive_payment_others`.`companyID` AS `companyid`,date_format(`comp_receive_payment_others`.`receivePaymentDate`,'%Y') AS `year`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_receive_payment_others`.`receivePaymentDate`) = 12),1,NULL)) AS `12` from `comp_receive_payment_others` where ((`comp_receive_payment_others`.`updateAble` = 0) and (`comp_receive_payment_others`.`is_delete` = 0)) group by `comp_receive_payment_others`.`companyID`,`year` union select 'comp_cash_sales' AS `comp_cash_sales`,1500 AS `1500`,`comp_cash_sales`.`companyID` AS `companyid`,date_format(`comp_cash_sales`.`salesInvoiceDate`,'%Y') AS `year`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 1),1,NULL)) AS `1`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 2),1,NULL)) AS `2`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 3),1,NULL)) AS `3`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 4),1,NULL)) AS `4`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 5),1,NULL)) AS `5`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 6),1,NULL)) AS `6`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 7),1,NULL)) AS `7`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 8),1,NULL)) AS `8`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 9),1,NULL)) AS `9`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 10),1,NULL)) AS `10`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 11),1,NULL)) AS `11`,count(if((month(`comp_cash_sales`.`salesInvoiceDate`) = 12),1,NULL)) AS `12` from `comp_cash_sales` where ((`comp_cash_sales`.`updateAble` = 0) and (`comp_cash_sales`.`is_delete` = 0)) group by `comp_cash_sales`.`companyID`,`year` union select 'comp_journal' AS `comp_journal`,1600 AS `1600`,`comp_journal`.`companyID` AS `companyid`,date_format(`comp_journal`.`effective_date`,'%Y') AS `year`,count(if((month(`comp_journal`.`effective_date`) = 1),1,NULL)) AS `1`,count(if((month(`comp_journal`.`effective_date`) = 2),1,NULL)) AS `2`,count(if((month(`comp_journal`.`effective_date`) = 3),1,NULL)) AS `3`,count(if((month(`comp_journal`.`effective_date`) = 4),1,NULL)) AS `4`,count(if((month(`comp_journal`.`effective_date`) = 5),1,NULL)) AS `5`,count(if((month(`comp_journal`.`effective_date`) = 6),1,NULL)) AS `6`,count(if((month(`comp_journal`.`effective_date`) = 7),1,NULL)) AS `7`,count(if((month(`comp_journal`.`effective_date`) = 8),1,NULL)) AS `8`,count(if((month(`comp_journal`.`effective_date`) = 9),1,NULL)) AS `9`,count(if((month(`comp_journal`.`effective_date`) = 10),1,NULL)) AS `10`,count(if((month(`comp_journal`.`effective_date`) = 11),1,NULL)) AS `11`,count(if((month(`comp_journal`.`effective_date`) = 12),1,NULL)) AS `12` from `comp_journal` where ((`comp_journal`.`is_delete` = 0) and isnull(`comp_journal`.`formNo`)) group by `comp_journal`.`companyID`,`comp_journal`.`year` */;

--
-- Final view structure for view `view_unpost_ap_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_creditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ap_creditnote` AS select `e`.`supplierName` AS `supplier`,`a`.`ID` AS `creditnoteID`,`b`.`lineNo` AS `lineNo`,`c`.`projectID` AS `projectID`,`a`.`supplierInvoiceID` AS `supplierInvoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`c`.`supplierInvoiceNo` AS `supplierInvoiceNo`,if((`c`.`purchaseInvoiceCodeID` = 1),(select `cri`.`locationID` from (`comp_receive_item_detail` `crid` left join `comp_receive_item` `cri` on((`cri`.`ID` = `crid`.`receiveID`))) where (`crid`.`ID` = `g`.`receiveID`)),`c`.`locationID`) AS `locationID`,`b`.`umID` AS `umID`,`b`.`quantity` AS `quantity`,`b`.`itemID` AS `itemID`,concat('[',`d`.`itemCode`,']',`d`.`name`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `item`.`inventoriesID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `drAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crTaxAccountID` from (((`comp_supplier_creditnote` `a` join (`comp_supplier_creditnote_detail` `b` left join `item` `d` on((`b`.`itemID` = `d`.`ID`)))) join (`comp_supplier_invoice` `c` left join `comp_supplier_invoice_detail` `g` on((`c`.`ID` = `g`.`invoiceID`)))) join `supplier` `e`) where ((`a`.`ID` = `b`.`creditnoteID`) and (`a`.`supplierInvoiceID` = `c`.`ID`) and (`e`.`ID` = `a`.`supplierID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `e`.`supplierName` AS `supplier`,`a`.`ID` AS `creditnoteID`,`b`.`lineNo` AS `lineNo`,`c`.`projectID` AS `projectID`,`a`.`supplierInvoiceID` AS `supplierInvoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`c`.`supplierInvoiceNo` AS `supplierInvoiceNo`,`c`.`locationID` AS `locationID`,`b`.`umID` AS `umID`,`b`.`quantity` AS `quantity`,NULL AS `itemID`,`b`.`itemdescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,`b`.`accountNoID` AS `drAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crTaxAccountID` from (((`comp_supplier_creditnote` `a` join `comp_supplier_creditnote_charges` `b`) join `comp_supplier_invoice` `c`) join `supplier` `e`) where ((`a`.`ID` = `b`.`creditNoteID`) and (`a`.`supplierInvoiceID` = `c`.`ID`) and (`e`.`ID` = `a`.`supplierID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_ap_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_debitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ap_debitnote` AS select `e`.`supplierName` AS `supplier`,`a`.`ID` AS `debitnoteID`,`b`.`lineNo` AS `lineNo`,`c`.`projectID` AS `projectID`,4 AS `typeID`,`b`.`ID` AS `typeDetailID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`c`.`supplierInvoiceNo` AS `supplierInvoiceNo`,if((`c`.`purchaseInvoiceCodeID` = 1),(select `cri`.`locationID` from (`comp_receive_item_detail` `crid` left join `comp_receive_item` `cri` on((`cri`.`ID` = `crid`.`receiveID`))) where (`crid`.`ID` = `g`.`receiveID`)),`c`.`locationID`) AS `locationID`,`b`.`umID` AS `umID`,`b`.`quantity` AS `quantity`,`b`.`itemID` AS `itemID`,concat('[',`d`.`itemCode`,']',`b`.`itemdescription`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drAccountID`,(select `item`.`inventoriesID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `crAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID`,NULL AS `cogsAcctID`,NULL AS `inventoriesAcctID` from (((`comp_supplier_debitnote` `a` join (`comp_supplier_debitnote_detail` `b` left join `item` `d` on((`b`.`itemID` = `d`.`ID`)))) join (`comp_supplier_invoice` `c` left join `comp_supplier_invoice_detail` `g` on((`c`.`ID` = `g`.`invoiceID`)))) join `supplier` `e`) where ((`a`.`ID` = `b`.`debitnoteID`) and (`a`.`supplierID` = `e`.`ID`) and (`a`.`supplierInvoiceID` = `c`.`ID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `e`.`supplierName` AS `supplier`,`a`.`ID` AS `debitnoteID`,`b`.`lineNo` AS `lineNo`,`c`.`projectID` AS `projectID`,4 AS `typeID`,`b`.`ID` AS `typeDetailID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`c`.`supplierInvoiceNo` AS `supplierInvoiceNo`,`c`.`locationID` AS `locationID`,`b`.`umID` AS `umID`,`b`.`quantity` AS `quantity`,NULL AS `itemID`,`b`.`itemdescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drAccountID`,`b`.`accountNoID` AS `crAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID`,NULL AS `cogsAcctID`,NULL AS `inventoriesAcctID` from (((`comp_supplier_debitnote` `a` join `comp_supplier_debitnote_charges` `b`) join `comp_supplier_invoice` `c`) join `supplier` `e`) where ((`a`.`ID` = `b`.`debitNoteID`) and (`a`.`supplierID` = `e`.`ID`) and (`a`.`supplierInvoiceID` = `c`.`ID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_ap_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ap_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ap_invoice` AS select `d`.`supplierName` AS `supplier`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`b`.`lineNo` AS `lineNo`,`b`.`itemID` AS `itemID`,concat('[',`c`.`itemCode`,']',`b`.`itemname`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'unInvoiceAP'))) AS `drAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crTaxAccountID` from (((`comp_supplier_invoice` `a` left join `comp_supplier_invoice_detail` `b` on((`a`.`ID` = `b`.`invoiceID`))) left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) join `supplier` `d` on((`d`.`ID` = `a`.`supplierID`))) where ((`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `d`.`supplierName` AS `supplier`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,(`b`.`lineNo` + (select ifnull(max(`comp_supplier_invoice_detail`.`lineNo`),0) from `comp_supplier_invoice_detail` where (`comp_supplier_invoice_detail`.`invoiceID` = `a`.`ID`))) AS `lineNo`,NULL AS `itemID`,`b`.`chargeDescription` AS `itemname`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,`b`.`accountNoID` AS `drAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `crTaxAccountID` from ((`comp_supplier_invoice` `a` join `comp_supplier_invoice_charges` `b` on((`a`.`ID` = `b`.`invoiceID`))) left join `supplier` `d` on((`d`.`ID` = `a`.`supplierID`))) where ((`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_ar_creditnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_creditnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ar_creditnote` AS select `f`.`customerName` AS `customer`,`a`.`salesInvoiceID` AS `salesinvoiceID`,`a`.`ID` AS `creditnoteID`,`a`.`projectID` AS `projectID`,0 AS `typeID`,`b`.`ID` AS `typeDetailID`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,if((`c`.`invoiceCodeID` = 1),(select `dord`.`locationID` from (`comp_delivery_detail` `ddet` left join `comp_delivery_order` `dord` on((`dord`.`ID` = `ddet`.`deliveryID`))) where (`ddet`.`ID` = `g`.`doID`)),`c`.`locationID`) AS `locationID`,concat(`c`.`formNo`,'[',convert(lpad(`c`.`serialNo`,8,'0') using latin1),']') AS `salesInvoiceNo`,`b`.`lineNo` AS `lineNo`,`b`.`itemID` AS `itemID`,`b`.`umID` AS `umID`,`b`.`quantity` AS `quantity`,concat('[',`d`.`itemCode`,']',`b`.`itemname`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `item`.`incomeID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `drAccountID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `crTaxAccountID`,(select `item`.`cogsID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `cogsAcctID`,(select `item`.`inventoriesID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `inventoriesAcctID` from ((((((`comp_sales_creditnote` `a` left join `comp_sales_creditnote_detail` `b` on((`a`.`ID` = `b`.`creditnoteID`))) left join `item` `d` on((`b`.`itemID` = `d`.`ID`))) left join `comp_sales_invoice` `c` on((`c`.`ID` = `a`.`salesInvoiceID`))) left join `comp_sales_invoice_detail` `g` on((`c`.`ID` = `g`.`invoiceID`))) join `customer` `f`) join `comp_control_acct_setup` `e`) where ((`a`.`ID` = `b`.`creditnoteID`) and (`a`.`customerID` = `f`.`ID`) and (`e`.`companyID` = `a`.`companyID`) and (`e`.`accountCode` = 'rcvacct') and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `f`.`customerName` AS `customer`,`a`.`salesInvoiceID` AS `salesinvoiceID`,`a`.`ID` AS `creditnoteID`,`c`.`projectID` AS `projectID`,0 AS `typeID`,`b`.`ID` AS `typeDetailID`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,`c`.`locationID` AS `locationID`,concat(`c`.`formNo`,'[',convert(lpad(`c`.`serialNo`,8,'0') using latin1),']') AS `salesInvoiceNo`,`b`.`lineNo` AS `lineNo`,NULL AS `itemID`,NULL AS `umID`,1 AS `quantity`,`b`.`chargeDescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,`b`.`accountNoID` AS `drAccountID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `crTaxAccountID`,NULL AS `cogsAcctID`,NULL AS `inventoriesAcctID` from ((((`comp_sales_creditnote` `a` left join `comp_sales_invoice` `c` on((`c`.`ID` = `a`.`salesInvoiceID`))) join `customer` `f`) join `comp_control_acct_setup` `e`) join `comp_sales_creditnote_charges` `b`) where ((`a`.`ID` = `b`.`creditNoteID`) and (`a`.`customerID` = `f`.`ID`) and (`e`.`companyID` = `a`.`companyID`) and (`e`.`accountCode` = 'rcvacct') and (`a`.`ID` = `b`.`creditNoteID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_ar_debitnote`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_debitnote`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ar_debitnote` AS select `f`.`customerName` AS `customer`,`a`.`salesInvoiceID` AS `salesinvoiceID`,`a`.`ID` AS `debitnoteID`,`c`.`projectID` AS `projectID`,3 AS `typeID`,`b`.`ID` AS `typeDetailID`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,if((`c`.`invoiceCodeID` = 1),(select `do`.`locationID` from (`comp_delivery_detail` `ddet` left join `comp_delivery_order` `do` on((`do`.`ID` = `ddet`.`deliveryID`))) where (`ddet`.`ID` = `g`.`doID`)),`c`.`locationID`) AS `locationID`,concat(`c`.`formNo`,'[',convert(lpad(`c`.`serialNo`,8,'0') using latin1),']') AS `salesInvoiceNo`,`b`.`lineNo` AS `lineNo`,`b`.`itemID` AS `itemID`,`b`.`umID` AS `umID`,`b`.`quantity` AS `quantity`,concat('[',`d`.`itemCode`,']',`b`.`itemname`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,`c`.`currencyID` AS `currencyID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `drAccountID`,(select `item`.`incomeID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `crAccountID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID`,`d`.`cogsID` AS `cogsAcctID`,`d`.`inventoriesID` AS `inventoriesAcctID` from ((((((`comp_sales_debitnote` `a` join `comp_sales_debitnote_detail` `b` on((`a`.`ID` = `b`.`debitnoteID`))) left join `item` `d` on((`b`.`itemID` = `d`.`ID`))) left join `comp_sales_invoice` `c` on((`c`.`ID` = `a`.`salesInvoiceID`))) left join `comp_sales_invoice_detail` `g` on((`c`.`ID` = `g`.`invoiceID`))) join `customer` `f`) join `comp_control_acct_setup` `e`) where ((`a`.`ID` = `b`.`debitnoteID`) and (`a`.`customerID` = `f`.`ID`) and (`e`.`companyID` = `a`.`companyID`) and (`e`.`accountCode` = 'rcvacct') and (`a`.`ID` = `b`.`debitnoteID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `f`.`customerName` AS `customer`,`a`.`salesInvoiceID` AS `salesinvoiceID`,`a`.`ID` AS `debitnoteID`,`c`.`projectID` AS `projectID`,0 AS `typeID`,`b`.`ID` AS `typeDetailID`,concat(`a`.`formNo`,'[',convert(lpad(`a`.`serialNo`,8,'0') using latin1),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,`c`.`locationID` AS `locationID`,concat(`c`.`formNo`,'[',convert(lpad(`c`.`serialNo`,8,'0') using latin1),']') AS `salesInvoiceNo`,`b`.`lineNo` AS `lineNo`,NULL AS `itemID`,NULL AS `umID`,1 AS `quantity`,`b`.`chargeDescription` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,`c`.`currencyID` AS `currencyID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `drAccountID`,`b`.`accountNoID` AS `crAccountID`,ifnull(`f`.`linkedAPAccountID`,`e`.`accountID`) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID`,NULL AS `cogsAcctID`,NULL AS `inventoriesAcctID` from ((((`comp_sales_debitnote` `a` left join `comp_sales_invoice` `c` on((`c`.`ID` = `a`.`salesInvoiceID`))) join `customer` `f`) join `comp_control_acct_setup` `e`) join `comp_sales_debitnote_charges` `b`) where ((`a`.`ID` = `b`.`debitNoteID`) and (`a`.`customerID` = `f`.`ID`) and (`e`.`companyID` = `a`.`companyID`) and (`e`.`accountCode` = 'rcvacct') and (`a`.`ID` = `b`.`debitNoteID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_ar_invoice`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_invoice`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ar_invoice` AS select `a`.`projectID` AS `projectID`,`e`.`customerName` AS `customer`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,`b`.`itemID` AS `itemID`,`b`.`lineNo` AS `lineNo`,concat('[',`c`.`itemCode`,']',`c`.`description`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `drAccountID`,(select `item`.`incomeID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `crAccountID`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID` from ((`comp_sales_invoice` `a` join (`comp_sales_invoice_detail` `b` left join `item` `c` on((`b`.`itemID` = `c`.`ID`)))) join `customer` `e`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`customerID` = `e`.`ID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`projectID` AS `projectID`,`e`.`customerName` AS `customer`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,`b`.`itemID` AS `itemID`,`b`.`lineNo` AS `lineNo`,concat('[',`c`.`itemCode`,']',`c`.`description`) AS `itemName`,(select sum((`crid`.`unitPrice` * `crdc`.`qty`)) from (`comp_receive_item_detail` `crid` join `comp_receive_delivery_conn` `crdc`) where ((`crid`.`ID` = `crdc`.`receiveDetailID`) and (`crdc`.`deliveryDetailID` = `do`.`ID`))) AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,NULL AS `taxamount`,(select `item`.`cogsID` from `item` where (`item`.`ID` = `b`.`itemID`)) AS `drAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'uninvoiceAR'))) AS `crAccountID`,NULL AS `drTaxAccountID`,NULL AS `crTaxAccountID` from ((`comp_sales_invoice` `a` join ((`comp_sales_invoice_detail` `b` left join `item` `c` on((`b`.`itemID` = `c`.`ID`))) left join `comp_delivery_detail` `do` on(((`do`.`invoiceID` = `b`.`invoiceID`) and (`do`.`itemID` = `b`.`itemID`) and (`do`.`umID` = `b`.`umID`))))) join `customer` `e`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`customerID` = `e`.`ID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0) and (`a`.`invoiceCodeID` <> 2)) union select `a`.`projectID` AS `projectID`,`e`.`customerName` AS `customer`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,NULL AS `NULL`,`b`.`lineNo` AS `lineNo`,`b`.`chargeDescription` AS `chargedescription`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `drAccountID`,`b`.`accountNoID` AS `crAccountID`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID` from ((`comp_sales_invoice` `a` join `comp_sales_invoice_charges` `b`) join `customer` `e`) where ((`a`.`ID` = `b`.`invoiceID`) and (`e`.`ID` = `a`.`customerID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`projectID` AS `projectID`,`e`.`customerName` AS `customer`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,NULL AS `NULL`,`b`.`lineNo` AS `lineNo`,'comission' AS `itemName`,((sum(`b`.`amountExcludedTax`) * `d`.`commisionRate`) / 100) AS `comissionAmount`,0 AS `taxID`,0 AS `taxAmount`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'commissionexp'))) AS `drAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'commissionpay'))) AS `crAccountID`,NULL AS `drTaxAccountID`,NULL AS `crTaxAccountID` from (((`comp_sales_invoice` `a` join `comp_sales_invoice_detail` `b`) join `comp_sales_agent` `d`) join `customer` `e`) where ((`a`.`companyID` = `d`.`companyID`) and (`a`.`ID` = `b`.`invoiceID`) and (`a`.`agentID` = `d`.`ID`) and (`a`.`customerID` = `e`.`ID`) and (`a`.`agentID` > 0) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) group by `a`.`ID` union select `a`.`projectID` AS `projectID`,`e`.`customerName` AS `customer`,`a`.`ID` AS `invoiceID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,NULL AS `NULL`,`b`.`lineNo` AS `lineNo`,'wakaf' AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,0 AS `taxID`,0 AS `taxAmount`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'wakafExpense'))) AS `drAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'wakafAcrual'))) AS `crAccountID`,NULL AS `drTaxAccountID`,NULL AS `crTaxAccountID` from ((((`comp_sales_invoice` `a` join `comp_sales_invoice_detail` `b`) join `wakaf_acrual` `c`) join `item` `d`) join `customer` `e`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`customerID` = `e`.`ID`) and (`a`.`companyID` = `c`.`companyID`) and (`b`.`itemID` = `d`.`ID`) and (`d`.`incomeID` = `c`.`salesAccountID`) and (`a`.`salesInvoiceDate` between `c`.`from` and `c`.`to`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_ar_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_ar_payment`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_ar_payment` AS select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,NULL AS `purchaseInvoiceID`,`b`.`customerName` AS `customerName`,0 AS `lineNo`,NULL AS `paymentDetailID`,`a`.`referenceNo` AS `item`,`a`.`bankCharges` AS `amtPaid_amtAppl`,0 AS `discount_bankCharges`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'bankchargesAccount'))) AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `crAccountID`,NULL AS `drDiscountAccountID`,NULL AS `crDiscountAccountID` from (`comp_receive_payment` `a` join `customer` `b`) where ((`a`.`customerID` = `b`.`ID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,`b`.`invoiceID` AS `invoiceID`,`e`.`customerName` AS `customerName`,`b`.`lineNo` AS `lineNo`,`b`.`ID` AS `paymentDetailID`,concat(concat(concat(`d`.`formNo`,'['),convert(lpad(`d`.`serialNo`,8,'0') using latin1)),']') AS `item`,(`b`.`amountApplied` - `b`.`discount`) AS `amtPaid_amtAppl`,`b`.`discount` AS `discount_bankCharges`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drAccountID`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `crAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'saledisacct'))) AS `drDiscountAccountID`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `crDiscountAccountID` from (((`comp_receive_payment` `a` join (`comp_receive_payment_detail` `b` left join `comp_sales_invoice` `d` on((`d`.`ID` = `b`.`invoiceID`)))) join `comp_sales_invoice` `c`) join `customer` `e`) where ((`a`.`customerID` = `e`.`ID`) and (`a`.`ID` = `b`.`receivePaymentID`) and (`c`.`ID` = `b`.`invoiceID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`customerID` AS `customerID`,`b`.`historicalinvoiceID` AS `invoiceID`,`e`.`customerName` AS `customerName`,`b`.`ID` AS `lineNo`,`b`.`ID` AS `paymentDetailID`,concat(concat(concat(`d`.`formNo`,'['),convert(lpad(`d`.`serialNo`,8,'0') using latin1)),']') AS `item`,`b`.`amountApplied` AS `amtPaid_amtAppl`,NULL AS `discount_bankCharges`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drAccountID`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `crAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'saledisacct'))) AS `drDiscountAccountID`,(select `customer`.`linkedAPAccountID` from `customer` where (`customer`.`ID` = `a`.`customerID`)) AS `crDiscountAccountID` from (((`comp_receive_payment` `a` join (`comp_receive_payment_detail_historical_invoice` `b` left join `comp_historical_customer_invoice` `d` on((`d`.`ID` = `b`.`historicalinvoiceID`)))) join `comp_historical_customer_invoice` `c`) join `customer` `e`) where ((`a`.`customerID` = `e`.`ID`) and (`a`.`ID` = `b`.`paymentID`) and (`c`.`ID` = `b`.`historicalinvoiceID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_cash_purchase`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_cash_purchase`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_cash_purchase` AS select `b`.`lineNo` AS `lineNo`,`b`.`quantity` AS `quantity`,`b`.`unitPrice` AS `unitPrice`,`b`.`itemID` AS `itemID`,`b`.`itemdescription` AS `itemdescription`,`b`.`umID` AS `umID`,`a`.`locationID` AS `locationID`,`a`.`ID` AS `othersPaymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`ID`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,NULL AS `supplierID`,NULL AS `purchaseInvoiceID`,`b`.`ID` AS `paymentDetailID`,NULL AS `supplierInvoiceNo`,`b`.`lineNo` AS `ID`,`b`.`itemname` AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedTax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxAmount`,`a`.`projectID` AS `projectID`,`c`.`itemTypeID` AS `itemTypeID`,if((`c`.`itemTypeID` = 23),`c`.`cogsID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'uninvoiceAP')))) AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankId`)) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drDiscountAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankId`)) AS `crDiscountAccountID` from ((`comp_payment_others` `a` join `comp_payment_others_with_item` `b`) left join `item` `c` on((`c`.`ID` = `b`.`itemID`))) where ((`a`.`ID` = `b`.`otherPaymentID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_cash_sale`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_cash_sale`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_cash_sale` AS select `a`.`projectID` AS `projectID`,`a`.`paymentFrom` AS `customer`,`a`.`ID` AS `invoiceID`,5 AS `typeID`,`b`.`ID` AS `typeDetailID`,`a`.`locationID` AS `locationID`,`b`.`quantity` AS `quantity`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`b`.`itemID` AS `itemID`,`b`.`umID` AS `umID`,`b`.`lineNo` AS `lineNo`,`d`.`currencyID` AS `currencyID`,concat('[',`c`.`itemCode`,']',`c`.`description`) AS `itemName`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drAccountID`,`c`.`incomeID` AS `crAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID`,`c`.`cogsID` AS `cogsAcctID`,`c`.`inventoriesID` AS `inventoriesAcctID` from ((`comp_cash_sales` `a` join (`comp_cash_sales_detail` `b` left join `item` `c` on((`b`.`itemID` = `c`.`ID`)))) join `company` `d`) where ((`a`.`ID` = `b`.`invoiceID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0) and (`a`.`companyID` = `d`.`ID`)) */;

--
-- Final view structure for view `view_unpost_do`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_do`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_do` AS select `a`.`ID` AS `deliveryOrderID`,`a`.`customerID` AS `customerID`,NULL AS `projectID`,NULL AS `customer`,`a`.`ID` AS `invoiceID`,1 AS `typeID`,`b`.`ID` AS `typeDetailID`,`a`.`locationID` AS `locationID`,`b`.`quantitySent` AS `quantity`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`b`.`itemID` AS `itemID`,concat('[',`c`.`itemCode`,']',`c`.`description`) AS `itemName`,0 AS `amountExcludedtax`,NULL AS `taxid`,0 AS `taxamount`,NULL AS `drAccountID`,NULL AS `crAccountID`,NULL AS `drTaxAccountID`,NULL AS `crTaxAccountID`,if((`b`.`invoiceID` > 0),`c`.`cogsID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'unInvoiceAR')))) AS `cogsAcctID`,`c`.`inventoriesID` AS `inventoriesAcctID` from (`comp_delivery_order` `a` join (`comp_delivery_detail` `b` left join `item` `c` on((`b`.`itemID` = `c`.`ID`)))) where ((`a`.`ID` = `b`.`deliveryID`) and (`a`.`updateAble` = 1) and (`a`.`isDelete` = 0)) */;

--
-- Final view structure for view `view_unpost_gst_transaction`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_gst_transaction`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_gst_transaction` AS select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,NULL AS `supplierID`,NULL AS `purchaseInvoiceID`,concat(`a`.`Description`,'[',`a`.`vendor_cust_name`,']') AS `supplierName`,0 AS `lineNo`,NULL AS `paymentDetailID`,NULL AS `supplierInvoiceNo`,`a`.`reference` AS `item`,`b`.`taxAmountDr` AS `amtPaid_amtAppl`,0 AS `discount_bankCharges`,`b`.`accountID` AS `drAccountID`,(select `comp_gst_transaction_detail`.`accountID` from `comp_gst_transaction_detail` where ((`comp_gst_transaction_detail`.`gstTransID` = `a`.`ID`) and (`comp_gst_transaction_detail`.`taxAmountCr` > 0))) AS `crAccountID`,NULL AS `drDiscountAccountID`,NULL AS `crDiscountAccountID` from (`comp_gst_transaction` `a` join `comp_gst_transaction_detail` `b`) where ((`a`.`ID` = `b`.`gstTransID`) and (`b`.`taxAmountDr` > 0) and (`a`.`updateAble` = 1) and (`a`.`isDelete` = 0)) */;

--
-- Final view structure for view `view_unpost_other_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_other_payment`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_other_payment` AS select `a`.`ID` AS `othersPaymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,NULL AS `supplierID`,NULL AS `purchaseInvoiceID`,`b`.`ID` AS `paymentDetailID`,NULL AS `supplierInvoiceNo`,`b`.`lineNo` AS `lineNo`,`b`.`itemdescription` AS `itemdescription`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,`b`.`accountID` AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankId`)) AS `crAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `drTaxAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankId`)) AS `crTaxAccountID` from (`comp_payment_others` `a` join `comp_payment_others_without_item` `b`) where ((`a`.`ID` = `b`.`otherPaymentID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_other_receive`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_other_receive`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_other_receive` AS select `a`.`projectID` AS `projectID`,`a`.`receiveFrom` AS `receiveFrom`,`a`.`ID` AS `otherReceiveID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,NULL AS `NULL`,`b`.`description` AS `itemdescription`,`b`.`amountExcludedTax` AS `amountExcludedtax`,`b`.`taxID` AS `taxid`,`b`.`taxAmount` AS `taxamount`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drAccountID`,`b`.`accountNoID` AS `crAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `drTaxAccountID`,(select `tax_master`.`taxAccount` from `tax_master` where (`tax_master`.`ID` = `b`.`taxID`)) AS `crTaxAccountID` from (`comp_receive_payment_others` `a` join `comp_receive_payment_others_detail` `b`) where ((`a`.`ID` = `b`.`receivePaymentOthersID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_payment`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_payment`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_payment` AS select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,NULL AS `purchaseInvoiceID`,`b`.`supplierName` AS `supplierName`,0 AS `lineNo`,NULL AS `paymentDetailID`,NULL AS `supplierInvoiceNo`,`a`.`referenceNo` AS `item`,`a`.`bankCharges` AS `amtPaid_amtAppl`,0 AS `discount_bankCharges`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'bankchargesAccount'))) AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `crAccountID`,NULL AS `drDiscountAccountID`,NULL AS `crDiscountAccountID` from (`comp_payment` `a` join `supplier` `b`) where ((`a`.`supplierID` = `b`.`ID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`b`.`purchaseInvoiceID` AS `purchaseInvoiceID`,`e`.`supplierName` AS `supplierName`,`b`.`lineNo` AS `lineNo`,`b`.`ID` AS `paymentDetailID`,`c`.`supplierInvoiceNo` AS `supplierInvoiceNo`,concat(concat(concat(`d`.`formNo`,'['),convert(lpad(`d`.`serialNo`,8,'0') using latin1)),']') AS `item`,(`b`.`amountApplied` - `b`.`discount`) AS `amtPaid_amtAppl`,`b`.`discount` AS `discount_bankCharges`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `crAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drDiscountAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'payDisc'))) AS `crDiscountAccountID` from (((`comp_payment` `a` join (`comp_payment_detail` `b` left join `comp_supplier_invoice` `d` on((`d`.`ID` = `b`.`purchaseInvoiceID`)))) join `comp_supplier_invoice` `c`) join `supplier` `e`) where ((`a`.`supplierID` = `e`.`ID`) and (`a`.`ID` = `b`.`paymentID`) and (`c`.`ID` = `b`.`purchaseInvoiceID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`b`.`historicalinvoiceID` AS `purchaseInvoiceID`,`e`.`supplierName` AS `supplierName`,`b`.`ID` AS `lineNo`,`b`.`ID` AS `paymentDetailID`,`c`.`supplierInvoiceNo` AS `supplierInvoiceNo`,concat(concat(concat(`d`.`formNo`,'['),convert(lpad(`d`.`serialNo`,8,'0') using latin1)),']') AS `item`,`b`.`amountApplied` AS `amtPaid_amtAppl`,NULL AS `discount_bankCharges`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `crAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drDiscountAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'payDisc'))) AS `crDiscountAccountID` from (((`comp_payment` `a` join (`comp_payment_detail_historical_invoice` `b` left join `comp_historical_supplier_invoice` `d` on((`d`.`ID` = `b`.`historicalinvoiceID`)))) join `comp_historical_supplier_invoice` `c`) join `supplier` `e`) where ((`a`.`supplierID` = `e`.`ID`) and (`a`.`ID` = `b`.`paymentID`) and (`c`.`ID` = `b`.`historicalinvoiceID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) union select `a`.`ID` AS `paymentID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`a`.`companyID` AS `companyID`,`a`.`supplierID` AS `supplierID`,`b`.`creditnoteID` AS `purchaseInvoiceID`,`e`.`supplierName` AS `supplierName`,`b`.`ID` AS `lineNo`,`b`.`ID` AS `paymentDetailID`,`c`.`supplierInvoiceID` AS `supplierInvoiceNo`,concat(concat(concat(`d`.`formNo`,'['),convert(lpad(`d`.`serialNo`,8,'0') using latin1)),']') AS `item`,`b`.`amountApplied` AS `amtPaid_amtAppl`,NULL AS `discount_bankCharges`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drAccountID`,(select `comp_bank`.`linkAccountID` from `comp_bank` where (`comp_bank`.`ID` = `a`.`bankID`)) AS `crAccountID`,(select `supplier`.`linkedAPAccountID` from `supplier` where (`supplier`.`ID` = `a`.`supplierID`)) AS `drDiscountAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'payDisc'))) AS `crDiscountAccountID` from (((`comp_payment` `a` join (`comp_payment_detail_creditnote` `b` left join `comp_supplier_creditnote` `d` on((`d`.`ID` = `b`.`creditnoteID`)))) join `comp_supplier_creditnote` `c`) join `supplier` `e`) where ((`a`.`supplierID` = `e`.`ID`) and (`a`.`ID` = `b`.`paymentID`) and (`c`.`ID` = `b`.`creditnoteID`) and (`a`.`updateAble` = 1) and (`a`.`is_delete` = 0)) */;

--
-- Final view structure for view `view_unpost_receive_item`
--

/*!50001 DROP VIEW IF EXISTS `view_unpost_receive_item`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_unpost_receive_item` AS select `a`.`ID` AS `receiveID`,`a`.`companyID` AS `companyID`,`a`.`locationID` AS `locationID`,`a`.`deliveryDate` AS `transactionDate`,`a`.`supplierID` AS `supplierID`,concat(concat(concat(`a`.`formNo`,'['),convert(lpad(`a`.`serialNo`,8,'0') using latin1)),']') AS `formNo`,`b`.`lineNo` AS `lineNo`,`b`.`itemID` AS `itemID`,concat('[',`c`.`itemCode`,']',`c`.`name`) AS `itemName`,`a`.`exchangeRate` AS `exchangeRate`,`b`.`unitPrice` AS `unitPrice`,`b`.`quantityReceived` AS `quantityReceived`,`b`.`umID` AS `umID`,`b`.`amount` AS `amount`,ifnull((select `item`.`inventoriesID` from `item` where (`item`.`ID` = `b`.`itemID`)),(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'invAcct')))) AS `drAccountID`,(select `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where ((`comp_control_acct_setup`.`companyID` = `a`.`companyID`) and (`comp_control_acct_setup`.`accountCode` = 'unInvoiceAP'))) AS `crAccountID` from ((`comp_receive_item` `a` join `comp_receive_item_detail` `b`) join `item` `c`) where ((`a`.`updateAble` = 1) and (`a`.`ID` = `b`.`receiveID`) and (`b`.`itemID` = `c`.`ID`)) */;

--
-- Final view structure for view `view_wakaf_accrual`
--

/*!50001 DROP VIEW IF EXISTS `view_wakaf_accrual`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_wakaf_accrual` AS select `b`.`companyID` AS `companyID`,`b`.`acctID` AS `acctID`,`b`.`year` AS `year`,sum(`b`.`total`) AS `totalAmount` from (`company` `a` join `comp_acc_det` `b`) where ((`a`.`ID` = `b`.`companyID`) and `b`.`acctID` in (select distinct `comp_control_acct_setup`.`accountID` from `comp_control_acct_setup` where (`comp_control_acct_setup`.`accountCode` = 'wakafAcrual'))) group by `b`.`companyID`,`b`.`acctID`,`b`.`year` */;

--
-- Final view structure for view `view_wakaf_from_profit`
--

/*!50001 DROP VIEW IF EXISTS `view_wakaf_from_profit`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `view_wakaf_from_profit` AS select `a`.`companyID` AS `companyid`,`a`.`year` AS `year`,`c`.`ID` AS `acctType`,sum(`a`.`amountdr`) AS `totalDr`,sum(`a`.`amountcr`) AS `totalCr` from ((`comp_acc_det` `a` join `comp_chart_of_acct` `b`) join `_ref_acct_group` `c`) where ((`b`.`ID` = `a`.`acctID`) and (`c`.`ID` = `b`.`acctGroupID`) and (`c`.`ID` in (3,4))) group by `a`.`companyID`,`a`.`year`,`acctType` */;


